summaryrefslogtreecommitdiffstats
path: root/src/k9main.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-17 00:32:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-17 00:32:19 +0000
commit0d382a262c0638d0f572fc37193ccc5ed3dc895f (patch)
tree8578dcddfce4191f3f7a142a37769df7add48475 /src/k9main.h
downloadk9copy-0d382a262c0638d0f572fc37193ccc5ed3dc895f.tar.gz
k9copy-0d382a262c0638d0f572fc37193ccc5ed3dc895f.zip
Added old abandoned version of k9copy
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1091546 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/k9main.h')
-rw-r--r--src/k9main.h240
1 files changed, 240 insertions, 0 deletions
diff --git a/src/k9main.h b/src/k9main.h
new file mode 100644
index 0000000..6e9c348
--- /dev/null
+++ b/src/k9main.h
@@ -0,0 +1,240 @@
+//
+// C++ Interface:
+//
+// Description:
+//
+//
+// Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef K9MAIN_H
+#define K9MAIN_H
+#include "k9common.h"
+#include "k9cddrive.h"
+#include "images.h"
+#include "k9mainw.h"
+#include "kconfigdlg.h"
+#include "k9playbackoptions.h"
+#include <qstring.h>
+#include <kmessagebox.h>
+#include <qlistview.h>
+#include <kmainwindow.h>
+#include <kaboutdata.h>
+#include <qevent.h>
+#include <kfiledialog.h>
+#include <qlistbox.h>
+#include "k9copy.h"
+#include <qmutex.h>
+
+enum eStreamType {SUB,AUD,VID,NONE,CHAP} ;
+enum eObjectType {TITLE,CHAPTER,TITLESET,STREAM,ROOT};
+
+class LvItem : public QListViewItem {
+public:
+ LvItem( QListViewItem *parent,eObjectType _objectType)
+ : QListViewItem( parent), obj( NULL ) {
+ objectType=_objectType;
+ }
+ LvItem( QListView *parent,eObjectType _objectType)
+ : QListViewItem( parent), obj( NULL ) {
+ objectType=_objectType;
+ }
+ eObjectType objectType;
+ QObject *obj;
+ virtual int rtti () const;
+ int compare ( QListViewItem * i, int col, bool ascending ) const;
+ void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align );
+};
+
+class k9Main;
+class k9DVD;
+class k9DVDAudioStream;
+class k9DVDSubtitle;
+class k9DVDTitle;
+class KLibFactory;
+class k9PlaybackOptions;
+class k9LangSelect;
+class k9UpdateFactor;
+
+class ckLvItem : public QCheckListItem {
+public:
+ ckLvItem( QListViewItem *parent,k9Main *dlg,eObjectType _objectType)
+ : QCheckListItem( parent,"",QCheckListItem::CheckBox) {
+ mainDlg=dlg;
+ obj=NULL;
+ stream=NULL;
+ streamType=NONE;
+ language="";
+ objectType=_objectType;
+ }
+ ckLvItem( QListView *parent,k9Main *dlg,eObjectType _objectType)
+ : QCheckListItem( parent,"",QCheckListItem::CheckBox) {
+ mainDlg=dlg;
+ obj=NULL;
+ stream=NULL;
+ streamType=NONE;
+ language="";
+ objectType=_objectType;
+ }
+ eStreamType streamType;
+ eObjectType objectType;
+
+ k9Main *mainDlg;
+ k9DVDTitle *mainTitle;
+ QObject *obj;
+ QObject *stream;
+ QString language;
+ virtual int rtti () const;
+ void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align );
+ int compare ( QListViewItem * i, int col, bool ascending ) const;
+ double getstreamSize();
+
+protected:
+ void stateChange(bool state);
+
+};
+
+
+class k9DVDListItem : public QObject {
+ Q_OBJECT
+public:
+ k9DVDAudioStream *audioStream;
+ k9DVDSubtitle *subtitle;
+ k9DVDTitle *title;
+ ckLvItem *listItem;
+ eStreamType streamType;
+public:
+ k9DVDListItem(QObject *DVD,ckLvItem *List,eStreamType type);
+};
+
+
+class k9Main : public MainDlg {
+ Q_OBJECT
+
+public:
+
+ k9Main(QWidget* parent = 0, const char* name = 0, k9CdDrives *_drives=0 );
+ ~k9Main();
+ /*$PUBLIC_FUNCTIONS$*/
+ void addTitle(k9DVDTitle *track);
+ void addChapters(QListViewItem *_parent,k9DVDTitle *_title);
+ void updateSelection();
+ void checkAll(bool state);
+ void checkTS( bool _state,ckLvItem *_item );
+ void checkTitle(bool state, ckLvItem *_item);
+ void checkLang(QString lang, eStreamType streamType,bool state);
+ bool getupdating();
+ void saveSettings();
+ void setDVDSize();
+ static int compare(double v1,double v2);
+ void readSettings();
+ bool getquickScan() {
+ return m_quickScan;
+ };
+ void setPlaybackOptions(k9PlaybackOptions *_value) {
+ m_playbackOptions=_value;
+ };
+ void setLangSelect(k9LangSelect *_value) {
+ m_langSelect=_value;
+ };
+ QObjectList *getItems() {
+ return &items;
+ };
+ void updateFactor();
+ bool withMenus();
+ k9DVD *dvd;
+ void eject();
+private slots:
+ virtual void listView1CurrentChanged( QListViewItem * );
+ virtual void bSaveClick();
+ virtual void cbOutputDevActivated(int);
+ virtual void bInputOpenClick();
+ virtual void bInputOpenDirClick();
+ virtual void foundMountPoint (const QString &mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail);
+ virtual void fspDone();
+ virtual void updateFactor_internal();
+ virtual void deviceAdded(k9CdDrive *_drive);
+ virtual void deviceRemoved(k9CdDrive *_drive);
+ virtual void expanded(QListViewItem*);
+ virtual void collapsed (QListViewItem*);
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void PreviewTitle();
+ virtual void CreateMP4();
+ virtual void extractMPEG2();
+ virtual void Copy();
+ virtual void Open();
+ virtual void Clone(QString _input,QString _output);
+ virtual void setInput(QString _input);
+ virtual void setOutput(QString _output);
+ virtual void volumeChanged(const QString &device,const QString &volumeName);
+
+ void setDrives(k9CdDrives* _value);
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ QObjectList items;
+ k9DVDListItem *addListItem(QObject *DVD,ckLvItem *List,eStreamType type);
+
+ void readDrives();
+ void addDrive (k9CdDrive *_drive);
+ k9Copy *m_parent;
+ QPtrList<ckLvItem> tsItems;
+ QPtrList<ckLvItem> chItems;
+ ckLvItem * root;
+ QPtrList <k9CdDrive> driveList;
+ QPtrList <k9CdDrive> recorderList;
+ k9CdDrives *drives;
+ QPixmap pxVideo;
+ QPixmap pxSound;
+ QPixmap pxText;
+ QPixmap pxChapter;
+ QMutex m_mutex;
+ bool updating;
+ bool fspFinish;
+ long fspAvail;
+ void closeEvent( QCloseEvent* ce );
+ void closeDVD();
+ KLibFactory *m_factory;
+ QString getDevice(QComboBox *_combo);
+ k9UpdateFactor *m_update;
+ //PREFERENCES
+ QString m_prefOutput;
+ bool m_useDvdAuthor;
+ bool m_quickScan;
+ int m_prefSize;
+ bool m_prefK3b;
+ bool m_prefMenu;
+ bool m_prefAutoBurn;
+ k9PlaybackOptions *m_playbackOptions;
+ k9LangSelect *m_langSelect;
+
+ KMdiToolViewAccessor *m_toolView;
+ KDockWidget *m_dockWidget;
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void itemRenamed ( QListViewItem *item, int col );
+signals: // Signals
+ /** No descriptions */
+ void sig_progress(QString str);
+ void changeStatusbar(const QString& str,int id);
+ void changeCaption(const QString& str);
+ void showPreview(k9DVD *_dvd,k9DVDTitle * title,int chapter);
+ void stopPreview();
+ void SelectionChanged(k9DVD *_dvd,bool _withMenus);
+ void changedTitle(k9DVDTitle *_title);
+private:
+ void fillLvLanguages();
+ void updateLvLang(const eStreamType streamType,const QString & lang) ;
+ long getFreeSpace(const QString & _path);
+ void setProgressWindow(QWidget *_widget);
+ void removeProgressWindow();
+
+
+};
+
+#endif
+