Commit Graph

371 Commits

Author SHA1 Message Date
Max Kellermann 72ec641f0d *: use auto 2020-02-01 14:02:43 +01:00
Rosen Penev b64fdae938 [clang-tidy] use override instead of virtual
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-31 21:27:26 -08:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Markus Mittendrein 7dea5db5df playlist/PlaylistSong: also copy start and end time in merge_song_metadata
This is needed to correctly load playlist entries that reference a song in a cuesheet that is treated as a folder.
2020-01-01 22:20:39 +01:00
Max Kellermann d63e2c2641 db/update: scan CUE playlist contents
This commit adds a PlaylistPlugin attribute "as_folder" which for now
is only enabled in the "CUE" playlist plugin (which handles separate
"*.cue" files).  If a playlist with this flag set is being scanned
during database update, it will be parsed and its contents will be
added to the database.  This allows clients to inspect them like
directories and its contents will be searchable.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/39
2019-09-08 00:39:53 +02:00
Max Kellermann 0fd6235a66 playlist/Registry: add FindPlaylistPluginBySuffix() 2019-09-02 20:28:14 +02:00
Max Kellermann 4d11745156 playlist/Plugin: add SupportsSuffix(), SupportsMimeType() 2019-09-02 20:19:47 +02:00
Max Kellermann f885e068c8 playlist/Plugin: add constructors 2019-09-01 15:01:58 +02:00
Max Kellermann 0d16772dea playlist/Plugin: rename with CamelCase 2019-09-01 14:58:49 +02:00
Max Kellermann ca9daf5e19 playlist/flac: set song URI to an empty string
Simplify the plugin by using a trivial relative URI; later,
playlist_check_translate_song() will set the correct full URI.
2019-08-16 14:55:12 +02:00
Max Kellermann f909615b14 include cleanups (powered by iwyu) 2019-08-15 17:57:20 +02:00
Max Kellermann 92c89f0c86 playlist/flac: allow reading from FLAC streams 2019-08-15 11:13:39 +02:00
Max Kellermann 34246eb7fd playlist/flac: read the file only once using FLAC__Metadata_Chain 2019-08-15 10:40:48 +02:00
Max Kellermann 5894514ccb playlist/flac: move code to ToSongEnumerator() 2019-08-15 10:40:37 +02:00
Max Kellermann dcb07e6ed4 playlist/flac: use class MemorySongEnumerator 2019-08-15 09:45:03 +02:00
Max Kellermann ccffff9870 playlist/flac: use the NarrowPath for FLAC__metadata_get_streaminfo() 2019-08-15 09:44:20 +02:00
Max Kellermann a8f314190f playlist/flac: add noexcept 2019-08-14 20:08:55 +02:00
Max Kellermann 9c6850210d util/UriExtract: uri_get_scheme() returns StringView
Reduce overhead by not duplicating the string.
2019-08-09 20:21:37 +02:00
Max Kellermann 40a2880857 util/UriUtil: split 2019-08-09 20:21:12 +02:00
Max Kellermann cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
Max Kellermann 991bbea875 Merge branch 'v0.21.x' 2019-07-29 11:32:00 +02:00
Max Kellermann 1033dbca2b playlist/Song: add missing includes 2019-07-29 11:31:30 +02:00
Max Kellermann 90ea3bf985 playlist/Song: support backslash in relative URIs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/607
2019-07-29 09:58:53 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann 7de6e4dbac playlist/Registry: eliminate MIME type copy 2019-06-11 19:32:45 +02:00
Max Kellermann 15dbb8082e playlist/Registry: pass StringView to playlist_list_open_stream_mime2() 2019-06-11 19:31:22 +02:00
Max Kellermann 74380d2ae4 playlist/Registry: use initializer instead of memset() 2019-06-11 19:27:59 +02:00
Max Kellermann d43ce8413a playlist/Plugin: update API documentation 2019-06-11 19:26:15 +02:00
Max Kellermann 548aa00111 tag/Handler: pass StringView to OnTag() and OnPair()
Eliminates a number of allocations, because callers don't need to copy
the strings to a newly allocated buffer only to null-terminate them.
And most callers don't need to have a null-terminated string.
2019-06-06 13:00:53 +02:00
Max Kellermann 0a0cc66e8f thread/Mutex: use using instead of making it a derived class
Prepare the transition to std::mutex.
2019-05-07 19:23:01 +02:00
Max Kellermann 2c6ebe28e9 playlist/EmbeddedCue:: wrap CueParser in std::unique_ptr<> 2019-04-26 14:58:09 +02:00
Max Kellermann 401f06f367 playlist/EmbeddedCue: add noexcept 2019-04-26 14:57:03 +02:00
Max Kellermann 0d98677212 playlist/flac: copy the URI to fix use-after-free bug
Closes https://github.com/MusicPlayerDaemon/MPD/issues/508
2019-03-14 19:30:33 +01:00
Stefano Miccoli b3a458338a allow loading playlists specified as absolute filesystem paths
implement for the "load" command the same logic used for the "add"
command: local clients can load playlist specified as absolute paths.

For relative paths the old logic is preserved: first look for a stored
playlist, then look in the music directory.
2019-02-26 00:12:09 +01:00
Max Kellermann e9c45a9140 playlist/Registry: add RAII class 2019-02-05 23:03:29 +01:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann 94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann e3142312bb player/Control: convert to class 2018-09-21 18:12:28 +02:00
Max Kellermann ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann 1ba35e1fd4 Merge tag 'v0.20.21'
release v0.20.21
2018-08-17 20:02:27 +02:00
Max Kellermann fcf487f4e0 playlist/cue: support file type declaration "FLAC" (non-standard)
According to http://wiki.hydrogenaud.io/index.php?title=Cue_sheet FLAC
files should use the "WAVE" file type, but I recently encountered CUE
files declared as "FLAC" which could not be read by MPD.
2018-08-13 08:18:18 +02:00
Max Kellermann 90201e9970 DetachedSong, db/LightSong, SongFilter: move to src/song/ 2018-08-02 13:51:18 +02:00
Max Kellermann cf471e830f Merge branch 'v0.20.x' 2018-08-02 11:07:40 +02:00
Max Kellermann 906972973e case-insensitive URI scheme comparison
Required according to RFC 3986:

> An implementation should accept uppercase letters as equivalent to
> lowercase in scheme names

Closes #330
2018-08-02 11:01:45 +02:00
Max Kellermann 32290d5eb8 fs/Path: add method ToUTF8Throw() 2018-07-18 16:51:29 +02:00
Max Kellermann 61a119b607 playlist/Registry: use struct ConfigData 2018-07-17 22:10:32 +02:00
Max Kellermann 5b192beaa5 config/Global: remove ConfigBlock::SetUsed() call, let caller do that
This fixes an old bug which caused the "unused" warnings to be
unreliable; only the first block in the list was marked as being
"used", no matter if it was really used, and the rest was never marked
as "used", suppressing all warnings for them.
2018-07-17 21:08:41 +02:00
Max Kellermann 816603fd9a config/Config*: rename files, drop "Config" prefix 2018-07-16 19:50:07 +02:00