Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts the Channel Playback.
        /// </summary>
        public bool Play()
        {
            try
            {
                var result = Bass.ChannelPlay(Handle, _restartOnNextPlayback);

                if (result)
                {
                    _restartOnNextPlayback = false;
                }

                return(result);
            }
            finally { OnStateChanged(); }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Start Recording.
 /// </summary>
 public void Start() => BASS.ChannelPlay(_handle);
Exemplo n.º 4
0
 /// <summary>
 /// Play Silence.
 /// </summary>
 /// <returns>true on success, else false.</returns>
 public bool Play() => Bass.ChannelPlay(_handle);
Exemplo n.º 5
0
 /// <summary>
 /// Start Audio Capture.
 /// </summary>
 /// <returns><see langword="true"/> on success, else <see langword="false"/>.</returns>
 public bool Start() => Bass.ChannelPlay(_handle);