diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 83145fe388..9405743e28 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -3118,6 +3118,31 @@ EAPI Eina_Bool edje_edit_state_tween_add(Evas_Object *obj, const char *part, con */ EAPI Eina_Bool edje_edit_state_tween_del(Evas_Object *obj, const char *part, const char *state, double value, const char *tween); +//@} +/******************************************************************************/ +/************************** SOUNDS API ************************************/ +/******************************************************************************/ +/** @name Sounds API + * Functions to deal with sound objects (see @ref edcref). + */ //@{ + +/** Get the list of all the sounds samples in the given edje. + * Use edje_edit_string_list_free() when you don't need the list anymore. + * + * @param obj Object being edited. + * + * @return A List containing all sounds samples names found in the edje file. + */ +EAPI Eina_List * edje_edit_sounds_samples_get(Evas_Object *obj); + +/** Get the list of all the sounds tones in the given edje. + * Use edje_edit_string_list_free() when you don't need the list anymore. + * + * @param obj Object being edited. + * + * @return A List containing all sounds tones names found in the edje file. + */ +EAPI Eina_List * edje_edit_sounds_tones_get(Evas_Object *obj); //@} /******************************************************************************/ diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 2ab1373488..47826673da 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -5662,6 +5662,46 @@ edje_edit_state_image_border_fill_set(Evas_Object *obj, const char *part, const return EINA_TRUE; } +/****************/ +/* SOUNDS API */ +/****************/ + +EAPI Eina_List * +edje_edit_sounds_samples_list_get(Evas_Object *obj) +{ + Eina_List *sounds_samples = NULL; + unsigned int i; + + GET_ED_OR_RETURN(NULL); + + if ((!ed->file) || (!ed->file->sound_dir)) + return NULL; + + for (i = 0; i < ed->file->sound_dir->samples_count; ++i) + sounds_samples = eina_list_append(sounds_samples, + eina_stringshare_add(ed->file->sound_dir->samples[i].name)); + + return sounds_samples; +} + +EAPI Eina_List * +edje_edit_sounds_tones_list_get(Evas_Object *obj) +{ + Eina_List *sounds_tones = NULL; + unsigned int i; + + GET_ED_OR_RETURN(NULL); + + if ((!ed->file) || (!ed->file->sound_dir)) + return NULL; + + for (i = 0; i < ed->file->sound_dir->tones_count; ++i) + sounds_tones = eina_list_append(sounds_tones, + eina_stringshare_add(ed->file->sound_dir->tones[i].name)); + + return sounds_tones; +} + /******************/ /* PROGRAMS API */ /******************/