コード例 #1
0
        private int AsioCallback(bool input, int channel, IntPtr buffer, int length, IntPtr user)
        {
            //We deal only with outputs here
            //And if the channel has it's own handler, we ignore it
            if (!this.FOutputHandled.Contains(channel) && !input)
            {
                if (this.manager.Exists(user.ToInt32()))
                {
                    ChannelInfo channelinfo = this.manager.GetChannel(user.ToInt32());
                    if (channelinfo.Play && channelinfo.IsDecoding)
                    {
                        int _decLength;

                        BASSASIOActive _status = BassAsio.BASS_ASIO_ChannelIsActive(false, channel);
                        //BASSActive _status = Bass.BASS_ChannelIsActive(user.ToInt32());
                        // now we evaluate the status...
                        if (_status != BASSASIOActive.BASS_ASIO_ACTIVE_ENABLED)
                        {
                            //BassAsio.BASS_ASIO_ChannelPause(false, channel);
                            return(0);
                        }
                        else
                        {
                            //BassAsio.BASS_ASIO_ChannelReset(false, channel, BASSASIOReset.BASS_ASIO_RESET_PAUSE);
                            _decLength = Bass.BASS_ChannelGetData(channelinfo.BassHandle.Value, buffer, length);

                            if (_decLength < 0)
                            {
                                _decLength = 0;
                            }
                            return(_decLength);
                        }
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    return(0);
                }
            }
            else
            {
                return(0);
            }
        }
コード例 #2
0
 private void buttonPause_Click(object sender, System.EventArgs e)
 {
     if (BassAsio.BASS_ASIO_ChannelIsActive(false, 0) == BASSASIOActive.BASS_ASIO_ACTIVE_PAUSED)
     {
         // channel is paused...so unpause
         BassAsio.BASS_ASIO_ChannelReset(false, 0, BASSASIOReset.BASS_ASIO_RESET_PAUSE);
         this.labelStatus.Text = "playing";
     }
     else
     {
         // channel is playing...so pause
         BassAsio.BASS_ASIO_ChannelPause(false, 0);
         this.labelStatus.Text         = "paused";
         this.progressBarVULeft.Value  = 0;
         this.progressBarVURight.Value = 0;
     }
 }