Fix #10 by implementing fbd_dev_sound_stop
Changes made:
-
moved
fbd_dev_sound_stop
fromfbd-feedback-sound.c
tofbd-dev-sound.c
-
in
struct FbdDevSound
new memberGCancellable *playback
-
in
initable_init
allocating the cancellable withg_cancellable_new
-
in
fbd_dev_sound_dispose
disposing of the cancellable withg_clear_object
-
in
fbd_dev_sound_stop
cancelling the cancellable withg_cancellable_cancel
but also drop the cancellable and create a new one
The recreation of the cancellable is necessary b/c the FdbDevSound
object may be reused. If it is reused, the sound is immediately cancelled when started with the old cancellable.
There is the possibility to reset the cancellable but the documentation of g_cancellable_reset advises to remove the reference and create a new object.