diff options
author | David Robillard <d@drobilla.net> | 2007-03-18 06:07:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-03-18 06:07:08 +0000 |
commit | 99904735e066804358f1d0bd138a84f1e9ecda91 (patch) | |
tree | 71a924cf1660b5b00231275bd481bbd27094dd9b /gtk2_ardour/gain_meter.cc | |
parent | eb270e70a12c410cdd98585ad25bb6d8e384a4f5 (diff) |
Merged with trunk R1612.
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/gain_meter.cc')
-rw-r--r-- | gtk2_ardour/gain_meter.cc | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 2d7cd5883e..fa719bcca2 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #include <limits.h> @@ -107,11 +106,11 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s) gain_display_box.pack_start (gain_display, true, true); peak_display.set_name ("MixerStripPeakDisplay"); - peak_display.set_has_frame (false); - peak_display.set_editable (false); +// peak_display.set_has_frame (false); +// peak_display.set_editable (false); set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6); /* note the descender */ max_peak = minus_infinity(); - peak_display.set_text (_("-inf")); + peak_display.set_label (_("-inf")); peak_display.unset_flags (Gtk::CAN_FOCUS); meter_metric_area.set_name ("MeterMetricsStrip"); @@ -161,7 +160,7 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s) using namespace Menu_Helpers; - gain_astate_menu.items().push_back (MenuElem (_("Off"), + gain_astate_menu.items().push_back (MenuElem (_("Manual"), bind (mem_fun (*_io, &IO::set_gain_automation_state), (AutoState) Off))); gain_astate_menu.items().push_back (MenuElem (_("Play"), bind (mem_fun (*_io, &IO::set_gain_automation_state), (AutoState) Play))); @@ -231,11 +230,11 @@ GainMeter::render_metrics (Gtk::Widget& w) Glib::RefPtr<Gdk::Window> win (w.get_window()); Glib::RefPtr<Gdk::GC> fg_gc (w.get_style()->get_fg_gc (Gtk::STATE_NORMAL)); Glib::RefPtr<Gdk::GC> bg_gc (w.get_style()->get_bg_gc (Gtk::STATE_NORMAL)); - gint x, y, width, height, depth; + gint width, height; int db_points[] = { -50, -40, -20, -30, -10, -3, 0, 4 }; char buf[32]; - win->get_geometry (x, y, width, height, depth); + win->get_size (width, height); Glib::RefPtr<Gdk::Pixmap> pixmap = Gdk::Pixmap::create (win, width, height); @@ -274,9 +273,9 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev) Glib::RefPtr<Gdk::GC> bg_gc (meter_metric_area.get_style()->get_bg_gc (Gtk::STATE_NORMAL)); GdkRectangle base_rect; GdkRectangle draw_rect; - gint x, y, width, height, depth; + gint width, height; - win->get_geometry (x, y, width, height, depth); + win->get_size (width, height); base_rect.width = width; base_rect.height = height; @@ -332,10 +331,10 @@ GainMeter::update_meters () max_peak = mpeak; /* set peak display */ if (max_peak <= -200.0f) { - peak_display.set_text (_("-inf")); + peak_display.set_label (_("-inf")); } else { snprintf (buf, sizeof(buf), "%.1f", max_peak); - peak_display.set_text (buf); + peak_display.set_label (buf); } if (max_peak >= 0.0f) { @@ -452,6 +451,14 @@ GainMeter::setup_meters () } } +int +GainMeter::get_gm_width () +{ + Gtk::Requisition sz; + hbox.size_request (sz); + return sz.width; +} + bool GainMeter::gain_key_press (GdkEventKey* ev) { @@ -491,7 +498,7 @@ GainMeter::reset_peak_display () } max_peak = -INFINITY; - peak_display.set_text (_("-Inf")); + peak_display.set_label (_("-Inf")); peak_display.set_name ("MixerStripPeakDisplay"); } @@ -513,7 +520,7 @@ GainMeter::meter_button_release (GdkEventButton* ev, uint32_t which) case 1: meters[which].meter->clear(); max_peak = minus_infinity(); - peak_display.set_text (_("-inf")); + peak_display.set_label (_("-inf")); peak_display.set_name ("MixerStripPeakDisplay"); break; @@ -842,7 +849,7 @@ GainMeter::_astate_string (AutoState state, bool shrt) switch (state) { case Off: - sstr = (shrt ? "O" : _("O")); + sstr = (shrt ? "M" : _("M")); break; case Play: sstr = (shrt ? "P" : _("P")); |