+EXPORT_API
+int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *is_on)
+{
+ int ret = MM_ERROR_NONE;
+ int i;
+ mm_sound_device_t *device = (mm_sound_device_t*)device_h;
+ bool _is_on = false;
+
+ if (!device || !is_on) {
+ debug_error("invalid argument");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (device->stream_num >= 0) {
+ debug_log("device_handle has stream id");
+ for (i = 0; i < device->stream_num; i++) {
+ if (device->stream_id[i] == stream_id) {
+ _is_on = true;
+ break;
+ }
+ }
+ } else {
+ debug_log("device_handle dosn't have stream id");
+ /* No information about stream in client-side, should ask to server-side */
+ if ((ret = mm_sound_client_is_stream_on_device(stream_id, device->id, &_is_on)) < 0) {
+ debug_error("Failed to query is stream on");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+ }
+
+ debug_log("device(%d) %s stream(%d)", device->id, _is_on ? "has" : "doesn't have", stream_id);
+ *is_on = _is_on;
+
+ return ret;
+}
+
+EXPORT_API
+int mm_sound_is_stream_on_device_by_id(int stream_id, int device_id, bool *is_on)
+{
+ int ret = MM_ERROR_NONE;
+ bool _is_on = false;
+
+ if (!is_on) {
+ debug_error("invalid argument");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if ((ret = mm_sound_client_is_stream_on_device(stream_id, device_id, &_is_on)) < 0) {
+ debug_error("Failed to query is stream on");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+
+ debug_log("device(%d) %s stream(%d)", device_id, _is_on ? "has" : "doesn't have", stream_id);
+ *is_on = _is_on;
+
+ return ret;
+}
+
+EXPORT_API
+int mm_sound_is_device_running(MMSoundDevice_t device_h, bool *is_running)
+{
+ mm_sound_device_t *device = (mm_sound_device_t*)device_h;
+ if (!device || !is_running) {
+ debug_error("invalid argument");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+ *is_running = device->is_running;
+ debug_log("device_handle:0x%p, running:%d", device, *is_running);
+
+ return MM_ERROR_NONE;
+}