]> git.vomp.tv Git - vompclient.git/blob - vaudioplayer.h
Code cleaning
[vompclient.git] / vaudioplayer.h
1 /*
2     Copyright 2004-2005 Chris Tallon, Andreas Vogel
3
4     This file is part of VOMP.
5
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.
10
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.
15
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.
19 */
20
21 #ifndef VAUDIOPLAYER_H
22 #define VAUDIOPLAYER_H
23
24 #include <stdio.h>
25 #include <string.h>
26 #include <vector>
27
28 #include "tbboxx.h"
29 #include "timerreceiver.h"
30 #include "colour.h"
31 #include "region.h"
32 #include "vmedialist.h"
33
34 class Message;
35
36 /**
37   * the audio player frontend
38   * will ineract with the parent List for ff,back, slide show...
39   *
40 */
41 class AudioPlayer;
42
43 class VAudioplayer : public TBBoxx, public TimerReceiver
44 {
45   public:
46     ~VAudioplayer();
47
48     void processMessage(Message* m);
49     int handleCommand(int command);
50     void preDelete();
51     void draw();
52     void timercall(int clientReference);
53     //factory method
54     //return NULL on error
55     static VAudioplayer *createPlayer(VMediaList * parent, bool startPlayall=false);
56     //show the picture currently selected in the parent
57     //potentially moving to next/previous one
58     void play(ULONG move=VMediaList::MV_NONE);
59
60     //start a playall
61     void startPlayall();
62
63
64   private:
65                 const static int BANNER_TIME=30;
66                 //show time of an error
67                 const static int BANNER_ERROR_TIME=8;
68
69
70                 //margin on SCREEN on each side
71                 const static int BANNER_X_MARGIN=50;
72                 //margin on bottom of screen
73                 const static int BANNER_BOTTOM_MARGIN=30;
74                 //length of the progress bar
75                 const static int BARLEN=250;
76
77     VAudioplayer(VMediaList * plist);
78                 void retriggerBanner();
79     void showBanner(bool forceRestart=false);
80     void destroyBanner();
81     void updateBanner(bool restart=false);
82                 void drawBanner();
83                 void drawClocks();
84                 TBBoxx *createBannerView(int numlines);
85                 int bannerlines;
86                 //add or destroy a view (banner, info)
87                 void sendViewMsg(Boxx *v,bool destroy=false);
88                 //get the player - create it if necessary
89                 AudioPlayer* getPlayer(bool create=true);
90     VMediaList   *parent;
91     TBBoxx *banner;
92     char * fullname;
93     char * filename;
94     ULONG ftime;
95     bool playall;
96     const char * mediaError;
97     Media * currentMedia;
98                 bool justPlaying;
99                 int numentries;
100                 time_t bannerTime;
101                 Region barRegion;
102                 Region clocksRegion;
103           Colour barBlue;
104
105 };
106
107 #endif