]> git.vomp.tv Git - vompclient.git/blob - vpicture.h
Sleep timer
[vompclient.git] / vpicture.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 VPICTURE_H
22 #define VPICTURE_H
23
24 #include <stdio.h>
25 #include <string.h>
26 #include <vector>
27
28 #include "boxx.h"
29 #include "timerreceiver.h"
30 #include "vmedialist.h"
31 #include "colour.h"
32 #include "wjpeg.h"
33
34 class Message;
35 class VInfo;
36
37 /**
38   * the picture viewer
39   * will ineract with the parent List for ff,back, slide show...
40   *
41 */
42 class VPictureBanner;
43
44 class VPicture : public Boxx, public TimerReceiver
45 {
46   public:
47     ~VPicture();
48
49     void preDelete();
50     void processMessage(Message* m);
51     int handleCommand(int command);
52     void draw();
53     void timercall(int clientReference);
54     //factory method
55     //return NULL on error
56     static VPicture *createViewer(VMediaList * parent, bool startSlideshow=false);
57     //show the picture currently selected in the parent
58     //potentially moving to next/previous one
59     void showPicture(ULONG move=VMediaList::MV_NONE,int rotate=WJpeg::ROT_0);
60
61     //start a slideshow
62     void startSlideshow();
63
64
65   private:
66     VPicture(VMediaList * plist);
67     void showBanner(bool loading=false, int shortDisplayTime=0);
68     void destroyBanner(bool fromTimer=false);
69     void updateBanner(bool shortDisplay=false);
70     void showInfo();
71     void updateInfo();
72     void destroyInfo(bool fromTimer=false);
73                 //add or destroy a view (banner, info)
74                 void sendViewMsg(Boxx *v,bool destroy=false);
75                 //send command in main thread
76                 void sendCommandMsg(int command);
77     VMediaList   *parent;
78     int  load(Media *m);
79     JpegReader   *reader;
80     bool needDraw;
81     WJpeg jpeg;
82     VPictureBanner *banner;
83     char * fullname;
84     char * filename;
85     ULONG ftime;
86     bool slideshow;
87     int showtime;
88     const char * mediaError;
89     Media * currentMedia;
90     const static int INITIAL_SHOWTIME=5;
91     bool shortBanner;
92     int rotate;
93     VInfo * info;
94     static Colour pictureBack;
95     static Colour infoBack;
96 };
97
98 #endif