summaryrefslogtreecommitdiffstats
path: root/k9Mplayer/k9mplayer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 23:37:00 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 23:37:00 +0000
commitb0e912c8b3d02a518fedda28c3180eb4794a7520 (patch)
tree07d344862562fab58cbe2df39d13d16f2e4d2bea /k9Mplayer/k9mplayer.cpp
parent4d695ec81fe4d4335ee82c7a9346ad9c9e144ecc (diff)
downloadk9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.tar.gz
k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.zip
TQt4 convert k9copy
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'k9Mplayer/k9mplayer.cpp')
-rw-r--r--k9Mplayer/k9mplayer.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/k9Mplayer/k9mplayer.cpp b/k9Mplayer/k9mplayer.cpp
index c5f501e..053d82d 100644
--- a/k9Mplayer/k9mplayer.cpp
+++ b/k9Mplayer/k9mplayer.cpp
@@ -1,29 +1,29 @@
#include "k9common.h"
#include "k9config.h"
-#include <qlayout.h>
-#include <qslider.h>
+#include <tqlayout.h>
+#include <tqslider.h>
#include <kselect.h>
#include "k9mplayer.h"
-#include <qcombobox.h>
+#include <tqcombobox.h>
#include <kiconloader.h>
#include <kpushbutton.h>
#include "k9dvd.h"
#include "k9dvdtitle.h"
#include <kprocess.h>
-#include <qlabel.h>
-#include <qtimer.h>
-#include <qapplication.h>
-#include <qevent.h>
+#include <tqlabel.h>
+#include <tqtimer.h>
+#include <tqapplication.h>
+#include <tqevent.h>
#include <klocale.h>
#include <kmessagebox.h>
-K9Mplayer::K9Mplayer(QObject *parent,const char *name,const QStringList args):MPlayer((QWidget*)parent) {
+K9Mplayer::K9Mplayer(TQObject *tqparent,const char *name,const TQStringList args):MPlayer((TQWidget*)tqparent) {
m_seeking=FALSE;
m_initVol=TRUE;
m_title=0;
- m_process=new KProcess(this);
+ m_process=new KProcess(TQT_TQOBJECT(this));
m_ratio=4.0/3.0;
slider->setRange(0, 100);
@@ -31,17 +31,17 @@ K9Mplayer::K9Mplayer(QObject *parent,const char *name,const QStringList args):M
bPlay->setPixmap(SmallIcon("player_play"));
bStop->setPixmap(SmallIcon("player_stop"));
bSwitchAudio->setPixmap(SmallIcon("cycle"));
- connect(m_process,SIGNAL(receivedStdout( KProcess*, char*, int )),this,SLOT(receivedStdout( KProcess*, char*, int )));
- m_timer=new QTimer(this);
- connect(m_process,SIGNAL(wroteStdin( KProcess* )),this,SLOT(wroteStdin( KProcess* )));
- connect(m_timer,SIGNAL(timeout()),this,SLOT(timeout()));
- m_container=new QWidget(Label);
+ connect(m_process,TQT_SIGNAL(receivedStdout( KProcess*, char*, int )),this,TQT_SLOT(receivedStdout( KProcess*, char*, int )));
+ m_timer=new TQTimer(this);
+ connect(m_process,TQT_SIGNAL(wroteStdin( KProcess* )),this,TQT_SLOT(wroteStdin( KProcess* )));
+ connect(m_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(timeout()));
+ m_container=new TQWidget(Label);
}
K9Mplayer::~K9Mplayer() {}
-void K9Mplayer::resizeEvent ( QResizeEvent * _resizeEvent) {
+void K9Mplayer::resizeEvent ( TQResizeEvent * _resizeEvent) {
int w,h;
w=Label->width();
h=Label->width() /m_ratio;
@@ -64,37 +64,37 @@ void K9Mplayer::timeout() {
}
-void K9Mplayer::setDevice(const QString & _device) {
+void K9Mplayer::setDevice(const TQString & _device) {
m_device=_device;
}
-void K9Mplayer::setTitle( const QString & _numTitle,const QString &_numChapter) {
+void K9Mplayer::setTitle( const TQString & _numTitle,const TQString &_numChapter) {
if (m_process->isRunning()) {
sendCmd("quit");
m_process->wait( 1000);
}
k9Config config;
- QString vout[]= {"x11","xv","gl2","sdl"};
- QString aout[]= {"alsa","oss","sdl"};
- QString vo=vout[config.getMplayerVout()];
- QString ao=aout[config.getMplayerAout()];
+ TQString vout[]= {"x11","xv","gl2","sdl"};
+ TQString aout[]= {"alsa","oss","sdl"};
+ TQString vo=vout[config.getMplayerVout()];
+ TQString ao=aout[config.getMplayerAout()];
m_process->clearArguments();
*m_process << "mplayer";
*m_process << "-vo" << vo << "-ao" << ao << "-sws" << "0";
*m_process << "-framedrop";
- *m_process << "-wid" << QString::number(m_container->winId()) ;
+ *m_process << "-wid" << TQString::number(m_container->winId()) ;
*m_process << "-slave" ;
*m_process << "-idle";
*m_process << "-dvd-device" << m_device;
if (_numChapter !="")
*m_process << "-chapter" << _numChapter;
- *m_process << QString("dvd://%1").arg(_numTitle);
+ *m_process << TQString("dvd://%1").tqarg(_numTitle);
if (!m_process->start( KProcess::NotifyOnExit,KProcess::All)) {
- KMessageBox::error (qApp->mainWidget(),i18n("Unable to run %1").arg("mplayer") , i18n("Preview"));
+ KMessageBox::error (tqApp->mainWidget(),i18n("Unable to run %1").tqarg("mplayer") , i18n("Preview"));
}
m_canwrite=TRUE;
@@ -108,13 +108,13 @@ void K9Mplayer::setTitle( const QString & _numTitle,const QString &_numChapter)
/*$SPECIALIZATION$*/
void K9Mplayer::receivedStdout (KProcess *proc, char *buffer, int buflen) {
- QString buf = QString::fromLatin1(buffer, buflen);
+ TQString buf = TQString::tqfromLatin1(buffer, buflen);
sscanf(buf.latin1(),"ANS_PERCENT_POSITION=%d",&m_position);
if (!m_seeking && m_position>0) {
slider->setValue(m_position);
}
int audio=0;
- if (buf.contains("ANS_switch_audio"))
+ if (buf.tqcontains("ANS_switch_audio"))
sscanf(buf.latin1(),"ANS_switch_audio=%d",&audio);
if (audio >0) {
for (int i=0;i < m_dvdTitle->getaudioStreamCount();i++) {
@@ -128,13 +128,13 @@ void K9Mplayer::receivedStdout (KProcess *proc, char *buffer, int buflen) {
void K9Mplayer::slotLengthChanged() {}
-void K9Mplayer::slotNewPosition(int _pos,const QTime & _time) {
+void K9Mplayer::slotNewPosition(int _pos,const TQTime & _time) {
slider->setValue(_pos);
}
void K9Mplayer::sliderReleased() {
- sendCmd( QString("seek %1 1").arg((int)slider->value()));
+ sendCmd( TQString("seek %1 1").tqarg((int)slider->value()));
m_seeking=FALSE;
}
@@ -146,7 +146,7 @@ void K9Mplayer::sliderPressed() {
}
void K9Mplayer::bPlayClick() {
- setTitle(QString::number( m_title),"");
+ setTitle(TQString::number( m_title),"");
}
void K9Mplayer::bStopClick() {
@@ -155,17 +155,17 @@ void K9Mplayer::bStopClick() {
void K9Mplayer::bDownClick() {
- sendCmd( QString("volume -1"));
+ sendCmd( TQString("volume -1"));
}
void K9Mplayer::bSwitchAudioClick() {
- sendCmd( QString("switch_audio"));
- sendCmd( QString("get_property switch_audio"));
+ sendCmd( TQString("switch_audio"));
+ sendCmd( TQString("get_property switch_audio"));
}
void K9Mplayer::bUpClick() {
- sendCmd( QString("volume +1"));
+ sendCmd( TQString("volume +1"));
}
@@ -175,12 +175,12 @@ void K9Mplayer::open( k9DVD *_dvd,k9DVDTitle *_title,int chapter) {
cbAudio->clear();
for (int i=0; i< _title->getaudioStreamCount();i++) {
k9DVDAudioStream *aud=_title->getaudioStream(i);
- cbAudio->insertItem(NULL,QString("%1-%2").arg(aud->getID()).arg(aud->getlanguage()),-1);
+ cbAudio->insertItem(NULL,TQString("%1-%2").tqarg(aud->getID()).tqarg(aud->getlanguage()),-1);
}
for (int i=0; i< _title->getsubPictureCount();i++) {
k9DVDSubtitle *sub=_title->getsubtitle(i);
- cbSub->insertItem(NULL,QString("%1-%2").arg(sub->getID().first()).arg(sub->getlanguage()),-1);
+ cbSub->insertItem(NULL,TQString("%1-%2").tqarg(sub->getID().first()).tqarg(sub->getlanguage()),-1);
}
if(_title->getaspectRatio()=="16:9")
@@ -192,7 +192,7 @@ void K9Mplayer::open( k9DVD *_dvd,k9DVDTitle *_title,int chapter) {
setDevice( _dvd->getDevice());
m_dvdTitle=_title;
m_title=_title->getnumTitle();
- setTitle( QString::number(m_title),QString::number(chapter));
+ setTitle( TQString::number(m_title),TQString::number(chapter));
if (_title->getaudioStreamCount() >0)
cbAudioActivated( 0);
if (_title->getsubPictureCount() >0)
@@ -207,19 +207,19 @@ void K9Mplayer::titleChanged() {}
void K9Mplayer::cbAudioActivated( int _value) {
if (m_dvdTitle) {
int value=m_dvdTitle->getaudioStream( _value)->getStreamId();
- sendCmd(QString( "switch_audio %1").arg(value));
+ sendCmd(TQString( "switch_audio %1").tqarg(value));
}
}
void K9Mplayer::cbSubActivated( int _value) {
- sendCmd(QString("sub_select %1").arg(_value));
+ sendCmd(TQString("sub_select %1").tqarg(_value));
}
-void K9Mplayer::sendCmd( QString _cmd) {
+void K9Mplayer::sendCmd( TQString _cmd) {
while (!m_canwrite) {
- qApp->processEvents();
+ tqApp->processEvents();
if ( !m_process->isRunning())
return;
}