summaryrefslogtreecommitdiffstats
path: root/src/kmplayerprocess.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 06:10:56 +0000
commit769e63d24adf5c844137484f06a972fcce732d6a (patch)
tree5185797dcb3ff4b1b3cb71d367123bf89eb2410f /src/kmplayerprocess.h
parent0a8af92185eac74d48da1225e6053a0d66c078f5 (diff)
downloadkmplayer-769e63d24adf5c844137484f06a972fcce732d6a.tar.gz
kmplayer-769e63d24adf5c844137484f06a972fcce732d6a.zip
TQt4 port kmplayer
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kmplayerprocess.h')
-rw-r--r--src/kmplayerprocess.h199
1 files changed, 105 insertions, 94 deletions
diff --git a/src/kmplayerprocess.h b/src/kmplayerprocess.h
index 8a51702..02f9c6d 100644
--- a/src/kmplayerprocess.h
+++ b/src/kmplayerprocess.h
@@ -21,12 +21,12 @@
#ifndef _KMPLAYERPROCESS_H_
#define _KMPLAYERPROCESS_H_
-#include <qobject.h>
-#include <qguardedptr.h>
-#include <qstring.h>
-#include <qcstring.h>
-#include <qstringlist.h>
-#include <qregexp.h>
+#include <tqobject.h>
+#include <tqguardedptr.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
#include <kurl.h>
#include <kio/global.h>
@@ -34,7 +34,7 @@
#include "kmplayerconfig.h"
#include "kmplayersource.h"
-class QWidget;
+class TQWidget;
class KProcess;
namespace KIO {
@@ -53,19 +53,20 @@ class Backend_stub;
/*
* Base class for all backend processes
*/
-class KMPLAYER_EXPORT Process : public QObject {
+class KMPLAYER_EXPORT Process : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
enum State {
NotRunning = 0, Ready, Buffering, Playing
};
- Process (QObject * parent, Settings * settings, const char * n);
+ Process (TQObject * tqparent, Settings * settings, const char * n);
virtual ~Process ();
virtual void init ();
virtual void initProcess (Viewer *);
- virtual QString menuName () const;
- virtual void setAudioLang (int, const QString &);
- virtual void setSubtitle (int, const QString &);
+ virtual TQString menuName () const;
+ virtual void setAudioLang (int, const TQString &);
+ virtual void setSubtitle (int, const TQString &);
bool playing () const;
KDE_NO_EXPORT KProcess * process () const { return m_process; }
KDE_NO_EXPORT Source * source () const { return m_source; }
@@ -77,7 +78,7 @@ public:
State state () const { return m_state; }
NodePtr mrl () const { return m_mrl; }
signals:
- void grabReady (const QString & path);
+ void grabReady (const TQString & path);
public slots:
virtual bool ready (Viewer *);
bool play (Source *, NodePtr mrl);
@@ -107,11 +108,11 @@ protected:
State m_old_state;
KProcess * m_process;
KIO::Job * m_job;
- QString m_url;
+ TQString m_url;
int m_request_seek;
const char ** m_supported_sources;
private:
- QGuardedPtr <Viewer> m_viewer;
+ TQGuardedPtr <Viewer> m_viewer;
};
/*
@@ -119,16 +120,17 @@ private:
*/
class MPlayerBase : public Process {
Q_OBJECT
+ TQ_OBJECT
public:
- MPlayerBase (QObject * parent, Settings * settings, const char * n);
+ MPlayerBase (TQObject * tqparent, Settings * settings, const char * n);
~MPlayerBase ();
void initProcess (Viewer *);
public slots:
virtual bool stop ();
virtual bool quit ();
protected:
- bool sendCommand (const QString &);
- QStringList commands;
+ bool sendCommand (const TQString &);
+ TQStringList commands;
bool m_use_slave : 1;
protected slots:
virtual void processStopped (KProcess *);
@@ -144,15 +146,16 @@ class MPlayerPreferencesFrame;
*/
class KDE_EXPORT MPlayer : public MPlayerBase {
Q_OBJECT
+ TQ_OBJECT
public:
- MPlayer (QObject * parent, Settings * settings);
+ MPlayer (TQObject * tqparent, Settings * settings);
~MPlayer ();
virtual void init ();
- virtual QString menuName () const;
+ virtual TQString menuName () const;
virtual WId widget ();
virtual bool grabPicture (const KURL & url, int pos);
- virtual void setAudioLang (int, const QString &);
- virtual void setSubtitle (int, const QString &);
+ virtual void setAudioLang (int, const TQString &);
+ virtual void setSubtitle (int, const TQString &);
bool run (const char * args, const char * pipe = 0L);
public slots:
virtual bool deMediafiedPlay ();
@@ -171,14 +174,14 @@ protected slots:
private slots:
void processOutput (KProcess *, char *, int);
private:
- QString m_process_output;
- QString m_grabfile;
- QWidget * m_widget;
+ TQString m_process_output;
+ TQString m_grabfile;
+ TQWidget * m_widget;
MPlayerPreferencesPage * m_configpage;
- QString m_tmpURL;
+ TQString m_tmpURL;
struct LangInfo {
- LangInfo (int i, const QString & n) : id (i), name (n) {}
- int id; QString name; SharedPtr <LangInfo> next;
+ LangInfo (int i, const TQString & n) : id (i), name (n) {}
+ int id; TQString name; SharedPtr <LangInfo> next;
};
SharedPtr <LangInfo> alanglist;
WeakPtr <LangInfo> alanglist_end;
@@ -206,12 +209,12 @@ public:
void write (KConfig *);
void read (KConfig *);
void sync (bool fromUI);
- void prefLocation (QString & item, QString & icon, QString & tab);
- QFrame * prefPage (QWidget * parent);
- QRegExp m_patterns[pat_last];
+ void prefLocation (TQString & item, TQString & icon, TQString & tab);
+ TQFrame * prefPage (TQWidget * tqparent);
+ TQRegExp m_patterns[pat_last];
int cachesize;
- QString mplayer_path;
- QString additionalarguments;
+ TQString mplayer_path;
+ TQString additionalarguments;
bool alwaysbuildindex;
private:
MPlayer * m_process;
@@ -234,8 +237,9 @@ protected:
*/
class MEncoder : public MPlayerBase, public Recorder {
Q_OBJECT
+ TQ_OBJECT
public:
- MEncoder (QObject * parent, Settings * settings);
+ MEncoder (TQObject * tqparent, Settings * settings);
~MEncoder ();
virtual void init ();
virtual bool deMediafiedPlay ();
@@ -249,8 +253,9 @@ public slots:
class KMPLAYER_NO_EXPORT MPlayerDumpstream
: public MPlayerBase, public Recorder {
Q_OBJECT
+ TQ_OBJECT
public:
- MPlayerDumpstream (QObject * parent, Settings * settings);
+ MPlayerDumpstream (TQObject * tqparent, Settings * settings);
~MPlayerDumpstream ();
virtual void init ();
virtual bool deMediafiedPlay ();
@@ -266,27 +271,28 @@ class XMLPreferencesFrame;
*/
class KMPLAYER_EXPORT CallbackProcess : public Process {
Q_OBJECT
+ TQ_OBJECT
friend class Callback;
public:
- CallbackProcess (QObject * parent, Settings * settings, const char * n, const QString & menu);
+ CallbackProcess (TQObject * tqparent, Settings * settings, const char * n, const TQString & menu);
~CallbackProcess ();
- virtual void setStatusMessage (const QString & msg);
- virtual void setErrorMessage (int code, const QString & msg);
+ virtual void setStatusMessage (const TQString & msg);
+ virtual void setErrorMessage (int code, const TQString & msg);
virtual void setFinished ();
virtual void setPlaying ();
- virtual void setStarted (QCString dcopname, QByteArray & data);
- virtual void setMovieParams (int length, int width, int height, float aspect, const QStringList & alang, const QStringList & slang);
+ virtual void setStarted (TQCString dcopname, TQByteArray & data);
+ virtual void setMovieParams (int length, int width, int height, float aspect, const TQStringList & alang, const TQStringList & slang);
virtual void setMoviePosition (int position);
virtual void setLoadingProgress (int percentage);
- virtual void setAudioLang (int, const QString &);
- virtual void setSubtitle (int, const QString &);
- virtual QString menuName () const;
+ virtual void setAudioLang (int, const TQString &);
+ virtual void setSubtitle (int, const TQString &);
+ virtual TQString menuName () const;
virtual WId widget ();
- KDE_NO_EXPORT QByteArray & configData () { return m_configdata; }
+ KDE_NO_EXPORT TQByteArray & configData () { return m_configdata; }
KDE_NO_EXPORT bool haveConfig () { return m_have_config == config_yes; }
bool getConfigData ();
- void setChangedData (const QByteArray &);
- QString dcopName ();
+ void setChangedData (const TQByteArray &);
+ TQString dcopName ();
NodePtr configDocument () { return configdoc; }
void initProcess (Viewer *);
virtual bool deMediafiedPlay ();
@@ -308,9 +314,9 @@ protected slots:
protected:
Callback * m_callback;
Backend_stub * m_backend;
- QString m_menuname;
- QByteArray m_configdata;
- QByteArray m_changeddata;
+ TQString m_menuname;
+ TQByteArray m_configdata;
+ TQByteArray m_changeddata;
XMLPreferencesPage * m_configpage;
NodePtr configdoc;
bool in_gui_update;
@@ -324,30 +330,30 @@ protected:
struct KMPLAYER_NO_EXPORT ConfigDocument : public Document {
ConfigDocument ();
~ConfigDocument ();
- NodePtr childFromTag (const QString & tag);
+ NodePtr childFromTag (const TQString & tag);
};
/*
* Element for ConfigDocument
*/
struct KMPLAYER_NO_EXPORT ConfigNode : public DarkNode {
- ConfigNode (NodePtr & d, const QString & tag);
+ ConfigNode (NodePtr & d, const TQString & tag);
KDE_NO_CDTOR_EXPORT ~ConfigNode () {}
- NodePtr childFromTag (const QString & tag);
- QWidget * w;
+ NodePtr childFromTag (const TQString & tag);
+ TQWidget * w;
};
/*
* Element for ConfigDocument, defining type of config item
*/
struct KMPLAYER_NO_EXPORT TypeNode : public ConfigNode {
- TypeNode (NodePtr & d, const QString & t);
+ TypeNode (NodePtr & d, const TQString & t);
KDE_NO_CDTOR_EXPORT ~TypeNode () {}
- NodePtr childFromTag (const QString & tag);
- void changedXML (QTextStream & out);
- QWidget * createWidget (QWidget * parent);
+ NodePtr childFromTag (const TQString & tag);
+ void changedXML (TQTextStream & out);
+ TQWidget * createWidget (TQWidget * tqparent);
const char * nodeName () const { return tag.ascii (); }
- QString tag;
+ TQString tag;
};
/*
@@ -360,8 +366,8 @@ public:
void write (KConfig *);
void read (KConfig *);
void sync (bool fromUI);
- void prefLocation (QString & item, QString & icon, QString & tab);
- QFrame * prefPage (QWidget * parent);
+ void prefLocation (TQString & item, TQString & icon, TQString & tab);
+ TQFrame * prefPage (TQWidget * tqparent);
private:
CallbackProcess * m_process;
XMLPreferencesFrame * m_configframe;
@@ -372,8 +378,9 @@ private:
*/
class KMPLAYER_NO_EXPORT Xine : public CallbackProcess, public Recorder {
Q_OBJECT
+ TQ_OBJECT
public:
- Xine (QObject * parent, Settings * settings);
+ Xine (TQObject * tqparent, Settings * settings);
~Xine ();
public slots:
bool ready (Viewer *);
@@ -384,8 +391,9 @@ public slots:
*/
class KMPLAYER_NO_EXPORT GStreamer : public CallbackProcess {
Q_OBJECT
+ TQ_OBJECT
public:
- GStreamer (QObject * parent, Settings * settings);
+ GStreamer (TQObject * tqparent, Settings * settings);
~GStreamer ();
public slots:
virtual bool ready (Viewer *);
@@ -396,8 +404,9 @@ public slots:
*/
class KMPLAYER_EXPORT FFMpeg : public Process, public Recorder {
Q_OBJECT
+ TQ_OBJECT
public:
- FFMpeg (QObject * parent, Settings * settings);
+ FFMpeg (TQObject * tqparent, Settings * settings);
~FFMpeg ();
virtual void init ();
virtual bool deMediafiedPlay ();
@@ -412,61 +421,63 @@ private slots:
* npplayer backend
*/
-class KMPLAYER_NO_EXPORT NpStream : public QObject {
+class KMPLAYER_NO_EXPORT NpStream : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
enum Reason {
NoReason = -1,
BecauseDone = 0, BecauseError = 1, BecauseStopped = 2
};
- NpStream (QObject *parent, Q_UINT32 stream_id, const KURL & url);
+ NpStream (TQObject *tqparent, TQ_UINT32 stream_id, const KURL & url);
~NpStream ();
void open ();
void close ();
KURL url;
- QByteArray pending_buf;
+ TQByteArray pending_buf;
KIO::TransferJob *job;
timeval data_arrival;
- Q_UINT32 bytes;
- Q_UINT32 stream_id;
- Q_UINT32 content_length;
+ TQ_UINT32 bytes;
+ TQ_UINT32 stream_id;
+ TQ_UINT32 content_length;
Reason finish_reason;
- QString mimetype;
+ TQString mimetype;
signals:
void stateChanged ();
- void redirected (Q_UINT32, const KURL &);
+ void redirected (TQ_UINT32, const KURL &);
private slots:
void slotResult (KIO::Job*);
- void slotData (KIO::Job*, const QByteArray& qb);
+ void slotData (KIO::Job*, const TQByteArray& qb);
void redirection (KIO::Job *, const KURL &url);
- void slotMimetype (KIO::Job *, const QString &mime);
+ void slotMimetype (KIO::Job *, const TQString &mime);
void slotTotalSize (KIO::Job *, KIO::filesize_t sz);
};
class KMPLAYER_NO_EXPORT NpPlayer : public Process {
Q_OBJECT
+ TQ_OBJECT
public:
- NpPlayer (QObject * parent, Settings * settings, const QString & srv);
+ NpPlayer (TQObject * tqparent, Settings * settings, const TQString & srv);
~NpPlayer ();
virtual void init ();
virtual bool deMediafiedPlay ();
virtual void initProcess (Viewer * viewer);
- virtual QString menuName () const;
+ virtual TQString menuName () const;
- void setStarted (const QString & srv);
- void requestStream (const QString & path, const QString & url, const QString & target);
- void destroyStream (const QString & path);
+ void setStarted (const TQString & srv);
+ void requestStream (const TQString & path, const TQString & url, const TQString & target);
+ void destroyStream (const TQString & path);
- KDE_NO_EXPORT const QString & destination () const { return service; }
- KDE_NO_EXPORT const QString & interface () const { return iface; }
- KDE_NO_EXPORT QString objectPath () const { return path; }
- QString evaluateScript (const QString & scr);
+ KDE_NO_EXPORT const TQString & destination () const { return service; }
+ KDE_NO_EXPORT const TQString & interface () const { return iface; }
+ KDE_NO_EXPORT TQString objectPath () const { return path; }
+ TQString evaluateScript (const TQString & scr);
signals:
- void evaluate (const QString & scr, QString & result);
- void openUrl (const KURL & url, const QString & target);
+ void evaluate (const TQString & scr, TQString & result);
+ void openUrl (const KURL & url, const TQString & target);
public slots:
virtual bool stop ();
virtual bool quit ();
@@ -477,21 +488,21 @@ private slots:
void processStopped (KProcess *);
void wroteStdin (KProcess *);
void streamStateChanged ();
- void streamRedirected (Q_UINT32, const KURL &);
+ void streamRedirected (TQ_UINT32, const KURL &);
protected:
virtual void terminateJobs ();
private:
- void sendFinish (Q_UINT32 sid, Q_UINT32 total, NpStream::Reason because);
+ void sendFinish (TQ_UINT32 sid, TQ_UINT32 total, NpStream::Reason because);
void processStreams ();
- QString service;
- QString iface;
- QString path;
- QString filter;
- QString m_base_url;
- typedef QMap <Q_UINT32, NpStream *> StreamMap;
+ TQString service;
+ TQString iface;
+ TQString path;
+ TQString filter;
+ TQString m_base_url;
+ typedef TQMap <TQ_UINT32, NpStream *> StreamMap;
StreamMap streams;
- QString remote_service;
- QByteArray send_buf;
+ TQString remote_service;
+ TQByteArray send_buf;
bool write_in_progress;
};