tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_LAMEManager.cpp
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
14#if JUCE_USE_LAME_AUDIO_FORMAT
15
16//==============================================================================
18{
19 #if JUCE_WINDOWS
21 #elif JUCE_MAC
23 #else
24 juce::File defaultLame ("/usr/bin/lame");
25 #endif
26
27 return defaultLame;
28}
29
31{
32 #if JUCE_WINDOWS
34 #elif JUCE_MAC
35 auto defaultFFmpeg = juce::File::getSpecialLocation (juce::File::currentExecutableFile).getSiblingFile ("../Resources/ffmpeg");
36 #else
37 juce::File defaultFFmpeg ("/usr/bin/ffmpeg");
38 #endif
39
40 return defaultFFmpeg;
41}
42
44void LAMEManager::registerAudioFormat (AudioFileFormatManager& affm)
45{
46 if (affm.getLameFormat() == nullptr && LAMEManager::lameIsAvailable())
47 {
48 TRACKTION_LOG ("LAME: using exe: " + LAMEManager::getLameEncoderExe().getFullPathName());
49
50 #if TRACKTION_ENABLE_FFMPEG
53 #else
56
57 #endif
58 }
59}
60
62{
63 #if TRACKTION_ENABLE_FFMPEG
64 auto ffmpeg = getFFmpegExe();
65 return ffmpeg.exists() && ffmpeg.getFileName().containsIgnoreCase ("ffmpeg");
66 #else
67 auto lameEnc = getLameEncoderExe();
68 return lameEnc.exists() && lameEnc.getFileName().containsIgnoreCase ("lame");
69 #endif
70}
71
72//==============================================================================
73#else
74
77bool LAMEManager::lameIsAvailable() { return false; }
78
79#endif
80
81}} // namespace tracktion { inline namespace engine
File getSiblingFile(StringRef siblingFileName) const
static File JUCE_CALLTYPE getSpecialLocation(const SpecialLocationType type)
Keeps a list of available wave formats and can create a format object for a file.
static juce::File getFFmpegExe()
Returns the current FFmpeg file.
static juce::File getLameEncoderExe()
Returns the current LAME file.
static bool lameIsAvailable()
Returns true if a valid LAME/FFmpeg file is found.
static void registerAudioFormat(AudioFileFormatManager &)
Add the LAMEAudioFormat to the AudioFileFormatManager.
T is_pointer_v