X-Git-Url: http://git.maemo.org/git/?p=demorecorder;a=blobdiff_plain;f=src%2FVolumeAndPanPopUp.vala;fp=src%2FVolumeAndPanPopUp.vala;h=e8a31cb7f9c57af4396a3340c3738dc737c5d290;hp=0000000000000000000000000000000000000000;hb=804630a4e0d41b182d8540f2aec69cf25ca0acfd;hpb=753fb925588aeeacdd74a163672acf2bf362a99e;ds=sidebyside diff --git a/src/VolumeAndPanPopUp.vala b/src/VolumeAndPanPopUp.vala new file mode 100644 index 0000000..e8a31cb --- /dev/null +++ b/src/VolumeAndPanPopUp.vala @@ -0,0 +1,68 @@ +/* Demo Recorder for MAEMO 5 +* Copyright (C) 2010 Dru Moore +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2, +* or (at your option) any later version, as published by the Free +* Software Foundation +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details +* +* You should have received a copy of the GNU General Public +* License along with this program; if not, write to the +* Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +namespace IdWorks { + +public class VolumeAndPanPopUp : Hildon.Dialog { + + Gtk.HScale volume_slider; + Gtk.HScale panorama_slider; + + public signal void volume_updated(double volume); + public signal void panorama_updated(double panorama); + + public VolumeAndPanPopUp(string title, Gtk.Widget parent) { + this.set_title(title); + this.set_parent(parent); + + this.set_default_response(Gtk.ResponseType.ACCEPT); + this.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.ACCEPT); + + Gtk.VBox control_area = (Gtk.VBox)this.get_content_area(); + + Gtk.HBox volume_bar = new Gtk.HBox(false, 2); + Gtk.Label volume_label = new Gtk.Label("Volume"); + volume_bar.pack_start(volume_label, false, false , 2); + volume_slider = new Gtk.HScale.with_range(0.0, 10.0, 0.05); + volume_slider.set_value_pos(Gtk.PositionType.LEFT); + volume_slider.value_changed.connect((s) => {volume_updated(s.get_value());}); + volume_bar.pack_start(volume_slider, true, true , 2); + + Gtk.HBox panorama_bar = new Gtk.HBox(false, 2); + Gtk.Label panorama_label = new Gtk.Label("Pan"); + panorama_bar.pack_start(panorama_label, false, false , 2); + panorama_slider = new Gtk.HScale.with_range(-1.0, 1.0, 0.05); + panorama_slider.set_value_pos(Gtk.PositionType.LEFT); + panorama_slider.value_changed.connect((s) => {panorama_updated(s.get_value());}); + panorama_bar.pack_start(panorama_slider, true, true , 2); + + control_area.pack_start(volume_bar, true, true , 2); + control_area.pack_start(panorama_bar, true, true , 2); + this.show_all(); + } + + public void set_volume(double volume) { + volume_slider.set_value(volume); + } + + public void set_panorama(double panorama) { + panorama_slider.set_value(panorama); + } + +} + +} \ No newline at end of file