@@ -410,8 +410,10 @@ data ControllerDeviceEventData =
410
410
deriving (Eq ,Ord ,Generic ,Show ,Typeable )
411
411
412
412
data AudioDeviceEventData =
413
- AudioDeviceEventData { audioDeviceEventWhich :: ! Word32
414
- -- ^ The audio device ID that reported the event.
413
+ AudioDeviceEventData { audioDeviceEventIsAddition :: ! Bool
414
+ -- ^ If the audio device is an addition, or a removal.
415
+ ,audioDeviceEventWhich :: ! Word32
416
+ -- ^ The audio device ID that reported the event.
415
417
,audioDeviceEventIsCapture :: ! Bool
416
418
-- ^ If the audio device is a capture device.
417
419
}
@@ -651,8 +653,12 @@ convertRaw (Raw.ControllerButtonEvent _ ts a b c) =
651
653
return (Event ts (ControllerButtonEvent (ControllerButtonEventData a b c)))
652
654
convertRaw (Raw. ControllerDeviceEvent _ ts a) =
653
655
return (Event ts (ControllerDeviceEvent (ControllerDeviceEventData a)))
654
- convertRaw (Raw. AudioDeviceEvent _ ts a b) =
655
- return (Event ts (AudioDeviceEvent (AudioDeviceEventData a (b /= 0 ))))
656
+ convertRaw (Raw. AudioDeviceEvent Raw. SDL_AUDIODEVICEADDED ts a b) =
657
+ return (Event ts (AudioDeviceEvent (AudioDeviceEventData True a (b /= 0 ))))
658
+ convertRaw (Raw. AudioDeviceEvent Raw. SDL_AUDIODEVICEREMOVED ts a b) =
659
+ return (Event ts (AudioDeviceEvent (AudioDeviceEventData False a (b /= 0 ))))
660
+ convertRaw (Raw. AudioDeviceEvent _ _ _ _) =
661
+ error " convertRaw: Unknown audio device motion"
656
662
convertRaw (Raw. QuitEvent _ ts) =
657
663
return (Event ts QuitEvent )
658
664
convertRaw (Raw. UserEvent _ ts a b c d) =
0 commit comments