* 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
* @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
- * @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
- * @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
* @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.
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;
- mmplayer_volume_type_t vol;
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;
}
-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;
- mmplayer_volume_type_t vol;
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__);
}
- *left = vol.level[MM_VOLUME_CHANNEL_LEFT];
- *right = vol.level[MM_VOLUME_CHANNEL_RIGHT];
return PLAYER_ERROR_NONE;
}
int legacy_player_is_muted(legacy_player_h player, bool *muted)
{
legacy_player_t *handle = (legacy_player_t *)player;
- int _mute;
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__);
- *muted = (bool)_mute;
-
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;
- double left, right;
+ double volume = 0.0;
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);
- 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;
}
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VOLUME;
muse_player_handle_t *muse_player = NULL;
- float left, right;
+ float volume = 0.0;
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);
return ret;
}
Name: mmsvc-player
Summary: A Media Player module for muse server
-Version: 0.2.108
+Version: 0.2.109
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0