private int mNowPlaying; // index in the playlist of the phrase currently playing /// <summary> /// Create a new transport bar. /// </summary> public TransportBar() { InitializeComponent(); mPlayer = new Audio.Player(); mPlayer.StateChanged += new Audio.StateChangedHandler(mPlayer_StateChanged); UpdatePlayerStatus(); mPlaylist = new List <AudioMediaData>(); }
/// <summary> /// Move to the next asset in the playlist or stop if at the end. /// </summary> private void mPlayer_EndOfAudioAsset(Audio.Player player, EventArgs e) { ++mNowPlaying; if (!Play()) { player.EndOfAudioAsset -= new Audio.EndOfAudioAssetHandler(mPlayer_EndOfAudioAsset); player.Stop(); } }
private void TransportBar_ParentChanged(object sender, EventArgs e) { if (this.player == null) { if (Parent != null) { this.player = new Audio.Player(Parent); } this.player.StateChanged += new Bobi.Audio.StateChangedEventHandler(player_StateChanged); } }
public void Play(Audio.Player player) { if (!disposed && channel != 0 && BassLib.Initialized) { (player as MusicPlayer).SetCurrentChannel(channel); if (player.Enabled) { BassLib.Play(channel, true); } } }
/// <summary> /// Update the transport bar when the player state changes. /// </summary> private void mPlayer_StateChanged(Audio.Player player, Audio.StateChangedEventArgs e) { UpdatePlayerStatus(); }
public TransportBar() { InitializeComponent(); this.player = null; this.timeDisplayUpdateTimer.Stop(); }