File indexing completed on 2024-05-12 04:51:10
0001 /* 0002 SPDX-FileCopyrightText: 2003-2004 Christian Kvasny <chris@k3b.org> 0003 SPDX-FileCopyrightText: 2009 Sebastian Trueg <trueg@k3b.org> 0004 SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef K3BVCDJOB_H 0010 #define K3BVCDJOB_H 0011 0012 #include "k3bjob.h" 0013 #include <QProcess> 0014 0015 class K3Process; 0016 0017 namespace K3b { 0018 class VcdDoc; 0019 class VcdTrack; 0020 class Process; 0021 class AbstractWriter; 0022 class Doc; 0023 0024 class VcdJob : public BurnJob 0025 { 0026 Q_OBJECT 0027 0028 public: 0029 VcdJob( VcdDoc*, JobHandler*, QObject* parent = 0 ); 0030 ~VcdJob() override; 0031 0032 Doc* doc() const; 0033 VcdDoc* vcdDoc() const 0034 { 0035 return m_doc; 0036 } 0037 Device::Device* writer() const override; 0038 0039 QString jobDescription() const override; 0040 QString jobDetails() const override; 0041 0042 public Q_SLOTS: 0043 void start() override; 0044 void cancel() override; 0045 0046 private Q_SLOTS: 0047 void cancelAll(); 0048 0049 protected Q_SLOTS: 0050 void slotVcdxBuildFinished( int, QProcess::ExitStatus ); 0051 void slotParseVcdxBuildOutput( const QString& ); 0052 0053 void slotWriterJobPercent( int p ); 0054 void slotProcessedSize( int cs, int ts ); 0055 void slotWriterNextTrack( int t, int tt ); 0056 void slotWriterJobFinished( bool success ); 0057 0058 0059 private: 0060 bool prepareWriterJob(); 0061 0062 void xmlGen(); 0063 void vcdxBuild(); 0064 void parseInformation( const QString& ); 0065 void startWriterjob(); 0066 0067 int m_copies; 0068 int m_finishedCopies; 0069 0070 unsigned long m_blocksToCopy; 0071 unsigned long m_bytesFinishedTracks; 0072 unsigned long m_bytesFinished; 0073 0074 enum { stageUnknown, stageScan, stageWrite, _stage_max }; 0075 0076 VcdDoc* m_doc; 0077 Device::Device* m_writer; 0078 Device::Device* m_reader; 0079 VcdTrack* m_currentWrittenTrack; 0080 0081 int m_speed; 0082 int m_stage; 0083 int m_currentcopy; 0084 int m_currentWrittenTrackNumber; 0085 0086 double m_createimageonlypercent; 0087 0088 bool firstTrack; 0089 bool m_burnProof; 0090 bool m_keepImage; 0091 bool m_onlyCreateImage; 0092 bool m_onTheFly; 0093 bool m_dummy; 0094 bool m_fastToc; 0095 bool m_readRaw; 0096 bool m_imageFinished; 0097 bool m_canceled; 0098 0099 QString m_tempPath; 0100 QString m_cueFile; 0101 QString m_collectedOutput; 0102 0103 AbstractWriter* m_writerJob; 0104 Process* m_process; 0105 0106 class Private; 0107 Private* d; 0108 }; 0109 } 0110 0111 #endif