Fixup spaces in some files

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
master
Alexander Golubev 2 weeks ago
parent 4e46f706ca
commit d7d278f1e8

@ -49,13 +49,13 @@ void K3b::addDefaultPrograms( K3bExternalBinManager* m )
void K3b::addTranscodePrograms( K3bExternalBinManager* m ) void K3b::addTranscodePrograms( K3bExternalBinManager* m )
{ {
static const char* transcodeTools[] = { "transcode", static const char* transcodeTools[] = { "transcode",
0, // K3b 1.0 only uses the transcode binary 0, // K3b 1.0 only uses the transcode binary
"tcprobe", "tcprobe",
"tccat", "tccat",
"tcscan", "tcscan",
"tcextract", "tcextract",
"tcdecode", "tcdecode",
0 }; 0 };
for( int i = 0; transcodeTools[i]; ++i ) for( int i = 0; transcodeTools[i]; ++i )
m->addProgram( new K3bTranscodeProgram( transcodeTools[i] ) ); m->addProgram( new K3bTranscodeProgram( transcodeTools[i] ) );
@ -102,16 +102,16 @@ static TQString& debianWeirdnessHack( TQString& path )
f.open( IO_ReadOnly ); f.open( IO_ReadOnly );
TQString s = TQTextStream( &f ).read(); TQString s = TQTextStream( &f ).read();
if( s.contains( "cdrecord.mmap" ) && s.contains( "cdrecord.shm" ) ) { if( s.contains( "cdrecord.mmap" ) && s.contains( "cdrecord.shm" ) ) {
kdDebug() << "(K3bCdrecordProgram) Found Debian Wrapper script." << endl; kdDebug() << "(K3bCdrecordProgram) Found Debian Wrapper script." << endl;
TQString ext; TQString ext;
if( K3b::kernelVersion().versionString().left(3) > "2.2" ) if( K3b::kernelVersion().versionString().left(3) > "2.2" )
ext = ".mmap"; ext = ".mmap";
else else
ext = ".shm"; ext = ".shm";
kdDebug() << "(K3bCdrecordProgram) Using cdrecord" << ext << endl; kdDebug() << "(K3bCdrecordProgram) Using cdrecord" << ext << endl;
path += ext; path += ext;
} }
} }
} }
@ -214,7 +214,7 @@ bool K3bCdrecordProgram::scan( const TQString& p )
if( out.output().contains( "-tao" ) ) if( out.output().contains( "-tao" ) )
bin->addFeature( "tao" ); bin->addFeature( "tao" );
if( out.output().contains( "cuefile=" ) && if( out.output().contains( "cuefile=" ) &&
( wodim || bin->version > K3bVersion( 2, 1, -1, "a14") ) ) // cuefile handling was still buggy in a14 ( wodim || bin->version > K3bVersion( 2, 1, -1, "a14") ) ) // cuefile handling was still buggy in a14
bin->addFeature( "cuefile" ); bin->addFeature( "cuefile" );
// new mode 2 options since cdrecord 2.01a12 // new mode 2 options since cdrecord 2.01a12
@ -223,15 +223,15 @@ bool K3bCdrecordProgram::scan( const TQString& p )
// two checks) // two checks)
// and the version check does not handle versions like 2.01-dvd properly // and the version check does not handle versions like 2.01-dvd properly
if( out.output().contains( "-xamix" ) || if( out.output().contains( "-xamix" ) ||
bin->version >= K3bVersion( 2, 1, -1, "a12" ) || bin->version >= K3bVersion( 2, 1, -1, "a12" ) ||
wodim ) wodim )
bin->addFeature( "xamix" ); bin->addFeature( "xamix" );
// check if we run cdrecord as root // check if we run cdrecord as root
struct stat s; struct stat s;
if( !::stat( TQFile::encodeName(path), &s ) ) { if( !::stat( TQFile::encodeName(path), &s ) ) {
if( (s.st_mode & S_ISUID) && s.st_uid == 0 ) if( (s.st_mode & S_ISUID) && s.st_uid == 0 )
bin->addFeature( "suidroot" ); bin->addFeature( "suidroot" );
} }
} }
else { else {
@ -352,7 +352,7 @@ bool K3bMkisofsProgram::scan( const TQString& p )
struct stat s; struct stat s;
if( !::stat( TQFile::encodeName(path), &s ) ) { if( !::stat( TQFile::encodeName(path), &s ) ) {
if( (s.st_mode & S_ISUID) && s.st_uid == 0 ) if( (s.st_mode & S_ISUID) && s.st_uid == 0 )
bin->addFeature( "suidroot" ); bin->addFeature( "suidroot" );
} }
} }
else { else {
@ -458,7 +458,7 @@ bool K3bReadcdProgram::scan( const TQString& p )
struct stat s; struct stat s;
if( !::stat( TQFile::encodeName(path), &s ) ) { if( !::stat( TQFile::encodeName(path), &s ) ) {
if( (s.st_mode & S_ISUID) && s.st_uid == 0 ) if( (s.st_mode & S_ISUID) && s.st_uid == 0 )
bin->addFeature( "suidroot" ); bin->addFeature( "suidroot" );
} }
} }
else { else {
@ -551,7 +551,7 @@ bool K3bCdrdaoProgram::scan( const TQString& p )
struct stat s; struct stat s;
if( !::stat( TQFile::encodeName(path), &s ) ) { if( !::stat( TQFile::encodeName(path), &s ) ) {
if( (s.st_mode & S_ISUID) && s.st_uid == 0 ) if( (s.st_mode & S_ISUID) && s.st_uid == 0 )
bin->addFeature( "suidroot" ); bin->addFeature( "suidroot" );
} }
} }
else { else {

@ -131,18 +131,18 @@ void K3bAudioNormalizeJob::slotStdLine( const TQString& line )
if( m_currentAction == ADJUSTING_LEVELS ) { if( m_currentAction == ADJUSTING_LEVELS ) {
emit newTask( i18n("Adjusting volume level for track %1 of %2").arg(m_currentTrack).arg(m_files.count()) ); emit newTask( i18n("Adjusting volume level for track %1 of %2").arg(m_currentTrack).arg(m_files.count()) );
kdDebug() << "(K3bAudioNormalizeJob) adjusting level for track " kdDebug() << "(K3bAudioNormalizeJob) adjusting level for track "
<< m_currentTrack << m_currentTrack
<< " " << " "
<< m_files.at(m_currentTrack-1) << m_files.at(m_currentTrack-1)
<< endl; << endl;
} }
else { else {
emit newTask( i18n("Computing level for track %1 of %2").arg(m_currentTrack).arg(m_files.count()) ); emit newTask( i18n("Computing level for track %1 of %2").arg(m_currentTrack).arg(m_files.count()) );
kdDebug() << "(K3bAudioNormalizeJob) computing level for track " kdDebug() << "(K3bAudioNormalizeJob) computing level for track "
<< m_currentTrack << m_currentTrack
<< " " << " "
<< m_files.at(m_currentTrack-1) << m_files.at(m_currentTrack-1)
<< endl; << endl;
} }
m_currentTrack++; m_currentTrack++;
@ -159,7 +159,7 @@ void K3bAudioNormalizeJob::slotStdLine( const TQString& line )
emit subPercent( p ); emit subPercent( p );
else else
kdDebug() << "(K3bAudioNormalizeJob) subPercent parsing error at pos " kdDebug() << "(K3bAudioNormalizeJob) subPercent parsing error at pos "
<< 19 << " in line '" << line.mid( 19, 3 ) << "'" << endl; << 19 << " in line '" << line.mid( 19, 3 ) << "'" << endl;
// batch progress starts at position 50 in version 0.7.6 // batch progress starts at position 50 in version 0.7.6
p = line.mid( 50, 3 ).toInt(&ok); p = line.mid( 50, 3 ).toInt(&ok);
@ -169,7 +169,7 @@ void K3bAudioNormalizeJob::slotStdLine( const TQString& line )
emit percent( 50 + (int)((double)p/2.0) ); emit percent( 50 + (int)((double)p/2.0) );
else else
kdDebug() << "(K3bAudioNormalizeJob) percent parsing error at pos " kdDebug() << "(K3bAudioNormalizeJob) percent parsing error at pos "
<< 50 << " in line '" << line.mid( 50, 3 ) << "'" << endl; << 50 << " in line '" << line.mid( 50, 3 ) << "'" << endl;
} }
} }
@ -185,13 +185,13 @@ void K3bAudioNormalizeJob::slotProcessExited( TDEProcess* p )
break; break;
default: default:
if( !m_canceled ) { if( !m_canceled ) {
emit infoMessage( i18n("%1 returned an unknown error (code %2).").arg("normalize-audio").arg(p->exitStatus()), emit infoMessage( i18n("%1 returned an unknown error (code %2).").arg("normalize-audio").arg(p->exitStatus()),
K3bJob::ERROR ); K3bJob::ERROR );
emit infoMessage( i18n("Please send me an email with the last output."), K3bJob::ERROR ); emit infoMessage( i18n("Please send me an email with the last output."), K3bJob::ERROR );
emit infoMessage( i18n("Error while normalizing tracks."), ERROR ); emit infoMessage( i18n("Error while normalizing tracks."), ERROR );
} }
else else
emit canceled(); emit canceled();
jobFinished(false); jobFinished(false);
break; break;
} }

