Fly my pretties!
[ardour.git] / gtk2_ardour / meter_bridge.h
1 /*
2     Copyright (C) 1999-2002 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19 */
20
21 #ifndef __ardour_meter_bridge_h__
22 #define __ardour_meter_bridge_h__
23
24 #include <list>
25
26 #include <gtkmm/eventbox.h>
27 #include <gtkmm/viewport.h>
28 #include <gtkmm/scrolledwindow.h>
29 #include <gtkmm/box.h>
30 #include <gtkmm/fixed.h>
31 #include <gtkmm/frame.h>
32
33 #include "keyboard_target.h"
34 #include "ardour_dialog.h"
35
36 class MeterBridgeStrip;
37
38 namespace ARDOUR {
39         class Session;
40         class Route;
41 }
42
43 class MeterBridge : public ArdourDialog
44 {
45
46   public:
47         MeterBridge ();
48         ~MeterBridge ();
49
50         void set_session (ARDOUR::Session*);
51         void clear_all_meters ();
52         void start_metering ();
53         void stop_metering ();
54         void toggle_metering ();
55
56   protected:
57         gint map_event_impl (GdkEventAny *);
58         gint unmap_event_impl (GdkEventAny *);
59
60   private:
61         /* diskstream/recorder display */
62
63         Gtk::Viewport            meter_viewport;
64         Gtk::ScrolledWindow      meter_scroller;
65         Gtk::EventBox            meter_scroll_base;
66         Gtk::HBox                meter_scroller_hpacker;
67         Gtk::VBox                meter_scroller_vpacker;
68         Gtk::VBox                metering_vpacker;
69         Gtk::VBox                metering_hpacker;
70
71         Gtk::VBox                metering_vbox;
72         Gtk::HBox                metering_hbox;
73         Gtk::Fixed               upper_metering_box;
74         Gtk::Fixed               lower_metering_box;
75         Gtk::Fixed               meter_base;
76         Gtk::Frame               meter_frame;
77
78         list<MeterBridgeStrip*>  meters;
79         
80         bool                    metering;
81         sigc::connection        metering_connection;
82
83         void update ();
84
85         void add_route (ARDOUR::Route*);
86         void remove_route (ARDOUR::Route*);
87         void session_gone(); /* overrides ArdourDialog::session_gone() */
88 };
89
90 #endif /* __ardour_meter_bridge_h__ (*/