Initial commit
[fillmore] / src / fillmore / VolumeAndPanPopUp.vala
diff --git a/src/fillmore/VolumeAndPanPopUp.vala b/src/fillmore/VolumeAndPanPopUp.vala
new file mode 100644 (file)
index 0000000..2d07a4e
--- /dev/null
@@ -0,0 +1,68 @@
+/*  Demo Recorder for MAEMO 5
+*   Copyright (C) 2010 Dru Moore <usr@dru-id.co.uk>
+*   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(Gtk.Widget parent, string title) {
+    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);
+  }
+
+}
+
+}