Beispiel #1
0
        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>();
        }
Beispiel #2
0
 /// <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();
     }
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
        public void Play(Audio.Player player)
        {
            if (!disposed && channel != 0 && BassLib.Initialized)
            {
                (player as MusicPlayer).SetCurrentChannel(channel);

                if (player.Enabled)
                {
                    BassLib.Play(channel, true);
                }
            }
        }
Beispiel #5
0
 /// <summary>
 /// Update the transport bar when the player state changes.
 /// </summary>
 private void mPlayer_StateChanged(Audio.Player player, Audio.StateChangedEventArgs e)
 {
     UpdatePlayerStatus();
 }
Beispiel #6
0
 public TransportBar()
 {
     InitializeComponent();
     this.player = null;
     this.timeDisplayUpdateTimer.Stop();
 }