Changeset 175

Show
Ignore:
Timestamp:
03/09/07 08:24:35 (2 years ago)
Author:
bsmith7
Message:

next and prev kinda work

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmp/trunk/Bridge/Bridge.cs

    r173 r175  
    381381                /// <param name="libraryId">The library ID to disconnect from</param> 
    382382                /// <returns></returns> 
    383                 public bool RemoveServerConnection(int libraryId) { 
     383                private bool RemoveServerConnection(int libraryId) { 
    384384                        bool containsKey; 
    385385                        lock (this.clientList) { 
     
    426426                                lock (this.serverNameToIdList) { 
    427427                                        libraryId = this.serverNameToIdList[zeroconfName]; 
     428                                        serverNameToIdList.Remove(zeroconfName); 
    428429                                } 
    429430                                bool result = this.RemoveServerConnection(libraryId); 
  • dmp/trunk/client/wpfclient/main_window.xaml

    r172 r175  
    5353     
    5454                <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="3" Grid.Column="1" HorizontalAlignment="Center"> 
    55       <Button Template="{StaticResource BackIcon}" Margin="5"
     55      <Button Template="{StaticResource BackIcon}" Margin="5" Click="PrevButtonOnClick"
    5656        <Button.BitmapEffect> 
    5757          <OuterGlowBitmapEffect GlowColor="#FF000000" GlowSize="2" Opacity="0.9"/> 
     
    6363        </Button.BitmapEffect> 
    6464      </Button> 
    65       <Button Template="{StaticResource NextIcon}" Margin="5"
     65      <Button Template="{StaticResource NextIcon}" Margin="5" Click="NextButtonOnClick"
    6666        <Button.BitmapEffect> 
    6767          <OuterGlowBitmapEffect GlowColor="#FF000000" GlowSize="2" Opacity="0.9"/> 
  • dmp/trunk/client/wpfclient/main_window.xaml.cs

    r172 r175  
    260260                        } 
    261261 
     262                        VLControl.ClearPlayList(); 
     263                         
     264                        foreach(DataRow dr in newDT.Rows){ 
     265                                int songId = (int)((long)dr["id"]); 
     266                                string url = myBridge.getSongURL(songId); 
     267                                VLControl.AddSongToPlaylist(songId, url, url); 
     268                        } 
     269 
    262270                        songView.SongDT = newDT; 
    263271                } 
     
    271279                                serverAddQueue.Enqueue(new ServerStatus(status.ServerName, status.Connected)); 
    272280                        } 
    273                         Thread newThread = new Thread(TServerClick); 
    274                         newThread.Start(); 
     281                        //Thread newThread = new Thread(TServerClick); 
     282                        //newThread.Start(); 
     283 
     284                        TServerClick(); 
    275285                } 
    276286 
     
    288298                } 
    289299 
     300                int playingId = -2; 
     301 
    290302                void PlayButtonOnClick(object sender, RoutedEventArgs args) { 
    291                          
    292                         if(VLControl.IsPlaying){ 
    293                                 VLControl.Pause(); 
    294                                 PlayButton.Template = (ControlTemplate)this.FindResource("PlayIcon"); 
    295                         } 
    296                         else if(VLControl.IsPaused){ 
    297                                 VLControl.UnPause(); 
    298  
    299                                 PlayButton.Template = (ControlTemplate)this.FindResource("PauseIcon"); 
     303                        if(songView.HighlightedRow.SongId == playingId){ 
     304                                if(VLControl.IsPlaying){ 
     305                                        VLControl.Pause(); 
     306                                        PlayButton.Template = (ControlTemplate)this.FindResource("PlayIcon"); 
     307         
     308                                } 
     309                                else if(VLControl.IsPaused){ 
     310                                        VLControl.UnPause(); 
     311         
     312                                        PlayButton.Template = (ControlTemplate)this.FindResource("PauseIcon"); 
     313                                } 
    300314                        } 
    301315                        else { 
     
    303317                                string songURL = myBridge.getSongURL(songId); 
    304318                                 
    305                                 VLControl.AddSongToPlaylist(songId, songURL, songURL); 
     319                                //VLControl.AddSongToPlaylist(songId, songURL, songURL); 
    306320                                VLControl.PlaySong(songId); 
     321                                playingId = songId; 
    307322 
    308323                                PlayButton.Template = (ControlTemplate)this.FindResource("PauseIcon"); 
    309324                        } 
     325                } 
     326 
     327                void NextButtonOnClick(object sender, RoutedEventArgs args) { 
     328                        VLControl.NextPlaylistTrack(); 
     329                } 
     330                         
     331                void PrevButtonOnClick(object sender, RoutedEventArgs args) { 
     332                        VLControl.PrevPlaylistTrack(); 
    310333                } 
    311334