diff options
author | Robin Gareus <robin@gareus.org> | 2013-06-23 16:05:52 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-07-10 15:27:02 +0200 |
commit | 35937e508322cfe336a15cc240839dbb2d553ef6 (patch) | |
tree | 2fa5340e3fbac1ea7c165706b1c8bed022ba1843 /gtk2_ardour/meterbridge.h | |
parent | b0998844dbfe25b24bd2abce28daaa5358d5b1bb (diff) |
implement meterbridge & meter-strip
Diffstat (limited to 'gtk2_ardour/meterbridge.h')
-rw-r--r-- | gtk2_ardour/meterbridge.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/gtk2_ardour/meterbridge.h b/gtk2_ardour/meterbridge.h new file mode 100644 index 0000000000..3bdf0483bd --- /dev/null +++ b/gtk2_ardour/meterbridge.h @@ -0,0 +1,94 @@ +/* + Copyright (C) 2012 Paul Davis + Author: Robin Gareus + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +#ifndef __ardour_meterbridge_h__ +#define __ardour_meterbridge_h__ + +#include <gtkmm/box.h> +#include <gtkmm/scrolledwindow.h> +#include <gtkmm/label.h> +#include <gtkmm/window.h> + +#include "ardour/ardour.h" +#include "ardour/types.h" +#include "ardour/session_handle.h" + +#include "pbd/stateful.h" +#include "pbd/signals.h" + +#include "gtkmm2ext/visibility_tracker.h" + +#include "meter_strip.h" + +class Meterbridge : + public Gtk::Window, + public PBD::ScopedConnectionList, + public ARDOUR::SessionHandlePtr, + public Gtkmm2ext::VisibilityTracker +{ + public: + static Meterbridge* instance(); + ~Meterbridge(); + + void set_session (ARDOUR::Session *); + + XMLNode& get_state (void); + int set_state (const XMLNode& ); + + void show_window (); + bool hide_window (GdkEventAny *ev); + + private: + Meterbridge (); + static Meterbridge* _instance; + + bool _visible; + + Gtk::ScrolledWindow scroller; + Gtk::HBox global_hpacker; + Gtk::VBox global_vpacker; + + gint start_updating (); + gint stop_updating (); + + sigc::connection fast_screen_update_connection; + void fast_update_strips (); + + void add_strips (ARDOUR::RouteList&); + void remove_strip (MeterStrip *); + + void parameter_changed (std::string const &); + + void session_going_away (); + + std::list<MeterStrip *> strips; + + static const int32_t default_width = 300; + static const int32_t default_height = 400; + // for restoring window geometry. + int m_root_x, m_root_y, m_width, m_height; + + void set_window_pos_and_size (); + void get_window_pos_and_size (); + + bool on_key_press_event (GdkEventKey*); + bool on_key_release_event (GdkEventKey*); +}; + +#endif |