Skip to content

Commit 2f33e1e

Browse files
committed
Added flac and fixed more stuff
1 parent b9abd5d commit 2f33e1e

File tree

20 files changed

+1085
-21
lines changed

20 files changed

+1085
-21
lines changed

cmake/yup_modules.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ macro (yup_add_default_modules modules_path)
835835
yup_add_module (${modules_path}/thirdparty/pffft_library "${modules_definitions}" ${thirdparty_group})
836836
yup_add_module (${modules_path}/thirdparty/dr_libs "${modules_definitions}" ${thirdparty_group})
837837
yup_add_module (${modules_path}/thirdparty/opus_library "${modules_definitions}" ${thirdparty_group})
838+
yup_add_module (${modules_path}/thirdparty/flac_library "${modules_definitions}" ${thirdparty_group})
838839

839840
# ==== Yup modules
840841
set (modules_group "Modules")

examples/graphics/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ yup_standalone_app (
7575
yup::yup_audio_formats
7676
pffft_library
7777
opus_library
78+
flac_library
7879
dr_libs
7980
libpng
8081
libwebp
577 KB
Binary file not shown.

examples/graphics/source/examples/ConvolutionDemo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ class ConvolutionDemo
214214
.getParentDirectory()
215215
.getChildFile ("data");
216216

217-
yup::File audioFile = dataDir.getChildFile ("break_boomblastic_92bpm.wav");
217+
yup::File audioFile = dataDir.getChildFile ("break_boomblastic_92bpm.flac");
218218
if (! audioFile.existsAsFile())
219219
{
220-
std::cerr << "Could not find break_boomblastic_92bpm.wav" << std::endl;
220+
std::cerr << "Could not find break_boomblastic_92bpm.flac" << std::endl;
221221
return;
222222
}
223223

examples/graphics/source/examples/CrossoverDemo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ class CrossoverDemo : public yup::Component
239239
.getParentDirectory()
240240
.getChildFile ("data");
241241

242-
yup::File audioFile = dataDir.getChildFile ("break_boomblastic_92bpm.opus");
242+
yup::File audioFile = dataDir.getChildFile ("break_boomblastic_92bpm.mp3");
243243
if (! audioFile.existsAsFile())
244244
{
245-
std::cerr << "Could not find break_boomblastic_92bpm.wav" << std::endl;
245+
std::cerr << "Could not find break_boomblastic_92bpm.mp3" << std::endl;
246246
return;
247247
}
248248

modules/yup_audio_formats/common/yup_AudioFormatManager.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,25 @@ AudioFormatManager::AudioFormatManager()
2929
void AudioFormatManager::registerDefaultFormats()
3030
{
3131
// Register Wave format
32+
#if YUP_AUDIO_FORMAT_WAVE
3233
registerFormat (std::make_unique<WaveAudioFormat>());
34+
#endif
35+
36+
#if YUP_AUDIO_FORMAT_MP3
37+
registerFormat (std::make_unique<Mp3AudioFormat>());
38+
#endif
3339

34-
#if YUP_MODULE_AVAILABLE_opus_library && YUP_AUDIO_FORMAT_OPUS
40+
#if YUP_AUDIO_FORMAT_OPUS
3541
registerFormat (std::make_unique<OpusAudioFormat>());
3642
#endif
3743

44+
#if YUP_AUDIO_FORMAT_FLAC
45+
registerFormat (std::make_unique<FlacAudioFormat>());
46+
#endif
47+
3848
// TODO: Add other formats like:
3949
// registerFormat (std::make_unique<AiffAudioFormat>());
40-
// registerFormat (std::make_unique<FlacAudioFormat>());
4150
// registerFormat (std::make_unique<OggVorbisAudioFormat>());
42-
// registerFormat (std::make_unique<MP3AudioFormat>());
4351
}
4452

4553
void AudioFormatManager::registerFormat (std::unique_ptr<AudioFormat> format)

0 commit comments

Comments
 (0)