summaryrefslogtreecommitdiffstats
path: root/src/k9play.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/k9play.cpp')
-rw-r--r--src/k9play.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/k9play.cpp b/src/k9play.cpp
index c772a1d..e2c3550 100644
--- a/src/k9play.cpp
+++ b/src/k9play.cpp
@@ -27,23 +27,23 @@
#include <ktempfile.h>
#include <kstandarddirs.h>
-void k9play::saveStatus(k9play_st _status) {
- QFile fstatus(m_inject);
+void k9play::savetqStatus(k9play_st _status) {
+ TQFile fstatus(m_inject);
fstatus.open(IO_WriteOnly);
fstatus.writeBlock((const char*)&_status,sizeof(k9play_st));
fstatus.close();
- kdebug (QString("saving status : %1 %2 %3 %4 %5 %6 %7\n").arg(_status.title).arg(_status.chapter).arg(_status.cell).arg(_status.sector).arg(_status.bytesWritten).arg(_status.bytesRead).arg(_status.bytesSkipped));
+ kdebug (TQString("saving status : %1 %2 %3 %4 %5 %6 %7\n").tqarg(_status.title).tqarg(_status.chapter).tqarg(_status.cell).tqarg(_status.sector).tqarg(_status.bytesWritten).tqarg(_status.bytesRead).tqarg(_status.bytesSkipped));
}
-void k9play::readStatus(k9play_st &_status) {
- QFile fstatus(m_inject);
+void k9play::readtqStatus(k9play_st &_status) {
+ TQFile fstatus(m_inject);
if (fstatus.open(IO_ReadOnly)) {
fstatus.readBlock((char*)&_status,sizeof(k9play_st));
fstatus.close();
} else memset(&_status,0,sizeof(k9play_st));
- kdebug (QString("reading status : title:%1 chapter:%2 cell:%3 sector:%4 written:%5 readen:%6 skipped:%7 chapters:%8 \n").arg(_status.title).arg(_status.chapter).arg(_status.cell).arg(_status.sector).arg(_status.bytesWritten).arg(_status.bytesRead).arg(_status.bytesSkipped).arg(_status.bytesChapters));
+ kdebug (TQString("reading status : title:%1 chapter:%2 cell:%3 sector:%4 written:%5 readen:%6 skipped:%7 chapters:%8 \n").tqarg(_status.title).tqarg(_status.chapter).tqarg(_status.cell).tqarg(_status.sector).tqarg(_status.bytesWritten).tqarg(_status.bytesRead).tqarg(_status.bytesSkipped).tqarg(_status.bytesChapters));
}
@@ -63,13 +63,13 @@ k9play::k9play() {
m_useCache=false;
}
-void k9play::kdebug(QString const & _msg) {
+void k9play::kdebug(TQString const & _msg) {
#ifdef debug
m_stderr.writeBlock(_msg.latin1(),_msg.length());
#endif
}
-void k9play::writeOutput(QString const & _msg) {
+void k9play::writeOutput(TQString const & _msg) {
m_stderr.writeBlock(_msg.latin1(),_msg.length());
}
@@ -78,72 +78,72 @@ k9play::~k9play() {
m_stderr.close();
}
-void k9play::setstartSector(QString _value) {
+void k9play::setstartSector(TQString _value) {
if (_value !="")
m_startSector=_value.toUInt();
}
-void k9play::setinject(QString _value) {
+void k9play::setinject(TQString _value) {
m_inject=_value;
}
-void k9play::setendSector(QString _value) {
+void k9play::setendSector(TQString _value) {
if (_value!="")
m_endSector=_value.toUInt();
}
-void k9play::setaudioFilter( QString _value) {
+void k9play::setaudioFilter( TQString _value) {
if (_value!="")
- m_audioFilter=QStringList::split(",",_value);
+ m_audioFilter=TQStringList::split(",",_value);
}
-void k9play::setsubpictureFilter( QString _value) {
+void k9play::setsubpictureFilter( TQString _value) {
if (_value!="")
- m_subpictureFilter=QStringList::split(",",_value);
+ m_subpictureFilter=TQStringList::split(",",_value);
}
-void k9play::setchapterList( QString _value) {
+void k9play::setchapterList( TQString _value) {
if (_value!="")
- m_chapterList=QStringList::split(",",_value);
+ m_chapterList=TQStringList::split(",",_value);
}
-void k9play::setvampsFactor(QString _value) {
+void k9play::setvampsFactor(TQString _value) {
if (_value!="")
m_vampsFactor=_value.toDouble();
}
-void k9play::setinputSize( QString _value) {
+void k9play::setinputSize( TQString _value) {
if (_value!="")
m_inputSize=_value.toULongLong();
}
-void k9play::settotalSize( QString _value) {
+void k9play::settotalSize( TQString _value) {
if (_value!="")
m_totalSize=_value.toULongLong();
}
-void k9play::setdvdSize( QString _value) {
+void k9play::setdvdSize( TQString _value) {
if (_value!="")
m_dvdSize=_value.toULongLong();
}
-void k9play::setchapterSize( QString _value) {
+void k9play::setchapterSize( TQString _value) {
if (_value!="")
m_chapterSize=_value.toULongLong();
}
-void k9play::setchapter( QString _value) {
+void k9play::setchapter( TQString _value) {
if (_value!="")
m_chapter=_value.toUInt();
}
-void k9play::setcell(QString _value) {
+void k9play::setcell(TQString _value) {
if (_value !="")
m_cell=_value.toUInt();
}
-void k9play::setinitStatus(bool _value) {
+void k9play::setinittqStatus(bool _value) {
m_initstatus=_value;
}
@@ -234,7 +234,7 @@ void k9play::play() {
if (m_initstatus)
memset(&status,0,sizeof(k9play_st));
else {
- readStatus( status);
+ readtqStatus( status);
if (m_continue)
m_startSector=status.sector;
}
@@ -246,7 +246,7 @@ void k9play::play() {
bufferFile=new KTempFile(locateLocal("tmp", "k9copy/k9p"), "");
m_output=bufferFile->file();
} else {
- m_output=new QFile();
+ m_output=new TQFile();
m_output->open(IO_WriteOnly,stdout);
}
k9vamps vamps(NULL);
@@ -277,20 +277,20 @@ void k9play::play() {
double factor;
factor = (double) (m_totalSize - (status.bytesRead +status.bytesSkipped)) / (double) (m_dvdSize-status.bytesWritten) ;
if (factor <1) factor =1;
- kdebug(QString("shrink factor %1 totalSize:%2 (status.bytesRead +status.bytesSkipped):%3 m_dvdSize:%4 status.bytesWritten:%5").arg(factor).arg(m_totalSize).arg(status.bytesRead +status.bytesSkipped).arg(m_dvdSize).arg(status.bytesWritten) );
+ kdebug(TQString("shrink factor %1 totalSize:%2 (status.bytesRead +status.bytesSkipped):%3 m_dvdSize:%4 status.bytesWritten:%5").tqarg(factor).tqarg(m_totalSize).tqarg(status.bytesRead +status.bytesSkipped).tqarg(m_dvdSize).tqarg(status.bytesWritten) );
vamps.setVapFactor(factor);
} else {
vamps.setVapFactor(m_vampsFactor);
- kdebug(QString("vamps factor %1\n").arg(m_vampsFactor));
+ kdebug(TQString("vamps factor %1\n").tqarg(m_vampsFactor));
}
vamps.setInputSize(m_inputSize);
- for ( QStringList::Iterator it = m_audioFilter.begin(); it != m_audioFilter.end(); ++it ) {
+ for ( TQStringList::Iterator it = m_audioFilter.begin(); it != m_audioFilter.end(); ++it ) {
vamps.addAudio((*it).toInt());
}
- for ( QStringList::Iterator it = m_subpictureFilter.begin(); it != m_subpictureFilter.end(); ++it ) {
+ for ( TQStringList::Iterator it = m_subpictureFilter.begin(); it != m_subpictureFilter.end(); ++it ) {
vamps.addSubpicture((*it).toInt());
}
@@ -302,7 +302,7 @@ void k9play::play() {
/* set read ahead cache usage */
if (dvdnav_set_readahead_flag(dvdnav, DVD_READ_CACHE) != DVDNAV_STATUS_OK) {
- writeOutput( QString("ERR:Error on dvdnav_set_readahead_flag: %1\n").arg(dvdnav_err_to_string(dvdnav)));
+ writeOutput( TQString("ERR:Error on dvdnav_set_readahead_flag: %1\n").tqarg(dvdnav_err_to_string(dvdnav)));
return;
}
@@ -310,14 +310,14 @@ void k9play::play() {
if (dvdnav_menu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK ||
dvdnav_audio_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK ||
dvdnav_spu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK) {
- writeOutput( QString("ERR:Error on setting languages: %1\n").arg(dvdnav_err_to_string(dvdnav)));
+ writeOutput( TQString("ERR:Error on setting languages: %1\n").tqarg(dvdnav_err_to_string(dvdnav)));
return ;
}
/* set the PGC positioning flag to have position information relatively to the
* whole feature instead of just relatively to the current chapter */
if (dvdnav_set_PGC_positioning_flag(dvdnav, 1) != DVDNAV_STATUS_OK) {
- writeOutput(QString("ERR:Error on dvdnav_set_PGC_positioning_flag: %1\n").arg(dvdnav_err_to_string(dvdnav)));
+ writeOutput(TQString("ERR:Error on dvdnav_set_PGC_positioning_flag: %1\n").tqarg(dvdnav_err_to_string(dvdnav)));
return ;
}
@@ -351,7 +351,7 @@ void k9play::play() {
if (result == DVDNAV_STATUS_ERR) {
- writeOutput(QString("ERR:Error getting next block: %1\n").arg(dvdnav_err_to_string(dvdnav)));
+ writeOutput(TQString("ERR:Error getting next block: %1\n").tqarg(dvdnav_err_to_string(dvdnav)));
return;
}
switch (event) {
@@ -367,7 +367,7 @@ void k9play::play() {
if ((m_endSector !=0xFFFFFFFF) && (((status.bytesRead+status.bytesSkipped)/2048) >m_endSector)) {
finished=1;
- kdebug(QString("pos >m_endSector %1 %2").arg((status.bytesRead+status.bytesSkipped)/2048).arg(m_endSector));
+ kdebug(TQString("pos >m_endSector %1 %2").tqarg((status.bytesRead+status.bytesSkipped)/2048).tqarg(m_endSector));
}
if ((m_chapter !=0 && ptt !=m_chapter) || (tt != m_title))
finished=1;
@@ -375,9 +375,9 @@ void k9play::play() {
finished=1;
if (!finished && m_chapterList.count() >0) {
- if (m_chapterList.findIndex( QString::number(ptt)) == -1) {
+ if (m_chapterList.tqfindIndex( TQString::number(ptt)) == -1) {
dvdnav_part_play(dvdnav,tt, ptt+1);
- kdebug( QString("skipping chapter %1").arg(ptt));
+ kdebug( TQString("skipping chapter %1").tqarg(ptt));
continue;
//dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part);
}
@@ -386,19 +386,19 @@ void k9play::play() {
if (m_continue) {
dvdnav_sector_search(dvdnav,m_startSector , SEEK_SET);
- kdebug (QString("repositionning on %1").arg(m_startSector));
+ kdebug (TQString("repositionning on %1").tqarg(m_startSector));
m_continue=false;
finished=0;
bcell=true;
} else {
if ((m_cell==0 || (m_cell!=0 && currCell==m_cell)) && finished==0) {
if (!vamps.running())
- vamps.start(QThread::NormalPriority);
+ vamps.start(TQThread::NormalPriority);
bcopy=true;
vamps.addData( buf,len);
status.bytesRead +=len;
if (!m_useCache)
- writeOutput(QString("\rINFOPOS: %1 %2").arg((status.bytesRead+status.bytesSkipped) / DVD_VIDEO_LB_LEN).arg(lgr));
+ writeOutput(TQString("\rINFOPOS: %1 %2").tqarg((status.bytesRead+status.bytesSkipped) / DVD_VIDEO_LB_LEN).tqarg(lgr));
if (m_pos==0xFFFFFFFF)
m_pos=(status.bytesRead+status.bytesSkipped) / DVD_VIDEO_LB_LEN;
}
@@ -412,7 +412,7 @@ void k9play::play() {
/* We have received a regular block of the currently playing MPEG stream.*/
if (m_cell==0 || (m_cell!=0 && currCell==m_cell)) {
if (!vamps.running())
- vamps.start(QThread::NormalPriority);
+ vamps.start(TQThread::NormalPriority);
vamps.addData( buf,len);
status.bytesRead +=len;
bcopy=true;
@@ -521,17 +521,17 @@ void k9play::play() {
status.bytesWritten +=vamps.getOutputBytes();
if (!m_firstPass)
- saveStatus( status);
+ savetqStatus( status);
delete bufferFile;
}
void k9play::flush(k9SaveImage &_saveImage ) {
char buffer[20*DVD_VIDEO_LB_LEN];
m_output->reset();
- QFile out;
+ TQFile out;
out.open(IO_WriteOnly,stdout);
while(!m_output->atEnd()) {
- writeOutput(QString("\rINFOPOS: %1 %2").arg(m_pos).arg(m_length));
+ writeOutput(TQString("\rINFOPOS: %1 %2").tqarg(m_pos).tqarg(m_length));
m_pos+=20;
int l=m_output->readBlock(buffer,20*DVD_VIDEO_LB_LEN);
if (l>0) {