示例#1
0
        /// <summary>
        /// Clears the equalizer effect.
        /// </summary>
        /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception>
        /// <since_tizen> 3 </since_tizen>
        public void Clear()
        {
            Player.ValidateNotDisposed();

            Native.EqualizerClear(Player.Handle).
            ThrowIfFailed("Failed to clear equalizer effect");
        }
示例#2
0
        internal AudioEffect(Player owner)
        {
            Player = owner;

            bool available = false;

            Native.EqualizerIsAvailable(Player.Handle, out available).
            ThrowIfFailed("Failed to initialize the AudioEffect");

            IsAvailable = available;

            if (IsAvailable == false)
            {
                return;
            }

            int count = 0;

            Native.GetEqualizerBandsCount(Player.Handle, out count).
            ThrowIfFailed("Failed to initialize the AudioEffect");

            int min = 0;
            int max = 0;

            Native.GetEqualizerLevelRange(Player.Handle, out min, out max).
            ThrowIfFailed("Failed to initialize the AudioEffect");

            Count          = count;
            BandLevelRange = new Range(min, max);

            _bands = new EqualizerBand[count];
        }
示例#3
0
        /// <summary>
        /// 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");
        }
示例#4
0
        /// <summary>
        /// Clears the equalizer effect.
        /// </summary>
        /// <exception cref="ObjectDisposedException">The <see cref="Player"/> has already been disposed of.</exception>
        /// <exception cref="NotAvailableException">If audio offload is enabled by calling <see cref="AudioOffload.IsEnabled"/>. (Since tizen 6.0)
        ///     -or-<br/>
        ///     <see cref="IsAvailable"/> returns false. (Since tizen 6.0)
        /// </exception>
        /// <seealso cref="IsAvailable"/>
        /// <since_tizen> 3 </since_tizen>
        public void Clear()
        {
            Player.ValidateNotDisposed();
            Player.AudioOffload.CheckDisabled();

            if (IsAvailable == false)
            {
                throw new NotAvailableException("The function is not available.");
            }

            Native.EqualizerClear(Player.Handle).
            ThrowIfFailed(Player, "Failed to clear equalizer effect");
        }
示例#5
0
        internal EqualizerBand(AudioEffect owner, int index)
        {
            Debug.Assert(owner != null);

            _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);
        }