From 76509b23406cb0349e183ddbf5a4f05c076b40ce Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Wed, 17 Apr 2013 18:49:53 +0100 Subject: [PATCH] ecore_audio: Implement notification when samplerate changes Signed-off-by: Daniel Willmann --- src/lib/ecore_audio/ecore_audio_obj_in.c | 9 +++++---- src/lib/ecore_audio/ecore_audio_obj_in.h | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c index 704e27d..92dc48d 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in.c @@ -20,6 +20,8 @@ EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_LOOPED = EO_EVENT_DESCRIPTION("in,looped", "Called when an input has looped."); EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_STOPPED = EO_EVENT_DESCRIPTION("in,stopped", "Called when an input has stopped playing."); +EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED = + EO_EVENT_DESCRIPTION("in,samplerate,changed", "Called when the input samplerate has changed."); #define MY_CLASS ECORE_AUDIO_OBJ_IN_CLASS #define MY_CLASS_NAME "ecore_audio_obj_in" @@ -37,8 +39,7 @@ static void _speed_set(Eo *eo_obj, void *_pd, va_list *list) obj->speed = speed; - /* TODO: Notify output */ - + eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL)); } static void _speed_get(Eo *eo_obj, void *_pd, va_list *list) @@ -59,8 +60,7 @@ static void _samplerate_set(Eo *eo_obj, void *_pd, va_list *list) obj->samplerate = samplerate; - /* TODO: Notify output */ - + eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL)); } static void _samplerate_get(Eo *eo_obj, void *_pd, va_list *list) @@ -251,6 +251,7 @@ static const Eo_Op_Description op_desc[] = { static const Eo_Event_Description *event_desc[] = { ECORE_AUDIO_EV_IN_LOOPED, ECORE_AUDIO_EV_IN_STOPPED, + ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL }; diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.h b/src/lib/ecore_audio/ecore_audio_obj_in.h index 6da0ec2..f2aa6e3 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in.h +++ b/src/lib/ecore_audio/ecore_audio_obj_in.h @@ -118,6 +118,9 @@ extern const Eo_Event_Description _ECORE_AUDIO_EV_IN_LOOPED; extern const Eo_Event_Description _ECORE_AUDIO_EV_IN_STOPPED; #define ECORE_AUDIO_EV_IN_STOPPED (&(_ECORE_AUDIO_EV_IN_STOPPED)) +extern const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED; +#define ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED (&(_ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED)) + /** * @} */ -- 2.7.4