SOUND_STREAM_TYPE_SOLO, /**< Sound stream type for solo */
SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE, /**< Sound stream type for voice recognition by service (Since 4.0) */
SOUND_STREAM_TYPE_MEDIA_COMPRESSED, /**< Sound stream type for compressed media (Since 4.0) */
+ SOUND_STREAM_TYPE_MEDIA_NETWORK_SOURCE, /**< Sound stream type for network source media (Since 5.5) */
} sound_stream_type_internal_e;
/**
/**
* @internal
+ * @brief Sets the virtual stream volume.
+ * @since_tizen 5.5
+ * @param[in] virtual_stream The handle of virtual stream
+ * @param[in] ratio The volume ratio to be set (Min.:0.0 ~ Max.:1.0, default:1.0)
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_create_virtual_stream()
+ * @see sound_manager_destroy_virtual_stream()
+ * @see sound_manager_start_virtual_stream()
+ */
+int sound_manager_set_virtual_stream_volume(virtual_sound_stream_h virtual_stream, double ratio);
+
+/**
+ * @internal
* @brief Set sound filter and apply to audio streams given selected stream type.
* @since_tizen 4.0
* @param[in] stream_type stream type to apply
/**
* @internal
+ * @brief Sets ACM master mode.
+ * @since_tizen 5.5
+ *
+ * @remarks The master mode is not enabled as default.
+ *
+ * @param[in] enable The master mode to be set: (@c true = master, @c false = slave)
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ */
+int sound_manager_set_acm_master_mode(bool enable);
+
+/**
+ * @internal
* @brief Enumeration for stream type.
* @since_tizen 6.0
* @remarks These values can be combined with bitwise 'or'.
int sound_manager_get_latest_stream_pid(int stream_type, unsigned int *pid);
/**
+ * @internal
+ * @brief Called when the remote client is connected or disconnected.
+ * @since_tizen 6.0
+ * @remarks This callback indicates that the new remote client is connected or existing remote client is disconnected. \n
+ The parameters are the identification of the remote client such as unique id, name, description, and recording or not, \n
+ which can help the user to make a decision to allow access from the remote client using sound_manager_set_remote_permission().
+ * @param[in] id The id of the remote client
+ * @param[in] name The name of the remote client
+ * @param[in] is_recording The flag indicating whether it's recording client or not
+ * @param[in] description The brief description of the remote client
+ * @param[in] is_connected The state of remote client connection: (@c true = connected, @c false = disconnected)
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre You should register this callback using sound_manager_publish_local_device().
+ * @see sound_manager_publish_local_device()
+ * @see sound_manager_unpublish_local_device()
+ * @see sound_manager_set_allow_remote_access()
+ */
+typedef void (*sound_manager_remote_client_connected_cb) (int id, const char *name, bool is_recording,
+ const char *description, bool is_connected, void *user_data);
+
+/**
+ * @internal
+ * @brief Publishes device's built-in audio devices to the local network.
+ * @since_tizen 6.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ * @remarks This function publishes the device's built-in audio devices such as speakers and microphones to the local network. \n
+ * The registered callback function will be invoked when the remote clients discover published audio devices and the connection established.
+ * @param[in] callback The remote client connection state changed callback function
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #SOUND_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @post sound_manager_remote_client_connected_cb() will be invoked.
+ * @see sound_manager_unpublish_local_device()
+ * @see sound_manager_set_remote_permission()
+ */
+int sound_manager_publish_local_device(sound_manager_remote_client_connected_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @brief Unpublishes device's built-in audio devices to local network.
+ * @since_tizen 6.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ * @remarks This function unpublishes the device's built-in audio devices to the local network.
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #SOUND_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @pre You should have already published using sound_manager_publish_local_device().
+ * @see sound_manager_publish_local_device()
+ * @see sound_manager_set_remote_permission()
+ */
+int sound_manager_unpublish_local_device(void);
+
+/**
+ * @internal
+ * @brief Sets the permission of accessing the local device from the remote client.
+ * @since_tizen 6.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ * @remarks
+ * @param[in] id The remote client id
+ * @param[in] allowed The permission to allow accessing from the remote client.
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #SOUND_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_publish_local_device()
+ * @see sound_manager_unpublish_local_device()
+ */
+int sound_manager_set_remote_permission(int id, bool allowed);
+
+/**
+ * @internal
+ * @brief Starts discovering of published remote devices on the local network.
+ * @since_tizen 6.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ * @remarks
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #SOUND_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_stop_discover_remote_device()
+ */
+int sound_manager_start_discover_remote_device(void);
+
+/**
+ * @internal
+ * @brief Stops discovering of published remote devices on the local network.
+ * @since_tizen 6.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/internet
+ * @remark
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ * @retval #SOUND_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @pre You should start discovering by sound_manager_start_discover_remote_device().
+ * @see sound_manager_start_discover_remote_device()
+ */
+int sound_manager_stop_discover_remote_device(void);
+
+/**
* @}
*/
CURRENT_STATUS_START_VIRTUAL_STREAM,
CURRENT_STATUS_STOP_VIRTUAL_STREAM,
CURRENT_STATUS_DESTROY_VIRTUAL_STREAM,
-#ifndef TIZEN_FEATURE_TV_PROD
CURRENT_STATUS_SET_VIRTUAL_STREAM_VOLUME,
-#endif
CURRENT_STATUS_SET_FILTER,
CURRENT_STATUS_SET_FILTER_PRESET,
CURRENT_STATUS_UNSET_FILTER,
CURRENT_STATUS_GET_MAX_MASTER_VOLUME,
CURRENT_STATUS_SET_MASTER_VOLUME,
CURRENT_STATUS_GET_MASTER_VOLUME,
- CURRENT_STATUS_SET_ACM_MASTER_MODE,
#endif
+ CURRENT_STATUS_SET_ACM_MASTER_MODE,
CURRENT_STATUS_CREATE_STREAM_DUCKING,
CURRENT_STATUS_DESTROY_STREAM_DUCKING,
CURRENT_STATUS_ACTIVATE_DUCKING,
g_menu_state = CURRENT_STATUS_STOP_VIRTUAL_STREAM;
else if (strncmp(cmd, "vdt", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_DESTROY_VIRTUAL_STREAM;
-#ifndef TIZEN_FEATURE_TV_PROD
else if (strncmp(cmd, "vsv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_VIRTUAL_STREAM_VOLUME;
-#endif
else if (strncmp(cmd, "sft", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_FILTER;
else if (strncmp(cmd, "sfp", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_MASTER_VOLUME;
else if (strncmp(cmd, "mgv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_MASTER_VOLUME;
+#endif
else if (strncmp(cmd, "acm", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_ACM_MASTER_MODE;
-#endif
else if (strncmp(cmd, "csd", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_CREATE_STREAM_DUCKING;
else if (strncmp(cmd, "dsd", MAX_CMD_LEN) == 0)
g_print("sso. *Set option for stream routing\n");
g_print("vcr. *Create VStream\t");
g_print("vsr. *Start VStream\t");
-#ifndef TIZEN_FEATURE_TV_PROD
g_print("vsv. *Set VStream Volume\n");
-#endif
g_print("vdt. *Destroy VStream\t");
g_print("vst. *Stop VStream\n");
g_print("sft. *Set Filter\t");
g_print("uft. *Unset Filter\n");
g_print("isd. *Is Stream on Device by ID\n");
g_print("gsp. *Get PID of the Latest Stream\n");
-#ifndef TIZEN_FEATURE_TV_PROD
g_print("acm. *Set ACM Master mode\n");
-#endif
g_print("dis. *Discover remote devices\n");
g_print("pub. *Publish remote devices\n");
g_print("alw. *Allow remote device\n");
g_print("*** press enter to stop virtual stream\n");
else if (g_menu_state == CURRENT_STATUS_DESTROY_VIRTUAL_STREAM)
g_print("*** press enter to destroy virtual stream\n");
-#ifndef TIZEN_FEATURE_TV_PROD
else if (g_menu_state == CURRENT_STATUS_SET_VIRTUAL_STREAM_VOLUME)
g_print("*** input volume ratio of virtual stream (Min:0.0 ~ Max:1.0)\n");
-#endif
else if (g_menu_state == CURRENT_STATUS_SET_FILTER)
g_print("*** input filter type of media stream (0:LOW_PASS 1:HIGH_PASS 2:DELAY 3:SOUNDALIVE)\n");
else if (g_menu_state == CURRENT_STATUS_SET_FILTER_PRESET)
g_print("*** input master volume level\n");
else if (g_menu_state == CURRENT_STATUS_GET_MASTER_VOLUME)
g_print("*** press enter to get master volume level\n");
+#endif
else if (g_menu_state == CURRENT_STATUS_SET_ACM_MASTER_MODE)
g_print("*** input master mode enable or disable (0:disable 1:enable)\n");
-#endif
else if (g_menu_state == CURRENT_STATUS_CREATE_STREAM_DUCKING)
g_print("*** input target stream (0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 6:VOICE_RECOGNITION 7:RINGTONE_VOIP 8:VOIP 9:MEDIA_EXTERNAL_ONLY\n");
else if (g_menu_state == CURRENT_STATUS_DESTROY_STREAM_DUCKING)
reset_menu_state();
break;
}
-#ifndef TIZEN_FEATURE_TV_PROD
case CURRENT_STATUS_SET_VIRTUAL_STREAM_VOLUME: {
int ret = SOUND_MANAGER_ERROR_NONE;
double ratio = 1.0;
reset_menu_state();
break;
}
-#endif
case CURRENT_STATUS_SET_FILTER: {
int ret = SOUND_MANAGER_ERROR_NONE;
sound_filter_e filter;
reset_menu_state();
break;
}
+#endif
case CURRENT_STATUS_SET_ACM_MASTER_MODE: {
int ret = SOUND_MANAGER_ERROR_NONE;
int selection = atoi(cmd);
reset_menu_state();
break;
}
-#endif
case CURRENT_STATUS_CREATE_STREAM_DUCKING: {
int ret = SOUND_MANAGER_ERROR_NONE;
sound_stream_type_e target_stream = SOUND_STREAM_TYPE_MEDIA;