diff options
Diffstat (limited to 'kaffeine/src/input/dvb/dvbstream.cpp')
| -rw-r--r-- | kaffeine/src/input/dvb/dvbstream.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kaffeine/src/input/dvb/dvbstream.cpp b/kaffeine/src/input/dvb/dvbstream.cpp index 77bee5c..377f119 100644 --- a/kaffeine/src/input/dvb/dvbstream.cpp +++ b/kaffeine/src/input/dvb/dvbstream.cpp @@ -38,8 +38,8 @@ #include <linux/dvb/dmx.h> -#include <qdir.h> -#include <qprogressdialog.h> +#include <tqdir.h> +#include <tqprogressdialog.h> #include <klocale.h> #include <kapplication.h> @@ -55,7 +55,7 @@ -DvbStream::DvbStream( Device *d, const QString &charset, EventTable *et ) +DvbStream::DvbStream( Device *d, const TQString &charset, EventTable *et ) { dvbDevice = d; isRunning = false; @@ -65,13 +65,13 @@ DvbStream::DvbStream( Device *d, const QString &charset, EventTable *et ) fdFrontend = fdDvr = 0; ndmx = 0; currentTransponder = Transponder(); - frontendName = QString("/dev/dvb/adapter%1/frontend%2").arg( dvbDevice->adapter ).arg( dvbDevice->tuner ); - dvrName = QString("/dev/dvb/adapter%1/dvr%2").arg( dvbDevice->adapter ).arg( dvbDevice->tuner ); - demuxName = QString("/dev/dvb/adapter%1/demux%2").arg( dvbDevice->adapter ).arg( dvbDevice->tuner ); + frontendName = TQString("/dev/dvb/adapter%1/frontend%2").tqarg( dvbDevice->adapter ).tqarg( dvbDevice->tuner ); + dvrName = TQString("/dev/dvb/adapter%1/dvr%2").tqarg( dvbDevice->adapter ).tqarg( dvbDevice->tuner ); + demuxName = TQString("/dev/dvb/adapter%1/demux%2").tqarg( dvbDevice->adapter ).tqarg( dvbDevice->tuner ); out.setAutoDelete( true ); - QString deviceType="NONE"; + TQString deviceType="NONE"; switch ( dvbDevice->type ) { case FE_QPSK: deviceType = "DVBS"; break; case FE_OFDM: deviceType = "DVBT"; break; @@ -84,7 +84,7 @@ DvbStream::DvbStream( Device *d, const QString &charset, EventTable *et ) cam = NULL; plug = NULL; - connect( &statusTimer, SIGNAL(timeout()), this, SLOT(checkStatus()) ); + connect( &statusTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(checktqStatus()) ); } @@ -118,24 +118,24 @@ void DvbStream::showCamDialog() -QStringList DvbStream::getSources( bool all ) +TQStringList DvbStream::getSources( bool all ) { if ( !all ) { if ( dvbDevice->type==FE_OFDM ) - return QStringList( "Terrestrial" ); + return TQStringList( "Terrestrial" ); if ( dvbDevice->type==FE_QAM ) - return QStringList( "Cable" ); + return TQStringList( "Cable" ); if ( dvbDevice->type==FE_ATSC ) - return QStringList( "Atsc" ); + return TQStringList( "Atsc" ); } - QStringList source; + TQStringList source; int i; if ( dvbDevice->type==FE_QPSK ) { for ( i=0; i<dvbDevice->numLnb; i++ ) source+= dvbDevice->lnb[i].source; } else { - QString s = dvbDevice->source; + TQString s = dvbDevice->source; source+= s.remove(0,2); } return source; @@ -158,7 +158,7 @@ bool DvbStream::canSource( ChannelDesc *chan ) return false; int i; for ( i=0; i<dvbDevice->numLnb; i++ ) { - if ( dvbDevice->lnb[i].source.contains(chan->tp.source) ) + if ( dvbDevice->lnb[i].source.tqcontains(chan->tp.source) ) return true; } return false; @@ -173,7 +173,7 @@ int DvbStream::getPriority() -int DvbStream::getSatPos( const QString &src ) +int DvbStream::getSatPos( const TQString &src ) { int i; @@ -181,7 +181,7 @@ int DvbStream::getSatPos( const QString &src ) return -1; for ( i=0; i<dvbDevice->numLnb; i++ ) - if ( dvbDevice->lnb[i].source.contains(src) ) + if ( dvbDevice->lnb[i].source.tqcontains(src) ) return i; return -1; } @@ -221,7 +221,7 @@ bool DvbStream::closeFe() -void DvbStream::connectStatus( bool con ) +void DvbStream::connecttqStatus( bool con ) { if ( con ) statusTimer.start( 1000 ); @@ -360,7 +360,7 @@ bool DvbStream::tuneDvb( ChannelDesc *chan, bool dvr ) freq*=1000; srate*=1000; - QTime t1 = QTime::currentTime(); + TQTime t1 = TQTime::currentTime(); if ( chan->tp.inversion==INVERSION_AUTO ) { if ( fe_info.caps & FE_CAN_INVERSION_AUTO ) @@ -375,8 +375,8 @@ bool DvbStream::tuneDvb( ChannelDesc *chan, bool dvr ) switch( fe_info.type ) { case FE_OFDM : { - QString s = fe_info.name; - //if ( s.contains("TerraTec/qanu USB2.0 Highspeed DVB-T Receiver") ) // cinergyT2 hack + TQString s = fe_info.name; + //if ( s.tqcontains("TerraTec/qanu USB2.0 Highspeed DVB-T Receiver") ) // cinergyT2 hack // freq+=167000; if (freq < 1000000) freq*=1000UL; @@ -452,8 +452,8 @@ bool DvbStream::tuneDvb( ChannelDesc *chan, bool dvr ) closeFe(); return false; } - fprintf( stderr, "Diseqc settings time = %d ms\n", t1.msecsTo( QTime::currentTime() ) ); - t1 = QTime::currentTime(); + fprintf( stderr, "Diseqc settings time = %d ms\n", t1.msecsTo( TQTime::currentTime() ) ); + t1 = TQTime::currentTime(); if ( chan->tp.S2 ) { fprintf(stderr,"\nTHIS IS DVB-S2 >>>>>>>>>>>>>>>>>>>\n"); cmdargs[0].cmd = DTV_DELIVERY_SYSTEM; cmdargs[0].u.data = SYS_DVBS2; @@ -513,7 +513,7 @@ bool DvbStream::tuneDvb( ChannelDesc *chan, bool dvr ) closeFe(); return false; } - QTime lockTime = QTime::currentTime(); + TQTime lockTime = TQTime::currentTime(); do { usleep( 100000 ); fprintf( stderr, "." ); @@ -526,7 +526,7 @@ bool DvbStream::tuneDvb( ChannelDesc *chan, bool dvr ) loop = 0; break; } - } while ( lockTime.msecsTo( QTime::currentTime() )<=dvbDevice->tuningTimeout ); + } while ( lockTime.msecsTo( TQTime::currentTime() )<=dvbDevice->tuningTimeout ); fprintf(stderr,"\n"); --loop; } @@ -537,7 +537,7 @@ bool DvbStream::tuneDvb( ChannelDesc *chan, bool dvr ) return false; } - fprintf( stderr, "Tuning time = %d ms\n", t1.msecsTo( QTime::currentTime() ) ); + fprintf( stderr, "Tuning time = %d ms\n", t1.msecsTo( TQTime::currentTime() ) ); if ( rotorMove ) dvbDevice->lnb[lnbPos].currentSource = chan->tp.source; @@ -654,7 +654,7 @@ void DvbStream::moveRotor( int switchPos, ChannelDesc *chan, int hiband, bool dv int rotor=0; int voltage18 = ( (chan->tp.pol=='H')||(chan->tp.pol=='h') ); int ci = 4 * switchPos + 2 * hiband + (voltage18 ? 1 : 0); - QString msg; + TQString msg; fprintf( stderr, "Driving rotor to %s\n", chan->tp.source.ascii() ); for ( i=0; i<(int)dvbDevice->lnb[switchPos].source.count(); i++ ) { @@ -697,16 +697,16 @@ void DvbStream::moveRotor( int switchPos, ChannelDesc *chan, int hiband, bool dv } } else { - QProgressDialog progress( msg, i18n("Cancel"), rotor*2, 0, "progress", true ); + TQProgressDialog progress( msg, i18n("Cancel"), rotor*2, 0, "progress", true ); for ( j=0; j<(rotor*2); j++ ) { progress.setProgress( j ); - qApp->processEvents(); + tqApp->processEvents(); if ( progress.wasCanceled() ) break; usleep( 500000 ); } progress.setProgress( rotor*2 ); - qApp->processEvents(); + tqApp->processEvents(); } if ( (ci/2)%2 ) { @@ -718,10 +718,10 @@ void DvbStream::moveRotor( int switchPos, ChannelDesc *chan, int hiband, bool dv -double DvbStream::getSourceAngle( QString source ) +double DvbStream::getSourceAngle( TQString source ) { double angle=1.0; - int pos = source.findRev("-"); + int pos = source.tqfindRev("-"); source.remove(0,pos+1); source = source.upper(); if ( source.endsWith("W") ) @@ -823,7 +823,7 @@ bool DvbStream::setPids( DVBout *o ) int i, dmx; struct dmx_pes_filter_params pesFilterParams; dmx_pes_type_t pestype = DMX_PES_OTHER; - QValueList<int> pidList; + TQValueList<int> pidList; pidList = o->pidsList(); @@ -869,9 +869,9 @@ void DvbStream::removePids( DVBout *o ) void DvbStream::removeOut( DVBout *o ) { - disconnect( o, SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); - disconnect( o, SIGNAL(playDvb()), this, SLOT(receivePlayDvb()) ); - disconnect( o, SIGNAL(shifting(bool)), this, SLOT(receiveShifting(bool)) ); + disconnect( o, TQT_SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, TQT_SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); + disconnect( o, TQT_SIGNAL(playDvb()), this, TQT_SLOT(receivePlayDvb()) ); + disconnect( o, TQT_SIGNAL(shifting(bool)), this, TQT_SLOT(receiveShifting(bool)) ); delOut = o; while ( delOut ) usleep(100); @@ -879,7 +879,7 @@ void DvbStream::removeOut( DVBout *o ) -bool DvbStream::checkStatus() +bool DvbStream::checktqStatus() { int32_t strength; fe_status_t festatus; @@ -887,19 +887,19 @@ bool DvbStream::checkStatus() strength=0; ioctl(fdFrontend,FE_READ_SIGNAL_STRENGTH,&strength); - emit signalStatus(strength*100/65535); + emit signaltqStatus(strength*100/65535); strength=0; ioctl(fdFrontend,FE_READ_SNR,&strength); - emit snrStatus(strength*100/65535); + emit snrtqStatus(strength*100/65535); memset( &festatus, 0, sizeof(festatus) ); ioctl(fdFrontend,FE_READ_STATUS,&festatus); if (festatus & FE_HAS_LOCK) - emit lockStatus( true ); + emit locktqStatus( true ); else { - emit lockStatus( false ); + emit locktqStatus( false ); ret = false; } @@ -985,7 +985,7 @@ void DvbStream::run() -bool DvbStream::doPause( const QString &name ) +bool DvbStream::doPause( const TQString &name ) { //if ( !hasVideo() ) return false; @@ -1029,12 +1029,12 @@ bool DvbStream::running() const void DvbStream::receivePlayDvb() { - KApplication::kApplication()->postEvent( this, new QTimerEvent( 500 ) ); + KApplication::kApplication()->postEvent( this, new TQTimerEvent( 500 ) ); } -void DvbStream::timerEvent( QTimerEvent* ev ) +void DvbStream::timerEvent( TQTimerEvent* ev ) { switch ( ev->timerId() ) { case 500: @@ -1101,7 +1101,7 @@ void DvbStream::stopBroadcast() { int i; DVBout *o=0; - QPtrList<DVBout> p; + TQPtrList<DVBout> p; for ( i=0; i<(int)out.count(); i++ ) { o = out.at(i); @@ -1139,14 +1139,14 @@ int DvbStream::canStartBroadcast( bool &live, ChannelDesc *chan ) -bool DvbStream::startBroadcast( QPtrList<ChannelDesc> *list, Ts2Rtp *rtp ) +bool DvbStream::startBroadcast( TQPtrList<ChannelDesc> *list, Ts2Rtp *rtp ) { int i, j; bool stop=false, newout; DVBout *o=0; int no=0; ChannelDesc *chan=list->at(0); - QPtrList<ChannelDesc> broadcastList; + TQPtrList<ChannelDesc> broadcastList; broadcastList.setAutoDelete( true ); if ( !isTuned() ) { @@ -1174,9 +1174,9 @@ bool DvbStream::startBroadcast( QPtrList<ChannelDesc> *list, Ts2Rtp *rtp ) if ( !o ) { o = new DVBout( *list->at(i), dvbDevice->adapter, dvbDevice->tuner, plug ); - connect( o, SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); - connect( o, SIGNAL(playDvb()), this, SLOT(receivePlayDvb()) ); - connect( o, SIGNAL(shifting(bool)), this, SLOT(receiveShifting(bool)) ); + connect( o, TQT_SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, TQT_SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); + connect( o, TQT_SIGNAL(playDvb()), this, TQT_SLOT(receivePlayDvb()) ); + connect( o, TQT_SIGNAL(shifting(bool)), this, TQT_SLOT(receiveShifting(bool)) ); out.append( o ); if ( !setPids( o ) ) { removePids( o ); @@ -1243,12 +1243,12 @@ int DvbStream::canStartTimer( bool &live, ChannelDesc *chan ) -bool DvbStream::startTimer( ChannelDesc *chan, QString path, int maxsize, RecTimer *t, QString name ) +bool DvbStream::startTimer( ChannelDesc *chan, TQString path, int maxsize, RecTimer *t, TQString name ) { int i; bool stop=false, newout=false; DVBout *o=0; - QPtrList<DVBout> p; + TQPtrList<DVBout> p; for ( i=0; i<(int)out.count(); i++ ) { if ( out.at(i)->channel.name==chan->name ) @@ -1288,9 +1288,9 @@ bool DvbStream::startTimer( ChannelDesc *chan, QString path, int maxsize, RecTim if ( !o ) { o = new DVBout( *chan, dvbDevice->adapter, dvbDevice->tuner, plug ); - connect( o, SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); - connect( o, SIGNAL(playDvb()), this, SLOT(receivePlayDvb()) ); - connect( o, SIGNAL(shifting(bool)), this, SLOT(receiveShifting(bool)) ); + connect( o, TQT_SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, TQT_SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); + connect( o, TQT_SIGNAL(playDvb()), this, TQT_SLOT(receivePlayDvb()) ); + connect( o, TQT_SIGNAL(shifting(bool)), this, TQT_SLOT(receiveShifting(bool)) ); out.append( o ); if ( !setPids( o ) ) { if ( stop ) @@ -1302,10 +1302,10 @@ bool DvbStream::startTimer( ChannelDesc *chan, QString path, int maxsize, RecTim newout = true; } - if ( t->mode && !name.contains("%date") ) + if ( t->mode && !name.tqcontains("%date") ) name+= "-%date"; - name = name.replace( "%chan", chan->name ).replace("%date", t->begin.toString( "yyyyMMdd-hhmmss" ) ).replace("%name", t->name ); - name = name.replace( "/", "_" ).replace( ">", "_" ).replace("<","_").replace(":","_").replace('"',"_").replace("\\","_").replace("|","_"); + name = name.tqreplace( "%chan", chan->name ).tqreplace("%date", t->begin.toString( "yyyyMMdd-hhmmss" ) ).tqreplace("%name", t->name ); + name = name.tqreplace( "/", "_" ).tqreplace( ">", "_" ).tqreplace("<","_").tqreplace(":","_").tqreplace('"',"_").tqreplace("\\","_").tqreplace("|","_"); name = path+name; if ( !o->goRec( name, maxsize, t ) ) { @@ -1330,7 +1330,7 @@ bool DvbStream::startTimer( ChannelDesc *chan, QString path, int maxsize, RecTim -int DvbStream::goLive( ChannelDesc *chan, const QString &pipeName, int ringBufSize ) +int DvbStream::goLive( ChannelDesc *chan, const TQString &pipeName, int ringBufSize ) { int i; bool stop=false; @@ -1364,9 +1364,9 @@ int DvbStream::goLive( ChannelDesc *chan, const QString &pipeName, int ringBufSi if ( !o ) { o = new DVBout( *chan, dvbDevice->adapter, dvbDevice->tuner, plug ); - connect( o, SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); - connect( o, SIGNAL(playDvb()), this, SLOT(receivePlayDvb()) ); - connect( o, SIGNAL(shifting(bool)), this, SLOT(receiveShifting(bool)) ); + connect( o, TQT_SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, TQT_SLOT(recordEnded(DVBout*,RecTimer*,bool)) ); + connect( o, TQT_SIGNAL(playDvb()), this, TQT_SLOT(receivePlayDvb()) ); + connect( o, TQT_SIGNAL(shifting(bool)), this, TQT_SLOT(receiveShifting(bool)) ); out.append( o ); if ( !setPids( o ) ) { if ( stop ) @@ -1414,7 +1414,7 @@ void DvbStream::stopLive( ChannelDesc *chan ) { int i; DVBout *o; - QPtrList<DVBout> p; + TQPtrList<DVBout> p; bool camUsed = false; fprintf(stderr,"Asked to stop\n"); @@ -1481,7 +1481,7 @@ void DvbStream::stopFrontend() void DvbStream::setScanning( bool b ) { - connectStatus( b ); + connecttqStatus( b ); } |
