aboutsummaryrefslogtreecommitdiff
path: root/src/player-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-17 16:41:54 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-17 16:41:54 +0100
commit05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9 (patch)
tree1e0de7f106d14e59585926bed28db184f1434572 /src/player-controller.vala
parent4125fd9e2eb0de55d04482b3c035aa91fe7d547a (diff)
downloadayatana-indicator-sound-05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9.tar.gz
ayatana-indicator-sound-05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9.tar.bz2
ayatana-indicator-sound-05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9.zip
transport plugged in
Diffstat (limited to 'src/player-controller.vala')
-rw-r--r--src/player-controller.vala18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 4c09c12..aa72cac 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -18,20 +18,20 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
using Dbusmenu;
using Gee;
public class PlayerController : GLib.Object
{
- private const int METADATA = 2;
+ private const int METADATA = 2;
+ private const int TRANSPORT = 3;
+
private Dbusmenu.Menuitem root_menu;
private string name;
private bool is_active;
private ArrayList<Dbusmenu.Menuitem> custom_items;
private MprisController mpris_adaptor;
- // TODO: pass in the appropriate position for the menu (to handle multiple players)
public PlayerController(Dbusmenu.Menuitem root, string client_name, bool active)
{
this.root_menu = root;
@@ -39,12 +39,20 @@ public class PlayerController : GLib.Object
this.is_active = active;
this.custom_items = new ArrayList<Dbusmenu.Menuitem>();
self_construct();
+
// Temporary scenario to handle both v1 and v2 of MPRIS.
if(this.name == "Vlc"){
this.mpris_adaptor = new MprisControllerV2(this.name, this);
- }else{
+ }
+ else{
this.mpris_adaptor = new MprisController(this.name, this);
- }
+ }
+
+ // TODO subclass dbusmenuMenuitem to something like a playermenuitem
+ // and use this type to collectively
+ // control widgets.
+ TransportMenuitem t = (TransportMenuitem)this.custom_items[TRANSPORT];
+ t.set_adaptor(this.mpris_adaptor);
}
public void vanish()