diff options
author | Doug McLain <doug@nostar.net> | 2007-12-20 23:25:19 +0000 |
---|---|---|
committer | Doug McLain <doug@nostar.net> | 2007-12-20 23:25:19 +0000 |
commit | b42213bb04031b954eda4f9b39c5f183bfb96ede (patch) | |
tree | ae68422474fb07d4d48486294cbc365cea8fc611 /gtk2_ardour/editor_audiotrack.cc | |
parent | 8c2715ce2c82873ce77319e918b01dbb9e8685b8 (diff) |
Port level meters to trunk
git-svn-id: svn://localhost/ardour2/trunk@2802 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_audiotrack.cc')
-rw-r--r-- | gtk2_ardour/editor_audiotrack.cc | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index 87fa8a06b8..43f63eed79 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -20,9 +20,11 @@ #include <ardour/location.h> #include <ardour/audio_diskstream.h> +#include "ardour_ui.h" #include "editor.h" #include "editing.h" #include "audio_time_axis.h" +#include "route_time_axis.h" #include "audio_region_view.h" #include "selection.h" @@ -91,3 +93,68 @@ Editor::set_show_waveforms_recording (bool yn) } } } + +gint +Editor::start_updating () +{ + RouteTimeAxisView* rtv; + + //cerr << "Editor::start_updating () called" << endl;//DEBUG + if (is_mapped() && session) { + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { + if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) { + rtv->reset_meter (); + } + } + } + + if (!meters_running) { + fast_screen_update_connection = ARDOUR_UI::SuperRapidScreenUpdate.connect (mem_fun(*this, &Editor::fast_update_strips)); + meters_running = true; + } + return 0; +} + +gint +Editor::stop_updating () +{ + RouteTimeAxisView* rtv; + + meters_running = false; + fast_screen_update_connection.disconnect(); + //cerr << "Editor::stop_updating () called" << endl;//DEBUG + if (is_mapped() && session) { + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { + if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) { + rtv->hide_meter (); + } + } + } + + return 0; +} + +void +Editor::toggle_meter_updating() +{ + if (Config->get_show_track_meters()) { + start_updating(); + } else { + stop_updating (); + } +} + +void +Editor::fast_update_strips () +{ + RouteTimeAxisView* rtv; + + if (is_mapped() && session) { + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { + if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) { + rtv->fast_update (); + } + } + } +} + |