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