forked from enlightenment/efl
edje: Edje_Edit - edje_edit_sound_compression_rate_xet()
Summary: There are new 'get and set' API for block 'sound'. Those functions return or set quality of the compression for a given sound. @feature Reviewers: cedric, Hermet, seoz, raster CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D1017 Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
parent
a810012d57
commit
e8cebd6ce7
|
@ -3628,6 +3628,25 @@ EAPI Eina_Bool edje_edit_sound_sample_del(Evas_Object *obj, const char *name);
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool edje_edit_sound_tone_del(Evas_Object *obj, const char* name);
|
EAPI Eina_Bool edje_edit_sound_tone_del(Evas_Object *obj, const char* name);
|
||||||
|
|
||||||
|
/** Get the sound quality compression.
|
||||||
|
*
|
||||||
|
*@param obj Object being edited.
|
||||||
|
*@param name The name of the sample.
|
||||||
|
*
|
||||||
|
*@return Quality of the compression of the sample sound.
|
||||||
|
*/
|
||||||
|
EAPI double edje_edit_sound_compression_rate_get(Evas_Object *obj, const char* sound);
|
||||||
|
|
||||||
|
/* Set the sound quality compression.
|
||||||
|
*
|
||||||
|
*@param obj Object being edited.
|
||||||
|
*@param name The name of the sample.
|
||||||
|
*@param rate Quality of the compression.
|
||||||
|
*
|
||||||
|
*@return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool edje_edit_sound_compression_rate_set(Evas_Object *obj, const char* sound, double rate);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/************************* SPECTRUM API ***********************************/
|
/************************* SPECTRUM API ***********************************/
|
||||||
|
|
|
@ -1206,6 +1206,55 @@ edje_edit_sound_tone_del(Evas_Object *obj, const char* name)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI double
|
||||||
|
edje_edit_sound_compression_rate_get(Evas_Object *obj, const char *sound)
|
||||||
|
{
|
||||||
|
Edje_Sound_Sample *ss = NULL;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
GET_ED_OR_RETURN(-1);
|
||||||
|
|
||||||
|
if ((!ed->file) || (!ed->file->sound_dir))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (i = 0; i < ed->file->sound_dir->samples_count; i++)
|
||||||
|
{
|
||||||
|
ss = ed->file->sound_dir->samples + i;
|
||||||
|
if ((ss->name) && (!strcmp(sound, ss->name)))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == ed->file->sound_dir->samples_count)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return ss->quality;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Eina_Bool
|
||||||
|
edje_edit_sound_compression_rate_set(Evas_Object *obj, const char *sound, double rate)
|
||||||
|
{
|
||||||
|
Edje_Sound_Sample *ss = NULL;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
GET_ED_OR_RETURN(EINA_FALSE);
|
||||||
|
|
||||||
|
if ((!ed->file) || (!ed->file->sound_dir))
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
for (i = 0; i < ed->file->sound_dir->samples_count; i++)
|
||||||
|
{
|
||||||
|
ss = ed->file->sound_dir->samples + i;
|
||||||
|
if ((ss->name) && (!strcmp(sound, ss->name)))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == ed->file->sound_dir->samples_count)
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
ss->quality = rate;
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/****************/
|
/****************/
|
||||||
/* GROUPS API */
|
/* GROUPS API */
|
||||||
/****************/
|
/****************/
|
||||||
|
|
Loading…
Reference in New Issue