Add sound_stop function 72/228172/1 accepted/tizen/unified/20200406.133208 submit/tizen/20200402.112144
authorYunmi Ha <yunmi.ha@samsung.com>
Thu, 19 Mar 2020 09:35:11 +0000 (18:35 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Thu, 19 Mar 2020 09:35:11 +0000 (18:35 +0900)
- When called this API, whole exist keytones will be stopped.

Change-Id: I5a11326e8b11f0e1e4532be615a0a84ed6fc6edd
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/sound.c

index 8e54a8d18b4a1124a7fb520be4a06f2383e0b0ab..886b707ed27ba4fd2d63903ebc1d262e6de64702 100644 (file)
@@ -219,6 +219,23 @@ static int sound_is_supported(feedback_pattern_e pattern, bool *supported)
        return 0;
 }
 
+static int sound_stop(void)
+{
+       int ret;
+
+       /**
+       * @param        filename        [in] keytone filename to stop (can be null if whole exist keytones needs stops)
+       * int mm_sound_stop_keysound(const char *filename);
+       */
+       ret = mm_sound_stop_keysound(NULL);
+       if (ret == MM_ERROR_NONE)       {
+               _D("stop success!");
+               return 0;
+       }
+       _E("mm_sound_stop_keysound() returned error(%d)", ret);
+       return ret;
+}
+
 //LCOV_EXCL_START Not used function
 static int sound_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen)
 {
@@ -311,6 +328,7 @@ static const struct device_ops sound_device_ops = {
        .init = sound_init,
        .exit = sound_exit,
        .play = sound_play,
+       .stop = sound_stop,
        .is_supported = sound_is_supported,
        .get_path = sound_get_path,
        .set_path = sound_set_path,