summaryrefslogtreecommitdiffstats
path: root/libk9copy/k9dvdbackup.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 /libk9copy/k9dvdbackup.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 'libk9copy/k9dvdbackup.cpp')
-rwxr-xr-xlibk9copy/k9dvdbackup.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/libk9copy/k9dvdbackup.cpp b/libk9copy/k9dvdbackup.cpp
index a651475..48a1463 100755
--- a/libk9copy/k9dvdbackup.cpp
+++ b/libk9copy/k9dvdbackup.cpp
@@ -26,8 +26,8 @@
#include "k9dvdtitleset.h"
#include <kmessagebox.h>
#include <kapplication.h>
-#include <qapplication.h>
-#include <qfileinfo.h>
+#include <tqapplication.h>
+#include <tqfileinfo.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,7 +35,7 @@
#include <errno.h>
#include <string.h>
#include <klocale.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kstandarddirs.h>
#include "k9backupdlg.h"
#include "dvdread.h"
@@ -47,13 +47,13 @@
#include "k9dvdbackup.moc"
-int k9CadtList::compareItems(QPtrCollection::Item item1,QPtrCollection::Item item2) {
+int k9CadtList::compareItems(TQPtrCollection::Item item1,TQPtrCollection::Item item2) {
cell_adr_t * it1=(cell_adr_t*)item1;
cell_adr_t * it2=(cell_adr_t*)item2;
return it1->start_sector - it2->start_sector;
};
-int k9TitleSetList::compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ) {
+int k9TitleSetList::compareItems ( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) {
k9TitleSet * it1,*it2;
it1=(k9TitleSet *) item1;
it2=(k9TitleSet *)item2;
@@ -67,7 +67,7 @@ int k9TitleSetList::compareItems ( QPtrCollection::Item item1, QPtrCollection::I
}
*/
-k9TitleSet::k9TitleSet(int _VTS):QObject(NULL,"") {
+k9TitleSet::k9TitleSet(int _VTS):TQObject(NULL,"") {
startSector=0;
lastSector=0;
VTS=_VTS;
@@ -90,8 +90,8 @@ uint32_t k9TitleSet::getSize() {
}
-k9DVDBackup::k9DVDBackup(QObject* _dvd,const char* name,const QStringList& )
- : QObject(NULL, name) {
+k9DVDBackup::k9DVDBackup(TQObject* _dvd,const char* name,const TQStringList& )
+ : TQObject(NULL, name) {
DVD = (k9DVD*)_dvd;
m_dvdread=DVD->getdvd();
currVTS=0;
@@ -99,7 +99,7 @@ k9DVDBackup::k9DVDBackup(QObject* _dvd,const char* name,const QStringList& )
currTS=NULL;
errMsg="";
error=false;
- backupDlg = new k9BackupDlg(qApp->mainWidget(),"",true);
+ backupDlg = new k9BackupDlg(tqApp->mainWidget(),"",true);
// cells.setAutoDelete(true);
vamps=new k9vamps(this);
m_withMenu=false;
@@ -125,13 +125,13 @@ bool k9DVDBackup::geterror() {
return error;
}
-void k9DVDBackup::seterror(const QString &_msg) {
+void k9DVDBackup::seterror(const TQString &_msg) {
error=true;
errMsg=_msg;
}
-QString k9DVDBackup::getErrMsg() {
+TQString k9DVDBackup::getErrMsg() {
return(errMsg);
}
@@ -196,10 +196,10 @@ void k9DVDBackup::prepareVTS(int _VTS) {
delete outputFile;
}
- QString filename;
+ TQString filename;
filename.sprintf("/VTS_%02d_1.VOB",_VTS);
filename=output+filename;
- outputFile=new QFile(filename);
+ outputFile=new TQFile(filename);
if (! outputFile->open(IO_WriteOnly)) {
seterror(tr2i18n("Unable to open file ") + filename);
return;
@@ -249,7 +249,7 @@ void k9DVDBackup::copyCell(int _VTS,k9Cell * _cell,bool _empty) {
vamps->reset();
vamps->setPreserve(true);
vamps->setInputSize(argSize);
- QValueList<int>::iterator it;
+ TQValueList<int>::iterator it;
for ( it = _cell->audio.begin(); it != _cell->audio.end(); ++it ) {
if (m_preserve)
vamps->addAudio(*it);
@@ -262,12 +262,12 @@ void k9DVDBackup::copyCell(int _VTS,k9Cell * _cell,bool _empty) {
}
vamps->setVapFactor(argFactor);
- vamps->start(QThread::NormalPriority);
+ vamps->start(TQThread::NormalPriority);
}
playCell(_VTS,_cell,_empty);
} else
copyEmptyPgc(_VTS,_cell);
- qApp->processEvents();
+ tqApp->processEvents();
}
void k9DVDBackup::copyEmptyPgc(int _vts,k9Cell *_cell) {
@@ -279,14 +279,14 @@ void k9DVDBackup::copyEmptyPgc(int _vts,k9Cell *_cell) {
k9DVDFile *dvdfile;
if ((dvdfile = m_dvdread->openTitle( _vts))== 0) {
- QString stmp;
- stmp=i18n("Unable to open titleset %1").arg(_vts);
+ TQString stmp;
+ stmp=i18n("Unable to open titleset %1").tqarg(_vts);
seterror(stmp);
return ;
}
backupDlg->setTotalSteps(vts_handle->vtsi_mat->vts_last_sector-vts_handle->vtsi_mat->vtstt_vobs -1);
- QString c;
- c=i18n("Extracting titleset %1").arg(_vts);
+ TQString c;
+ c=i18n("Extracting titleset %1").tqarg(_vts);
backupDlg->setProgressLabel(c);
backupDlg->show();
@@ -351,7 +351,7 @@ void k9DVDBackup::getOutput(uchar * buffer, uint32_t buflen) {
m_cellCopyList->addFrcoutbytes( buflen);
uchar *temp =buffer;
- QString sName;
+ TQString sName;
if ((buflen %2048) !=0)
qDebug("getOutput, buffer : %u",buflen);
uint end=0;
@@ -368,7 +368,7 @@ void k9DVDBackup::getOutput(uchar * buffer, uint32_t buflen) {
k9Vobu * vobu = vobuQueue.dequeue();
- cellOut=vobu->parent;
+ cellOut=vobu->tqparent;
dsi_t dsiPack;
navRead_DSI (&dsiPack, (uchar*)(temp+itemp) + DSI_START_BYTE);
@@ -382,7 +382,7 @@ void k9DVDBackup::getOutput(uchar * buffer, uint32_t buflen) {
else
sName.sprintf("/VTS_%02d_%d.VOB",(int)currVTS,(int)currVOB);
sName=output+sName;
- outputFile=new QFile(sName);
+ outputFile=new TQFile(sName);
if ( !outputFile->open(IO_WriteOnly)) {
seterror(tr2i18n("Unable to open file ") + sName);
mutex.unlock();
@@ -403,18 +403,18 @@ void k9DVDBackup::getOutput(uchar * buffer, uint32_t buflen) {
/*!
-\fn k9DVDBackup::setDevice(QString _device)
+\fn k9DVDBackup::setDevice(TQString _device)
*/
-void k9DVDBackup::setDevice(QString _device) {
+void k9DVDBackup::setDevice(TQString _device) {
device=_device;
}
/*!
-\fn k9DVDBackup::setOutput(QString _output)
+\fn k9DVDBackup::setOutput(TQString _output)
*/
-void k9DVDBackup::setOutput(QString _output) {
- output=QDir::cleanDirPath(_output);
+void k9DVDBackup::setOutput(TQString _output) {
+ output=TQDir::cleanDirPath(_output);
}
@@ -441,7 +441,7 @@ uint32_t k9DVDBackup::copyMenu2(int _vts) {
m_position=0;
m_copyMenu=true;
- QString targetName;
+ TQString targetName;
if (_vts == 0) {
targetName="VIDEO_TS.VOB";
} else {
@@ -449,7 +449,7 @@ uint32_t k9DVDBackup::copyMenu2(int _vts) {
}
targetName=output+"/"+targetName;
- outputFile=new QFile(targetName);
+ outputFile=new TQFile(targetName);
if (! outputFile->open(IO_WriteOnly)) {
seterror(tr2i18n("Unable to open file ") + targetName);
return 0;
@@ -457,8 +457,8 @@ uint32_t k9DVDBackup::copyMenu2(int _vts) {
k9DVDFile *dvdfile;
if ((dvdfile = m_dvdread->openMenu( _vts))== 0) {
- QString stmp;
- stmp=i18n("Unable to open menu for titleset %1").arg(_vts);
+ TQString stmp;
+ stmp=i18n("Unable to open menu for titleset %1").tqarg(_vts);
seterror (stmp);
return 0;
}
@@ -483,8 +483,8 @@ uint32_t k9DVDBackup::copyMenu2(int _vts) {
uint32_t sector, dsi_next_vobu = 0;
uint32_t imax=length/sizeof(cell_adr_t);
- QString c;
- c=i18n("Extracting menu for titleset %1").arg(_vts);
+ TQString c;
+ c=i18n("Extracting menu for titleset %1").tqarg(_vts);
backupDlg->setProgressLabel(c);
backupDlg->show();
@@ -502,7 +502,7 @@ uint32_t k9DVDBackup::copyMenu2(int _vts) {
nbCells++;
}
//else
- //qDebug() << QString("cell start sector (%1) exceed menu size (%2)").arg((ptr+i)->start_sector).arg(menuLastSector);
+ //qDebug() << TQString("cell start sector (%1) exceed menu size (%2)").tqarg((ptr+i)->start_sector).tqarg(menuLastSector);
}
cadr.sort();
vamps->reset();
@@ -516,7 +516,7 @@ uint32_t k9DVDBackup::copyMenu2(int _vts) {
vamps->setVapFactor(argFactor);
vamps->setInputSize(msize*2048);
- vamps->start(QThread::NormalPriority);
+ vamps->start(TQThread::NormalPriority);
// while(!vamps->running() && !vamps->finished());
for(uint32_t i = 0; i < nbCells; i++) {
@@ -576,16 +576,16 @@ void k9DVDBackup::playCell (int vts_num, k9Cell *_cell,bool _empty) {
// vts_handle = ifoOpen (dvd_handle, vts_num);
vts_handle=currTS->ifoTitle->getIFO();
if (!vts_handle) {
- QString stmp;
- stmp=i18n("Unable to open ifo file for titleset %1").arg(vts_num);
+ TQString stmp;
+ stmp=i18n("Unable to open ifo file for titleset %1").tqarg(vts_num);
seterror (stmp);
//JMP vamps->setNoData();
return;
}
backupDlg->setTotalSteps( vts_handle->vtsi_mat->vts_last_sector-vts_handle->vtsi_mat->vtstt_vobs -1);
- QString c;
- c=i18n("Extracting titleset %1").arg(vts_num);
+ TQString c;
+ c=i18n("Extracting titleset %1").tqarg(vts_num);
backupDlg->setProgressLabel(c);
backupDlg->show();
} else {
@@ -598,8 +598,8 @@ void k9DVDBackup::playCell (int vts_num, k9Cell *_cell,bool _empty) {
/* open VTS data */
dvdfile = m_dvdread->openTitle (vts_num);
if (! dvdfile) {
- QString stmp;
- stmp=i18n("Unable to open vobs for titleset %1").arg(vts_num);
+ TQString stmp;
+ stmp=i18n("Unable to open vobs for titleset %1").tqarg(vts_num);
seterror( stmp);
//JMP vamps->setNoData();
return;
@@ -807,7 +807,7 @@ uint32_t k9DVDBackup::copyVobu(k9DVDFile *_fileHandle,uint32_t _startSector,k9V
m_cellCopyList->addFrcinbytes( nsectors*DVD_VIDEO_LB_LEN);
mutex.lock();
- qApp->processEvents();
+ tqApp->processEvents();
mutex.unlock();
return (end+1);
@@ -817,13 +817,13 @@ uint32_t k9DVDBackup::copyVobu(k9DVDFile *_fileHandle,uint32_t _startSector,k9V
k9Vobu * k9DVDBackup::remapVobu(uint32_t *value) {
k9Vobu *vobu=NULL;
- uint32_t sector,mask;
+ uint32_t sector,tqmask;
if ( (*value & 0x80000000) == 0x80000000) {
sector = *value & 0x7FFFFFFF;
- mask=0x80000000;
+ tqmask=0x80000000;
} else {
sector =*value;
- mask=0;
+ tqmask=0;
}
*value=0;
k9CellList *lstCell;
@@ -837,7 +837,7 @@ k9Vobu * k9DVDBackup::remapVobu(uint32_t *value) {
}
vobu=lstCell->findVobu(sector);
if (vobu !=NULL) {
- *value = vobu->newSector | mask;
+ *value = vobu->newSector | tqmask;
return vobu;
}
@@ -850,22 +850,22 @@ k9Vobu * k9DVDBackup::remapVobu(uint32_t *value) {
k9Vobu * k9DVDBackup::remapOffset(uint32_t _sector,uint32_t *_offset,int _dir) {
k9Vobu *vobu1=NULL, *vobu2=NULL;
uint32_t offset,sector;
- uint32_t maskOffset1=0,maskOffset2=0,maskSector=0;
+ uint32_t tqmaskOffset1=0,tqmaskOffset2=0,tqmaskSector=0;
if ((*_offset!= 0xbfffffff) && (*_offset!=0x3fffffff) && (*_offset!=0x7fffffff)) {
if ( (*_offset & 0x80000000) == 0x80000000)
- maskOffset1= 0x80000000;
+ tqmaskOffset1= 0x80000000;
if ( (*_offset & 0x40000000) == 0x40000000)
- maskOffset2= 0x40000000;
+ tqmaskOffset2= 0x40000000;
offset = *_offset & 0x3FFFFFFF;
if ( (_sector & 0x80000000) == 0x80000000) {
sector = _sector & 0x7FFFFFFF;
- maskSector=0x80000000;
+ tqmaskSector=0x80000000;
} else {
sector =_sector;
- maskSector=0;
+ tqmaskSector=0;
}
k9CellList *lstCell;
@@ -883,8 +883,8 @@ k9Vobu * k9DVDBackup::remapOffset(uint32_t _sector,uint32_t *_offset,int _dir) {
if ((vobu1 !=NULL) && (vobu2!=NULL)) {
- *_offset = abs(vobu1->newSector - vobu2->newSector) | maskOffset1 ;
- *_offset |= maskOffset2;
+ *_offset = abs(vobu1->newSector - vobu2->newSector) | tqmaskOffset1 ;
+ *_offset |= tqmaskOffset2;
return vobu2;
}
@@ -1099,7 +1099,7 @@ void k9DVDBackup::update4Menu(ifo_handle_t *_hifo) {
qDebug ("Error : could not find startSector");
else {
if (remapVobu(&lastSect)==NULL)
- lastSect=vobu->parent->lastSector;
+ lastSect=vobu->tqparent->lastSector;
else
lastSect--;
ptr[i].start_sector = startSect;
@@ -1312,7 +1312,7 @@ void k9DVDBackup::updateIfo() {
qDebug ("Error : could not find startSector");
else {
if (remapVobu(&lastSect)==NULL)
- lastSect= vobu->parent->lastSector;
+ lastSect= vobu->tqparent->lastSector;
else
lastSect--;
ptr[i].start_sector = startSect;
@@ -1347,10 +1347,10 @@ void k9DVDBackup::updateIfo() {
newPos=0;
for(uint32_t j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++) {
//bit 31 indicates whether VOBU time codes are discontinous with previous
- uint32_t mask=map_ent[j] & 0x80000000 ;
+ uint32_t tqmask=map_ent[j] & 0x80000000 ;
uint32_t value=map_ent[j] & 0x7FFFFFFF;
if (remapVobu(&value) !=NULL) {
- map_ent[j]=value | mask;
+ map_ent[j]=value | tqmask;
map_ent[newPos]=map_ent[j];
newPos++;
} else
@@ -1371,15 +1371,15 @@ void k9DVDBackup::updateVob(k9CellList *cellLst) {
int nbVobuUpdated=0;
uchar buffer[DVD_VIDEO_LB_LEN];
- QFile *file=NULL;
- QString dbg;
+ TQFile *file=NULL;
+ TQString dbg;
int pVobNum=-1;
//for (uint iCell=0;iCell<currTS->cells.count();iCell++) {
// k9Cell *cell=currTS->cells.at(iCell);
for (uint iCell=0;iCell< cellLst->count();iCell++) {
k9Cell *cell=cellLst->at(iCell);
for (uint ivobu=0; ivobu<cell->vobus.count();ivobu++) {
- qApp->processEvents();
+ tqApp->processEvents();
k9Vobu * vobu = cell->vobus.at(ivobu);
int VobNum=vobu->vobNum;
if (error)
@@ -1390,19 +1390,19 @@ void k9DVDBackup::updateVob(k9CellList *cellLst) {
delete file;
}
//fclose(file);
- QString sName;
+ TQString sName;
if (currVTS==0)
sName="VIDEO_TS.VOB";
else
sName.sprintf("VTS_%02d_%d.VOB",(int)currVTS,(int)VobNum);
- dbg=i18n("Updating vob %1").arg(sName);
+ dbg=i18n("Updating vob %1").tqarg(sName);
sName=output+"/"+sName;
- QFileInfo finfo(sName);
+ TQFileInfo finfo(sName);
long fileSize=finfo.size();
backupDlg->setTotalSteps(fileSize);
backupDlg->setProgressLabel(dbg);
- file =new QFile(sName);
+ file =new TQFile(sName);
file->open( IO_ReadWrite);
//file=fopen(sName,"r+b");
pVobNum=VobNum;
@@ -1509,12 +1509,12 @@ void k9DVDBackup::updateVob(k9CellList *cellLst) {
if (dsiPack.sml_pbi.ilvu_sa !=0) {
k9Vobu *vobu2=remapOffset(sector,&dsiPack.sml_pbi.ilvu_sa,1);
if (vobu2!= NULL) {
- QFile *file2;
+ TQFile *file2;
if ( vobu2->vobNum != VobNum) {
- QString sName;
+ TQString sName;
sName.sprintf("/VTS_%02d_%d.VOB",(int)currVTS,(int)vobu2->vobNum);
sName=output+sName;
- file2=new QFile(sName);
+ file2=new TQFile(sName);
file2->open(IO_ReadWrite);
//file2=fopen(sName,"rb");
} else
@@ -1622,7 +1622,7 @@ uint k9DVDBackup::getLastCell(k9CellCopyList *_cellCopyList, uint _index) {
memset(subpOrig,0,sizeof(uchar)*32);
;
- QValueList<int>::iterator it;
+ TQValueList<int>::iterator it;
for ( it = orig->audio.begin(); it != orig->audio.end(); ++it )
audioOrig[*it -1]=1;
@@ -1647,7 +1647,7 @@ uint k9DVDBackup::getLastCell(k9CellCopyList *_cellCopyList, uint _index) {
memset(audio,0,sizeof(uchar)*8);
memset(subp,0,sizeof(uchar)*32);
;
- QValueList<int>::iterator it;
+ TQValueList<int>::iterator it;
for ( it = cell->audio.begin(); it != cell->audio.end(); ++it )
audio[*it -1]=1;
@@ -1670,7 +1670,7 @@ uint k9DVDBackup::getLastCell(k9CellCopyList *_cellCopyList, uint _index) {
void k9DVDBackup::calcFactor() {
double factor=m_cellCopyList->getfactor(m_withMenu,false);
- QString sFactor;
+ TQString sFactor;
sFactor.sprintf("%.2f",factor);
backupDlg->setFactor(sFactor);
argFactor = factor;
@@ -1682,7 +1682,7 @@ void k9DVDBackup::forceFactor(double _factor) {
double minFactor=m_cellCopyList->getMinFactor( m_withMenu);
if (factor<minFactor)
factor=minFactor;
- QString sFactor;
+ TQString sFactor;
sFactor.sprintf("%.2f",factor);
backupDlg->setFactor(sFactor);
argFactor = factor;
@@ -1692,19 +1692,19 @@ void k9DVDBackup::forceFactor(double _factor) {
void k9DVDBackup::execute() {
- QString sOutput=output;
+ TQString sOutput=output;
- output=QDir::cleanDirPath(output +"/dvd");
+ output=TQDir::cleanDirPath(output +"/dvd");
- QDir root("/");
+ TQDir root("/");
root.mkdir(output);
k9Tools::clearOutput(output);
- QDir dir(output);
+ TQDir dir(output);
dir.mkdir("VIDEO_TS");
dir.mkdir("AUDIO_TS");
- output=QDir::cleanDirPath(output +"/VIDEO_TS");
+ output=TQDir::cleanDirPath(output +"/VIDEO_TS");
m_dvdread->openDevice(device);
if (!m_dvdread->opened()) {