@ -58,7 +58,7 @@ class K3bSoxProgram : public K3bExternalProgram
TQFileInfo fi( path ); TQFileInfo fi( path );
if( fi.isDir() ) { if( fi.isDir() ) {
if( path[path.length()-1] != '/' ) if( path[path.length()-1] != '/' )
path.append("/"); path.append("/");
path.append("sox"); path.append("sox");
} }
@ -75,34 +75,34 @@ class K3bSoxProgram : public K3bExternalProgram
if( vp.start( TDEProcess::Block, TDEProcess::AllOutput ) ) { if( vp.start( TDEProcess::Block, TDEProcess::AllOutput ) ) {
int pos = out.output().find( "sox: SoX Version" ); int pos = out.output().find( "sox: SoX Version" );
if ( pos < 0 ) if ( pos < 0 )
pos = out.output().find( "sox: SoX v" ); // newer sox versions pos = out.output().find( "sox: SoX v" ); // newer sox versions
int endPos = out.output().find( "\n", pos ); int endPos = out.output().find( "\n", pos );
if( pos > 0 && endPos > 0 ) { if( pos > 0 && endPos > 0 ) {
pos += 17; pos += 17;
bin = new K3bExternalBin( this ); bin = new K3bExternalBin( this );
bin->path = path; bin->path = path;
bin->version = out.output().mid( pos, endPos-pos ); bin->version = out.output().mid( pos, endPos-pos );
addBin( bin ); addBin( bin );
return true; return true;
} }
else { else {
pos = out.output().find( "sox: Version" ); pos = out.output().find( "sox: Version" );
endPos = out.output().find( "\n", pos ); endPos = out.output().find( "\n", pos );
if( pos > 0 && endPos > 0 ) { if( pos > 0 && endPos > 0 ) {
pos += 13; pos += 13;
bin = new K3bExternalBin( this ); bin = new K3bExternalBin( this );
bin->path = path; bin->path = path;
bin->version = out.output().mid( pos, endPos-pos ); bin->version = out.output().mid( pos, endPos-pos );
addBin( bin ); addBin( bin );
return true; return true;
}
else
return false;
} }
else
return false;
}
} }
else else
return false; return false;
@ -112,7 +112,7 @@ class K3bSoxProgram : public K3bExternalProgram
class K3bSoxEncoder::Private class K3bSoxEncoder::Private
{ {
public: public:
Private() Private()
: process(0) { : process(0) {
} }
@ -183,20 +183,20 @@ bool K3bSoxEncoder::initEncoderInternal( const TQString& extension )
d->process->setRawStdin(true); d->process->setRawStdin(true);
connect( d->process, TQ_SIGNAL(processExited(TDEProcess*)), connect( d->process, TQ_SIGNAL(processExited(TDEProcess*)),
this, TQ_SLOT(slotSoxFinished(TDEProcess*)) ); this, TQ_SLOT(slotSoxFinished(TDEProcess*)) );
connect( d->process, TQ_SIGNAL(stderrLine(const TQString&)), connect( d->process, TQ_SIGNAL(stderrLine(const TQString&)),
this, TQ_SLOT(slotSoxOutputLine(const TQString&)) ); this, TQ_SLOT(slotSoxOutputLine(const TQString&)) );
connect( d->process, TQ_SIGNAL(stdoutLine(const TQString&)), connect( d->process, TQ_SIGNAL(stdoutLine(const TQString&)),
this, TQ_SLOT(slotSoxOutputLine(const TQString&)) ); this, TQ_SLOT(slotSoxOutputLine(const TQString&)) );
// input settings // input settings
*d->process << soxBin->path *d->process << soxBin->path
<< "-t" << "raw" // raw samples << "-t" << "raw" // raw samples
<< "-r" << "44100" // samplerate << "-r" << "44100" // samplerate
<< "-s" // signed linear << "-s" // signed linear
<< "-w" // 16-bit words << "-w" // 16-bit words
<< "-c" << "2" // stereo << "-c" << "2" // stereo
<< "-"; // read from stdin << "-"; // read from stdin
// output settings // output settings
*d->process << "-t" << extension; *d->process << "-t" << extension;
@ -205,28 +205,28 @@ bool K3bSoxEncoder::initEncoderInternal( const TQString& extension )
c->setGroup( "K3bSoxEncoderPlugin" ); c->setGroup( "K3bSoxEncoderPlugin" );
if( c->readBoolEntry( "manual settings", false ) ) { if( c->readBoolEntry( "manual settings", false ) ) {
*d->process << "-r" << TQString::number( c->readNumEntry( "samplerate", 44100 ) ) *d->process << "-r" << TQString::number( c->readNumEntry( "samplerate", 44100 ) )
<< "-c" << TQString::number( c->readNumEntry( "channels", 2 ) ); << "-c" << TQString::number( c->readNumEntry( "channels", 2 ) );
int size = c->readNumEntry( "data size", 16 ); int size = c->readNumEntry( "data size", 16 );
*d->process << ( size == 8 ? TQString("-b") : ( size == 32 ? TQString("-l") : TQString("-w") ) ); *d->process << ( size == 8 ? TQString("-b") : ( size == 32 ? TQString("-l") : TQString("-w") ) );
TQString encoding = c->readEntry( "data encoding", "signed" ); TQString encoding = c->readEntry( "data encoding", "signed" );
if( encoding == "unsigned" ) if( encoding == "unsigned" )
*d->process << "-u"; *d->process << "-u";
else if( encoding == "u-law" ) else if( encoding == "u-law" )
*d->process << "-U"; *d->process << "-U";
else if( encoding == "A-law" ) else if( encoding == "A-law" )
*d->process << "-A"; *d->process << "-A";
else if( encoding == "ADPCM" ) else if( encoding == "ADPCM" )
*d->process << "-a"; *d->process << "-a";
else if( encoding == "IMA_ADPCM" ) else if( encoding == "IMA_ADPCM" )
*d->process << "-i"; *d->process << "-i";
else if( encoding == "GSM" ) else if( encoding == "GSM" )
*d->process << "-g"; *d->process << "-g";
else if( encoding == "Floating-point" ) else if( encoding == "Floating-point" )
*d->process << "-f"; *d->process << "-f";
else else
*d->process << "-s"; *d->process << "-s";
} }
*d->process << d->fileName; *d->process << d->fileName;
@ -273,24 +273,24 @@ TQStringList K3bSoxEncoder::extensions() const
static TQStringList s_extensions; static TQStringList s_extensions;
if( s_extensions.isEmpty() ) { if( s_extensions.isEmpty() ) {
s_extensions << "au" s_extensions << "au"
<< "8svx" << "8svx"
<< "aiff" << "aiff"
<< "avr" << "avr"
<< "cdr" << "cdr"
<< "cvs" << "cvs"
<< "dat" << "dat"
<< "gsm" << "gsm"
<< "hcom" << "hcom"
<< "maud" << "maud"
<< "sf" << "sf"
<< "sph" << "sph"
<< "smp" << "smp"
<< "txw" << "txw"
<< "vms" << "vms"
<< "voc" << "voc"
<< "wav" << "wav"
<< "wve" << "wve"
<< "raw"; << "raw";
} }
if( k3bcore->externalBinManager()->foundBin( "sox" ) ) if( k3bcore->externalBinManager()->foundBin( "sox" ) )
@ -348,24 +348,24 @@ TQString K3bSoxEncoder::fileTypeComment( const TQString& ext ) const
long long K3bSoxEncoder::fileSize( const TQString&, const K3b::Msf& msf ) const long long K3bSoxEncoder::fileSize( const TQString&, const K3b::Msf& msf ) const
{ {
// for now we make a rough assumption based on the settings // for now we make a rough assumption based on the settings
TDEConfig* c = k3bcore->config(); TDEConfig* c = k3bcore->config();
c->setGroup( "K3bSoxEncoderPlugin" ); c->setGroup( "K3bSoxEncoderPlugin" );
if( c->readBoolEntry( "manual settings", false ) ) { if( c->readBoolEntry( "manual settings", false ) ) {
int sr = c->readNumEntry( "samplerate", 44100 ); int sr = c->readNumEntry( "samplerate", 44100 );
int ch = c->readNumEntry( "channels", 2 ); int ch = c->readNumEntry( "channels", 2 );
int wsize = c->readNumEntry( "data size", 16 ); int wsize = c->readNumEntry( "data size", 16 );
return msf.totalFrames()*sr*ch*wsize/75; return msf.totalFrames()*sr*ch*wsize/75;
} }
else { else {
// fallback to raw // fallback to raw
return msf.audioBytes(); return msf.audioBytes();
} }
} }
K3bPluginConfigWidget* K3bSoxEncoder::createConfigWidget( TQWidget* parent, K3bPluginConfigWidget* K3bSoxEncoder::createConfigWidget( TQWidget* parent,
const char* name ) const const char* name ) const
{ {
return new K3bSoxEncoderSettingsWidget( parent, name ); return new K3bSoxEncoderSettingsWidget( parent, name );
} }
@ -435,16 +435,16 @@ void K3bSoxEncoderSettingsWidget::saveConfig()
c->writeEntry( "manual settings", w->m_checkManual->isChecked() ); c->writeEntry( "manual settings", w->m_checkManual->isChecked() );
c->writeEntry( "channels", w->m_comboChannels->currentItem() == 0 c->writeEntry( "channels", w->m_comboChannels->currentItem() == 0
? 1 ? 1
: ( w->m_comboChannels->currentItem() == 2 : ( w->m_comboChannels->currentItem() == 2
? 4 ? 4
: 2 ) ); : 2 ) );
c->writeEntry( "data size", w->m_comboSize->currentItem() == 0 c->writeEntry( "data size", w->m_comboSize->currentItem() == 0
? 8 ? 8
: ( w->m_comboSize->currentItem() == 2 : ( w->m_comboSize->currentItem() == 2
? 32 ? 32
: 16 ) ); : 16 ) );
c->writeEntry( "samplerate", w->m_editSamplerate->text().toInt() ); c->writeEntry( "samplerate", w->m_editSamplerate->text().toInt() );

Loading…
Cancel
Save