Something went wrong. Try again.
MPRIS for Zig: a media player's side of the D-Bus remote control interfaces, on mdbus and zig-dbus-service.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: MIT
//! MPRIS for Zig: a media player's side of the Media Player Remote//! Interfacing Specification, the D-Bus interfaces through which desktop//! shells, media keys, `playerctl` and the like see and control players.//!//! A program describes what it is doing as a `State` whenever asked, and//! says what it can do with the commands of a `Server.Player`. The `Server`//! serves `org.mpris.MediaPlayer2` and its `Player`, `TrackList` and//! `Playlists` interfaces from that, and works out from one snapshot to the//! next what to tell the bus.//!//! ```zig//! var connection = try mdbus.Connection.connectSession(io, gpa, environ);//! const server = try mpris.Server.create(gpa, io, &connection, .{//! .name = "myplayer",//! .identity = "My Player",//! .desktop_entry = "myplayer",//! }, .{ .context = &app, .snapshot = snapshot, .play_pause = playPause });//! defer server.destroy();//! try server.start();//! // server.run() on a thread of its own; server.update() when anything changes//! ```
const std = @import("std");
const state = @import("state.zig");
pub const State = state.State;pub const Metadata = state.Metadata;pub const Playlist = state.Playlist;pub const PlaybackStatus = state.PlaybackStatus;pub const LoopStatus = state.LoopStatus;pub const no_track = state.no_track;pub const trackId = state.trackId;
/// An MPRIS player on the session bus.pub const Server = @import("Server.zig");
/// The bindings dbus-codegen generates from the four MPRIS interfaces in/// `dbus/`: what `Server` is built on, and a typed `Client` for each/// interface, for talking to some other player.pub const interfaces = @import("mpris_interfaces");
test { std.testing.refAllDecls(@This()); _ = state; _ = &Server.create; _ = &Server.start; _ = &Server.run; _ = &Server.update;}