Пример #1
0
        public void Play(bool Restart = false)
        {
            if (_handle != 0)
            {
                if (Bass.ChannelIsActive(_handle) == PlaybackState.Stopped || Bass.ChannelIsActive(_handle) == PlaybackState.Paused)
                {
                    if (Loop)
                    {
                        Bass.ChannelAddFlag(_handle, BassFlags.Loop);
                    }
                    else
                    {
                        Bass.ChannelRemoveFlag(_handle, BassFlags.Loop);
                    }

                    if (!Bass.ChannelPlay(_handle, Restart))
                    {
                        Console.WriteLine("Player: Error Playing {0:G}", Bass.LastError);
                        _handle = 0;
                        return;
                    }
                }

                _UpdateTimer.Start();
            }
        }