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.

614 lines
22KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. namespace juce
  20. {
  21. #if JUCE_USE_FLAC
  22. }
  23. #if defined _WIN32 && !defined __CYGWIN__
  24. #include <io.h>
  25. #else
  26. #include <unistd.h>
  27. #endif
  28. #if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
  29. #include <sys/types.h> /* for off_t */
  30. #endif
  31. #if HAVE_INTTYPES_H
  32. #define __STDC_FORMAT_MACROS
  33. #include <inttypes.h>
  34. #endif
  35. #if defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ || defined __EMX__
  36. #include <io.h> /* for _setmode(), chmod() */
  37. #include <fcntl.h> /* for _O_BINARY */
  38. #else
  39. #include <unistd.h> /* for chown(), unlink() */
  40. #endif
  41. #if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
  42. #if defined __BORLANDC__
  43. #include <utime.h> /* for utime() */
  44. #else
  45. #include <sys/utime.h> /* for utime() */
  46. #endif
  47. #else
  48. #include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */
  49. #include <utime.h> /* for utime() */
  50. #endif
  51. #if defined _MSC_VER
  52. #if _MSC_VER >= 1600
  53. #include <stdint.h>
  54. #else
  55. #include <limits.h>
  56. #endif
  57. #endif
  58. #ifdef _WIN32
  59. #include <stdio.h>
  60. #include <sys/stat.h>
  61. #include <stdarg.h>
  62. #include <windows.h>
  63. #endif
  64. #ifdef DEBUG
  65. #include <assert.h>
  66. #endif
  67. #include <stdlib.h>
  68. #include <stdio.h>
  69. namespace juce
  70. {
  71. namespace FlacNamespace
  72. {
  73. #if JUCE_INCLUDE_FLAC_CODE || ! defined (JUCE_INCLUDE_FLAC_CODE)
  74. #undef VERSION
  75. #define VERSION "1.3.1"
  76. #define FLAC__NO_DLL 1
  77. #if JUCE_MSVC
  78. #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4312 4505 4365 4005 4334 181 111)
  79. #else
  80. #define HAVE_LROUND 1
  81. #endif
  82. #if JUCE_MAC
  83. #define FLAC__SYS_DARWIN 1
  84. #endif
  85. #ifndef SIZE_MAX
  86. #define SIZE_MAX 0xffffffff
  87. #endif
  88. #if JUCE_CLANG
  89. #pragma clang diagnostic push
  90. #pragma clang diagnostic ignored "-Wconversion"
  91. #pragma clang diagnostic ignored "-Wshadow"
  92. #pragma clang diagnostic ignored "-Wdeprecated-register"
  93. #if __has_warning("-Wzero-as-null-pointer-constant")
  94. #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
  95. #endif
  96. #endif
  97. #if JUCE_GCC
  98. #pragma GCC diagnostic push
  99. #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  100. #pragma GCC diagnostic ignored "-Wconversion"
  101. #pragma GCC diagnostic ignored "-Wsign-conversion"
  102. #endif
  103. #if JUCE_INTEL
  104. #if JUCE_32BIT
  105. #define FLAC__CPU_IA32 1
  106. #endif
  107. #if JUCE_64BIT
  108. #define FLAC__CPU_X86_64 1
  109. #endif
  110. #define FLAC__HAS_X86INTRIN 1
  111. #endif
  112. #undef __STDC_LIMIT_MACROS
  113. #define __STDC_LIMIT_MACROS 1
  114. #define flac_max jmax
  115. #define flac_min jmin
  116. #undef DEBUG // (some flac code dumps debug trace if the app defines this macro)
  117. #include "flac/all.h"
  118. #include "flac/libFLAC/bitmath.c"
  119. #include "flac/libFLAC/bitreader.c"
  120. #include "flac/libFLAC/bitwriter.c"
  121. #include "flac/libFLAC/cpu.c"
  122. #include "flac/libFLAC/crc.c"
  123. #include "flac/libFLAC/fixed.c"
  124. #include "flac/libFLAC/float.c"
  125. #include "flac/libFLAC/format.c"
  126. #include "flac/libFLAC/lpc_flac.c"
  127. #include "flac/libFLAC/md5.c"
  128. #include "flac/libFLAC/memory.c"
  129. #include "flac/libFLAC/stream_decoder.c"
  130. #include "flac/libFLAC/stream_encoder.c"
  131. #include "flac/libFLAC/stream_encoder_framing.c"
  132. #include "flac/libFLAC/window_flac.c"
  133. #undef VERSION
  134. #else
  135. #include <FLAC/all.h>
  136. #endif
  137. #if JUCE_CLANG
  138. #pragma clang diagnostic pop
  139. #endif
  140. #if JUCE_GCC
  141. #pragma GCC diagnostic pop
  142. #endif
  143. }
  144. #undef max
  145. #undef min
  146. //==============================================================================
  147. static const char* const flacFormatName = "FLAC file";
  148. //==============================================================================
  149. class FlacReader : public AudioFormatReader
  150. {
  151. public:
  152. FlacReader (InputStream* in) : AudioFormatReader (in, flacFormatName)
  153. {
  154. lengthInSamples = 0;
  155. decoder = FlacNamespace::FLAC__stream_decoder_new();
  156. ok = FLAC__stream_decoder_init_stream (decoder,
  157. readCallback_, seekCallback_, tellCallback_, lengthCallback_,
  158. eofCallback_, writeCallback_, metadataCallback_, errorCallback_,
  159. this) == FlacNamespace::FLAC__STREAM_DECODER_INIT_STATUS_OK;
  160. if (ok)
  161. {
  162. FLAC__stream_decoder_process_until_end_of_metadata (decoder);
  163. if (lengthInSamples == 0 && sampleRate > 0)
  164. {
  165. // the length hasn't been stored in the metadata, so we'll need to
  166. // work it out the length the hard way, by scanning the whole file..
  167. scanningForLength = true;
  168. FLAC__stream_decoder_process_until_end_of_stream (decoder);
  169. scanningForLength = false;
  170. auto tempLength = lengthInSamples;
  171. FLAC__stream_decoder_reset (decoder);
  172. FLAC__stream_decoder_process_until_end_of_metadata (decoder);
  173. lengthInSamples = tempLength;
  174. }
  175. }
  176. }
  177. ~FlacReader() override
  178. {
  179. FlacNamespace::FLAC__stream_decoder_delete (decoder);
  180. }
  181. void useMetadata (const FlacNamespace::FLAC__StreamMetadata_StreamInfo& info)
  182. {
  183. sampleRate = info.sample_rate;
  184. bitsPerSample = info.bits_per_sample;
  185. lengthInSamples = (unsigned int) info.total_samples;
  186. numChannels = info.channels;
  187. reservoir.setSize ((int) numChannels, 2 * (int) info.max_blocksize, false, false, true);
  188. }
  189. // returns the number of samples read
  190. bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
  191. int64 startSampleInFile, int numSamples) override
  192. {
  193. if (! ok)
  194. return false;
  195. while (numSamples > 0)
  196. {
  197. if (startSampleInFile >= reservoirStart
  198. && startSampleInFile < reservoirStart + samplesInReservoir)
  199. {
  200. auto num = (int) jmin ((int64) numSamples,
  201. reservoirStart + samplesInReservoir - startSampleInFile);
  202. jassert (num > 0);
  203. for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;)
  204. if (destSamples[i] != nullptr)
  205. memcpy (destSamples[i] + startOffsetInDestBuffer,
  206. reservoir.getReadPointer (i, (int) (startSampleInFile - reservoirStart)),
  207. (size_t) num * sizeof (int));
  208. startOffsetInDestBuffer += num;
  209. startSampleInFile += num;
  210. numSamples -= num;
  211. }
  212. else
  213. {
  214. if (startSampleInFile >= lengthInSamples)
  215. {
  216. samplesInReservoir = 0;
  217. }
  218. else if (startSampleInFile < reservoirStart
  219. || startSampleInFile > reservoirStart + jmax (samplesInReservoir, 511))
  220. {
  221. // had some problems with flac crashing if the read pos is aligned more
  222. // accurately than this. Probably fixed in newer versions of the library, though.
  223. reservoirStart = (int) (startSampleInFile & ~511);
  224. samplesInReservoir = 0;
  225. FLAC__stream_decoder_seek_absolute (decoder, (FlacNamespace::FLAC__uint64) reservoirStart);
  226. }
  227. else
  228. {
  229. reservoirStart += samplesInReservoir;
  230. samplesInReservoir = 0;
  231. FLAC__stream_decoder_process_single (decoder);
  232. }
  233. if (samplesInReservoir == 0)
  234. break;
  235. }
  236. }
  237. if (numSamples > 0)
  238. {
  239. for (int i = numDestChannels; --i >= 0;)
  240. if (destSamples[i] != nullptr)
  241. zeromem (destSamples[i] + startOffsetInDestBuffer, (size_t) numSamples * sizeof (int));
  242. }
  243. return true;
  244. }
  245. void useSamples (const FlacNamespace::FLAC__int32* const buffer[], int numSamples)
  246. {
  247. if (scanningForLength)
  248. {
  249. lengthInSamples += numSamples;
  250. }
  251. else
  252. {
  253. if (numSamples > reservoir.getNumSamples())
  254. reservoir.setSize ((int) numChannels, numSamples, false, false, true);
  255. auto bitsToShift = 32 - bitsPerSample;
  256. for (int i = 0; i < (int) numChannels; ++i)
  257. {
  258. auto* src = buffer[i];
  259. int n = i;
  260. while (src == nullptr && n > 0)
  261. src = buffer [--n];
  262. if (src != nullptr)
  263. {
  264. auto* dest = reinterpret_cast<int*> (reservoir.getWritePointer(i));
  265. for (int j = 0; j < numSamples; ++j)
  266. dest[j] = src[j] << bitsToShift;
  267. }
  268. }
  269. samplesInReservoir = numSamples;
  270. }
  271. }
  272. //==============================================================================
  273. static FlacNamespace::FLAC__StreamDecoderReadStatus readCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__byte buffer[], size_t* bytes, void* client_data)
  274. {
  275. *bytes = (size_t) static_cast<const FlacReader*> (client_data)->input->read (buffer, (int) *bytes);
  276. return FlacNamespace::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
  277. }
  278. static FlacNamespace::FLAC__StreamDecoderSeekStatus seekCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64 absolute_byte_offset, void* client_data)
  279. {
  280. static_cast<const FlacReader*> (client_data)->input->setPosition ((int) absolute_byte_offset);
  281. return FlacNamespace::FLAC__STREAM_DECODER_SEEK_STATUS_OK;
  282. }
  283. static FlacNamespace::FLAC__StreamDecoderTellStatus tellCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* absolute_byte_offset, void* client_data)
  284. {
  285. *absolute_byte_offset = (uint64) static_cast<const FlacReader*> (client_data)->input->getPosition();
  286. return FlacNamespace::FLAC__STREAM_DECODER_TELL_STATUS_OK;
  287. }
  288. static FlacNamespace::FLAC__StreamDecoderLengthStatus lengthCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* stream_length, void* client_data)
  289. {
  290. *stream_length = (uint64) static_cast<const FlacReader*> (client_data)->input->getTotalLength();
  291. return FlacNamespace::FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
  292. }
  293. static FlacNamespace::FLAC__bool eofCallback_ (const FlacNamespace::FLAC__StreamDecoder*, void* client_data)
  294. {
  295. return static_cast<const FlacReader*> (client_data)->input->isExhausted();
  296. }
  297. static FlacNamespace::FLAC__StreamDecoderWriteStatus writeCallback_ (const FlacNamespace::FLAC__StreamDecoder*,
  298. const FlacNamespace::FLAC__Frame* frame,
  299. const FlacNamespace::FLAC__int32* const buffer[],
  300. void* client_data)
  301. {
  302. static_cast<FlacReader*> (client_data)->useSamples (buffer, (int) frame->header.blocksize);
  303. return FlacNamespace::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
  304. }
  305. static void metadataCallback_ (const FlacNamespace::FLAC__StreamDecoder*,
  306. const FlacNamespace::FLAC__StreamMetadata* metadata,
  307. void* client_data)
  308. {
  309. static_cast<FlacReader*> (client_data)->useMetadata (metadata->data.stream_info);
  310. }
  311. static void errorCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__StreamDecoderErrorStatus, void*)
  312. {
  313. }
  314. private:
  315. FlacNamespace::FLAC__StreamDecoder* decoder;
  316. AudioBuffer<float> reservoir;
  317. int reservoirStart = 0, samplesInReservoir = 0;
  318. bool ok = false, scanningForLength = false;
  319. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FlacReader)
  320. };
  321. //==============================================================================
  322. class FlacWriter : public AudioFormatWriter
  323. {
  324. public:
  325. FlacWriter (OutputStream* out, double rate, uint32 numChans, uint32 bits, int qualityOptionIndex)
  326. : AudioFormatWriter (out, flacFormatName, rate, numChans, bits),
  327. streamStartPos (output != nullptr ? jmax (output->getPosition(), 0ll) : 0ll)
  328. {
  329. encoder = FlacNamespace::FLAC__stream_encoder_new();
  330. if (qualityOptionIndex > 0)
  331. FLAC__stream_encoder_set_compression_level (encoder, (uint32) jmin (8, qualityOptionIndex));
  332. FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2);
  333. FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2);
  334. FLAC__stream_encoder_set_channels (encoder, numChannels);
  335. FLAC__stream_encoder_set_bits_per_sample (encoder, jmin ((unsigned int) 24, bitsPerSample));
  336. FLAC__stream_encoder_set_sample_rate (encoder, (unsigned int) sampleRate);
  337. FLAC__stream_encoder_set_blocksize (encoder, 0);
  338. FLAC__stream_encoder_set_do_escape_coding (encoder, true);
  339. ok = FLAC__stream_encoder_init_stream (encoder,
  340. encodeWriteCallback, encodeSeekCallback,
  341. encodeTellCallback, encodeMetadataCallback,
  342. this) == FlacNamespace::FLAC__STREAM_ENCODER_INIT_STATUS_OK;
  343. }
  344. ~FlacWriter() override
  345. {
  346. if (ok)
  347. {
  348. FlacNamespace::FLAC__stream_encoder_finish (encoder);
  349. output->flush();
  350. }
  351. else
  352. {
  353. output = nullptr; // to stop the base class deleting this, as it needs to be returned
  354. // to the caller of createWriter()
  355. }
  356. FlacNamespace::FLAC__stream_encoder_delete (encoder);
  357. }
  358. //==============================================================================
  359. bool write (const int** samplesToWrite, int numSamples) override
  360. {
  361. if (! ok)
  362. return false;
  363. HeapBlock<int*> channels;
  364. HeapBlock<int> temp;
  365. auto bitsToShift = 32 - (int) bitsPerSample;
  366. if (bitsToShift > 0)
  367. {
  368. temp.malloc (numChannels * (size_t) numSamples);
  369. channels.calloc (numChannels + 1);
  370. for (unsigned int i = 0; i < numChannels; ++i)
  371. {
  372. if (samplesToWrite[i] == nullptr)
  373. break;
  374. auto* destData = temp.get() + i * (size_t) numSamples;
  375. channels[i] = destData;
  376. for (int j = 0; j < numSamples; ++j)
  377. destData[j] = (samplesToWrite[i][j] >> bitsToShift);
  378. }
  379. samplesToWrite = const_cast<const int**> (channels.get());
  380. }
  381. return FLAC__stream_encoder_process (encoder, (const FlacNamespace::FLAC__int32**) samplesToWrite, (unsigned) numSamples) != 0;
  382. }
  383. bool writeData (const void* const data, const int size) const
  384. {
  385. return output->write (data, (size_t) size);
  386. }
  387. static void packUint32 (FlacNamespace::FLAC__uint32 val, FlacNamespace::FLAC__byte* b, const int bytes)
  388. {
  389. b += bytes;
  390. for (int i = 0; i < bytes; ++i)
  391. {
  392. *(--b) = (FlacNamespace::FLAC__byte) (val & 0xff);
  393. val >>= 8;
  394. }
  395. }
  396. void writeMetaData (const FlacNamespace::FLAC__StreamMetadata* metadata)
  397. {
  398. using namespace FlacNamespace;
  399. auto& info = metadata->data.stream_info;
  400. unsigned char buffer[FLAC__STREAM_METADATA_STREAMINFO_LENGTH];
  401. const unsigned int channelsMinus1 = info.channels - 1;
  402. const unsigned int bitsMinus1 = info.bits_per_sample - 1;
  403. packUint32 (info.min_blocksize, buffer, 2);
  404. packUint32 (info.max_blocksize, buffer + 2, 2);
  405. packUint32 (info.min_framesize, buffer + 4, 3);
  406. packUint32 (info.max_framesize, buffer + 7, 3);
  407. buffer[10] = (uint8) ((info.sample_rate >> 12) & 0xff);
  408. buffer[11] = (uint8) ((info.sample_rate >> 4) & 0xff);
  409. buffer[12] = (uint8) (((info.sample_rate & 0x0f) << 4) | (channelsMinus1 << 1) | (bitsMinus1 >> 4));
  410. buffer[13] = (FLAC__byte) (((bitsMinus1 & 0x0f) << 4) | (unsigned int) ((info.total_samples >> 32) & 0x0f));
  411. packUint32 ((FLAC__uint32) info.total_samples, buffer + 14, 4);
  412. memcpy (buffer + 18, info.md5sum, 16);
  413. const bool seekOk = output->setPosition (streamStartPos + 4);
  414. ignoreUnused (seekOk);
  415. // if this fails, you've given it an output stream that can't seek! It needs
  416. // to be able to seek back to write the header
  417. jassert (seekOk);
  418. output->writeIntBigEndian (FLAC__STREAM_METADATA_STREAMINFO_LENGTH);
  419. output->write (buffer, FLAC__STREAM_METADATA_STREAMINFO_LENGTH);
  420. }
  421. //==============================================================================
  422. static FlacNamespace::FLAC__StreamEncoderWriteStatus encodeWriteCallback (const FlacNamespace::FLAC__StreamEncoder*,
  423. const FlacNamespace::FLAC__byte buffer[],
  424. size_t bytes,
  425. unsigned int /*samples*/,
  426. unsigned int /*current_frame*/,
  427. void* client_data)
  428. {
  429. return static_cast<FlacWriter*> (client_data)->writeData (buffer, (int) bytes)
  430. ? FlacNamespace::FLAC__STREAM_ENCODER_WRITE_STATUS_OK
  431. : FlacNamespace::FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
  432. }
  433. static FlacNamespace::FLAC__StreamEncoderSeekStatus encodeSeekCallback (const FlacNamespace::FLAC__StreamEncoder*, FlacNamespace::FLAC__uint64, void*)
  434. {
  435. return FlacNamespace::FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED;
  436. }
  437. static FlacNamespace::FLAC__StreamEncoderTellStatus encodeTellCallback (const FlacNamespace::FLAC__StreamEncoder*, FlacNamespace::FLAC__uint64* absolute_byte_offset, void* client_data)
  438. {
  439. if (client_data == nullptr)
  440. return FlacNamespace::FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED;
  441. *absolute_byte_offset = (FlacNamespace::FLAC__uint64) static_cast<FlacWriter*> (client_data)->output->getPosition();
  442. return FlacNamespace::FLAC__STREAM_ENCODER_TELL_STATUS_OK;
  443. }
  444. static void encodeMetadataCallback (const FlacNamespace::FLAC__StreamEncoder*, const FlacNamespace::FLAC__StreamMetadata* metadata, void* client_data)
  445. {
  446. static_cast<FlacWriter*> (client_data)->writeMetaData (metadata);
  447. }
  448. bool ok = false;
  449. private:
  450. FlacNamespace::FLAC__StreamEncoder* encoder;
  451. int64 streamStartPos;
  452. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FlacWriter)
  453. };
  454. //==============================================================================
  455. FlacAudioFormat::FlacAudioFormat() : AudioFormat (flacFormatName, ".flac") {}
  456. FlacAudioFormat::~FlacAudioFormat() {}
  457. Array<int> FlacAudioFormat::getPossibleSampleRates()
  458. {
  459. return { 8000, 11025, 12000, 16000, 22050, 32000, 44100, 48000,
  460. 88200, 96000, 176400, 192000, 352800, 384000 };
  461. }
  462. Array<int> FlacAudioFormat::getPossibleBitDepths()
  463. {
  464. return { 16, 24 };
  465. }
  466. bool FlacAudioFormat::canDoStereo() { return true; }
  467. bool FlacAudioFormat::canDoMono() { return true; }
  468. bool FlacAudioFormat::isCompressed() { return true; }
  469. AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, const bool deleteStreamIfOpeningFails)
  470. {
  471. std::unique_ptr<FlacReader> r (new FlacReader (in));
  472. if (r->sampleRate > 0)
  473. return r.release();
  474. if (! deleteStreamIfOpeningFails)
  475. r->input = nullptr;
  476. return nullptr;
  477. }
  478. AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out,
  479. double sampleRate,
  480. unsigned int numberOfChannels,
  481. int bitsPerSample,
  482. const StringPairArray& /*metadataValues*/,
  483. int qualityOptionIndex)
  484. {
  485. if (out != nullptr && getPossibleBitDepths().contains (bitsPerSample))
  486. {
  487. std::unique_ptr<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels,
  488. (uint32) bitsPerSample, qualityOptionIndex));
  489. if (w->ok)
  490. return w.release();
  491. }
  492. return nullptr;
  493. }
  494. StringArray FlacAudioFormat::getQualityOptions()
  495. {
  496. return { "0 (Fastest)", "1", "2", "3", "4", "5 (Default)","6", "7", "8 (Highest quality)" };
  497. }
  498. #endif
  499. } // namespace juce