cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7366caab1ab57086aca560d57137e8bea4e67b7f

commit 7366caab1ab57086aca560d57137e8bea4e67b7f
Author: Igor Gala <[email protected]>
Date:   Sat Oct 18 13:44:25 2014 +0200

    edje: Edje_Edit - get the source name of the sample
    
    @feature
    
    Reviewers: cedric, Hermet, seoz, raster, reutskiy.v.v
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1546
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/lib/edje/Edje_Edit.h | 10 ++++++++++
 src/lib/edje/edje_edit.c | 27 +++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 14bbb72..795a383 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -5014,6 +5014,16 @@ EAPI Eina_Bool 
edje_edit_sound_compression_type_set(Evas_Object *obj, const char
  */
 EAPI Eina_Binbuf *edje_edit_sound_samplebuffer_get(Evas_Object *obj, const 
char *sample_name);
 
+/** Get the name of sample source.
+ *
+ * @param obj Object being edited.
+ * @param sample_name The name of the sample.
+ *
+ * @return snd_src The sample source name.
+ * @since 1.11
+ */
+EAPI const char *edje_edit_sound_samplesource_get(Evas_Object *obj, const char 
*sample_name);
+
 //@}
 
/******************************************************************************/
 /*************************   SPECTRUM API   
***********************************/
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index bc743c6..2802ba5 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -1500,6 +1500,33 @@ edje_edit_sound_samplebuffer_get(Evas_Object *obj, const 
char *sample_name)
    return NULL;
 }
 
+EAPI const char *
+edje_edit_sound_samplesource_get(Evas_Object *obj, const char *sample_name)
+{
+   Edje_Sound_Sample *sample;
+   int i;
+
+   if (!sample_name)
+    {
+       ERR("Given Sample Name is NULL");
+       return NULL;
+    }
+
+   GET_ED_OR_RETURN(NULL);
+
+   if ((!ed) || (!ed->file) || (!ed->file->sound_dir))
+     return NULL;
+
+   for(i = 0; i < (int)ed->file->sound_dir->samples_count; i++)
+     {
+        sample = &ed->file->sound_dir->samples[i];
+        if (!strcmp(sample->name, sample_name))
+          return eina_stringshare_add(sample->snd_src);
+     }
+
+   return NULL;
+}
+
 
 /****************/
 /*  GROUPS API  */

-- 


Reply via email to