Add mm_sound_stop_keysound()
[platform/core/multimedia/libmm-sound.git] / testsuite / mm_sound_testsuite_simple.c
index f72e2fd..677c9ff 100755 (executable)
@@ -44,8 +44,9 @@
 #include <dirent.h>
 #include <vconf.h>
 
-#define POWERON_FILE   "/usr/share/feedback/sound/operation/power_on.wav"
-#define KEYTONE_FILE   "/usr/share/feedback/sound/operation/operation.wav"
+#define POWERON_FILE   "/usr/share/keysound/poweron.ogg"
+#define KEYTONE_FILE   "/usr/share/sounds/sound-server/Tizen_HW_Touch.ogg"
+#define KEYTONE_NOTI_FILE      "/usr/share/sounds/alsa/Front_Center.wav"
 
 enum {
        CURRENT_STATUS_MAINMENU = 0,
@@ -195,7 +196,11 @@ static void displaymenu()
                g_print("==================================================================\n");
                g_print("       Sound Play APIs\n");
                g_print("==================================================================\n");
-               g_print("k : Key Sound     \t");
+               g_print("k : Play Keysound     \t");
+               g_print("ks : Stop Keysound     \t");
+               g_print("kn : Play Keysound (Notification) \t");
+               g_print("ksn : Stop Keysound (Notification)    \t");
+               g_print("ksa : Stop Keysound (All)    \n");
                g_print("as : play sound with stream type\n");
                g_print("FS : Play DTMF with stream type\t");
                g_print("b : Play directory\n");
@@ -498,10 +503,26 @@ static void interpret(char *cmd)
                        ret = mm_sound_unset_focus_watch_callback(g_focus_watch_index);
                        if (ret)
                                g_print("failed to mm_sound_unset_focus_watch_callback(), ret[0x%x]\n", ret);
+               } else if (strncmp(cmd, "ksn", 3) == 0) {
+                       ret = mm_sound_stop_keysound(KEYTONE_NOTI_FILE);
+                       if (ret < 0)
+                               debug_error("keysound stop(noti) failed with 0x%x", ret);
+               } else if (strncmp(cmd, "ksa", 3) == 0) {
+                       ret = mm_sound_stop_keysound(NULL);
+                       if (ret < 0)
+                               debug_error("keysound stop(all) failed with 0x%x", ret);
+               } else if (strncmp(cmd, "kn", 2) == 0) {
+                       ret = mm_sound_play_keysound(KEYTONE_NOTI_FILE, VOLUME_TYPE_NOTIFICATION);
+                       if (ret < 0)
+                               debug_error("keysound play(noti) failed with 0x%x", ret);
+               } else if (strncmp(cmd, "ks", 2) == 0) {
+                       ret = mm_sound_stop_keysound(KEYTONE_FILE);
+                       if (ret < 0)
+                               debug_error("keysound stop failed with 0x%x", ret);
                } else if (strncmp(cmd, "k", 1) == 0) {
                        ret = mm_sound_play_keysound(KEYTONE_FILE, 0);
                        if (ret < 0)
-                               debug_log("keysound play failed with 0x%x", ret);
+                               debug_error("keysound play failed with 0x%x", ret);
                } else if (strcmp(cmd, "dbus-m") == 0) {
                        int ret = 0;
                        int a = 3;