vendetta / src / mpris_notd_mpris.v
39 lines · 26 sloc · 995 bytes · 77754ad9e6dc749afefba326ff89abc5ddd8c9c9
Raw
1module main
2
3// The default build has no desktop media controls: no libdbus, no worker, no
4// D-Bus types. This file stands in for mpris_d_mpris.v and mpris_glue_d_mpris.v
5// with the same names the app calls, so the rest of the app builds unchanged
6// and every call is a no-op. Build with -d mpris to get the real service.
7
8struct Mpris {}
9
10fn media_controls_unavailable() {
11 eprintln('vendetta: desktop media controls are not built in; rebuild with -d mpris')
12}
13
14fn (mut m Mpris) mpris_free() {}
15
16fn (mut p Player) start_media_controls() {
17 media_controls_unavailable()
18}
19
20fn (mut p Player) set_media_controls(on bool) {
21 if on && !p.media_controls {
22 media_controls_unavailable()
23 }
24 p.media_controls = on
25}
26
27fn (mut p Player) mpris_announce() {}
28
29fn (mut p Player) mpris_push() {}
30
31fn (mut p Player) mpris_on_position(_ f64) {}
32
33fn (mut p Player) mpris_seek_started() {}
34
35fn (mut p Player) mpris_seek_landed() {}
36
37fn (mut p Player) mpris_on_volume() {}
38
39fn (mut p Player) drain_mpris() {}
40