~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/videopreview/videopreview.h

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-03-31 23:05:43 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090331230543-0h2hfwpwlu9opbv2
* New upstream release. (Closes: #523791)
  - Reworked subtitle font preferences. (Closes: #503295)
  - No longer installs qt_fr.qm. (Closes: #486314)
* debian/control:
  - Bumped Standards-Version to 3.8.1.
  - Changed maintainer name (still the same person and GPG key).
  - Changed section to video.
  - Build-depend on zlib1g-dev for findsubtitles.
  - Require Qt >= 4.3 per readme.
  - Added ${misc:Depends}.
  - Make smplayer-translations depend on smplayer and smplayer recommend
    smplayer-translations, not the other way round. (Closes: #489375)
* debian/copyright:
  - Significantly expanded per-file with new upstream authors.
* debian/rules:
  - Make make use correct uic in install.
  - Clean svn_revision.
  - Removed get-orig-source - not needed with uscan --repack.
* debian/patches/01_gl_translation.patch:
  - Added patch to fix lrelease error on smplayer_gl.ts.
* Added debian/README.source for simple-patchsys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  smplayer, GUI front-end for mplayer.
 
2
    Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
 
3
 
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with this program; if not, write to the Free Software
 
16
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
*/
 
18
 
 
19
#ifndef _VIDEOPREVIEW_H_
 
20
#define _VIDEOPREVIEW_H_
 
21
 
 
22
#include <QWidget>
 
23
#include <QString>
 
24
#include <QList>
 
25
 
 
26
class QProgressDialog;
 
27
class QGridLayout;
 
28
class QLabel;
 
29
class QScrollArea;
 
30
class QDialogButtonBox;
 
31
class QSettings;
 
32
 
 
33
class VideoInfo 
 
34
{
 
35
public:
 
36
        VideoInfo() { filename.clear(); width = 0; height = 0; length = 0; 
 
37
                  size = 0; fps = 0; aspect = 0; video_bitrate = 0; 
 
38
                  audio_bitrate = 0; audio_rate = 0; video_format.clear(); };
 
39
        ~VideoInfo() {};
 
40
 
 
41
        QString filename;
 
42
        int width;
 
43
        int height;
 
44
        int length;
 
45
        qint64 size;
 
46
        double fps;
 
47
        double aspect;
 
48
        int video_bitrate;
 
49
        int audio_bitrate;
 
50
        int audio_rate;
 
51
        QString video_format;
 
52
};
 
53
 
 
54
class VideoPreview : public QWidget
 
55
{
 
56
        Q_OBJECT
 
57
 
 
58
public:
 
59
        enum ExtractFormat { JPEG = 1, PNG = 2 };
 
60
 
 
61
        VideoPreview(QString mplayer_path, QWidget * parent = 0);
 
62
        ~VideoPreview();
 
63
 
 
64
        void setMplayerPath(QString mplayer_path);
 
65
        QString mplayerPath() { return mplayer_bin; };
 
66
 
 
67
        void setVideoFile(QString file) { prop.input_video = file; };
 
68
        QString videoFile() { return prop.input_video; };
 
69
 
 
70
        void setDVDDevice(const QString & dvd_device) { prop.dvd_device = dvd_device; };
 
71
        QString DVDDevice() { return prop.dvd_device; };
 
72
 
 
73
        void setCols(int cols) { prop.n_cols = cols; };
 
74
        int cols() { return prop.n_cols; };
 
75
 
 
76
        void setRows(int rows) { prop.n_rows = rows; };
 
77
        int rows() { return prop.n_rows; };
 
78
 
 
79
        void setGrid(int cols, int rows) { prop.n_cols = cols; prop.n_rows = rows; };
 
80
 
 
81
        void setInitialStep(int step) { prop.initial_step = step; };
 
82
        int initialStep() { return prop.initial_step; };
 
83
 
 
84
        void setMaxWidth(int w) { prop.max_width = w; };
 
85
        int maxWidth() { return prop.max_width; };
 
86
 
 
87
        void setDisplayOSD(bool b) { prop.display_osd = b; };
 
88
        bool displayOSD() { return prop.display_osd; };
 
89
 
 
90
        void setAspectRatio(double asp) { prop.aspect_ratio = asp; };
 
91
        double aspectRatio() { return prop.aspect_ratio; };
 
92
 
 
93
        void setExtractFormat( ExtractFormat format ) { prop.extract_format = format; };
 
94
        ExtractFormat extractFormat() { return prop.extract_format; };
 
95
 
 
96
        bool createThumbnails();
 
97
 
 
98
        bool showConfigDialog(QWidget * parent);
 
99
 
 
100
        void setSettings(QSettings * settings);
 
101
        QSettings * settings() { return set; };
 
102
 
 
103
        VideoInfo getInfo(const QString & mplayer_path, const QString & filename);
 
104
        QString errorMessage() { return error_message; };
 
105
 
 
106
        void adjustWindowSize();
 
107
 
 
108
protected slots:
 
109
        void cancelPressed();
 
110
        void saveImage();
 
111
 
 
112
protected:
 
113
        virtual void retranslateStrings();
 
114
        virtual void changeEvent( QEvent * event );
 
115
 
 
116
protected:
 
117
        bool extractImages();
 
118
        bool runMplayer(int seek, double aspect_ratio);
 
119
        bool addPicture(const QString & filename, int num, int time); 
 
120
        void displayVideoInfo(const VideoInfo & i);
 
121
        void cleanDir(QString directory);
 
122
        void clearThumbnails();
 
123
        QString framePicture();
 
124
        void saveSettings();
 
125
        void loadSettings();
 
126
 
 
127
        QList <QLabel *> label_list;
 
128
 
 
129
        QGridLayout * grid_layout;
 
130
        QLabel * info;
 
131
        QLabel * foot;
 
132
        QWidget * w_contents;
 
133
        QScrollArea * scroll_area;
 
134
        QDialogButtonBox * button_box;
 
135
 
 
136
        QString mplayer_bin;
 
137
 
 
138
        QString output_dir;
 
139
        QString full_output_dir;
 
140
 
 
141
        QProgressDialog * progress;
 
142
        bool canceled;
 
143
 
 
144
        QSettings * set;
 
145
 
 
146
        struct Properties {
 
147
                QString input_video;
 
148
                QString dvd_device;
 
149
                int n_cols, n_rows, initial_step, max_width;
 
150
                double aspect_ratio;
 
151
                bool display_osd;
 
152
                ExtractFormat extract_format;
 
153
        } prop;
 
154
 
 
155
        struct {
 
156
                int thumbnail_width;
 
157
        } run;
 
158
 
 
159
        QString last_directory;
 
160
        bool save_last_directory;
 
161
        QString error_message;
 
162
};
 
163
 
 
164
#endif