summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2007-11-17 23:31:56 +0000
committerDoug McLain <doug@nostar.net>2007-11-17 23:31:56 +0000
commit8683ccfd80e9cb222ba94684954caff7cf318670 (patch)
tree2f8cb59a6263a1481417816dba8572b2fd3c679a
parent6220b80b9b5f81e7058e44a829d1b198db472f29 (diff)
Level meters added to editor tracks, smaller and above
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2690 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/ardour.menus1
-rw-r--r--gtk2_ardour/ardour_ui.h1
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc6
-rw-r--r--gtk2_ardour/ardour_ui_options.cc6
-rw-r--r--gtk2_ardour/editor.cc2
-rw-r--r--gtk2_ardour/editor.h6
-rw-r--r--gtk2_ardour/editor_actions.cc2
-rw-r--r--gtk2_ardour/editor_audiotrack.cc59
-rw-r--r--gtk2_ardour/editor_route_list.cc2
-rw-r--r--gtk2_ardour/gain_meter.cc29
-rw-r--r--gtk2_ardour/gain_meter.h12
-rw-r--r--gtk2_ardour/route_time_axis.cc52
-rw-r--r--gtk2_ardour/route_time_axis.h9
-rw-r--r--gtk2_ardour/time_axis_view.cc9
-rw-r--r--libs/ardour/ardour/configuration_vars.h2
-rw-r--r--libs/gtkmm2ext/fastmeter.cc14
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/fastmeter.h2
17 files changed, 182 insertions, 32 deletions
diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus
index 76cf2fdc9e..95dc8cddc3 100644
--- a/gtk2_ardour/ardour.menus
+++ b/gtk2_ardour/ardour.menus
@@ -323,6 +323,7 @@
<menuitem action='UseExternalMonitoring'/>
</menu>
<menu action='Metering'>
+ <menuitem action='ShowTrackMeters'/>
<menu action='MeteringFallOffRate'>
<menuitem action='MeterFalloffOff'/>
<menuitem action='MeterFalloffSlowest'/>
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index a60c7876ce..4d9da2044c 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -709,6 +709,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void toggle_PrimaryClockDeltaEditCursor ();
void toggle_SecondaryClockDeltaEditCursor ();
void toggle_only_copy_imported_files ();
+ void toggle_ShowTrackMeters ();
void mtc_port_changed ();
void map_solo_model ();
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index 0143f3c60e..fc2602dacf 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -415,8 +415,8 @@ ARDOUR_UI::install_actions ()
ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport));
ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable));
ActionManager::register_toggle_action (option_actions, X_("RegionEquivalentsOverlap"), _("Region equivalents overlap"), mem_fun (*this, &ARDOUR_UI::toggle_RegionEquivalentsOverlap));
- ActionManager::register_toggle_action (option_actions, X_("PrimaryClockDeltaEditCursor"), _("Primary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor));
- ActionManager::register_toggle_action (option_actions, X_("SecondaryClockDeltaEditCursor"), _("Secondary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor));
+ ActionManager::register_toggle_action (option_actions, X_("PrimaryClockDeltaEditCursor"), _("Primary Clock delta to edit point"), mem_fun (*this, &ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor));
+ ActionManager::register_toggle_action (option_actions, X_("SecondaryClockDeltaEditCursor"), _("Secondary Clock delta to edit point"), mem_fun (*this, &ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor));
ActionManager::register_toggle_action (option_actions, X_("OnlyCopyImportedFiles"), _("Always copy imported files"), mem_fun (*this, &ARDOUR_UI::toggle_only_copy_imported_files));
RadioAction::Group denormal_group;
@@ -461,7 +461,7 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
ActionManager::session_sensitive_actions.push_back (act);
-
+ act = ActionManager::register_toggle_action (option_actions, X_("ShowTrackMeters"), _("Display Editor Meters"), mem_fun (*this, &ARDOUR_UI::toggle_ShowTrackMeters));
act = ActionManager::register_toggle_action (option_actions, X_("LatchedSolo"), _("Latched solo"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedSolo));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("ShowSoloMutes"), _("Show solo muting"), mem_fun (*this, &ARDOUR_UI::toggle_ShowSoloMutes));
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index adaa20db72..fb92900346 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -507,6 +507,12 @@ ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor()
}
void
+ARDOUR_UI::toggle_ShowTrackMeters()
+{
+ ActionManager::toggle_config_state ("options", "ShowTrackMeters", &Configuration::set_show_track_meters, &Configuration::get_show_track_meters);
+}
+
+void
ARDOUR_UI::mtc_port_changed ()
{
bool have_mtc;
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index b600bee6c5..0fc1e49e62 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -1248,6 +1248,8 @@ Editor::connect_to_session (Session *t)
/* register for undo history */
session->register_with_memento_command_factory(_id, this);
+
+ start_updating ();
}
void
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 20b721942b..5d71009163 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -1939,6 +1939,12 @@ class Editor : public PublicEditor
RegionSelection& get_regions_for_action ();
+ sigc::connection fast_screen_update_connection;
+ gint start_updating ();
+ gint stop_updating ();
+ void toggle_meter_updating();
+ void fast_update_strips ();
+
};
#endif /* __ardour_editor_h__ */
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 1299b6dc33..0cb122d4b4 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -1209,6 +1209,8 @@ Editor::parameter_changed (const char* parameter_name)
} else if (PARAM_IS ("subframes-per-frame")) {
update_subframes_per_frame ();
update_just_smpte ();
+ } else if (PARAM_IS ("show-track-meters")) {
+ toggle_meter_updating();
}
#undef PARAM_IS
diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc
index 755437c628..db831bfd61 100644
--- a/gtk2_ardour/editor_audiotrack.cc
+++ b/gtk2_ardour/editor_audiotrack.cc
@@ -20,6 +20,7 @@
#include <ardour/location.h>
#include <ardour/audio_diskstream.h>
+#include "ardour_ui.h"
#include "editor.h"
#include "editing.h"
#include "audio_time_axis.h"
@@ -91,3 +92,61 @@ Editor::set_show_waveforms_recording (bool yn)
}
}
}
+
+gint
+Editor::start_updating ()
+{
+ AudioTimeAxisView* atv;
+
+ if (is_mapped() && session) {
+ for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
+ atv->show_meter ();
+ }
+ }
+ }
+ fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun(*this, &Editor::fast_update_strips));
+ return 0;
+}
+
+gint
+Editor::stop_updating ()
+{
+ AudioTimeAxisView* atv;
+
+ cerr << "Editor::stop_updating () called" << endl;
+ if (is_mapped() && session) {
+ for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
+ atv->hide_meter ();
+ }
+ }
+ }
+ fast_screen_update_connection.disconnect();
+ return 0;
+}
+
+void
+Editor::toggle_meter_updating()
+{
+ if (Config->get_show_track_meters()) {
+ start_updating();
+ } else {
+ stop_updating ();
+ }
+}
+
+void
+Editor::fast_update_strips ()
+{
+ AudioTimeAxisView* atv;
+
+ if (is_mapped() && session) {
+ for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
+ atv->fast_update ();
+ }
+ }
+ }
+}
+
diff --git a/gtk2_ardour/editor_route_list.cc b/gtk2_ardour/editor_route_list.cc
index 769bd5dc25..5f1346c23b 100644
--- a/gtk2_ardour/editor_route_list.cc
+++ b/gtk2_ardour/editor_route_list.cc
@@ -61,7 +61,7 @@ Editor::handle_new_route (Session::RouteList& routes)
}
tv = new AudioTimeAxisView (*this, *session, route, track_canvas);
-
+ cerr << "Editor::handle_new_route() called on " << route->name() << endl;//DEBUG
row = *(route_display_model->append ());
row[route_display_columns.route] = route;
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index 7b576228cc..dd33509f0b 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -73,7 +73,8 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
// 0.781787 is the value needed for gain to be set to 0.
gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1),
gain_automation_style_button (""),
- gain_automation_state_button ("")
+ gain_automation_state_button (""),
+ regular_meter_width(5)
{
if (slider == 0) {
@@ -207,10 +208,11 @@ GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
ResetGroupPeakDisplays.connect (mem_fun(*this, &GainMeter::reset_group_peak_display));
UI::instance()->theme_changed.connect (mem_fun(*this, &GainMeter::on_theme_changed));
+ //hide_all();
}
void
-GainMeter::set_width (Width w)
+GainMeter::set_width (Width w, int len)
{
switch (w) {
case Wide:
@@ -222,7 +224,7 @@ GainMeter::set_width (Width w)
}
_width = w;
- setup_meters ();
+ setup_meters (len);
}
Glib::RefPtr<Gdk::Pixmap>
@@ -406,7 +408,7 @@ GainMeter::hide_all_meters ()
}
void
-GainMeter::setup_meters ()
+GainMeter::setup_meters (int len)
{
uint32_t nmeters = _io->n_outputs();
guint16 width;
@@ -455,11 +457,12 @@ GainMeter::setup_meters ()
}
for (int32_t n = nmeters-1; nmeters && n >= 0 ; --n) {
- if (meters[n].width != width) {
+ if (meters[n].width != width || meters[n].length != len) {
delete meters[n].meter;
- meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, FastMeter::Vertical);
+ meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, FastMeter::Vertical, len);
+ //cerr << "GainMeter::setup_meters() w:l = " << width << ":" << len << endl;//DEBUG
meters[n].width = width;
-
+ meters[n].length = len;
meters[n].meter->add_events (Gdk::BUTTON_RELEASE_MASK);
meters[n].meter->signal_button_release_event().connect (bind (mem_fun(*this, &GainMeter::meter_button_release), n));
}
@@ -958,3 +961,15 @@ GainMeter::gain_automation_state_changed ()
gain_watching = ARDOUR_UI::RapidScreenUpdate.connect (mem_fun (*this, &GainMeter::effective_gain_display));
}
}
+
+void GainMeter::setup_atv_meter (int len)
+{
+ set_no_show_all();
+ regular_meter_width = 3;
+ hide_all();
+ set_width(Narrow, len);
+ meter_packer.show_all();
+ hbox.show();
+ show();
+}
+
diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h
index c35cd1e299..e46479d23b 100644
--- a/gtk2_ardour/gain_meter.h
+++ b/gtk2_ardour/gain_meter.h
@@ -66,14 +66,16 @@ class GainMeter : public Gtk::VBox
void effective_gain_display ();
- void set_width (Width);
- void setup_meters ();
+ void set_width (Width, int len=0);
+ void setup_meters (int len=0);
int get_gm_width ();
void set_meter_strip_name (const char * name);
void set_fader_name (const char * name);
+ void setup_atv_meter (int);
+
private:
friend class MixerStrip;
@@ -128,17 +130,19 @@ class GainMeter : public Gtk::VBox
struct MeterInfo {
Gtkmm2ext::FastMeter *meter;
- gint16 width;
+ gint16 width;
+ int length;
bool packed;
MeterInfo() {
meter = 0;
width = 0;
+ length = 0;
packed = false;
}
};
- static const guint16 regular_meter_width = 5;
+ guint16 regular_meter_width;
static const guint16 thin_meter_width = 2;
vector<MeterInfo> meters;
float max_peak;
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 13fa435b16..0e070fdaa3 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -92,9 +92,11 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
playlist_button (_("p")),
size_button (_("h")), // height
automation_button (_("a")),
- visual_button (_("v"))
+ visual_button (_("v")),
+ gpm (rt, sess)
{
+ gpm.setup_atv_meter(50);
_has_state = true;
playlist_menu = 0;
playlist_action_menu = 0;
@@ -144,12 +146,15 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press), false);
rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
- controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
+ controls_table.attach (*rec_enable_button, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
+ controls_hbox.pack_end(gpm);
+ _route->meter_change.connect (mem_fun(*this, &RouteTimeAxisView::meter_changed));
+
}
- controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
- controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::FILL|Gtk::EXPAND, 0, 0);
+ controls_table.attach (*mute_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
+ controls_table.attach (*solo_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
controls_table.attach (edit_group_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
@@ -644,8 +649,9 @@ RouteTimeAxisView::show_selection (TimeSelection& ts)
void
RouteTimeAxisView::set_height (TrackHeight h)
{
+ int gmlen = (height_to_pixels (h)) - 5;
bool height_changed = (height == 0) || (h != height_style);
-
+ gpm.setup_atv_meter (gmlen);
TimeAxisView::set_height (h);
ensure_xml_node ();
@@ -685,6 +691,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
case Large:
case Larger:
case Normal:
+ gpm.show();
show_name_entry ();
hide_name_label ();
@@ -705,6 +712,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
break;
case Smaller:
+ gpm.show();
show_name_entry ();
hide_name_label ();
@@ -725,6 +733,7 @@ RouteTimeAxisView::set_height (TrackHeight h)
break;
case Small:
+ gpm.hide ();
hide_name_entry ();
show_name_label ();
@@ -1774,4 +1783,35 @@ RouteTimeAxisView::update_rec_display ()
RouteUI::update_rec_display ();
name_entry.set_sensitive (!_route->record_enabled());
}
-
+
+void
+RouteTimeAxisView::fast_update ()
+{
+ gpm.update_meters ();
+}
+
+void
+RouteTimeAxisView::hide_meter ()
+{
+ gpm.hide ();
+}
+
+void
+RouteTimeAxisView::show_meter ()
+{
+ gpm.show ();
+}
+
+void
+RouteTimeAxisView::reset_meter ()
+{
+ gpm.setup_atv_meter (height-5);
+}
+
+void
+RouteTimeAxisView::meter_changed (void *src)
+{
+ ENSURE_GUI_THREAD (bind (mem_fun(*this, &RouteTimeAxisView::meter_changed), src));
+ reset_meter();
+}
+
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index a2ccc5d7c8..c2c1f02ee5 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -38,6 +38,8 @@
#include "enums.h"
#include "time_axis_view.h"
#include "canvas.h"
+#include "gain_meter.h"
+
namespace ARDOUR {
class Session;
@@ -98,6 +100,11 @@ public:
StreamView* view() const { return _view; }
ARDOUR::RouteGroup* edit_group() const;
boost::shared_ptr<ARDOUR::Playlist> playlist() const;
+ void fast_update ();
+ void hide_meter ();
+ void show_meter ();
+ void reset_meter ();
+ void meter_changed (void *);
protected:
friend class StreamView;
@@ -243,6 +250,8 @@ protected:
sigc::connection modified_connection;
void post_construct ();
+
+ GainMeter gpm;
};
#endif /* __ardour_route_time_axis_h__ */
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index a85e0284ca..20666fb30d 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -71,7 +71,7 @@ bool TimeAxisView::need_size_info = true;
TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& canvas)
: AxisView (sess),
editor (ed),
- controls_table (2, 8)
+ controls_table (2, 7)
{
if (need_size_info) {
compute_controls_size_info ();
@@ -123,9 +123,9 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
controls_table.set_border_width (2);
controls_table.set_row_spacings (0);
controls_table.set_col_spacings (0);
- controls_table.set_homogeneous (true);
+ controls_table.set_homogeneous (false);
- controls_table.attach (name_hbox, 0, 4, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
+ controls_table.attach (name_hbox, 0, 4, 0, 1, Gtk::SHRINK|Gtk::EXPAND, Gtk::SHRINK|Gtk::EXPAND);
controls_table.show_all ();
controls_table.set_no_show_all ();
@@ -365,11 +365,12 @@ TimeAxisView::set_height_pixels (uint32_t h)
{
height = h;
controls_frame.set_size_request (-1, height + ((order == 0) ? 1 : 0));
-
+ //cerr << "TimeAxisView::set_height_pixels() called h = " << h << endl;//DEBUG
if (canvas_item_visible (selection_group)) {
/* resize the selection rect */
show_selection (editor.get_selection().time);
}
+
}
bool
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 8473f0f4d0..d730ad583a 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -115,7 +115,7 @@ CONFIG_VARIABLE (ShuttleUnits, shuttle_units, "shuttle-units", Percentage)
CONFIG_VARIABLE (bool, quieten_at_speed, "quieten-at-speed", true)
CONFIG_VARIABLE (bool, primary_clock_delta_edit_cursor, "primary-clock-delta-edit-cursor", false)
CONFIG_VARIABLE (bool, secondary_clock_delta_edit_cursor, "secondary-clock-delta-edit-cursor", false)
-
+CONFIG_VARIABLE (bool, show_track_meters, "show-track-meters", true)
/* timecode and sync */
CONFIG_VARIABLE (bool, jack_time_master, "jack-time-master", true)
diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc
index ab1e1472b3..03745765ab 100644
--- a/libs/gtkmm2ext/fastmeter.cc
+++ b/libs/gtkmm2ext/fastmeter.cc
@@ -34,16 +34,16 @@ using namespace Gtkmm2ext;
using namespace std;
-int FastMeter::min_v_pixbuf_size = 50;
+int FastMeter::min_v_pixbuf_size = 10;
int FastMeter::max_v_pixbuf_size = 1024;
Glib::RefPtr<Gdk::Pixbuf>* FastMeter::v_pixbuf_cache = 0;
-int FastMeter::min_h_pixbuf_size = 50;
+int FastMeter::min_h_pixbuf_size = 10;
int FastMeter::max_h_pixbuf_size = 1024;
Glib::RefPtr<Gdk::Pixbuf>* FastMeter::h_pixbuf_cache = 0;
-FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o)
+FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len)
{
orientation = o;
hold_cnt = hold;
@@ -57,9 +57,13 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o)
pixrect.y = 0;
if (orientation == Vertical) {
- pixbuf = request_vertical_meter(dimen, 250);
+ if (!len)
+ len = 250;
+ pixbuf = request_vertical_meter(dimen, len);
} else {
- pixbuf = request_horizontal_meter(186, dimen);
+ if (!len)
+ len = 186;
+ pixbuf = request_horizontal_meter(len, dimen);
}
pixheight = pixbuf->get_height();
diff --git a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h
index 48bed3d150..31e05d9b14 100644
--- a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h
+++ b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h
@@ -32,7 +32,7 @@ class FastMeter : public Gtk::DrawingArea {
Vertical
};
- FastMeter (long hold_cnt, unsigned long width, Orientation);
+ FastMeter (long hold_cnt, unsigned long width, Orientation, int len=0);
virtual ~FastMeter ();
void set (float level);