Adding first code drop
[demorecorder] / src / EqualizerPopUp.vala
diff --git a/src/EqualizerPopUp.vala b/src/EqualizerPopUp.vala
new file mode 100644 (file)
index 0000000..adba54b
--- /dev/null
@@ -0,0 +1,55 @@
+/*  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 EqualizerPopUp : Hildon.Dialog {
+    
+    GraphicEqualizer equalizer;
+    
+    public signal void eq_updated(int band, double val);
+    public signal void name_updated(string name);
+    
+    private void eq_updated_callback(GraphicEqualizer sender, int band, double val) {
+      eq_updated(band, val);
+    }
+    
+    private void name_updated_callback(GraphicEqualizer sender, string name) {
+      name_updated(name);
+    }
+    
+    public EqualizerPopUp(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();
+      
+      equalizer = new GraphicEqualizer();
+      equalizer.name_updated.connect(name_updated_callback);
+      equalizer.eq_updated.connect(eq_updated_callback);
+      
+      control_area.pack_start(equalizer, true, true , 2);
+      
+      this.show_all();
+    }
+    
+  }
+  
+}
\ No newline at end of file