The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-9 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCE_AUDIOCDBURNER_JUCEHEADER__
  19. #define __JUCE_AUDIOCDBURNER_JUCEHEADER__
  20. #if JUCE_USE_CDBURNER
  21. #include "juce_AudioFormatReader.h"
  22. #include "../audio_sources/juce_AudioSource.h"
  23. //==============================================================================
  24. /**
  25. */
  26. class AudioCDBurner
  27. {
  28. public:
  29. //==============================================================================
  30. /** Returns a list of available optical drives.
  31. Use openDevice() to open one of the items from this list.
  32. */
  33. static const StringArray findAvailableDevices();
  34. /** Tries to open one of the optical drives.
  35. The deviceIndex is an index into the array returned by findAvailableDevices().
  36. */
  37. static AudioCDBurner* openDevice (const int deviceIndex);
  38. /** Destructor. */
  39. ~AudioCDBurner();
  40. //==============================================================================
  41. /** Returns true if there's a writable disk in the drive.
  42. */
  43. bool isDiskPresent() const;
  44. /** Returns the number of free blocks on the disk.
  45. There are 75 blocks per second, at 44100Hz.
  46. */
  47. int getNumAvailableAudioBlocks() const;
  48. /** Adds a track to be written.
  49. The source passed-in here will be kept by this object, and it will
  50. be used and deleted at some point in the future, either during the
  51. burn() method or when this AudioCDBurner object is deleted. Your caller
  52. method shouldn't keep a reference to it or use it again after passing
  53. it in here.
  54. */
  55. bool addAudioTrack (AudioSource* source, int numSamples);
  56. /**
  57. Return true to cancel the current burn operation
  58. */
  59. class BurnProgressListener
  60. {
  61. public:
  62. BurnProgressListener() throw() {}
  63. virtual ~BurnProgressListener() {}
  64. /** Called at intervals to report on the progress of the AudioCDBurner.
  65. To cancel the burn, return true from this.
  66. */
  67. virtual bool audioCDBurnProgress (float proportionComplete) = 0;
  68. };
  69. const String burn (BurnProgressListener* listener,
  70. const bool ejectDiscAfterwards,
  71. const bool peformFakeBurnForTesting);
  72. //==============================================================================
  73. juce_UseDebuggingNewOperator
  74. private:
  75. AudioCDBurner (const int deviceIndex);
  76. void* internal;
  77. };
  78. #endif
  79. #endif // __JUCE_AUDIOCDBURNER_JUCEHEADER__