1
/* smplayer, GUI front-end for mplayer.
2
Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
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.
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.
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
19
#ifndef _VIDEOPREVIEW_H_
20
#define _VIDEOPREVIEW_H_
26
class QProgressDialog;
30
class QDialogButtonBox;
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(); };
54
class VideoPreview : public QWidget
59
enum ExtractFormat { JPEG = 1, PNG = 2 };
61
VideoPreview(QString mplayer_path, QWidget * parent = 0);
64
void setMplayerPath(QString mplayer_path);
65
QString mplayerPath() { return mplayer_bin; };
67
void setVideoFile(QString file) { prop.input_video = file; };
68
QString videoFile() { return prop.input_video; };
70
void setDVDDevice(const QString & dvd_device) { prop.dvd_device = dvd_device; };
71
QString DVDDevice() { return prop.dvd_device; };
73
void setCols(int cols) { prop.n_cols = cols; };
74
int cols() { return prop.n_cols; };
76
void setRows(int rows) { prop.n_rows = rows; };
77
int rows() { return prop.n_rows; };
79
void setGrid(int cols, int rows) { prop.n_cols = cols; prop.n_rows = rows; };
81
void setInitialStep(int step) { prop.initial_step = step; };
82
int initialStep() { return prop.initial_step; };
84
void setMaxWidth(int w) { prop.max_width = w; };
85
int maxWidth() { return prop.max_width; };
87
void setDisplayOSD(bool b) { prop.display_osd = b; };
88
bool displayOSD() { return prop.display_osd; };
90
void setAspectRatio(double asp) { prop.aspect_ratio = asp; };
91
double aspectRatio() { return prop.aspect_ratio; };
93
void setExtractFormat( ExtractFormat format ) { prop.extract_format = format; };
94
ExtractFormat extractFormat() { return prop.extract_format; };
96
bool createThumbnails();
98
bool showConfigDialog(QWidget * parent);
100
void setSettings(QSettings * settings);
101
QSettings * settings() { return set; };
103
VideoInfo getInfo(const QString & mplayer_path, const QString & filename);
104
QString errorMessage() { return error_message; };
106
void adjustWindowSize();
109
void cancelPressed();
113
virtual void retranslateStrings();
114
virtual void changeEvent( QEvent * event );
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();
127
QList <QLabel *> label_list;
129
QGridLayout * grid_layout;
132
QWidget * w_contents;
133
QScrollArea * scroll_area;
134
QDialogButtonBox * button_box;
139
QString full_output_dir;
141
QProgressDialog * progress;
149
int n_cols, n_rows, initial_step, max_width;
152
ExtractFormat extract_format;
159
QString last_directory;
160
bool save_last_directory;
161
QString error_message;