forked from enlightenment/efl
edje/multisense: add checking sample,tone name at playing. and some indent fixes
SVN revision: 71264
This commit is contained in:
parent
962b912d75
commit
29504633fc
|
@ -85,17 +85,17 @@ init_multisense_environment(void)
|
||||||
strncpy(ms_factory, ms_factory_env, BUF_LEN);
|
strncpy(ms_factory, ms_factory_env, BUF_LEN);
|
||||||
else
|
else
|
||||||
strcpy(ms_factory, "multisense_factory");
|
strcpy(ms_factory, "multisense_factory");
|
||||||
|
|
||||||
m = _edje_module_handle_load(ms_factory);
|
m = _edje_module_handle_load(ms_factory);
|
||||||
if (!m) goto err;
|
if (!m) goto err;
|
||||||
|
|
||||||
msdata->msenv->remixenv = remix_init();
|
msdata->msenv->remixenv = remix_init();
|
||||||
|
|
||||||
multisense_factory_init =
|
multisense_factory_init =
|
||||||
eina_module_symbol_get(m, "multisense_factory_init");
|
eina_module_symbol_get(m, "multisense_factory_init");
|
||||||
if (multisense_factory_init) multisense_factory_init(msdata->msenv);
|
if (multisense_factory_init) multisense_factory_init(msdata->msenv);
|
||||||
|
|
||||||
msdata->multisense_sound_player_get =
|
msdata->multisense_sound_player_get =
|
||||||
eina_module_symbol_get(m, "multisense_sound_player_get");
|
eina_module_symbol_get(m, "multisense_sound_player_get");
|
||||||
if (!msdata->multisense_sound_player_get) goto err;
|
if (!msdata->multisense_sound_player_get) goto err;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ eet_sound_reader_get(Edje_Multisense_Env *msenv, const char *path, const char *s
|
||||||
ERR ("Multisense EET Sound reader plugin NULL\n");
|
ERR ("Multisense EET Sound reader plugin NULL\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sf_path_key = remix_get_init_parameter_key(env, sf_plugin, "path");
|
sf_path_key = remix_get_init_parameter_key(env, sf_plugin, "path");
|
||||||
sf_sound_id_key = remix_get_init_parameter_key(env, sf_plugin, "sound_id");
|
sf_sound_id_key = remix_get_init_parameter_key(env, sf_plugin, "sound_id");
|
||||||
sf_speed_key = remix_get_init_parameter_key(env, sf_plugin, "speed");
|
sf_speed_key = remix_get_init_parameter_key(env, sf_plugin, "speed");
|
||||||
|
@ -156,7 +156,7 @@ eet_sound_reader_get(Edje_Multisense_Env *msenv, const char *path, const char *s
|
||||||
sf_parms = cd_set_replace(env, sf_parms, sf_sound_id_key, CD_STRING(sound_id));
|
sf_parms = cd_set_replace(env, sf_parms, sf_sound_id_key, CD_STRING(sound_id));
|
||||||
sf_parms = cd_set_replace(env, sf_parms, sf_speed_key, CD_DOUBLE(speed));
|
sf_parms = cd_set_replace(env, sf_parms, sf_speed_key, CD_DOUBLE(speed));
|
||||||
eet_snd_reader = remix_new(env, sf_plugin, sf_parms);
|
eet_snd_reader = remix_new(env, sf_plugin, sf_parms);
|
||||||
|
|
||||||
return eet_snd_reader;
|
return eet_snd_reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ edje_remix_tone_create(Multisense_Data *msdata, Edje*ed, Edje_Tone_Action *actio
|
||||||
|
|
||||||
if ((!ed) || (!ed->file) || (!ed->file->sound_dir))
|
if ((!ed) || (!ed->file) || (!ed->file->sound_dir))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (i = 0; i < ed->file->sound_dir->tones_count; i++)
|
for (i = 0; i < ed->file->sound_dir->tones_count; i++)
|
||||||
{
|
{
|
||||||
tone = &ed->file->sound_dir->tones[i];
|
tone = &ed->file->sound_dir->tones[i];
|
||||||
|
@ -215,7 +215,7 @@ sound_command_handler(Multisense_Data *msdata)
|
||||||
Edje_Multisense_Sound_Action command;
|
Edje_Multisense_Sound_Action command;
|
||||||
RemixBase *base = NULL;
|
RemixBase *base = NULL;
|
||||||
RemixBase *sound;
|
RemixBase *sound;
|
||||||
|
|
||||||
if (read(command_pipe[0], &command, sizeof(command)) <= 0) return;
|
if (read(command_pipe[0], &command, sizeof(command)) <= 0) return;
|
||||||
switch (command.action)
|
switch (command.action)
|
||||||
{
|
{
|
||||||
|
@ -258,7 +258,7 @@ _msdata_free(void)
|
||||||
remix_destroy(msdata->msenv->remixenv, msdata->player);
|
remix_destroy(msdata->msenv->remixenv, msdata->player);
|
||||||
remix_destroy(msdata->msenv->remixenv, msdata->deck);
|
remix_destroy(msdata->msenv->remixenv, msdata->deck);
|
||||||
remix_purge(msdata->msenv->remixenv);
|
remix_purge(msdata->msenv->remixenv);
|
||||||
|
|
||||||
free(msdata->msenv);
|
free(msdata->msenv);
|
||||||
free(msdata);
|
free(msdata);
|
||||||
msdata = NULL;
|
msdata = NULL;
|
||||||
|
@ -270,9 +270,9 @@ _player_job(void *data __UNUSED__, Ecore_Thread *th)
|
||||||
fd_set wait_fds;
|
fd_set wait_fds;
|
||||||
RemixBase *sound;
|
RemixBase *sound;
|
||||||
RemixCount process_len;
|
RemixCount process_len;
|
||||||
// disable and move outside of thread due to dlsym etc. thread issues
|
// disable and move outside of thread due to dlsym etc. thread issues
|
||||||
// Multisense_Data * msdata = init_multisense_environment();
|
// Multisense_Data * msdata = init_multisense_environment();
|
||||||
|
|
||||||
if (!msdata) return;
|
if (!msdata) return;
|
||||||
|
|
||||||
fcntl(command_pipe[0], F_SETFL, O_NONBLOCK);
|
fcntl(command_pipe[0], F_SETFL, O_NONBLOCK);
|
||||||
|
@ -337,8 +337,13 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c
|
||||||
ssize_t size = 0;
|
ssize_t size = 0;
|
||||||
#ifdef ENABLE_MULTISENSE
|
#ifdef ENABLE_MULTISENSE
|
||||||
Edje_Multisense_Sound_Action command;
|
Edje_Multisense_Sound_Action command;
|
||||||
|
|
||||||
if ((!pipe_initialized) && (!player_thread)) return EINA_FALSE;
|
if ((!pipe_initialized) && (!player_thread)) return EINA_FALSE;
|
||||||
|
if (!sample_name)
|
||||||
|
{
|
||||||
|
ERR("Given Sample Name is NULL\n");
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
command.action = EDJE_PLAY_SAMPLE;
|
command.action = EDJE_PLAY_SAMPLE;
|
||||||
command.ed = ed;
|
command.ed = ed;
|
||||||
|
@ -360,14 +365,20 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const
|
||||||
ssize_t size = 0;
|
ssize_t size = 0;
|
||||||
#ifdef ENABLE_MULTISENSE
|
#ifdef ENABLE_MULTISENSE
|
||||||
Edje_Multisense_Sound_Action command;
|
Edje_Multisense_Sound_Action command;
|
||||||
|
|
||||||
if ((!pipe_initialized) && (!player_thread)) return EINA_FALSE;
|
if ((!pipe_initialized) && (!player_thread)) return EINA_FALSE;
|
||||||
|
if (!tone_name)
|
||||||
|
{
|
||||||
|
ERR("Given Tone Name is NULL\n");
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
command.action = EDJE_PLAY_TONE;
|
command.action = EDJE_PLAY_TONE;
|
||||||
command.ed = ed;
|
command.ed = ed;
|
||||||
strncpy(command.type.tone.tone_name, tone_name, BUF_LEN);
|
strncpy(command.type.tone.tone_name, tone_name, BUF_LEN);
|
||||||
command.type.tone.duration = duration;
|
command.type.tone.duration = duration;
|
||||||
size = write(command_pipe[1], &command, sizeof(command));
|
size = write(command_pipe[1], &command, sizeof(command));
|
||||||
#else
|
#else
|
||||||
// warning shh
|
// warning shh
|
||||||
(void) ed;
|
(void) ed;
|
||||||
(void) duration;
|
(void) duration;
|
||||||
|
@ -387,7 +398,7 @@ _edje_multisense_init(void)
|
||||||
|
|
||||||
// init msdata outside of thread due to thread issues in dlsym etc.
|
// init msdata outside of thread due to thread issues in dlsym etc.
|
||||||
if (!msdata) msdata = init_multisense_environment();
|
if (!msdata) msdata = init_multisense_environment();
|
||||||
|
|
||||||
if (!player_thread)
|
if (!player_thread)
|
||||||
player_thread = ecore_thread_run(_player_job, _player_end, _player_cancel, NULL);
|
player_thread = ecore_thread_run(_player_job, _player_end, _player_cancel, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue