File indexing completed on 2024-04-21 15:38:27

0001 /**
0002  * Copyright (C) 2003 Joonas Koivunen <rzei@mbnet.fi>
0003  * Copyright (C) 2003 Koos Vriezen <koos.vriezen@xs4all.nl>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef _KMPlayerPREF_H_
0022 #define _KMPlayerPREF_H_
0023 
0024 #include "config-kmplayer.h"
0025 
0026 #include "kmplayer_def.h"
0027 
0028 #include <kpagedialog.h>
0029 #include <qmap.h>
0030 
0031 #include "kmplayerplaylist.h"
0032 
0033 class QTabWidget;
0034 class QCheckBox;
0035 class QComboBox;
0036 class QLabel;
0037 class QLineEdit;
0038 class QRadioButton;
0039 class QSlider;
0040 class QSpinBox;
0041 class QColor;
0042 class QButtonGroup;
0043 class QListWidget;
0044 class KHistoryCombo;
0045 class KComboBox;
0046 class KUrlRequester;
0047 class KColorButton;
0048 class KPageWidgetItem;
0049 
0050 namespace KMPlayer {
0051 
0052 class PrefGeneralPageGeneral;   // general, general
0053 class PrefSourcePageURL;        // source, url
0054 class PrefRecordPage;           // recording
0055 class RecorderPage;                     // base recorder
0056 class PrefMEncoderPage;         // mencoder
0057 class PrefMPlayerDumpstreamPage; // mplayer -dumpstream
0058 class PrefFFMpegPage;           // ffmpeg
0059 class PrefXinePage;             // xine url:record
0060 class PrefGeneralPageLooks;     // general, looks
0061 class PrefGeneralPageOutput;    // general, output
0062 class PrefOPPagePostProc;   // outputplugins, postproc
0063 class PartBase;
0064 class Source;
0065 class Settings;
0066 class PreferencesPage;
0067 class OutputDriver;
0068 class ColorSetting;
0069 class FontSetting;
0070 
0071 class KMPLAYER_NO_EXPORT Preferences : public KPageDialog
0072 {
0073     Q_OBJECT
0074 public:
0075 
0076     Preferences(PartBase *, Settings *);
0077     ~Preferences();
0078 
0079     PrefGeneralPageGeneral      *m_GeneralPageGeneral;
0080     PrefSourcePageURL           *m_SourcePageURL;
0081     PrefRecordPage              *m_RecordPage;
0082     PrefMEncoderPage            *m_MEncoderPage;
0083     PrefMPlayerDumpstreamPage   *m_MPlayerDumpstreamPage;
0084 #ifdef KMPLAYER_WITH_XINE
0085     PrefXinePage                *m_XinePage;
0086 #warning foo
0087 #endif
0088     PrefFFMpegPage              *m_FFMpegPage;
0089     PrefGeneralPageLooks        *m_GeneralPageLooks;
0090     PrefGeneralPageOutput       *m_GeneralPageOutput;
0091     PrefOPPagePostProc      *m_OPPagePostproc;
0092     void setDefaults();
0093     void setPage (const char *);
0094     void addPrefPage (PreferencesPage *);
0095     void removePrefPage (PreferencesPage *);
0096 
0097     RecorderPage * recorders;
0098     QMap<QString, QTabWidget *> entries;
0099 public slots:
0100     void confirmDefaults();
0101 private:
0102     KPageWidgetItem *m_record_item;
0103     KPageWidgetItem *m_url_item;
0104 };
0105 
0106 class KMPLAYER_NO_EXPORT PrefGeneralPageGeneral : public QWidget
0107 {
0108     Q_OBJECT
0109 public:
0110     PrefGeneralPageGeneral(QWidget *parent, Settings *);
0111     ~PrefGeneralPageGeneral() {}
0112 
0113     QCheckBox *keepSizeRatio;
0114     QCheckBox * autoResize;
0115     QButtonGroup* sizesChoice;
0116     QCheckBox *dockSysTray;
0117     QCheckBox *loop;
0118     QCheckBox *showConfigButton;
0119     QCheckBox *showPlaylistButton;
0120     QCheckBox *showRecordButton;
0121     QCheckBox *showBroadcastButton;
0122     QCheckBox *framedrop;
0123     QCheckBox *adjustvolume;
0124     QCheckBox *adjustcolors;
0125 
0126     QSpinBox *seekTime;
0127 };
0128 
0129 class KMPLAYER_NO_EXPORT PrefGeneralPageLooks : public QWidget {
0130     Q_OBJECT
0131 public:
0132     PrefGeneralPageLooks (QWidget *parent, Settings *);
0133     ~PrefGeneralPageLooks () {}
0134     QComboBox *colorscombo;
0135     KColorButton *colorbutton;
0136     QComboBox *fontscombo;
0137     QPushButton *fontbutton;
0138 public slots:
0139     void colorItemChanged (int);
0140     void colorCanged (const QColor &);
0141     void fontItemChanged (int);
0142     void fontClicked ();
0143 private:
0144     ColorSetting * colors;
0145     FontSetting * fonts;
0146 };
0147 
0148 class KMPLAYER_NO_EXPORT PrefSourcePageURL : public QWidget
0149 {
0150     Q_OBJECT
0151 public:
0152     PrefSourcePageURL (QWidget *parent);
0153     ~PrefSourcePageURL () {}
0154 
0155     KUrlRequester * url;
0156     //KHistoryCombo * url;
0157     KComboBox * urllist;
0158     KUrlRequester * sub_url;
0159     KComboBox * sub_urllist;
0160     QListWidget* backend;
0161     QCheckBox * clicktoplay;
0162     QCheckBox * grabhref;
0163     QLineEdit * prefBitRate;
0164     QLineEdit * maxBitRate;
0165     bool changed;
0166 private slots:
0167     void slotBrowse ();
0168     void slotTextChanged (const QString &);
0169 };
0170 
0171 
0172 class KMPLAYER_NO_EXPORT PrefRecordPage : public QWidget
0173 {
0174     Q_OBJECT
0175 public:
0176     PrefRecordPage (QWidget *parent, PartBase *, RecorderPage *, int len);
0177     ~PrefRecordPage ();
0178 
0179     KUrlRequester * url;
0180     QButtonGroup* recorder;
0181     QButtonGroup* replay;
0182     QSpinBox* replaytime;
0183     QLabel * source;
0184 protected:
0185     void showEvent (QShowEvent *);
0186 public slots:
0187     void replayClicked (int id);
0188     void recorderClicked (int id);
0189 private slots:
0190     void slotRecord ();
0191     void recording (bool);
0192 private:
0193     PartBase * m_player;
0194     RecorderPage *m_recorders;
0195     QPushButton * recordButton;
0196     QString source_url;
0197     int m_recorders_length;
0198 };
0199 
0200 class KMPLAYER_NO_EXPORT RecorderPage : public QWidget
0201 {
0202     Q_OBJECT
0203 public:
0204     RecorderPage (QWidget *parent, PartBase *);
0205     virtual ~RecorderPage () {}
0206     virtual void startRecording () {}
0207     virtual QString name () = 0;
0208     virtual const char * recorderName () = 0;
0209     RecorderPage * next;
0210 protected:
0211     PartBase *m_player;
0212 };
0213 
0214 class KMPLAYER_NO_EXPORT PrefMEncoderPage : public RecorderPage
0215 {
0216     Q_OBJECT
0217 public:
0218     PrefMEncoderPage (QWidget *parent, PartBase *);
0219     ~PrefMEncoderPage () {}
0220 
0221     virtual void startRecording ();
0222     QString name ();
0223     const char * recorderName () { return "mencoder"; }
0224 
0225     QLineEdit * arguments;
0226     QButtonGroup* format;
0227 public slots:
0228     void formatClicked (int id);
0229 private:
0230 };
0231 
0232 class KMPLAYER_NO_EXPORT PrefMPlayerDumpstreamPage : public RecorderPage {
0233 public:
0234     PrefMPlayerDumpstreamPage (QWidget *parent, PartBase *);
0235     ~PrefMPlayerDumpstreamPage () {}
0236 
0237     QString name ();
0238     const char * recorderName () { return "mplayerdumpstream"; }
0239 };
0240 
0241 #ifdef KMPLAYER_WITH_XINE
0242 class KMPLAYER_NO_EXPORT PrefXinePage : public RecorderPage {
0243 public:
0244     PrefXinePage (QWidget *parent, PartBase *);
0245     ~PrefXinePage () {}
0246 
0247     QString name ();
0248     const char * recorderName () { return "xine"; }
0249 };
0250 #endif
0251 
0252 class KMPLAYER_NO_EXPORT PrefFFMpegPage : public RecorderPage
0253 {
0254     Q_OBJECT
0255 public:
0256     PrefFFMpegPage (QWidget *parent, PartBase *);
0257     ~PrefFFMpegPage () {}
0258 
0259     virtual void startRecording ();
0260     QString name ();
0261     const char * recorderName () { return "ffmpeg"; }
0262 
0263     QLineEdit * arguments;
0264     QButtonGroup* format;
0265 private:
0266 };
0267 
0268 
0269 class KMPLAYER_NO_EXPORT PrefGeneralPageOutput : public QWidget
0270 {
0271     Q_OBJECT
0272 public:
0273     PrefGeneralPageOutput (QWidget *parent, OutputDriver * ad, OutputDriver * vd);
0274     ~PrefGeneralPageOutput() {}
0275 
0276     QListWidget* videoDriver;
0277     QListWidget* audioDriver;
0278 };
0279 
0280 class KMPLAYER_NO_EXPORT PrefOPPagePostProc : public QWidget
0281 {
0282     Q_OBJECT
0283 public:
0284     PrefOPPagePostProc(QWidget *parent = 0);
0285     ~PrefOPPagePostProc() {}
0286 
0287     QCheckBox* postProcessing;
0288     QCheckBox* disablePPauto;
0289     QTabWidget* PostprocessingOptions;
0290 
0291     QRadioButton* defaultPreset;
0292     QRadioButton* customPreset;
0293     QRadioButton* fastPreset;
0294 
0295     QCheckBox* HzDeblockFilter;
0296     QCheckBox* VtDeblockFilter;
0297     QCheckBox* DeringFilter;
0298     QCheckBox* HzDeblockAQuality;
0299     QCheckBox* VtDeblockAQuality;
0300     QCheckBox* DeringAQuality;
0301 
0302     QCheckBox* AutolevelsFilter;
0303     QCheckBox* AutolevelsFullrange;
0304     QCheckBox* HzDeblockCFiltering;
0305     QCheckBox* VtDeblockCFiltering;
0306     QCheckBox* DeringCFiltering;
0307     QCheckBox* TmpNoiseFilter;
0308     QSlider* TmpNoiseSlider;
0309 
0310     QCheckBox* LinBlendDeinterlacer;
0311     QCheckBox* CubicIntDeinterlacer;
0312     QCheckBox* LinIntDeinterlacer;
0313     QCheckBox* MedianDeinterlacer;
0314     QCheckBox* FfmpegDeinterlacer;
0315 };
0316 
0317 } // namespace
0318 
0319 #endif // _KMPlayerPREF_H_