Changeset 159

Show
Ignore:
Timestamp:
03/08/07 22:38:19 (1 year ago)
Author:
mgeske2
Message:

Added IMusicPlayer, an interface for VLC, and MusicPlayerControl?, a class that extends VlcUserControl? and implements IMusicPlayer. Also modified BadClient? to use these.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmp/trunk/BadClient/Form1.Designer.cs

    r145 r159  
    3838            this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 
    3939            this.button2 = new System.Windows.Forms.Button(); 
    40             this.vlcPlayer = new VLanControl.VlcUserControl(); 
     40            this.vlcPlayer = new VLanControl.MusicPlayerControl(); 
    4141            this.splitContainer3 = new System.Windows.Forms.SplitContainer(); 
    4242            this.panel1 = new System.Windows.Forms.Panel(); 
     
    354354        //private VLanControl.VlcUserControl vlcController; 
    355355        private System.Windows.Forms.Button button3; 
    356         private VLanControl.VlcUserControl vlcPlayer; 
     356        private VLanControl.MusicPlayerControl vlcPlayer; 
    357357        private System.Windows.Forms.DataGridViewTextBoxColumn colID; 
    358358        private System.Windows.Forms.DataGridViewTextBoxColumn colLibID; 
  • dmp/trunk/BadClient/Form1.cs

    r145 r159  
    1111        public partial class Form1 : Form { 
    1212                private Bridge  myBridge; 
    13         private System.Collections.Hashtable playlistHash; 
    1413                public Form1() { 
    1514                        InitializeComponent(); 
    1615                        myBridge = new Bridge(); 
    17             playlistHash = new System.Collections.Hashtable(); 
    1816            if( myBridge.isDatabaseUp() ) 
    1917                lblStatus.Text = "Status: Bridge constructed and db up!"; 
     
    3634                        dgvSongs.Rows.Add(row.ItemArray); 
    3735                        int songId = int.Parse(row.ItemArray[0].ToString()); 
    38                         if (!playlistHash.Contains(songId)) 
    39                         { 
    40                             String songURL = this.myBridge.getSongURL(songId); 
    41                             playlistHash.Add(songId, vlcPlayer.AddToPlayList(songURL, songURL, null)); 
    42                         } 
     36                        String songURL = this.myBridge.getSongURL(songId); 
     37                        vlcPlayer.AddSongToPlaylist(songId, songURL, songURL); 
    4338                    } 
    4439                } 
     
    7065 
    7166                int songId = int.Parse(row.ItemArray[0].ToString()); 
    72  
    73                 if (!playlistHash.Contains(songId)) 
    74                 { 
    75                     String songURL = this.myBridge.getSongURL(songId); 
    76                     playlistHash.Add(songId, vlcPlayer.AddToPlayList(songURL, songURL, null)); 
    77                 } 
     67                String songURL = this.myBridge.getSongURL(songId); 
     68                vlcPlayer.AddSongToPlaylist(songId, songURL, songURL); 
    7869                        } 
    7970        } 
     
    9081            if (vlcPlayer.IsPaused) 
    9182            { 
    92                 vlcPlayer.TogglePause(); 
     83                vlcPlayer.UnPause(); 
    9384                this.button3.Text = "Pause"; 
    9485            } 
    9586            else if (vlcPlayer.IsPlaying) 
    9687            { 
    97                 vlcPlayer.TogglePause(); 
     88                vlcPlayer.Pause(); 
    9889                this.button3.Text = "Play"; 
    9990            } 
     
    121112            //vlcPlayer.AddAndPlay(songURL,""); 
    122113 
    123             int playlistId = (int)playlistHash[songId]; 
    124             Debug.WriteLine("Playing song with id " + playlistId.ToString()); 
    125             vlcPlayer.PlayItem(playlistId); 
     114             
     115            vlcPlayer.PlaySong(songId); 
    126116            this.button3.Text = "Pause"; 
    127117        } 
  • dmp/trunk/vlc.NET/VLanControl.csproj

    r98 r159  
    5656    </Compile> 
    5757    <Compile Include="IPlayer.cs" /> 
     58    <Compile Include="MusicPlayer.cs" /> 
     59    <Compile Include="MusicPlayerControl.cs"> 
     60      <SubType>UserControl</SubType> 
     61    </Compile> 
    5862    <Compile Include="NativeLibVlc.cs" /> 
    5963    <Compile Include="VlcUserControl.cs">