Fix for coding rule 68/53768/1 accepted/tizen/ivi/20160218.023443 accepted/tizen/mobile/20151210.081020 accepted/tizen/tv/20151210.081711 accepted/tizen/wearable/20151210.081804 submit/tizen/20151210.020801 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000002
authorSeungbae Shin <seungbae.shin@samsung.com>
Wed, 9 Dec 2015 07:27:02 +0000 (16:27 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 9 Dec 2015 07:27:20 +0000 (16:27 +0900)
Change-Id: I641a40752b0100888ba4753d049f97fe24c7b422

packaging/capi-media-tone-player.spec
test/multimedia_tone_player_test.c

index 4428176..20b3d3a 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       capi-media-tone-player
 Summary:    A tone player library in Tizen C API
-Version:    0.1.5
-Release:    18
+Version:    0.1.6
+Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 201cc91..044e913 100755 (executable)
@@ -14,8 +14,6 @@
 * limitations under the License.
 */
 
-
-
 #include <stdio.h>
 #include <tone_player.h>
 #include <glib.h>
 static GMainLoop *g_mainloop = NULL;
 static GThread *event_thread;
 
-gpointer GmainThread(gpointer data) {
-       g_mainloop = g_main_loop_new (NULL, 0);
-       g_main_loop_run (g_mainloop);
+gpointer GmainThread(gpointer data)
+{
+       g_mainloop = g_main_loop_new(NULL, 0);
+       g_main_loop_run(g_mainloop);
 
        return NULL;
 }
@@ -41,16 +40,16 @@ void help()
 {
        printf("Usage : ");
        printf("multimedia_tone_player_test [OPTION]\n\n"
-                  "  -f, --from                from which tone type\n"
-                  "  -t, --to                  to which tone type\n"
-                  "  -d, --duration            duration(ms)\n"
-                  "  -s, --sleep               sleep time after play start(ms)\n"
-                  "  -h, --help                help\n");
+                       "  -f, --from                from which tone type\n"
+                       "  -t, --to                  to which tone type\n"
+                       "  -d, --duration            duration(ms)\n"
+                       "  -s, --sleep               sleep time after play start(ms)\n"
+                       "  -h, --help                help\n");
 }
 
 void tone_play_test(int from, int to, int duration, int sleep_time)
 {
-       int i ;
+       int i;
 
        printf("From : %2d,   To : %2d,    Duration : %4d,  sleep_time : %4d\n", from, to, duration, sleep_time);
 
@@ -59,14 +58,14 @@ void tone_play_test(int from, int to, int duration, int sleep_time)
                return;
        }
 
-       for(i = from ;i <= to ;i++) {
+       for (i = from; i <= to; i++) {
                printf("Play Tone : %d\n", i);
-               tone_player_start(i, SOUND_TYPE_MEDIA , duration, NULL);
+               tone_player_start(i, SOUND_TYPE_MEDIA, duration, NULL);
                usleep(sleep_time * 1000);
        }
 }
 
-int main(int argc, char** argv)
+int main(int argc, char **argv)
 {
        GError *gerr = NULL;
        int from = TONE_TYPE_DTMF_0, to = TONE_TYPE_DTMF_S;
@@ -76,36 +75,35 @@ int main(int argc, char** argv)
                int opt;
                int opt_idx = 0;
 
-               static struct option long_options[] =
-               {
-                       {"from"    , required_argument, 0, 'f'},
-                       {"to"      , required_argument, 0, 't'},
+               static struct option long_options[] = {
+                       {"from", required_argument, 0, 'f'},
+                       {"to", required_argument, 0, 't'},
                        {"duration", required_argument, 0, 'd'},
-                       {"sleep"   , required_argument, 0, 's'},
-                       {"help"    , no_argument      , 0, 'h'},
-                       { 0, 0, 0, 0 }
+                       {"sleep", required_argument, 0, 's'},
+                       {"help", no_argument, 0, 'h'},
+                       {0, 0, 0, 0}
                };
 
                if ((opt = getopt_long(argc, argv, "f:t:d:s:h", long_options, &opt_idx)) == -1)
                        break;
 
                switch (opt) {
-                       case 'f':
-                               from = atoi(optarg);
-                               break;
-                       case 't':
-                               to = atoi(optarg);
-                               break;
-                       case 'd':
-                               duration = atoi(optarg);
-                               break;
-                       case 's':
-                               sleep_time = atoi(optarg);
-                               break;
-                       case 'h':
-                       default:
-                               help();
-                               return 0;
+               case 'f':
+                       from = atoi(optarg);
+                       break;
+               case 't':
+                       to = atoi(optarg);
+                       break;
+               case 'd':
+                       duration = atoi(optarg);
+                       break;
+               case 's':
+                       sleep_time = atoi(optarg);
+                       break;
+               case 'h':
+               default:
+                       help();
+                       return 0;
                }
        }