File indexing completed on 2024-05-05 04:50:56

0001 /*
0002     SPDX-FileCopyrightText: 2011 Michal Malek <michalm@jabster.pl>
0003     SPDX-FileCopyrightText: 1998-2007 Sebastian Trueg <trueg@k3b.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef _K3B_CLONE_JOB_H_
0009 #define _K3B_CLONE_JOB_H_
0010 
0011 #include "k3bjob.h"
0012 #include "k3b_export.h"
0013 #include <QString>
0014 
0015 
0016 namespace K3b {
0017     namespace Device {
0018         class Device;
0019     }
0020     class CdrecordWriter;
0021     class ReadcdReader;
0022 
0023     class LIBK3B_EXPORT CloneJob : public BurnJob
0024     {
0025         Q_OBJECT
0026 
0027     public:
0028         explicit CloneJob( JobHandler*, QObject* parent = 0 );
0029         ~CloneJob() override;
0030 
0031         Device::Device* writer() const override { return m_writerDevice; }
0032         Device::Device* readingDevice() const { return m_readerDevice; }
0033 
0034         QString jobDescription() const override;
0035         QString jobDetails() const override;
0036         QString jobSource() const override;
0037         QString jobTarget() const override;
0038 
0039     public Q_SLOTS:
0040         void start() override;
0041         void cancel() override;
0042 
0043         void setWriterDevice( K3b::Device::Device* w ) { m_writerDevice = w; }
0044         void setReaderDevice( K3b::Device::Device* w ) { m_readerDevice = w; }
0045         void setImagePath( const QString& p ) { m_imagePath = p; }
0046         void setNoCorrection( bool b ) { m_noCorrection = b; }
0047         void setRemoveImageFiles( bool b ) { m_removeImageFiles = b; }
0048         void setOnlyCreateImage( bool b ) { m_onlyCreateImage = b; }
0049         void setOnlyBurnExistingImage( bool b ) { m_onlyBurnExistingImage = b; }
0050         void setSimulate( bool b ) { m_simulate = b; }
0051         void setWriteSpeed( int s ) { m_speed = s; }
0052         void setCopies( int c ) { m_copies = c; }
0053         void setReadRetries( int i ) { m_readRetries = i; }
0054 
0055     private Q_SLOTS:
0056         void slotWriterPercent( int );
0057         void slotWriterFinished( bool );
0058         void slotWriterNextTrack( int, int );
0059         void slotReadingPercent( int );
0060         void slotReadingFinished( bool );
0061 
0062     private:
0063         void removeImageFiles();
0064         void prepareReader();
0065         void prepareWriter();
0066         void startWriting();
0067 
0068         Device::Device* m_writerDevice;
0069         Device::Device* m_readerDevice;
0070         QString m_imagePath;
0071 
0072         CdrecordWriter* m_writerJob;
0073         ReadcdReader* m_readcdReader;
0074 
0075         bool m_noCorrection;
0076         bool m_removeImageFiles;
0077 
0078         bool m_canceled;
0079         bool m_running;
0080 
0081         bool m_simulate;
0082         int m_speed;
0083         int m_copies;
0084         bool m_onlyCreateImage;
0085         bool m_onlyBurnExistingImage;
0086         int m_readRetries;
0087 
0088         class Private;
0089         Private* d;
0090     };
0091 }
0092 
0093 #endif