Commit Graph

380 Commits

Author SHA1 Message Date
Max Kellermann
5fb97b81d1 util/AllocatedArray: migrate from {Const,Writable}Buffer to std::span 2022-05-19 20:52:48 +02:00
Max Kellermann
5c300a9f1a tag/ReplayGainParser: add "noexcept" 2022-04-26 21:06:26 +02:00
Max Kellermann
6e1500c251 Merge branch 'v0.23.x' 2022-04-26 21:05:39 +02:00
Max Kellermann
c3d393f214 tag/Id3Picture: fix unaligned access 2022-04-26 21:03:48 +02:00
Max Kellermann
fb8d8242ab tag/ApeLoader: fix unaligned access
Fixes part 4 of https://github.com/MusicPlayerDaemon/MPD/issues/1490
2022-04-26 21:00:41 +02:00
Max Kellermann
166ce0da5a db/VHelper: move CompareTags() to tag/Sort.cxx 2022-02-14 12:37:05 +01:00
Max Kellermann
ad4cf79cc9 tag: new tag "Mood"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1435
2022-02-12 07:50:18 +01:00
Max Kellermann
2240327286 ReplayGainInfo: move to tag/ 2021-12-06 09:28:36 +01:00
Max Kellermann
3452682a42 IcyMetaDataParser: move to tag/ 2021-12-03 16:07:39 +01:00
Max Kellermann
bf287fefb5 decoder/mad: move parse_id3_mixramp() to tag/Id3MixRamp.cxx 2021-12-01 17:11:36 +01:00
Max Kellermann
20bf1d68e6 MixRampInfo: move to tag/ 2021-12-01 17:09:02 +01:00
Max Kellermann
9bc4c168fd tag/MixRamp: rename to MixRampParser.cxx 2021-12-01 17:07:53 +01:00
Max Kellermann
a45949b597 tag/MixRamp: [[gnu::...]] attributes 2021-12-01 15:48:33 +01:00
Max Kellermann
6009d4abab tag/MixRamp: use std::string_view 2021-12-01 15:47:54 +01:00
Max Kellermann
16fb843c9b tag/MixRamp: fix typo which broken MixRamp
Fixes regression by commit 8e0d810968 which is 2 years old, and nobody
noticed.  D'oh, how embarassing!
2021-12-01 15:46:31 +01:00
Rosen Penev
4e0e4c00bf treewide: replace lock_guard with scoped_lock
SonarLint reports the latter to be better:

std::scoped_lock basically provides the same feature as std::lock_guard,
but is more generic: It can lock several mutexes at the same time, with a
deadlock prevention mechanism (see {rule:cpp:S5524}). The equivalent code
to perform simultaneous locking with std::lock_guard is significantly more
complex. Therefore, it is simpler to use std::scoped_lock all the time,
even when locking only one mutex (there will be no performance impact).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:13:03 -08:00
Rosen Penev
31aa6d0c4f use auto with make_unique
C arrays can be used with make_unique in C++17.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 01:33:03 -08:00
Max Kellermann
8e71130e8a tag/FixString: use class AllocatedArray 2021-10-13 14:40:33 +02:00
Max Kellermann
ed7baf3ae1 tag/Id3Scan: use StringView::Strip() instead of duplicating the string 2021-10-13 14:32:43 +02:00
Max Kellermann
1e159af2ce tag/Id3Scan: merge duplicate code into InvokeOnTag() 2021-10-13 14:30:57 +02:00
Max Kellermann
dffed6e393 tag/Id3Scan: add class Id3String 2021-10-13 14:24:17 +02:00
Max Kellermann
f510564d9d more [[gnu::...]] attributes 2021-10-13 12:07:05 +02:00
Max Kellermann
be8ed2f59e tag/Settings: use [[gnu::const]] 2021-10-13 10:37:26 +02:00
Max Kellermann
08491fcd86 tag/Format: use [[gnu::pure]] 2021-10-13 10:37:26 +02:00
Max Kellermann
abed633fcb tag/FixString: use [[gnu::pure]] 2021-10-13 10:37:26 +02:00
Max Kellermann
db2a9cb6d5 tag/Builder: use [[gnu::pure]] 2021-10-13 10:37:26 +02:00
Max Kellermann
7caeb3b0d8 tag/ParseName: use [[gnu::pure]] 2021-10-13 10:32:22 +02:00
Max Kellermann
08500be239 tag/VorbisComment: use [[gnu::pure]] 2021-10-13 10:31:51 +02:00
Max Kellermann
3ef7d8fecb tag/Tag: use [[gnu::pure]] 2021-10-13 10:31:51 +02:00
Max Kellermann
ffde7223b9 tag/Table: use [[gnu::pure]] 2021-10-13 10:31:51 +02:00
Rosen Penev
40c6a214e3 unique_ptr/new to make_unique
The latter is easier to read and is the "correct" thing to do.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-20 23:54:14 -07:00
Max Kellermann
a74b07728e tag/Tag: add Merge() which takes Tag pointers 2021-08-05 17:36:14 +02:00
Max Kellermann
7d69cbbda7 tag/Tag: Merge() returns Tag, MergePtr() returns std::unique_ptr<Tag> 2021-08-05 17:32:23 +02:00
Max Kellermann
c97aabe43a Merge branch 'v0.22.x' 2021-08-05 15:17:07 +02:00
Max Kellermann
bde64a13e2 tag/Builder: do not acquire tag_pool_lock if TagItem list is empty 2021-08-05 14:32:58 +02:00
Max Kellermann
96875921b7 tag/Builder: use std::swap() in move operator
This way, we save the overhead for acquiring the tag_pool_lock.
2021-08-05 14:28:37 +02:00
Cebtenzzre
551c941b5a tag/Builder: don't ignore the result of tag_pool_dup_item
Also, use RemoveAll() instead of directly clearing TagBuilder::items in
most cases, as its elements represent references that must be released.

