@@ -276,11 +276,13 @@ impl DeviceTrait for Device {
276
276
match & self . 0 {
277
277
None => Ok ( "default" . to_owned ( ) ) ,
278
278
Some ( info) => {
279
- let device_type = device_type_to_str ( info. device_type ) ;
280
279
let name = if info. address . is_empty ( ) {
281
- format ! ( "{}:{}" , info. product_name, device_type)
280
+ format ! ( "{}:{:? }" , info. product_name, info . device_type)
282
281
} else {
283
- format ! ( "{}:{}:{}" , info. product_name, device_type, info. address)
282
+ format ! (
283
+ "{}:{:?}:{}" ,
284
+ info. product_name, info. device_type, info. address
285
+ )
284
286
} ;
285
287
Ok ( name)
286
288
}
@@ -505,40 +507,3 @@ impl StreamTrait for Stream {
505
507
}
506
508
}
507
509
}
508
-
509
- fn device_type_to_str ( audio_device_type : oboe:: AudioDeviceType ) -> & ' static str {
510
- match audio_device_type {
511
- oboe:: AudioDeviceType :: Unknown => "Unknown" ,
512
- oboe:: AudioDeviceType :: AuxLine => "AuxLine" ,
513
- oboe:: AudioDeviceType :: BleBroadcast => "BleBroadcast" ,
514
- oboe:: AudioDeviceType :: BleHeadset => "BleHeadset" ,
515
- oboe:: AudioDeviceType :: BleSpeaker => "BleSpeaker" ,
516
- oboe:: AudioDeviceType :: BluetoothA2DP => "BluetoothA2DP" ,
517
- oboe:: AudioDeviceType :: BluetoothSCO => "BluetoothSCO" ,
518
- oboe:: AudioDeviceType :: BuiltinEarpiece => "BuiltinEarpiece" ,
519
- oboe:: AudioDeviceType :: BuiltinMic => "BuiltinMic" ,
520
- oboe:: AudioDeviceType :: BuiltinSpeaker => "BuiltinSpeaker" ,
521
- oboe:: AudioDeviceType :: BuiltinSpeakerSafe => "BuiltinSpeakerSafe" ,
522
- oboe:: AudioDeviceType :: Bus => "Bus" ,
523
- oboe:: AudioDeviceType :: Dock => "Dock" ,
524
- oboe:: AudioDeviceType :: Fm => "Fm" ,
525
- oboe:: AudioDeviceType :: FmTuner => "FmTuner" ,
526
- oboe:: AudioDeviceType :: Hdmi => "Hdmi" ,
527
- oboe:: AudioDeviceType :: HdmiArc => "HdmiArc" ,
528
- oboe:: AudioDeviceType :: HdmiEarc => "HdmiEarc" ,
529
- oboe:: AudioDeviceType :: HearingAid => "HearingAid" ,
530
- oboe:: AudioDeviceType :: Ip => "Ip" ,
531
- oboe:: AudioDeviceType :: LineAnalog => "LineAnalog" ,
532
- oboe:: AudioDeviceType :: LineDigital => "LineDigital" ,
533
- oboe:: AudioDeviceType :: RemoteSubmix => "RemoteSubmix" ,
534
- oboe:: AudioDeviceType :: Telephony => "Telephony" ,
535
- oboe:: AudioDeviceType :: TvTuner => "TvTuner" ,
536
- oboe:: AudioDeviceType :: UsbAccessory => "UsbAccessory" ,
537
- oboe:: AudioDeviceType :: UsbDevice => "UsbDevice" ,
538
- oboe:: AudioDeviceType :: UsbHeadset => "UsbHeadset" ,
539
- oboe:: AudioDeviceType :: WiredHeadphones => "WiredHeadphones" ,
540
- oboe:: AudioDeviceType :: WiredHeadset => "WiredHeadset" ,
541
- oboe:: AudioDeviceType :: Unsupported => "Unsupported" ,
542
- _ => "NotSpecified" ,
543
- }
544
- }
0 commit comments