| 1 |
/* |
| 2 |
* dbus.h -- D-BUS interface |
| 3 |
* |
| 4 |
* Copyright (C) 2007-2008 Igalia, S.L. |
| 5 |
* Authors: Mario Sanchez Prada <msanchez@igalia.com> |
| 6 |
* Alberto Garcia <agarcia@igalia.com> |
| 7 |
* |
| 8 |
* This file is part of Vagalume and is published under the GNU GPLv3 |
| 9 |
* See the README file for more details. |
| 10 |
*/ |
| 11 |
|
| 12 |
#ifndef VAGALUME_DBUS_H |
| 13 |
#define VAGALUME_DBUS_H |
| 14 |
|
| 15 |
#include "globaldefs.h" |
| 16 |
#include "playlist.h" |
| 17 |
#include "controller.h" |
| 18 |
|
| 19 |
#define APP_DBUS_SERVICE "com.igalia." APP_NAME_LC |
| 20 |
#define APP_DBUS_OBJECT "/com/igalia/" APP_NAME_LC |
| 21 |
#define APP_DBUS_IFACE APP_DBUS_SERVICE |
| 22 |
|
| 23 |
/* D-Bus methods */ |
| 24 |
#define APP_DBUS_METHOD_PLAYURL "PlayUrl" |
| 25 |
#define APP_DBUS_METHOD_PLAY "Play" |
| 26 |
#define APP_DBUS_METHOD_STOP "Stop" |
| 27 |
#define APP_DBUS_METHOD_SKIP "Skip" |
| 28 |
#define APP_DBUS_METHOD_LOVETRACK "LoveTrack" |
| 29 |
#define APP_DBUS_METHOD_BANTRACK "BanTrack" |
| 30 |
#define APP_DBUS_METHOD_SHOWWINDOW "ShowWindow" |
| 31 |
#define APP_DBUS_METHOD_HIDEWINDOW "HideWindow" |
| 32 |
#define APP_DBUS_METHOD_CLOSEAPP "CloseApp" |
| 33 |
#define APP_DBUS_METHOD_VOLUMEUP "VolumeUp" |
| 34 |
#define APP_DBUS_METHOD_VOLUMEDOWN "VolumeDown" |
| 35 |
#define APP_DBUS_METHOD_SETVOLUME "SetVolume" |
| 36 |
#define APP_DBUS_METHOD_TOPAPP "top_application" |
| 37 |
#define APP_DBUS_METHOD_REQUEST_STATUS "request_status" |
| 38 |
|
| 39 |
/* D-Bus signals */ |
| 40 |
#define APP_DBUS_SIGNAL_NOTIFY "notify" |
| 41 |
#define APP_DBUS_SIGNAL_NOTIFY_PLAYING "playing" |
| 42 |
#define APP_DBUS_SIGNAL_NOTIFY_STOPPED "stopped" |
| 43 |
#define APP_DBUS_SIGNAL_NOTIFY_STARTED "started" |
| 44 |
#define APP_DBUS_SIGNAL_NOTIFY_CLOSING "closing" |
| 45 |
|
| 46 |
#ifdef HAVE_GSD_MEDIA_PLAYER_KEYS |
| 47 |
|
| 48 |
/* Gnome Settings Daemon - Media Player Keys D-Bus interface */ |
| 49 |
#define GSD_DBUS_SERVICE "org.gnome.SettingsDaemon" |
| 50 |
#define GSD_DBUS_MK_OBJECT "/org/gnome/SettingsDaemon/MediaKeys" |
| 51 |
#define GSD_DBUS_MK_IFACE GSD_DBUS_SERVICE ".MediaKeys" |
| 52 |
|
| 53 |
#define GSD_DBUS_MK_GRAB_KEYS "GrabMediaPlayerKeys" |
| 54 |
#define GSD_DBUS_MK_RELEASE_KEYS "ReleaseMediaPlayerKeys" |
| 55 |
#define GSD_DBUS_MK_KEYPRESSED "MediaPlayerKeyPressed" |
| 56 |
#define GSD_DBUS_MK_KEYPRESSED_STOP "Stop" |
| 57 |
#define GSD_DBUS_MK_KEYPRESSED_PLAY "Play" |
| 58 |
#define GSD_DBUS_MK_KEYPRESSED_PREVIOUS "Previous" |
| 59 |
#define GSD_DBUS_MK_KEYPRESSED_NEXT "Next" |
| 60 |
|
| 61 |
#endif /* HAVE_GSD_MEDIA_PLAYER_KEYS */ |
| 62 |
|
| 63 |
typedef enum { |
| 64 |
DBUS_INIT_OK, |
| 65 |
DBUS_INIT_ERROR, |
| 66 |
DBUS_INIT_ALREADY_RUNNING |
| 67 |
} DbusInitReturnCode; |
| 68 |
|
| 69 |
DbusInitReturnCode |
| 70 |
lastfm_dbus_init (VglController *controller); |
| 71 |
|
| 72 |
void |
| 73 |
lastfm_dbus_close (void); |
| 74 |
|
| 75 |
void |
| 76 |
lastfm_dbus_notify_playback (LastfmTrack *track); |
| 77 |
|
| 78 |
void |
| 79 |
lastfm_dbus_notify_started (void); |
| 80 |
|
| 81 |
void |
| 82 |
lastfm_dbus_notify_closing (void); |
| 83 |
|
| 84 |
void |
| 85 |
lastfm_dbus_play_radio_url (const char *url); |
| 86 |
|
| 87 |
#endif |