playlistb.cpp

来自「Yet another mp3 player, but this time us」· C++ 代码 · 共 101 行

CPP
101
字号
/*   playlistb.cpp  Playlist browser class  This program is free software; you can redistribute it and/or modify it  under the terms of the GNU General Public License as published by the  Free Software Foundation; either version 2 of the License, or (at your  option) any later version.  This program is distributed in the hope that it will be useful, but  WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  General Public License for more details, www.gnu.org.  Copyright (C) 2000  Simon Harrison (email smh@N_O_S_P_A_M@dr.com)*/#include "playlistb.h"//// NB:  The playlist browser may have the playlist changed under it// (by the player).  Should call start_processing multiple times// To update the list unlike the directory browser.//CPlaylistBrowser::start_processing( CPlayList* p )//{int selected;bool redraw = true;      if (p) {       playlist = p;   // store the pointer to the underlying playlist.                      // we almost certainly want to redraw.      playlist->NeedsRedraw();  // let the playlist know it's being redrawn.   } else {      redraw = playlist->NeedsRedraw();   }   if (!redraw) return 0;  // nothing changed.   // free any previously allocated list.   selected = GetListSelected();  // try to save the selection over the                                  // clean()   clean();   // TODO:  Mutex the playlist here if mpgcontroller is another thread.   // Copy the playlist into our own structure.   int n=playlist->GetEntries();   if (n) {      CString* l = new CString[n];      playlist->SetPtrAtIndex(0);      for (int i=0;i<n;i++) {        l[i].SetName( playlist->GetNext() );       }       // TODO:  End of mutex.      // update the selection with the saved one.      if (selected<=n) {         SetSelect( selected );      } else {         SetSelect( n );      }      SetList( l, n );  // Attach the new list      update();         // Update the page to be shown.   }}CPlaylistBrowser::del()//// Delete Item from playlist.//{   // TODO:  Mutex playlist begin   // Remove the item from the playlist.   playlist->DeleteAtIndex( GetListSelected()-1 );   // then re-read it for display.   //start_processing( NULL );      // TODO:  Mutex playlist end}/*CListBrowser cdb;main(){CString* cde;int n;   printf( "Starting processing\n" );   cdb.start_processing();   printf( "done. processing\n" );   cde = cdb.GetPage();   n = cdb.GetPageEnts();   cdb.DebugDumpPage( cde, n );   printf( "Running\n" );}*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?