Skip to content

Commit

Permalink
Moved k3bprocess to tools and removed unused PipeBuffer class
Browse files Browse the repository at this point in the history
svn path=/trunk/extragear/multimedia/k3b/; revision=946079
  • Loading branch information
trueg committed Mar 28, 2009
1 parent de35775 commit ac71159
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 384 deletions.
3 changes: 1 addition & 2 deletions libk3b/CMakeLists.txt
Expand Up @@ -67,7 +67,6 @@ set(k3b_core_SRCS
core/k3bdefaultexternalprograms.cpp
core/k3bexternalbinmanager.cpp
core/k3bversion.cpp
core/k3bprocess.cpp
core/k3bjob.cpp
core/k3bthread.cpp
core/k3bthreadjob.cpp
Expand Down Expand Up @@ -95,6 +94,7 @@ set(k3b_tools_SRCS
tools/k3bmedium.cpp
tools/k3bmediacache.cpp
tools/k3bcddb.cpp
tools/k3bprocess.cpp
tools/qprocess/k3bqprocess.cpp
tools/qprocess/k3bkprocess.cpp
)
Expand Down Expand Up @@ -141,7 +141,6 @@ set(k3b_project_SRCS
projects/k3btocfilewriter.cpp
projects/k3bimagefilereader.cpp
projects/k3bcuefileparser.cpp )
# projects/k3bpipebuffer.cpp)

set(k3b_project_audiocd_SRCS
projects/audiocd/k3baudiojob.cpp
Expand Down
1 change: 0 additions & 1 deletion libk3b/core/CMakeLists.txt
Expand Up @@ -3,7 +3,6 @@ install( FILES
k3bcore.h
k3bdefaultexternalprograms.h
k3bexternalbinmanager.h
k3bprocess.h
k3bversion.h
k3bglobals.h
k3bjob.h
Expand Down
58 changes: 11 additions & 47 deletions libk3b/projects/k3bgrowisofswriter.cpp
Expand Up @@ -24,7 +24,6 @@
#include <k3bglobals.h>
#include <k3bthroughputestimator.h>
#include "k3bgrowisofshandler.h"
#include <k3bpipebuffer.h>
#include <k3bglobalsettings.h>
#include <k3bdeviceglobals.h>

Expand All @@ -46,10 +45,7 @@ class K3b::GrowisofsWriter::Private
multiSession(false),
growisofsBin( 0 ),
trackSize(-1),
layerBreak(0)
// , usingRingBuffer(false),
// ringBuffer(0)
{
layerBreak(0) {
}

K3b::WritingMode writingMode;
Expand Down Expand Up @@ -84,9 +80,6 @@ class K3b::GrowisofsWriter::Private

QFile inputFile;

// bool usingRingBuffer;
// K3b::PipeBuffer* ringBuffer;

QString multiSessionInfo;

int burnedMediumType;
Expand Down Expand Up @@ -166,7 +159,7 @@ bool K3b::GrowisofsWriter::prepareProcess()

if( d->growisofsBin->version < K3b::Version( 5, 10 ) ) {
emit infoMessage( i18n("Growisofs version %1 is too old. "
"K3b needs at least version 5.10.",d->growisofsBin->version),
"K3b needs at least version 5.10.", d->growisofsBin->version ),
MessageError );
return false;
}
Expand All @@ -178,6 +171,11 @@ bool K3b::GrowisofsWriter::prepareProcess()
,d->growisofsBin->version,d->growisofsBin->copyright), MessageInfo );


if ( !d->growisofsBin->hasFeature( "buffer" ) ) {
emit infoMessage( i18n( "Growisofs version %1 does not feature a software buffer which may result in an unstable burn process.", d->growisofsBin->version ),
MessageWarning );
}

//
// The growisofs bin is ready. Now we add the parameters
//
Expand Down Expand Up @@ -205,12 +203,9 @@ bool K3b::GrowisofsWriter::prepareProcess()

d->process << d->growisofsBin;

// set this var to true to enable the ringbuffer
// d->usingRingBuffer = !d->growisofsBin->hasFeature( "buffer" );

QString s = burnDevice()->blockDeviceName() + "=";
if( /*d->usingRingBuffer || */d->image.isEmpty() ) {
// we always read from stdin since the ringbuffer does the actual reading from the source
if( d->image.isEmpty() ) {
// we always read from stdin
s += "/dev/fd/0";
}
else
Expand All @@ -226,7 +221,7 @@ bool K3b::GrowisofsWriter::prepareProcess()
d->process << s;


if( !d->image.isEmpty() /*&& d->usingRingBuffer*/ ) {
if( !d->image.isEmpty() ) {
d->inputFile.setFileName( d->image );
d->trackSize = (K3b::filesize( d->image ) + 1024) / 2048;
if( !d->inputFile.open( QIODevice::ReadOnly ) ) {
Expand Down Expand Up @@ -314,7 +309,7 @@ bool K3b::GrowisofsWriter::prepareProcess()
if( k3bcore->globalSettings()->overburn() )
d->process << "-overburn";

if( /*!d->usingRingBuffer && */d->growisofsBin->hasFeature( "buffer" ) ) {
if( d->growisofsBin->hasFeature( "buffer" ) ) {
bool manualBufferSize = k3bcore->globalSettings()->useManualBufferSize();
int bufSize = ( manualBufferSize ? k3bcore->globalSettings()->bufferSize() : 32 );
d->process << QString("-use-the-force-luke=bufsize:%1m").arg(bufSize);
Expand Down Expand Up @@ -392,25 +387,6 @@ void K3b::GrowisofsWriter::start()
}

d->gh->handleStart();

// create the ring buffer
// if( d->usingRingBuffer ) {
// if( !d->ringBuffer ) {
// d->ringBuffer = new K3b::PipeBuffer( this, this );
// connect( d->ringBuffer, SIGNAL(percent(int)), this, SIGNAL(buffer(int)) );
// connect( d->ringBuffer, SIGNAL(finished(bool)), this, SLOT(slotRingBufferFinished(bool)) );
// }

// d->ringBuffer->writeTo( d->process );
// bool manualBufferSize = k3bcore->globalSettings()->useManualBufferSize();
// int bufSize = ( manualBufferSize ? k3bcore->globalSettings()->bufferSize() : 20 );
// d->ringBuffer->setBufferSize( bufSize );

// if( !d->image.isEmpty() )
// d->ringBuffer->readFrom( &d->inputFile );

// d->ringBuffer->start();
// }
}
}
}
Expand All @@ -421,8 +397,6 @@ void K3b::GrowisofsWriter::cancel()
if( active() ) {
d->canceled = true;
closeFd();
// if( d->usingRingBuffer && d->ringBuffer )
// d->ringBuffer->cancel();
d->process.terminate();
}
}
Expand Down Expand Up @@ -574,16 +548,6 @@ void K3b::GrowisofsWriter::slotProcessExited( int exitCode, QProcess::ExitStatus
}


// void K3b::GrowisofsWriter::slotRingBufferFinished( bool )
// {
// if( !d->finished ) {
// d->finished = true;
// // this will unblock and eject the drive and emit the finished/canceled signals
// K3b::AbstractWriter::cancel();
// }
// }


void K3b::GrowisofsWriter::slotThroughput( int t )
{
emit writeSpeed( t, d->speedMultiplicator() );
Expand Down
3 changes: 0 additions & 3 deletions libk3b/projects/k3bgrowisofswriter.h
Expand Up @@ -25,8 +25,6 @@ namespace K3b {
class Device;
}



class GrowisofsWriter : public AbstractWriter
{
Q_OBJECT
Expand Down Expand Up @@ -98,7 +96,6 @@ namespace K3b {
void slotProcessExited( int, QProcess::ExitStatus );
void slotThroughput( int t );
void slotFlushingCache();
// void slotRingBufferFinished( bool );

private:
bool closeFd();
Expand Down

0 comments on commit ac71159

Please sign in to comment.