Commit Graph

162 Commits

Author SHA1 Message Date
Max Kellermann
ab5b6f83fd queue/Print: support sorting by priority 2022-02-14 14:10:33 +01:00
Max Kellermann
2172aaf1ce song/PrioritySongFilter: new filter
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1412
2022-02-14 14:06:37 +01:00
Max Kellermann
c68dbc4e5c queue/Queue: add method GetLight() 2022-02-14 13:33:34 +01:00
Max Kellermann
c3be961ccf queue/Print: implement sorting 2022-02-14 13:07:13 +01:00
Max Kellermann
e9e3d8c57c queue/Selection: add "window" field 2022-02-14 09:12:18 +01:00
Max Kellermann
5588291a35 queue/Selection: wrap SongFilter in a new struct 2022-02-14 09:12:18 +01:00
Max Kellermann
4b41e766c6 queue/Queue{Save,Print}: remove redundant "Queue" prefix from file name 2022-02-14 09:12:06 +01:00
Max Kellermann
a5fa43b526 fs/io: move to io/ 2021-12-03 14:35:41 +01:00
Max Kellermann
8681a3d74c replace TextFile references with LineReader 2021-12-03 14:22:56 +01:00
Max Kellermann
d94e8bd82d queue/IdTable: include cleanup 2021-11-19 16:03:09 +01:00
Max Kellermann
b0c92e1a34 queue/IdTable: lazy-initialize the "data" array
With large "max_playlist_length" settings, the "data" array can be
very large, and initializing it during MPD startup causes page faults,
resulting in allocation of physical RAM.  This commit postpones the
initialization until the queue is really large, to avoid wasting
memory.
2021-11-19 16:00:39 +01:00
Max Kellermann
ead5bcf048 queue/IdTable: make size const 2021-11-19 15:51:10 +01:00
Max Kellermann
c0bcfe244c command/QueueCommands: reimplement relative "move"/"moveid" offsets
The existing implementation has been utterly broken forever; I cannot
explain what it actually does, but it doesn't do what the
documentation says.
2021-10-07 22:49:38 +02:00
Max Kellermann
b29a43b4d7 decoder/mad, ...: more libfmt logging 2021-06-25 20:52:08 +02:00
Max Kellermann
36410daaa4 queue/PlaylistEdit: fix inverted check
Regression by commit 471c37be59

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1135
2021-05-28 13:56:01 +02:00
Max Kellermann
0440c41cba client/Response: add method Fmt() based on libfmt 2021-05-25 16:01:56 +02:00
Max Kellermann
b2cec7a0a3 Merge branch 'v0.22.x' 2021-05-19 08:09:05 +02:00
Max Kellermann
c3f9b38c97 command/PlaylistCommands: pass real_uri to LookupRemoteTag()
For querying tags, the real song URI should be used, because if the
(display) URI is different, requesting it will not produce a usable
response.  This is a theoretical problem because none of the existing
playlist plugins sets the real_uri.

This requires changing the URI comparison in playlist::TagModified().

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1154
2021-05-18 21:35:09 +02:00
Max Kellermann
471c37be59 queue/PlaylistEdit: convert start/end parameters to RangeArg 2021-02-15 22:51:09 +01:00
Max Kellermann
ab160aa359 queue/PlaylistEdit: check "current>=0" before updating it 2021-02-15 22:50:37 +01:00
Max Kellermann
5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Johann Uhrmann
38498d3ee2 Removed duplicate check for negative song time 2020-08-23 12:17:10 +02:00
Max Kellermann
3d7147390f Merge branch 'v0.21.x' 2020-07-01 16:56:17 +02:00
Max Kellermann
5716cde1fb queue/PlaylistEdit: fix crash in SetSongIdRange() while playing
An assertion failure in UpdateQueuedSong() could trigger because the
`prev` parameter is always `nullptr`, but `queued` may be set.  And in
fact, calling UpdateQueuedSong() is only necessary when the queued
song was edited, to re-queue it with the new range.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/901
2020-06-11 07:07:02 +02:00
Rosen Penev
e41a52d909 change abs() to std::abs()
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:42 +01:00
Rosen Penev
6d91b5c7b2
fix double promotions
Found with -Wdouble-promotion

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 12:43:24 -07:00
Max Kellermann
cefc773992 playlist/PlaylistSong: pass std::string_view 2020-03-13 19:58:36 +01:00
Rosen Penev
a2f5a63bbc
replace stdint.h with cstdint
The former is deprecated by C++14. The standard says they are the same:

The header defines all types and macros the same as the C standard library
header<stdint.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev
ab9f5d2067
replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann
2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann
e1867a99e9 release v0.21.16
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl2m6cwQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEuMlD/9W6UTA9WfbeB2k8F2gFvy30w3jarsIdANG
 iRl2qW8a/MSp6zNj5t3rIH/JTOPEVXgB7c844gIC2VHkKAu4M3kV2sqa7cDEcq6o
 tFH5npemuCFbpkkAqXHpgFindWGMOqZy01PCN8m70y9IbfmI0Q25jngKeeuzgZ9O
 4DHw9IniWNamAi9H3MdGt6BpyuQ+EJ+FOfuJdsJkLgfK15qMn/3LwNoUyCxjyK/K
 brdQO0qpBg7dLZoGb6ER7qkyV1Cp+z/Mqeeocn4iQf3RuepIKzhZFMB1MY9FS7O1
 YAA89Lpk9mvLqx1/LkArrPEOv7k5Ia5KSmxZJ5dsrdXm/TKVM1k0MxZuE7LoXLXp
 wbdhXFoyhuL6lwLkw20wj1zqcTGMAYIp6t48YbDlVy59f/9OVROr++pCQsY+3L2t
 JPY90z6hf6yDF5yZCucSt7gin/WXRdeQLTgAxd8EqGqFgIRrW0GZhssg+7O1iGCq
 aSAVlxfzhVFxz7eyo4u3Dq/+d6gh3NRzV6exUYMxp3WHu7eweemlnKyxPxQ1lvSF
 5EkZXC56wQp0JIcIRYLEXkJN8lmIy/i0xHaOLDB7cJN23CC5Z68Up6peCzvVPp+E
 PIzOtT+4/FnQ6euu6KLHeiDyTWxdmGSrSP1W6cc/FpyLU86ZV/5tLg0bEaNxb9Sl
 lYfRth0D/A==
 =9Cv+
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.16'

release v0.21.16
2019-10-16 12:03:12 +02:00
Max Kellermann
12a86c4975 queue/PlaylistEdit: fix relative destination offset when moving a range
Commit 13208bf5a7 added range support to
the `move` command, but applied the wrong offset to the `to` variable.
When the source range is before the current song, and the song thus
gets decremented by the range size, then the final destination offset
must also be decremented by the range size.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/663
2019-10-15 17:00:16 +02:00
Max Kellermann
07f212c98c SongSave: return DetachedSong, not a std::unique_ptr<>
Eliminate unnecessary dynamic allocations.
2019-09-05 20:58:04 +02:00
Max Kellermann
b03e4ae692 queue/Save: move code to LoadQueueSong() 2019-09-05 20:56:47 +02:00
Max Kellermann
57808d1a1b queue/Save: queue_load_song() throws on error
Don't catch and log exceptions here; let the caller decide.
2019-09-05 20:55:18 +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
3eae3a2826 queue/Queue: allocate MoveRange() buffer on the heap
No variable-length arrays on the stack.
2019-06-06 12:39:42 +02:00
Max Kellermann
3c1f7c77f0 queue/Queue: remove outdated API documentation 2019-06-06 12:38:21 +02:00
Max Kellermann
c3ccbfd407 queue/Playlist: add noexcept 2019-05-31 13:58:57 +02:00
Max Kellermann
de3cd96c76 queue/Playlist: remove destructor 2019-05-31 13:58:57 +02:00
Max Kellermann
d8cf7d1ef0 queue/Playlist: use C++11 initializers 2019-05-31 13:58:57 +02:00
Max Kellermann
57de2470f1 queue/Listener: add noexcept 2019-05-31 13:57:46 +02: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
0e0bc7976f player/Control: add LockGetSyncInfo() 2018-09-23 17:17:57 +02:00
Max Kellermann
224400074c player/CrossFade: use std::chrono::duration 2018-09-22 19:37:02 +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
90201e9970 DetachedSong, db/LightSong, SongFilter: move to src/song/ 2018-08-02 13:51:18 +02:00