summaryrefslogtreecommitdiffstats
path: root/libk3b/projects/k3binffilewriter.h
blob: 93164edf3cd325232f8853ed733ed55a11db4c63 (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
119
/* 
 *
 * $Id: k3binffilewriter.h 619556 2007-01-03 17:38:12Z 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 _K3B_INF_FILE_WRITER_H_
#define _K3B_INF_FILE_WRITER_H_

#include <tqvaluevector.h>
#include <tqtextstream.h>

#include <k3bmsf.h>


namespace K3bDevice {
  class Track;
  class TrackCdText;
  class CdText;
}


class K3bInfFileWriter
{
 public:
  K3bInfFileWriter();

  bool save( TQTextStream& );
  bool save( const TQString& filename );

  /**
   * Use this to set:
   * @li trackStart
   * @li trackLength
   * @li index0
   * @li all indices
   * @li preemphasis
   * @li copyPermitted
   * @li ISRC
   *
   * Endianess is set to big.
   *
   * Tracknumber needs to be set manually.
   */
  void setTrack( const K3bDevice::Track& );

  void clearIndices() { m_indices.clear(); }

  /**
   * This is relative to the track start
   */
  void setIndex0( int i ) { m_index0 = i; }
  void addIndex( long i );

  void setTrackNumber( int i ) { m_trackNumber = i; }

  void setTrackStart( const K3b::Msf& i ) { m_trackStart = i; }
  void setTrackLength( const K3b::Msf& i ) { m_trackLength = i; }

  void setPreEmphasis( bool b ) { m_preEmphasis = b; }
  void setCopyPermitted( bool b ) { m_copyPermitted = b; }

  /**
   * Cdrecord seems to ignore this anyway and always expect big endian
   * data on stdin and wavs are little endian anyway.
   */
  void setBigEndian( bool b ) { m_bigEndian = b; }

  void setTrackCdText( const K3bDevice::TrackCdText& );
  void setTrackTitle( const TQString& s ) { m_trackTitle = s; }
  void setTrackPerformer( const TQString& s ) { m_trackPerformer = s; }
  void setTrackSongwriter( const TQString& s ) { m_trackSongwriter = s; }
  void setTrackComposer( const TQString& s ) { m_trackComposer = s; }
  void setTrackArranger( const TQString& s ) { m_trackArranger = s; }
  void setTrackMessage( const TQString& s ) { m_trackMessage = s; }

  void setCdText( const K3bDevice::CdText& );
  void setAlbumTitle( const TQString& s ) { m_albumTitle = s; }
  void setAlbumPerformer( const TQString& s ) { m_albumPerformer = s; }

  void setIsrc( const TQCString& s ) { m_isrc = s; }
  void setMcn( const TQCString& s ) { m_mcn = s; }

 private:
  long m_index0;

  TQValueVector<long> m_indices;

  int m_trackNumber;
  K3b::Msf m_trackStart;
  K3b::Msf m_trackLength;
  bool m_preEmphasis;
  bool m_copyPermitted;
  bool m_bigEndian;

  TQString m_trackTitle;
  TQString m_trackPerformer;
  TQString m_trackSongwriter;
  TQString m_trackComposer;
  TQString m_trackArranger;
  TQString m_trackMessage;

  TQString m_albumTitle;
  TQString m_albumPerformer;

  TQCString m_isrc;
  TQCString m_mcn;
};

#endif