track being played and later picked at random. Fixes a long-standing
TODO...
The 'gap' directive will no longer work. It could be restored if there
is real demand.
The 'gap' directive will no longer work. It could be restored if there
is real demand.
+*** Random Track Choice
+
+This has been completely rewritten to support new features:
+ - tracks in the recently-played list or in the queue are no longer
+ eligible for random choice
+ - there is a new configuration item replay_min defining the minimum
+ time before a played track can be picked at random. The default is
+ 8 hours (which matches the earlier behaviour).
+
* Changes up to version 3.0
Important! See README.upgrades when upgrading.
* Changes up to version 3.0
Important! See README.upgrades when upgrading.
The minimum number of seconds that must elapse between password reminders.
The default is 600, i.e. 10 minutes.
.TP
The minimum number of seconds that must elapse between password reminders.
The default is 600, i.e. 10 minutes.
.TP
+.B replay_min \fISECONDS\fR
+The minimum number of seconds that must elapse after a track has been played
+before it can be picked at random. The default is 8 hours. If this is set to
+0 then there is no limit, though current \fBdisorder-choose\fR will not pick
+anything currently listed in the recently-played list.
+.TP
.B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
Describes the sample format expected by the \fBspeaker_command\fR (below).
The components of the format specification are as follows:
.B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
Describes the sample format expected by the \fBspeaker_command\fR (below).
The components of the format specification are as follows:
{ C(plugins), &type_string_accum, validate_isdir },
{ C(prefsync), &type_integer, validate_positive },
{ C(queue_pad), &type_integer, validate_positive },
{ C(plugins), &type_string_accum, validate_isdir },
{ C(prefsync), &type_integer, validate_positive },
{ C(queue_pad), &type_integer, validate_positive },
+ { C(replay_min), &type_integer, validate_non_negative },
{ C(refresh), &type_integer, validate_positive },
{ C(reminder_interval), &type_integer, validate_positive },
{ C2(restrict, restrictions), &type_restrict, validate_any },
{ C(refresh), &type_integer, validate_positive },
{ C(reminder_interval), &type_integer, validate_positive },
{ C2(restrict, restrictions), &type_restrict, validate_any },
c->sample_format.channels = 2;
c->sample_format.endian = ENDIAN_NATIVE;
c->queue_pad = 10;
c->sample_format.channels = 2;
c->sample_format.endian = ENDIAN_NATIVE;
c->queue_pad = 10;
+ c->replay_min = 8 * 3600;
c->api = -1;
c->multicast_ttl = 1;
c->multicast_loop = 1;
c->api = -1;
c->multicast_ttl = 1;
c->multicast_loop = 1;
/** @brief Target queue length */
long queue_pad;
/** @brief Target queue length */
long queue_pad;
+ /** @brief Minimum time between a track being played again */
+ long replay_min;
+
struct namepartlist namepart; /* transformations */
/** @brief Termination signal for subprocesses */
struct namepartlist namepart; /* transformations */
/** @brief Termination signal for subprocesses */
if((s = kvp_get(prefs, "played_time"))) {
last = atoll(s);
now = time(0);
if((s = kvp_get(prefs, "played_time"))) {
last = atoll(s);
now = time(0);
- if(now < last + 8 * 3600) /* TODO configurable */
+ if(now < last + config->replay_min)