Reworked AboutDialog.
[demorecorder] / src / EqualizerPopUp.vala
1 /*  Demo Recorder for MAEMO 5
2 *   Copyright (C) 2010 Dru Moore <usr@dru-id.co.uk>
3 *   This program is free software; you can redistribute it and/or modify
4 *   it under the terms of the GNU General Public License version 2,
5 *   or (at your option) any later version, as published by the Free
6 *   Software Foundation
7 *
8 *   This program is distributed in the hope that it will be useful,
9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details
12 *
13 *   You should have received a copy of the GNU General Public
14 *   License along with this program; if not, write to the
15 *   Free Software Foundation, Inc.,
16 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 namespace IdWorks {
19   
20   public class EqualizerPopUp : Hildon.Dialog {
21     
22     GraphicEqualizer equalizer;
23     
24     public signal void eq_updated(int band, double val);
25     public signal void name_updated(string name);
26     
27     private void eq_updated_callback(GraphicEqualizer sender, int band, double val) {
28       eq_updated(band, val);
29     }
30     
31     private void name_updated_callback(GraphicEqualizer sender, string name) {
32       name_updated(name);
33     }
34     
35     public EqualizerPopUp(string title, Gtk.Widget parent) {
36       this.set_title(title);
37       this.set_parent(parent);
38       
39       this.set_default_response(Gtk.ResponseType.ACCEPT);
40       this.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.ACCEPT);
41       
42       Gtk.VBox control_area = (Gtk.VBox)this.get_content_area();
43       
44       equalizer = new GraphicEqualizer();
45       equalizer.name_updated.connect(name_updated_callback);
46       equalizer.eq_updated.connect(eq_updated_callback);
47       
48       control_area.pack_start(equalizer, true, true , 2);
49       
50       this.show_all();
51     }
52     
53   }
54   
55 }