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.

122 lines
3.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-7 by Raw Material Software ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the
  7. GNU General Public License, as published by the Free Software Foundation;
  8. either version 2 of the License, or (at your option) any later version.
  9. JUCE is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with JUCE; if not, visit www.gnu.org/licenses or write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. ------------------------------------------------------------------------------
  18. If you'd like to release a closed-source product which uses JUCE, commercial
  19. licenses are also available: visit www.rawmaterialsoftware.com/juce for
  20. more information.
  21. ==============================================================================
  22. */
  23. /*#include "../../../src/juce_core/basics/juce_StandardHeader.h"
  24. #include <Carbon/Carbon.h>
  25. extern "C"
  26. {
  27. int juce_findDiskBurnerDevices (const char** devices);
  28. void* juce_openDiskBurnerDevice (int deviceIndex);
  29. void juce_deleteDiskBurnerDevice (void* diskBurnerDevice);
  30. bool juce_isDiskPresentInDevice (void* diskBurnerDevice);
  31. int juce_getNumAvailableAudioBlocks (void* diskBurnerDevice);
  32. typedef bool (*diskBurnCallback) (void* userRef, float progress);
  33. void juce_performBurn (void* diskBurnerDevice, diskBurnCallback callback);
  34. }
  35. BEGIN_JUCE_NAMESPACE
  36. #include "../../../src/juce_appframework/audio/audio_file_formats/juce_AudioCDBurner.h"
  37. //==============================================================================
  38. AudioCDBurner::AudioCDBurner (const int deviceIndex)
  39. : internal (0)
  40. {
  41. internal = juce_openDiskBurnerDevice (deviceIndex);
  42. }
  43. AudioCDBurner::~AudioCDBurner()
  44. {
  45. if (internal != 0)
  46. juce_deleteDiskBurnerDevice (internal);
  47. }
  48. AudioCDBurner* AudioCDBurner::openDevice (const int deviceIndex)
  49. {
  50. AudioCDBurner* b = new AudioCDBurner (deviceIndex);
  51. if (b->internal == 0)
  52. deleteAndZero (b);
  53. return b;
  54. }
  55. const StringArray AudioCDBurner::findAvailableDevices()
  56. {
  57. int num = juce_findDiskBurnerDevices (0);
  58. char** names = (char**) juce_calloc (sizeof (char*) * num);
  59. for (int i = num; --i >= 0;)
  60. names[i] = (char*) juce_calloc (2048);
  61. juce_findDiskBurnerDevices ((const char**) names);
  62. StringArray s;
  63. for (int i = num; --i >= 0;)
  64. {
  65. s.add (String::fromUTF8 ((juce::uint8*) names[i]));
  66. juce_free (names[i]);
  67. }
  68. return s;
  69. }
  70. bool AudioCDBurner::isDiskPresent() const
  71. {
  72. return juce_isDiskPresentInDevice (internal);
  73. }
  74. int AudioCDBurner::getNumAvailableAudioBlocks() const
  75. {
  76. return juce_getNumAvailableAudioBlocks (internal);
  77. }
  78. bool AudioCDBurner::addAudioTrack (AudioFormatReader& source, int numSamples)
  79. {
  80. juce_BeginAudioTrack (internal);
  81. juce_AddSamplesToAudioTrack (internal, samples, num);
  82. juce_EndAudioTrack (internal);
  83. return false;
  84. }
  85. bool AudioCDBurner::addAudioTrack (AudioSource& source, int numSamples)
  86. {
  87. return false;
  88. }
  89. const String AudioCDBurner::burn (BurnProgressListener* listener,
  90. const bool ejectDiscAfterwards)
  91. {
  92. return String::empty;
  93. }
  94. END_JUCE_NAMESPACE*/