summaryrefslogtreecommitdiffstats
path: root/libk3b/jobs/k3bcdcopyjob.h
blob: 013100e05221dd6474847b32282ee7917b8a3c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* 
 *
 * $Id: k3bcdcopyjob.h 690187 2007-07-20 09:18:03Z trueg $
 * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * See the file "COPYING" for the exact licensing terms.
 */


#ifndef _K3BCDCOPYJOB_H_
#define _K3BCDCOPYJOB_H_

#include <k3bjob.h>
#include "k3b_export.h"

namespace K3bDevice {
  class Device;
  class DeviceHandler;
}


/**
  *@author Sebastian Trueg
  */
class LIBK3B_EXPORT K3bCdCopyJob : public K3bBurnJob
{
  Q_OBJECT
  

 public:
  K3bCdCopyJob( K3bJobHandler* hdl, TQObject* parent = 0 );
  ~K3bCdCopyJob();

  K3bDevice::Device* writer() const { return m_onlyCreateImages ? 0 : m_writerDevice; }
  K3bDevice::Device* reader() const { return m_readerDevice; }
	
  TQString jobDescription() const;
  TQString jobDetails() const;

 public slots:
  void start();
  void cancel();

 public:
  void setWriterDevice( K3bDevice::Device* dev ) { m_writerDevice = dev; }
  void setReaderDevice( K3bDevice::Device* dev ) { m_readerDevice = dev; }
  void setWritingMode( int m ) { m_writingMode = m; }
  void setSpeed( int s ) { m_speed = s; }
  void setOnTheFly( bool b ) { m_onTheFly = b; }
  void setKeepImage( bool b ) { m_keepImage = b; }
  void setOnlyCreateImage( bool b ) { m_onlyCreateImages = b; }
  void setSimulate( bool b ) { m_simulate = b; }
  void setTempPath( const TQString& path ) { m_tempPath= path; }
  void setCopies( unsigned int c ) { m_copies = c; }
  void setParanoiaMode( int i ) { m_paranoiaMode = i; }
  void setIgnoreDataReadErrors( bool b ) { m_ignoreDataReadErrors = b; }
  void setDataReadRetries( int i ) { m_dataReadRetries = i; }
  void setIgnoreAudioReadErrors( bool b ) { m_ignoreAudioReadErrors = b; }
  void setAudioReadRetries( int i ) { m_audioReadRetries = i; }
  void setPreferCdText( bool b ) { m_preferCdText = b; }
  void setCopyCdText( bool b ) { m_copyCdText = b; }
  void setNoCorrection( bool b ) { m_noCorrection = b; }

 private slots:
  void slotDiskInfoReady( K3bDevice::DeviceHandler* );
  void slotCdTextReady( K3bDevice::DeviceHandler* );
  void slotMediaReloadedForNextSession( K3bDevice::DeviceHandler* dh );
  void slotCddbQueryFinished(int);
  void slotWritingNextTrack( int t, int tt );
  void slotReadingNextTrack( int t, int tt );
  void slotSessionReaderFinished( bool success );
  void slotWriterFinished( bool success );
  void slotReaderProgress( int p );
  void slotReaderSubProgress( int p );
  void slotWriterProgress( int p );
  void slotReaderProcessedSize( int p, int pp );

 private:
  void startCopy();
  void searchCdText();
  void queryCddb();
  bool writeNextSession();
  void readNextSession();
  bool prepareImageFiles();
  void cleanup();
  void finishJob( bool canceled, bool error );

  K3bDevice::Device* m_writerDevice;
  K3bDevice::Device* m_readerDevice;
  bool m_simulate;
  int m_speed;
  int m_paranoiaMode;
  unsigned int m_copies;
  bool m_keepImage;
  bool m_onlyCreateImages;
  bool m_onTheFly;
  bool m_ignoreDataReadErrors;
  bool m_ignoreAudioReadErrors;
  bool m_noCorrection;
  int m_dataReadRetries;
  int m_audioReadRetries;
  bool m_preferCdText;
  bool m_copyCdText;
  TQString m_tempPath;
  int m_writingMode;

  class Private;
  Private* d;
};

#endif