├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md ├── dependabot.yml └── workflows │ ├── build.yml │ └── build_android.yml ├── .gitignore ├── .readthedocs.yaml ├── AUTHORS ├── COPYING ├── LICENSES ├── BSD-2-Clause.txt ├── GPL-2.0-or-later.txt ├── ISC.txt └── LGPL-2.1-only.txt ├── NEWS ├── README.md ├── android ├── .gitignore ├── PrivacyPolicy.rst ├── README.md ├── app │ ├── .gitignore │ ├── build.gradle.kts │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── aidl │ │ └── org │ │ │ └── musicpd │ │ │ ├── IMain.aidl │ │ │ └── IMainCallback.aidl │ │ ├── ic_launcher-playstore.png │ │ ├── java │ │ └── org │ │ │ └── musicpd │ │ │ ├── AutomationReceiver.kt │ │ │ ├── Bridge.java │ │ │ ├── Loader.kt │ │ │ ├── MPDApplication.kt │ │ │ ├── MPDPlayer.java │ │ │ ├── Main.kt │ │ │ ├── MainActivity.kt │ │ │ ├── MainServiceClient.java │ │ │ ├── NetworkUtil.java │ │ │ ├── Preferences.java │ │ │ ├── Receiver.java │ │ │ ├── data │ │ │ └── LoggingRepository.kt │ │ │ ├── ui │ │ │ ├── LogScreen.kt │ │ │ ├── MainScreen.kt │ │ │ ├── NetworkAddress.kt │ │ │ ├── SettingsScreen.kt │ │ │ ├── SettingsViewModel.kt │ │ │ └── StatusScreen.kt │ │ │ └── utils │ │ │ └── IntentUtils.kt │ │ ├── jnilibs │ │ └── .keepme │ │ └── res │ │ ├── drawable │ │ ├── baseline_wifi_24.xml │ │ ├── ic_banner_foreground.xml │ │ ├── ic_launcher_foreground.xml │ │ └── notification_icon.png │ │ ├── layout │ │ └── custom_notification_gb.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_banner.xml │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_banner.png │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_banner.png │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_banner.png │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_banner.png │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_banner.png │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ └── values │ │ ├── ic_banner_background.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml ├── build.gradle.kts ├── build.py ├── custom_rules.xml ├── gdb.sh ├── gradle.properties ├── gradle │ ├── libs.versions.toml │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── include │ └── meson.build ├── meson.build └── settings.gradle.kts ├── build └── pkg-config.sh ├── doc ├── _static │ └── css │ │ └── custom.css ├── client.rst ├── conf.py ├── developer.rst ├── doxygen.conf.in ├── index.rst ├── meson.build ├── mpd.1.rst ├── mpd.conf.5.rst ├── mpdconf.example ├── plugins.rst ├── protocol.rst ├── requirements.txt └── user.rst ├── meson.build ├── meson_options.txt ├── mpd.svg ├── python └── build │ ├── __init__.py │ ├── autotools.py │ ├── cmake.py │ ├── dirs.py │ ├── download.py │ ├── ffmpeg.py │ ├── libs.py │ ├── makeproject.py │ ├── meson.py │ ├── project.py │ ├── quilt.py │ ├── tar.py │ ├── toolchain.py │ ├── verify.py │ └── zlib.py ├── src ├── BulkEdit.hxx ├── Chrono.hxx ├── CommandLine.cxx ├── CommandLine.hxx ├── ConsumeMode.cxx ├── ConsumeMode.hxx ├── GitVersion.cxx ├── GitVersion.hxx ├── Idle.cxx ├── Idle.hxx ├── Instance.cxx ├── Instance.hxx ├── Listen.cxx ├── Listen.hxx ├── LocateUri.cxx ├── LocateUri.hxx ├── Log.cxx ├── Log.hxx ├── LogBackend.cxx ├── LogBackend.hxx ├── LogInit.cxx ├── LogInit.hxx ├── LogLevel.hxx ├── Main.cxx ├── Main.hxx ├── Mapper.cxx ├── Mapper.hxx ├── MusicBuffer.cxx ├── MusicBuffer.hxx ├── MusicChunk.cxx ├── MusicChunk.hxx ├── MusicChunkPtr.cxx ├── MusicChunkPtr.hxx ├── MusicPipe.cxx ├── MusicPipe.hxx ├── Partition.cxx ├── Partition.hxx ├── Permission.cxx ├── Permission.hxx ├── PlaylistDatabase.cxx ├── PlaylistDatabase.hxx ├── PlaylistError.cxx ├── PlaylistError.hxx ├── PlaylistFile.cxx ├── PlaylistFile.hxx ├── PlaylistPrint.cxx ├── PlaylistPrint.hxx ├── PlaylistSave.cxx ├── PlaylistSave.hxx ├── PluginUnavailable.hxx ├── RemoteTagCache.cxx ├── RemoteTagCache.hxx ├── RemoteTagCacheHandler.hxx ├── ReplayGainMode.cxx ├── ReplayGainMode.hxx ├── SingleMode.cxx ├── SingleMode.hxx ├── SongLoader.cxx ├── SongLoader.hxx ├── SongPrint.cxx ├── SongPrint.hxx ├── SongSave.cxx ├── SongSave.hxx ├── SongUpdate.cxx ├── StateFile.cxx ├── StateFile.hxx ├── StateFileConfig.cxx ├── StateFileConfig.hxx ├── Stats.cxx ├── Stats.hxx ├── TagAny.cxx ├── TagAny.hxx ├── TagArchive.cxx ├── TagArchive.hxx ├── TagFile.cxx ├── TagFile.hxx ├── TagPrint.cxx ├── TagPrint.hxx ├── TagSave.cxx ├── TagSave.hxx ├── TagStream.cxx ├── TagStream.hxx ├── TimePrint.cxx ├── TimePrint.hxx ├── android │ ├── AudioManager.cxx │ ├── AudioManager.hxx │ ├── Context.cxx │ ├── Context.hxx │ ├── Environment.cxx │ ├── Environment.hxx │ ├── LogListener.cxx │ └── LogListener.hxx ├── apple │ ├── AudioObject.cxx │ ├── AudioObject.hxx │ ├── AudioUnit.hxx │ ├── ErrorRef.hxx │ ├── StringRef.hxx │ ├── Throw.cxx │ ├── Throw.hxx │ └── meson.build ├── archive │ ├── ArchiveFile.hxx │ ├── ArchiveList.cxx │ ├── ArchiveList.hxx │ ├── ArchivePlugin.cxx │ ├── ArchivePlugin.hxx │ ├── ArchiveVisitor.hxx │ ├── meson.build │ └── plugins │ │ ├── Bzip2ArchivePlugin.cxx │ │ ├── Bzip2ArchivePlugin.hxx │ │ ├── Iso9660ArchivePlugin.cxx │ │ ├── Iso9660ArchivePlugin.hxx │ │ ├── ZzipArchivePlugin.cxx │ │ ├── ZzipArchivePlugin.hxx │ │ └── meson.build ├── client │ ├── BackgroundCommand.hxx │ ├── Client.cxx │ ├── Client.hxx │ ├── Config.cxx │ ├── Config.hxx │ ├── Domain.cxx │ ├── Domain.hxx │ ├── Event.cxx │ ├── Expire.cxx │ ├── File.cxx │ ├── IClient.hxx │ ├── Idle.cxx │ ├── List.cxx │ ├── List.hxx │ ├── Listener.cxx │ ├── Listener.hxx │ ├── Message.cxx │ ├── Message.hxx │ ├── New.cxx │ ├── Process.cxx │ ├── ProtocolFeature.cxx │ ├── ProtocolFeature.hxx │ ├── Read.cxx │ ├── Response.cxx │ ├── Response.hxx │ ├── Subscribe.cxx │ ├── ThreadBackgroundCommand.cxx │ ├── ThreadBackgroundCommand.hxx │ └── Write.cxx ├── cmdline │ ├── OptionDef.hxx │ ├── OptionParser.cxx │ ├── OptionParser.hxx │ └── meson.build ├── command │ ├── AllCommands.cxx │ ├── AllCommands.hxx │ ├── ClientCommands.cxx │ ├── ClientCommands.hxx │ ├── CommandError.cxx │ ├── CommandError.hxx │ ├── CommandListBuilder.cxx │ ├── CommandListBuilder.hxx │ ├── CommandResult.hxx │ ├── DatabaseCommands.cxx │ ├── DatabaseCommands.hxx │ ├── FileCommands.cxx │ ├── FileCommands.hxx │ ├── FingerprintCommands.cxx │ ├── FingerprintCommands.hxx │ ├── MessageCommands.cxx │ ├── MessageCommands.hxx │ ├── NeighborCommands.cxx │ ├── NeighborCommands.hxx │ ├── OtherCommands.cxx │ ├── OtherCommands.hxx │ ├── OutputCommands.cxx │ ├── OutputCommands.hxx │ ├── PartitionCommands.cxx │ ├── PartitionCommands.hxx │ ├── PlayerCommands.cxx │ ├── PlayerCommands.hxx │ ├── PlaylistCommands.cxx │ ├── PlaylistCommands.hxx │ ├── PositionArg.cxx │ ├── PositionArg.hxx │ ├── QueueCommands.cxx │ ├── QueueCommands.hxx │ ├── Request.hxx │ ├── StickerCommands.cxx │ ├── StickerCommands.hxx │ ├── StorageCommands.cxx │ ├── StorageCommands.hxx │ ├── TagCommands.cxx │ └── TagCommands.hxx ├── config │ ├── Block.cxx │ ├── Block.hxx │ ├── Check.cxx │ ├── Check.hxx │ ├── Data.cxx │ ├── Data.hxx │ ├── Defaults.hxx │ ├── Domain.cxx │ ├── Domain.hxx │ ├── File.cxx │ ├── File.hxx │ ├── Migrate.cxx │ ├── Migrate.hxx │ ├── Net.cxx │ ├── Net.hxx │ ├── Option.hxx │ ├── Param.cxx │ ├── Param.hxx │ ├── Parser.cxx │ ├── Parser.hxx │ ├── PartitionConfig.cxx │ ├── PartitionConfig.hxx │ ├── Path.cxx │ ├── Path.hxx │ ├── PlayerConfig.cxx │ ├── PlayerConfig.hxx │ ├── QueueConfig.hxx │ ├── ReplayGainConfig.cxx │ ├── ReplayGainConfig.hxx │ ├── Templates.cxx │ ├── Templates.hxx │ └── meson.build ├── db │ ├── Configured.cxx │ ├── Configured.hxx │ ├── Count.cxx │ ├── Count.hxx │ ├── DatabaseError.hxx │ ├── DatabaseGlue.cxx │ ├── DatabaseGlue.hxx │ ├── DatabaseListener.hxx │ ├── DatabaseLock.cxx │ ├── DatabaseLock.hxx │ ├── DatabasePlaylist.cxx │ ├── DatabasePlaylist.hxx │ ├── DatabasePlugin.hxx │ ├── DatabasePrint.cxx │ ├── DatabasePrint.hxx │ ├── DatabaseQueue.cxx │ ├── DatabaseQueue.hxx │ ├── DatabaseSong.cxx │ ├── DatabaseSong.hxx │ ├── Helpers.cxx │ ├── Helpers.hxx │ ├── Interface.hxx │ ├── LightDirectory.hxx │ ├── PlaylistInfo.hxx │ ├── PlaylistVector.cxx │ ├── PlaylistVector.hxx │ ├── Ptr.hxx │ ├── Registry.cxx │ ├── Registry.hxx │ ├── Selection.cxx │ ├── Selection.hxx │ ├── Stats.hxx │ ├── UniqueTags.cxx │ ├── UniqueTags.hxx │ ├── Uri.hxx │ ├── VHelper.cxx │ ├── VHelper.hxx │ ├── Visitor.hxx │ ├── meson.build │ ├── plugins │ │ ├── ProxyDatabasePlugin.cxx │ │ ├── ProxyDatabasePlugin.hxx │ │ ├── meson.build │ │ ├── simple │ │ │ ├── DatabaseSave.cxx │ │ │ ├── DatabaseSave.hxx │ │ │ ├── Directory.cxx │ │ │ ├── Directory.hxx │ │ │ ├── DirectorySave.cxx │ │ │ ├── DirectorySave.hxx │ │ │ ├── ExportedSong.hxx │ │ │ ├── Mount.cxx │ │ │ ├── Mount.hxx │ │ │ ├── PrefixedLightSong.hxx │ │ │ ├── Ptr.hxx │ │ │ ├── SimpleDatabasePlugin.cxx │ │ │ ├── SimpleDatabasePlugin.hxx │ │ │ ├── Song.cxx │ │ │ ├── Song.hxx │ │ │ ├── SongSort.cxx │ │ │ └── SongSort.hxx │ │ └── upnp │ │ │ ├── ContentDirectoryService.cxx │ │ │ ├── Directory.cxx │ │ │ ├── Directory.hxx │ │ │ ├── Object.cxx │ │ │ ├── Object.hxx │ │ │ ├── Tags.cxx │ │ │ ├── Tags.hxx │ │ │ ├── UpnpDatabasePlugin.cxx │ │ │ └── UpnpDatabasePlugin.hxx │ └── update │ │ ├── Archive.cxx │ │ ├── Config.cxx │ │ ├── Config.hxx │ │ ├── Container.cxx │ │ ├── Editor.cxx │ │ ├── Editor.hxx │ │ ├── ExcludeList.cxx │ │ ├── ExcludeList.hxx │ │ ├── InotifyDomain.cxx │ │ ├── InotifyDomain.hxx │ │ ├── InotifyQueue.cxx │ │ ├── InotifyQueue.hxx │ │ ├── InotifyUpdate.cxx │ │ ├── InotifyUpdate.hxx │ │ ├── Playlist.cxx │ │ ├── Queue.cxx │ │ ├── Queue.hxx │ │ ├── Remove.cxx │ │ ├── Remove.hxx │ │ ├── Service.cxx │ │ ├── Service.hxx │ │ ├── SpecialDirectory.cxx │ │ ├── UpdateDomain.cxx │ │ ├── UpdateDomain.hxx │ │ ├── UpdateIO.cxx │ │ ├── UpdateIO.hxx │ │ ├── UpdateSong.cxx │ │ ├── VirtualDirectory.cxx │ │ ├── Walk.cxx │ │ └── Walk.hxx ├── decoder │ ├── Bridge.cxx │ ├── Bridge.hxx │ ├── Client.hxx │ ├── Command.hxx │ ├── Control.cxx │ ├── Control.hxx │ ├── DecoderAPI.cxx │ ├── DecoderAPI.hxx │ ├── DecoderBuffer.cxx │ ├── DecoderBuffer.hxx │ ├── DecoderList.cxx │ ├── DecoderList.hxx │ ├── DecoderPlugin.cxx │ ├── DecoderPlugin.hxx │ ├── DecoderPrint.cxx │ ├── DecoderPrint.hxx │ ├── Domain.cxx │ ├── Domain.hxx │ ├── Reader.cxx │ ├── Reader.hxx │ ├── Thread.cxx │ ├── meson.build │ └── plugins │ │ ├── AdPlugDecoderPlugin.cxx │ │ ├── AdPlugDecoderPlugin.h │ │ ├── AudiofileDecoderPlugin.cxx │ │ ├── AudiofileDecoderPlugin.hxx │ │ ├── DsdLib.cxx │ │ ├── DsdLib.hxx │ │ ├── DsdiffDecoderPlugin.cxx │ │ ├── DsdiffDecoderPlugin.hxx │ │ ├── DsfDecoderPlugin.cxx │ │ ├── DsfDecoderPlugin.hxx │ │ ├── FaadDecoderPlugin.cxx │ │ ├── FaadDecoderPlugin.hxx │ │ ├── FfmpegDecoderPlugin.cxx │ │ ├── FfmpegDecoderPlugin.hxx │ │ ├── FfmpegIo.cxx │ │ ├── FfmpegIo.hxx │ │ ├── FfmpegMetaData.cxx │ │ ├── FfmpegMetaData.hxx │ │ ├── FlacCommon.cxx │ │ ├── FlacCommon.hxx │ │ ├── FlacDecoderPlugin.cxx │ │ ├── FlacDecoderPlugin.h │ │ ├── FlacDomain.cxx │ │ ├── FlacDomain.hxx │ │ ├── FlacInput.cxx │ │ ├── FlacInput.hxx │ │ ├── FlacPcm.cxx │ │ ├── FlacPcm.hxx │ │ ├── FlacStreamDecoder.hxx │ │ ├── FluidsynthDecoderPlugin.cxx │ │ ├── FluidsynthDecoderPlugin.hxx │ │ ├── GmeDecoderPlugin.cxx │ │ ├── GmeDecoderPlugin.hxx │ │ ├── MadDecoderPlugin.cxx │ │ ├── MadDecoderPlugin.hxx │ │ ├── MikmodDecoderPlugin.cxx │ │ ├── MikmodDecoderPlugin.hxx │ │ ├── ModCommon.cxx │ │ ├── ModCommon.hxx │ │ ├── ModplugDecoderPlugin.cxx │ │ ├── ModplugDecoderPlugin.hxx │ │ ├── MpcdecDecoderPlugin.cxx │ │ ├── MpcdecDecoderPlugin.hxx │ │ ├── Mpg123DecoderPlugin.cxx │ │ ├── Mpg123DecoderPlugin.hxx │ │ ├── OggCodec.cxx │ │ ├── OggCodec.hxx │ │ ├── OggDecoder.cxx │ │ ├── OggDecoder.hxx │ │ ├── OpenmptDecoderPlugin.cxx │ │ ├── OpenmptDecoderPlugin.hxx │ │ ├── OpusDecoderPlugin.cxx │ │ ├── OpusDecoderPlugin.h │ │ ├── OpusDomain.cxx │ │ ├── OpusDomain.hxx │ │ ├── OpusHead.cxx │ │ ├── OpusHead.hxx │ │ ├── OpusReader.hxx │ │ ├── OpusTags.cxx │ │ ├── OpusTags.hxx │ │ ├── PcmDecoderPlugin.cxx │ │ ├── PcmDecoderPlugin.hxx │ │ ├── SidplayDecoderPlugin.cxx │ │ ├── SidplayDecoderPlugin.hxx │ │ ├── SndfileDecoderPlugin.cxx │ │ ├── SndfileDecoderPlugin.hxx │ │ ├── VgmstreamDecoderPlugin.cxx │ │ ├── VgmstreamDecoderPlugin.hxx │ │ ├── VorbisDecoderPlugin.cxx │ │ ├── VorbisDecoderPlugin.h │ │ ├── VorbisDomain.cxx │ │ ├── VorbisDomain.hxx │ │ ├── WavpackDecoderPlugin.cxx │ │ ├── WavpackDecoderPlugin.hxx │ │ ├── WildmidiDecoderPlugin.cxx │ │ ├── WildmidiDecoderPlugin.hxx │ │ └── meson.build ├── encoder │ ├── Configured.cxx │ ├── Configured.hxx │ ├── EncoderAPI.hxx │ ├── EncoderInterface.hxx │ ├── EncoderList.cxx │ ├── EncoderList.hxx │ ├── EncoderPlugin.hxx │ ├── ToOutputStream.cxx │ ├── ToOutputStream.hxx │ ├── meson.build │ └── plugins │ │ ├── FlacEncoderPlugin.cxx │ │ ├── FlacEncoderPlugin.hxx │ │ ├── LameEncoderPlugin.cxx │ │ ├── LameEncoderPlugin.hxx │ │ ├── NullEncoderPlugin.cxx │ │ ├── NullEncoderPlugin.hxx │ │ ├── OggEncoder.hxx │ │ ├── OpusEncoderPlugin.cxx │ │ ├── OpusEncoderPlugin.hxx │ │ ├── ShineEncoderPlugin.cxx │ │ ├── ShineEncoderPlugin.hxx │ │ ├── TwolameEncoderPlugin.cxx │ │ ├── TwolameEncoderPlugin.hxx │ │ ├── VorbisEncoderPlugin.cxx │ │ ├── VorbisEncoderPlugin.hxx │ │ ├── WaveEncoderPlugin.cxx │ │ ├── WaveEncoderPlugin.hxx │ │ └── meson.build ├── event │ ├── Backend.hxx │ ├── BackendEvents.hxx │ ├── BufferedSocket.cxx │ ├── BufferedSocket.hxx │ ├── Call.cxx │ ├── Call.hxx │ ├── Chrono.hxx │ ├── CoarseTimerEvent.cxx │ ├── CoarseTimerEvent.hxx │ ├── DeferEvent.cxx │ ├── DeferEvent.hxx │ ├── EpollBackend.hxx │ ├── EpollEvents.hxx │ ├── FarTimerEvent.hxx │ ├── FineTimerEvent.cxx │ ├── FineTimerEvent.hxx │ ├── FullyBufferedSocket.cxx │ ├── FullyBufferedSocket.hxx │ ├── IdleEvent.hxx │ ├── InjectEvent.cxx │ ├── InjectEvent.hxx │ ├── InotifyEvent.cxx │ ├── InotifyEvent.hxx │ ├── InotifyManager.cxx │ ├── InotifyManager.hxx │ ├── Loop.cxx │ ├── Loop.hxx │ ├── MaskMonitor.cxx │ ├── MaskMonitor.hxx │ ├── MultiSocketMonitor.cxx │ ├── MultiSocketMonitor.hxx │ ├── PipeEvent.hxx │ ├── PollBackend.cxx │ ├── PollBackend.hxx │ ├── PollEvents.hxx │ ├── PollResultGeneric.hxx │ ├── ServerSocket.cxx │ ├── ServerSocket.hxx │ ├── SignalMonitor.cxx │ ├── SignalMonitor.hxx │ ├── SocketEvent.cxx │ ├── SocketEvent.hxx │ ├── Thread.cxx │ ├── Thread.hxx │ ├── TimerList.cxx │ ├── TimerList.hxx │ ├── TimerWheel.cxx │ ├── TimerWheel.hxx │ ├── WakeFD.hxx │ ├── WinSelectBackend.cxx │ ├── WinSelectBackend.hxx │ ├── WinSelectEvents.hxx │ ├── meson.build │ └── uring │ │ └── Manager.hxx ├── filter │ ├── Factory.cxx │ ├── Factory.hxx │ ├── Filter.hxx │ ├── FilterPlugin.hxx │ ├── LoadChain.cxx │ ├── LoadChain.hxx │ ├── LoadOne.cxx │ ├── LoadOne.hxx │ ├── NullFilter.hxx │ ├── Observer.cxx │ ├── Observer.hxx │ ├── Prepared.hxx │ ├── Registry.cxx │ ├── Registry.hxx │ ├── meson.build │ └── plugins │ │ ├── AutoConvertFilterPlugin.cxx │ │ ├── AutoConvertFilterPlugin.hxx │ │ ├── ConvertFilterPlugin.cxx │ │ ├── ConvertFilterPlugin.hxx │ │ ├── FfmpegFilter.cxx │ │ ├── FfmpegFilter.hxx │ │ ├── FfmpegFilterPlugin.cxx │ │ ├── FfmpegFilterPlugin.hxx │ │ ├── HdcdFilterPlugin.cxx │ │ ├── HdcdFilterPlugin.hxx │ │ ├── NormalizeFilterPlugin.cxx │ │ ├── NormalizeFilterPlugin.hxx │ │ ├── NullFilterPlugin.cxx │ │ ├── NullFilterPlugin.hxx │ │ ├── ReplayGainFilterPlugin.cxx │ │ ├── ReplayGainFilterPlugin.hxx │ │ ├── RouteFilterPlugin.cxx │ │ ├── RouteFilterPlugin.hxx │ │ ├── TwoFilters.cxx │ │ ├── TwoFilters.hxx │ │ ├── VolumeFilterPlugin.cxx │ │ ├── VolumeFilterPlugin.hxx │ │ └── meson.build ├── fs │ ├── AllocatedPath.cxx │ ├── AllocatedPath.hxx │ ├── Charset.cxx │ ├── Charset.hxx │ ├── Config.cxx │ ├── Config.hxx │ ├── DirectoryReader.cxx │ ├── DirectoryReader.hxx │ ├── Domain.cxx │ ├── Domain.hxx │ ├── Features.hxx │ ├── FileInfo.cxx │ ├── FileInfo.hxx │ ├── FileSystem.cxx │ ├── FileSystem.hxx │ ├── Glob.cxx │ ├── Glob.hxx │ ├── Limits.hxx │ ├── List.cxx │ ├── List.hxx │ ├── LookupFile.cxx │ ├── LookupFile.hxx │ ├── NarrowPath.cxx │ ├── NarrowPath.hxx │ ├── Path.cxx │ ├── Path.hxx │ ├── Path2.cxx │ ├── Traits.cxx │ ├── Traits.hxx │ ├── XDG.hxx │ ├── glue │ │ ├── CheckFile.cxx │ │ ├── CheckFile.hxx │ │ ├── StandardDirectory.cxx │ │ ├── StandardDirectory.hxx │ │ └── meson.build │ └── meson.build ├── input │ ├── AsyncInputStream.cxx │ ├── AsyncInputStream.hxx │ ├── BufferedInputStream.cxx │ ├── BufferedInputStream.hxx │ ├── BufferingInputStream.cxx │ ├── BufferingInputStream.hxx │ ├── CondHandler.hxx │ ├── Error.cxx │ ├── Error.hxx │ ├── FailingInputStream.hxx │ ├── Handler.hxx │ ├── IcyInputStream.cxx │ ├── IcyInputStream.hxx │ ├── Init.cxx │ ├── Init.hxx │ ├── InputPlugin.cxx │ ├── InputPlugin.hxx │ ├── InputStream.cxx │ ├── InputStream.hxx │ ├── LastInputStream.cxx │ ├── LastInputStream.hxx │ ├── LocalOpen.cxx │ ├── LocalOpen.hxx │ ├── MaybeBufferedInputStream.cxx │ ├── MaybeBufferedInputStream.hxx │ ├── MemoryInputStream.cxx │ ├── MemoryInputStream.hxx │ ├── Offset.hxx │ ├── Open.cxx │ ├── ProxyInputStream.cxx │ ├── ProxyInputStream.hxx │ ├── Ptr.hxx │ ├── Reader.cxx │ ├── Reader.hxx │ ├── Registry.cxx │ ├── Registry.hxx │ ├── RemoteTagScanner.hxx │ ├── RewindInputStream.cxx │ ├── RewindInputStream.hxx │ ├── ScanTags.cxx │ ├── ScanTags.hxx │ ├── TextInputStream.cxx │ ├── TextInputStream.hxx │ ├── ThreadInputStream.cxx │ ├── ThreadInputStream.hxx │ ├── WaitReady.cxx │ ├── WaitReady.hxx │ ├── cache │ │ ├── Config.cxx │ │ ├── Config.hxx │ │ ├── Item.cxx │ │ ├── Item.hxx │ │ ├── Lease.hxx │ │ ├── Manager.cxx │ │ ├── Manager.hxx │ │ ├── Stream.cxx │ │ └── Stream.hxx │ ├── meson.build │ └── plugins │ │ ├── AlsaInputPlugin.cxx │ │ ├── AlsaInputPlugin.hxx │ │ ├── ArchiveInputPlugin.cxx │ │ ├── ArchiveInputPlugin.hxx │ │ ├── CdioParanoiaInputPlugin.cxx │ │ ├── CdioParanoiaInputPlugin.hxx │ │ ├── CurlInputPlugin.cxx │ │ ├── CurlInputPlugin.hxx │ │ ├── FfmpegInputPlugin.cxx │ │ ├── FfmpegInputPlugin.hxx │ │ ├── FileInputPlugin.cxx │ │ ├── FileInputPlugin.hxx │ │ ├── MmsInputPlugin.cxx │ │ ├── MmsInputPlugin.hxx │ │ ├── NfsInputPlugin.cxx │ │ ├── NfsInputPlugin.hxx │ │ ├── QobuzClient.cxx │ │ ├── QobuzClient.hxx │ │ ├── QobuzErrorParser.cxx │ │ ├── QobuzErrorParser.hxx │ │ ├── QobuzInputPlugin.cxx │ │ ├── QobuzInputPlugin.hxx │ │ ├── QobuzLoginRequest.cxx │ │ ├── QobuzLoginRequest.hxx │ │ ├── QobuzSession.hxx │ │ ├── QobuzTagScanner.cxx │ │ ├── QobuzTagScanner.hxx │ │ ├── QobuzTrackRequest.cxx │ │ ├── QobuzTrackRequest.hxx │ │ ├── SmbclientInputPlugin.cxx │ │ ├── SmbclientInputPlugin.hxx │ │ ├── UringInputPlugin.cxx │ │ ├── UringInputPlugin.hxx │ │ └── meson.build ├── io │ ├── BufferedOutputStream.cxx │ ├── BufferedOutputStream.hxx │ ├── BufferedReader.cxx │ ├── BufferedReader.hxx │ ├── FileAt.hxx │ ├── FileDescriptor.cxx │ ├── FileDescriptor.hxx │ ├── FileLineReader.hxx │ ├── FileOutputStream.cxx │ ├── FileOutputStream.hxx │ ├── FileReader.cxx │ ├── FileReader.hxx │ ├── LineReader.hxx │ ├── Open.cxx │ ├── Open.hxx │ ├── OutputStream.hxx │ ├── PeekReader.cxx │ ├── PeekReader.hxx │ ├── Reader.cxx │ ├── Reader.hxx │ ├── StdioOutputStream.hxx │ ├── StringOutputStream.hxx │ ├── UniqueFileDescriptor.hxx │ ├── linux │ │ └── ProcPath.hxx │ ├── meson.build │ └── uring │ │ ├── CancellableOperation.hxx │ │ ├── Close.cxx │ │ ├── Close.hxx │ │ ├── Operation.cxx │ │ ├── Operation.hxx │ │ ├── Queue.cxx │ │ ├── Queue.hxx │ │ ├── ReadOperation.cxx │ │ ├── ReadOperation.hxx │ │ ├── Ring.cxx │ │ ├── Ring.hxx │ │ └── meson.build ├── java │ ├── Class.hxx │ ├── Exception.cxx │ ├── Exception.hxx │ ├── File.cxx │ ├── File.hxx │ ├── Global.cxx │ ├── Global.hxx │ ├── Object.cxx │ ├── Object.hxx │ ├── Ref.hxx │ ├── String.cxx │ ├── String.hxx │ └── meson.build ├── lib │ ├── alsa │ │ ├── AllowedFormat.cxx │ │ ├── AllowedFormat.hxx │ │ ├── ChannelMap.cxx │ │ ├── ChannelMap.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── Format.hxx │ │ ├── HwSetup.cxx │ │ ├── HwSetup.hxx │ │ ├── NonBlock.cxx │ │ ├── NonBlock.hxx │ │ ├── PeriodBuffer.hxx │ │ ├── Version.cxx │ │ ├── Version.hxx │ │ └── meson.build │ ├── avahi │ │ ├── Client.cxx │ │ ├── Client.hxx │ │ ├── ConnectionListener.hxx │ │ ├── EntryGroup.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── ErrorHandler.hxx │ │ ├── Poll.cxx │ │ ├── Poll.hxx │ │ ├── Publisher.cxx │ │ ├── Publisher.hxx │ │ └── Service.hxx │ ├── cdio │ │ └── Paranoia.hxx │ ├── chromaprint │ │ ├── Context.hxx │ │ ├── DecoderClient.cxx │ │ ├── DecoderClient.hxx │ │ └── meson.build │ ├── crypto │ │ ├── Base64.cxx │ │ ├── Base64.hxx │ │ ├── MD5.cxx │ │ ├── MD5.hxx │ │ └── meson.build │ ├── curl │ │ ├── Adapter.cxx │ │ ├── Adapter.hxx │ │ ├── Delegate.cxx │ │ ├── Delegate.hxx │ │ ├── Easy.hxx │ │ ├── Error.hxx │ │ ├── Escape.cxx │ │ ├── Escape.hxx │ │ ├── Form.cxx │ │ ├── Form.hxx │ │ ├── Global.cxx │ │ ├── Global.hxx │ │ ├── Handler.hxx │ │ ├── Headers.hxx │ │ ├── HttpStatusError.hxx │ │ ├── Init.cxx │ │ ├── Init.hxx │ │ ├── Multi.hxx │ │ ├── Parser.hxx │ │ ├── Request.cxx │ │ ├── Request.hxx │ │ ├── Setup.cxx │ │ ├── Setup.hxx │ │ ├── Slist.hxx │ │ ├── String.hxx │ │ ├── StringHandler.cxx │ │ ├── StringHandler.hxx │ │ ├── StringResponse.hxx │ │ ├── Version.cxx │ │ ├── Version.hxx │ │ └── meson.build │ ├── dbus │ │ ├── AppendIter.hxx │ │ ├── AsyncRequest.hxx │ │ ├── Connection.cxx │ │ ├── Connection.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── FilterHelper.cxx │ │ ├── FilterHelper.hxx │ │ ├── Glue.cxx │ │ ├── Glue.hxx │ │ ├── Init.hxx │ │ ├── Iter.hxx │ │ ├── Message.cxx │ │ ├── Message.hxx │ │ ├── ObjectManager.hxx │ │ ├── PendingCall.hxx │ │ ├── ReadIter.hxx │ │ ├── ScopeMatch.cxx │ │ ├── ScopeMatch.hxx │ │ ├── Types.hxx │ │ ├── UDisks2.cxx │ │ ├── UDisks2.hxx │ │ ├── Values.hxx │ │ ├── Watch.cxx │ │ ├── Watch.hxx │ │ └── meson.build │ ├── expat │ │ ├── ExpatParser.cxx │ │ ├── ExpatParser.hxx │ │ ├── StreamExpatParser.cxx │ │ └── meson.build │ ├── ffmpeg │ │ ├── Buffer.hxx │ │ ├── ChannelLayout.hxx │ │ ├── Codec.hxx │ │ ├── DetectFilterFormat.cxx │ │ ├── DetectFilterFormat.hxx │ │ ├── Domain.cxx │ │ ├── Domain.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── Filter.cxx │ │ ├── Filter.hxx │ │ ├── Format.hxx │ │ ├── Frame.hxx │ │ ├── IOContext.hxx │ │ ├── Init.cxx │ │ ├── Init.hxx │ │ ├── Interleave.cxx │ │ ├── Interleave.hxx │ │ ├── LibFmt.hxx │ │ ├── LogCallback.cxx │ │ ├── LogCallback.hxx │ │ ├── SampleFormat.hxx │ │ ├── Time.hxx │ │ └── meson.build │ ├── fmt │ │ ├── AudioFormatFormatter.hxx │ │ ├── ExceptionFormatter.cxx │ │ ├── ExceptionFormatter.hxx │ │ ├── PathFormatter.hxx │ │ ├── RuntimeError.cxx │ │ ├── RuntimeError.hxx │ │ ├── SocketAddressFormatter.cxx │ │ ├── SocketAddressFormatter.hxx │ │ ├── SystemError.cxx │ │ ├── SystemError.hxx │ │ ├── ToBuffer.hxx │ │ ├── Unsafe.hxx │ │ └── meson.build │ ├── gcrypt │ │ ├── Hash.hxx │ │ ├── Init.hxx │ │ ├── MD5.cxx │ │ ├── MD5.hxx │ │ └── meson.build │ ├── icu │ │ ├── Canonicalize.cxx │ │ ├── Canonicalize.hxx │ │ ├── Collate.cxx │ │ ├── Collate.hxx │ │ ├── Compare.cxx │ │ ├── Compare.hxx │ │ ├── Converter.cxx │ │ ├── Converter.hxx │ │ ├── Error.hxx │ │ ├── FoldCase.cxx │ │ ├── FoldCase.hxx │ │ ├── Init.cxx │ │ ├── Init.hxx │ │ ├── Normalize.cxx │ │ ├── Normalize.hxx │ │ ├── Transliterator.cxx │ │ ├── Transliterator.hxx │ │ ├── Util.cxx │ │ ├── Util.hxx │ │ ├── Win32.cxx │ │ ├── Win32.hxx │ │ └── meson.build │ ├── modplug │ │ └── patches │ │ │ ├── no_register │ │ │ └── series │ ├── nfs │ │ ├── Base.cxx │ │ ├── Base.hxx │ │ ├── Blocking.cxx │ │ ├── Blocking.hxx │ │ ├── Callback.hxx │ │ ├── Cancellable.hxx │ │ ├── Connection.cxx │ │ ├── Connection.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── FileReader.cxx │ │ ├── FileReader.hxx │ │ ├── Glue.cxx │ │ ├── Glue.hxx │ │ ├── Lease.hxx │ │ ├── Manager.cxx │ │ ├── Manager.hxx │ │ └── meson.build │ ├── nlohmann_json │ │ └── meson.build │ ├── oss │ │ └── meson.build │ ├── pcre │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── MatchData.hxx │ │ ├── RegexPointer.hxx │ │ ├── UniqueRegex.cxx │ │ ├── UniqueRegex.hxx │ │ └── meson.build │ ├── pipewire │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── ThreadLoop.hxx │ │ └── meson.build │ ├── pulse │ │ ├── Domain.cxx │ │ ├── Domain.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── LockGuard.hxx │ │ ├── LogError.cxx │ │ ├── LogError.hxx │ │ └── meson.build │ ├── smbclient │ │ ├── Context.cxx │ │ ├── Context.hxx │ │ ├── Domain.cxx │ │ ├── Domain.hxx │ │ ├── Init.cxx │ │ ├── Init.hxx │ │ └── meson.build │ ├── sndio │ │ └── meson.build │ ├── sqlite │ │ ├── Database.cxx │ │ ├── Database.hxx │ │ ├── Error.cxx │ │ ├── Error.hxx │ │ ├── Util.hxx │ │ └── meson.build │ ├── systemd │ │ ├── Watchdog.cxx │ │ ├── Watchdog.hxx │ │ └── meson.build │ ├── upnp │ │ ├── Action.cxx │ │ ├── Action.hxx │ │ ├── Callback.hxx │ │ ├── ClientInit.cxx │ │ ├── ClientInit.hxx │ │ ├── ContentDirectoryService.cxx │ │ ├── ContentDirectoryService.hxx │ │ ├── Device.cxx │ │ ├── Device.hxx │ │ ├── Discovery.cxx │ │ ├── Discovery.hxx │ │ ├── Error.hxx │ │ ├── Init.cxx │ │ ├── Init.hxx │ │ ├── Util.cxx │ │ ├── Util.hxx │ │ └── meson.build │ ├── xiph │ │ ├── FlacAudioFormat.hxx │ │ ├── FlacIOHandle.cxx │ │ ├── FlacIOHandle.hxx │ │ ├── FlacMetadataChain.cxx │ │ ├── FlacMetadataChain.hxx │ │ ├── FlacMetadataIterator.hxx │ │ ├── FlacStreamMetadata.cxx │ │ ├── FlacStreamMetadata.hxx │ │ ├── OggFind.cxx │ │ ├── OggFind.hxx │ │ ├── OggPacket.cxx │ │ ├── OggPacket.hxx │ │ ├── OggPage.hxx │ │ ├── OggStreamState.hxx │ │ ├── OggSyncState.cxx │ │ ├── OggSyncState.hxx │ │ ├── OggVisitor.cxx │ │ ├── OggVisitor.hxx │ │ ├── ScanVorbisComment.cxx │ │ ├── ScanVorbisComment.hxx │ │ ├── VorbisComment.hxx │ │ ├── VorbisComments.cxx │ │ ├── VorbisComments.hxx │ │ ├── VorbisPicture.cxx │ │ ├── VorbisPicture.hxx │ │ ├── XiphTags.cxx │ │ ├── XiphTags.hxx │ │ └── meson.build │ └── zlib │ │ ├── AutoGunzipFileLineReader.cxx │ │ ├── AutoGunzipFileLineReader.hxx │ │ ├── AutoGunzipReader.cxx │ │ ├── AutoGunzipReader.hxx │ │ ├── Error.hxx │ │ ├── GunzipReader.cxx │ │ ├── GunzipReader.hxx │ │ ├── GzipOutputStream.cxx │ │ ├── GzipOutputStream.hxx │ │ └── meson.build ├── ls.cxx ├── ls.hxx ├── mixer │ ├── All.cxx │ ├── Control.cxx │ ├── Control.hxx │ ├── Listener.hxx │ ├── Memento.cxx │ ├── Memento.hxx │ ├── Mixer.cxx │ ├── Mixer.hxx │ ├── MixerPlugin.hxx │ ├── Type.cxx │ ├── Type.hxx │ ├── meson.build │ └── plugins │ │ ├── AlsaMixerPlugin.cxx │ │ ├── AlsaMixerPlugin.hxx │ │ ├── AndroidMixerPlugin.cxx │ │ ├── AndroidMixerPlugin.hxx │ │ ├── NullMixerPlugin.cxx │ │ ├── NullMixerPlugin.hxx │ │ ├── OSXMixerPlugin.cxx │ │ ├── OSXMixerPlugin.hxx │ │ ├── OssMixerPlugin.cxx │ │ ├── OssMixerPlugin.hxx │ │ ├── PipeWireMixerPlugin.cxx │ │ ├── PipeWireMixerPlugin.hxx │ │ ├── PulseMixerPlugin.cxx │ │ ├── PulseMixerPlugin.hxx │ │ ├── SndioMixerPlugin.cxx │ │ ├── SndioMixerPlugin.hxx │ │ ├── SoftwareMixerPlugin.cxx │ │ ├── SoftwareMixerPlugin.hxx │ │ ├── VolumeMapping.cxx │ │ ├── VolumeMapping.hxx │ │ ├── WasapiMixerPlugin.cxx │ │ ├── WasapiMixerPlugin.hxx │ │ ├── WinmmMixerPlugin.cxx │ │ ├── WinmmMixerPlugin.hxx │ │ └── meson.build ├── neighbor │ ├── Explorer.hxx │ ├── Glue.cxx │ ├── Glue.hxx │ ├── Info.hxx │ ├── Listener.hxx │ ├── NeighborPlugin.hxx │ ├── Registry.cxx │ ├── Registry.hxx │ ├── meson.build │ └── plugins │ │ ├── SmbclientNeighborPlugin.cxx │ │ ├── SmbclientNeighborPlugin.hxx │ │ ├── UdisksNeighborPlugin.cxx │ │ ├── UdisksNeighborPlugin.hxx │ │ ├── UpnpNeighborPlugin.cxx │ │ ├── UpnpNeighborPlugin.hxx │ │ └── meson.build ├── net │ ├── AddressInfo.cxx │ ├── AddressInfo.hxx │ ├── AllocatedSocketAddress.cxx │ ├── AllocatedSocketAddress.hxx │ ├── DscpParser.cxx │ ├── DscpParser.hxx │ ├── FormatAddress.cxx │ ├── FormatAddress.hxx │ ├── HostParser.cxx │ ├── HostParser.hxx │ ├── IPv4Address.cxx │ ├── IPv4Address.hxx │ ├── IPv6Address.cxx │ ├── IPv6Address.hxx │ ├── Init.hxx │ ├── LocalSocketAddress.cxx │ ├── LocalSocketAddress.hxx │ ├── MsgHdr.hxx │ ├── PeerCredentials.hxx │ ├── Resolver.cxx │ ├── Resolver.hxx │ ├── SocketAddress.cxx │ ├── SocketAddress.hxx │ ├── SocketDescriptor.cxx │ ├── SocketDescriptor.hxx │ ├── SocketError.cxx │ ├── SocketError.hxx │ ├── SocketUtil.cxx │ ├── SocketUtil.hxx │ ├── StaticSocketAddress.cxx │ ├── StaticSocketAddress.hxx │ ├── ToString.cxx │ ├── ToString.hxx │ ├── UniqueSocketDescriptor.hxx │ └── meson.build ├── open.h ├── output │ ├── Client.hxx │ ├── Control.cxx │ ├── Control.hxx │ ├── Defaults.cxx │ ├── Defaults.hxx │ ├── Domain.cxx │ ├── Domain.hxx │ ├── Error.hxx │ ├── Filtered.cxx │ ├── Filtered.hxx │ ├── Init.cxx │ ├── Interface.cxx │ ├── Interface.hxx │ ├── MultipleOutputs.cxx │ ├── MultipleOutputs.hxx │ ├── OutputAPI.hxx │ ├── OutputCommand.cxx │ ├── OutputCommand.hxx │ ├── OutputPlugin.cxx │ ├── OutputPlugin.hxx │ ├── Print.cxx │ ├── Print.hxx │ ├── Registry.cxx │ ├── Registry.hxx │ ├── SharedPipeConsumer.cxx │ ├── SharedPipeConsumer.hxx │ ├── Source.cxx │ ├── Source.hxx │ ├── State.cxx │ ├── State.hxx │ ├── Thread.cxx │ ├── Timer.cxx │ ├── Timer.hxx │ ├── meson.build │ └── plugins │ │ ├── AlsaOutputPlugin.cxx │ │ ├── AlsaOutputPlugin.hxx │ │ ├── AoOutputPlugin.cxx │ │ ├── AoOutputPlugin.hxx │ │ ├── FifoOutputPlugin.cxx │ │ ├── FifoOutputPlugin.hxx │ │ ├── JackOutputPlugin.cxx │ │ ├── JackOutputPlugin.hxx │ │ ├── NullOutputPlugin.cxx │ │ ├── NullOutputPlugin.hxx │ │ ├── OSXOutputPlugin.cxx │ │ ├── OSXOutputPlugin.hxx │ │ ├── OpenALOutputPlugin.cxx │ │ ├── OpenALOutputPlugin.hxx │ │ ├── OssOutputPlugin.cxx │ │ ├── OssOutputPlugin.hxx │ │ ├── PipeOutputPlugin.cxx │ │ ├── PipeOutputPlugin.hxx │ │ ├── PipeWireOutputPlugin.cxx │ │ ├── PipeWireOutputPlugin.hxx │ │ ├── PulseOutputPlugin.cxx │ │ ├── PulseOutputPlugin.hxx │ │ ├── RecorderOutputPlugin.cxx │ │ ├── RecorderOutputPlugin.hxx │ │ ├── ShoutOutputPlugin.cxx │ │ ├── ShoutOutputPlugin.hxx │ │ ├── SndioOutputPlugin.cxx │ │ ├── SndioOutputPlugin.hxx │ │ ├── SolarisOutputPlugin.cxx │ │ ├── SolarisOutputPlugin.hxx │ │ ├── WinmmOutputPlugin.cxx │ │ ├── WinmmOutputPlugin.hxx │ │ ├── httpd │ │ ├── HttpdClient.cxx │ │ ├── HttpdClient.hxx │ │ ├── HttpdInternal.hxx │ │ ├── HttpdOutputPlugin.cxx │ │ ├── HttpdOutputPlugin.hxx │ │ ├── IcyMetaDataServer.cxx │ │ ├── IcyMetaDataServer.hxx │ │ └── Page.hxx │ │ ├── meson.build │ │ ├── sles │ │ ├── AndroidSimpleBufferQueue.hxx │ │ ├── Engine.hxx │ │ ├── Object.hxx │ │ ├── Play.hxx │ │ ├── SlesOutputPlugin.cxx │ │ └── SlesOutputPlugin.hxx │ │ ├── snapcast │ │ ├── Chunk.hxx │ │ ├── Client.cxx │ │ ├── Client.hxx │ │ ├── Internal.hxx │ │ ├── Protocol.hxx │ │ ├── SnapcastOutputPlugin.cxx │ │ ├── SnapcastOutputPlugin.hxx │ │ └── Timestamp.hxx │ │ └── wasapi │ │ ├── AudioClient.hxx │ │ ├── Device.hxx │ │ ├── ForMixer.hxx │ │ ├── PropertyStore.hxx │ │ ├── WasapiOutputPlugin.cxx │ │ └── WasapiOutputPlugin.hxx ├── pcm │ ├── AudioFormat.cxx │ ├── AudioFormat.hxx │ ├── AudioParser.cxx │ ├── AudioParser.hxx │ ├── Buffer.cxx │ ├── Buffer.hxx │ ├── ChannelDefs.hxx │ ├── ChannelsConverter.cxx │ ├── ChannelsConverter.hxx │ ├── CheckAudioFormat.cxx │ ├── CheckAudioFormat.hxx │ ├── Clamp.hxx │ ├── ConfiguredResampler.cxx │ ├── ConfiguredResampler.hxx │ ├── Convert.cxx │ ├── Convert.hxx │ ├── Dither.cxx │ ├── Dither.hxx │ ├── Dop.cxx │ ├── Dop.hxx │ ├── Dsd16.cxx │ ├── Dsd16.hxx │ ├── Dsd2Pcm.cxx │ ├── Dsd2Pcm.hxx │ ├── Dsd32.cxx │ ├── Dsd32.hxx │ ├── Export.cxx │ ├── Export.hxx │ ├── FallbackResampler.cxx │ ├── FallbackResampler.hxx │ ├── FloatConvert.hxx │ ├── FormatConverter.cxx │ ├── FormatConverter.hxx │ ├── GlueResampler.cxx │ ├── GlueResampler.hxx │ ├── Interleave.cxx │ ├── Interleave.hxx │ ├── LibsamplerateResampler.cxx │ ├── LibsamplerateResampler.hxx │ ├── Mix.cxx │ ├── Mix.hxx │ ├── MixRampAnalyzer.cxx │ ├── MixRampAnalyzer.hxx │ ├── MixRampGlue.cxx │ ├── MixRampGlue.hxx │ ├── Neon.hxx │ ├── Normalizer.cxx │ ├── Normalizer.hxx │ ├── Order.cxx │ ├── Order.hxx │ ├── Pack.cxx │ ├── Pack.hxx │ ├── PcmChannels.cxx │ ├── PcmChannels.hxx │ ├── PcmDsd.cxx │ ├── PcmDsd.hxx │ ├── PcmFormat.cxx │ ├── PcmFormat.hxx │ ├── Prng.hxx │ ├── ReplayGainAnalyzer.cxx │ ├── ReplayGainAnalyzer.hxx │ ├── Resampler.hxx │ ├── RestBuffer.hxx │ ├── SampleFormat.cxx │ ├── SampleFormat.hxx │ ├── ShiftConvert.hxx │ ├── Silence.cxx │ ├── Silence.hxx │ ├── SoxrResampler.cxx │ ├── SoxrResampler.hxx │ ├── Traits.hxx │ ├── Volume.cxx │ ├── Volume.hxx │ └── meson.build ├── player │ ├── Control.cxx │ ├── Control.hxx │ ├── CrossFade.cxx │ ├── CrossFade.hxx │ ├── Listener.hxx │ ├── Outputs.hxx │ └── Thread.cxx ├── playlist │ ├── Length.cxx │ ├── Length.hxx │ ├── MemorySongEnumerator.cxx │ ├── MemorySongEnumerator.hxx │ ├── PlaylistAny.cxx │ ├── PlaylistAny.hxx │ ├── PlaylistMapper.cxx │ ├── PlaylistMapper.hxx │ ├── PlaylistPlugin.cxx │ ├── PlaylistPlugin.hxx │ ├── PlaylistQueue.cxx │ ├── PlaylistQueue.hxx │ ├── PlaylistRegistry.cxx │ ├── PlaylistRegistry.hxx │ ├── PlaylistSong.cxx │ ├── PlaylistSong.hxx │ ├── PlaylistStream.cxx │ ├── PlaylistStream.hxx │ ├── Print.cxx │ ├── Print.hxx │ ├── SongEnumerator.hxx │ ├── cue │ │ ├── CueParser.cxx │ │ └── CueParser.hxx │ ├── meson.build │ └── plugins │ │ ├── AsxPlaylistPlugin.cxx │ │ ├── AsxPlaylistPlugin.hxx │ │ ├── CuePlaylistPlugin.cxx │ │ ├── CuePlaylistPlugin.hxx │ │ ├── EmbeddedCuePlaylistPlugin.cxx │ │ ├── EmbeddedCuePlaylistPlugin.hxx │ │ ├── ExtM3uPlaylistPlugin.cxx │ │ ├── ExtM3uPlaylistPlugin.hxx │ │ ├── FlacPlaylistPlugin.cxx │ │ ├── FlacPlaylistPlugin.hxx │ │ ├── M3uPlaylistPlugin.cxx │ │ ├── M3uPlaylistPlugin.hxx │ │ ├── PlsPlaylistPlugin.cxx │ │ ├── PlsPlaylistPlugin.hxx │ │ ├── RssPlaylistPlugin.cxx │ │ ├── RssPlaylistPlugin.hxx │ │ ├── XspfPlaylistPlugin.cxx │ │ ├── XspfPlaylistPlugin.hxx │ │ └── meson.build ├── protocol │ ├── Ack.hxx │ ├── ArgParser.cxx │ ├── ArgParser.hxx │ ├── IdleFlags.cxx │ ├── IdleFlags.hxx │ └── RangeArg.hxx ├── queue │ ├── IdTable.hxx │ ├── Listener.hxx │ ├── Playlist.cxx │ ├── Playlist.hxx │ ├── PlaylistControl.cxx │ ├── PlaylistEdit.cxx │ ├── PlaylistState.cxx │ ├── PlaylistState.hxx │ ├── PlaylistTag.cxx │ ├── PlaylistUpdate.cxx │ ├── Print.cxx │ ├── Print.hxx │ ├── Queue.cxx │ ├── Queue.hxx │ ├── QueuePrint.cxx │ ├── Save.cxx │ ├── Save.hxx │ ├── Selection.cxx │ └── Selection.hxx ├── song │ ├── AddedSinceSongFilter.cxx │ ├── AddedSinceSongFilter.hxx │ ├── AndSongFilter.cxx │ ├── AndSongFilter.hxx │ ├── AudioFormatSongFilter.cxx │ ├── AudioFormatSongFilter.hxx │ ├── BaseSongFilter.cxx │ ├── BaseSongFilter.hxx │ ├── DetachedSong.cxx │ ├── DetachedSong.hxx │ ├── Escape.cxx │ ├── Escape.hxx │ ├── Filter.cxx │ ├── Filter.hxx │ ├── ISongFilter.hxx │ ├── LightSong.cxx │ ├── LightSong.hxx │ ├── ModifiedSinceSongFilter.cxx │ ├── ModifiedSinceSongFilter.hxx │ ├── NotSongFilter.hxx │ ├── OptimizeFilter.cxx │ ├── OptimizeFilter.hxx │ ├── PrioritySongFilter.cxx │ ├── PrioritySongFilter.hxx │ ├── StringFilter.cxx │ ├── StringFilter.hxx │ ├── TagSongFilter.cxx │ ├── TagSongFilter.hxx │ ├── UriSongFilter.cxx │ ├── UriSongFilter.hxx │ └── meson.build ├── sticker │ ├── AllowedTags.cxx │ ├── AllowedTags.hxx │ ├── CleanupService.cxx │ ├── CleanupService.hxx │ ├── Database.cxx │ ├── Database.hxx │ ├── Match.hxx │ ├── Print.cxx │ ├── Print.hxx │ ├── SongSticker.cxx │ ├── SongSticker.hxx │ ├── Sticker.hxx │ ├── TagSticker.cxx │ └── TagSticker.hxx ├── storage │ ├── CompositeStorage.cxx │ ├── CompositeStorage.hxx │ ├── Configured.cxx │ ├── Configured.hxx │ ├── FileInfo.hxx │ ├── MemoryDirectoryReader.cxx │ ├── MemoryDirectoryReader.hxx │ ├── Registry.cxx │ ├── Registry.hxx │ ├── StorageInterface.cxx │ ├── StorageInterface.hxx │ ├── StoragePlugin.cxx │ ├── StoragePlugin.hxx │ ├── StorageState.cxx │ ├── StorageState.hxx │ ├── meson.build │ └── plugins │ │ ├── CurlStorage.cxx │ │ ├── CurlStorage.hxx │ │ ├── LocalStorage.cxx │ │ ├── LocalStorage.hxx │ │ ├── NfsStorage.cxx │ │ ├── NfsStorage.hxx │ │ ├── SmbclientStorage.cxx │ │ ├── SmbclientStorage.hxx │ │ ├── UdisksStorage.cxx │ │ ├── UdisksStorage.hxx │ │ └── meson.build ├── system │ ├── Clock.cxx │ ├── Clock.hxx │ ├── EpollFD.cxx │ ├── EpollFD.hxx │ ├── Error.hxx │ ├── EventFD.cxx │ ├── EventFD.hxx │ ├── EventPipe.cxx │ ├── EventPipe.hxx │ ├── KernelVersion.cxx │ ├── KernelVersion.hxx │ ├── SignalFD.cxx │ ├── SignalFD.hxx │ ├── VmaName.hxx │ ├── linux │ │ ├── meson.build │ │ └── openat2.h │ └── meson.build ├── tag │ ├── Aiff.cxx │ ├── Aiff.hxx │ ├── ApeLoader.cxx │ ├── ApeLoader.hxx │ ├── ApeReplayGain.cxx │ ├── ApeReplayGain.hxx │ ├── ApeTag.cxx │ ├── ApeTag.hxx │ ├── Builder.cxx │ ├── Builder.hxx │ ├── Config.cxx │ ├── Config.hxx │ ├── Fallback.hxx │ ├── FixString.cxx │ ├── FixString.hxx │ ├── Format.cxx │ ├── Format.hxx │ ├── GenParseName.cxx │ ├── Generic.cxx │ ├── Generic.hxx │ ├── Handler.cxx │ ├── Handler.hxx │ ├── IcyMetaDataParser.cxx │ ├── IcyMetaDataParser.hxx │ ├── Id3Load.cxx │ ├── Id3Load.hxx │ ├── Id3MixRamp.cxx │ ├── Id3MixRamp.hxx │ ├── Id3MusicBrainz.cxx │ ├── Id3MusicBrainz.hxx │ ├── Id3Parse.hxx │ ├── Id3Picture.cxx │ ├── Id3Picture.hxx │ ├── Id3ReplayGain.cxx │ ├── Id3ReplayGain.hxx │ ├── Id3Scan.cxx │ ├── Id3Scan.hxx │ ├── Id3String.hxx │ ├── Id3Unique.hxx │ ├── Item.hxx │ ├── Mask.hxx │ ├── MixRampInfo.hxx │ ├── MixRampParser.cxx │ ├── MixRampParser.hxx │ ├── Names.cxx │ ├── Names.hxx │ ├── ParseName.cxx │ ├── ParseName.hxx │ ├── Pool.cxx │ ├── Pool.hxx │ ├── ReplayGainInfo.cxx │ ├── ReplayGainInfo.hxx │ ├── ReplayGainParser.cxx │ ├── ReplayGainParser.hxx │ ├── RiffFormat.hxx │ ├── RiffId3.cxx │ ├── RiffId3.hxx │ ├── Rva2.cxx │ ├── Rva2.hxx │ ├── Settings.cxx │ ├── Settings.hxx │ ├── Sort.cxx │ ├── Sort.hxx │ ├── Table.cxx │ ├── Table.hxx │ ├── Tag.cxx │ ├── Tag.hxx │ ├── Type.hxx │ ├── VisitFallback.hxx │ ├── VorbisComment.cxx │ ├── VorbisComment.hxx │ └── meson.build ├── thread │ ├── AsyncWaiter.hxx │ ├── Cond.hxx │ ├── CriticalSection.hxx │ ├── Future.hxx │ ├── Id.hxx │ ├── Mutex.hxx │ ├── Name.hxx │ ├── SafeSingleton.hxx │ ├── Slack.hxx │ ├── Thread.cxx │ ├── Thread.hxx │ ├── Util.cxx │ ├── Util.hxx │ ├── WindowsCond.hxx │ ├── WindowsFuture.hxx │ └── meson.build ├── time │ ├── Calendar.hxx │ ├── ChronoUtil.hxx │ ├── ClockCache.hxx │ ├── Convert.cxx │ ├── Convert.hxx │ ├── FileTime.hxx │ ├── ISO8601.cxx │ ├── ISO8601.hxx │ ├── Math.cxx │ ├── Math.hxx │ ├── PeriodClock.hxx │ ├── SystemClock.hxx │ ├── Zone.cxx │ ├── Zone.hxx │ └── meson.build ├── unix │ ├── Daemon.cxx │ ├── Daemon.hxx │ ├── PidFile.hxx │ ├── SignalHandlers.cxx │ └── SignalHandlers.hxx ├── util │ ├── ASCII.hxx │ ├── AllocatedArray.hxx │ ├── AllocatedString.hxx │ ├── BindMethod.hxx │ ├── BitReverse.cxx │ ├── BitReverse.hxx │ ├── ByteOrder.hxx │ ├── ByteReverse.cxx │ ├── ByteReverse.hxx │ ├── CNumberParser.hxx │ ├── Cast.hxx │ ├── CharUtil.hxx │ ├── CircularBuffer.hxx │ ├── Clamp.hxx │ ├── Compiler.h │ ├── Concepts.hxx │ ├── CopyConst.hxx │ ├── DeleteDisposer.hxx │ ├── DereferenceIterator.hxx │ ├── DisposablePointer.hxx │ ├── Domain.hxx │ ├── DynamicFifoBuffer.hxx │ ├── Exception.cxx │ ├── Exception.hxx │ ├── FilteredContainer.hxx │ ├── ForeignFifoBuffer.hxx │ ├── GenerateArray.hxx │ ├── HexFormat.hxx │ ├── HugeAllocator.cxx │ ├── HugeAllocator.hxx │ ├── IntrusiveForwardList.hxx │ ├── IntrusiveHashSet.hxx │ ├── IntrusiveHookMode.hxx │ ├── IntrusiveList.hxx │ ├── IntrusiveTreeSet.hxx │ ├── IterableSplitString.hxx │ ├── LazyRandomEngine.cxx │ ├── LazyRandomEngine.hxx │ ├── Manual.hxx │ ├── Math.hxx │ ├── MemberPointer.hxx │ ├── MimeType.cxx │ ├── MimeType.hxx │ ├── NumberParser.hxx │ ├── OffsetPointer.hxx │ ├── OptionalCounter.hxx │ ├── OptionalField.hxx │ ├── PackedBigEndian.hxx │ ├── PackedLittleEndian.hxx │ ├── PeakBuffer.cxx │ ├── PeakBuffer.hxx │ ├── PrintException.cxx │ ├── PrintException.hxx │ ├── RecursiveMap.hxx │ ├── RedBlackTree.hxx │ ├── ReusableArray.hxx │ ├── RingBuffer.hxx │ ├── RoundPowerOfTwo.hxx │ ├── ScopeExit.hxx │ ├── Serial.cxx │ ├── Serial.hxx │ ├── SliceBuffer.hxx │ ├── SortList.hxx │ ├── SpanCast.hxx │ ├── SparseBuffer.cxx │ ├── SparseBuffer.hxx │ ├── SplitString.cxx │ ├── SplitString.hxx │ ├── StaticFifoBuffer.hxx │ ├── StaticVector.hxx │ ├── StringAPI.hxx │ ├── StringBuffer.hxx │ ├── StringCompare.cxx │ ├── StringCompare.hxx │ ├── StringPointer.hxx │ ├── StringSplit.hxx │ ├── StringStrip.cxx │ ├── StringStrip.hxx │ ├── StringUtil.cxx │ ├── StringUtil.hxx │ ├── StringVerify.hxx │ ├── TagStructs.hxx │ ├── TemplateString.hxx │ ├── TerminatedArray.hxx │ ├── TextFile.hxx │ ├── Tokenizer.cxx │ ├── Tokenizer.hxx │ ├── TransformN.hxx │ ├── TruncateString.cxx │ ├── TruncateString.hxx │ ├── UTF8.cxx │ ├── UTF8.hxx │ ├── UriExtract.cxx │ ├── UriExtract.hxx │ ├── UriQueryParser.cxx │ ├── UriQueryParser.hxx │ ├── UriRelative.cxx │ ├── UriRelative.hxx │ ├── UriUtil.cxx │ ├── UriUtil.hxx │ ├── VarSize.hxx │ ├── WCharUtil.hxx │ ├── WStringAPI.hxx │ ├── WStringCompare.cxx │ ├── WStringCompare.hxx │ ├── djb_hash.hxx │ ├── format.c │ ├── format.h │ └── meson.build ├── win32 │ ├── Com.hxx │ ├── ComHeapPtr.hxx │ ├── ComPtr.hxx │ ├── ComWorker.cxx │ ├── ComWorker.hxx │ ├── HResult.cxx │ ├── HResult.hxx │ ├── PropVariant.cxx │ ├── PropVariant.hxx │ ├── Win32Main.cxx │ ├── WinEvent.cxx │ ├── WinEvent.hxx │ └── meson.build └── zeroconf │ ├── Bonjour.cxx │ ├── Bonjour.hxx │ ├── Glue.cxx │ ├── Glue.hxx │ ├── Helper.cxx │ ├── Helper.hxx │ ├── avahi │ ├── Helper.cxx │ ├── Helper.hxx │ └── meson.build │ └── meson.build ├── subprojects ├── .gitignore ├── curl.wrap ├── expat.wrap ├── flac.wrap ├── fmt.wrap ├── gtest.wrap ├── id3tag.wrap ├── lame.wrap ├── libmpdclient.wrap ├── libnpupnp.wrap ├── libsndfile.wrap ├── liburing.wrap ├── nlohmann_json.wrap ├── ogg.wrap ├── openssl.wrap ├── opus.wrap ├── packagefiles │ └── id3tag │ │ └── meson.build ├── sqlite3.wrap └── vorbis.wrap ├── systemd ├── meson.build ├── system │ ├── meson.build │ ├── mpd.service.in │ └── mpd.socket.in └── user │ ├── meson.build │ └── mpd.service.in ├── test ├── ConfigGlue.hxx ├── ContainerScan.cxx ├── DumpDatabase.cxx ├── DumpDecoderClient.cxx ├── DumpDecoderClient.hxx ├── DumpOgg.cxx ├── LoadDatabase.cxx ├── MakeTag.hxx ├── NullMixerListener.hxx ├── ParseSongFilter.cxx ├── ReadApeTags.cxx ├── ReadFrames.cxx ├── ReadFrames.hxx ├── RunChromaprint.cxx ├── RunCurl.cxx ├── RunMixRampAnalyzer.cxx ├── RunReplayGainAnalyzer.cxx ├── RunZeroconf.cxx ├── ShutdownHandler.cxx ├── ShutdownHandler.hxx ├── TestAudioFormat.cxx ├── TestIcu.cxx ├── TestRewindInputStream.cxx ├── TestStringFilter.cxx ├── TestTagSongFilter.cxx ├── WriteFile.cxx ├── dump_playlist.cxx ├── dump_rva2.cxx ├── dump_text_file.cxx ├── fs │ ├── TestGlob.cxx │ ├── TestLookupFile.cxx │ ├── TestParsePath.cxx │ ├── TestPath.cxx │ └── meson.build ├── fuzzer │ ├── FuzzCueParser.cxx │ └── meson.build ├── meson.build ├── net │ ├── TestIPv4Address.cxx │ ├── TestIPv6Address.cxx │ ├── TestLocalSocketAddress.cxx │ └── meson.build ├── playlist │ ├── PlaylistUtil.cxx │ ├── PlaylistUtil.hxx │ ├── TestPlsPlaylistPlugin.cxx │ └── meson.build ├── read_conf.cxx ├── read_mixer.cxx ├── read_tags.cxx ├── run_convert.cxx ├── run_decoder.cxx ├── run_encoder.cxx ├── run_filter.cxx ├── run_gunzip.cxx ├── run_gzip.cxx ├── run_inotify.cxx ├── run_input.cxx ├── run_neighbor_explorer.cxx ├── run_normalize.cxx ├── run_output.cxx ├── run_resolver.cxx ├── run_storage.cxx ├── software_volume.cxx ├── tag │ ├── TestMixRampInterpolate.cxx │ ├── TestMixRampParser.cxx │ └── meson.build ├── test_archive_bzip2.sh ├── test_archive_iso9660.sh ├── test_archive_zzip.sh ├── test_icy_parser.cxx ├── test_pcm_channels.cxx ├── test_pcm_dither.cxx ├── test_pcm_export.cxx ├── test_pcm_format.cxx ├── test_pcm_interleave.cxx ├── test_pcm_mix.cxx ├── test_pcm_pack.cxx ├── test_pcm_util.hxx ├── test_pcm_volume.cxx ├── test_protocol.cxx ├── test_queue_priority.cxx ├── test_translate_song.cxx ├── test_vorbis_encoder.cxx ├── time │ ├── TestConvert.cxx │ ├── TestFileTime.cxx │ ├── TestISO8601.cxx │ └── meson.build ├── util │ ├── TestCircularBuffer.cxx │ ├── TestException.cxx │ ├── TestIntrusiveForwardList.cxx │ ├── TestIntrusiveHashSet.cxx │ ├── TestIntrusiveList.cxx │ ├── TestIntrusiveTreeSet.cxx │ ├── TestMimeType.cxx │ ├── TestRingBuffer.cxx │ ├── TestSplitString.cxx │ ├── TestStringStrip.cxx │ ├── TestTemplateString.cxx │ ├── TestTerminatedArray.cxx │ ├── TestUriExtract.cxx │ ├── TestUriQueryParser.cxx │ ├── TestUriRelative.cxx │ ├── TestUriUtil.cxx │ ├── meson.build │ └── test_byte_reverse.cxx └── visit_archive.cxx ├── valgrind.suppressions └── win32 ├── build.py ├── meson.build └── res ├── meson.build ├── mpd.ico └── mpd.rc.in /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | AccessModifierOffset: -8 3 | AllowAllConstructorInitializersOnNextLine: false 4 | AlwaysBreakTemplateDeclarations: Yes 5 | BraceWrapping: 6 | AfterFunction: true 7 | SplitEmptyFunction: true 8 | BreakConstructorInitializers: BeforeColon 9 | ColumnLimit: 90 10 | ConstructorInitializerIndentWidth: 0 11 | ContinuationIndentWidth: 8 12 | IndentCaseLabels: false 13 | IndentPPDirectives: AfterHash 14 | IndentWidth: 8 15 | Standard: c++17 16 | TabWidth: 8 17 | UseTab: Always 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: User manual 4 | url: https://mpd.readthedocs.io/en/stable/user.html 5 | about: Read the manual and its troubleshooting chapter 6 | - name: Help forum 7 | url: https://github.com/MusicPlayerDaemon/MPD/discussions 8 | about: Please ask and answer questions here. 9 | - name: IRC Channel 10 | url: ircs://irc.libera.chat:6697/#mpd 11 | about: Please ask and answer questions here. 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Create a feature request 4 | --- 5 | 6 | ## Feature request 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /output/ 2 | 3 | __pycache__/ 4 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.12" 12 | 13 | python: 14 | install: 15 | - requirements: "doc/requirements.txt" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: doc/conf.py 20 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | ## ignoring .idea completely 5 | # until a good reason emerges not to 6 | /.idea 7 | ##-- 8 | ## moved the following into .idea/.gitignore 9 | #/.idea/caches 10 | #/.idea/libraries 11 | #/.idea/modules.xml 12 | #/.idea/workspace.xml 13 | #/.idea/navEditor.xml 14 | #/.idea/assetWizardSettings.xml 15 | ## -- 16 | .DS_Store 17 | /build 18 | /captures 19 | .externalNativeBuild 20 | .cxx 21 | local.properties 22 | # both were used: different spelling 23 | app/src/main/jnilibs/ 24 | app/src/main/jniLibs/ 25 | -------------------------------------------------------------------------------- /android/PrivacyPolicy.rst: -------------------------------------------------------------------------------- 1 | MPD for Android Privacy Policy 2 | ============================== 3 | 4 | Music Player Daemon is an open source project currently maintained by 5 | `Max Kellermann `__. 6 | 7 | Music Player Daemon does not access, collect, use or share any 8 | personal or sensitive user data. 9 | -------------------------------------------------------------------------------- /android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /android/app/src/main/aidl/org/musicpd/IMain.aidl: -------------------------------------------------------------------------------- 1 | package org.musicpd; 2 | import org.musicpd.IMainCallback; 3 | 4 | interface IMain 5 | { 6 | void start(); 7 | void stop(); 8 | void setPauseOnHeadphonesDisconnect(boolean enabled); 9 | void setWakelockEnabled(boolean enabled); 10 | boolean isRunning(); 11 | void registerCallback(IMainCallback cb); 12 | void unregisterCallback(IMainCallback cb); 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/aidl/org/musicpd/IMainCallback.aidl: -------------------------------------------------------------------------------- 1 | package org.musicpd; 2 | 3 | interface IMainCallback 4 | { 5 | void onStarted(); 6 | void onStopped(); 7 | void onError(String error); 8 | } 9 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/java/org/musicpd/MPDApplication.kt: -------------------------------------------------------------------------------- 1 | package org.musicpd 2 | 3 | import android.app.Application 4 | import dagger.hilt.android.HiltAndroidApp 5 | 6 | @HiltAndroidApp 7 | class MPDApplication : Application() { 8 | 9 | } -------------------------------------------------------------------------------- /android/app/src/main/jnilibs/.keepme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/jnilibs/.keepme -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/baseline_wifi_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/drawable/notification_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_banner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-hdpi/ic_banner.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-mdpi/ic_banner.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xhdpi/ic_banner.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xxhdpi/ic_banner.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xxxhdpi/ic_banner.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_banner_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | plugins { 3 | id("com.google.devtools.ksp") version "1.9.22-1.0.16" apply false 4 | alias(libs.plugins.android.application) apply false 5 | alias(libs.plugins.jetbrains.kotlin.android) apply false 6 | alias(libs.plugins.dagger.hilt.android) apply false 7 | } -------------------------------------------------------------------------------- /android/custom_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Dec 17 15:00:03 CST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /android/include/meson.build: -------------------------------------------------------------------------------- 1 | javac = find_program('javac') 2 | 3 | bridge_header = custom_target( 4 | 'org_musicpd_Bridge.h', 5 | output: 'org_musicpd_Bridge.h', 6 | input: [ 7 | '../app/src/main/java/org/musicpd/Bridge.java', 8 | ], 9 | command: [ 10 | javac, 11 | '-source', '1.8', '-target', '1.8', 12 | '-Xlint:-options', 13 | '-cp', join_paths(android_sdk_platform_dir, 'android.jar'), 14 | 15 | # not interested in *.class, we only want the JNI header 16 | '-d', '@PRIVATE_DIR@', 17 | 18 | '-h', '@OUTDIR@', 19 | '@INPUT@', 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /android/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | 16 | rootProject.name = "MPD" 17 | include(":app") 18 | -------------------------------------------------------------------------------- /build/pkg-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # This is a wrapper for pkg-config which helps with cross-compiling; 4 | # it sets up environment variables to pkg-config searches for 5 | # libraries in the sysroot where a copy of this script is located. 6 | 7 | BIN=`dirname $0` 8 | ROOT=`dirname "$BIN"` 9 | 10 | export PKG_CONFIG_DIR= 11 | export PKG_CONFIG_LIBDIR="${ROOT}/lib/pkgconfig:${ROOT}/share/pkgconfig" 12 | 13 | exec pkg-config "$@" 14 | -------------------------------------------------------------------------------- /doc/_static/css/custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * css to override sphinx theme 3 | */ -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | Music Player Daemon 2 | =================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | user 9 | plugins 10 | developer 11 | client 12 | protocol 13 | 14 | .. toctree:: 15 | :maxdepth: 1 16 | :caption: man pages: 17 | 18 | mpd.1 19 | mpd.conf.5 20 | 21 | Indices and tables 22 | ================== 23 | 24 | * :ref:`genindex` 25 | * :ref:`search` 26 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx-rtd-theme==2.0.0 2 | -------------------------------------------------------------------------------- /python/build/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/python/build/__init__.py -------------------------------------------------------------------------------- /python/build/dirs.py: -------------------------------------------------------------------------------- 1 | import os.path 2 | 3 | lib_path = os.path.abspath('lib') 4 | 5 | shared_path = lib_path 6 | if 'MPD_SHARED_LIB' in os.environ: 7 | shared_path = os.environ['MPD_SHARED_LIB'] 8 | tarball_path = os.path.join(shared_path, 'download') 9 | src_path = os.path.join(shared_path, 'src') 10 | -------------------------------------------------------------------------------- /python/build/quilt.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | from typing import Union 3 | 4 | from .toolchain import AnyToolchain 5 | 6 | def run_quilt(toolchain: AnyToolchain, cwd: str, patches_path: str, *args: str) -> None: 7 | env = dict(toolchain.env) 8 | env['QUILT_PATCHES'] = patches_path 9 | subprocess.check_call(['quilt'] + list(args), cwd=cwd, env=env) 10 | 11 | def push_all(toolchain: AnyToolchain, src_path: str, patches_path: str) -> None: 12 | run_quilt(toolchain, src_path, patches_path, 'push', '-a') 13 | -------------------------------------------------------------------------------- /src/GitVersion.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "GitVersion.hxx" 5 | 6 | const char GIT_VERSION[] = "@VCS_TAG@"; 7 | -------------------------------------------------------------------------------- /src/GitVersion.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_GIT_VERSION_HXX 5 | #define MPD_GIT_VERSION_HXX 6 | 7 | extern const char GIT_VERSION[]; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/Idle.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /* 5 | * Support library for the "idle" command. 6 | * 7 | */ 8 | 9 | #include "Idle.hxx" 10 | #include "Main.hxx" 11 | #include "Instance.hxx" 12 | 13 | #include 14 | 15 | void 16 | idle_add(unsigned flags) 17 | { 18 | assert(flags != 0); 19 | 20 | global_instance->EmitIdle(flags); 21 | } 22 | -------------------------------------------------------------------------------- /src/Idle.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /* 5 | * Support library for the "idle" command. 6 | * 7 | */ 8 | 9 | #ifndef MPD_IDLE_HXX 10 | #define MPD_IDLE_HXX 11 | 12 | #include "protocol/IdleFlags.hxx" 13 | 14 | /** 15 | * Adds idle flag (with bitwise "or") and queues notifications to all 16 | * clients. 17 | */ 18 | void 19 | idle_add(unsigned flags); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/Listen.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_LISTEN_HXX 5 | #define MPD_LISTEN_HXX 6 | 7 | struct ConfigData; 8 | class ClientListener; 9 | 10 | extern int listen_port; 11 | 12 | void 13 | listen_global_init(const ConfigData &config, ClientListener &listener); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/LogBackend.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_LOG_BACKEND_HXX 5 | #define MPD_LOG_BACKEND_HXX 6 | 7 | #include "LogLevel.hxx" 8 | 9 | void 10 | SetLogThreshold(LogLevel _threshold) noexcept; 11 | 12 | void 13 | EnableLogTimestamp() noexcept; 14 | 15 | void 16 | LogInitSysLog() noexcept; 17 | 18 | void 19 | LogFinishSysLog() noexcept; 20 | 21 | #endif /* LOG_H */ 22 | -------------------------------------------------------------------------------- /src/MusicChunkPtr.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "MusicChunkPtr.hxx" 5 | #include "MusicBuffer.hxx" 6 | 7 | void 8 | MusicChunkDeleter::operator()(MusicChunk *chunk) noexcept 9 | { 10 | buffer->Return(chunk); 11 | } 12 | -------------------------------------------------------------------------------- /src/PlaylistError.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "PlaylistError.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain playlist_domain("playlist"); 8 | -------------------------------------------------------------------------------- /src/RemoteTagCacheHandler.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_REMOTE_TAG_CACHE_HANDLER_HXX 5 | #define MPD_REMOTE_TAG_CACHE_HANDLER_HXX 6 | 7 | struct Tag; 8 | 9 | class RemoteTagCacheHandler { 10 | public: 11 | virtual void OnRemoteTag(const char *uri, const Tag &tag) noexcept = 0; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/Stats.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STATS_HXX 5 | #define MPD_STATS_HXX 6 | 7 | class Response; 8 | struct Partition; 9 | 10 | void 11 | stats_invalidate(); 12 | 13 | void 14 | stats_print(Response &r, const Partition &partition); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/TagAny.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_ANY_HXX 5 | #define MPD_TAG_ANY_HXX 6 | 7 | class Client; 8 | class TagHandler; 9 | 10 | /** 11 | * Scan tags in the song file specified by the given URI. The URI may 12 | * be relative to the music directory (the "client" parameter will be 13 | * used to obtain a handle to the #Storage) or absolute. 14 | * 15 | * Throws on error. 16 | */ 17 | void 18 | TagScanAny(Client &client, const char *uri, TagHandler &handler); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/TagSave.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_SAVE_HXX 5 | #define MPD_TAG_SAVE_HXX 6 | 7 | struct Tag; 8 | class BufferedOutputStream; 9 | 10 | void 11 | tag_save(BufferedOutputStream &os, const Tag &tag); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/TimePrint.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "TimePrint.hxx" 5 | #include "client/Response.hxx" 6 | #include "time/ISO8601.hxx" 7 | #include "util/StringBuffer.hxx" 8 | 9 | #include 10 | 11 | void 12 | time_print(Response &r, const char *name, 13 | std::chrono::system_clock::time_point t) 14 | { 15 | StringBuffer<64> s; 16 | 17 | try { 18 | s = FormatISO8601(t); 19 | } catch (...) { 20 | return; 21 | } 22 | 23 | r.Fmt("{}: {}\n", name, s.c_str()); 24 | } 25 | -------------------------------------------------------------------------------- /src/TimePrint.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TIME_PRINT_HXX 5 | #define MPD_TIME_PRINT_HXX 6 | 7 | #include 8 | 9 | class Response; 10 | 11 | /** 12 | * Write a line with a time stamp to the client. 13 | */ 14 | void 15 | time_print(Response &r, const char *name, 16 | std::chrono::system_clock::time_point t); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/android/LogListener.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ANDROID_LOG_LISTENER_HXX 5 | #define MPD_ANDROID_LOG_LISTENER_HXX 6 | 7 | #include "java/Object.hxx" 8 | 9 | class LogListener : public Java::GlobalObject { 10 | jmethodID onLogMethod; 11 | 12 | public: 13 | LogListener(JNIEnv *env, jobject obj) noexcept; 14 | 15 | void OnLog(JNIEnv *env, int priority, const char *msg) const noexcept; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/apple/AudioObject.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "AudioObject.hxx" 5 | #include "StringRef.hxx" 6 | 7 | Apple::StringRef 8 | AudioObjectGetStringProperty(AudioObjectID inObjectID, 9 | const AudioObjectPropertyAddress &inAddress) 10 | { 11 | auto s = AudioObjectGetPropertyDataT(inObjectID, 12 | inAddress); 13 | return Apple::StringRef(s); 14 | } 15 | -------------------------------------------------------------------------------- /src/apple/Throw.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef APPLE_THROW_HXX 5 | #define APPLE_THROW_HXX 6 | 7 | #include 8 | 9 | namespace Apple { 10 | 11 | void 12 | ThrowOSStatus(OSStatus status); 13 | 14 | void 15 | ThrowOSStatus(OSStatus status, const char *msg); 16 | 17 | } // namespace Apple 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/apple/meson.build: -------------------------------------------------------------------------------- 1 | if not is_darwin 2 | apple_dep = dependency('', required: false) 3 | subdir_done() 4 | endif 5 | 6 | audiounit_dep = declare_dependency( 7 | link_args: ['-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreServices'], 8 | ) 9 | 10 | apple = static_library( 11 | 'apple', 12 | 'AudioObject.cxx', 13 | 'Throw.cxx', 14 | include_directories: inc, 15 | dependencies: [ 16 | audiounit_dep, 17 | ], 18 | ) 19 | 20 | apple_dep = declare_dependency( 21 | link_with: apple, 22 | dependencies: [ 23 | audiounit_dep, 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /src/archive/ArchivePlugin.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "ArchivePlugin.hxx" 5 | #include "ArchiveFile.hxx" 6 | #include "fs/Path.hxx" 7 | 8 | #include 9 | 10 | std::unique_ptr 11 | archive_file_open(const ArchivePlugin *plugin, Path path) 12 | { 13 | assert(plugin != nullptr); 14 | assert(plugin->open != nullptr); 15 | assert(!path.IsNull()); 16 | 17 | return plugin->open(path); 18 | } 19 | -------------------------------------------------------------------------------- /src/archive/ArchiveVisitor.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ARCHIVE_VISITOR_HXX 5 | #define MPD_ARCHIVE_VISITOR_HXX 6 | 7 | class ArchiveVisitor { 8 | public: 9 | virtual void VisitArchiveEntry(const char *path_utf8) = 0; 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/archive/plugins/Bzip2ArchivePlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ARCHIVE_BZ2_HXX 5 | #define MPD_ARCHIVE_BZ2_HXX 6 | 7 | struct ArchivePlugin; 8 | 9 | extern const ArchivePlugin bz2_archive_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/archive/plugins/Iso9660ArchivePlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ARCHIVE_ISO9660_HXX 5 | #define MPD_ARCHIVE_ISO9660_HXX 6 | 7 | struct ArchivePlugin; 8 | 9 | extern const ArchivePlugin iso9660_archive_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/archive/plugins/ZzipArchivePlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ARCHIVE_ZZIP_HXX 5 | #define MPD_ARCHIVE_ZZIP_HXX 6 | 7 | struct ArchivePlugin; 8 | 9 | extern const ArchivePlugin zzip_archive_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/client/Config.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CLIENT_CONFIG_HXX 5 | #define MPD_CLIENT_CONFIG_HXX 6 | 7 | #include "event/Chrono.hxx" 8 | 9 | struct ConfigData; 10 | 11 | extern Event::Duration client_timeout; 12 | extern size_t client_max_command_list_size; 13 | extern size_t client_max_output_buffer_size; 14 | 15 | void 16 | client_manager_init(const ConfigData &config); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/client/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain client_domain("client"); 8 | -------------------------------------------------------------------------------- /src/client/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CLIENT_DOMAIN_HXX 5 | #define MPD_CLIENT_DOMAIN_HXX 6 | 7 | extern const class Domain client_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/client/Event.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Client.hxx" 5 | #include "Domain.hxx" 6 | #include "lib/fmt/ExceptionFormatter.hxx" 7 | #include "Log.hxx" 8 | 9 | void 10 | Client::OnSocketError(std::exception_ptr ep) noexcept 11 | { 12 | FmtError(client_domain, "[{}] error: {}", name, ep); 13 | 14 | SetExpired(); 15 | } 16 | 17 | void 18 | Client::OnSocketClosed() noexcept 19 | { 20 | SetExpired(); 21 | } 22 | -------------------------------------------------------------------------------- /src/client/List.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "List.hxx" 5 | #include "util/DeleteDisposer.hxx" 6 | 7 | #include 8 | 9 | ClientList::~ClientList() noexcept 10 | { 11 | list.clear_and_dispose(DeleteDisposer()); 12 | } 13 | 14 | void 15 | ClientList::Remove(Client &client) noexcept 16 | { 17 | assert(!list.empty()); 18 | 19 | list.erase(list.iterator_to(client)); 20 | } 21 | -------------------------------------------------------------------------------- /src/client/Message.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Message.hxx" 5 | #include "util/CharUtil.hxx" 6 | 7 | static constexpr bool 8 | valid_channel_char(const char ch) noexcept 9 | { 10 | return IsAlphaNumericASCII(ch) || 11 | ch == '_' || ch == '-' || ch == '.' || ch == ':'; 12 | } 13 | 14 | bool 15 | client_message_valid_channel_name(const char *name) noexcept 16 | { 17 | do { 18 | if (!valid_channel_char(*name)) 19 | return false; 20 | } while (*++name != 0); 21 | 22 | return true; 23 | } 24 | -------------------------------------------------------------------------------- /src/client/Write.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Client.hxx" 5 | 6 | #include 7 | 8 | bool 9 | Client::Write(const void *data, size_t length) noexcept 10 | { 11 | /* if the client is going to be closed, do nothing */ 12 | return !IsExpired() && FullyBufferedSocket::Write(data, length); 13 | } 14 | -------------------------------------------------------------------------------- /src/cmdline/meson.build: -------------------------------------------------------------------------------- 1 | cmdline = static_library( 2 | 'cmdline', 3 | 'OptionParser.cxx', 4 | include_directories: inc, 5 | dependencies: [ 6 | fmt_dep, 7 | ], 8 | ) 9 | 10 | cmdline_dep = declare_dependency( 11 | link_with: cmdline, 12 | ) 13 | -------------------------------------------------------------------------------- /src/command/AllCommands.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ALL_COMMANDS_HXX 5 | #define MPD_ALL_COMMANDS_HXX 6 | 7 | #include "CommandResult.hxx" 8 | 9 | class Client; 10 | 11 | void 12 | command_init() noexcept; 13 | 14 | CommandResult 15 | command_process(Client &client, unsigned num, char *line) noexcept; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/command/CommandError.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_COMMAND_ERROR_HXX 5 | #define MPD_COMMAND_ERROR_HXX 6 | 7 | #include 8 | 9 | class Response; 10 | 11 | /** 12 | * Send the exception to the client. 13 | */ 14 | void 15 | PrintError(Response &r, const std::exception_ptr& ep); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/command/CommandListBuilder.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "CommandListBuilder.hxx" 5 | #include "client/Config.hxx" 6 | 7 | #include 8 | 9 | void 10 | CommandListBuilder::Reset() 11 | { 12 | list.clear(); 13 | mode = Mode::DISABLED; 14 | } 15 | 16 | bool 17 | CommandListBuilder::Add(const char *cmd) 18 | { 19 | size_t len = strlen(cmd) + 1; 20 | size += len; 21 | if (size > client_max_command_list_size) 22 | return false; 23 | 24 | list.emplace_back(cmd); 25 | return true; 26 | } 27 | -------------------------------------------------------------------------------- /src/command/FingerprintCommands.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FINGERPRINT_COMMANDS_HXX 5 | #define MPD_FINGERPRINT_COMMANDS_HXX 6 | 7 | #include "CommandResult.hxx" 8 | 9 | class Client; 10 | class Request; 11 | class Response; 12 | 13 | CommandResult 14 | handle_getfingerprint(Client &client, Request request, Response &response); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/command/NeighborCommands.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NEIGHBOR_COMMANDS_HXX 5 | #define MPD_NEIGHBOR_COMMANDS_HXX 6 | 7 | #include "CommandResult.hxx" 8 | 9 | struct Instance; 10 | class Client; 11 | class Request; 12 | class Response; 13 | 14 | [[gnu::pure]] 15 | bool 16 | neighbor_commands_available(const Instance &instance) noexcept; 17 | 18 | CommandResult 19 | handle_listneighbors(Client &client, Request request, Response &response); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/command/PositionArg.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct playlist; 7 | struct RangeArg; 8 | 9 | /** 10 | * Throws #ProtocolError on error. 11 | */ 12 | unsigned 13 | ParseInsertPosition(const char *s, const playlist &playlist); 14 | 15 | unsigned 16 | ParseMoveDestination(const char *s, const RangeArg range, const playlist &p); 17 | -------------------------------------------------------------------------------- /src/command/TagCommands.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_COMMANDS_HXX 5 | #define MPD_TAG_COMMANDS_HXX 6 | 7 | #include "CommandResult.hxx" 8 | 9 | class Client; 10 | class Request; 11 | class Response; 12 | 13 | CommandResult 14 | handle_addtagid(Client &client, Request request, Response &response); 15 | 16 | CommandResult 17 | handle_cleartagid(Client &client, Request request, Response &response); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/config/Check.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CONFIG_CHECK_HXX 5 | #define MPD_CONFIG_CHECK_HXX 6 | 7 | struct ConfigData; 8 | 9 | /** 10 | * Call this function after all configuration has been evaluated. It 11 | * checks for unused parameters, and logs warnings. 12 | */ 13 | void 14 | Check(const ConfigData &config_data) noexcept; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/config/Defaults.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CONFIG_DEFAULTS_HXX 5 | #define MPD_CONFIG_DEFAULTS_HXX 6 | 7 | static constexpr bool DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS = false; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/config/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain config_domain("config"); 8 | -------------------------------------------------------------------------------- /src/config/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CONFIG_DOMAIN_HXX 5 | #define MPD_CONFIG_DOMAIN_HXX 6 | 7 | extern const class Domain config_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/config/File.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CONFIG_FILE_HXX 5 | #define MPD_CONFIG_FILE_HXX 6 | 7 | class Path; 8 | struct ConfigData; 9 | 10 | void 11 | ReadConfigFile(ConfigData &data, Path path); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/config/Migrate.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CONFIG_MIGRATE_HXX 5 | #define MPD_CONFIG_MIGRATE_HXX 6 | 7 | struct ConfigData; 8 | 9 | /** 10 | * Migrate deprecated #Config settings to new-style settings. 11 | */ 12 | void 13 | Migrate(ConfigData &config) noexcept; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/config/PartitionConfig.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "QueueConfig.hxx" 7 | #include "PlayerConfig.hxx" 8 | 9 | struct PartitionConfig { 10 | QueueConfig queue; 11 | PlayerConfig player; 12 | 13 | PartitionConfig() = default; 14 | 15 | explicit PartitionConfig(const ConfigData &config); 16 | }; 17 | -------------------------------------------------------------------------------- /src/config/Path.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include 5 | 6 | struct ConfigData; 7 | class AllocatedPath; 8 | 9 | void 10 | InitPathParser(const ConfigData &config) noexcept; 11 | 12 | /** 13 | * Throws #std::runtime_error on error. 14 | */ 15 | AllocatedPath 16 | ParsePath(std::string_view path); 17 | -------------------------------------------------------------------------------- /src/config/QueueConfig.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct QueueConfig { 7 | static constexpr unsigned DEFAULT_MAX_LENGTH = 16 * 1024; 8 | static constexpr unsigned MAX_MAX_LENGTH = 16 * 1024 * 1024; 9 | 10 | unsigned max_length = DEFAULT_MAX_LENGTH; 11 | }; 12 | -------------------------------------------------------------------------------- /src/config/ReplayGainConfig.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct ConfigData; 7 | 8 | struct ReplayGainConfig { 9 | static constexpr bool DEFAULT_LIMIT = true; 10 | 11 | float preamp = 1.0; 12 | 13 | float missing_preamp = 1.0; 14 | 15 | bool limit = DEFAULT_LIMIT; 16 | 17 | ReplayGainConfig() = default; 18 | 19 | explicit ReplayGainConfig(const ConfigData &config); 20 | }; 21 | -------------------------------------------------------------------------------- /src/config/meson.build: -------------------------------------------------------------------------------- 1 | config = static_library( 2 | 'fs', 3 | 'Path.cxx', 4 | 'Check.cxx', 5 | 'Data.cxx', 6 | 'Block.cxx', 7 | 'Param.cxx', 8 | 'Parser.cxx', 9 | 'File.cxx', 10 | 'Migrate.cxx', 11 | 'Templates.cxx', 12 | 'Domain.cxx', 13 | 'Net.cxx', 14 | include_directories: inc, 15 | dependencies: [ 16 | log_dep, 17 | fmt_dep, 18 | fs_dep, 19 | fs_glue_dep, 20 | io_fs_dep, 21 | ], 22 | ) 23 | 24 | config_dep = declare_dependency( 25 | link_with: config, 26 | dependencies: [ 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /src/db/Count.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DB_COUNT_HXX 5 | #define MPD_DB_COUNT_HXX 6 | 7 | #include 8 | 9 | enum TagType : uint8_t; 10 | struct Partition; 11 | class Response; 12 | class SongFilter; 13 | 14 | void 15 | PrintSongCount(Response &r, const Partition &partition, const char *name, 16 | const SongFilter *filter, 17 | TagType group); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/db/DatabaseLock.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "DatabaseLock.hxx" 5 | 6 | Mutex db_mutex; 7 | 8 | #ifndef NDEBUG 9 | ThreadId db_mutex_holder; 10 | #endif 11 | -------------------------------------------------------------------------------- /src/db/DatabaseQueue.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DATABASE_QUEUE_HXX 5 | #define MPD_DATABASE_QUEUE_HXX 6 | 7 | struct Partition; 8 | struct DatabaseSelection; 9 | 10 | void 11 | AddFromDatabase(Partition &partition, const DatabaseSelection &selection); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/db/Helpers.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DATABASE_HELPERS_HXX 5 | #define MPD_DATABASE_HELPERS_HXX 6 | 7 | class Database; 8 | struct DatabaseSelection; 9 | struct DatabaseStats; 10 | 11 | DatabaseStats 12 | GetStats(const Database &db, const DatabaseSelection &selection); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/db/Ptr.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DATABASE_PTR_HXX 5 | #define MPD_DATABASE_PTR_HXX 6 | 7 | #include 8 | 9 | class Database; 10 | 11 | typedef std::unique_ptr DatabasePtr; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/db/Registry.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DATABASE_REGISTRY_HXX 5 | #define MPD_DATABASE_REGISTRY_HXX 6 | 7 | struct DatabasePlugin; 8 | 9 | /** 10 | * nullptr terminated list of all database plugins which were enabled at 11 | * compile time. 12 | */ 13 | extern const DatabasePlugin *const database_plugins[]; 14 | 15 | [[gnu::pure]] 16 | const DatabasePlugin * 17 | GetDatabasePluginByName(const char *name) noexcept; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/db/Uri.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DB_URI_HXX 5 | #define MPD_DB_URI_HXX 6 | 7 | #include 8 | 9 | static inline bool 10 | isRootDirectory(std::string_view name) noexcept 11 | { 12 | return name.empty() || (name.size() == 1 && name.front() == '/'); 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/db/plugins/ProxyDatabasePlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PROXY_DATABASE_PLUGIN_HXX 5 | #define MPD_PROXY_DATABASE_PLUGIN_HXX 6 | 7 | struct DatabasePlugin; 8 | 9 | extern const DatabasePlugin proxy_db_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/db/plugins/simple/DirectorySave.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DIRECTORY_SAVE_HXX 5 | #define MPD_DIRECTORY_SAVE_HXX 6 | 7 | struct Directory; 8 | class LineReader; 9 | class BufferedOutputStream; 10 | 11 | void 12 | directory_save(BufferedOutputStream &os, const Directory &directory); 13 | 14 | /** 15 | * Throws #std::runtime_error on error. 16 | */ 17 | void 18 | directory_load(LineReader &file, Directory &directory); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/db/plugins/simple/Ptr.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SONG_PTR_HXX 5 | #define MPD_SONG_PTR_HXX 6 | 7 | #include 8 | 9 | struct Song; 10 | 11 | using SongPtr = std::unique_ptr; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/db/plugins/simple/SongSort.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SONG_SORT_HXX 5 | #define MPD_SONG_SORT_HXX 6 | 7 | #include "util/IntrusiveList.hxx" 8 | 9 | struct Song; 10 | 11 | void 12 | song_list_sort(IntrusiveList &songs) noexcept; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/db/plugins/upnp/Object.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Object.hxx" 5 | 6 | /* this destructor exists here just so it won't get inlined */ 7 | UPnPDirObject::~UPnPDirObject() noexcept = default; 8 | -------------------------------------------------------------------------------- /src/db/plugins/upnp/Tags.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Tags.hxx" 5 | #include "tag/Table.hxx" 6 | 7 | const struct tag_table upnp_tags[] = { 8 | { "upnp:artist", TAG_ARTIST }, 9 | { "upnp:album", TAG_ALBUM }, 10 | { "upnp:originalTrackNumber", TAG_TRACK }, 11 | { "upnp:genre", TAG_GENRE }, 12 | { "dc:title", TAG_TITLE }, 13 | 14 | /* sentinel */ 15 | { nullptr, TAG_NUM_OF_ITEM_TYPES } 16 | }; 17 | -------------------------------------------------------------------------------- /src/db/plugins/upnp/Tags.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_UPNP_TAGS_HXX 5 | #define MPD_UPNP_TAGS_HXX 6 | 7 | /** 8 | * Map UPnP property names to MPD tags. 9 | */ 10 | extern const struct tag_table upnp_tags[]; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/db/plugins/upnp/UpnpDatabasePlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_UPNP_DATABASE_PLUGIN_HXX 5 | #define MPD_UPNP_DATABASE_PLUGIN_HXX 6 | 7 | struct DatabasePlugin; 8 | 9 | extern const DatabasePlugin upnp_db_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/db/update/InotifyDomain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "InotifyDomain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain inotify_domain("inotify"); 8 | -------------------------------------------------------------------------------- /src/db/update/InotifyDomain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INOTIFY_DOMAIN_HXX 5 | #define MPD_INOTIFY_DOMAIN_HXX 6 | 7 | extern const class Domain inotify_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/db/update/UpdateDomain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "UpdateDomain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain update_domain("update"); 8 | -------------------------------------------------------------------------------- /src/db/update/UpdateDomain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_UPDATE_DOMAIN_HXX 5 | #define MPD_UPDATE_DOMAIN_HXX 6 | 7 | extern const class Domain update_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/Command.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_COMMAND_HXX 5 | #define MPD_DECODER_COMMAND_HXX 6 | 7 | #include 8 | 9 | enum class DecoderCommand : uint8_t { 10 | NONE = 0, 11 | START, 12 | STOP, 13 | SEEK 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/decoder/DecoderPrint.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_PRINT_HXX 5 | #define MPD_DECODER_PRINT_HXX 6 | 7 | class Response; 8 | 9 | void 10 | decoder_list_print(Response &r); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/decoder/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain decoder_domain("decoder"); 8 | -------------------------------------------------------------------------------- /src/decoder/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_DOMAIN_HXX 5 | #define MPD_DECODER_DOMAIN_HXX 6 | 7 | extern const class Domain decoder_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/Reader.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Reader.hxx" 5 | #include "DecoderAPI.hxx" 6 | 7 | std::size_t 8 | DecoderReader::Read(std::span dest) 9 | { 10 | return decoder_read(client, is, dest); 11 | } 12 | -------------------------------------------------------------------------------- /src/decoder/plugins/AdPlugDecoderPlugin.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_ADPLUG_H 5 | #define MPD_DECODER_ADPLUG_H 6 | 7 | extern const struct DecoderPlugin adplug_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/AudiofileDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_AUDIOFILE_HXX 5 | #define MPD_DECODER_AUDIOFILE_HXX 6 | 7 | extern const struct DecoderPlugin audiofile_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/DsdiffDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_DSDIFF_H 5 | #define MPD_DECODER_DSDIFF_H 6 | 7 | extern const struct DecoderPlugin dsdiff_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/DsfDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_DSF_H 5 | #define MPD_DECODER_DSF_H 6 | 7 | extern const struct DecoderPlugin dsf_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/FaadDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FAAD_DECODER_PLUGIN_HXX 5 | #define MPD_FAAD_DECODER_PLUGIN_HXX 6 | 7 | extern const struct DecoderPlugin faad_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/FfmpegDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_FFMPEG_HXX 5 | #define MPD_DECODER_FFMPEG_HXX 6 | 7 | extern const struct DecoderPlugin ffmpeg_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/FfmpegMetaData.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_METADATA_HXX 5 | #define MPD_FFMPEG_METADATA_HXX 6 | 7 | struct AVDictionary; 8 | class TagHandler; 9 | 10 | void 11 | FfmpegScanDictionary(AVDictionary *dict, TagHandler &handler) noexcept; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/decoder/plugins/FlacDecoderPlugin.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_FLAC_H 5 | #define MPD_DECODER_FLAC_H 6 | 7 | extern const struct DecoderPlugin flac_decoder_plugin; 8 | extern const struct DecoderPlugin oggflac_decoder_plugin; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/decoder/plugins/FlacDomain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "FlacDomain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain flac_domain("flac"); 8 | -------------------------------------------------------------------------------- /src/decoder/plugins/FlacDomain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FLAC_DOMAIN_HXX 5 | #define MPD_FLAC_DOMAIN_HXX 6 | 7 | extern const class Domain flac_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/FluidsynthDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_FLUIDSYNTH_HXX 5 | #define MPD_DECODER_FLUIDSYNTH_HXX 6 | 7 | extern const struct DecoderPlugin fluidsynth_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/GmeDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_GME_HXX 5 | #define MPD_DECODER_GME_HXX 6 | 7 | extern const struct DecoderPlugin gme_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/MadDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_MAD_HXX 5 | #define MPD_DECODER_MAD_HXX 6 | 7 | extern const struct DecoderPlugin mad_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/MikmodDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_MIKMOD_HXX 5 | #define MPD_DECODER_MIKMOD_HXX 6 | 7 | extern const struct DecoderPlugin mikmod_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/ModCommon.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_MOD_COMMON_HXX 5 | #define MPD_MOD_COMMON_HXX 6 | 7 | #include "../DecoderAPI.hxx" 8 | #include "input/InputStream.hxx" 9 | #include "util/AllocatedArray.hxx" 10 | #include "util/Domain.hxx" 11 | 12 | AllocatedArray mod_loadfile(const Domain *domain, DecoderClient *client, InputStream &is); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/decoder/plugins/ModplugDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_MODPLUG_HXX 5 | #define MPD_DECODER_MODPLUG_HXX 6 | 7 | extern const struct DecoderPlugin modplug_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/MpcdecDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_MPCDEC_HXX 5 | #define MPD_DECODER_MPCDEC_HXX 6 | 7 | extern const struct DecoderPlugin mpcdec_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/Mpg123DecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_MPG123_HXX 5 | #define MPD_DECODER_MPG123_HXX 6 | 7 | extern const struct DecoderPlugin mpg123_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/OggCodec.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /* 5 | * Common functions used for Ogg data streams (Ogg-Vorbis and OggFLAC) 6 | */ 7 | 8 | #ifndef MPD_OGG_CODEC_HXX 9 | #define MPD_OGG_CODEC_HXX 10 | 11 | class DecoderClient; 12 | class InputStream; 13 | 14 | enum ogg_codec { 15 | OGG_CODEC_UNKNOWN, 16 | OGG_CODEC_VORBIS, 17 | OGG_CODEC_FLAC, 18 | OGG_CODEC_OPUS, 19 | }; 20 | 21 | enum ogg_codec 22 | ogg_codec_detect(DecoderClient *client, InputStream &is); 23 | 24 | #endif /* _OGG_COMMON_H */ 25 | -------------------------------------------------------------------------------- /src/decoder/plugins/OpenmptDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_OPENMPT_HXX 5 | #define MPD_DECODER_OPENMPT_HXX 6 | 7 | extern const struct DecoderPlugin openmpt_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/OpusDecoderPlugin.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_OPUS_H 5 | #define MPD_DECODER_OPUS_H 6 | 7 | extern const struct DecoderPlugin opus_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/OpusDomain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "OpusDomain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain opus_domain("opus"); 8 | -------------------------------------------------------------------------------- /src/decoder/plugins/OpusDomain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OPUS_DOMAIN_HXX 5 | #define MPD_OPUS_DOMAIN_HXX 6 | 7 | extern const class Domain opus_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/OpusHead.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OPUS_HEAD_HXX 5 | #define MPD_OPUS_HEAD_HXX 6 | 7 | #include 8 | 9 | bool 10 | ScanOpusHeader(const void *data, size_t size, unsigned &channels_r, 11 | signed &output_gain_r, unsigned &pre_skip_r); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/decoder/plugins/OpusTags.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OPUS_TAGS_HXX 5 | #define MPD_OPUS_TAGS_HXX 6 | 7 | #include 8 | 9 | struct ReplayGainInfo; 10 | class TagHandler; 11 | 12 | bool 13 | ScanOpusTags(const void *data, size_t size, 14 | ReplayGainInfo *rgi, 15 | TagHandler &handler) noexcept; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/decoder/plugins/PcmDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /** \file 5 | * 6 | * Not really a decoder; this plugin forwards its input data "as-is". 7 | * 8 | * It was written only to support the "cdio_paranoia" input plugin, 9 | * which does not need a decoder. 10 | */ 11 | 12 | #ifndef MPD_DECODER_PCM_HXX 13 | #define MPD_DECODER_PCM_HXX 14 | 15 | extern const struct DecoderPlugin pcm_decoder_plugin; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/decoder/plugins/SidplayDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_SIDPLAY_HXX 5 | #define MPD_DECODER_SIDPLAY_HXX 6 | 7 | extern const struct DecoderPlugin sidplay_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/SndfileDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_SNDFILE_HXX 5 | #define MPD_DECODER_SNDFILE_HXX 6 | 7 | extern const struct DecoderPlugin sndfile_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/VgmstreamDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_VGMSTREAM_HXX 5 | #define MPD_DECODER_VGMSTREAM_HXX 6 | 7 | extern const struct DecoderPlugin vgmstream_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/VorbisDecoderPlugin.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_VORBIS_H 5 | #define MPD_DECODER_VORBIS_H 6 | 7 | extern const struct DecoderPlugin vorbis_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/VorbisDomain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "VorbisDomain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain vorbis_domain("vorbis"); 8 | -------------------------------------------------------------------------------- /src/decoder/plugins/VorbisDomain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_VORBIS_DOMAIN_HXX 5 | #define MPD_VORBIS_DOMAIN_HXX 6 | 7 | class Domain; 8 | 9 | extern const Domain vorbis_domain; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/decoder/plugins/WavpackDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_WAVPACK_HXX 5 | #define MPD_DECODER_WAVPACK_HXX 6 | 7 | extern const struct DecoderPlugin wavpack_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/decoder/plugins/WildmidiDecoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_DECODER_WILDMIDI_HXX 5 | #define MPD_DECODER_WILDMIDI_HXX 6 | 7 | extern const struct DecoderPlugin wildmidi_decoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/EncoderAPI.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /* 5 | * This header is included by encoder plugins. 6 | * 7 | */ 8 | 9 | #ifndef MPD_ENCODER_API_HXX 10 | #define MPD_ENCODER_API_HXX 11 | 12 | // IWYU pragma: begin_exports 13 | 14 | #include "EncoderInterface.hxx" 15 | #include "EncoderPlugin.hxx" 16 | #include "pcm/AudioFormat.hxx" 17 | #include "tag/Tag.hxx" 18 | #include "config/Block.hxx" 19 | 20 | // IWYU pragma: end_exports 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/encoder/ToOutputStream.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "ToOutputStream.hxx" 5 | #include "EncoderInterface.hxx" 6 | #include "io/OutputStream.hxx" 7 | 8 | void 9 | EncoderToOutputStream(OutputStream &os, Encoder &encoder) 10 | { 11 | while (true) { 12 | /* read from the encoder */ 13 | 14 | std::byte buffer[32768]; 15 | const auto r = encoder.Read(buffer); 16 | if (r.empty()) 17 | return; 18 | 19 | /* write everything to the stream */ 20 | 21 | os.Write(r); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/encoder/ToOutputStream.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | class OutputStream; 7 | class Encoder; 8 | 9 | /** 10 | * Read all available output from the #Encoder and write it to the 11 | * #OutputStream. 12 | * 13 | * Throws on error. 14 | */ 15 | void 16 | EncoderToOutputStream(OutputStream &os, Encoder &encoder); 17 | -------------------------------------------------------------------------------- /src/encoder/plugins/FlacEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_FLAC_HXX 5 | #define MPD_ENCODER_FLAC_HXX 6 | 7 | extern const struct EncoderPlugin flac_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/LameEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_LAME_HXX 5 | #define MPD_ENCODER_LAME_HXX 6 | 7 | extern const struct EncoderPlugin lame_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/NullEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_NULL_HXX 5 | #define MPD_ENCODER_NULL_HXX 6 | 7 | extern const struct EncoderPlugin null_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/OpusEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_OPUS_H 5 | #define MPD_ENCODER_OPUS_H 6 | 7 | extern const struct EncoderPlugin opus_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/ShineEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_SHINE_HXX 5 | #define MPD_ENCODER_SHINE_HXX 6 | 7 | extern const struct EncoderPlugin shine_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/TwolameEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_TWOLAME_HXX 5 | #define MPD_ENCODER_TWOLAME_HXX 6 | 7 | extern const struct EncoderPlugin twolame_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/VorbisEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_VORBIS_H 5 | #define MPD_ENCODER_VORBIS_H 6 | 7 | extern const struct EncoderPlugin vorbis_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/encoder/plugins/WaveEncoderPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ENCODER_WAVE_HXX 5 | #define MPD_ENCODER_WAVE_HXX 6 | 7 | extern const struct EncoderPlugin wave_encoder_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/event/Backend.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef EVENT_BACKEND_HXX 5 | #define EVENT_BACKEND_HXX 6 | 7 | #include "event/Features.h" 8 | 9 | #ifdef _WIN32 10 | 11 | #include "WinSelectBackend.hxx" 12 | using EventPollBackend = WinSelectBackend; 13 | 14 | #elif defined(USE_EPOLL) 15 | 16 | #include "EpollBackend.hxx" 17 | using EventPollBackend = EpollBackend; 18 | 19 | #else 20 | 21 | #include "PollBackend.hxx" 22 | using EventPollBackend = PollBackend; 23 | 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/event/BackendEvents.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | 3 | #pragma once 4 | 5 | #include "event/Features.h" 6 | 7 | #ifdef _WIN32 8 | 9 | #include "WinSelectEvents.hxx" 10 | using EventPollBackendEvents = WinSelectEvents; 11 | 12 | #elif defined(USE_EPOLL) 13 | 14 | #include "EpollEvents.hxx" 15 | using EventPollBackendEvents = EpollEvents; 16 | 17 | #else 18 | 19 | #include "PollEvents.hxx" 20 | using EventPollBackendEvents = PollEvents; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/event/Call.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | class EventLoop; 9 | 10 | /** 11 | * Call the given function in the context of the #EventLoop, and wait 12 | * for it to finish. 13 | * 14 | * Exceptions thrown by the given function will be rethrown. 15 | */ 16 | void 17 | BlockingCall(EventLoop &loop, std::function &&f); 18 | -------------------------------------------------------------------------------- /src/event/Chrono.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace Event { 9 | 10 | /** 11 | * The clock used by classes #EventLoop, #CoarseTimerEvent and #FineTimerEvent. 12 | */ 13 | using Clock = std::chrono::steady_clock; 14 | 15 | using Duration = Clock::duration; 16 | using TimePoint = Clock::time_point; 17 | 18 | } // namespace Event 19 | -------------------------------------------------------------------------------- /src/event/InjectEvent.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "InjectEvent.hxx" 5 | #include "Loop.hxx" 6 | 7 | void 8 | InjectEvent::Cancel() noexcept 9 | { 10 | loop.RemoveInject(*this); 11 | } 12 | 13 | void 14 | InjectEvent::Schedule() noexcept 15 | { 16 | loop.AddInject(*this); 17 | } 18 | -------------------------------------------------------------------------------- /src/event/MaskMonitor.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "MaskMonitor.hxx" 5 | 6 | void 7 | MaskMonitor::OrMask(unsigned new_mask) noexcept 8 | { 9 | if (pending_mask.fetch_or(new_mask) == 0) 10 | event.Schedule(); 11 | } 12 | 13 | void 14 | MaskMonitor::RunDeferred() noexcept 15 | { 16 | const unsigned mask = pending_mask.exchange(0); 17 | if (mask != 0) 18 | callback(mask); 19 | } 20 | -------------------------------------------------------------------------------- /src/event/uring/Manager.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include "io/uring/Queue.hxx" 8 | 9 | namespace Uring { 10 | 11 | class Manager final : public Queue { 12 | public: 13 | using Queue::Queue; 14 | 15 | // virtual methods from class Uring::Queue 16 | void Submit() override { 17 | /* this will be done by EventLoop::Run() */ 18 | } 19 | }; 20 | 21 | } // namespace Uring 22 | -------------------------------------------------------------------------------- /src/filter/Factory.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FILTER_FACTORY_HXX 5 | #define MPD_FILTER_FACTORY_HXX 6 | 7 | #include 8 | 9 | struct ConfigData; 10 | class PreparedFilter; 11 | 12 | class FilterFactory { 13 | const ConfigData &config; 14 | 15 | public: 16 | explicit FilterFactory(const ConfigData &_config) noexcept 17 | :config(_config) {} 18 | 19 | std::unique_ptr MakeFilter(const char *name); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/filter/NullFilter.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NULL_FILTER_HXX 5 | #define MPD_NULL_FILTER_HXX 6 | 7 | #include "filter/Filter.hxx" 8 | 9 | class NullFilter final : public Filter { 10 | public: 11 | explicit NullFilter(const AudioFormat &af):Filter(af) {} 12 | 13 | std::span FilterPCM(std::span src) override { 14 | return src; 15 | } 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/filter/Registry.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /** \file 5 | * 6 | * This library manages all filter plugins which are enabled at 7 | * compile time. 8 | */ 9 | 10 | #ifndef MPD_FILTER_REGISTRY_HXX 11 | #define MPD_FILTER_REGISTRY_HXX 12 | 13 | struct FilterPlugin; 14 | 15 | [[gnu::pure]] 16 | const FilterPlugin * 17 | filter_plugin_by_name(const char *name) noexcept; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/filter/plugins/FfmpegFilterPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_FILTER_PLUGIN_HXX 5 | #define MPD_FFMPEG_FILTER_PLUGIN_HXX 6 | 7 | struct FilterPlugin; 8 | 9 | extern const FilterPlugin ffmpeg_filter_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/filter/plugins/HdcdFilterPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_HDCD_FILTER_PLUGIN_HXX 5 | #define MPD_HDCD_FILTER_PLUGIN_HXX 6 | 7 | struct FilterPlugin; 8 | 9 | extern const FilterPlugin hdcd_filter_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/filter/plugins/NormalizeFilterPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NORMALIZE_FILTER_PLUGIN_HXX 5 | #define MPD_NORMALIZE_FILTER_PLUGIN_HXX 6 | 7 | #include 8 | 9 | struct FilterPlugin; 10 | class PreparedFilter; 11 | 12 | extern const FilterPlugin normalize_filter_plugin; 13 | 14 | std::unique_ptr 15 | normalize_filter_prepare() noexcept; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/filter/plugins/NullFilterPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NULL_FILTER_PLUGIN_HXX 5 | #define MPD_NULL_FILTER_PLUGIN_HXX 6 | 7 | struct FilterPlugin; 8 | 9 | extern const FilterPlugin null_filter_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/filter/plugins/RouteFilterPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ROUTE_FILTER_PLUGIN_HXX 5 | #define MPD_ROUTE_FILTER_PLUGIN_HXX 6 | 7 | struct FilterPlugin; 8 | 9 | extern const FilterPlugin route_filter_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/filter/plugins/VolumeFilterPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_VOLUME_FILTER_PLUGIN_HXX 5 | #define MPD_VOLUME_FILTER_PLUGIN_HXX 6 | 7 | #include 8 | 9 | class PreparedFilter; 10 | class Filter; 11 | 12 | std::unique_ptr 13 | volume_filter_prepare() noexcept; 14 | 15 | unsigned 16 | volume_filter_get(const Filter *filter) noexcept; 17 | 18 | void 19 | volume_filter_set(Filter *filter, unsigned volume) noexcept; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/fs/Config.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FS_CONFIG_HXX 5 | #define MPD_FS_CONFIG_HXX 6 | 7 | struct ConfigData; 8 | 9 | /** 10 | * Performs global one-time initialization of this class. 11 | * 12 | * Throws std::runtime_error on error. 13 | */ 14 | void 15 | ConfigureFS(const ConfigData &config); 16 | 17 | void 18 | DeinitFS() noexcept; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/fs/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain path_domain("path"); 8 | -------------------------------------------------------------------------------- /src/fs/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FS_DOMAIN_HXX 5 | #define MPD_FS_DOMAIN_HXX 6 | 7 | extern const class Domain path_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/fs/Features.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "lib/icu/Features.h" // for HAVE_ICU, HAVE_ICONV 7 | 8 | #if (defined(HAVE_ICU) || defined(HAVE_ICONV)) && !defined(_WIN32) 9 | #define HAVE_FS_CHARSET 10 | #endif 11 | 12 | #if !defined(HAVE_FS_CHARSET) && !defined(_WIN32) 13 | /** 14 | * Is the filesystem character set hard-coded to UTF-8? 15 | */ 16 | #define FS_CHARSET_ALWAYS_UTF8 17 | #endif 18 | -------------------------------------------------------------------------------- /src/fs/Glob.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifdef _WIN32 5 | // COM needs the "MSG" typedef, and shlwapi.h includes COM headers 6 | #undef NOUSER 7 | #endif 8 | 9 | #include "Glob.hxx" 10 | 11 | #ifdef _WIN32 12 | #include 13 | 14 | bool 15 | Glob::Check(const char *name_fs) const noexcept 16 | { 17 | return PathMatchSpecA(name_fs, pattern.c_str()); 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/fs/Limits.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FS_LIMITS_HXX 5 | #define MPD_FS_LIMITS_HXX 6 | 7 | #include 8 | #include 9 | 10 | #if defined(_WIN32) 11 | static constexpr size_t MPD_PATH_MAX = 260; 12 | #elif defined(MAXPATHLEN) 13 | static constexpr size_t MPD_PATH_MAX = MAXPATHLEN; 14 | #elif defined(PATH_MAX) 15 | static constexpr size_t MPD_PATH_MAX = PATH_MAX; 16 | #else 17 | static constexpr size_t MPD_PATH_MAX = 256; 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/fs/List.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FS_LIST_XX 5 | #define MPD_FS_LIST_XX 6 | 7 | #include 8 | 9 | class Path; 10 | class AllocatedPath; 11 | 12 | /** 13 | * Returns a sorted list of files matching the given pattern. 14 | * 15 | * Throws on error. 16 | */ 17 | std::forward_list 18 | ListWildcard(Path pattern); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/fs/XDG.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FS_XDG_HXX 5 | #define MPD_FS_XDG_HXX 6 | 7 | // Use X Desktop guidelines where applicable 8 | #if !defined(__APPLE__) && !defined(_WIN32) && !defined(ANDROID) 9 | #define USE_XDG 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/fs/glue/CheckFile.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | class Path; 7 | 8 | /** 9 | * Check whether the directory is readable and usable. Logs a warning 10 | * if there is a problem. 11 | */ 12 | void 13 | CheckDirectoryReadable(Path path_fs); 14 | -------------------------------------------------------------------------------- /src/fs/glue/meson.build: -------------------------------------------------------------------------------- 1 | fs_glue = static_library( 2 | 'fs_glue', 3 | 'StandardDirectory.cxx', 4 | 'CheckFile.cxx', 5 | include_directories: inc, 6 | dependencies: [ 7 | fs_dep, 8 | io_dep, 9 | fmt_dep, 10 | log_dep, 11 | util_dep, 12 | ], 13 | ) 14 | 15 | fs_glue_dep = declare_dependency( 16 | link_with: fs_glue, 17 | ) 18 | -------------------------------------------------------------------------------- /src/input/Error.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef INPUT_ERROR_HXX 5 | #define INPUT_ERROR_HXX 6 | 7 | #include 8 | 9 | /** 10 | * Was this exception thrown because the requested file does not 11 | * exist? This function attempts to recognize exceptions thrown by 12 | * various input plugins. 13 | */ 14 | [[gnu::pure]] 15 | bool 16 | IsFileNotFound(std::exception_ptr e) noexcept; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/input/LocalOpen.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_LOCAL_OPEN_HXX 5 | #define MPD_INPUT_LOCAL_OPEN_HXX 6 | 7 | #include "Ptr.hxx" 8 | #include "thread/Mutex.hxx" 9 | 10 | class Path; 11 | 12 | /** 13 | * Open a "local" file. This is a wrapper for the input plugins 14 | * "file" and "archive". 15 | * 16 | * Throws std::runtime_error on error. 17 | */ 18 | InputStreamPtr 19 | OpenLocalInputStream(Path path, Mutex &mutex); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/input/Offset.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | /** 9 | * A type for absolute offsets in a file. 10 | */ 11 | typedef uint64_t offset_type; 12 | -------------------------------------------------------------------------------- /src/input/Ptr.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_STREAM_PTR_HXX 5 | #define MPD_INPUT_STREAM_PTR_HXX 6 | 7 | #include 8 | 9 | class InputStream; 10 | 11 | typedef std::unique_ptr InputStreamPtr; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/input/Reader.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Reader.hxx" 5 | #include "InputStream.hxx" 6 | 7 | std::size_t 8 | InputStreamReader::Read(std::span dest) 9 | { 10 | size_t nbytes = is.LockRead(dest); 11 | assert(nbytes > 0 || is.IsEOF()); 12 | 13 | return nbytes; 14 | } 15 | -------------------------------------------------------------------------------- /src/input/RewindInputStream.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /** \file 5 | * 6 | * A wrapper for an input_stream object which allows cheap buffered 7 | * rewinding. This is useful while detecting the stream codec (let 8 | * each decoder plugin peek a portion from the stream). 9 | */ 10 | 11 | #ifndef MPD_REWIND_INPUT_STREAM_HXX 12 | #define MPD_REWIND_INPUT_STREAM_HXX 13 | 14 | #include "Ptr.hxx" 15 | 16 | InputStreamPtr 17 | input_rewind_open(InputStreamPtr is); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/input/WaitReady.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "thread/Mutex.hxx" 7 | 8 | class InputStream; 9 | 10 | void 11 | WaitReady(InputStream &is, std::unique_lock &lock); 12 | 13 | void 14 | LockWaitReady(InputStream &is); 15 | -------------------------------------------------------------------------------- /src/input/cache/Config.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_CACHE_CONFIG_HXX 5 | #define MPD_INPUT_CACHE_CONFIG_HXX 6 | 7 | #include 8 | 9 | struct ConfigBlock; 10 | 11 | struct InputCacheConfig { 12 | size_t size; 13 | 14 | explicit InputCacheConfig(const ConfigBlock &block); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/input/plugins/AlsaInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ALSA_INPUT_PLUGIN_HXX 5 | #define MPD_ALSA_INPUT_PLUGIN_HXX 6 | 7 | #include "../InputPlugin.hxx" 8 | 9 | extern const struct InputPlugin input_plugin_alsa; 10 | 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/input/plugins/ArchiveInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_ARCHIVE_HXX 5 | #define MPD_INPUT_ARCHIVE_HXX 6 | 7 | #include "input/Ptr.hxx" 8 | #include "thread/Mutex.hxx" 9 | 10 | class Path; 11 | 12 | InputStreamPtr 13 | OpenArchiveInputStream(Path path, Mutex &mutex); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/input/plugins/CdioParanoiaInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CDIO_PARANOIA_INPUT_PLUGIN_HXX 5 | #define MPD_CDIO_PARANOIA_INPUT_PLUGIN_HXX 6 | 7 | /** 8 | * An input plugin based on libcdio_paranoia library. 9 | */ 10 | extern const struct InputPlugin input_plugin_cdio_paranoia; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/input/plugins/FfmpegInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_INPUT_PLUGIN_HXX 5 | #define MPD_FFMPEG_INPUT_PLUGIN_HXX 6 | 7 | /** 8 | * An input plugin based on libavformat's "avio" library. 9 | */ 10 | extern const struct InputPlugin input_plugin_ffmpeg; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/input/plugins/FileInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_FILE_HXX 5 | #define MPD_INPUT_FILE_HXX 6 | 7 | #include "input/Ptr.hxx" 8 | #include "thread/Mutex.hxx" 9 | 10 | class Path; 11 | 12 | InputStreamPtr 13 | OpenFileInputStream(Path path, Mutex &mutex); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/input/plugins/MmsInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef INPUT_MMS_H 5 | #define INPUT_MMS_H 6 | 7 | extern const struct InputPlugin input_plugin_mms; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/input/plugins/NfsInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "input/Ptr.hxx" 7 | #include "thread/Mutex.hxx" 8 | 9 | #include 10 | 11 | class NfsConnection; 12 | 13 | extern const struct InputPlugin input_plugin_nfs; 14 | 15 | InputStreamPtr 16 | OpenNfsInputStream(NfsConnection &connection, std::string_view path, 17 | Mutex &mutex); 18 | -------------------------------------------------------------------------------- /src/input/plugins/QobuzErrorParser.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct StringCurlResponse; 7 | 8 | [[noreturn]] 9 | void 10 | ThrowQobuzError(const StringCurlResponse &response); 11 | -------------------------------------------------------------------------------- /src/input/plugins/QobuzInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef INPUT_QOBUZ_HXX 5 | #define INPUT_QOBUZ_HXX 6 | 7 | extern const struct InputPlugin qobuz_input_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/input/plugins/QobuzSession.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | class CurlRequest; 9 | 10 | struct QobuzSession { 11 | std::string user_auth_token; 12 | 13 | bool IsDefined() const noexcept { 14 | return !user_auth_token.empty(); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /src/input/plugins/SmbclientInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_SMBCLIENT_H 5 | #define MPD_INPUT_SMBCLIENT_H 6 | 7 | extern const struct InputPlugin input_plugin_smbclient; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/input/plugins/UringInputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_INPUT_URING_HXX 5 | #define MPD_INPUT_URING_HXX 6 | 7 | #include "input/Ptr.hxx" 8 | #include "thread/Mutex.hxx" 9 | 10 | class EventLoop; 11 | 12 | void 13 | InitUringInputPlugin(EventLoop &event_loop) noexcept; 14 | 15 | InputStreamPtr 16 | OpenUringInputStream(const char *path, Mutex &mutex); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/io/FileAt.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include "FileDescriptor.hxx" 8 | 9 | /** 10 | * Reference to a file by an anchor directory (which can be an 11 | * `O_PATH` descriptor) and a path name relative to it. 12 | */ 13 | struct FileAt { 14 | FileDescriptor directory; 15 | const char *name; 16 | }; 17 | -------------------------------------------------------------------------------- /src/io/LineReader.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | class LineReader 7 | { 8 | public: 9 | /** 10 | * Reads a line from the input file, and strips trailing 11 | * space. There is a reasonable maximum line length, only to 12 | * prevent denial of service. 13 | * 14 | * @return a pointer to the line, or nullptr on end-of-file 15 | */ 16 | virtual char *ReadLine() = 0; 17 | }; 18 | -------------------------------------------------------------------------------- /src/io/OutputStream.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | class OutputStream { 10 | public: 11 | OutputStream() = default; 12 | OutputStream(const OutputStream &) = delete; 13 | 14 | /** 15 | * Throws std::exception on error. 16 | */ 17 | virtual void Write(std::span src) = 0; 18 | }; 19 | -------------------------------------------------------------------------------- /src/io/Reader.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "Reader.hxx" 5 | 6 | #include 7 | 8 | void 9 | Reader::ReadFull(std::span dest) 10 | { 11 | const auto nbytes = Read(dest); 12 | if (nbytes < dest.size()) 13 | throw std::runtime_error{"Unexpected end of file"}; 14 | } 15 | -------------------------------------------------------------------------------- /src/io/uring/Close.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | class FileDescriptor; 8 | 9 | namespace Uring { 10 | 11 | class Queue; 12 | 13 | /** 14 | * Schedule a close() on the given file descriptor. If no 15 | * #io_uring_sqe is available, this function falls back to close(). 16 | * No callback will be invoked. 17 | */ 18 | void 19 | Close(Queue *queue, FileDescriptor fd) noexcept; 20 | 21 | } // namespace Uring 22 | -------------------------------------------------------------------------------- /src/java/Global.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "Global.hxx" 5 | 6 | namespace Java { 7 | 8 | JavaVM *jvm; 9 | 10 | void Init(JNIEnv *env) noexcept 11 | { 12 | env->GetJavaVM(&jvm); 13 | } 14 | 15 | } // namespace Java 16 | -------------------------------------------------------------------------------- /src/java/Object.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "Object.hxx" 5 | #include "Class.hxx" 6 | 7 | jmethodID Java::Object::toString_method; 8 | 9 | void 10 | Java::Object::Initialise(JNIEnv *env) 11 | { 12 | assert(env != nullptr); 13 | 14 | Class cls(env, "java/lang/Object"); 15 | 16 | toString_method = env->GetMethodID(cls, "toString", 17 | "()Ljava/lang/String;"); 18 | assert(toString_method != nullptr); 19 | } 20 | -------------------------------------------------------------------------------- /src/java/meson.build: -------------------------------------------------------------------------------- 1 | java = static_library( 2 | 'java', 3 | 'Global.cxx', 4 | 'Exception.cxx', 5 | 'File.cxx', 6 | 'Object.cxx', 7 | 'String.cxx', 8 | include_directories: inc, 9 | dependencies: [ 10 | ], 11 | ) 12 | 13 | java_dep = declare_dependency( 14 | link_with: java, 15 | dependencies: [ 16 | util_dep, 17 | fs_dep, 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /src/lib/alsa/ChannelMap.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "pcm/Export.hxx" 7 | 8 | #include 9 | 10 | namespace Alsa { 11 | 12 | /** 13 | * Choose and set an ALSA channel map using snd_pcm_set_chmap(). 14 | * 15 | * Throws on error. Logs a warning for non-fatal errors. 16 | */ 17 | void 18 | SetupChannelMap(snd_pcm_t *pcm, 19 | unsigned channels, 20 | PcmExport::Params ¶ms); 21 | 22 | } // namespace Alsa 23 | -------------------------------------------------------------------------------- /src/lib/alsa/Error.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "Error.hxx" 5 | 6 | #include 7 | #include 8 | 9 | namespace Alsa { 10 | 11 | ErrorCategory error_category; 12 | 13 | std::string 14 | ErrorCategory::message(int condition) const 15 | { 16 | return snd_strerror(condition); 17 | } 18 | 19 | } // namespace Alsa 20 | -------------------------------------------------------------------------------- /src/lib/avahi/EntryGroup.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace Avahi { 12 | 13 | struct EntryGroupDeleter { 14 | void operator()(AvahiEntryGroup *g) noexcept { 15 | avahi_entry_group_free(g); 16 | } 17 | }; 18 | 19 | using EntryGroupPtr = std::unique_ptr; 20 | 21 | } // namespace Avahi 22 | -------------------------------------------------------------------------------- /src/lib/avahi/ErrorHandler.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | struct AvahiClient; 10 | 11 | namespace Avahi { 12 | 13 | class ErrorHandler { 14 | public: 15 | /** 16 | * @return true to keep retrying, false if the failed object 17 | * has been disposed 18 | */ 19 | virtual bool OnAvahiError(std::exception_ptr e) noexcept = 0; 20 | }; 21 | 22 | } // namespace Avahi 23 | -------------------------------------------------------------------------------- /src/lib/chromaprint/meson.build: -------------------------------------------------------------------------------- 1 | chromaprint_dep = dependency('libchromaprint', required: get_option('chromaprint')) 2 | conf.set('ENABLE_CHROMAPRINT', chromaprint_dep.found()) 3 | -------------------------------------------------------------------------------- /src/lib/crypto/MD5.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | void 10 | GlobalInitMD5() noexcept; 11 | 12 | [[gnu::pure]] 13 | std::array 14 | MD5(std::span input) noexcept; 15 | 16 | [[gnu::pure]] 17 | std::array 18 | MD5Hex(std::span input) noexcept; 19 | -------------------------------------------------------------------------------- /src/lib/curl/Escape.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef CURL_ESCAPE_HXX 5 | #define CURL_ESCAPE_HXX 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | std::string 13 | CurlEscapeUriPath(CURL *curl, std::string_view src) noexcept; 14 | 15 | std::string 16 | CurlEscapeUriPath(std::string_view src) noexcept; 17 | 18 | std::string 19 | CurlUnescape(CURL *curl, std::string_view src) noexcept; 20 | 21 | std::string 22 | CurlUnescape(std::string_view src) noexcept; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/lib/curl/Form.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef CURL_FORM_HXX 5 | #define CURL_FORM_HXX 6 | 7 | #include "Headers.hxx" 8 | 9 | #include 10 | 11 | #include 12 | 13 | /** 14 | * Encode the given map of form fields to a 15 | * "application/x-www-form-urlencoded" string. 16 | */ 17 | std::string 18 | EncodeForm(CURL *curl, const Curl::Headers &fields) noexcept; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/lib/curl/Headers.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace Curl { 11 | 12 | using Headers = std::multimap>; 13 | 14 | } // namespace Curl 15 | -------------------------------------------------------------------------------- /src/lib/curl/Parser.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | class CurlResponseParser { 9 | public: 10 | virtual ~CurlResponseParser() = default; 11 | virtual void OnData(std::span data) = 0; 12 | virtual void OnEnd() = 0; 13 | }; 14 | -------------------------------------------------------------------------------- /src/lib/curl/Setup.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | class CurlEasy; 7 | 8 | namespace Curl { 9 | 10 | void 11 | Setup(CurlEasy &easy); 12 | 13 | } // namespace Curl 14 | -------------------------------------------------------------------------------- /src/lib/curl/StringResponse.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include "Headers.hxx" 8 | 9 | #include 10 | 11 | struct StringCurlResponse { 12 | unsigned status; 13 | Curl::Headers headers; 14 | std::string body; 15 | }; 16 | -------------------------------------------------------------------------------- /src/lib/curl/Version.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "Version.hxx" 5 | 6 | #include 7 | 8 | bool 9 | IsCurlOlderThan(unsigned version_num) noexcept 10 | { 11 | const auto *const info = curl_version_info(CURLVERSION_FIRST); 12 | return info == nullptr || info->version_num < version_num; 13 | } 14 | -------------------------------------------------------------------------------- /src/lib/curl/Version.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef CURL_VERSION_HXX 5 | #define CURL_VERSION_HXX 6 | 7 | [[gnu::const]] 8 | bool 9 | IsCurlOlderThan(unsigned version_num) noexcept; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/lib/dbus/Error.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #include "Error.hxx" 6 | #include "lib/fmt/RuntimeError.hxx" 7 | 8 | void 9 | ODBus::Error::Throw(const char *prefix) const 10 | { 11 | throw FmtRuntimeError("{}: {}", prefix, GetMessage()); 12 | } 13 | 14 | void 15 | ODBus::Error::CheckThrow(const char *prefix) const 16 | { 17 | if (*this) 18 | Throw(prefix); 19 | } 20 | -------------------------------------------------------------------------------- /src/lib/dbus/Init.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef ODBUS_INIT_HXX 5 | #define ODBUS_INIT_HXX 6 | 7 | #include 8 | 9 | namespace ODBus { 10 | 11 | class ScopeInit { 12 | public: 13 | ScopeInit() = default; 14 | 15 | ~ScopeInit() noexcept { 16 | /* free libdbus memory to make memory leak checkers happy */ 17 | dbus_shutdown(); 18 | } 19 | 20 | ScopeInit(const ScopeInit &) = delete; 21 | ScopeInit &operator=(const ScopeInit &) = delete; 22 | }; 23 | 24 | } /* namespace ODBus */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/lib/dbus/Iter.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | namespace ODBus { 10 | 11 | class MessageIter { 12 | protected: 13 | DBusMessageIter iter; 14 | 15 | MessageIter() = default; 16 | 17 | public: 18 | MessageIter(const MessageIter &) = delete; 19 | MessageIter &operator=(const MessageIter &) = delete; 20 | }; 21 | 22 | } /* namespace ODBus */ 23 | -------------------------------------------------------------------------------- /src/lib/dbus/ScopeMatch.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #include "ScopeMatch.hxx" 6 | #include "Error.hxx" 7 | 8 | ODBus::ScopeMatch::ScopeMatch(DBusConnection *_connection, const char *_rule) 9 | :connection(_connection), rule(_rule) 10 | { 11 | Error error; 12 | dbus_bus_add_match(connection, rule, error); 13 | error.CheckThrow("DBus AddMatch error"); 14 | } 15 | -------------------------------------------------------------------------------- /src/lib/expat/StreamExpatParser.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "ExpatParser.hxx" 5 | #include "input/InputStream.hxx" 6 | #include "util/SpanCast.hxx" 7 | 8 | void 9 | ExpatParser::Parse(InputStream &is) 10 | { 11 | assert(is.IsReady()); 12 | 13 | while (true) { 14 | std::byte buffer[4096]; 15 | size_t nbytes = is.LockRead(buffer); 16 | if (nbytes == 0) 17 | break; 18 | 19 | Parse(ToStringView(std::span{buffer}.first(nbytes))); 20 | } 21 | 22 | CompleteParse(); 23 | } 24 | -------------------------------------------------------------------------------- /src/lib/ffmpeg/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain ffmpeg_domain("ffmpeg"); 8 | -------------------------------------------------------------------------------- /src/lib/ffmpeg/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_DOMAIN_HXX 5 | #define MPD_FFMPEG_DOMAIN_HXX 6 | 7 | class Domain; 8 | 9 | extern const Domain ffmpeg_domain; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/lib/ffmpeg/Error.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_ERROR_HXX 5 | #define MPD_FFMPEG_ERROR_HXX 6 | 7 | #include 8 | 9 | std::runtime_error 10 | MakeFfmpegError(int errnum); 11 | 12 | std::runtime_error 13 | MakeFfmpegError(int errnum, const char *prefix); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/lib/ffmpeg/Init.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /* necessary because libavutil/common.h uses UINT64_C */ 5 | #define __STDC_CONSTANT_MACROS 6 | 7 | #include "Init.hxx" 8 | #include "LogCallback.hxx" 9 | 10 | extern "C" { 11 | #include 12 | } 13 | 14 | void 15 | FfmpegInit() 16 | { 17 | av_log_set_callback(FfmpegLogCallback); 18 | } 19 | -------------------------------------------------------------------------------- /src/lib/ffmpeg/Init.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_INIT_HXX 5 | #define MPD_FFMPEG_INIT_HXX 6 | 7 | void 8 | FfmpegInit(); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/lib/ffmpeg/LogCallback.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FFMPEG_LOG_CALLBACK_HXX 5 | #define MPD_FFMPEG_LOG_CALLBACK_HXX 6 | 7 | #include 8 | 9 | void 10 | FfmpegLogCallback(void *ptr, int level, const char *fmt, std::va_list vl); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/lib/fmt/ExceptionFormatter.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "ExceptionFormatter.hxx" 5 | #include "util/Exception.hxx" 6 | 7 | auto 8 | fmt::formatter::format(std::exception_ptr e, format_context &ctx) const 9 | -> format_context::iterator 10 | { 11 | return formatter::format(GetFullMessage(std::move(e)), ctx); 12 | } 13 | -------------------------------------------------------------------------------- /src/lib/fmt/ExceptionFormatter.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include 9 | 10 | template<> 11 | struct fmt::formatter : formatter 12 | { 13 | auto format(std::exception_ptr e, format_context &ctx) const -> format_context::iterator; 14 | }; 15 | -------------------------------------------------------------------------------- /src/lib/fmt/PathFormatter.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "fs/Path.hxx" 7 | 8 | #include 9 | 10 | #include 11 | 12 | template T> 13 | struct fmt::formatter : formatter 14 | { 15 | template 16 | auto format(Path path, FormatContext &ctx) const { 17 | return formatter::format(path.ToUTF8(), ctx); 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /src/lib/fmt/SocketAddressFormatter.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "SocketAddressFormatter.hxx" 5 | #include "net/FormatAddress.hxx" 6 | 7 | auto 8 | fmt::formatter::format(SocketAddress address, format_context &ctx) const 9 | -> format_context::iterator 10 | { 11 | char buffer[256]; 12 | std::string_view s; 13 | 14 | if (ToString(std::span{buffer}, address)) 15 | s = buffer; 16 | else 17 | s = "?"; 18 | 19 | return formatter::format(s, ctx); 20 | } 21 | -------------------------------------------------------------------------------- /src/lib/fmt/SocketAddressFormatter.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include "net/SocketAddress.hxx" 7 | 8 | #include 9 | 10 | #include 11 | 12 | template<> 13 | struct fmt::formatter : formatter 14 | { 15 | auto format(SocketAddress address, format_context &ctx) const -> format_context::iterator; 16 | }; 17 | 18 | template T> 19 | struct fmt::formatter : formatter 20 | { 21 | }; 22 | -------------------------------------------------------------------------------- /src/lib/gcrypt/Hash.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | namespace Gcrypt { 12 | 13 | template 14 | [[gnu::pure]] 15 | auto 16 | Hash(std::span input) noexcept 17 | { 18 | std::array result; 19 | gcry_md_hash_buffer(algo, &result.front(), 20 | input.data(), input.size()); 21 | return result; 22 | } 23 | 24 | } /* namespace Gcrypt */ 25 | -------------------------------------------------------------------------------- /src/lib/gcrypt/Init.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef GCRYPT_INIT_HXX 5 | #define GCRYPT_INIT_HXX 6 | 7 | #include 8 | 9 | namespace Gcrypt { 10 | 11 | inline void 12 | Init() noexcept 13 | { 14 | gcry_check_version(GCRYPT_VERSION); 15 | } 16 | 17 | } /* namespace Gcrypt */ 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/lib/gcrypt/MD5.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "MD5.hxx" 5 | #include "Hash.hxx" 6 | 7 | namespace Gcrypt { 8 | 9 | std::array 10 | MD5(std::span input) noexcept 11 | { 12 | return Gcrypt::Hash(input); 13 | } 14 | 15 | } // namespace Gcrypt 16 | -------------------------------------------------------------------------------- /src/lib/gcrypt/MD5.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace Gcrypt { 10 | 11 | [[gnu::pure]] 12 | std::array 13 | MD5(std::span input) noexcept; 14 | 15 | } // namespace Gcrypt 16 | -------------------------------------------------------------------------------- /src/lib/icu/Collate.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ICU_COLLATE_HXX 5 | #define MPD_ICU_COLLATE_HXX 6 | 7 | #include 8 | 9 | /** 10 | * Throws #std::runtime_error on error. 11 | */ 12 | void 13 | IcuCollateInit(); 14 | 15 | void 16 | IcuCollateFinish() noexcept; 17 | 18 | [[gnu::pure]] 19 | int 20 | IcuCollate(std::string_view a, std::string_view b) noexcept; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/lib/icu/FoldCase.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include 9 | 10 | template class AllocatedArray; 11 | 12 | /** 13 | * @return the normalized string (or nullptr on error) 14 | */ 15 | [[gnu::pure]] 16 | AllocatedArray 17 | IcuFoldCase(std::basic_string_view src) noexcept; 18 | -------------------------------------------------------------------------------- /src/lib/modplug/patches/series: -------------------------------------------------------------------------------- 1 | no_register 2 | -------------------------------------------------------------------------------- /src/lib/nlohmann_json/meson.build: -------------------------------------------------------------------------------- 1 | nlohmann_json = dependency('nlohmann_json', 2 | version: '>= 3.11', 3 | fallback: ['nlohmann_json', 'nlohmann_json_multiple_headers'], 4 | required: get_option('nlohmann_json')) 5 | if not nlohmann_json.found() 6 | nlohmann_json_dep = nlohmann_json 7 | subdir_done() 8 | endif 9 | 10 | nlohmann_json_dep = declare_dependency( 11 | # no iostreams, please 12 | compile_args: ['-DJSON_NO_IO'], 13 | dependencies: nlohmann_json, 14 | ) 15 | -------------------------------------------------------------------------------- /src/lib/oss/meson.build: -------------------------------------------------------------------------------- 1 | enable_oss = get_option('oss') 2 | if enable_oss.disabled() 3 | enable_oss = false 4 | elif enable_oss.auto() and alsa_dep.found() 5 | # don't bother auto-enabling OSS if ALSA is available 6 | enable_oss = false 7 | elif compiler.has_header('sys/soundcard.h') 8 | enable_oss = true 9 | elif enable_oss.auto() 10 | enable_oss = false 11 | else 12 | error('sys/soundcard.h not found') 13 | endif 14 | 15 | conf.set('HAVE_OSS', enable_oss) 16 | -------------------------------------------------------------------------------- /src/lib/pcre/Error.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #include "Error.hxx" 6 | 7 | #include 8 | 9 | namespace Pcre { 10 | 11 | ErrorCategory error_category; 12 | 13 | std::string 14 | ErrorCategory::message(int condition) const 15 | { 16 | PCRE2_UCHAR8 buffer[256]; 17 | pcre2_get_error_message_8(condition, buffer, std::size(buffer)); 18 | return std::string{(const char *)buffer}; 19 | } 20 | 21 | } // namespace Pcre 22 | -------------------------------------------------------------------------------- /src/lib/pipewire/Error.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Error.hxx" 5 | 6 | #include 7 | 8 | namespace PipeWire { 9 | 10 | ErrorCategory error_category; 11 | 12 | std::string 13 | ErrorCategory::message(int condition) const 14 | { 15 | return spa_strerror(condition); 16 | } 17 | 18 | } // namespace PipeWire 19 | -------------------------------------------------------------------------------- /src/lib/pulse/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain pulse_domain("pulse"); 8 | -------------------------------------------------------------------------------- /src/lib/pulse/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PULSE_DOMAIN_HXX 5 | #define MPD_PULSE_DOMAIN_HXX 6 | 7 | class Domain; 8 | 9 | extern const Domain pulse_domain; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/lib/pulse/Error.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Error.hxx" 5 | 6 | #include 7 | #include 8 | 9 | namespace Pulse { 10 | 11 | std::string 12 | ErrorCategory::message(int condition) const 13 | { 14 | return pa_strerror(condition); 15 | } 16 | 17 | ErrorCategory error_category; 18 | 19 | std::system_error 20 | MakeError(pa_context *context, const char *msg) noexcept 21 | { 22 | return MakeError(pa_context_errno(context), msg); 23 | } 24 | 25 | } // namespace Pulse 26 | -------------------------------------------------------------------------------- /src/lib/pulse/LogError.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "LogError.hxx" 5 | #include "Domain.hxx" 6 | #include "Log.hxx" 7 | 8 | #include 9 | #include 10 | 11 | void 12 | LogPulseError(pa_context *context, const char *prefix) noexcept 13 | { 14 | const int e = pa_context_errno(context); 15 | FmtError(pulse_domain, "{}: {}", prefix, pa_strerror(e)); 16 | } 17 | -------------------------------------------------------------------------------- /src/lib/pulse/LogError.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PULSE_LOG_ERROR_HXX 5 | #define MPD_PULSE_LOG_ERROR_HXX 6 | 7 | struct pa_context; 8 | 9 | void 10 | LogPulseError(pa_context *context, const char *prefix) noexcept; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/lib/pulse/meson.build: -------------------------------------------------------------------------------- 1 | pulse_dep = dependency('libpulse', version: '>= 0.9.16', required: get_option('pulse')) 2 | conf.set('ENABLE_PULSE', pulse_dep.found()) 3 | if not pulse_dep.found() 4 | subdir_done() 5 | endif 6 | 7 | pulse = static_library( 8 | 'pulse', 9 | 'LogError.cxx', 10 | 'Error.cxx', 11 | 'Domain.cxx', 12 | include_directories: inc, 13 | dependencies: [ 14 | pulse_dep, 15 | log_dep, 16 | ], 17 | ) 18 | 19 | pulse_dep = declare_dependency( 20 | link_with: pulse, 21 | dependencies: [ 22 | pulse_dep, 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /src/lib/smbclient/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain smbclient_domain("smbclient"); 8 | -------------------------------------------------------------------------------- /src/lib/smbclient/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SMBCLIENT_DOMAIN_HXX 5 | #define MPD_SMBCLIENT_DOMAIN_HXX 6 | 7 | class Domain; 8 | 9 | extern const Domain smbclient_domain; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/lib/smbclient/Init.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Init.hxx" 5 | 6 | void 7 | SmbclientInit() 8 | { 9 | /* this is currently a no-op, but one day, we might want to 10 | call smbc_thread_posix() here */ 11 | } 12 | -------------------------------------------------------------------------------- /src/lib/smbclient/Init.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SMBCLIENT_INIT_HXX 5 | #define MPD_SMBCLIENT_INIT_HXX 6 | 7 | /** 8 | * Initialize libsmbclient. 9 | * 10 | * Throws std::runtime_error on error. 11 | */ 12 | void 13 | SmbclientInit(); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/lib/smbclient/meson.build: -------------------------------------------------------------------------------- 1 | smbclient_dep = dependency('smbclient', version: '>= 0.2', required: get_option('smbclient')) 2 | conf.set('ENABLE_SMBCLIENT', smbclient_dep.found()) 3 | if not smbclient_dep.found() 4 | subdir_done() 5 | endif 6 | 7 | smbclient = static_library( 8 | 'smbclient', 9 | 'Domain.cxx', 10 | 'Init.cxx', 11 | 'Context.cxx', 12 | include_directories: inc, 13 | dependencies: [ 14 | smbclient_dep, 15 | ], 16 | ) 17 | 18 | smbclient_dep = declare_dependency( 19 | link_with: smbclient, 20 | dependencies: [ 21 | smbclient_dep, 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /src/lib/sndio/meson.build: -------------------------------------------------------------------------------- 1 | libsndio_dep = c_compiler.find_library('sndio', required: get_option('sndio')) 2 | if libsndio_dep.found() 3 | if c_compiler.has_header_symbol('sndio.h', 'ROAR_VERSION') 4 | if get_option('sndio').enabled() 5 | error('Found libroarsndio, which is known to be broken.') 6 | else 7 | warning('Found libroarsndio, which is known to be broken; ignoring it.') 8 | libsndio_dep = dependency('', required: false) 9 | endif 10 | endif 11 | endif 12 | conf.set('ENABLE_SNDIO', libsndio_dep.found()) 13 | -------------------------------------------------------------------------------- /src/lib/sqlite/Database.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Database.hxx" 5 | #include "Error.hxx" 6 | #include "lib/fmt/ToBuffer.hxx" 7 | 8 | namespace Sqlite { 9 | 10 | Database::Database(const char *path) 11 | { 12 | int result = sqlite3_open(path, &db); 13 | if (result != SQLITE_OK) 14 | throw SqliteError(db, result, 15 | FmtBuffer<1024>("Failed to open sqlite database {:?}", 16 | path)); 17 | } 18 | 19 | } // namespace Sqlite 20 | -------------------------------------------------------------------------------- /src/lib/sqlite/Error.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SQLITE_ERROR_HXX 5 | #define MPD_SQLITE_ERROR_HXX 6 | 7 | #include 8 | 9 | struct sqlite3; 10 | struct sqlite3_stmt; 11 | 12 | class SqliteError final : public std::runtime_error { 13 | int code; 14 | 15 | public: 16 | SqliteError(sqlite3 *db, int _code, const char *msg) noexcept; 17 | SqliteError(sqlite3_stmt *stmt, int _code, const char *msg) noexcept; 18 | 19 | int GetCode() const { 20 | return code; 21 | } 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/lib/systemd/meson.build: -------------------------------------------------------------------------------- 1 | if not is_linux or is_android 2 | systemd_dep = dependency('', required: false) 3 | subdir_done() 4 | endif 5 | 6 | systemd_dep = dependency('libsystemd', required: get_option('systemd')) 7 | conf.set('ENABLE_SYSTEMD_DAEMON', systemd_dep.found()) 8 | if not systemd_dep.found() 9 | subdir_done() 10 | endif 11 | 12 | systemd = static_library( 13 | 'systemd', 14 | 'Watchdog.cxx', 15 | include_directories: inc, 16 | dependencies: [ 17 | systemd_dep, 18 | ], 19 | ) 20 | 21 | systemd_dep = declare_dependency( 22 | link_with: systemd, 23 | ) 24 | -------------------------------------------------------------------------------- /src/lib/upnp/ClientInit.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | UpnpClient_Handle 9 | UpnpClientGlobalInit(const char* iface); 10 | 11 | void 12 | UpnpClientGlobalFinish() noexcept; 13 | -------------------------------------------------------------------------------- /src/lib/upnp/Init.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_UPNP_INIT_HXX 5 | #define MPD_UPNP_INIT_HXX 6 | 7 | void 8 | UpnpGlobalInit(const char* iface); 9 | 10 | void 11 | UpnpGlobalFinish() noexcept; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/lib/upnp/Util.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | void 9 | trimstring(std::string &s, const char *ws = " \t\n") noexcept; 10 | 11 | std::string 12 | path_getfather(std::string_view s) noexcept; 13 | -------------------------------------------------------------------------------- /src/lib/xiph/OggPacket.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "OggPacket.hxx" 5 | #include "OggSyncState.hxx" 6 | #include "OggStreamState.hxx" 7 | 8 | bool 9 | OggReadPacket(OggSyncState &sync, OggStreamState &stream, ogg_packet &packet) 10 | { 11 | while (true) { 12 | if (stream.PacketOut(packet)) 13 | return true; 14 | 15 | if (!sync.ExpectPageIn(stream)) 16 | return false; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/lib/xiph/OggPacket.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OGG_PACKET_HXX 5 | #define MPD_OGG_PACKET_HXX 6 | 7 | #include 8 | 9 | class OggSyncState; 10 | class OggStreamState; 11 | 12 | /** 13 | * Read the next packet. If necessary, feed more data into 14 | * #OggSyncState and feed more pages into #OggStreamState. 15 | */ 16 | bool 17 | OggReadPacket(OggSyncState &sync, OggStreamState &stream, ogg_packet &packet); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/lib/xiph/ScanVorbisComment.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SCAN_VORBIS_COMMENT_HXX 5 | #define MPD_SCAN_VORBIS_COMMENT_HXX 6 | 7 | #include 8 | 9 | class TagHandler; 10 | 11 | void 12 | ScanVorbisComment(std::string_view comment, TagHandler &handler) noexcept; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/lib/xiph/VorbisPicture.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_VORBIS_PICTURE_HXX 5 | #define MPD_VORBIS_PICTURE_HXX 6 | 7 | #include 8 | 9 | class TagHandler; 10 | 11 | void 12 | ScanVorbisPicture(std::string_view value, TagHandler &handler) noexcept; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/lib/xiph/XiphTags.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_XIPH_TAGS_HXX 5 | #define MPD_XIPH_TAGS_HXX 6 | 7 | #include "tag/Table.hxx" 8 | 9 | extern const struct tag_table xiph_tags[]; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/lib/zlib/meson.build: -------------------------------------------------------------------------------- 1 | zlib_dep = dependency('zlib', required: get_option('zlib')) 2 | conf.set('ENABLE_ZLIB', zlib_dep.found()) 3 | if not zlib_dep.found() 4 | subdir_done() 5 | endif 6 | 7 | zlib = static_library( 8 | 'zlib', 9 | 'GunzipReader.cxx', 10 | 'GzipOutputStream.cxx', 11 | 'AutoGunzipReader.cxx', 12 | 'AutoGunzipFileLineReader.cxx', 13 | include_directories: inc, 14 | dependencies: [ 15 | zlib_dep, 16 | ], 17 | ) 18 | 19 | zlib_dep = declare_dependency( 20 | link_with: zlib, 21 | dependencies: [ 22 | zlib_dep, 23 | io_dep, 24 | ], 25 | ) 26 | -------------------------------------------------------------------------------- /src/mixer/Listener.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_MIXER_LISTENER_HXX 5 | #define MPD_MIXER_LISTENER_HXX 6 | 7 | class Mixer; 8 | 9 | /** 10 | * An interface that listens on events from mixer plugins. The 11 | * methods must be thread-safe and non-blocking. 12 | */ 13 | class MixerListener { 14 | public: 15 | virtual void OnMixerVolumeChanged(Mixer &mixer, 16 | int volume) noexcept = 0; 17 | virtual void OnMixerChanged() noexcept = 0; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/mixer/plugins/AlsaMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin alsa_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/AndroidMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin android_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/NullMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin null_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/OSXMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin osx_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/OssMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin oss_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/PipeWireMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PIPEWIRE_MIXER_PLUGIN_HXX 5 | #define MPD_PIPEWIRE_MIXER_PLUGIN_HXX 6 | 7 | struct MixerPlugin; 8 | class PipeWireMixer; 9 | 10 | extern const MixerPlugin pipewire_mixer_plugin; 11 | 12 | void 13 | pipewire_mixer_on_change(PipeWireMixer &pm, float new_volume) noexcept; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/mixer/plugins/PulseMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | class PulseMixer; 8 | struct pa_context; 9 | struct pa_stream; 10 | 11 | extern const MixerPlugin pulse_mixer_plugin; 12 | 13 | void 14 | pulse_mixer_on_connect(PulseMixer &pm, pa_context *context); 15 | 16 | void 17 | pulse_mixer_on_disconnect(PulseMixer &pm); 18 | 19 | void 20 | pulse_mixer_on_change(PulseMixer &pm, pa_context *context, pa_stream *stream); 21 | -------------------------------------------------------------------------------- /src/mixer/plugins/SndioMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin sndio_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/WasapiMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin wasapi_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/mixer/plugins/WinmmMixerPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct MixerPlugin; 7 | 8 | extern const MixerPlugin winmm_mixer_plugin; 9 | -------------------------------------------------------------------------------- /src/neighbor/Info.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NEIGHBOR_INFO_HXX 5 | #define MPD_NEIGHBOR_INFO_HXX 6 | 7 | #include 8 | 9 | struct NeighborInfo { 10 | std::string uri; 11 | std::string display_name; 12 | 13 | template 14 | NeighborInfo(U &&_uri, DN &&_display_name) 15 | :uri(std::forward(_uri)), 16 | display_name(std::forward(_display_name)) {} 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/neighbor/Registry.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NEIGHBOR_REGISTRY_HXX 5 | #define MPD_NEIGHBOR_REGISTRY_HXX 6 | 7 | struct NeighborPlugin; 8 | 9 | /** 10 | * nullptr terminated list of all neighbor plugins which were enabled at 11 | * compile time. 12 | */ 13 | extern const NeighborPlugin *const neighbor_plugins[]; 14 | 15 | [[gnu::pure]] 16 | const NeighborPlugin * 17 | GetNeighborPluginByName(const char *name) noexcept; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/neighbor/plugins/SmbclientNeighborPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NEIGHBOR_SMBCLIENT_HXX 5 | #define MPD_NEIGHBOR_SMBCLIENT_HXX 6 | 7 | struct NeighborPlugin; 8 | 9 | extern const NeighborPlugin smbclient_neighbor_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/neighbor/plugins/UdisksNeighborPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NEIGHBOR_UDISKS_HXX 5 | #define MPD_NEIGHBOR_UDISKS_HXX 6 | 7 | struct NeighborPlugin; 8 | 9 | extern const NeighborPlugin udisks_neighbor_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/neighbor/plugins/UpnpNeighborPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NEIGHBOR_UPNP_HXX 5 | #define MPD_NEIGHBOR_UPNP_HXX 6 | 7 | struct NeighborPlugin; 8 | 9 | extern const NeighborPlugin upnp_neighbor_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/net/DscpParser.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | /** 7 | * Parse a DSCP (Differentiated Services Code Point) class name. 8 | * This can either be a name (CS*, LE, AF*, EF) or numeric (decimal or 9 | * hexadecimal). 10 | * 11 | * @return the DSCP or -1 on error 12 | */ 13 | [[gnu::pure]] 14 | int 15 | ParseDscpClass(const char *s) noexcept; 16 | -------------------------------------------------------------------------------- /src/net/IPv4Address.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "IPv4Address.hxx" 5 | 6 | #include 7 | 8 | IPv4Address::IPv4Address(SocketAddress src) noexcept 9 | :address(src.CastTo()) 10 | { 11 | assert(!src.IsNull()); 12 | assert(src.GetFamily() == AF_INET); 13 | } 14 | -------------------------------------------------------------------------------- /src/net/LocalSocketAddress.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "LocalSocketAddress.hxx" 5 | 6 | const char * 7 | LocalSocketAddress::GetLocalPath() const noexcept 8 | { 9 | const auto raw = GetLocalRaw(); 10 | return !raw.empty() && 11 | /* must be an absolute path */ 12 | raw.front() == '/' && 13 | /* must be null-terminated and there must not be any 14 | other null byte */ 15 | raw.find('\0') == raw.size() - 1 16 | ? raw.data() 17 | : nullptr; 18 | } 19 | -------------------------------------------------------------------------------- /src/output/Defaults.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Defaults.hxx" 5 | #include "config/Data.hxx" 6 | 7 | AudioOutputDefaults::AudioOutputDefaults(const ConfigData &config) 8 | :normalize(config.GetBool(ConfigOption::VOLUME_NORMALIZATION, false)), 9 | mixer_type(mixer_type_parse(config.GetString(ConfigOption::MIXER_TYPE, 10 | "hardware"))) 11 | 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /src/output/Domain.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Domain.hxx" 5 | #include "util/Domain.hxx" 6 | 7 | const Domain output_domain("output"); 8 | -------------------------------------------------------------------------------- /src/output/Domain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OUTPUT_ERROR_HXX 5 | #define MPD_OUTPUT_ERROR_HXX 6 | 7 | extern const class Domain output_domain; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/Error.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_AUDIO_OUTPUT_ERROR_HXX 5 | #define MPD_AUDIO_OUTPUT_ERROR_HXX 6 | 7 | /** 8 | * An exception class that will be thrown by various #AudioOutput 9 | * methods after AudioOutput::Interrupt() has been called. 10 | */ 11 | class AudioOutputInterrupted {}; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/output/Interface.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Interface.hxx" 5 | 6 | #include 7 | 8 | void 9 | AudioOutput::SetAttribute([[maybe_unused]] std::string &&name, 10 | [[maybe_unused]] std::string &&value) 11 | { 12 | throw std::invalid_argument("Unsupported attribute"); 13 | } 14 | -------------------------------------------------------------------------------- /src/output/OutputAPI.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OUTPUT_API_HXX 5 | #define MPD_OUTPUT_API_HXX 6 | 7 | // IWYU pragma: begin_exports 8 | 9 | #include "OutputPlugin.hxx" 10 | #include "Interface.hxx" 11 | #include "pcm/AudioFormat.hxx" 12 | #include "tag/Tag.hxx" 13 | #include "config/Block.hxx" 14 | 15 | // IWYU pragma: end_exports 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/output/OutputPlugin.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "OutputPlugin.hxx" 5 | 6 | #include 7 | 8 | AudioOutput * 9 | ao_plugin_init(EventLoop &event_loop, 10 | const AudioOutputPlugin &plugin, 11 | const ConfigBlock &block) 12 | { 13 | assert(plugin.init != nullptr); 14 | 15 | return plugin.init(event_loop, block); 16 | } 17 | -------------------------------------------------------------------------------- /src/output/Print.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | /* 5 | * Protocol specific code for the audio output library. 6 | * 7 | */ 8 | 9 | #ifndef MPD_OUTPUT_PRINT_HXX 10 | #define MPD_OUTPUT_PRINT_HXX 11 | 12 | class Response; 13 | class MultipleOutputs; 14 | 15 | void 16 | printAudioDevices(Response &r, const MultipleOutputs &outputs); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/output/plugins/AlsaOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ALSA_OUTPUT_PLUGIN_HXX 5 | #define MPD_ALSA_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin alsa_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/AoOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_AO_OUTPUT_PLUGIN_HXX 5 | #define MPD_AO_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin ao_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/FifoOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FIFO_OUTPUT_PLUGIN_HXX 5 | #define MPD_FIFO_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin fifo_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/JackOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_JACK_OUTPUT_PLUGIN_HXX 5 | #define MPD_JACK_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin jack_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/NullOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_NULL_OUTPUT_PLUGIN_HXX 5 | #define MPD_NULL_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin null_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/OSXOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OSX_OUTPUT_PLUGIN_HXX 5 | #define MPD_OSX_OUTPUT_PLUGIN_HXX 6 | 7 | struct OSXOutput; 8 | 9 | extern const struct AudioOutputPlugin osx_output_plugin; 10 | 11 | int 12 | osx_output_get_volume(OSXOutput &output); 13 | 14 | void 15 | osx_output_set_volume(OSXOutput &output, unsigned new_volume); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/output/plugins/OpenALOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OPENAL_OUTPUT_PLUGIN_HXX 5 | #define MPD_OPENAL_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin openal_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/OssOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_OSS_OUTPUT_PLUGIN_HXX 5 | #define MPD_OSS_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin oss_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/PipeOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PIPE_OUTPUT_PLUGIN_HXX 5 | #define MPD_PIPE_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin pipe_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/RecorderOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_RECORDER_OUTPUT_PLUGIN_HXX 5 | #define MPD_RECORDER_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin recorder_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/ShoutOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SHOUT_OUTPUT_PLUGIN_HXX 5 | #define MPD_SHOUT_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin shout_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/SolarisOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SOLARIS_OUTPUT_PLUGIN_HXX 5 | #define MPD_SOLARIS_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin solaris_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/WinmmOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_WINMM_OUTPUT_PLUGIN_HXX 5 | #define MPD_WINMM_OUTPUT_PLUGIN_HXX 6 | 7 | #include "output/Features.h" 8 | 9 | #ifdef ENABLE_WINMM_OUTPUT 10 | 11 | #include 12 | #include 13 | 14 | class WinmmOutput; 15 | 16 | extern const struct AudioOutputPlugin winmm_output_plugin; 17 | 18 | [[gnu::pure]] 19 | HWAVEOUT 20 | winmm_output_get_handle(WinmmOutput &output); 21 | 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/output/plugins/httpd/HttpdOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_HTTPD_OUTPUT_PLUGIN_HXX 5 | #define MPD_HTTPD_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin httpd_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/httpd/IcyMetaDataServer.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "Page.hxx" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | enum TagType : uint8_t; 13 | struct Tag; 14 | 15 | std::string 16 | icy_server_metadata_header(const char *name, 17 | const char *genre, const char *url, 18 | const char *content_type, std::size_t metaint) noexcept; 19 | 20 | PagePtr 21 | icy_server_metadata_page(const Tag &tag, const TagType *types) noexcept; 22 | -------------------------------------------------------------------------------- /src/output/plugins/httpd/Page.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PAGE_HXX 5 | #define MPD_PAGE_HXX 6 | 7 | #include "util/AllocatedArray.hxx" 8 | 9 | #include 10 | #include 11 | 12 | /** 13 | * A dynamically allocated buffer. It is used to pass 14 | * reference-counted buffers around (using std::shared_ptr), when 15 | * several instances hold references to one buffer. 16 | */ 17 | using Page = AllocatedArray; 18 | 19 | typedef std::shared_ptr PagePtr; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/output/plugins/sles/SlesOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SLES_OUTPUT_PLUGIN_HXX 5 | #define MPD_SLES_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin sles_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/snapcast/SnapcastOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SNAPCAST_OUTPUT_PLUGIN_HXX 5 | #define MPD_SNAPCAST_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin snapcast_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/output/plugins/wasapi/WasapiOutputPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_WASAPI_OUTPUT_PLUGIN_HXX 5 | #define MPD_WASAPI_OUTPUT_PLUGIN_HXX 6 | 7 | extern const struct AudioOutputPlugin wasapi_output_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/pcm/Buffer.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Buffer.hxx" 5 | 6 | void * 7 | PcmBuffer::Get(size_t new_size) noexcept 8 | { 9 | if (new_size == 0) 10 | /* never return nullptr, because nullptr would be 11 | assumed to be an error condition */ 12 | new_size = 1; 13 | 14 | return buffer.Get(new_size); 15 | } 16 | -------------------------------------------------------------------------------- /src/pcm/ChannelDefs.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PCM_CHANNEL_DEFS_HXX 5 | #define MPD_PCM_CHANNEL_DEFS_HXX 6 | 7 | static constexpr unsigned MAX_CHANNELS = 8; 8 | 9 | /** 10 | * Checks whether the number of channels is valid. 11 | */ 12 | constexpr bool 13 | audio_valid_channel_count(unsigned channels) noexcept 14 | { 15 | return channels >= 1 && channels <= MAX_CHANNELS; 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/pcm/ConfiguredResampler.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CONFIGURED_RESAMPLER_HXX 5 | #define MPD_CONFIGURED_RESAMPLER_HXX 6 | 7 | struct ConfigData; 8 | class PcmResampler; 9 | 10 | void 11 | pcm_resampler_global_init(const ConfigData &config); 12 | 13 | /** 14 | * Create a #PcmResampler instance from the implementation class 15 | * configured in mpd.conf. 16 | */ 17 | PcmResampler * 18 | pcm_resampler_create(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/pcm/MixRampGlue.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | struct AudioFormat; 9 | class MusicPipe; 10 | 11 | enum class MixRampDirection { 12 | START, END 13 | }; 14 | 15 | [[gnu::pure]] 16 | std::string 17 | AnalyzeMixRamp(const MusicPipe &pipe, const AudioFormat &audio_format, 18 | MixRampDirection direction) noexcept; 19 | -------------------------------------------------------------------------------- /src/pcm/Order.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PCM_ORDER_HXX 5 | #define MPD_PCM_ORDER_HXX 6 | 7 | #include "SampleFormat.hxx" 8 | 9 | #include 10 | 11 | class PcmBuffer; 12 | 13 | /** 14 | * Convert the given buffer from FLAC channel order 15 | * (https://xiph.org/flac/format.html) to ALSA channel order. 16 | */ 17 | std::span 18 | ToAlsaChannelOrder(PcmBuffer &buffer, std::span src, 19 | SampleFormat sample_format, unsigned channels) noexcept; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/pcm/Prng.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PCM_PRNG_HXX 5 | #define MPD_PCM_PRNG_HXX 6 | 7 | /** 8 | * A very simple linear congruential PRNG. It's good enough for PCM 9 | * dithering. 10 | */ 11 | constexpr static inline unsigned long 12 | pcm_prng(unsigned long state) noexcept 13 | { 14 | return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/pcm/Silence.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Silence.hxx" 5 | #include "Traits.hxx" 6 | #include "SampleFormat.hxx" 7 | 8 | #include 9 | 10 | void 11 | PcmSilence(std::span dest, SampleFormat format) noexcept 12 | { 13 | std::byte pattern{0}; 14 | if (format == SampleFormat::DSD) 15 | pattern = std::byte{SampleTraits::SILENCE}; 16 | 17 | std::fill(dest.begin(), dest.end(), pattern); 18 | } 19 | -------------------------------------------------------------------------------- /src/pcm/Silence.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PCM_SILENCE_HXX 5 | #define MPD_PCM_SILENCE_HXX 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | enum class SampleFormat : uint8_t; 12 | 13 | /** 14 | * Fill the given buffer with the format-specific silence pattern. 15 | */ 16 | void 17 | PcmSilence(std::span dest, SampleFormat format) noexcept; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/playlist/MemorySongEnumerator.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "MemorySongEnumerator.hxx" 5 | 6 | std::unique_ptr 7 | MemorySongEnumerator::NextSong() 8 | { 9 | if (songs.empty()) 10 | return nullptr; 11 | 12 | auto result = std::make_unique(std::move(songs.front())); 13 | songs.pop_front(); 14 | return result; 15 | } 16 | -------------------------------------------------------------------------------- /src/playlist/plugins/AsxPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ASX_PLAYLIST_PLUGIN_HXX 5 | #define MPD_ASX_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin asx_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/CuePlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CUE_PLAYLIST_PLUGIN_HXX 5 | #define MPD_CUE_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin cue_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/EmbeddedCuePlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_EMBCUE_PLAYLIST_PLUGIN_HXX 5 | #define MPD_EMBCUE_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin embcue_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/ExtM3uPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_EXTM3U_PLAYLIST_PLUGIN_HXX 5 | #define MPD_EXTM3U_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin extm3u_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/FlacPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_FLAC_PLAYLIST_PLUGIN_HXX 5 | #define MPD_FLAC_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin flac_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/M3uPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_M3U_PLAYLIST_PLUGIN_HXX 5 | #define MPD_M3U_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin m3u_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/PlsPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_PLS_PLAYLIST_PLUGIN_HXX 5 | #define MPD_PLS_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin pls_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/RssPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_RSS_PLAYLIST_PLUGIN_HXX 5 | #define MPD_RSS_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin rss_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/playlist/plugins/XspfPlaylistPlugin.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_XSPF_PLAYLIST_PLUGIN_HXX 5 | #define MPD_XSPF_PLAYLIST_PLUGIN_HXX 6 | 7 | extern const struct PlaylistPlugin xspf_playlist_plugin; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/queue/Selection.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Selection.hxx" 5 | #include "Queue.hxx" 6 | #include "song/DetachedSong.hxx" 7 | #include "song/Filter.hxx" 8 | #include "song/LightSong.hxx" 9 | 10 | bool 11 | QueueSelection::MatchPosition(const Queue &queue, 12 | unsigned position) const noexcept 13 | { 14 | if (filter != nullptr) { 15 | const auto song = queue.GetLight(position); 16 | if (!filter->Match(song)) 17 | return false; 18 | } 19 | 20 | return true; 21 | } 22 | -------------------------------------------------------------------------------- /src/song/BaseSongFilter.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "BaseSongFilter.hxx" 5 | #include "Escape.hxx" 6 | #include "LightSong.hxx" 7 | #include "util/UriRelative.hxx" 8 | 9 | std::string 10 | BaseSongFilter::ToExpression() const noexcept 11 | { 12 | return "(base \"" + EscapeFilterString(value) + "\")"; 13 | } 14 | 15 | bool 16 | BaseSongFilter::Match(const LightSong &song) const noexcept 17 | { 18 | return uri_is_child_or_same(value.c_str(), song.GetURI().c_str()); 19 | } 20 | -------------------------------------------------------------------------------- /src/song/Escape.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Escape.hxx" 5 | 6 | static constexpr bool 7 | MustEscape(char ch) noexcept 8 | { 9 | return ch == '"' || ch == '\'' || ch == '\\'; 10 | } 11 | 12 | std::string 13 | EscapeFilterString(const std::string &src) noexcept 14 | { 15 | std::string result; 16 | result.reserve(src.length() + 16); 17 | 18 | for (char ch : src) { 19 | if (MustEscape(ch)) 20 | result.push_back('\\'); 21 | result.push_back(ch); 22 | } 23 | 24 | return result; 25 | } 26 | -------------------------------------------------------------------------------- /src/song/Escape.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SONG_ESCAPE_HXX 5 | #define MPD_SONG_ESCAPE_HXX 6 | 7 | #include 8 | 9 | [[gnu::pure]] 10 | std::string 11 | EscapeFilterString(const std::string &src) noexcept; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/song/LightSong.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "LightSong.hxx" 5 | #include "tag/Tag.hxx" 6 | 7 | SignedSongTime 8 | LightSong::GetDuration() const noexcept 9 | { 10 | SongTime a = start_time, b = end_time; 11 | if (!b.IsPositive()) { 12 | if (tag.duration.IsNegative()) 13 | return tag.duration; 14 | 15 | b = SongTime(tag.duration); 16 | } 17 | 18 | return {b - a}; 19 | } 20 | -------------------------------------------------------------------------------- /src/song/OptimizeFilter.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SONG_OPTIMIZE_FILTER_HXX 5 | #define MPD_SONG_OPTIMIZE_FILTER_HXX 6 | 7 | #include "ISongFilter.hxx" 8 | 9 | class AndSongFilter; 10 | 11 | void 12 | OptimizeSongFilter(AndSongFilter &af) noexcept; 13 | 14 | ISongFilterPtr 15 | OptimizeSongFilter(ISongFilterPtr f) noexcept; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/song/PrioritySongFilter.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "PrioritySongFilter.hxx" 5 | #include "LightSong.hxx" 6 | #include "time/ISO8601.hxx" 7 | #include "util/StringBuffer.hxx" 8 | 9 | #include 10 | 11 | std::string 12 | PrioritySongFilter::ToExpression() const noexcept 13 | { 14 | return fmt::format("(prio >= {})", value); 15 | } 16 | 17 | bool 18 | PrioritySongFilter::Match(const LightSong &song) const noexcept 19 | { 20 | return song.priority >= value; 21 | } 22 | -------------------------------------------------------------------------------- /src/song/UriSongFilter.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "UriSongFilter.hxx" 5 | #include "Escape.hxx" 6 | #include "LightSong.hxx" 7 | 8 | std::string 9 | UriSongFilter::ToExpression() const noexcept 10 | { 11 | return std::string("(file ") + filter.GetOperator() 12 | + " \"" + EscapeFilterString(filter.GetValue()) + "\")"; 13 | } 14 | 15 | bool 16 | UriSongFilter::Match(const LightSong &song) const noexcept 17 | { 18 | return filter.Match(song.GetURI().c_str()); 19 | } 20 | -------------------------------------------------------------------------------- /src/sticker/AllowedTags.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | class TagMask; 7 | 8 | /** 9 | * These are the tags that are allowed to have stickers. 10 | */ 11 | extern const TagMask sticker_allowed_tags; 12 | -------------------------------------------------------------------------------- /src/sticker/Print.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Print.hxx" 5 | #include "Sticker.hxx" 6 | #include "client/Response.hxx" 7 | 8 | #include 9 | 10 | void 11 | sticker_print_value(Response &r, 12 | const char *name, const char *value) 13 | { 14 | r.Fmt("sticker: {}={}\n", name, value); 15 | } 16 | 17 | void 18 | sticker_print(Response &r, const Sticker &sticker) 19 | { 20 | for (const auto &[name, val] : sticker.table) 21 | sticker_print_value(r, name.c_str(), val.c_str()); 22 | } 23 | -------------------------------------------------------------------------------- /src/sticker/Print.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STICKER_PRINT_HXX 5 | #define MPD_STICKER_PRINT_HXX 6 | 7 | struct Sticker; 8 | class Response; 9 | 10 | /** 11 | * Sends one sticker value to the client. 12 | */ 13 | void 14 | sticker_print_value(Response &r, const char *name, const char *value); 15 | 16 | /** 17 | * Sends all sticker values to the client. 18 | */ 19 | void 20 | sticker_print(Response &r, const Sticker &sticker); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/sticker/Sticker.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STICKER_HXX 5 | #define MPD_STICKER_HXX 6 | 7 | #include 8 | #include 9 | 10 | struct Sticker { 11 | std::map> table; 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/storage/StoragePlugin.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "StoragePlugin.hxx" 5 | #include "util/StringCompare.hxx" 6 | 7 | bool 8 | StoragePlugin::SupportsUri(const char *uri) const noexcept 9 | { 10 | if (prefixes == nullptr) 11 | return false; 12 | 13 | for (auto i = prefixes; *i != nullptr; ++i) 14 | if (StringStartsWithIgnoreCase(uri, *i)) 15 | return true; 16 | 17 | return false; 18 | } 19 | -------------------------------------------------------------------------------- /src/storage/plugins/CurlStorage.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STORAGE_CURL_HXX 5 | #define MPD_STORAGE_CURL_HXX 6 | 7 | struct StoragePlugin; 8 | 9 | extern const StoragePlugin curl_storage_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/storage/plugins/LocalStorage.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STORAGE_LOCAL_HXX 5 | #define MPD_STORAGE_LOCAL_HXX 6 | 7 | #include 8 | 9 | struct StoragePlugin; 10 | class Storage; 11 | class Path; 12 | 13 | extern const StoragePlugin local_storage_plugin; 14 | 15 | std::unique_ptr 16 | CreateLocalStorage(Path base_fs); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/storage/plugins/NfsStorage.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STORAGE_NFS_HXX 5 | #define MPD_STORAGE_NFS_HXX 6 | 7 | struct StoragePlugin; 8 | 9 | extern const StoragePlugin nfs_storage_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/storage/plugins/SmbclientStorage.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STORAGE_SMBCLIENT_HXX 5 | #define MPD_STORAGE_SMBCLIENT_HXX 6 | 7 | struct StoragePlugin; 8 | 9 | extern const StoragePlugin smbclient_storage_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/storage/plugins/UdisksStorage.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_STORAGE_UDISKS_HXX 5 | #define MPD_STORAGE_UDISKS_HXX 6 | 7 | struct StoragePlugin; 8 | 9 | extern const StoragePlugin udisks_storage_plugin; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/system/Clock.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Clock.hxx" 5 | 6 | #ifdef _WIN32 7 | #include "time/FileTime.hxx" 8 | 9 | #include 10 | 11 | std::chrono::seconds 12 | GetProcessUptimeS() 13 | { 14 | FILETIME creation_time, exit_time, kernel_time, user_time, now; 15 | GetProcessTimes(GetCurrentProcess(), &creation_time, 16 | &exit_time, &kernel_time, &user_time); 17 | GetSystemTimeAsFileTime(&now); 18 | 19 | return DeltaFileTimeS(now, creation_time); 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/system/Clock.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_CLOCK_H 5 | #define MPD_CLOCK_H 6 | 7 | #ifdef _WIN32 8 | 9 | #include 10 | 11 | /** 12 | * Returns the uptime of the current process in seconds. 13 | */ 14 | [[gnu::pure]] 15 | std::chrono::seconds 16 | GetProcessUptimeS(); 17 | 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/system/EpollFD.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "EpollFD.hxx" 5 | #include "Error.hxx" 6 | 7 | EpollFD::EpollFD() 8 | :fd(AdoptTag{}, ::epoll_create1(EPOLL_CLOEXEC)) 9 | { 10 | if (!fd.IsDefined()) 11 | throw MakeErrno("epoll_create1() failed"); 12 | } 13 | -------------------------------------------------------------------------------- /src/system/linux/meson.build: -------------------------------------------------------------------------------- 1 | system_linux_features = configuration_data() 2 | 3 | if host_machine.system() == 'linux' 4 | system_linux_features.set('HAVE_OPENAT2', compiler.has_header('linux/openat2.h')) 5 | endif 6 | 7 | configure_file(output: 'Features.h', configuration: system_linux_features) 8 | -------------------------------------------------------------------------------- /src/system/linux/openat2.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include // for O_* 8 | #include // for RESOLVE_* 9 | #include 10 | #include 11 | 12 | static inline int 13 | openat2(int dirfd, const char *pathname, 14 | const struct open_how *how, size_t size) 15 | { 16 | return syscall(__NR_openat2, dirfd, pathname, how, size); 17 | } 18 | -------------------------------------------------------------------------------- /src/tag/ApeReplayGain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_APE_REPLAY_GAIN_HXX 5 | #define MPD_APE_REPLAY_GAIN_HXX 6 | 7 | class InputStream; 8 | struct ReplayGainInfo; 9 | 10 | /** 11 | * Throws on I/O error. 12 | */ 13 | bool 14 | replay_gain_ape_read(InputStream &is, ReplayGainInfo &info); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/tag/ApeTag.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_APE_TAG_HXX 5 | #define MPD_APE_TAG_HXX 6 | 7 | class InputStream; 8 | class TagHandler; 9 | 10 | /** 11 | * Scan the APE tags of a stream. 12 | * 13 | * Throws on I/O error. 14 | * 15 | * @param path_fs the path of the file in filesystem encoding 16 | */ 17 | bool 18 | tag_ape_scan2(InputStream &is, TagHandler &handler); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/tag/Config.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_CONFIG_HXX 5 | #define MPD_TAG_CONFIG_HXX 6 | 7 | struct ConfigData; 8 | 9 | void 10 | TagLoadConfig(const ConfigData &config); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /src/tag/FixString.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_STRING_HXX 5 | #define MPD_TAG_STRING_HXX 6 | 7 | #include 8 | 9 | template class AllocatedArray; 10 | 11 | AllocatedArray 12 | FixTagString(std::string_view p) noexcept; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/tag/Format.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_FORMAT_HXX 5 | #define MPD_TAG_FORMAT_HXX 6 | 7 | struct Tag; 8 | 9 | [[gnu::malloc]] [[gnu::nonnull]] 10 | char * 11 | FormatTag(const Tag &tag, const char *format) noexcept; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/tag/Id3Load.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_ID3_LOAD_HXX 5 | #define MPD_TAG_ID3_LOAD_HXX 6 | 7 | #include "Id3Unique.hxx" 8 | 9 | class InputStream; 10 | 11 | /** 12 | * Loads the ID3 tags from the #InputStream into a libid3tag object. 13 | * 14 | * @return nullptr on error or if no ID3 tag was found in the file 15 | */ 16 | UniqueId3Tag 17 | tag_id3_load(InputStream &is); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/tag/Id3MixRamp.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | struct id3_tag; 7 | class MixRampInfo; 8 | 9 | [[gnu::pure]] 10 | MixRampInfo 11 | Id3ToMixRampInfo(const struct id3_tag *tag) noexcept; 12 | -------------------------------------------------------------------------------- /src/tag/Id3MusicBrainz.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_ID3MUSICBRAINZ_HXX 5 | #define MPD_TAG_ID3MUSICBRAINZ_HXX 6 | 7 | extern const struct tag_table musicbrainz_txxx_tags[]; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/tag/Id3Parse.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "Id3Unique.hxx" 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | /** 14 | * Wrapper for id3_tag_parse() which accepts a std::span and returns a 15 | * #UniqueId3Tag. 16 | */ 17 | inline UniqueId3Tag 18 | id3_tag_parse(std::span src) noexcept 19 | { 20 | return UniqueId3Tag{id3_tag_parse(reinterpret_cast(src.data()), src.size())}; 21 | } 22 | -------------------------------------------------------------------------------- /src/tag/Id3Picture.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_ID3_PICTURE_HXX 5 | #define MPD_TAG_ID3_PICTURE_HXX 6 | 7 | #include 8 | 9 | class TagHandler; 10 | 11 | /** 12 | * Scan an "APIC" value and call TagHandler::OnPicture(). 13 | */ 14 | void 15 | ScanId3Apic(std::span buffer, TagHandler &handler) noexcept; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/tag/Id3ReplayGain.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_ID3_REPLAY_GAIN_HXX 5 | #define MPD_TAG_ID3_REPLAY_GAIN_HXX 6 | 7 | struct id3_tag; 8 | struct ReplayGainInfo; 9 | 10 | bool 11 | Id3ToReplayGainInfo(ReplayGainInfo &rgi, const struct id3_tag *tag) noexcept; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/tag/Id3Unique.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_ID3_UNIQUE_HXX 5 | #define MPD_TAG_ID3_UNIQUE_HXX 6 | 7 | #include 8 | 9 | #include 10 | 11 | struct Id3Delete { 12 | void operator()(struct id3_tag *tag) noexcept { 13 | id3_tag_delete(tag); 14 | } 15 | }; 16 | 17 | using UniqueId3Tag = std::unique_ptr; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/tag/MixRampParser.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | class MixRampInfo; 9 | 10 | bool 11 | ParseMixRampTag(MixRampInfo &info, 12 | const char *name, const char *value) noexcept; 13 | 14 | bool 15 | ParseMixRampVorbis(MixRampInfo &info, std::string_view entry) noexcept; 16 | -------------------------------------------------------------------------------- /src/tag/Names.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include "Type.hxx" 7 | 8 | #include 9 | 10 | /** 11 | * An array of strings, which map the #TagType to its machine 12 | * readable name (specific to the MPD protocol). 13 | */ 14 | extern const std::array tag_item_names; 15 | -------------------------------------------------------------------------------- /src/tag/ReplayGainParser.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_REPLAY_GAIN_HXX 5 | #define MPD_TAG_REPLAY_GAIN_HXX 6 | 7 | #include 8 | 9 | struct ReplayGainInfo; 10 | 11 | bool 12 | ParseReplayGainTag(ReplayGainInfo &info, 13 | const char *name, const char *value) noexcept; 14 | 15 | bool 16 | ParseReplayGainVorbis(ReplayGainInfo &info, std::string_view entry) noexcept; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/tag/Rva2.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_RVA2_HXX 5 | #define MPD_TAG_RVA2_HXX 6 | 7 | struct id3_tag; 8 | struct ReplayGainInfo; 9 | 10 | /** 11 | * Parse the RVA2 tag, and fill the #ReplayGainInfo struct. This is 12 | * used by decoder plugins with ID3 support. 13 | * 14 | * @return true on success 15 | */ 16 | bool 17 | tag_rva2_parse(const struct id3_tag *tag, 18 | ReplayGainInfo &replay_gain_info) noexcept; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/tag/Settings.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "Settings.hxx" 5 | #include "Type.hxx" 6 | 7 | TagMask global_tag_mask = TagMask::All() & ~TagMask(TAG_COMMENT); 8 | -------------------------------------------------------------------------------- /src/tag/Settings.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_SETTINGS_HXX 5 | #define MPD_TAG_SETTINGS_HXX 6 | 7 | #include "Mask.hxx" 8 | 9 | extern TagMask global_tag_mask; 10 | 11 | [[gnu::const]] 12 | static inline bool 13 | IsTagEnabled(TagType tag) noexcept 14 | { 15 | return global_tag_mask.Test(tag); 16 | } 17 | 18 | [[gnu::const]] 19 | static inline bool 20 | IsTagEnabled(unsigned tag) noexcept 21 | { 22 | return IsTagEnabled(TagType(tag)); 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/tag/Sort.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | enum TagType : uint8_t; 9 | struct Tag; 10 | 11 | [[gnu::pure]] 12 | bool 13 | CompareTags(TagType type, bool descending, 14 | const Tag &a, const Tag &b) noexcept; 15 | -------------------------------------------------------------------------------- /src/tag/VorbisComment.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "VorbisComment.hxx" 5 | #include "util/StringCompare.hxx" 6 | 7 | #include 8 | 9 | std::string_view 10 | GetVorbisCommentValue(std::string_view entry, std::string_view name) noexcept 11 | { 12 | assert(!name.empty()); 13 | 14 | if (StringStartsWithIgnoreCase(entry, name) && 15 | entry.size() > name.size() && 16 | entry[name.size()] == '=') 17 | return entry.substr(name.size() + 1); 18 | 19 | return {}; 20 | } 21 | -------------------------------------------------------------------------------- /src/tag/VorbisComment.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TAG_VORBIS_COMMENT_HXX 5 | #define MPD_TAG_VORBIS_COMMENT_HXX 6 | 7 | #include 8 | 9 | /** 10 | * Checks if the specified name matches the entry's name, and if yes, 11 | * returns the comment value. 12 | */ 13 | [[gnu::pure]] 14 | std::string_view 15 | GetVorbisCommentValue(std::string_view entry, std::string_view name) noexcept; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/thread/Cond.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef THREAD_COND_HXX 5 | #define THREAD_COND_HXX 6 | 7 | #ifdef _WIN32 8 | 9 | #include "WindowsCond.hxx" 10 | class Cond : public WindowsCond {}; 11 | 12 | #else 13 | 14 | #include 15 | using Cond = std::condition_variable; 16 | 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/thread/Future.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef THREAD_FUTURE_HXX 5 | #define THREAD_FUTURE_HXX 6 | 7 | #ifdef _WIN32 8 | 9 | #include "WindowsFuture.hxx" 10 | 11 | template 12 | using Future = WinFuture; 13 | template 14 | using Promise = WinPromise; 15 | 16 | #else 17 | 18 | #include 19 | 20 | template 21 | using Future = std::future; 22 | template 23 | using Promise = std::promise; 24 | 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/thread/Util.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef THREAD_UTIL_HXX 5 | #define THREAD_UTIL_HXX 6 | 7 | /** 8 | * Lower the current thread's priority to "idle" (very low). 9 | */ 10 | void 11 | SetThreadIdlePriority() noexcept; 12 | 13 | /** 14 | * Raise the current thread's priority to "real-time" (very high). 15 | * 16 | * Throws std::system_error on error. 17 | */ 18 | void 19 | SetThreadRealtime(); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/time/ChronoUtil.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef CHRONO_UTIL_HXX 5 | #define CHRONO_UTIL_HXX 6 | 7 | #include 8 | 9 | template 10 | constexpr bool 11 | IsNegative(const std::chrono::time_point p) 12 | { 13 | return p < std::chrono::time_point(); 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/time/Zone.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | /** 8 | * Determine the time zone offset in a portable way. 9 | */ 10 | [[gnu::const]] 11 | int 12 | GetTimeZoneOffset() noexcept; 13 | -------------------------------------------------------------------------------- /src/time/meson.build: -------------------------------------------------------------------------------- 1 | time = static_library( 2 | 'time', 3 | 'Convert.cxx', 4 | 'ISO8601.cxx', 5 | 'Math.cxx', 6 | 'Zone.cxx', 7 | include_directories: inc, 8 | ) 9 | 10 | time_dep = declare_dependency( 11 | link_with: time, 12 | ) 13 | -------------------------------------------------------------------------------- /src/util/BitReverse.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "BitReverse.hxx" 5 | 6 | static constexpr BitReverseTable 7 | GenerateBitReverseTable() noexcept 8 | { 9 | BitReverseTable table{}; 10 | for (unsigned i = 0; i < 256; ++i) 11 | table.data[i] = BitReverseMultiplyModulus(static_cast(i)); 12 | return table; 13 | } 14 | 15 | const BitReverseTable bit_reverse_table = GenerateBitReverseTable(); 16 | -------------------------------------------------------------------------------- /src/util/Clamp.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef CLAMP_HPP 5 | #define CLAMP_HPP 6 | 7 | /** 8 | * Clamps the specified value in a range. Returns #min or #max if the 9 | * value is outside. 10 | */ 11 | template 12 | constexpr const T & 13 | Clamp(const T &value, const T &min, const T &max) noexcept 14 | { 15 | if (value < min) [[unlikely]] 16 | return min; 17 | 18 | if (value > max) [[unlikely]] 19 | return max; 20 | 21 | return value; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/util/Concepts.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | template 9 | concept Disposer = std::invocable; 10 | -------------------------------------------------------------------------------- /src/util/CopyConst.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | /** 9 | * Generate a type based on #To with the same const-ness as #From. 10 | */ 11 | template 12 | using CopyConst = std::conditional_t, 13 | std::add_const_t, 14 | std::remove_const_t>; 15 | -------------------------------------------------------------------------------- /src/util/DeleteDisposer.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | /** 7 | * A disposer for boost::intrusive that invokes the "delete" operator 8 | * on the given pointer. 9 | */ 10 | class DeleteDisposer { 11 | public: 12 | template 13 | void operator()(T *t) const noexcept { 14 | delete t; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /src/util/LazyRandomEngine.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "LazyRandomEngine.hxx" 5 | 6 | void LazyRandomEngine::AutoCreate() { 7 | if (engine) 8 | return; 9 | 10 | std::random_device rd; 11 | engine.emplace(rd()); 12 | } 13 | -------------------------------------------------------------------------------- /src/util/Math.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef MATH_HXX 5 | #define MATH_HXX 6 | 7 | #include 8 | 9 | /* 10 | * C99 math can be optionally omitted with gcc's libstdc++. 11 | * Use boost if unavailable. 12 | */ 13 | #if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) && !defined(_GLIBCXX_USE_C99_MATH_TR1) 14 | #include 15 | using boost::math::lround; 16 | #else 17 | using std::lround; 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/util/PrintException.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // Copyright CM4all GmbH 3 | // author: Max Kellermann 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | /** 10 | * Print this exception (and its nested exceptions, if any) to stderr. 11 | */ 12 | void 13 | PrintException(const std::exception &e) noexcept; 14 | 15 | void 16 | PrintException(const std::exception_ptr &ep) noexcept; 17 | -------------------------------------------------------------------------------- /src/util/RecursiveMap.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #ifndef RECURSIVE_MAP_HXX 5 | #define RECURSIVE_MAP_HXX 6 | 7 | #include 8 | 9 | /** 10 | * A #std::map which contains instances of itself. 11 | */ 12 | template 13 | class RecursiveMap : public std::map> {}; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/util/Serial.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_SERIAL_HXX 5 | #define MPD_SERIAL_HXX 6 | 7 | /** 8 | * Generate the next pseudo-random serial. 9 | */ 10 | int 11 | GenerateSerial() noexcept; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/util/TruncateString.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #include "TruncateString.hxx" 5 | #include "Compiler.h" 6 | 7 | #include 8 | 9 | #include 10 | 11 | char * 12 | CopyTruncateString(char *gcc_restrict dest, const char *gcc_restrict src, 13 | size_t size) noexcept 14 | { 15 | size_t length = strlen(src); 16 | if (length >= size) 17 | length = size - 1; 18 | 19 | char *p = std::copy_n(src, length, dest); 20 | *p = '\0'; 21 | return p; 22 | } 23 | -------------------------------------------------------------------------------- /src/util/UriQueryParser.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // author: Max Kellermann 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | /** 9 | * Find the first query parameter with the given name and return its 10 | * raw value (without unescaping). 11 | * 12 | * @return the raw value (pointing into the #query_string parameter) 13 | * or nullptr if the parameter does not exist 14 | */ 15 | [[gnu::pure]] 16 | std::string_view 17 | UriFindRawQueryParameter(std::string_view query_string, std::string_view name) noexcept; 18 | -------------------------------------------------------------------------------- /src/win32/PropVariant.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_WIN32_PROPVARIANT_HXX 5 | #define MPD_WIN32_PROPVARIANT_HXX 6 | 7 | #include // needed by propidl.h if COM_NO_WINDOWS_H is defined 8 | #include 9 | 10 | class AllocatedString; 11 | 12 | [[gnu::pure]] 13 | AllocatedString 14 | ToString(const PROPVARIANT &pv) noexcept; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/win32/WinEvent.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "WinEvent.hxx" 5 | #include "system/Error.hxx" 6 | 7 | WinEvent::WinEvent() 8 | :event(CreateEventW(nullptr, false, false, nullptr)) 9 | { 10 | if (!event) 11 | throw MakeLastError("Error creating events"); 12 | } 13 | -------------------------------------------------------------------------------- /src/win32/meson.build: -------------------------------------------------------------------------------- 1 | if not is_windows 2 | win32_dep = dependency('', required: false) 3 | subdir_done() 4 | endif 5 | 6 | win32 = static_library( 7 | 'win32', 8 | 'ComWorker.cxx', 9 | 'HResult.cxx', 10 | 'PropVariant.cxx', 11 | 'WinEvent.cxx', 12 | include_directories: inc, 13 | dependencies: [ 14 | fmt_dep, 15 | ], 16 | ) 17 | 18 | win32_dep = declare_dependency( 19 | link_with: win32, 20 | dependencies: [ 21 | thread_dep, 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /src/zeroconf/Glue.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_ZEROCONF_GLUE_HXX 5 | #define MPD_ZEROCONF_GLUE_HXX 6 | 7 | #include "Helper.hxx" 8 | #include "config.h" 9 | 10 | #include 11 | 12 | struct ConfigData; 13 | class EventLoop; 14 | class ZeroconfHelper; 15 | 16 | #ifdef HAVE_ZEROCONF 17 | 18 | /** 19 | * Throws on error. 20 | */ 21 | std::unique_ptr 22 | ZeroconfInit(const ConfigData &config, EventLoop &loop); 23 | 24 | #endif /* ! HAVE_ZEROCONF */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /subprojects/.gitignore: -------------------------------------------------------------------------------- 1 | /packagecache/ 2 | 3 | /curl-*/ 4 | /expat-*/ 5 | /flac-*/ 6 | /fmt-*/ 7 | /googletest-*/ 8 | /lame-*/ 9 | /libid3tag-*/ 10 | /libmicrohttpd* 11 | /libmpdclient/ 12 | /libnpupnp-*/ 13 | /libogg-*/ 14 | /libsndfile-*/ 15 | /libvorbis-*/ 16 | /liburing-*/ 17 | /nlohmann_json-*/ 18 | /openssl-*/ 19 | /opus-*/ 20 | /sqlite-*/ 21 | -------------------------------------------------------------------------------- /subprojects/id3tag.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = libid3tag-0.15.1b 3 | source_url = ftp://ftp.mars.org/pub/mpeg/libid3tag-0.15.1b.tar.gz 4 | source_filename = libid3tag-0.15.1b.tar.gz 5 | source_hash = 63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151 6 | patch_directory = id3tag 7 | 8 | [provide] 9 | id3tag = libid3tag_dep 10 | -------------------------------------------------------------------------------- /subprojects/libmpdclient.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://github.com/MusicPlayerDaemon/libmpdclient 3 | revision = v2.22 4 | 5 | [provide] 6 | libmpdclient = libmpdclient_dep 7 | -------------------------------------------------------------------------------- /subprojects/libnpupnp.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = libnpupnp-6.2.1 3 | source_url = https://www.lesbonscomptes.com/upmpdcli/downloads/libnpupnp-6.2.1.tar.gz 4 | source_filename = libnpupnp-6.2.1.tar.gz 5 | source_hash = 1cc1222512d480826d2923cc7b98b7361183a2add8c6b646a7fa32c2f34b32b3 6 | source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/libnpupnp_6.2.1-1/libnpupnp-6.2.1.tar.gz 7 | wrapdb_version = 6.2.1-1 8 | 9 | [provide] 10 | libnpupnp = libnpupnp_dep 11 | -------------------------------------------------------------------------------- /subprojects/nlohmann_json.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = nlohmann_json-3.12.0 3 | lead_directory_missing = true 4 | source_url = https://github.com/nlohmann/json/releases/download/v3.12.0/include.zip 5 | source_filename = nlohmann_json-3.12.0.zip 6 | source_hash = b8cb0ef2dd7f57f18933997c9934bb1fa962594f701cd5a8d3c2c80541559372 7 | source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/nlohmann_json_3.12.0-1/nlohmann_json-3.12.0.zip 8 | wrapdb_version = 3.12.0-1 9 | 10 | [provide] 11 | nlohmann_json = nlohmann_json_dep 12 | -------------------------------------------------------------------------------- /subprojects/opus.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = opus-1.5.2 3 | source_url = https://downloads.xiph.org/releases/opus/opus-1.5.2.tar.gz 4 | source_filename = opus-1.5.2.tar.gz 5 | source_hash = 65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 6 | source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/opus_1.5.2-1/opus-1.5.2.tar.gz 7 | wrapdb_version = 1.5.2-1 8 | 9 | [provide] 10 | opus = opus_dep 11 | -------------------------------------------------------------------------------- /systemd/system/mpd.socket.in: -------------------------------------------------------------------------------- 1 | [Socket] 2 | @listen_streams@ 3 | Backlog=5 4 | KeepAlive=true 5 | PassCredentials=true 6 | 7 | [Install] 8 | WantedBy=sockets.target 9 | -------------------------------------------------------------------------------- /test/ConfigGlue.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TEST_CONFIG_GLUE_HXX 5 | #define MPD_TEST_CONFIG_GLUE_HXX 6 | 7 | #include "config/File.hxx" 8 | #include "config/Migrate.hxx" 9 | #include "config/Data.hxx" 10 | #include "fs/Path.hxx" 11 | 12 | inline ConfigData 13 | AutoLoadConfigFile(Path path) 14 | { 15 | ConfigData data; 16 | 17 | if (!path.IsNull()) { 18 | ReadConfigFile(data, path); 19 | Migrate(data); 20 | } 21 | 22 | return data; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /test/NullMixerListener.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef NULL_MIXER_LISTENER_HXX 5 | #define NULL_MIXER_LISTENER_HXX 6 | 7 | #include "mixer/Listener.hxx" 8 | 9 | class NullMixerListener : public MixerListener { 10 | public: 11 | void OnMixerVolumeChanged(Mixer &, int) noexcept override {} 12 | virtual void OnMixerChanged() noexcept override {} 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /test/ReadFrames.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include 5 | 6 | class FileDescriptor; 7 | 8 | std::size_t 9 | ReadFrames(FileDescriptor fd, void *buffer, std::size_t size, 10 | std::size_t frame_size); 11 | -------------------------------------------------------------------------------- /test/RunZeroconf.cxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #include "event/Loop.hxx" 5 | #include "ShutdownHandler.hxx" 6 | #include "zeroconf/Helper.hxx" 7 | 8 | #include 9 | 10 | int 11 | main([[maybe_unused]] int argc, [[maybe_unused]] char **argv) 12 | { 13 | EventLoop event_loop; 14 | const ShutdownHandler shutdown_handler(event_loop); 15 | 16 | const ZeroconfHelper helper(event_loop, "test", "_mpd._tcp", 1234); 17 | 18 | event_loop.Run(); 19 | 20 | return EXIT_SUCCESS; 21 | } 22 | -------------------------------------------------------------------------------- /test/ShutdownHandler.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #ifndef MPD_TEST_SHUTDOWN_HANDLER_HXX 5 | #define MPD_TEST_SHUTDOWN_HANDLER_HXX 6 | 7 | class EventLoop; 8 | 9 | class ShutdownHandler { 10 | public: 11 | explicit ShutdownHandler(EventLoop &loop); 12 | ~ShutdownHandler(); 13 | }; 14 | 15 | #ifdef _WIN32 16 | inline ShutdownHandler::ShutdownHandler(EventLoop &) {} 17 | inline ShutdownHandler::~ShutdownHandler() {} 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /test/fuzzer/FuzzCueParser.cxx: -------------------------------------------------------------------------------- 1 | #include "playlist/cue/CueParser.hxx" 2 | #include "util/IterableSplitString.hxx" 3 | 4 | extern "C" { 5 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); 6 | } 7 | 8 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 9 | { 10 | CueParser parser; 11 | 12 | const std::string_view src{(const char *)data, size}; 13 | 14 | for (const auto line : IterableSplitString(src, '\n')) { 15 | parser.Feed(line); 16 | parser.Get(); 17 | } 18 | 19 | parser.Finish(); 20 | parser.Get(); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/fuzzer/meson.build: -------------------------------------------------------------------------------- 1 | executable( 2 | 'FuzzCueParser', 3 | 'FuzzCueParser.cxx', 4 | '../../src/playlist/cue/CueParser.cxx', 5 | include_directories: inc, 6 | dependencies: [ 7 | tag_dep, 8 | ], 9 | ) 10 | -------------------------------------------------------------------------------- /test/net/meson.build: -------------------------------------------------------------------------------- 1 | test_net_sources = [] 2 | 3 | if have_tcp 4 | test_net_sources += 'TestIPv4Address.cxx' 5 | if have_ipv6 6 | test_net_sources += 'TestIPv6Address.cxx' 7 | endif 8 | endif 9 | 10 | if have_local_socket 11 | test_net_sources += 'TestLocalSocketAddress.cxx' 12 | endif 13 | 14 | test( 15 | 'TestNet', 16 | executable( 17 | 'TestNet', 18 | test_net_sources, 19 | include_directories: inc, 20 | dependencies: [ 21 | net_dep, 22 | fs_dep, 23 | util_dep, 24 | gtest_dep, 25 | ], 26 | ), 27 | protocol: 'gtest', 28 | ) 29 | -------------------------------------------------------------------------------- /test/playlist/PlaylistUtil.hxx: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright The Music Player Daemon Project 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | class SongEnumerator; 10 | 11 | std::unique_ptr 12 | ParsePlaylist(const char *uri, std::string_view contents); 13 | 14 | std::string 15 | ToString(SongEnumerator &e); 16 | -------------------------------------------------------------------------------- /test/playlist/meson.build: -------------------------------------------------------------------------------- 1 | test( 2 | 'TestPlaylistPlugins', 3 | executable( 4 | 'TestPlaylistPlugins', 5 | 'PlaylistUtil.cxx', 6 | 'TestPlsPlaylistPlugin.cxx', 7 | '../../src/SongSave.cxx', 8 | '../../src/TagSave.cxx', 9 | '../../src/TagFile.cxx', 10 | include_directories: inc, 11 | dependencies: [ 12 | gtest_dep, 13 | playlist_glue_dep, 14 | archive_glue_dep, 15 | input_glue_dep, 16 | decoder_glue_dep, 17 | ], 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /test/tag/meson.build: -------------------------------------------------------------------------------- 1 | test( 2 | 'TestMixRamp', 3 | executable( 4 | 'TestMixRamp', 5 | 'TestMixRampParser.cxx', 6 | 'TestMixRampInterpolate.cxx', 7 | include_directories: inc, 8 | dependencies: [ 9 | log_dep, 10 | tag_dep, 11 | util_dep, 12 | gtest_dep, 13 | ], 14 | ), 15 | protocol: 'gtest', 16 | ) 17 | -------------------------------------------------------------------------------- /test/test_archive_bzip2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | SRC_BASE=meson.build 4 | SRC="$(dirname $0)/../${SRC_BASE}" 5 | DST="$(pwd)/test/tmp/${SRC_BASE}.bz2" 6 | 7 | mkdir -p test/tmp 8 | rm -f "$DST" 9 | bzip2 -c "$SRC" >"$DST" 10 | ./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" - 11 | -------------------------------------------------------------------------------- /test/test_archive_iso9660.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | SRC_BASE=meson.build 4 | SRC="$(dirname $0)/../${SRC_BASE}" 5 | DST="$(pwd)/test/tmp/${SRC_BASE}.iso" 6 | 7 | mkdir -p test/tmp 8 | rm -f "$DST" 9 | mkisofs -quiet -l -o "$DST" "$SRC" 10 | 11 | # Using an odd chunk size to check whether the plugin can cope with 12 | # partial sectors 13 | ./test/run_input --chunk-size=1337 "$DST/${SRC_BASE}" |diff "$SRC" - 14 | -------------------------------------------------------------------------------- /test/test_archive_zzip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | SRC_BASE=meson.build 4 | SRC="$(dirname $0)/../${SRC_BASE}" 5 | DST="$(pwd)/test/tmp/${SRC_BASE}.zip" 6 | 7 | mkdir -p test/tmp 8 | rm -f "$DST" 9 | zip --quiet --junk-paths "$DST" "$SRC" 10 | ./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" - 11 | -------------------------------------------------------------------------------- /test/time/meson.build: -------------------------------------------------------------------------------- 1 | test_time_sources = [ 2 | 'TestConvert.cxx', 3 | 'TestISO8601.cxx', 4 | ] 5 | 6 | if is_windows 7 | test_time_sources += 'TestFileTime.cxx' 8 | endif 9 | 10 | test( 11 | 'TestTime', 12 | executable( 13 | 'TestTime', 14 | test_time_sources, 15 | include_directories: inc, 16 | dependencies: [ 17 | time_dep, 18 | gtest_dep, 19 | ], 20 | ), 21 | protocol: 'gtest', 22 | ) 23 | -------------------------------------------------------------------------------- /win32/meson.build: -------------------------------------------------------------------------------- 1 | subdir('res') 2 | -------------------------------------------------------------------------------- /win32/res/mpd.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/daaea3f2b6eb75eaaad5ae032284dd95f0c2516d/win32/res/mpd.ico --------------------------------------------------------------------------------