LMMS
Loading...
Searching...
No Matches
juce_FlacAudioFormat.cpp
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29#if JUCE_USE_FLAC
30
31}
32
33#if defined _WIN32 && !defined __CYGWIN__
34 #include <io.h>
35#else
36 #include <unistd.h>
37#endif
38
39#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
40 #include <sys/types.h> /* for off_t */
41#endif
42
43#if HAVE_INTTYPES_H
44 #define __STDC_FORMAT_MACROS
45 #include <inttypes.h>
46#endif
47
48#if defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ || defined __EMX__
49 #include <io.h> /* for _setmode(), chmod() */
50 #include <fcntl.h> /* for _O_BINARY */
51#else
52 #include <unistd.h> /* for chown(), unlink() */
53#endif
54
55#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
56 #if defined __BORLANDC__
57 #include <utime.h> /* for utime() */
58 #else
59 #include <sys/utime.h> /* for utime() */
60 #endif
61#else
62 #include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */
63 #include <utime.h> /* for utime() */
64#endif
65
66#if defined _MSC_VER
67 #if _MSC_VER >= 1600
68 #include <stdint.h>
69 #else
70 #include <limits.h>
71 #endif
72#endif
73
74#ifdef _WIN32
75 #include <stdio.h>
76 #include <sys/stat.h>
77 #include <stdarg.h>
78 #include <windows.h>
79#endif
80
81#ifdef DEBUG
82 #include <assert.h>
83#endif
84
85#include <stdlib.h>
86#include <stdio.h>
87
88namespace juce
89{
90
91namespace FlacNamespace
92{
93#if JUCE_INCLUDE_FLAC_CODE || ! defined (JUCE_INCLUDE_FLAC_CODE)
94
95 #undef VERSION
96 #define VERSION "1.3.1"
97
98 #define FLAC__NO_DLL 1
99
100 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4312 4505 4365 4005 4334 181 111 6340 6308 6297 6001 6320)
101 #if ! JUCE_MSVC
102 #define HAVE_LROUND 1
103 #endif
104
105 #if JUCE_MAC
106 #define FLAC__SYS_DARWIN 1
107 #endif
108
109 #ifndef SIZE_MAX
110 #define SIZE_MAX 0xffffffff
111 #endif
112
114 "-Wshadow",
115 "-Wdeprecated-register",
116 "-Wswitch-enum",
117 "-Wswitch-default",
118 "-Wimplicit-fallthrough",
119 "-Wzero-as-null-pointer-constant",
120 "-Wsign-conversion",
121 "-Wredundant-decls",
122 "-Wlanguage-extension-token")
123
124 #if JUCE_INTEL
125 #if JUCE_32BIT
126 #define FLAC__CPU_IA32 1
127 #endif
128 #if JUCE_64BIT
129 #define FLAC__CPU_X86_64 1
130 #endif
131 #define FLAC__HAS_X86INTRIN 1
132 #endif
133
134 #undef __STDC_LIMIT_MACROS
135 #define __STDC_LIMIT_MACROS 1
136 #define flac_max jmax
137 #define flac_min jmin
138 #undef DEBUG // (some flac code dumps debug trace if the app defines this macro)
139 #include "flac/all.h"
140 #include "flac/libFLAC/bitmath.c"
141 #include "flac/libFLAC/bitreader.c"
142 #include "flac/libFLAC/bitwriter.c"
143 #include "flac/libFLAC/cpu.c"
144 #include "flac/libFLAC/crc.c"
145 #include "flac/libFLAC/fixed.c"
146 #include "flac/libFLAC/float.c"
147 #include "flac/libFLAC/format.c"
148 #include "flac/libFLAC/lpc_flac.c"
149 #include "flac/libFLAC/md5.c"
150 #include "flac/libFLAC/memory.c"
155 #undef VERSION
156
159
160#else
161 #include <FLAC/all.h>
162#endif
163}
164
165#undef max
166#undef min
167
168//==============================================================================
169static const char* const flacFormatName = "FLAC file";
170
171template <typename Item>
172auto emptyRange (Item item) { return Range<Item>::emptyRange (item); }
173
174//==============================================================================
175class FlacReader : public AudioFormatReader
176{
177public:
178 FlacReader (InputStream* in) : AudioFormatReader (in, flacFormatName)
179 {
180 lengthInSamples = 0;
181 decoder = FlacNamespace::FLAC__stream_decoder_new();
182
184 readCallback_, seekCallback_, tellCallback_, lengthCallback_,
185 eofCallback_, writeCallback_, metadataCallback_, errorCallback_,
186 this) == FlacNamespace::FLAC__STREAM_DECODER_INIT_STATUS_OK;
187
188 if (ok)
189 {
191
192 if (lengthInSamples == 0 && sampleRate > 0)
193 {
194 // the length hasn't been stored in the metadata, so we'll need to
195 // work it out the length the hard way, by scanning the whole file..
196 scanningForLength = true;
198 scanningForLength = false;
199 auto tempLength = lengthInSamples;
200
203 lengthInSamples = tempLength;
204 }
205 }
206 }
207
208 ~FlacReader() override
209 {
210 FlacNamespace::FLAC__stream_decoder_delete (decoder);
211 }
212
213 void useMetadata (const FlacNamespace::FLAC__StreamMetadata_StreamInfo& info)
214 {
215 sampleRate = info.sample_rate;
216 bitsPerSample = info.bits_per_sample;
217 lengthInSamples = (unsigned int) info.total_samples;
218 numChannels = info.channels;
219
220 reservoir.setSize ((int) numChannels, 2 * (int) info.max_blocksize, false, false, true);
221 }
222
223 bool readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
224 int64 startSampleInFile, int numSamples) override
225 {
226 if (! ok)
227 return false;
228
229 const auto getBufferedRange = [this] { return bufferedRange; };
230
231 const auto readFromReservoir = [this, &destSamples, &numDestChannels, &startOffsetInDestBuffer, &startSampleInFile] (const Range<int64> rangeToRead)
232 {
233 const auto bufferIndices = rangeToRead - bufferedRange.getStart();
234 const auto writePos = (int64) startOffsetInDestBuffer + (rangeToRead.getStart() - startSampleInFile);
235
236 for (int i = jmin (numDestChannels, reservoir.getNumChannels()); --i >= 0;)
237 {
238 if (destSamples[i] != nullptr)
239 {
240 memcpy (destSamples[i] + writePos,
241 reservoir.getReadPointer (i) + bufferIndices.getStart(),
242 (size_t) bufferIndices.getLength() * sizeof (int));
243 }
244 }
245 };
246
247 const auto fillReservoir = [this] (const int64 requestedStart)
248 {
249 if (requestedStart >= lengthInSamples)
250 {
251 bufferedRange = emptyRange (requestedStart);
252 return;
253 }
254
255 if (requestedStart < bufferedRange.getStart()
256 || jmax (bufferedRange.getEnd(), bufferedRange.getStart() + (int64) 511) < requestedStart)
257 {
258 // had some problems with flac crashing if the read pos is aligned more
259 // accurately than this. Probably fixed in newer versions of the library, though.
260 bufferedRange = emptyRange (requestedStart & ~511);
261 FLAC__stream_decoder_seek_absolute (decoder, (FlacNamespace::FLAC__uint64) bufferedRange.getStart());
262 return;
263 }
264
265 bufferedRange = emptyRange (bufferedRange.getEnd());
267 };
268
269 const auto remainingSamples = Reservoir::doBufferedRead (Range<int64> { startSampleInFile, startSampleInFile + numSamples },
270 getBufferedRange,
271 readFromReservoir,
272 fillReservoir);
273
274 if (! remainingSamples.isEmpty())
275 for (int i = numDestChannels; --i >= 0;)
276 if (destSamples[i] != nullptr)
277 zeromem (destSamples[i] + startOffsetInDestBuffer, (size_t) remainingSamples.getLength() * sizeof (int));
278
279 return true;
280 }
281
282 void useSamples (const FlacNamespace::FLAC__int32* const buffer[], int numSamples)
283 {
284 if (scanningForLength)
285 {
286 lengthInSamples += numSamples;
287 }
288 else
289 {
290 if (numSamples > reservoir.getNumSamples())
291 reservoir.setSize ((int) numChannels, numSamples, false, false, true);
292
293 auto bitsToShift = 32 - bitsPerSample;
294
295 for (int i = 0; i < (int) numChannels; ++i)
296 {
297 auto* src = buffer[i];
298 int n = i;
299
300 while (src == nullptr && n > 0)
301 src = buffer [--n];
302
303 if (src != nullptr)
304 {
305 auto* dest = reinterpret_cast<int*> (reservoir.getWritePointer (i));
306
307 for (int j = 0; j < numSamples; ++j)
308 dest[j] = src[j] << bitsToShift;
309 }
310 }
311
312 bufferedRange.setLength (numSamples);
313 }
314 }
315
316 //==============================================================================
317 static FlacNamespace::FLAC__StreamDecoderReadStatus readCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__byte buffer[], size_t* bytes, void* client_data)
318 {
319 *bytes = (size_t) static_cast<const FlacReader*> (client_data)->input->read (buffer, (int) *bytes);
320 return FlacNamespace::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
321 }
322
323 static FlacNamespace::FLAC__StreamDecoderSeekStatus seekCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64 absolute_byte_offset, void* client_data)
324 {
325 static_cast<const FlacReader*> (client_data)->input->setPosition ((int) absolute_byte_offset);
326 return FlacNamespace::FLAC__STREAM_DECODER_SEEK_STATUS_OK;
327 }
328
329 static FlacNamespace::FLAC__StreamDecoderTellStatus tellCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* absolute_byte_offset, void* client_data)
330 {
331 *absolute_byte_offset = (uint64) static_cast<const FlacReader*> (client_data)->input->getPosition();
332 return FlacNamespace::FLAC__STREAM_DECODER_TELL_STATUS_OK;
333 }
334
335 static FlacNamespace::FLAC__StreamDecoderLengthStatus lengthCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__uint64* stream_length, void* client_data)
336 {
337 *stream_length = (uint64) static_cast<const FlacReader*> (client_data)->input->getTotalLength();
338 return FlacNamespace::FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
339 }
340
341 static FlacNamespace::FLAC__bool eofCallback_ (const FlacNamespace::FLAC__StreamDecoder*, void* client_data)
342 {
343 return static_cast<const FlacReader*> (client_data)->input->isExhausted();
344 }
345
346 static FlacNamespace::FLAC__StreamDecoderWriteStatus writeCallback_ (const FlacNamespace::FLAC__StreamDecoder*,
347 const FlacNamespace::FLAC__Frame* frame,
348 const FlacNamespace::FLAC__int32* const buffer[],
349 void* client_data)
350 {
351 static_cast<FlacReader*> (client_data)->useSamples (buffer, (int) frame->header.blocksize);
352 return FlacNamespace::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
353 }
354
355 static void metadataCallback_ (const FlacNamespace::FLAC__StreamDecoder*,
356 const FlacNamespace::FLAC__StreamMetadata* metadata,
357 void* client_data)
358 {
359 static_cast<FlacReader*> (client_data)->useMetadata (metadata->data.stream_info);
360 }
361
362 static void errorCallback_ (const FlacNamespace::FLAC__StreamDecoder*, FlacNamespace::FLAC__StreamDecoderErrorStatus, void*)
363 {
364 }
365
366private:
367 FlacNamespace::FLAC__StreamDecoder* decoder;
368 AudioBuffer<float> reservoir;
369 Range<int64> bufferedRange;
370 bool ok = false, scanningForLength = false;
371
373};
374
375
376//==============================================================================
377class FlacWriter : public AudioFormatWriter
378{
379public:
380 FlacWriter (OutputStream* out, double rate, uint32 numChans, uint32 bits, int qualityOptionIndex)
381 : AudioFormatWriter (out, flacFormatName, rate, numChans, bits),
382 streamStartPos (output != nullptr ? jmax (output->getPosition(), 0ll) : 0ll)
383 {
384 encoder = FlacNamespace::FLAC__stream_encoder_new();
385
386 if (qualityOptionIndex > 0)
387 FLAC__stream_encoder_set_compression_level (encoder, (uint32) jmin (8, qualityOptionIndex));
388
389 FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2);
390 FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2);
391 FLAC__stream_encoder_set_channels (encoder, numChannels);
392 FLAC__stream_encoder_set_bits_per_sample (encoder, jmin ((unsigned int) 24, bitsPerSample));
393 FLAC__stream_encoder_set_sample_rate (encoder, (unsigned int) sampleRate);
396
398 encodeWriteCallback, encodeSeekCallback,
399 encodeTellCallback, encodeMetadataCallback,
400 this) == FlacNamespace::FLAC__STREAM_ENCODER_INIT_STATUS_OK;
401 }
402
403 ~FlacWriter() override
404 {
405 if (ok)
406 {
407 FlacNamespace::FLAC__stream_encoder_finish (encoder);
408 output->flush();
409 }
410 else
411 {
412 output = nullptr; // to stop the base class deleting this, as it needs to be returned
413 // to the caller of createWriter()
414 }
415
416 FlacNamespace::FLAC__stream_encoder_delete (encoder);
417 }
418
419 //==============================================================================
420 bool write (const int** samplesToWrite, int numSamples) override
421 {
422 if (! ok)
423 return false;
424
425 HeapBlock<int*> channels;
426 HeapBlock<int> temp;
427 auto bitsToShift = 32 - (int) bitsPerSample;
428
429 if (bitsToShift > 0)
430 {
431 temp.malloc (numChannels * (size_t) numSamples);
432 channels.calloc (numChannels + 1);
433
434 for (unsigned int i = 0; i < numChannels; ++i)
435 {
436 if (samplesToWrite[i] == nullptr)
437 break;
438
439 auto* destData = temp.get() + i * (size_t) numSamples;
440 channels[i] = destData;
441
442 for (int j = 0; j < numSamples; ++j)
443 destData[j] = (samplesToWrite[i][j] >> bitsToShift);
444 }
445
446 samplesToWrite = const_cast<const int**> (channels.get());
447 }
448
449 return FLAC__stream_encoder_process (encoder, (const FlacNamespace::FLAC__int32**) samplesToWrite, (unsigned) numSamples) != 0;
450 }
451
452 bool writeData (const void* const data, const int size) const
453 {
454 return output->write (data, (size_t) size);
455 }
456
457 static void packUint32 (FlacNamespace::FLAC__uint32 val, FlacNamespace::FLAC__byte* b, const int bytes)
458 {
459 b += bytes;
460
461 for (int i = 0; i < bytes; ++i)
462 {
463 *(--b) = (FlacNamespace::FLAC__byte) (val & 0xff);
464 val >>= 8;
465 }
466 }
467
468 void writeMetaData (const FlacNamespace::FLAC__StreamMetadata* metadata)
469 {
470 using namespace FlacNamespace;
471 auto& info = metadata->data.stream_info;
472
474 const unsigned int channelsMinus1 = info.channels - 1;
475 const unsigned int bitsMinus1 = info.bits_per_sample - 1;
476
477 packUint32 (info.min_blocksize, buffer, 2);
478 packUint32 (info.max_blocksize, buffer + 2, 2);
479 packUint32 (info.min_framesize, buffer + 4, 3);
480 packUint32 (info.max_framesize, buffer + 7, 3);
481 buffer[10] = (uint8) ((info.sample_rate >> 12) & 0xff);
482 buffer[11] = (uint8) ((info.sample_rate >> 4) & 0xff);
483 buffer[12] = (uint8) (((info.sample_rate & 0x0f) << 4) | (channelsMinus1 << 1) | (bitsMinus1 >> 4));
484 buffer[13] = (FLAC__byte) (((bitsMinus1 & 0x0f) << 4) | (unsigned int) ((info.total_samples >> 32) & 0x0f));
485 packUint32 ((FLAC__uint32) info.total_samples, buffer + 14, 4);
486 memcpy (buffer + 18, info.md5sum, 16);
487
488 const bool seekOk = output->setPosition (streamStartPos + 4);
489 ignoreUnused (seekOk);
490
491 // if this fails, you've given it an output stream that can't seek! It needs
492 // to be able to seek back to write the header
493 jassert (seekOk);
494
495 output->writeIntBigEndian (FLAC__STREAM_METADATA_STREAMINFO_LENGTH);
496 output->write (buffer, FLAC__STREAM_METADATA_STREAMINFO_LENGTH);
497 }
498
499 //==============================================================================
500 static FlacNamespace::FLAC__StreamEncoderWriteStatus encodeWriteCallback (const FlacNamespace::FLAC__StreamEncoder*,
501 const FlacNamespace::FLAC__byte buffer[],
502 size_t bytes,
503 unsigned int /*samples*/,
504 unsigned int /*current_frame*/,
505 void* client_data)
506 {
507 return static_cast<FlacWriter*> (client_data)->writeData (buffer, (int) bytes)
508 ? FlacNamespace::FLAC__STREAM_ENCODER_WRITE_STATUS_OK
509 : FlacNamespace::FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
510 }
511
512 static FlacNamespace::FLAC__StreamEncoderSeekStatus encodeSeekCallback (const FlacNamespace::FLAC__StreamEncoder*, FlacNamespace::FLAC__uint64, void*)
513 {
514 return FlacNamespace::FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED;
515 }
516
517 static FlacNamespace::FLAC__StreamEncoderTellStatus encodeTellCallback (const FlacNamespace::FLAC__StreamEncoder*, FlacNamespace::FLAC__uint64* absolute_byte_offset, void* client_data)
518 {
519 if (client_data == nullptr)
520 return FlacNamespace::FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED;
521
522 *absolute_byte_offset = (FlacNamespace::FLAC__uint64) static_cast<FlacWriter*> (client_data)->output->getPosition();
523 return FlacNamespace::FLAC__STREAM_ENCODER_TELL_STATUS_OK;
524 }
525
526 static void encodeMetadataCallback (const FlacNamespace::FLAC__StreamEncoder*, const FlacNamespace::FLAC__StreamMetadata* metadata, void* client_data)
527 {
528 static_cast<FlacWriter*> (client_data)->writeMetaData (metadata);
529 }
530
531 bool ok = false;
532
533private:
534 FlacNamespace::FLAC__StreamEncoder* encoder;
535 int64 streamStartPos;
536
538};
539
540
541//==============================================================================
542FlacAudioFormat::FlacAudioFormat() : AudioFormat (flacFormatName, ".flac") {}
543FlacAudioFormat::~FlacAudioFormat() {}
544
545Array<int> FlacAudioFormat::getPossibleSampleRates()
546{
547 return { 8000, 11025, 12000, 16000, 22050, 32000, 44100, 48000,
548 88200, 96000, 176400, 192000, 352800, 384000 };
549}
550
551Array<int> FlacAudioFormat::getPossibleBitDepths()
552{
553 return { 16, 24 };
554}
555
556bool FlacAudioFormat::canDoStereo() { return true; }
557bool FlacAudioFormat::canDoMono() { return true; }
558bool FlacAudioFormat::isCompressed() { return true; }
559
560AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, const bool deleteStreamIfOpeningFails)
561{
562 std::unique_ptr<FlacReader> r (new FlacReader (in));
563
564 if (r->sampleRate > 0)
565 return r.release();
566
567 if (! deleteStreamIfOpeningFails)
568 r->input = nullptr;
569
570 return nullptr;
571}
572
573AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out,
574 double sampleRate,
575 unsigned int numberOfChannels,
576 int bitsPerSample,
577 const StringPairArray& /*metadataValues*/,
578 int qualityOptionIndex)
579{
580 if (out != nullptr && getPossibleBitDepths().contains (bitsPerSample))
581 {
582 std::unique_ptr<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels,
583 (uint32) bitsPerSample, qualityOptionIndex));
584 if (w->ok)
585 return w.release();
586 }
587
588 return nullptr;
589}
590
591StringArray FlacAudioFormat::getQualityOptions()
592{
593 return { "0 (Fastest)", "1", "2", "3", "4", "5 (Default)","6", "7", "8 (Highest quality)" };
594}
595
596#endif
597
598} // namespace juce
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
#define nullptr
Definition DistrhoDefines.h:75
uint8_t uint8
Definition basics.h:86
int64_t int64
Definition basics.h:91
uint64_t uint64
Definition basics.h:92
uint32_t uint32
Definition basics.h:90
Definition Array.h:57
Definition StringArray.h:41
UINT_D64 w
Definition inflate.c:942
register unsigned j
Definition inflate.c:1576
register unsigned i
Definition inflate.c:1575
#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH
Definition format.h:550
FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder)
Definition stream_decoder.c:957
FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadCallback read_callback, FLAC__StreamDecoderSeekCallback seek_callback, FLAC__StreamDecoderTellCallback tell_callback, FLAC__StreamDecoderLengthCallback length_callback, FLAC__StreamDecoderEofCallback eof_callback, FLAC__StreamDecoderWriteCallback write_callback, FLAC__StreamDecoderMetadataCallback metadata_callback, FLAC__StreamDecoderErrorCallback error_callback, void *client_data)
Definition stream_decoder.c:459
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder)
Definition stream_decoder.c:1081
FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample)
Definition stream_decoder.c:1146
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder)
Definition stream_decoder.c:1054
FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder)
Definition stream_decoder.c:1017
FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1574
FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1563
FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1552
FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1629
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_stream(FLAC__StreamEncoder *encoder, FLAC__StreamEncoderWriteCallback write_callback, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderTellCallback tell_callback, FLAC__StreamEncoderMetadataCallback metadata_callback, void *client_data)
Definition stream_encoder.c:1237
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_escape_coding(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1787
FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1541
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1618
FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 *const buffer[], unsigned samples)
Definition stream_encoder.c:2125
FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1607
struct backing_store_struct * info
Definition jmemsys.h:183
int val
Definition jpeglib.h:956
JSAMPIMAGE data
Definition jpeglib.h:945
#define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...)
Definition juce_CompilerWarnings.h:181
#define JUCE_END_IGNORE_WARNINGS_GCC_LIKE
Definition juce_CompilerWarnings.h:182
#define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings)
Definition juce_CompilerWarnings.h:198
#define JUCE_END_IGNORE_WARNINGS_MSVC
Definition juce_CompilerWarnings.h:199
#define jassert(expression)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
float in
Definition lilv_test.c:1460
float out
Definition lilv_test.c:1461
JOCTET * buffer
Definition juce_JPEGLoader.cpp:302
Definition carla_juce.cpp:31
void ignoreUnused(Types &&...) noexcept
Definition juce_MathsFunctions.h:333
void zeromem(void *memory, size_t numBytes) noexcept
Definition juce_Memory.h:28
FLAC__uint8 FLAC__byte
Definition ordinals.h:72
uint32_t FLAC__uint32
Definition ordinals.h:65
int n
Definition crypt.c:458
memcpy(hh, h, RAND_HEAD_LEN)
int r
Definition crypt.c:458
b
Definition crypt.c:628
ulg size
Definition extract.c:2350
typedef int(UZ_EXP MsgFn)()