Remove idiocy.
[ardour2.git] / gtk2_ardour / editor_audiotrack.cc
blob084a7f99841bd88bd612ba1015bf051ce3886c41
1 /*
2 Copyright (C) 2000-2007 Paul Davis
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.
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.
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.
20 #include "ardour/location.h"
21 #include "ardour/audio_diskstream.h"
23 #include "ardour_ui.h"
24 #include "editor.h"
25 #include "editing.h"
26 #include "audio_time_axis.h"
27 #include "route_time_axis.h"
28 #include "audio_region_view.h"
29 #include "selection.h"
31 #include "i18n.h"
33 using namespace ARDOUR;
34 using namespace PBD;
36 void
37 Editor::set_show_waveforms_recording (bool yn)
39 AudioTimeAxisView* atv;
41 if (_show_waveforms_recording != yn) {
42 _show_waveforms_recording = yn;
43 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
44 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
45 atv->set_show_waveforms_recording (yn);
51 gint
52 Editor::start_updating ()
54 RouteTimeAxisView* rtv;
56 //cerr << "Editor::start_updating () called" << endl;//DEBUG
57 if (is_mapped() && session) {
58 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
59 if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
60 rtv->reset_meter ();
65 if (!meters_running) {
66 fast_screen_update_connection = ARDOUR_UI::SuperRapidScreenUpdate.connect (mem_fun(*this, &Editor::fast_update_strips));
67 meters_running = true;
69 return 0;
72 gint
73 Editor::stop_updating ()
75 RouteTimeAxisView* rtv;
77 meters_running = false;
78 fast_screen_update_connection.disconnect();
79 //cerr << "Editor::stop_updating () called" << endl;//DEBUG
80 if (is_mapped() && session) {
81 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
82 if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
83 rtv->hide_meter ();
88 return 0;
91 void
92 Editor::toggle_meter_updating()
94 if (Config->get_show_track_meters()) {
95 start_updating();
96 } else {
97 stop_updating ();
99 track_canvas_allocate(track_canvas->get_allocation());
102 void
103 Editor::fast_update_strips ()
105 RouteTimeAxisView* rtv;
107 if (is_mapped() && session) {
108 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
109 if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
110 rtv->fast_update ();