1 /* Gnome Music Player Client (GMPC)
2 * Copyright (C) 2004-2014 Qball Cow <qball@sarine.nl>
3 * Project homepage: http://gmpc.wikia.com/
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 private const bool use_transition_mir
= Gmpc
.use_transition
;
31 public class Gmpc
.MenuItem
.Rating
: Gtk
.MenuItem
33 private const string some_unique_name
= Config
.VERSION
;
34 public Gtk
.VBox hbox
= null;
35 public Gmpc
.Rating rating
= null;
37 public int get_rating ()
41 bool button_press_event_callback(Gdk
.EventButton event
, void *userdata
)
43 this
.rating
.button_press_event_callback(this
.rating
.event_box
, event
);
47 bool button_release_event_callback(Gdk
.EventButton event
, void *userdata
)
52 public Rating (MPD
.Server server
, MPD
.Song song
)
54 /* this fixes vala bitching */
55 GLib
.Signal
.connect_swapped(this
, "button-press-event",
56 (GLib
.Callback
)button_press_event_callback
,this
);
57 GLib
.Signal
.connect_swapped(this
, "button-release-event",
58 (GLib
.Callback
)button_release_event_callback
,this
);
60 this
.hbox
= new Gtk
.VBox(false,6);
61 this
.rating
= new Gmpc
.Rating(server
,song
);
63 this
.hbox
.pack_start(new Gtk
.Label(_("Rating:")),false,true,0);
64 this
.hbox
.pack_start(this
.rating
,false,true,0);