Пример #1
0
        void Reassign(int h)
        {
            Channel = h;

            _handle = Bass.ChannelSetDSP(Channel, OnDsp, Priority: _priority);

            if (Channel != 0)
            {
                Resolution = Bass.ChannelGetInfo(Channel).Resolution;
            }

            if (_handle != 0)
            {
                IsAssigned = true;
            }
        }
Пример #2
0
        /// <summary>
        /// Applies the DSP on a Channel.
        /// </summary>
        /// <param name="Channel">Channel to apply the DSP on.</param>
        /// <param name="Priority">Priority of the DSP in the DSP chain.</param>
        public void ApplyOn(int Channel, int Priority = 0)
        {
            this.Channel = Channel;

            _priority = Priority;

            _handle = Bass.ChannelSetDSP(Channel, OnDsp, Priority: _priority);

            Resolution = Bass.ChannelGetInfo(Channel).Resolution;

            Bass.ChannelSetSync(Channel, SyncFlags.Free, 0, (a, b, c, d) => Dispose());

            if (_handle != 0)
            {
                IsAssigned = true;
            }
            else
            {
                throw new InvalidOperationException("DSP Assignment Failed");
            }
        }