]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Add num_played mood method.
authorAndre Noll <maan@systemlinux.org>
Sun, 19 Jul 2009 16:47:23 +0000 (18:47 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 19 Jul 2009 16:47:23 +0000 (18:47 +0200)
README.afs
mm.c

index edd2d17be98591391a7d3ceab0a820cf12b77763..46e30c4542f3ba619e8b5109ac3ddab98214623b 100644 (file)
@@ -178,18 +178,19 @@ is not set, the empty string is matched against the pattern.
        bitrate ~ <num>
        frequency ~ <num>
        channels ~ <num>
        bitrate ~ <num>
        frequency ~ <num>
        channels ~ <num>
+       num_played ~ <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
 
 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
-(bitrate in kbit/s, frequency in Hz, channel count, value of the
-year tag).
+(value of the year tag, bitrate in kbit/s, frequency in Hz, channel
+count, play count).
 
 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
 audio files never match. Another difference is the special treatment
 if the year tag is a two-digit number. In this case either 1900 or
 
 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
 audio files never match. Another difference is the special treatment
 if the year tag is a two-digit number. In this case either 1900 or
-2000 are added to the tag value, depending on whether the number is
+2000 are added to the tag value depending on whether the number is
 greater than 2000 plus the current year.
 
 
 greater than 2000 plus the current year.
 
 
diff --git a/mm.c b/mm.c
index 4f76d40f306f1de0706617c04e27dd3281e7ff40..885b6307d80bfc86664f1933daef52988260574b 100644 (file)
--- a/mm.c
+++ b/mm.c
@@ -187,6 +187,14 @@ static int mm_channels_score_function(__a_unused const char *path,
        return mm_compare_num_score_function(afhi->channels, private);
 }
 
        return mm_compare_num_score_function(afhi->channels, 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,
+               const void *private)
+{
+       return mm_compare_num_score_function(afsi->num_played, private);
+}
+
 struct mm_year_data {
        /** Comparator and year given at the mood line. */
        struct mm_compare_num_data *cnd;
 struct mm_year_data {
        /** Comparator and year given at the mood line. */
        struct mm_compare_num_data *cnd;
@@ -343,5 +351,6 @@ const struct mood_method mood_methods[] = {
        {DEFINE_COMPARE_NUM_MOOD_METHOD(bitrate)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(frequency)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(channels)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(bitrate)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(frequency)},
        {DEFINE_COMPARE_NUM_MOOD_METHOD(channels)},
+       {DEFINE_COMPARE_NUM_MOOD_METHOD(num_played)},
        {.parser = NULL}
 };
        {.parser = NULL}
 };