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.

88 lines
3.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. Reads and Writes AIFF format audio files.
  18. @see AudioFormat
  19. @tags{Audio}
  20. */
  21. class JUCE_API AiffAudioFormat : public AudioFormat
  22. {
  23. public:
  24. //==============================================================================
  25. /** Creates an format object. */
  26. AiffAudioFormat();
  27. /** Destructor. */
  28. ~AiffAudioFormat() override;
  29. //==============================================================================
  30. /** Metadata property name used when reading a aiff file with a basc chunk. */
  31. static const char* const appleOneShot;
  32. /** Metadata property name used when reading a aiff file with a basc chunk. */
  33. static const char* const appleRootSet;
  34. /** Metadata property name used when reading a aiff file with a basc chunk. */
  35. static const char* const appleRootNote;
  36. /** Metadata property name used when reading a aiff file with a basc chunk. */
  37. static const char* const appleBeats;
  38. /** Metadata property name used when reading a aiff file with a basc chunk. */
  39. static const char* const appleDenominator;
  40. /** Metadata property name used when reading a aiff file with a basc chunk. */
  41. static const char* const appleNumerator;
  42. /** Metadata property name used when reading a aiff file with a basc chunk. */
  43. static const char* const appleTag;
  44. /** Metadata property name used when reading a aiff file with a basc chunk. */
  45. static const char* const appleKey;
  46. //==============================================================================
  47. Array<int> getPossibleSampleRates() override;
  48. Array<int> getPossibleBitDepths() override;
  49. bool canDoStereo() override;
  50. bool canDoMono() override;
  51. #if JUCE_MAC
  52. bool canHandleFile (const File& fileToTest) override;
  53. #endif
  54. //==============================================================================
  55. AudioFormatReader* createReaderFor (InputStream* sourceStream,
  56. bool deleteStreamIfOpeningFails) override;
  57. MemoryMappedAudioFormatReader* createMemoryMappedReader (const File&) override;
  58. MemoryMappedAudioFormatReader* createMemoryMappedReader (FileInputStream*) override;
  59. AudioFormatWriter* createWriterFor (OutputStream* streamToWriteTo,
  60. double sampleRateToUse,
  61. unsigned int numberOfChannels,
  62. int bitsPerSample,
  63. const StringPairArray& metadataValues,
  64. int qualityOptionIndex) override;
  65. using AudioFormat::createWriterFor;
  66. private:
  67. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AiffAudioFormat)
  68. };
  69. } // namespace juce