Hot Diggity Daffodil!

main
Jay Moore 1 week ago
parent a272f236bc
commit 043d5b166d

@ -1,7 +1,7 @@
project( project(
'mpd', 'mpd-dbcreate',
['c', 'cpp'], ['c', 'cpp'],
version: '0.25', version: '0.1',
meson_version: '>= 1.2', meson_version: '>= 1.2',
default_options: [ default_options: [
'c_std=c11', 'c_std=c11',
@ -237,13 +237,11 @@ add_project_arguments(c_compiler.get_supported_arguments(test_cflags), language:
add_project_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp') add_project_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp')
is_linux = host_machine.system() == 'linux' is_linux = host_machine.system() == 'linux'
is_android = get_option('android_ndk') != '' is_android = false # Android support removed
is_darwin = host_machine.system() == 'darwin' is_darwin = host_machine.system() == 'darwin'
is_windows = host_machine.system() == 'windows' is_windows = host_machine.system() == 'windows'
if is_android # Android support removed
common_cppflags += '-DANDROID'
endif
if is_windows if is_windows
common_cppflags += [ common_cppflags += [
@ -275,13 +273,7 @@ if is_windows
subdir('win32') subdir('win32')
endif endif
if is_android # Android support removed from mpd-dbcreate
# With ndk27 libcpp doesn't seem to have a rune table defined for the
# localization module, tell it to use the one it ships with
common_cppflags += ['-D_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE']
subdir('android')
endif
add_global_arguments(common_global_cppflags, language: 'c') add_global_arguments(common_global_cppflags, language: 'c')
add_global_arguments(common_global_cppflags, language: 'cpp') add_global_arguments(common_global_cppflags, language: 'cpp')
@ -289,8 +281,9 @@ add_global_arguments(common_global_cppflags, language: 'cpp')
add_project_arguments(common_cppflags, language: 'c') add_project_arguments(common_cppflags, language: 'c')
add_project_arguments(common_cppflags, language: 'cpp') add_project_arguments(common_cppflags, language: 'cpp')
enable_daemon = not is_windows and not is_android and get_option('daemon') # mpd-dbcreate is not a daemon - it's a standalone utility
conf.set('ENABLE_DAEMON', enable_daemon) enable_daemon = false
conf.set('ENABLE_DAEMON', false)
conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r')) conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r'))
conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups')) conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups'))
@ -457,19 +450,11 @@ if is_windows
] ]
endif endif
if not is_android # Android support removed - always use non-Android sources
sources += [ sources += [
'src/CommandLine.cxx', 'src/CommandLine.cxx',
'src/unix/SignalHandlers.cxx', 'src/unix/SignalHandlers.cxx',
] ]
else
sources += [
'src/android/Context.cxx',
'src/android/AudioManager.cxx',
'src/android/Environment.cxx',
'src/android/LogListener.cxx',
]
endif
if enable_daemon if enable_daemon
sources += 'src/unix/Daemon.cxx' sources += 'src/unix/Daemon.cxx'
@ -509,7 +494,8 @@ subdir('src/lib/dbus')
subdir('src/lib/smbclient') subdir('src/lib/smbclient')
subdir('src/lib/zlib') subdir('src/lib/zlib')
subdir('src/lib/alsa') # subdir('src/lib/alsa') # Disabled - not needed for database creation
alsa_dep = declare_dependency() # Empty dependency for compatibility
subdir('src/lib/chromaprint') subdir('src/lib/chromaprint')
subdir('src/lib/curl') subdir('src/lib/curl')
subdir('src/lib/expat') subdir('src/lib/expat')
@ -517,13 +503,17 @@ subdir('src/lib/ffmpeg')
subdir('src/lib/gcrypt') subdir('src/lib/gcrypt')
subdir('src/lib/nfs') subdir('src/lib/nfs')
subdir('src/lib/nlohmann_json') subdir('src/lib/nlohmann_json')
subdir('src/lib/oss') # subdir('src/lib/oss') # Disabled - not needed for database creation
enable_oss = false # Disabled for database creation
subdir('src/lib/pcre') subdir('src/lib/pcre')
subdir('src/lib/pipewire') # subdir('src/lib/pipewire') # Disabled - not needed for database creation
subdir('src/lib/pulse') pipewire_dep = declare_dependency() # Empty dependency for compatibility
subdir('src/lib/sndio') # subdir('src/lib/pulse') # Disabled - not needed for database creation
pulse_dep = declare_dependency() # Empty dependency for compatibility
# subdir('src/lib/sndio') # Disabled - not needed for database creation
libsndio_dep = declare_dependency() # Empty dependency for compatibility
subdir('src/lib/sqlite') subdir('src/lib/sqlite')
subdir('src/lib/systemd') subdir('src/lib/systemd') # Provides empty systemd_dep for compatibility
subdir('src/lib/upnp') subdir('src/lib/upnp')
subdir('src/lib/crypto') subdir('src/lib/crypto')
@ -613,27 +603,10 @@ endif
link_args = [] link_args = []
more_deps = [] more_deps = []
if is_android # Android support removed - always use executable type
subdir('src/java')
target_type = 'shared_library'
target_name = 'mpd'
link_args += [
'-Wl,--no-undefined,-shared,-Bsymbolic',
'-llog',
'-lz',
]
more_deps += [
declare_dependency(sources: [bridge_header]),
java_dep,
]
android_abi = get_option('android_abi')
install_dir = meson.current_source_dir() / 'android/app/src/main/jniLibs' / android_abi
else
target_type = 'executable' target_type = 'executable'
target_name = 'mpd' target_name = 'mpd'
install_dir = get_option('bindir') install_dir = get_option('bindir')
endif
if enable_sacdiso if enable_sacdiso
more_deps += [ more_deps += [
@ -647,9 +620,9 @@ if enable_dvdaiso
] ]
endif endif
# MPD build target removed - this project only builds mpd-dbcreate # The mpd-dbcreator utility is a specialized database creator that
# The mpd-dbcreate utility is a specialized database creator that
# uses MPD's codebase but with modified behavior for filtering # uses MPD's codebase but with modified behavior for filtering
# multichannel content. It's just hacked mpd.'
configure_file(output: 'config.h', configuration: conf) configure_file(output: 'config.h', configuration: conf)
@ -668,7 +641,6 @@ db_creator_sources = [
source_index = 0 source_index = 0
foreach src : sources foreach src : sources
if source_index == 0 if source_index == 0
# Skip version_cxx (first element)
source_index += 1 source_index += 1
else else
# For all other elements, only check against Main.cxx # For all other elements, only check against Main.cxx
@ -702,7 +674,7 @@ mpd_dbcreate = executable(
db_glue_dep, db_glue_dep,
storage_glue_dep, storage_glue_dep,
song_dep, song_dep,
systemd_dep, # so log systemd!
sqlite_dep, sqlite_dep,
chromaprint_dep, chromaprint_dep,
neighbor_glue_dep, neighbor_glue_dep,
@ -717,11 +689,9 @@ mpd_dbcreate = executable(
install_dir: get_option('bindir') install_dir: get_option('bindir')
) )
if systemd_dep.found() # dropped systemd like a bad habbit because we quit daemon life
subdir('systemd')
endif
if not is_android # Android deleted because why would you run this on a phone?
install_data( install_data(
'mpd.svg', 'mpd.svg',
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'), install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'),
@ -731,7 +701,6 @@ if not is_android
'AUTHORS', 'COPYING', 'NEWS', 'README.md', 'AUTHORS', 'COPYING', 'NEWS', 'README.md',
install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
) )
endif
subdir('doc') subdir('doc')

