64
64
#define RB_PLAYLIST_MGR_VERSION (xmlChar *) "1.0"
65
65
#define RB_PLAYLIST_MGR_PL (xmlChar *) "rhythmdb-playlists"
67
#define RB_PLAYLIST_MANAGER_IFACE_NAME "org.gnome.Rhythmbox.PlaylistManager"
68
#define RB_PLAYLIST_MANAGER_DBUS_PATH "/org/gnome/Rhythmbox/PlaylistManager"
67
#define RB_PLAYLIST_MANAGER_IFACE_NAME "org.gnome.Rhythmbox3.PlaylistManager"
68
#define RB_PLAYLIST_MANAGER_DBUS_PATH "/org/gnome/Rhythmbox3/PlaylistManager"
70
70
static const char *rb_playlist_manager_dbus_spec =
72
" <interface name='org.gnome.Rhythmbox.PlaylistManager'>"
73
" <method name='getPlaylists'>"
72
" <interface name='org.gnome.Rhythmbox3.PlaylistManager'>"
73
" <method name='GetPlaylists'>"
74
74
" <arg type='as' direction='out'/>"
76
" <method name='createPlaylist'>"
77
" <arg type='s' name='name'/>"
79
" <method name='deletePlaylist'>"
80
" <arg type='s' name='name'/>"
82
" <method name='addToPlaylist'>"
83
" <arg type='s' name='playlist'/>"
84
" <arg type='s' name='uri'/>"
86
" <method name='removeFromPlaylist'>"
87
" <arg type='s' name='playlist'/>"
88
" <arg type='s' name='uri'/>"
90
" <method name='exportPlaylist'>"
76
" <method name='CreatePlaylist'>"
77
" <arg type='s' name='name'/>"
79
" <method name='DeletePlaylist'>"
80
" <arg type='s' name='name'/>"
82
" <method name='AddToPlaylist'>"
83
" <arg type='s' name='playlist'/>"
84
" <arg type='s' name='uri'/>"
86
" <method name='RemoveFromPlaylist'>"
87
" <arg type='s' name='playlist'/>"
88
" <arg type='s' name='uri'/>"
90
" <method name='ExportPlaylist'>"
91
91
" <arg type='s' name='playlist'/>"
92
92
" <arg type='s' name='uri'/>"
93
93
" <arg type='b' name='mp3_format'/>"
95
" <method name='importPlaylist'>"
95
" <method name='ImportPlaylist'>"
96
96
" <arg type='s' name='uri'/>"
1626
if (g_strcmp0 (method_name, "getPlaylists") == 0) {
1626
if (g_strcmp0 (method_name, "GetPlaylists") == 0) {
1629
1629
rb_playlist_manager_get_playlist_names (mgr, &names, NULL);
1630
1630
g_dbus_method_invocation_return_value (invocation,
1631
1631
g_variant_new_strv ((const char * const *)names, -1));
1632
1632
g_strfreev (names);
1633
} else if (g_strcmp0 (method_name, "createPlaylist") == 0) {
1633
} else if (g_strcmp0 (method_name, "CreatePlaylist") == 0) {
1634
1634
g_variant_get (parameters, "(&s)", &name);
1635
1635
if (rb_playlist_manager_create_static_playlist (mgr, name, &error)) {
1636
1636
g_dbus_method_invocation_return_value (invocation, NULL);
1638
1638
g_dbus_method_invocation_return_gerror (invocation, error);
1639
1639
g_clear_error (&error);
1641
} else if (g_strcmp0 (method_name, "deletePlaylist") == 0) {
1641
} else if (g_strcmp0 (method_name, "DeletePlaylist") == 0) {
1642
1642
g_variant_get (parameters, "(&s)", &name);
1643
1643
if (rb_playlist_manager_delete_playlist (mgr, name, &error)) {
1644
1644
g_dbus_method_invocation_return_value (invocation, NULL);
1646
1646
g_dbus_method_invocation_return_gerror (invocation, error);
1647
1647
g_clear_error (&error);
1649
} else if (g_strcmp0 (method_name, "addToPlaylist") == 0) {
1649
} else if (g_strcmp0 (method_name, "AddToPlaylist") == 0) {
1650
1650
g_variant_get (parameters, "(ss)", &name, &uri);
1651
1651
if (rb_playlist_manager_add_to_playlist (mgr, name, uri, &error)) {
1652
1652
g_dbus_method_invocation_return_value (invocation, NULL);
1654
1654
g_dbus_method_invocation_return_gerror (invocation, error);
1655
1655
g_clear_error (&error);
1657
} else if (g_strcmp0 (method_name, "removeFromPlaylist") == 0) {
1657
} else if (g_strcmp0 (method_name, "RemoveFromPlaylist") == 0) {
1658
1658
g_variant_get (parameters, "(ss)", &name, &uri);
1659
1659
if (rb_playlist_manager_remove_from_playlist (mgr, name, uri, &error)) {
1660
1660
g_dbus_method_invocation_return_value (invocation, NULL);
1662
1662
g_dbus_method_invocation_return_gerror (invocation, error);
1663
1663
g_clear_error (&error);
1665
} else if (g_strcmp0 (method_name, "exportPlaylist") == 0) {
1665
} else if (g_strcmp0 (method_name, "ExportPlaylist") == 0) {
1666
1666
gboolean m3u_format;
1667
1667
g_variant_get (parameters, "(ssb)", &name, &uri, &m3u_format);
1668
1668
if (rb_playlist_manager_export_playlist (mgr, name, uri, m3u_format, &error)) {
1671
1671
g_dbus_method_invocation_return_gerror (invocation, error);
1672
1672
g_clear_error (&error);
1674
} else if (g_strcmp0 (method_name, "importPlaylist") == 0) {
1674
} else if (g_strcmp0 (method_name, "ImportPlaylist") == 0) {
1675
1675
g_variant_get (parameters, "(s)", &uri);
1676
1676
if (rb_playlist_manager_parse_file (mgr, uri, &error)) {
1677
1677
g_dbus_method_invocation_return_value (invocation, NULL);