edje: Edje_Edit - add sounds list accessor.
authorIgor Gala <i.gala@samsung.com>
Tue, 3 Jun 2014 22:44:42 +0000 (00:44 +0200)
committerCedric BAIL <c.bail@partner.samsung.com>
Tue, 3 Jun 2014 22:51:56 +0000 (00:51 +0200)
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>
src/lib/edje/Edje_Edit.h
src/lib/edje/edje_edit.c

index 83145fe..9405743 100644 (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);
 
 //@}
 /******************************************************************************/
index 2ab1373..4782667 100644 (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  */
 /******************/