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
-(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
-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.
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;
{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}
};