Skip to content

Commit 0ab1905

Browse files
committed
Fixes to support the latest JUCE/develop.
1 parent 764bb1a commit 0ab1905

File tree

5 files changed

+22
-25
lines changed

5 files changed

+22
-25
lines changed

demo/JuceLibraryCode/AppConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
#endif
115115

116116
#ifndef JUCE_USE_LAME_AUDIO_FORMAT
117-
#define JUCE_USE_LAME_AUDIO_FORMAT 1
117+
//#define JUCE_USE_LAME_AUDIO_FORMAT 0
118118
#endif
119119

120120
#ifndef JUCE_USE_WINDOWS_MEDIA_FORMAT

demo/SquarePineDemo.jucer

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@
8787
</GROUP>
8888
</MAINGROUP>
8989
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1" JUCE_USE_CAMERA="1" JUCE_USE_WINRT_MIDI="1"
90-
JUCE_USE_MP3AUDIOFORMAT="1" JUCE_USE_LAME_AUDIO_FORMAT="1" JUCE_PLUGINHOST_VST3="1"
91-
JUCE_PLUGINHOST_AU="1" JUCE_PLUGINHOST_LADSPA="1" JUCE_USE_WIN_WEBVIEW2="1"
92-
SQUAREPINE_COMPILE_UNIT_TESTS="1" SQUAREPINE_LOG_GOOGLE_ANALYTICS="1"
93-
SQUAREPINE_USE_REX_AUDIO_FORMAT="1" SQUAREPINE_LOG_OPENGL_INFO="1"/>
90+
JUCE_USE_MP3AUDIOFORMAT="1" JUCE_PLUGINHOST_VST3="1" JUCE_PLUGINHOST_AU="1"
91+
JUCE_PLUGINHOST_LADSPA="1" JUCE_USE_WIN_WEBVIEW2="1" SQUAREPINE_COMPILE_UNIT_TESTS="1"
92+
SQUAREPINE_LOG_GOOGLE_ANALYTICS="1" SQUAREPINE_USE_REX_AUDIO_FORMAT="1"
93+
SQUAREPINE_LOG_OPENGL_INFO="1"/>
9494
<EXPORTFORMATS>
9595
<ANDROIDSTUDIO targetFolder="builds/android" smallIcon="jqPxuh" bigIcon="jqPxuh"
9696
androidAdditionalResourceFolders="assets/Android/res" androidTheme="@style/ActivityTheme"

modules/squarepine_audio/codecs/ALACAudioFormat.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@ class ALACAudioFormatWriter final : public AudioFormatWriter
204204
{
205205
public:
206206
ALACAudioFormatWriter (OutputStream* out, double rate,
207-
unsigned int numChans, unsigned int bits,
208-
const StringPairArray&) :
209-
AudioFormatWriter (out, TRANS (alac::formatName), rate, numChans, bits)
207+
int numChans, int bits,
208+
const std::unordered_map<String, String>& metadataMap) :
209+
AudioFormatWriter (out, TRANS (alac::formatName), rate, (uint32) numChans, (uint32) bits)
210210
{
211+
ignoreUnused (metadataMap); // TODO
211212
}
212213

213214
~ALACAudioFormatWriter() override
@@ -260,20 +261,19 @@ AudioFormatReader* ALACAudioFormat::createReaderFor (InputStream* sourceStream,
260261
return nullptr;
261262
}
262263

263-
AudioFormatWriter* ALACAudioFormat::createWriterFor (OutputStream* out,
264-
double sampleRate,
265-
unsigned int numberOfChannels,
266-
int bitsPerSample,
267-
const StringPairArray& metadataValues,
268-
int)
264+
std::unique_ptr<AudioFormatWriter> ALACAudioFormat::createWriterFor (std::unique_ptr<OutputStream>& out,
265+
const AudioFormatWriterOptions& options)
266+
269267
{
270268
if (out != nullptr
271-
&& getPossibleSampleRates().contains ((int) sampleRate)
272-
&& getPossibleBitDepths().contains (bitsPerSample)
273-
&& numberOfChannels > 0
274-
&& isPositiveAndBelow ((int) numberOfChannels, (int) alac::maxChannels))
275-
return new ALACAudioFormatWriter (out, sampleRate, numberOfChannels,
276-
(unsigned int) bitsPerSample, metadataValues);
269+
&& getPossibleSampleRates().contains ((int) options.getSampleRate())
270+
&& getPossibleBitDepths().contains (options.getBitsPerSample())
271+
&& options.getNumChannels() > 0
272+
&& isPositiveAndBelow (options.getNumChannels(), (int) alac::maxChannels))
273+
{
274+
return std::make_unique<ALACAudioFormatWriter> (out.release(), options.getSampleRate(), options.getNumChannels(),
275+
options.getBitsPerSample(), options.getMetadataValues());
276+
}
277277

278278
return nullptr;
279279
}

modules/squarepine_audio/codecs/ALACAudioFormat.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ class ALACAudioFormat final : public AudioFormat
2424
/** @internal */
2525
AudioFormatReader* createReaderFor (InputStream*, bool) override;
2626
/** @internal */
27-
AudioFormatWriter* createWriterFor (OutputStream*, double, unsigned int,
28-
int, const StringPairArray&, int) override;
29-
/** @internal */
30-
using AudioFormat::createWriterFor;
27+
std::unique_ptr<AudioFormatWriter> createWriterFor (std::unique_ptr<OutputStream>&, const AudioFormatWriterOptions&) override;
3128

3229
private:
3330
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ALACAudioFormat)

modules/squarepine_audio/codecs/REXAudioFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class REXAudioFormat final : public AudioFormat
7474
/** @internal */
7575
AudioFormatReader* createReaderFor (InputStream*, bool) override;
7676
/** @internal */
77-
AudioFormatWriter* createWriterFor (OutputStream*, double, unsigned int, int, const StringPairArray&, int) override { return nullptr; }
77+
std::unique_ptr<AudioFormatWriter> createWriterFor (std::unique_ptr<OutputStream>&, const AudioFormatWriterOptions&) override { return {}; }
7878

7979
private:
8080
//==============================================================================

0 commit comments

Comments
 (0)