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 <cedric@osg.samsung.com>
This commit is contained in:
parent
92f369cd1b
commit
7366caab1a
|
@ -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 ***********************************/
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue