]> git.vomp.tv Git - vompclient.git/blob - vaudioplayer.h
German updates
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 draw();
51     void timercall(int clientReference);
52     //factory method
53     //return NULL on error
54     static VAudioplayer *createPlayer(VMediaList * parent, bool startPlayall=false);
55     //show the picture currently selected in the parent
56     //potentially moving to next/previous one
57     void play(ULONG move=VMediaList::MV_NONE);
58
59     //start a playall
60     void startPlayall();
61
62
63   private:
64                 const static int BANNER_TIME=30;
65                 //show time of an error
66                 const static int BANNER_ERROR_TIME=8;
67
68
69                 //margin on SCREEN on each side
70                 const static int BANNER_X_MARGIN=50;
71                 //margin on bottom of screen
72                 const static int BANNER_BOTTOM_MARGIN=30;
73                 //length of the progress bar
74                 const static int BARLEN=250;
75
76     VAudioplayer(VMediaList * plist);
77                 void retriggerBanner();
78     void showBanner(bool forceRestart=false);
79     void destroyBanner();
80     void updateBanner(bool restart=false);
81                 void drawBanner();
82                 void drawClocks();
83                 TBBoxx *createBannerView(int numlines);
84                 int bannerlines;
85                 //add or destroy a view (banner, info)
86                 void sendViewMsg(Boxx *v,bool destroy=false);
87                 //get the player - create it if necessary
88                 AudioPlayer* getPlayer(bool create=true);
89     VMediaList   *parent;
90     TBBoxx *banner;
91     char * fullname;
92     char * filename;
93     ULONG ftime;
94     bool playall;
95     const char * mediaError;
96     Media * currentMedia;
97                 bool justPlaying;
98                 int numentries;
99                 time_t bannerTime;
100                 Region barRegion;
101                 Region clocksRegion;
102           Colour barBlue;
103
104 };
105
106 #endif