| 1 | module 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 | |
| 8 | struct Mpris {} |
| 9 | |
| 10 | fn media_controls_unavailable() { |
| 11 | eprintln('vendetta: desktop media controls are not built in; rebuild with -d mpris') |
| 12 | } |
| 13 | |
| 14 | fn (mut m Mpris) mpris_free() {} |
| 15 | |
| 16 | fn (mut p Player) start_media_controls() { |
| 17 | media_controls_unavailable() |
| 18 | } |
| 19 | |
| 20 | fn (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 | |
| 27 | fn (mut p Player) mpris_announce() {} |
| 28 | |
| 29 | fn (mut p Player) mpris_push() {} |
| 30 | |
| 31 | fn (mut p Player) mpris_on_position(_ f64) {} |
| 32 | |
| 33 | fn (mut p Player) mpris_seek_started() {} |
| 34 | |
| 35 | fn (mut p Player) mpris_seek_landed() {} |
| 36 | |
| 37 | fn (mut p Player) mpris_on_volume() {} |
| 38 | |
| 39 | fn (mut p Player) drain_mpris() {} |
| 40 | |