From: Hayato Nakamura Date: Wed, 6 Nov 2013 10:23:49 +0000 (+0900) Subject: Config preset value addition repeat_flg and media_role. X-Git-Tag: accepted/tizen/20131107.181109^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49474d87474fd43356723ab3fc39a3d460509f12;p=profile%2Fivi%2Fico-uxf-homescreen-sample-apps.git Config preset value addition repeat_flg and media_role. Change-Id: I51721a3af2cb4c2a5e14f5b9c2507975bd688bb4 Signed-off-by: Hayato Nakamura --- diff --git a/ico-app-soundsample/soundsample_config.txt b/ico-app-soundsample/soundsample_config.txt index 0569ab4..112efb6 100644 --- a/ico-app-soundsample/soundsample_config.txt +++ b/ico-app-soundsample/soundsample_config.txt @@ -1,5 +1,5 @@ ## audioTP Config File -## /opt/apps/org.tizen.ico.ico-app-soundsample/res/soundsample_config.txt +## /usr/apps/org.tizen.ico.ico-app-soundsample/res/soundsample_config.txt [data] wavfile_path=/usr/apps/org.tizen.ico.app-soundsample/sounds/musicbox.wav @@ -9,3 +9,5 @@ volume1=30000 volume2=30000 app_name=SampleSound stream_name=sample_sound +repeat_flg=OFF +media_role=music diff --git a/ico-app-soundsample/src/soundsample.c b/ico-app-soundsample/src/soundsample.c index abefca8..2ea3f81 100644 --- a/ico-app-soundsample/src/soundsample.c +++ b/ico-app-soundsample/src/soundsample.c @@ -59,6 +59,8 @@ #define KEY_VOLUME2 "volume2" #define KEY_APP_NAME "app_name" #define KEY_STREAM_NAME "stream_name" +#define KEY_REPEAT_FLG "repeat_flg" +#define KEY_MEDIA_ROLE "media_role" /* font */ #define FONT_SIZE 48 @@ -556,6 +558,22 @@ static int read_config(void) AudioConfig.stream_name = "Pri0"; } + AudioConfig.repeat_flg = g_key_file_get_string(keyfile, GROUP_DATA, + KEY_REPEAT_FLG, &error); + if ((error) || (strlen(AudioConfig.repeat_flg) <= 0)) { + ICO_DBG("No config data [%s]", KEY_REPEAT_FLG); + conf_check_gerror(KEY_DEVICE_NAME, &error); + AudioConfig.repeat_flg = "OFF"; + } + + AudioConfig.media_role = g_key_file_get_string(keyfile, GROUP_DATA, + KEY_MEDIA_ROLE, &error); + if ((error) || (strlen(AudioConfig.media_role) <= 0)) { + ICO_DBG("No config data [%s]", KEY_MEDIA_ROLE); + conf_check_gerror(KEY_DEVICE_NAME, &error); + AudioConfig.media_role = "none"; + } + ICO_DBG("AudioConfig.wavfile_path = [%s]", AudioConfig.wavfile_path); ICO_DBG("AudioConfig.server_ip = [%s]", AudioConfig.server_ip); ICO_DBG("AudioConfig.device_name = [%s]", AudioConfig.device_name); @@ -563,7 +581,8 @@ static int read_config(void) ICO_DBG("AudioConfig.volume2 = [%d]", AudioConfig.volume2); ICO_DBG("AudioConfig.app_name = [%s]", AudioConfig.app_name); ICO_DBG("AudioConfig.stream_name = [%s]", AudioConfig.stream_name); - + ICO_DBG("AudioConfig.repeat_flg = [%s]", AudioConfig.repeat_flg); + ICO_DBG("AudioConfig.media_role = [%s]", AudioConfig.media_role); ICO_DBG("read_config: Leave"); return 0; } diff --git a/ico-app-soundsample/src/soundsample.h b/ico-app-soundsample/src/soundsample.h index 9bc4889..90305bb 100644 --- a/ico-app-soundsample/src/soundsample.h +++ b/ico-app-soundsample/src/soundsample.h @@ -30,6 +30,8 @@ extern "C" int volume2; char *app_name; char *stream_name; + char *repeat_flg; + char *media_role; }; /* STATE */ diff --git a/ico-app-soundsample/src/soundsample_pulse_async_test.cpp b/ico-app-soundsample/src/soundsample_pulse_async_test.cpp index 4dfc0a0..ecfb450 100644 --- a/ico-app-soundsample/src/soundsample_pulse_async_test.cpp +++ b/ico-app-soundsample/src/soundsample_pulse_async_test.cpp @@ -41,7 +41,6 @@ extern "C" static int ExitFlg; static int ReadFiledes; -#define REPEAT_FLG 1 /* ON:0 ,OFF:1 */ static YSRESULT YsPulseAudioWaitForConnectionEstablished(pa_context * paContext, @@ -85,15 +84,11 @@ static void event_input_callback(pa_mainloop_api *a, pa_io_event *e, int fd, pa_stream_cork((pa_stream *) userdata, ICO_PA_STREAM_PAUSE, NULL, NULL); ICO_DBG("pa_stream_cork(PAUSE)"); - sleep(2); - ICO_DBG("sleep end"); } else { pa_stream_cork((pa_stream *) userdata, ICO_PA_STREAM_RESUME, NULL, NULL); ICO_DBG("pa_stream_cork(RESUME)"); - sleep(2); - ICO_DBG("sleep end"); } break; @@ -113,7 +108,8 @@ int pulse_main(struct audio_config_t *audio_config, int filedes) int volume_set2 = -1; char *app_name = NULL; char *stream_name = NULL; - + char *repeat_flg = NULL; + char *media_role = NULL; pa_cvolume *cvolume = NULL; char cm[PA_CHANNEL_MAP_SNPRINT_MAX]; @@ -147,6 +143,8 @@ int pulse_main(struct audio_config_t *audio_config, int filedes) volume_set2 = audio_config->volume2; app_name = audio_config->app_name; stream_name = audio_config->stream_name; + repeat_flg = audio_config->repeat_flg; + media_role = audio_config->media_role; ICO_DBG("Before Resampling:"); ICO_DBG("Bit per sample: %d", wavFile.BitPerSample()); @@ -241,7 +239,17 @@ int pulse_main(struct audio_config_t *audio_config, int filedes) static pa_io_event *stdio_event = NULL; static pa_mainloop_api *mainloop_api = pa_mainloop_get_api(paMainLoop); - paStream = pa_stream_new(paContext, stream_name, &ss, &cmap); + pa_proplist *plist_p = pa_proplist_new(); + if ((NULL != plist_p) && (NULL != media_role) && (0 != strcmp(media_role, "none"))) { + pa_proplist_sets(plist_p, PA_PROP_MEDIA_ROLE, media_role); + paStream = pa_stream_new_with_proplist(paContext, stream_name, &ss, &cmap , plist_p); + ICO_DBG("pa_stream_new_with_proplist : media role set [%s]", media_role); + } + else { + paStream = pa_stream_new(paContext, stream_name, &ss, &cmap); + ICO_DBG("pa_stream_new : media role unset"); + } + if (NULL != paStream) { ICO_DBG("Stream created! Getting there!"); } @@ -314,11 +322,13 @@ int pulse_main(struct audio_config_t *audio_config, int filedes) ICO_DBG ("Underflow detected. (Probably the playback is done.)"); playBackPtr = 0; -#if REPEAT_FLG - break; -#endif + + if (0 != strcmp(repeat_flg, "ON")) { + break; + } } pa_mainloop_iterate(paMainLoop, 0, NULL); + usleep(500); } ICO_DBG("STREAM is END."); diff --git a/packaging/ico-uxf-homescreen-sample-apps.changes b/packaging/ico-uxf-homescreen-sample-apps.changes index ec2a870..78fb271 100644 --- a/packaging/ico-uxf-homescreen-sample-apps.changes +++ b/packaging/ico-uxf-homescreen-sample-apps.changes @@ -1,3 +1,22 @@ +* Wed Nov 06 2013 Shibata Makoto submit/tizen/20131106.102408@3acddd7 +- 0.9.1 release. +-ico-app-soundsample +-- bugfix : When it reproduces from a stop, sound is come out slowly. +-- Config preset value addition + ・repeat_flg + "ON" A sound is repeated. + "OFF" A sound is not repeated. + ・media_role (An initial value has no setup. "none") + +- 0.9.2 release +-ico-app-soundsample +-- bugfix : 100% of the CPU usage rate at the time of a pause. + +- 0.9.3 release +-ico-app-soundsample +-- Config default configuration change :media role. + + * Wed Oct 02 2013 Shibata Makoto accepted/2.0alpha-wayland/20130612.174822@212f3fb - 0.9.0 release. -- leave application vicsample, soundsamples. remove other applications. diff --git a/packaging/ico-uxf-homescreen-sample-apps.spec b/packaging/ico-uxf-homescreen-sample-apps.spec index e4bcb83..317592f 100644 --- a/packaging/ico-uxf-homescreen-sample-apps.spec +++ b/packaging/ico-uxf-homescreen-sample-apps.spec @@ -1,7 +1,7 @@ Name: ico-uxf-homescreen-sample-apps Summary: HomeScreen sample application -Version: 0.9.0 -Release: 1 +Version: 0.9.3 +Release: 1.1 Group: System/GUI License: Apache License, Version 2.0 URL: http://www.toyota.com