2 Copyright 2004-2005 Chris Tallon, Andreas Vogel
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include "wselectlist.h"
31 #include "timerreceiver.h"
40 class MediaListHolder;
42 class VMediaList : public TBBoxx , public TimerReceiver
48 void processMessage(Message* m);
49 int handleCommand(int command);
54 static int createList();
56 //move functions for getMedia
57 const static ULONG MV_NEXT=1;
58 const static ULONG MV_PREV=2;
59 const static ULONG MV_RND=3;
60 const static ULONG MV_NONE=0;
62 //move selection to the next matching media
64 //return NULL if none found
65 //the returned Media is a copy and must contain an URI!
66 Media * getMedia(ULONG type,ULONG move=MV_NONE);
68 //get the number of media entries of particular types in this list
69 //if lowerThen is set, only count entries lt this one
70 int getNumEntries(ULONG mediaType,int lowerThen=-1,bool noAudiolist=false);
72 //get the directory of the current medium (display only)
73 const char * getDirname(ULONG mediaType) const;
76 //update all viewers/players
79 //the engine on top of the viewer has finished
83 virtual void timercall(int ref);
88 //set the media list, this makes no copy, list is owned by me afterwards
89 void setList(MediaListHolder* chanList);
91 * fill the medialist basing on the current dirname
94 VMediaView *getViewer();
96 void playAudio(bool all=false,bool activate=false, bool showInfo=false);
98 MediaListHolder *mediaList;
103 //sort list defined by new order
104 void sortList(int order);
105 static const int SORT_NONE=0;
106 static const int SORT_NAME=1;
107 static const int SORT_TIME=2;
108 static const int SORT_RANDOM=3;
109 void updateSelectList();
110 void updateSelectList(int current);
111 //start playing everything from the current selected Media
112 //the startlevel will be set to the current level
114 //change to the selected directory with updating
115 bool changeDirectory(Media *m);
116 //update the selection in the dirlist from the selectlist
118 void updateSelection(bool toSelectList=false);
119 //find the next entry in a media list
120 //return -1 if none found, otherwise index in list
121 int findNextEntry(int current, MediaList *list,ULONG ltype, ULONG move,bool wrap);
122 //get the currently selected media fro a list
123 Media * getCurrentMedia(DirList *dl);
125 DirList* audiodirlist;
134 enum Dirmode dirmode;
135 bool playingAll; //flag for combined and recursive playing