Merge branch 'refs/heads/t/image_id_mm'
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 1 Apr 2016 23:59:11 +0000 (01:59 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 2 Apr 2016 00:11:35 +0000 (02:11 +0200)
A single commit that was cooking for several months.

* refs/heads/t/image_id_mm:
  server: Add mood methods image_id and lyrics_id.

NEWS
mm.c
web/manual.m4

diff --git a/NEWS b/NEWS
index a5bef9f633eb8f25319865ea48f79bd8e34785a6..1481f687406a654928adfe9aba85777953770c9f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,11 @@ NEWS
 current master branch "cascading gradient"
 ------------------------------------------
 
+The highlight of this release is the new -m flag for para_afh which
+lets it modify the meta tags of the given audio file(s). This feature
+is supported for all audio formats. Many small cleanups and bug fixes
+not mentioned here have accumulated and are also part of the release.
+
        - para_afh learned to modify meta tags of mp3 wma ogg spx
          opus flac aac files.
        - afs commands propagate error codes to the client.
@@ -12,7 +17,7 @@ current master branch "cascading gradient"
          inconsistencies.
        - New -v flag for the version command (print verbose version string)
        - New option --priority for para_server and para_audiod.
-
+       - New mood methods: image_id and lyrics_id.
 
 --------------------------------------
 0.5.5 (2015-09-20) "magnetic momentum"
diff --git a/mm.c b/mm.c
index d6f3573ce438564f0edbc4c0aafa1a9642470f3d..92856ec3ef903eb905b0379c6eaff605bf6f8d06 100644 (file)
--- a/mm.c
+++ b/mm.c
@@ -191,6 +191,22 @@ static int mm_channels_score_function(__a_unused const char *path,
        return mm_compare_num_score_function(afhi->channels, private);
 }
 
+static int mm_image_id_score_function(__a_unused const char *path,
+               const struct afs_info *afsi,
+               __a_unused const struct afh_info *afhi,
+               const void *private)
+{
+       return mm_compare_num_score_function(afsi->image_id, private);
+}
+
+static int mm_lyrics_id_score_function(__a_unused const char *path,
+               const struct afs_info *afsi,
+               __a_unused const struct afh_info *afhi,
+               const void *private)
+{
+       return mm_compare_num_score_function(afsi->lyrics_id, private);
+}
+
 static int mm_num_played_score_function(__a_unused const char *path,
                const struct afs_info *afsi,
                __a_unused const struct afh_info *afhi,
@@ -356,5 +372,7 @@ const struct mood_method mood_methods[] = {
        {DEFINE_COMPARE_NUM_MOOD_METHOD(frequency)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(channels)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(num_played)},
+       {DEFINE_COMPARE_NUM_MOOD_METHOD(image_id)},
+       {DEFINE_COMPARE_NUM_MOOD_METHOD(lyrics_id)},
        {.parser = NULL}
 };
index d63b07e8cbb69067439db6bca4875f9867908831..59abc5385f9eb5cdcc4a21bfbdb6a30567fa6b90 100644 (file)
@@ -956,12 +956,13 @@ is not set, the empty string is matched against the pattern.
        frequency ~ <num>
        channels ~ <num>
        num_played ~ <num>
+       image_id ~ <num>
+       lyrics_id ~ <num>
 
 Takes a comparator ~ of the set {<, =, <=, >, >=, !=} and a number
 <num>. Matches an audio file iff the condition <val> ~ <num> is
 satisfied where val is the corresponding value of the audio file
-(value of the year tag, bitrate in kbit/s, frequency in Hz, channel
-count, play count).
+(value of the year tag, bitrate in kbit/s, etc.).
 
 The year tag is special as its value is undefined if the audio file
 has no year tag or the content of the year tag is not a number. Such