edje: Edje_Edit - add sounds list accessor.

Summary:
make "get" functions for block "sounds" which return
a sounds or tones list (Eina_List *) off the given edje object.
@feature

Reviewers: raster, cedric, seoz, Hermet

Reviewed By: cedric

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D932

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
Igor Gala 2014-06-04 00:44:42 +02:00 committed by Cedric BAIL
parent fb89f79b6a
commit f0e4cba71c
2 changed files with 65 additions and 0 deletions

View File

@ -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);
//@}
/******************************************************************************/

View File

@ -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 */
/******************/