@ -7,11 +7,7 @@ option('syslog', type: 'feature', description: 'syslog support')
option('inotify', type: 'boolean', value: true, description: 'inotify support (for automatic database update)') option('inotify', type: 'boolean', value: true, description: 'inotify support (for automatic database update)')
option('io_uring', type: 'feature', description: 'Linux io_uring support using liburing') option('io_uring', type: 'feature', description: 'Linux io_uring support using liburing')
option('daemon', type: 'boolean', value: true, description: 'enable daemonization') # Daemon and systemd options removed - mpd-dbcreate is a standalone utility, not a daemon
option('systemd', type: 'feature', description: 'systemd support')
option('systemd_system_unit_dir', type: 'string', description: 'systemd system service directory')
option('systemd_user_unit_dir', type: 'string', description: 'systemd user service directory')
# #
# Options for developers # Options for developers
@ -21,21 +17,7 @@ option('test', type: 'boolean', value: false, description: 'Build the unit tests
option('fuzzer', type: 'boolean', value: false, description: 'Build fuzzers') option('fuzzer', type: 'boolean', value: false, description: 'Build fuzzers')
option('libfuzzer', type: 'boolean', value: true, description: 'Enable libFuzzer support for the fuzzers') option('libfuzzer', type: 'boolean', value: true, description: 'Enable libFuzzer support for the fuzzers')
# # Android support removed from mpd-dbcreate
# Android
#
option('android_sdk', type: 'string', description: 'The path where Android SDK is installed')
option('android_ndk', type: 'string', description: 'The path where Android NDK is installed')
option('android_abi', type: 'string', value: 'armeabi-v7a', description: 'The Android ABI to be built')
option('android_strip', type: 'string', value: 'strip', description: 'The "strip" tool from the NDK')
option('android_debug_keystore', type: 'string', description: 'The keystore file used to sign debug APK files')
option('android_keystore', type: 'string', description: 'The keystore file used to sign APK files')
option('android_keyalias', type: 'string', description: 'The key alias used to sign APK files')
option('android_keypass', type: 'string', description: 'The password of the keystore used to sign APK files')
# #
# System call support # System call support
@ -163,28 +145,28 @@ option('wave_encoder', type: 'boolean', value: true, description: 'PCM wave enco
# Filter plugins # Filter plugins
# #
option('libsamplerate', type: 'feature', description: 'libsamplerate resampler') option('libsamplerate', type: 'feature', value: 'disabled', description: 'libsamplerate resampler')
option('soxr', type: 'feature', description: 'libsoxr resampler') option('soxr', type: 'feature', value: 'disabled', description: 'libsoxr resampler')
# #
# Output plugins # Output plugins
# #
option('alsa', type: 'feature', description: 'ALSA support') option('alsa', type: 'feature', value: 'disabled', description: 'ALSA support')
option('ao', type: 'feature', description: 'libao output plugin') option('ao', type: 'feature', value: 'disabled', description: 'libao output plugin')
option('fifo', type: 'boolean', value: true, description: 'FIFO output plugin') option('fifo', type: 'boolean', value: false, description: 'FIFO output plugin')
option('httpd', type: 'boolean', value: true, description: 'HTTP streaming output plugin') option('httpd', type: 'boolean', value: false, description: 'HTTP streaming output plugin')
option('jack', type: 'feature', description: 'JACK output plugin') option('jack', type: 'feature', value: 'disabled', description: 'JACK output plugin')
option('openal', type: 'feature', description: 'OpenAL output plugin') option('openal', type: 'feature', value: 'disabled', description: 'OpenAL output plugin')
option('oss', type: 'feature', description: 'Open Sound System support') option('oss', type: 'feature', value: 'disabled', description: 'Open Sound System support')
option('pipe', type: 'boolean', value: true, description: 'Pipe output plugin') option('pipe', type: 'boolean', value: false, description: 'Pipe output plugin')
option('pipewire', type: 'feature', description: 'PipeWire support') option('pipewire', type: 'feature', value: 'disabled', description: 'PipeWire support')
option('pulse', type: 'feature', description: 'PulseAudio support') option('pulse', type: 'feature', value: 'disabled', description: 'PulseAudio support')
option('recorder', type: 'boolean', value: true, description: 'Recorder output plugin') option('recorder', type: 'boolean', value: false, description: 'Recorder output plugin')
option('shout', type: 'feature', description: 'Shoutcast streaming support using libshout') option('shout', type: 'feature', value: 'disabled', description: 'Shoutcast streaming support using libshout')
option('snapcast', type: 'boolean', value: true, description: 'Snapcast output plugin') option('snapcast', type: 'boolean', value: false, description: 'Snapcast output plugin')
option('sndio', type: 'feature', description: 'sndio output plugin') option('sndio', type: 'feature', value: 'disabled', description: 'sndio output plugin')
option('solaris_output', type: 'feature', description: 'Solaris /dev/audio support') option('solaris_output', type: 'feature', value: 'disabled', description: 'Solaris /dev/audio support')
# #
# Misc libraries # Misc libraries

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project // Copyright The Music Player Daemon Project
// Standalone database creation utility // mpd-dbcreate "Hot diggity daffodil!"
// Jay Moore - dewdude@pickmy.org
#include "config.h" #include "config.h"
#include "Instance.hxx" #include "Instance.hxx"
@ -71,7 +72,7 @@ private:
// Show progress every 10 seconds (100 checks) // Show progress every 10 seconds (100 checks)
if (verbose && ++progress_counter >= 100) { if (verbose && ++progress_counter >= 100) {
progress_counter = 0; progress_counter = 0;
std::cout << "." << std::flush; std::cerr << "." << std::flush;
} }
} }
} }
@ -81,6 +82,7 @@ static ChannelMode channel_mode = ChannelMode::ALL;
static std::string music_directory; static std::string music_directory;
static AllocatedPath database_path = nullptr; static AllocatedPath database_path = nullptr;
static bool verbose = false; static bool verbose = false;
static bool update_mode = false;
// Global instance pointer required by other MPD components // Global instance pointer required by other MPD components
// This must be defined here as we're not linking with Main.cxx // This must be defined here as we're not linking with Main.cxx
@ -91,11 +93,12 @@ extern "C" __attribute__((visibility("default"))) ChannelMode GetChannelMode() n
} }
static void PrintUsage() { static void PrintUsage() {
std::cout << "MPD Database Creator\n" std::cout << "mpd-dbcreate | Jay's MPD DB Creator - Hot Diggity Daffodil!\n"
<< "Usage: mpd-dbcreate [options]\n\n" << "Usage: mpd-dbcreate --music-dir /path/to/scan --database /path/to/mpd.db [options]\n\n"
<< "Options:\n" << "Options:\n"
<< " --music-dir <path> Music directory\n" << " --music-dir <path> Music directory\n"
<< " --database <path> Database file\n" << " --database <path> Database file\n"
<< " --update Update existing database (incremental scan)\n"
<< " --stereo Stereo only\n" << " --stereo Stereo only\n"
<< " --multichannel Multichannel only\n" << " --multichannel Multichannel only\n"
<< " --all All (default)\n" << " --all All (default)\n"
@ -109,6 +112,8 @@ static void ParseArgs(int argc, char *argv[]) {
if (arg == "--help") { if (arg == "--help") {
PrintUsage(); PrintUsage();
exit(0); exit(0);
} else if (arg == "--update") {
update_mode = true;
} else if (arg == "--stereo") { } else if (arg == "--stereo") {
channel_mode = ChannelMode::STEREO; channel_mode = ChannelMode::STEREO;
} else if (arg == "--multichannel") { } else if (arg == "--multichannel") {
@ -140,9 +145,10 @@ int main(int argc, char *argv[]) {
// Initialize // Initialize
const ScopeIcuInit icu_init; const ScopeIcuInit icu_init;
log_early_init(verbose); log_early_init(verbose);
// Note: setup_log_output() redirects stderr to /dev/null or log file // Steal logging back from systemd for verbose
// Comment out if you need to see stderr output for debugging if (!verbose) {
setup_log_output(); setup_log_output();
}
// Config // Config
ConfigData config; ConfigData config;
@ -201,18 +207,19 @@ int main(int argc, char *argv[]) {
} }
if (verbose) { if (verbose) {
std::cout << "Music directory: " << music_directory << "\n"; std::cerr << "Music directory: " << music_directory << "\n";
std::cout << "Database path: " << database_path.ToUTF8() << "\n"; std::cerr << "Database path: " << database_path.ToUTF8() << "\n";
std::cout << "Channel Mode: "; std::cerr << "Mode: " << (update_mode ? "UPDATE (incremental)" : "CREATE (full scan)") << "\n";
std::cerr << "Channel Mode: ";
if (channel_mode == ChannelMode::STEREO) { if (channel_mode == ChannelMode::STEREO) {
std::cout << "STEREO (filtering out multichannel)\n"; std::cerr << "STEREO (filtering out multichannel)\n";
} else if (channel_mode == ChannelMode::MULTICHANNEL) { } else if (channel_mode == ChannelMode::MULTICHANNEL) {
std::cout << "MULTICHANNEL (filtering out stereo)\n"; std::cerr << "MULTICHANNEL (filtering out stereo)\n";
} else { } else {
std::cout << "ALL (no filtering)\n"; std::cerr << "ALL (no filtering)\n";
} }
std::cout << "Scanning"; std::cerr << (update_mode ? "Updating" : "Scanning");
std::cout.flush(); std::cerr.flush();
} }
// Create update service // Create update service
@ -222,8 +229,9 @@ int main(int argc, char *argv[]) {
*composite, *composite,
instance); instance);
// Start scan // Start scan - use 'false' for discard parameter when in update mode
instance.update->Enqueue("", true); // to perform incremental update, 'true' for full rescan
instance.update->Enqueue("", !update_mode);
// Create update checker to monitor completion // Create update checker to monitor completion
UpdateChecker checker(instance, verbose); UpdateChecker checker(instance, verbose);
@ -234,7 +242,7 @@ int main(int argc, char *argv[]) {
instance.event_loop.Run(); instance.event_loop.Run();
if (verbose) if (verbose)
std::cout << "\n"; std::cerr << "\n";
// Save // Save
simple_db->Save(); simple_db->Save();
@ -256,7 +264,7 @@ int main(int argc, char *argv[]) {
instance.io_thread.Stop(); instance.io_thread.Stop();
if (verbose) if (verbose)
std::cout << "Done!\n"; std::cerr << "Done!\n";
return 0; return 0;
} catch (const std::exception &e) { } catch (const std::exception &e) {

@ -6,9 +6,10 @@ if uring_dep.found()
input_plugins_sources += 'UringInputPlugin.cxx' input_plugins_sources += 'UringInputPlugin.cxx'
endif endif
if alsa_dep.found() # ALSA input disabled for mpd-dbcreate
input_plugins_sources += 'AlsaInputPlugin.cxx' # if alsa_dep.found()
endif # input_plugins_sources += 'AlsaInputPlugin.cxx'
# endif
libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 10.2+0.93+1', required: get_option('cdio_paranoia')) libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 10.2+0.93+1', required: get_option('cdio_paranoia'))
input_features.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found()) input_features.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found())

@ -1,8 +1,7 @@
uring_features = configuration_data() uring_features = configuration_data()
if host_machine.system() != 'linux' or is_android if host_machine.system() != 'linux'
# io_uring is a Linux-only feature; on Android, we also disable it # io_uring is a Linux-only feature
# because it's forbidden by a seccomp filter
uring_dep = dependency('', required: false) uring_dep = dependency('', required: false)
uring_features.set('HAVE_URING', false) uring_features.set('HAVE_URING', false)
configure_file(output: 'Features.h', configuration: uring_features) configure_file(output: 'Features.h', configuration: uring_features)

@ -1,23 +1,4 @@
if not is_linux or is_android # Provide empty systemd_dep for build compatibility
# mpd-dbcreate doesn't need systemd as it's not a daemon
systemd_dep = dependency('', required: false) systemd_dep = dependency('', required: false)
subdir_done() conf.set('ENABLE_SYSTEMD_DAEMON', false)
endif
systemd_dep = dependency('libsystemd', required: get_option('systemd'))
conf.set('ENABLE_SYSTEMD_DAEMON', systemd_dep.found())
if not systemd_dep.found()
subdir_done()
endif
systemd = static_library(
'systemd',
'Watchdog.cxx',
include_directories: inc,
dependencies: [
systemd_dep,
],
)
systemd_dep = declare_dependency(
link_with: systemd,
)

@ -37,9 +37,7 @@ if is_windows
] ]
endif endif
if is_android # Android support removed
mixer_plugins_sources += 'AndroidMixerPlugin.cxx'
endif
mixer_plugins = static_library( mixer_plugins = static_library(
'mixer_plugins', 'mixer_plugins',

@ -5,91 +5,13 @@
#include "Registry.hxx" #include "Registry.hxx"
#include "OutputPlugin.hxx" #include "OutputPlugin.hxx"
#include "output/Features.h" #include "output/Features.h"
#include "plugins/AlsaOutputPlugin.hxx"
#include "plugins/AoOutputPlugin.hxx"
#include "plugins/FifoOutputPlugin.hxx"
#include "plugins/SndioOutputPlugin.hxx"
#include "plugins/snapcast/SnapcastOutputPlugin.hxx"
#include "plugins/httpd/HttpdOutputPlugin.hxx"
#include "plugins/JackOutputPlugin.hxx"
#include "plugins/NullOutputPlugin.hxx" #include "plugins/NullOutputPlugin.hxx"
#include "plugins/OpenALOutputPlugin.hxx"
#include "plugins/OssOutputPlugin.hxx"
#include "plugins/OSXOutputPlugin.hxx"
#include "plugins/PipeOutputPlugin.hxx"
#include "plugins/PipeWireOutputPlugin.hxx"
#include "plugins/PulseOutputPlugin.hxx"
#include "plugins/RecorderOutputPlugin.hxx"
#include "plugins/ShoutOutputPlugin.hxx"
#include "plugins/sles/SlesOutputPlugin.hxx"
#include "plugins/SolarisOutputPlugin.hxx"
#ifdef ENABLE_WINMM_OUTPUT
#include "plugins/WinmmOutputPlugin.hxx"
#endif
#ifdef ENABLE_WASAPI_OUTPUT
#include "plugins/wasapi/WasapiOutputPlugin.hxx"
#endif
#include "util/StringAPI.hxx" #include "util/StringAPI.hxx"
// Only include the NullOutputPlugin for mpd-dbcreate
// since we don't need actual audio output for database creation
constinit const AudioOutputPlugin *const audio_output_plugins[] = { constinit const AudioOutputPlugin *const audio_output_plugins[] = {
#ifdef HAVE_SHOUT
&shout_output_plugin,
#endif
&null_output_plugin, &null_output_plugin,
#ifdef ANDROID
&sles_output_plugin,
#endif
#ifdef HAVE_FIFO
&fifo_output_plugin,
#endif
#ifdef ENABLE_SNDIO
&sndio_output_plugin,
#endif
#ifdef ENABLE_PIPE_OUTPUT
&pipe_output_plugin,
#endif
#ifdef ENABLE_ALSA
&alsa_output_plugin,
#endif
#ifdef ENABLE_AO
&ao_output_plugin,
#endif
#ifdef HAVE_OSS
&oss_output_plugin,
#endif
#ifdef HAVE_OPENAL
&openal_output_plugin,
#endif
#ifdef HAVE_OSX
&osx_output_plugin,
#endif
#ifdef ENABLE_SOLARIS_OUTPUT
&solaris_output_plugin,
#endif
#ifdef ENABLE_PIPEWIRE
&pipewire_output_plugin,
#endif
#ifdef ENABLE_PULSE
&pulse_output_plugin,
#endif
#ifdef ENABLE_JACK
&jack_output_plugin,
#endif
#ifdef ENABLE_HTTPD_OUTPUT
&httpd_output_plugin,
#endif
#ifdef ENABLE_SNAPCAST_OUTPUT
&snapcast_output_plugin,
#endif
#ifdef ENABLE_RECORDER_OUTPUT
&recorder_output_plugin,
#endif
#ifdef ENABLE_WINMM_OUTPUT
&winmm_output_plugin,
#endif
#ifdef ENABLE_WASAPI_OUTPUT
&wasapi_output_plugin,
#endif
nullptr nullptr
}; };

@ -12,173 +12,36 @@ output_plugins_deps = [
need_encoder = false need_encoder = false
need_wave_encoder = false need_wave_encoder = false
if alsa_dep.found() # All output plugins disabled for mpd-dbcreate - only NullOutputPlugin needed
output_plugins_sources += 'AlsaOutputPlugin.cxx' # Set all feature flags to false
output_plugins_deps += event_dep output_features.set('ENABLE_AO', false)
endif output_features.set('HAVE_FIFO', false)
output_features.set('ENABLE_HTTPD_OUTPUT', false)
libao_dep = dependency('ao', required: get_option('ao')) output_features.set('ENABLE_JACK', false)
output_features.set('ENABLE_AO', libao_dep.found()) output_features.set('HAVE_OPENAL', false)
if libao_dep.found() output_features.set('HAVE_OSX', false)
output_plugins_sources += 'AoOutputPlugin.cxx' output_features.set('ENABLE_PIPE_OUTPUT', false)
endif output_features.set('ENABLE_RECORDER_OUTPUT', false)
output_features.set('HAVE_SHOUT', false)
enable_fifo_output = get_option('fifo') and not is_windows output_features.set('ENABLE_SNAPCAST_OUTPUT', false)
output_features.set('HAVE_FIFO', enable_fifo_output) output_features.set('ENABLE_SOLARIS_OUTPUT', false)
if enable_fifo_output output_features.set('ENABLE_WINMM_OUTPUT', false)
output_plugins_sources += 'FifoOutputPlugin.cxx' output_features.set('ENABLE_WASAPI_OUTPUT', false)
endif
# Define empty dependencies to avoid build errors
output_features.set('ENABLE_HTTPD_OUTPUT', get_option('httpd')) libao_dep = dependency('', required: false)
if get_option('httpd') libjack_dep = dependency('', required: false)
output_plugins_sources += [
'httpd/IcyMetaDataServer.cxx',
'httpd/HttpdClient.cxx',
'httpd/HttpdOutputPlugin.cxx',
]
output_plugins_deps += [ event_dep, net_dep ]
need_encoder = true
endif
libjack_dep = dependency('jack', version: '>= 0.100', required: get_option('jack'))
output_features.set('ENABLE_JACK', libjack_dep.found())
if libjack_dep.found()
output_plugins_sources += 'JackOutputPlugin.cxx'
output_features.set('HAVE_JACK_SET_INFO_FUNCTION', compiler.has_header_symbol('jack/jack.h', 'jack_set_info_function'))
endif
openal_dep = dependency('', required: false) openal_dep = dependency('', required: false)
if not get_option('openal').disabled() libshout_dep = dependency('', required: false)
if is_darwin
if compiler.has_header('OpenAL/al.h')
openal_dep = declare_dependency(link_args: ['-framework', 'OpenAL'])
endif
else
openal_dep = dependency('openal', required: false)
endif
if openal_dep.found()
output_plugins_sources += 'OpenALOutputPlugin.cxx'
elif get_option('openal').enabled()
error('OpenAL not available')
endif
endif
output_features.set('HAVE_OPENAL', openal_dep.found())
if enable_oss
output_plugins_sources += 'OssOutputPlugin.cxx'
endif
if is_darwin
output_plugins_sources += [
'OSXOutputPlugin.cxx',
]
endif
output_features.set('HAVE_OSX', is_darwin)
enable_pipe_output = get_option('pipe') and not is_windows
output_features.set('ENABLE_PIPE_OUTPUT', enable_pipe_output)
if enable_pipe_output
output_plugins_sources += 'PipeOutputPlugin.cxx'
endif
if pipewire_dep.found()
output_plugins_sources += 'PipeWireOutputPlugin.cxx'
endif
if pulse_dep.found()
output_plugins_sources += 'PulseOutputPlugin.cxx'
endif
output_features.set('ENABLE_RECORDER_OUTPUT', get_option('recorder'))
if get_option('recorder')
output_plugins_sources += 'RecorderOutputPlugin.cxx'
need_encoder = true
endif
libshout_dep = dependency('shout', version: '>= 2.4.0', required: get_option('shout'))
output_features.set('HAVE_SHOUT', libshout_dep.found())
if libshout_dep.found()
output_plugins_sources += 'ShoutOutputPlugin.cxx'
need_encoder = true
endif
if is_android
sles_dep = c_compiler.find_library('OpenSLES')
output_plugins_sources += 'sles/SlesOutputPlugin.cxx'
else
sles_dep = dependency('', required: false) sles_dep = dependency('', required: false)
endif
if libsndio_dep.found()
output_plugins_sources += 'SndioOutputPlugin.cxx'
endif
output_features.set('ENABLE_SNAPCAST_OUTPUT', get_option('snapcast'))
if get_option('snapcast')
output_plugins_sources += [
'snapcast/SnapcastOutputPlugin.cxx',
'snapcast/Client.cxx',
]
output_plugins_deps += [ event_dep, net_dep, nlohmann_json_dep, zeroconf_dep ]
output_features.set('HAVE_NLOHMANN_JSON', nlohmann_json_dep.found())
need_wave_encoder = true
endif
enable_solaris_output = get_option('solaris_output')
if enable_solaris_output.auto()
enable_solaris_output = host_machine.system() == 'sunos' or host_machine.system() == 'solaris'
else
enable_solaris_output = enable_solaris_output.enabled()
endif
output_features.set('ENABLE_SOLARIS_OUTPUT', enable_solaris_output)
if enable_solaris_output
output_plugins_sources += 'SolarisOutputPlugin.cxx'
endif
output_features.set('ENABLE_WINMM_OUTPUT', is_windows)
if is_windows
output_plugins_sources += 'WinmmOutputPlugin.cxx'
winmm_dep = c_compiler.find_library('winmm')
else
winmm_dep = dependency('', required: false) winmm_dep = dependency('', required: false)
endif
output_features.set('ENABLE_WASAPI_OUTPUT', is_windows)
if is_windows
output_plugins_sources += [
'wasapi/WasapiOutputPlugin.cxx',
]
wasapi_dep = [
c_compiler.find_library('ksuser', required: true),
c_compiler.find_library('ole32', required: true),
win32_dep,
]
else
wasapi_dep = dependency('', required: false) wasapi_dep = dependency('', required: false)
endif
output_plugins = static_library( output_plugins = static_library(
'output_plugins', 'output_plugins',
output_plugins_sources, output_plugins_sources,
include_directories: inc, include_directories: inc,
dependencies: [ dependencies: output_plugins_deps,
alsa_dep,
apple_dep,
libao_dep,
libjack_dep,
pipewire_dep,
pulse_dep,
libshout_dep,
libsndio_dep,
openal_dep,
sles_dep,
winmm_dep,
wasapi_dep,
output_plugins_deps,
],
) )
output_plugins_dep = declare_dependency( output_plugins_dep = declare_dependency(

@ -25,6 +25,12 @@ CreateConfiguredStorageUri(EventLoop &event_loop, const char *uri)
static AllocatedPath static AllocatedPath
GetConfiguredMusicDirectory(const ConfigData &config) GetConfiguredMusicDirectory(const ConfigData &config)
{ {
// Don't try to parse URIs as filesystem paths
auto uri = config.GetString(ConfigOption::MUSIC_DIR);
if (uri != nullptr && uri_has_scheme(uri))
// This is a URI, not a local path
return nullptr;
AllocatedPath path = config.GetPath(ConfigOption::MUSIC_DIR); AllocatedPath path = config.GetPath(ConfigOption::MUSIC_DIR);
if (path.IsNull()) if (path.IsNull())
path = GetUserMusicDir(); path = GetUserMusicDir();
@ -47,6 +53,7 @@ CreateConfiguredStorageLocal(const ConfigData &config)
std::unique_ptr<Storage> std::unique_ptr<Storage>
CreateConfiguredStorage(const ConfigData &config, EventLoop &event_loop) CreateConfiguredStorage(const ConfigData &config, EventLoop &event_loop)
{ {
// Check if it's a URI first before trying to parse as a path
auto uri = config.GetString(ConfigOption::MUSIC_DIR); auto uri = config.GetString(ConfigOption::MUSIC_DIR);
if (uri != nullptr && uri_has_scheme(uri)) if (uri != nullptr && uri_has_scheme(uri))
return CreateConfiguredStorageUri(event_loop, uri); return CreateConfiguredStorageUri(event_loop, uri);

@ -5,7 +5,7 @@ avahi_dep = dependency('', required: false)
if zeroconf_option == 'auto' if zeroconf_option == 'auto'
if is_darwin if is_darwin
zeroconf_option = 'bonjour' zeroconf_option = 'bonjour'
elif is_android or is_windows elif is_windows
zeroconf_option = 'disabled' zeroconf_option = 'disabled'
elif dbus_dep.found() elif dbus_dep.found()
zeroconf_option = 'avahi' zeroconf_option = 'avahi'

Loading…
Cancel
Save