@@ -410,8 +410,10 @@ data ControllerDeviceEventData =
410410 deriving (Eq ,Ord ,Generic ,Show ,Typeable )
411411
412412data 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.
415417 ,audioDeviceEventIsCapture :: ! Bool
416418 -- ^ If the audio device is a capture device.
417419 }
@@ -651,8 +653,12 @@ convertRaw (Raw.ControllerButtonEvent _ ts a b c) =
651653 return (Event ts (ControllerButtonEvent (ControllerButtonEventData a b c)))
652654convertRaw (Raw. ControllerDeviceEvent _ ts a) =
653655 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"
656662convertRaw (Raw. QuitEvent _ ts) =
657663 return (Event ts QuitEvent )
658664convertRaw (Raw. UserEvent _ ts a b c d) =
0 commit comments