[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate bool AdaptiveVariantCallback(int bandwidth, int width, int height, IntPtr userData);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate bool SupportedMediaFormatCallback(int format, IntPtr userData);
+
[DllImport(Libraries.Player, EntryPoint = "player_create")]
internal static extern PlayerErrorCode Create(out PlayerHandle player);
[DllImport(Libraries.Player, EntryPoint = "player_audio_pitch_get_value")]
internal static extern PlayerErrorCode GetAudioPitch(IntPtr player, out float level);
+
+ [DllImport(Libraries.Player, EntryPoint = "player_audio_offload_set_enabled")]
+ internal static extern PlayerErrorCode SetAudioOffloadEnabled(IntPtr player, bool value);
+
+ [DllImport(Libraries.Player, EntryPoint = "player_audio_offload_is_enabled")]
+ internal static extern PlayerErrorCode IsAudioOffloadEnabled(IntPtr player, out bool value);
+
+ [DllImport(Libraries.Player, EntryPoint = "player_audio_offload_is_activated")]
+ internal static extern PlayerErrorCode IsAudioOffloadActivated(IntPtr player, out bool value);
+
+ [DllImport(Libraries.Player, EntryPoint = "player_audio_offload_foreach_supported_format")]
+ internal static extern PlayerErrorCode SupportedAudioOffloadFormat(IntPtr player, SupportedMediaFormatCallback callback, IntPtr userData);
}
internal class PlayerHandle : SafeHandle
{
Player = owner;
- bool available = false;
-
- Native.EqualizerIsAvailable(Player.Handle, out available).
- ThrowIfFailed(Player, "Failed to initialize the AudioEffect");
-
- IsAvailable = available;
-
- if (IsAvailable == false)
+ if (IsAvailable== false)
{
return;
}
- int count = 0;
- Native.GetEqualizerBandsCount(Player.Handle, out count).
- ThrowIfFailed(Player, "Failed to initialize the AudioEffect");
-
- int min = 0;
- int max = 0;
- Native.GetEqualizerLevelRange(Player.Handle, out min, out max).
- ThrowIfFailed(Player, "Failed to initialize the AudioEffect");
-
- Count = count;
- BandLevelRange = new Range(min, max);
-
- _bands = new EqualizerBand[count];
+ _bands = new EqualizerBand[Count];
}
/// <summary>
/// -or-<br/>
/// <paramref name="index"/> is equal to or greater than <see cref="Count"/>.
/// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
public EqualizerBand this[int index]
{
get
{
Player.ValidateNotDisposed();
+ Player.AudioOffload.CheckDisabled();
if (index < 0 || Count <= index)
{
/// Clears the equalizer effect.
/// </summary>
/// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
public void Clear()
{
Player.ValidateNotDisposed();
+ Player.AudioOffload.CheckDisabled();
Native.EqualizerClear(Player.Handle).
ThrowIfFailed(Player, "Failed to clear equalizer effect");
/// <summary>
/// Gets the number of items.
/// </summary>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
- public int Count { get; }
+ public int Count
+ {
+ get
+ {
+ Player.AudioOffload.CheckDisabled();
+
+ Native.GetEqualizerBandsCount(Player.Handle, out var count).
+ ThrowIfFailed(Player, "Failed to initialize the AudioEffect");
+
+ return count;
+ }
+ }
/// <summary>
/// Gets the band level range of the bands in the dB.
/// </summary>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
- public Range BandLevelRange { get; }
+ public Range BandLevelRange
+ {
+ get
+ {
+ Player.AudioOffload.CheckDisabled();
+
+ Native.GetEqualizerLevelRange(Player.Handle, out var min, out var max).
+ ThrowIfFailed(Player, "Failed to initialize the AudioEffect");
+
+ return new Range(min, max);
+ }
+ }
/// <summary>
/// Gets the value whether the AudioEffect is available or not.
/// </summary>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
- public bool IsAvailable { get; }
+ public bool IsAvailable
+ {
+ get
+ {
+ Player.AudioOffload.CheckDisabled();
+
+ Native.EqualizerIsAvailable(Player.Handle, out var available).
+ ThrowIfFailed(Player, "Failed to initialize the AudioEffect");
+ return available;
+ }
+ }
/// <summary>
/// Gets the player that this AudioEffect belongs to.
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using static Interop;
+
+namespace Tizen.Multimedia
+{
+ /// <summary>
+ /// Provides the ability to control the audio offload for <see cref="Multimedia.Player"/>.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ public class AudioOffload
+ {
+ private IList<MediaFormatAudioMimeType> _supportedFormat;
+ private Player _player { get; }
+
+ /// <summary>
+ /// Provides a means to retrieve audio offload information.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ internal AudioOffload(Player player)
+ {
+ Debug.Assert(player != null);
+ _player = player;
+ }
+
+ private bool _enabled;
+ internal void CheckDisabled()
+ {
+ if (_enabled)
+ {
+ throw new InvalidOperationException("the audio offload is enabled.");
+ }
+ }
+
+ /// <summary>
+ /// Enables or disables the audio offload.
+ /// </summary>
+ /// <value>The value indicating whether or not AudioOffload is enabled. The default value is false.</value>
+ /// <remarks><para>The player lets the hardware decode and render the sound if the audio offload is enabled.
+ /// This will reduce the power consumption, but will disable the ability to handle output PCM.
+ /// Please check the below list of functions which will not work if offloading is enabled.</para>
+ /// <para>If audio offload is enabled, the following functions will return <see cref="InvalidOperationException"/>
+ /// and they will not work at all even if they were called before offload is enabled.<br/>
+ /// <see cref="AudioEffect"/><br/>
+ /// <see cref="EqualizerBand"/><br/>
+ /// <see cref="PlayerTrackInfo"/><br/>
+ /// <see cref="Player.EnableExportingAudioData"/><br/>
+ /// <see cref="Player.AudioLatencyMode"/><br/>
+ /// <see cref="Player.SetPlaybackRate"/><br/>
+ /// <see cref="Player.ReplayGain"/><br/>
+ /// <see cref="Player.AudioPitch"/><br/>
+ /// <see cref="Player.AudioPitchEnabled"/><br/></para>
+ /// <para>To set, the player must be in the <see cref="PlayerState.Idle"/> state.
+ /// The sound stream type of the player should be <see cref="AudioStreamType.Media"/>.</para></remarks>
+ /// <feature>http://tizen.org/feature/multimedia.player.audio_offload</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The player is not in the valid state.<br/>
+ /// -or-<br/>
+ /// Operation failed; internal error.
+ /// </exception>
+ /// <since_tizen> 6 </since_tizen>
+ public bool IsEnabled
+ {
+ get
+ {
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.AudioOffload);
+ _player.ValidateNotDisposed();
+
+ NativePlayer.IsAudioOffloadEnabled(_player.Handle, out var value).
+ ThrowIfFailed(_player, "Failed to get whether the audio offload of the player is enabled or not");
+ return value;
+ }
+
+ set
+ {
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.AudioOffload);
+ _player.ValidateNotDisposed();
+ _player.ValidatePlayerState(PlayerState.Idle);
+
+ NativePlayer.SetAudioOffloadEnabled(_player.Handle, value).
+ ThrowIfFailed(_player, "Failed to set the audio offload of the player");
+ _enabled = value;
+ }
+ }
+
+ /// <summary>
+ /// Get a state whether or not the audio offload is activated.
+ /// </summary>
+ /// <value>The value indicating whether or not AudioOffload is activated.</value>
+ /// <remarks>
+ /// Audio offload could be inactivated depending on the audio device capability even if the audio offload feature is supported.
+ /// The <see cref="Player"/> that owns this instance must be in the <see cref="PlayerState.Ready"/>,
+ /// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state.
+ /// </remarks>
+ /// <feature>http://tizen.org/feature/multimedia.player.audio_offload</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The player is not in the valid state.<br/>
+ /// -or-<br/>
+ /// Operation failed; internal error.
+ /// </exception>
+ /// <since_tizen> 6 </since_tizen>
+ public bool IsActivated
+ {
+ get
+ {
+ ValidationUtil.ValidateFeatureSupported(PlayerFeatures.AudioOffload);
+ _player.ValidateNotDisposed();
+ _player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
+
+ NativePlayer.IsAudioOffloadActivated(_player.Handle, out var value).
+ ThrowIfFailed(_player, "Failed to get whether the audio offload of the player is enabled or not");
+ return value;
+ }
+ }
+
+ /// <summary>
+ /// Retrieves all formats for audio offload.
+ /// </summary>
+ /// <returns>
+ /// It returns a list contained all formats for audio offload.
+ /// </returns>
+ /// <remarks>The supported media format can vary depending on the device capabilities.</remarks>
+ /// <feature>http://tizen.org/feature/multimedia.player.audio_offload</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// Operation failed; internal error.
+ /// </exception>
+ /// <seealso cref="MediaFormatAudioMimeType"/>
+ /// <since_tizen> 6 </since_tizen>
+ public IEnumerable<MediaFormatAudioMimeType> SupportedFormats
+ {
+ get
+ {
+ if (_supportedFormat == null)
+ {
+ _supportedFormat = GetSupportedFormats();
+ }
+
+ return _supportedFormat;
+ }
+ }
+
+ private IList<MediaFormatAudioMimeType> GetSupportedFormats()
+ {
+ List<MediaFormatAudioMimeType> audioFormats = new List<MediaFormatAudioMimeType>();
+
+ NativePlayer.SupportedMediaFormatCallback callback = (int format, IntPtr userData) =>
+ {
+ if (!Enum.IsDefined(typeof(MediaFormatAudioMimeType), format))
+ {
+ Log.Warn(PlayerLog.Tag, "not supported : " + format.ToString());
+ return false;
+ }
+
+ Log.Debug(PlayerLog.Tag, "supported : " + ((MediaFormatAudioMimeType)format).ToString());
+ audioFormats.Add((MediaFormatAudioMimeType)format);
+ return true;
+ };
+
+ NativePlayer.SupportedAudioOffloadFormat(_player.Handle, callback, IntPtr.Zero).
+ ThrowIfFailed(_player, "Failed to get the supported formats for audio offload");
+
+ return audioFormats.AsReadOnly();
+ }
+ }
+}
_owner = owner;
_index = index;
- Native.GetEqualizerBandFrequency(_owner.Player.Handle, _index, out var frequency).
- ThrowIfFailed(_owner.Player, "Failed to initialize equalizer band");
-
- Native.GetEqualizerBandFrequencyRange(_owner.Player.Handle, _index, out var range).
- ThrowIfFailed(_owner.Player, "Failed to initialize equalizer band");
-
- Frequency = frequency;
- FrequencyRange = range;
- Log.Debug(PlayerLog.Tag, "frequency : " + frequency + ", range : " + range);
+ Log.Debug(PlayerLog.Tag, "frequency : " + Frequency + ", range : " + FrequencyRange);
}
/// <summary>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="value"/> is not inside of <see cref="AudioEffect.BandLevelRange"/>.
/// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
public int Level
{
get
{
_owner.Player.ValidateNotDisposed();
+ _owner.Player.AudioOffload.CheckDisabled();
Native.GetEqualizerBandLevel(_owner.Player.Handle, _index, out var value).
ThrowIfFailed(_owner.Player, "Failed to get the level of the equalizer band");
set
{
_owner.Player.ValidateNotDisposed();
+ _owner.Player.AudioOffload.CheckDisabled();
if (value < _owner.BandLevelRange.Min || _owner.BandLevelRange.Max < value)
{
/// <summary>
/// Gets the frequency in the dB.
/// </summary>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
- public int Frequency { get; }
+ public int Frequency
+ {
+ get
+ {
+ _owner.Player.AudioOffload.CheckDisabled();
+
+ Native.GetEqualizerBandFrequency(_owner.Player.Handle, _index, out var frequency).
+ ThrowIfFailed(_owner.Player, "Failed to initialize equalizer band");
+
+ return frequency;
+ }
+ }
/// <summary>
/// Gets the frequency range in the dB.
/// </summary>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
- public int FrequencyRange { get; }
+ public int FrequencyRange
+ {
+ get
+ {
+ _owner.Player.AudioOffload.CheckDisabled();
+
+ Native.GetEqualizerBandFrequencyRange(_owner.Player.Handle, _index, out var frequencyRange).
+ ThrowIfFailed(_owner.Player, "Failed to initialize equalizer band");
+
+ return frequencyRange;
+ }
+ }
}
}
/// </remarks>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="ArgumentException">The value is not valid.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
public AudioLatencyMode AudioLatencyMode
{
get
{
+ AudioOffload.CheckDisabled();
+
NativePlayer.GetAudioLatencyMode(Handle, out var value).
ThrowIfFailed(this, "Failed to get the audio latency mode of the player");
set
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
ValidationUtil.ValidateEnum(typeof(AudioLatencyMode), value, nameof(value));
/// <value>If the replaygain status is true, replaygain is applied (if contents has a replaygain tag);
/// otherwise, the replaygain is not affected by tag and properties.</value>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
- /// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The player is not in the valid state.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 5 </since_tizen>
public bool ReplayGain
{
get
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
+
NativePlayer.IsReplayGain(Handle, out var value).
ThrowIfFailed(this, "Failed to get the replaygain of the player");
return value;
set
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
+
NativePlayer.SetReplayGain(Handle, value).
ThrowIfFailed(this, "Failed to set the replaygain of the player");
}
/// <value>The value indicating whether or not AudioPitch is enabled. The default is false.</value>
/// <remarks>This function is used for audio content only.
/// To set, the player must be in the <see cref="PlayerState.Idle"/> state.</remarks>
- /// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The player is not in the valid state.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <seealso cref="AudioPitch"/>
/// <since_tizen> 6 </since_tizen>
get
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
+
NativePlayer.IsAudioPitchEnabled(Handle, out var value).
ThrowIfFailed(this, "Failed to get whether the audio pitch is enabled or not");
return value;
set
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
ValidatePlayerState(PlayerState.Idle);
NativePlayer.SetAudioPitchEnabled(Handle, value).
/// <value>The audio stream pitch value. The default is 1.</value>
/// <remarks>Enabling pitch control could increase the CPU usage on some devices.
/// This function is used for audio content only.</remarks>
- /// <exception cref="InvalidOperationException">A pitch is not enabled.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// A pitch is not enabled.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
/// <exception cref="ArgumentOutOfRangeException">
/// value is less than 0.5.
get
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
if (AudioPitchEnabled == false)
{
set
{
ValidateNotDisposed();
+ AudioOffload.CheckDisabled();
if (AudioPitchEnabled == false)
{
return _adaptiveVariants;
}
}
+
+ private AudioOffload _audioOffload;
+
+ /// <summary>
+ /// Gets the setting for audio offload.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ public AudioOffload AudioOffload
+ {
+ get
+ {
+ if (_audioOffload == null)
+ {
+ _audioOffload = new AudioOffload(this);
+ }
+
+ return _audioOffload;
+ }
+ }
}
}
/// The player is not in the valid state.<br/>
/// -or-<br/>
/// Streaming playback.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="rate"/> is less than -5.0.<br/>
throw new ArgumentOutOfRangeException(nameof(rate), rate, "Valid range is -5.0 to 5.0 (except 0.0)");
}
+ AudioOffload.CheckDisabled();
ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
NativePlayer.SetPlaybackRate(Handle, rate).ThrowIfFailed(this, "Failed to set the playback rate.");
/// Operation failed; internal error.
/// -or-<br/>
/// The player is not in the valid state.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
/// </exception>
/// <seealso cref="PlayerAudioExtractOption"/>
/// <seealso cref="DisableExportingAudioData"/>
/// <since_tizen> 6 </since_tizen>
public void EnableExportingAudioData(AudioMediaFormat format, PlayerAudioExtractOption option)
{
- ValidatePlayerState(PlayerState.Idle);
ValidationUtil.ValidateEnum(typeof(PlayerAudioExtractOption), option, nameof(option));
+ AudioOffload.CheckDisabled();
+ ValidatePlayerState(PlayerState.Idle);
_audioFrameDecodedCallback = (IntPtr packetHandle, IntPtr userData) =>
{
internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video";
internal const string OpenGl = "http://tizen.org/feature/opengles.version.2_0";
internal const string SphericalVideo = "http://tizen.org/feature/multimedia.player.spherical_video";
+ internal const string AudioOffload = "http://tizen.org/feature/multimedia.player.audio_offload";
}
}
/// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state.
/// </remarks>
/// <exception cref="ObjectDisposedException">The <see cref="Player"/> that this instance belongs to has been disposed of.</exception>
- /// <exception cref="InvalidOperationException">The <see cref="Player"/> that this instance belongs to is not in the valid state.</exception>
+ /// <exception cref="InvalidOperationException">The <see cref="Player"/> that this instance belongs to is not in the valid state.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <since_tizen> 3 </since_tizen>
public int GetCount()
{
+ _owner.ValidateNotDisposed();
+ _owner.AudioOffload.CheckDisabled();
_owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
NativePlayer.GetTrackCount(_owner.Handle, _streamType, out var count).
/// <para>The language codes are defined in ISO 639-1.</para>
/// </remarks>
/// <exception cref="ObjectDisposedException">The <see cref="Player"/> that this instance belongs to has been disposed of.</exception>
- /// <exception cref="InvalidOperationException">The <see cref="Player"/> that this instance belongs to is not in the valid state.</exception>
+ /// <exception cref="InvalidOperationException">The <see cref="Player"/> that this instance belongs to is not in the valid state.
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="index"/> is less than zero.<br/>
/// -or-<br/>
/// <since_tizen> 3 </since_tizen>
public string GetLanguageCode(int index)
{
- _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
+ _owner.ValidateNotDisposed();
if (index < 0 || GetCount() <= index)
{
$"Valid index range is 0 <= x < {nameof(GetCount)}(), but got { index }.");
}
+ _owner.AudioOffload.CheckDisabled();
+ _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
+
IntPtr code = IntPtr.Zero;
try
/// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state.
/// </remarks>
/// <exception cref="ObjectDisposedException">The <see cref="Player"/> that this instance belongs to has been disposed of.</exception>
- /// <exception cref="InvalidOperationException">The <see cref="Player"/> that this instance belongs to is not in the valid state.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// The <see cref="Player"/> that this instance belongs to is not in the valid state.<br/>
+ /// -or-<br/>
+ /// If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
+ /// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="value"/> is less than zero.<br/>
/// -or-<br/>
{
get
{
+ _owner.ValidateNotDisposed();
+ _owner.AudioOffload.CheckDisabled();
_owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
NativePlayer.GetCurrentTrack(_owner.Handle, _streamType, out var value).
}
set
{
+ _owner.ValidateNotDisposed();
+
if (value < 0 || GetCount() <= value)
{
throw new ArgumentOutOfRangeException(nameof(value), value,
$"Valid index range is 0 <= x < {nameof(GetCount)}(), but got { value }.");
}
+ _owner.AudioOffload.CheckDisabled();
_owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
NativePlayer.SelectTrack(_owner.Handle, _streamType, value).