* <td>This function must be called before player_prepare()</td>
* </tr>
* <tr>
- * <td>player_set_sound_type()</td>
- * <td>IDLE</td>
- * <td>This function must be called before player_prepare()</td>
- * </tr>
- * <tr>
* <td>player_set_mute()</td>
* <td>IDLE/ READY/ PLAYING/ PAUSED</td>
* <td>This function must be called after player_create()</td>
* @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
*/
typedef enum {
- PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict and the player handle will be paused or unprepared */
- PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT = 4, /**< Interrupted by a resource conflict and the player handle will be paused or unprepared */
} player_interrupted_code_e;
/**
int player_get_volume(player_h player, float *left, float *right);
/**
- * @deprecated Deprecated since 3.0. Use player_set_sound_stream_info() instead.
- * @brief Sets the player's volume type.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks The default sound type of the player is #SOUND_TYPE_MEDIA.
- * To get the current sound type, use sound_manager_get_current_sound_type().
- * @remarks If stream_info already exists by calling sound_manager_create_stream_info(),
- * It will return error since 3.0.
- *
- * @param[in] player The handle to the media player
- * @param[in] type The sound type
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #PLAYER_ERROR_NONE Successful
- * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create().
- * @see sound_manager_get_current_sound_type()
- */
-int player_set_sound_type(player_h player, sound_type_e type) TIZEN_DEPRECATED_API;
-
-/**
* @brief Sets the player's sound manager stream information.
* @since_tizen 3.0
* @remarks You can set sound stream information including audio routing and volume type.
}
#endif
-static char* _convert_code_to_str(int code)
-{
- switch (code) {
- case PLAYER_INTERRUPTED_COMPLETED: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_COMPLETED";
- case PLAYER_INTERRUPTED_BY_MEDIA: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_BY_MEDIA";
- case PLAYER_INTERRUPTED_BY_CALL: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_BY_CALL";
- case PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG";
- case PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT:
- return "PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT";
- case PLAYER_INTERRUPTED_BY_ALARM: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_BY_ALARM";
- case PLAYER_INTERRUPTED_BY_EMERGENCY: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_BY_EMERGENCY";
- case PLAYER_INTERRUPTED_BY_NOTIFICATION: /* Deprecated since 3.0 */
- return "PLAYER_INTERRUPTED_BY_NOTIFICATION";
- default:
- LOGE("Invalid interrupted code %d (Never enter here)", code);
- return NULL;
- }
-}
-
static void __interrupt_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
{
int code;
muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_INTERRUPT;
- if (player_msg_get(code, recv_data->buffer)) {
-
- if (code >= PLAYER_INTERRUPTED_COMPLETED &&
- code <= PLAYER_INTERRUPTED_BY_NOTIFICATION &&
- code != PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT) {
- LOGW("DEPRECATION WARNING: %s is deprecated and will be removed from next release.", _convert_code_to_str(code));
- }
-
+ if (player_msg_get(code, recv_data->buffer))
((player_interrupted_cb) cb_info->user_cb[ev]) (code, cb_info->user_data[ev]);
- }
}
static void __error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
return ret;
}
-int player_set_sound_type(player_h player, sound_type_e type)
-{
- PLAYER_INSTANCE_CHECK(player);
- int ret = PLAYER_ERROR_NONE;
- muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_TYPE;
- player_cli_s *pc = (player_cli_s *) player;
- char *ret_buf = NULL;
-
- LOGD("ENTER");
- LOGW("DEPRECATION WARNING: player_set_sound_type() is deprecated and will be removed from next release. Use player_set_sound_stream_info() instead.");
-
- player_msg_send1(api, pc, ret_buf, ret, INT, type);
- g_free(ret_buf);
- return ret;
-}
-
int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
{
PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SOUND_STREAM);
CURRENT_STATUS_HANDLE_NUM,
CURRENT_STATUS_FILENAME,
CURRENT_STATUS_VOLUME,
- CURRENT_STATUS_SOUND_TYPE,
CURRENT_STATUS_SOUND_STREAM_INFO,
CURRENT_STATUS_MUTE,
CURRENT_STATUS_POSITION_TIME,
static void _player_set_progressive_download()
{
- player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
+ player_set_progressive_download_path(g_player[0], "/tmp/test.pd");
player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]);
}
g_print(" ==> [Player_Audio_Test] mute = %d\n", *mute);
}
-static void set_sound_type(sound_type_e type)
-{
- if (player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE)
- g_print("failed to set sound type(%d)\n", type);
- else
- g_print("set sound type(%d) success", type);
-}
-
void focus_callback(sound_stream_info_h stream_info,
sound_stream_focus_mask_e focus_mask,
sound_stream_focus_state_e focus_state,
float left;
float right;
get_volume(&left, &right);
- } else if (strncmp(cmd, "z", 1) == 0) {
- g_menu_state = CURRENT_STATUS_SOUND_TYPE;
} else if (strncmp(cmd, "k", 1) == 0) {
g_menu_state = CURRENT_STATUS_SOUND_STREAM_INFO;
} else if (strncmp(cmd, "h", 1) == 0) {
g_print("*** input mediapath.\n");
} else if (g_menu_state == CURRENT_STATUS_VOLUME) {
g_print("*** input volume value.(0~1.0)\n");
- } else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) {
- g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n");
} else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO) {
g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 9:MEDIA_EXT_ONLY)\n");
} else if (g_menu_state == CURRENT_STATUS_MUTE) {
reset_menu_state();
}
break;
- case CURRENT_STATUS_SOUND_TYPE:
- {
- int type = atoi(cmd);
- set_sound_type(type);
- reset_menu_state();
- }
- break;
case CURRENT_STATUS_SOUND_STREAM_INFO:
{
int type = atoi(cmd);
CURRENT_STATUS_HANDLE_NUM,
CURRENT_STATUS_FILENAME,
CURRENT_STATUS_VOLUME,
- CURRENT_STATUS_SOUND_TYPE,
CURRENT_STATUS_SOUND_STREAM_INFO,
CURRENT_STATUS_MUTE,
CURRENT_STATUS_POSITION_TIME,
static void _player_set_progressive_download()
{
- player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
+ player_set_progressive_download_path(g_player[0], "/tmp/test.pd");
player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]);
}
g_print(" ==> [Player_Test] mute = %d\n", *mute);
}
-static void set_sound_type(sound_type_e type)
-{
- if (player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE)
- g_print("failed to set sound type(%d)\n", type);
- else
- g_print("set sound type(%d) success", type);
-}
-
void focus_callback(sound_stream_info_h stream_info,
sound_stream_focus_mask_e focus_mask,
sound_stream_focus_state_e focus_state,
float left;
float right;
get_volume(&left, &right);
- } else if (strncmp(cmd, "z", 1) == 0) {
- g_menu_state = CURRENT_STATUS_SOUND_TYPE;
} else if (strncmp(cmd, "k", 1) == 0) {
g_menu_state = CURRENT_STATUS_SOUND_STREAM_INFO;
} else if (strncmp(cmd, "h", 1) == 0) {
g_print("*** input mediapath.\n");
} else if (g_menu_state == CURRENT_STATUS_VOLUME) {
g_print("*** input volume value.(0~1.0)\n");
- } else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) {
- g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n");
} else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO) {
g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 9:MEDIA_EXT_ONLY)\n");
} else if (g_menu_state == CURRENT_STATUS_MUTE) {
reset_menu_state();
}
break;
- case CURRENT_STATUS_SOUND_TYPE:
- {
- int type = atoi(cmd);
- set_sound_type(type);
- reset_menu_state();
- }
- break;
case CURRENT_STATUS_SOUND_STREAM_INFO:
{
int type = atoi(cmd);