openshot-audio  0.1.7
juce_AudioCDBurner.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_AUDIOCDBURNER_H_INCLUDED
26 #define JUCE_AUDIOCDBURNER_H_INCLUDED
27 
28 #if JUCE_USE_CDBURNER || DOXYGEN
29 
30 
31 //==============================================================================
34 class AudioCDBurner : public ChangeBroadcaster
35 {
36 public:
37  //==============================================================================
42  static StringArray findAvailableDevices();
43 
48  static AudioCDBurner* openDevice (const int deviceIndex);
49 
51  ~AudioCDBurner();
52 
53  //==============================================================================
54  enum DiskState
55  {
56  unknown,
57  trayOpen,
59  noDisc,
60  writableDiskPresent,
61  readOnlyDiskPresent
62  };
63 
69  DiskState getDiskState() const;
70 
72  bool isDiskPresent() const;
73 
78  bool openTray();
79 
83  DiskState waitUntilStateChange (int timeOutMilliseconds);
84 
85  //==============================================================================
91  Array<int> getAvailableWriteSpeeds() const;
92 
93  //==============================================================================
98  bool setBufferUnderrunProtection (bool shouldBeEnabled);
99 
100  //==============================================================================
105  int getNumAvailableAudioBlocks() const;
106 
115  bool addAudioTrack (AudioSource* source, int numSamples);
116 
117  //==============================================================================
121  class BurnProgressListener
122  {
123  public:
124  BurnProgressListener() noexcept {}
125  virtual ~BurnProgressListener() {}
126 
131  virtual bool audioCDBurnProgress (float proportionComplete) = 0;
132  };
133 
143  String burn (BurnProgressListener* listener,
144  bool ejectDiscAfterwards,
145  bool performFakeBurnForTesting,
146  int writeSpeed);
147 
154  void abortBurn();
155 
156 private:
157  //==============================================================================
158  AudioCDBurner (const int deviceIndex);
159 
160  class Pimpl;
161  friend struct ContainerDeletePolicy<Pimpl>;
162  ScopedPointer<Pimpl> pimpl;
163 
165 };
166 
167 
168 #endif
169 #endif // JUCE_AUDIOCDBURNER_H_INCLUDED
Definition: juce_AudioSource.h:110
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_String.h:43
Definition: juce_ChangeBroadcaster.h:35
Definition: juce_ScopedPointer.h:70
Definition: juce_StringArray.h:39
Definition: juce_ContainerDeletePolicy.h:44
Definition: juce_Array.h:60
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198