forked from external/yambar
mpd: support the single
flag
This flag indicates that `mpd` will automatically stop after the current song is played.
This commit is contained in:
parent
b15714b38a
commit
57711f0dbe
3 changed files with 9 additions and 1 deletions
|
@ -26,11 +26,13 @@
|
||||||
is on.
|
is on.
|
||||||
* Added "string like" `~~` operator to Map particle. Allows glob-style
|
* Added "string like" `~~` operator to Map particle. Allows glob-style
|
||||||
matching on strings using `*` and `?` characters ([#400][400]).
|
matching on strings using `*` and `?` characters ([#400][400]).
|
||||||
|
* Added "single" mode flag to the `mpd` module ([#428][428]).
|
||||||
|
|
||||||
[96]: https://codeberg.org/dnkl/yambar/issues/96
|
[96]: https://codeberg.org/dnkl/yambar/issues/96
|
||||||
[380]: https://codeberg.org/dnkl/yambar/issues/380
|
[380]: https://codeberg.org/dnkl/yambar/issues/380
|
||||||
[392]: https://codeberg.org/dnkl/yambar/issues/392
|
[392]: https://codeberg.org/dnkl/yambar/issues/392
|
||||||
[400]: https://codeberg.org/dnkl/yambar/pulls/400
|
[400]: https://codeberg.org/dnkl/yambar/pulls/400
|
||||||
|
[428]: https://codeberg.org/dnkl/yambar/pulls/428
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -20,6 +20,9 @@ mpd - This module provides MPD status such as currently playing artist/album/son
|
||||||
| consume
|
| consume
|
||||||
: bool
|
: bool
|
||||||
: True if the *consume* flag is set
|
: True if the *consume* flag is set
|
||||||
|
| single
|
||||||
|
: bool
|
||||||
|
: True if the *single* flag is set
|
||||||
| volume
|
| volume
|
||||||
: range
|
: range
|
||||||
: Volume of MPD in percentage
|
: Volume of MPD in percentage
|
||||||
|
|
|
@ -39,6 +39,7 @@ struct private
|
||||||
bool repeat;
|
bool repeat;
|
||||||
bool random;
|
bool random;
|
||||||
bool consume;
|
bool consume;
|
||||||
|
bool single;
|
||||||
int volume;
|
int volume;
|
||||||
char *album;
|
char *album;
|
||||||
char *artist;
|
char *artist;
|
||||||
|
@ -176,6 +177,7 @@ content(struct module *mod)
|
||||||
tag_new_bool(mod, "repeat", m->repeat),
|
tag_new_bool(mod, "repeat", m->repeat),
|
||||||
tag_new_bool(mod, "random", m->random),
|
tag_new_bool(mod, "random", m->random),
|
||||||
tag_new_bool(mod, "consume", m->consume),
|
tag_new_bool(mod, "consume", m->consume),
|
||||||
|
tag_new_bool(mod, "single", m->single),
|
||||||
tag_new_int_range(mod, "volume", m->volume, 0, 100),
|
tag_new_int_range(mod, "volume", m->volume, 0, 100),
|
||||||
tag_new_string(mod, "album", m->album),
|
tag_new_string(mod, "album", m->album),
|
||||||
tag_new_string(mod, "artist", m->artist),
|
tag_new_string(mod, "artist", m->artist),
|
||||||
|
@ -187,7 +189,7 @@ content(struct module *mod)
|
||||||
tag_new_int_realtime(
|
tag_new_int_realtime(
|
||||||
mod, "elapsed", elapsed, 0, m->duration, realtime),
|
mod, "elapsed", elapsed, 0, m->duration, realtime),
|
||||||
},
|
},
|
||||||
.count = 13,
|
.count = 14,
|
||||||
};
|
};
|
||||||
|
|
||||||
mtx_unlock(&mod->lock);
|
mtx_unlock(&mod->lock);
|
||||||
|
@ -336,6 +338,7 @@ update_status(struct module *mod)
|
||||||
m->repeat = mpd_status_get_repeat(status);
|
m->repeat = mpd_status_get_repeat(status);
|
||||||
m->random = mpd_status_get_random(status);
|
m->random = mpd_status_get_random(status);
|
||||||
m->consume = mpd_status_get_consume(status);
|
m->consume = mpd_status_get_consume(status);
|
||||||
|
m->single = mpd_status_get_single_state(status) == MPD_SINGLE_ONESHOT;
|
||||||
m->volume = mpd_status_get_volume(status);
|
m->volume = mpd_status_get_volume(status);
|
||||||
m->duration = mpd_status_get_total_time(status) * 1000;
|
m->duration = mpd_status_get_total_time(status) * 1000;
|
||||||
m->elapsed.value = mpd_status_get_elapsed_ms(status);
|
m->elapsed.value = mpd_status_get_elapsed_ms(status);
|
||||||
|
|
Loading…
Add table
Reference in a new issue