- change set/get volume function interface
by using united volume parameter instead of
left and right volume which is not used anymore.
Change-Id: I11895b1574a7d4776b4704660dec19b42bbe4ec9
* Finally, it does not support to set other value into each channel currently.
*
* @param[in] player The handle to the media player
* Finally, it does not support to set other value into each channel currently.
*
* @param[in] player The handle to the media player
- * @param[in] left The left volume scalar
- * @param[in] right The right volume scalar
+ * @param[in] volume The volume scalar
* @return @c 0 on success,
* otherwise a negative error value
* @retval #PLAYER_ERROR_NONE Successful
* @return @c 0 on success,
* otherwise a negative error value
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
* @see legacy_player_get_volume()
*/
* @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
* @see legacy_player_get_volume()
*/
-int legacy_player_set_volume(legacy_player_h player, float left, float right);
+int legacy_player_set_volume(legacy_player_h player, float volume);
/**
* @brief Gets the player's current volume factor.
* @since_tizen 2.3
/**
* @brief Gets the player's current volume factor.
* @since_tizen 2.3
- * @details The range of @a left and @a right is from @c 0 to @c 1.0, inclusive (1.0 = 100%).
+ * @details The range of @a volume is from @c 0 to @c 1.0, inclusive (1.0 = 100%).
* This function gets the player volume, not the system volume.
* To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
*
* @param[in] player The handle to the media player
* This function gets the player volume, not the system volume.
* To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
*
* @param[in] player The handle to the media player
- * @param[out] left The current left volume scalar
- * @param[out] right The current right volume scalar
+ * @param[out] volume The current volume scalar
* @return @c 0 on success,
* otherwise a negative error value
* @retval #PLAYER_ERROR_NONE Successful
* @return @c 0 on success,
* otherwise a negative error value
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
* @see legacy_player_set_volume()
*/
* @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
* @see legacy_player_set_volume()
*/
-int legacy_player_get_volume(legacy_player_h player, float *left, float *right);
+int legacy_player_get_volume(legacy_player_h player, float *volume);
/**
* @brief Sets the player's sound manager stream information.
/**
* @brief Sets the player's sound manager stream information.
return PLAYER_ERROR_NONE;
}
return PLAYER_ERROR_NONE;
}
-int legacy_player_set_volume(legacy_player_h player, float left, float right)
+int legacy_player_set_volume(legacy_player_h player, float volume)
{
legacy_player_t *handle = (legacy_player_t *)player;
{
legacy_player_t *handle = (legacy_player_t *)player;
- mmplayer_volume_type_t vol;
int ret = MM_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
int ret = MM_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
- PLAYER_CHECK_CONDITION(left >= 0 && left <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- PLAYER_CHECK_CONDITION(right >= 0 && right <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
+ PLAYER_CHECK_CONDITION(volume >= 0 && volume <= 1.0, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER");
- vol.level[MM_VOLUME_CHANNEL_LEFT] = left;
- vol.level[MM_VOLUME_CHANNEL_RIGHT] = right;
- ret = mm_player_set_volume(handle->mm_handle, &vol);
+ ret = mm_player_set_volume(handle->mm_handle, volume);
if (ret != MM_ERROR_NONE)
return __player_convert_error_code(ret, (char *)__FUNCTION__);
return PLAYER_ERROR_NONE;
}
if (ret != MM_ERROR_NONE)
return __player_convert_error_code(ret, (char *)__FUNCTION__);
return PLAYER_ERROR_NONE;
}
-int legacy_player_get_volume(legacy_player_h player, float *left, float *right)
+int legacy_player_get_volume(legacy_player_h player, float *volume)
{
legacy_player_t *handle = (legacy_player_t *)player;
{
legacy_player_t *handle = (legacy_player_t *)player;
- mmplayer_volume_type_t vol;
int ret = MM_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
int ret = MM_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(left);
- PLAYER_NULL_ARG_CHECK(right);
+ PLAYER_NULL_ARG_CHECK(volume);
- ret = mm_player_get_volume(handle->mm_handle, &vol);
+ ret = mm_player_get_volume(handle->mm_handle, volume);
if (ret != MM_ERROR_NONE) {
return __player_convert_error_code(ret, (char *)__FUNCTION__);
}
if (ret != MM_ERROR_NONE) {
return __player_convert_error_code(ret, (char *)__FUNCTION__);
}
- *left = vol.level[MM_VOLUME_CHANNEL_LEFT];
- *right = vol.level[MM_VOLUME_CHANNEL_RIGHT];
return PLAYER_ERROR_NONE;
}
return PLAYER_ERROR_NONE;
}
int legacy_player_is_muted(legacy_player_h player, bool *muted)
{
legacy_player_t *handle = (legacy_player_t *)player;
int legacy_player_is_muted(legacy_player_h player, bool *muted)
{
legacy_player_t *handle = (legacy_player_t *)player;
int ret = MM_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(muted);
int ret = MM_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(muted);
- ret = mm_player_get_mute(handle->mm_handle, &_mute);
+ ret = mm_player_get_mute(handle->mm_handle, muted);
if (ret != MM_ERROR_NONE)
return __player_convert_error_code(ret, (char *)__FUNCTION__);
if (ret != MM_ERROR_NONE)
return __player_convert_error_code(ret, (char *)__FUNCTION__);
- *muted = (bool)_mute;
-
return PLAYER_ERROR_NONE;
}
return PLAYER_ERROR_NONE;
}
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_VOLUME;
muse_player_handle_t *muse_player = NULL;
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_SET_VOLUME;
muse_player_handle_t *muse_player = NULL;
bool ret_val = true;
ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
bool ret_val = true;
ret_val = _player_disp_get_param_value(muse_server_module_get_msg(module),
- MUSE_TYPE_DOUBLE, "left", (void *)&left,
- MUSE_TYPE_DOUBLE, "right", (void *)&right,
+ MUSE_TYPE_DOUBLE, "volume", (void *)&volume,
INVALID_MUSE_TYPE_VALUE);
if (ret_val) {
muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
INVALID_MUSE_TYPE_VALUE);
if (ret_val) {
muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- ret = legacy_player_set_volume(muse_player->player_handle, (float)left, (float)right);
+ ret = legacy_player_set_volume(muse_player->player_handle, (float)volume);
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
}
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
}
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VOLUME;
muse_player_handle_t *muse_player = NULL;
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VOLUME;
muse_player_handle_t *muse_player = NULL;
muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
muse_player = (muse_player_handle_t *)muse_server_ipc_get_handle(module);
- ret = legacy_player_get_volume(muse_player->player_handle, &left, &right);
+ ret = legacy_player_get_volume(muse_player->player_handle, &volume);
- PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_DOUBLE, "left", (double)left, MUSE_TYPE_DOUBLE, "right", (double)right);
+ PLAYER_RETURN_MSG(api, ret, module, MUSE_TYPE_DOUBLE, "volume", (double)volume);
Name: mmsvc-player
Summary: A Media Player module for muse server
Name: mmsvc-player
Summary: A Media Player module for muse server
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0