aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-08-17 17:43:34 +0100
committerConor Curran <conor.curran@canonical.com>2010-08-17 17:43:34 +0100
commitf18466945a43718111ec93a79f1936157b02ce3f (patch)
treeec71788e99e1c1c404aa61f1d3fff0052790311e /src
parent7aa4517861e27a0857d36e83844d670446c22ee6 (diff)
downloadayatana-indicator-sound-f18466945a43718111ec93a79f1936157b02ce3f.tar.gz
ayatana-indicator-sound-f18466945a43718111ec93a79f1936157b02ce3f.tar.bz2
ayatana-indicator-sound-f18466945a43718111ec93a79f1936157b02ce3f.zip
we have mpris 2 basic stuff working with rb perfectly
Diffstat (limited to 'src')
-rw-r--r--src/mpris2-controller.vala13
-rw-r--r--src/player-controller.vala32
-rw-r--r--src/sound-service.c4
3 files changed, 10 insertions, 39 deletions
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index c5ca0a5..8b937b7 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -34,23 +34,24 @@ public interface MprisRoot : DBus.Object {
[DBus (name = "org.mpris.MediaPlayer2.Player")]
public interface MprisPlayer : DBus.Object {
-
+
+ // properties
public abstract HashTable<string, Value?> Metadata{owned get; set;}
public abstract int32 Position{owned get; set;}
public abstract string PlaybackStatus{owned get; set;}
-
+ // methods
public abstract void SetPosition(DBus.ObjectPath path, int64 pos) throws DBus.Error;
public abstract void PlayPause() throws DBus.Error;
public abstract void Pause() throws DBus.Error;
public abstract void Next() throws DBus.Error;
public abstract void Previous() throws DBus.Error;
-
+ // signals
public signal void Seeked(int64 new_position);
- //public signal void PropertiesChanged(string source, HashTable<string, Value?> changed_properties, string[] invalid);
}
[DBus (name = "org.freedesktop.DBus.Properties")]
public interface FreeDesktopProperties : DBus.Object{
+ // signals
public signal void PropertiesChanged(string source, HashTable<string, Value?> changed_properties, string[] invalid);
}
@@ -96,7 +97,7 @@ public class Mpris2Controller : GLib.Object
{
debug("properties-changed for interface %s", interface_source);
if(changed_properties == null || interface_source.has_prefix(this.root_interface) == false){
- warning("Property-changed hash is null");
+ warning("Property-changed hash is null or this is an interface that concerns us");
return;
}
Value? play_v = changed_properties.lookup("PlaybackStatus");
@@ -160,8 +161,6 @@ public class Mpris2Controller : GLib.Object
MetadataMenuitem.attributes_format());
this.owner.custom_items[PlayerController.widget_order.SCRUB].update(this.player.Metadata,
ScrubMenuitem.attributes_format());
- ScrubMenuitem scrub = this.owner.custom_items[PlayerController.widget_order.SCRUB] as ScrubMenuitem;
- scrub.update_position(this.player.Position);
}
public void transport_event(TransportMenuitem.action command)
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 79b63d7..2aa4382 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -23,7 +23,7 @@ using Gee;
public class PlayerController : GLib.Object
{
- public const int WIDGET_QUANTITY = 6;
+ public const int WIDGET_QUANTITY = 5;
public static enum widget_order{
SEPARATOR,
@@ -31,7 +31,6 @@ public class PlayerController : GLib.Object
METADATA,
SCRUB,
TRANSPORT,
- PLAYLIST
}
public enum state{
@@ -128,8 +127,6 @@ public class PlayerController : GLib.Object
false);
this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
false);
- this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE,
- false);
return;
}
this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE,
@@ -138,8 +135,6 @@ public class PlayerController : GLib.Object
this.custom_items[widget_order.SCRUB].populated(ScrubMenuitem.attributes_format()));
this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE,
true);
- this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE,
- true);
}
private void construct_widgets()
@@ -162,34 +157,11 @@ public class PlayerController : GLib.Object
// Transport item
TransportMenuitem transport_item = new TransportMenuitem(this);
this.custom_items.add(transport_item);
-
- this.custom_items.add(create_playlist());
-
+
foreach(PlayerItem item in this.custom_items){
root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item));
}
}
-
- private PlayerItem create_playlist()
- {
- PlayerItem playlist_root = new PlayerItem(CLIENT_TYPES_DEFAULT);
- playlist_root.property_set(MENUITEM_PROP_LABEL, "Choose Playlist");
-
- PlayerItem subentry_1 = new PlayerItem(CLIENT_TYPES_DEFAULT);
- subentry_1.property_set(MENUITEM_PROP_LABEL, "Raster-noton selection");
-
- PlayerItem subentry_2 = new PlayerItem(CLIENT_TYPES_DEFAULT);
- subentry_2.property_set(MENUITEM_PROP_LABEL, "Rune Grammofon selection");
-
- PlayerItem subentry_3 = new PlayerItem(CLIENT_TYPES_DEFAULT);
- subentry_3.property_set(MENUITEM_PROP_LABEL, "Kranky selection");
-
- playlist_root.child_append(subentry_1);
- playlist_root.child_append(subentry_2);
- playlist_root.child_append(subentry_3);
-
- return playlist_root;
- }
private static string format_client_name(string client_name)
{
diff --git a/src/sound-service.c b/src/sound-service.c
index 16fa87c..8768cd3 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -42,8 +42,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
// TODO: uncomment for release !!
- //close_pulse_activites();
- //g_main_loop_quit(mainloop);
+ close_pulse_activites();
+ g_main_loop_quit(mainloop);
}
return;
}