int player_get_display_mode(player_h player, player_display_mode_e *mode);
/**
- * @brief Sets the ROI(Region Of Interest) area of display.
+ * @brief Sets the ROI (Region Of Interest) area of display.
* @since_tizen 3.0
* @remarks If no display is set, no operation is performed and
* the ROI area is valid only in #PLAYER_DISPLAY_MODE_DST_ROI display mode.
*/
int player_is_audio_only(player_h player, bool *audio_only);
+/**
+ * @brief Sets the player's replaygain status.
+ * @details If the replaygain status is @c true, replaygain is applied (if contents has a replaygain tag).
+ * If it is @c false, the replaygain isn't affected by tag and properties.
+ * @since_tizen 5.0
+ * @param[in] player The handle to the media player
+ * @param[in] enabled The new replaygain status: (@c true = enable, @c false = disable)
+ * @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_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
+ * @see player_is_replaygain_enabled()
+ */
+int player_set_replaygain_enabled(player_h player, bool enabled);
+
+/**
+ * @brief Gets the player's replaygain status.
+ * @since_tizen 5.0
+ * @param[in] player The handle to the media player
+ * @param[out] enabled Pointer to store current replaygain status:
+ * (@c true = enabled replaygain,
+ @c false = disabled replaygain)
+ * @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_INVALID_STATE Invalid player state
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @pre The player state must be one of #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
+ * @see player_set_replaygain_enable()
+ */
+int player_is_replaygain_enabled(player_h player, bool *enabled);
+
/**
* @}
*/
LOGD("LEAVE 0x%X", ret);
return ret;
}
+
+int player_set_replaygain_enabled(player_h player, bool enabled)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_REPLAYGAIN_ENABLED;
+ player_cli_s *pc = (player_cli_s *) player;
+ char *ret_buf = NULL;
+ int val = (int)enabled;
+
+ LOGD("ENTER");
+
+ player_msg_send1(api, pc, ret_buf, ret, INT, val);
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_is_replaygain_enabled(player_h player, bool *enabled)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(enabled);
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_IS_REPLAYGAIN_ENABLED;
+ player_cli_s *pc = (player_cli_s *) player;
+ char *ret_buf = NULL;
+ int val = -1;
+
+ LOGD("ENTER");
+
+ player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get(val, ret_buf);
+ *enabled = (bool) val;
+ }
+
+ g_free(ret_buf);
+ return ret;
+}
+
CURRENT_STATUS_VIDEO360_SET_ZOOM,
CURRENT_STATUS_AUDIO_CODEC_TYPE,
CURRENT_STATUS_VIDEO_CODEC_TYPE,
+ CURRENT_STATUS_REPLAYGAIN_ENABLE,
};
typedef struct {
g_print(" ==> [Player_Test] Video 360 zoom = %f\n", zoom);
}
+static void set_replaygain_enabled(bool enabled)
+{
+ if (player_set_replaygain_enabled(g_player[0], enabled) != PLAYER_ERROR_NONE)
+ g_print("failed to set_replaygain_enabled\n");
+}
+
+static void is_replaygain_enabled(bool *enable)
+{
+ player_is_replaygain_enabled(g_player[0], enable);
+ g_print(" ==> [Player_Test] replaygain = %d\n", *enable);
+}
+
#ifdef USE_EVENT_HANDLER
static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void * data, float e[3])
{
g_print("unknown menu \n");
}
} else if (len == 3) {
- if (strncmp(cmd, "trs", 3) == 0)
+ if (strncmp(cmd, "trs", 3) == 0) {
g_menu_state = CURRENT_STATUS_STREAMING_PLAYBACK_RATE;
- else
+ } else if (strncmp(cmd, "rgs", 3) == 0) {
+ g_menu_state = CURRENT_STATUS_REPLAYGAIN_ENABLE;
+ } else if (strncmp(cmd, "rgg", 3) == 0) {
+ bool enable;
+ is_replaygain_enabled(&enable);
+ } else {
g_print("unknown menu \n");
+ }
} else if (len == 4) {
if (!strncmp(cmd, "v3sp", 4))
video360_is_spherical();
g_print("v3gf. Get Field Of View\n");
g_print("[Video 360] v3sz. Set Zoom\t\t");
g_print("v3gz. Get Zoom\n");
+ g_print("[Replaygain] rgs. Set Replaygain\t\t");
+ g_print("rgg. Get replaygain\n");
g_print("[etc] sp. Set Progressive Download\t");
g_print("gp. Get Progressive Download status\t");
g_print("mp. memory playback\n");
g_print("*** set audio codec type (1: HW, 2: SW) \n");
} else if (g_menu_state == CURRENT_STATUS_VIDEO_CODEC_TYPE) {
g_print("*** set video codec type (1: HW, 2: SW) \n");
+ } else if (g_menu_state == CURRENT_STATUS_REPLAYGAIN_ENABLE) {
+ g_print("*** input replaygain value.(0:disable, 1: enable) \n");
} else {
g_print("*** unknown status.\n");
quit_program();
reset_menu_state();
}
break;
+ case CURRENT_STATUS_REPLAYGAIN_ENABLE:
+ {
+ int value = atoi(cmd);
+ set_replaygain_enabled(value);
+ reset_menu_state();
+ }
+ break;
}
g_timeout_add(100, timeout_menu_display, 0);