Skip to content

lkrasner/mpris-cxx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpris-cxx

A C++ implementation of the MPRIS standard to control media players using the dbus-C++ library

Requirements

make

gcc

pkg-config

libdbus-C++ (http://dbus-cplusplus.sourceforge.net/)

Installation

./configure
make
sudo make install

Example

//test.cpp

#include <mpris-cxx.hpp>

int main(int argc, char** argv)
{
	//initiallize a DBus dispatcher
	DBus::BusDispatcher dispatcher;
	//Set as defualt
	DBus::default_dispatcher = &dispatcher;
	//initialize the bus connection
	DBus::Connection bus = DBus::Connection::SessionBus();

	//connect to the Root object of clementines mpris interface
	Mpris Root(bus, "/", "org.mpris.clementine");
	//Attach to the Player as well
	Mpris Player(bus, "/Player", "org.mpris.clementine");

	//Print the Identity, pause, and quit
	std::cout << Root.Identity() << std::endl;
	Player.Pause();
	Root.Quit();
}

About

A simple binding of the MPRIS media control standard in C++ using dbus-c++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages