?? playlist.h
字號:
/* playlist.h Playlist management 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)*/#ifndef PLAYLIST_DOT_H#define PLAYLIST_DOT_H#include <stdio.h>#include <string.h>class CListItem { char* text; int len; CListItem* next; CListItem(); public : CListItem(char* value); ~CListItem() { if (len) delete text; } SetNext( CListItem* n ) { next = n; } char* GetText () { return len?text:""; } CListItem* GetNext() { return next; }};class CPlayList { CListItem* plist; CListItem* ptemp; CListItem* ptempprev; int Entries; bool changed; // indicate whether the playlist has changed. public: CPlayList() : plist(NULL),Entries(0),changed(true) { ;} ~CPlayList() { while (ChopHead()) { ;} } bool NeedsRedraw() { // find out if the list has changed. bool r = changed; changed=false; return r; } Add( char* text ); char* GetHead() { return plist?plist->GetText():NULL; } int ChopHead(); DebugWriteOut(); SetPtrAtIndex( int n ) { // starting point for quick retrieve int t=n; ptemp = plist; while (t-- && ptemp) ptemp = ptemp->GetNext(); } char* GetNext() { // get next value. if (ptemp) { CListItem* t; t = ptemp; ptemp = ptemp->GetNext(); return t->GetText(); } else { return NULL; } } DeleteAtIndex( int i ); // zero based index. int GetEntries() { return Entries; } int ReadFromFile( char* fname ); int WriteToFile( char* fname ); void Clean();};#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -