File indexing completed on 2024-06-16 07:42:05

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