{"action":"created","issue":{"url":"https://api.github.com/repos/cmus/cmus/issues/90","labels_url":"https://api.github.com/repos/cmus/cmus/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/cmus/cmus/issues/90/comments","events_url":"https://api.github.com/repos/cmus/cmus/issues/90/events","html_url":"https://github.com/cmus/cmus/pull/90","id":24934735,"number":90,"title":"D-Bus support","user":{"login":"mahkoh","id":1882250,"avatar_url":"https://avatars.githubusercontent.com/u/1882250?v=3","gravatar_id":"","url":"https://api.github.com/users/mahkoh","html_url":"https://github.com/mahkoh","followers_url":"https://api.github.com/users/mahkoh/followers","following_url":"https://api.github.com/users/mahkoh/following{/other_user}","gists_url":"https://api.github.com/users/mahkoh/gists{/gist_id}","starred_url":"https://api.github.com/users/mahkoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahkoh/subscriptions","organizations_url":"https://api.github.com/users/mahkoh/orgs","repos_url":"https://api.github.com/users/mahkoh/repos","events_url":"https://api.github.com/users/mahkoh/events{/privacy}","received_events_url":"https://api.github.com/users/mahkoh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2013-12-31T23:28:10Z","updated_at":"2015-01-08T22:22:24Z","closed_at":"2014-02-13T05:47:46Z","pull_request":{"url":"https://api.github.com/repos/cmus/cmus/pulls/90","html_url":"https://github.com/cmus/cmus/pull/90","diff_url":"https://github.com/cmus/cmus/pull/90.diff","patch_url":"https://github.com/cmus/cmus/pull/90.patch"},"body":"This is a work in progress\r\n\r\n----------\r\n\r\nThis patch adds D-Bus support to cmus. D-Bus is an IPC protocol and the de-facto standard on the linux desktop. The reference implementation also runs on OS X and Windows. D-Bus is supported by many languages and allows cmus to be tightly integrated into other applications and the desktop via notifications, panels, etc. \r\n\r\nHere is an example of how a python script can communicate with cmus:\r\n\r\n    #!/usr/bin/env python2\r\n    import dbus\r\n\r\n    bus = dbus.SessionBus()\r\n    obj = bus.get_object(\"net.sourceforge.cmus\", \"/net/sourceforge/cmus\", introspect=False)\r\n    cmus = dbus.Interface(obj, \"net.sourceforge.cmus\")\r\n\r\n    print \"currently playing: \", cmus.artist(), \"-\", cmus.title()\r\n\r\nSimilarly we can pause the player, go to the next track, or seek:\r\n\r\n    cmus.pause()\r\n    cmus.next()\r\n    cmus.seek(\"+10\")\r\n\r\nD-Bus supports two (for us relevant) ways of communication: Methods and Signals. We've seen Methods above. Signals allow cmus to tell other programs that an important event happened, e.g., that the track changed. An example of how this works in for python can be found in `dbus/examples/dbus2.py`. \r\n\r\nI've currently implemented many of the methods from `cmus-remote` and three signals: `track_change`, `vol_change`, and `status_change`.  The full documentation of the D-Bus interface can be found in `dbus/dbus.md`. \r\n\r\nD-Bus support can be disabled at compile time via `CONFIG_DBUS=n`."},"comment":{"url":"https://api.github.com/repos/cmus/cmus/issues/comments/69260771","html_url":"https://github.com/cmus/cmus/pull/90#issuecomment-69260771","issue_url":"https://api.github.com/repos/cmus/cmus/issues/90","id":69260771,"user":{"login":"mahkoh","id":1882250,"avatar_url":"https://avatars.githubusercontent.com/u/1882250?v=3","gravatar_id":"","url":"https://api.github.com/users/mahkoh","html_url":"https://github.com/mahkoh","followers_url":"https://api.github.com/users/mahkoh/followers","following_url":"https://api.github.com/users/mahkoh/following{/other_user}","gists_url":"https://api.github.com/users/mahkoh/gists{/gist_id}","starred_url":"https://api.github.com/users/mahkoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahkoh/subscriptions","organizations_url":"https://api.github.com/users/mahkoh/orgs","repos_url":"https://api.github.com/users/mahkoh/repos","events_url":"https://api.github.com/users/mahkoh/events{/privacy}","received_events_url":"https://api.github.com/users/mahkoh/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T22:22:24Z","updated_at":"2015-01-08T22:22:24Z","body":"I'm still maintaining this branch in my fork if anyone else is interested in working on is."}}