Closes #1023
2021-08-05 14:25:55 +02:00
Cebtenzzre
624c77ab43 tag/Builder: another missing RemoveAll() call 2021-08-05 14:25:05 +02:00
Cebtenzzre
ba13b4b5d6 tag/Builder: use RemoveAll() to give up references 2021-08-05 14:23:48 +02:00
Cebtenzzre
4b2d9e544c tag/Pool: add [[nodiscard]] 2021-08-05 14:20:59 +02:00
Max Kellermann
a2bdac571a Merge branch 'v0.22.x' 2021-05-17 19:33:15 +02:00
Max Kellermann
650a30d794 Revert "tag/Pool: use strncmp() without strlen() to compare strings"
This reverts commit 1532983fb5.  This
optimization was bad because now all strings match if they are a
prefix of another string, and this caused collisions in the tag string
pool, corrupting the database.
2021-04-15 16:15:44 +02:00
Simon Persson
8f1e7385b7 Add tags relevant to classical music.
This commit adds some tags that are (mostly) interesting for listeners
of classical music.

Ensemble
--------
This is an ensemble that is playing the music, such as Wiener
Philharmoniker. The tag can be used to distinguish the ensemble from the
conductor, composer, soloist, and ensemble, that are generally all in
the "ARTIST" tag.

Movement
-------
The movement number and movement (name) of this track, i.e.  "II" and
"Allegro".

ComposerSort
------------
Allows us to look for Beethoven's 9th under B, for Beethoven, not L for
Ludwig.

Location
--------
This is the location of the recording, e.g. "Wiener Musikverein".
2021-03-10 21:24:25 +01:00
Rosen Penev
44378b7dbe use structured binding declarations
Shorter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-03-04 20:28:02 +01:00
Max Kellermann
d4bbb8c851 Merge branch 'struc' of git://github.com/neheb/MPD 2021-03-04 17:50:53 +01:00
Max Kellermann
6153fca4fc tag/RiffFormat: add struct RiffFmtChunk 2021-02-16 19:50:40 +01:00
Max Kellermann
f090af0a22 tag/RiffFormat: add static_asserts on sizeof() 2021-02-16 19:50:25 +01:00
Max Kellermann
58f420fdca tag/RiffFormat: use CamelCase 2021-02-16 19:24:51 +01:00
Max Kellermann
ded2b31fbc tag/Riff: split into RiffId3.?xx and RiffFormat.hxx 2021-02-16 19:23:01 +01:00
vkostas
a59f1b21a6 Fix: Separate Conductor from Performer
Conductor was incorrectly saved to Performer tag in MPD database
2021-02-07 20:45:01 +01:00