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"
26 #include "audio_time_axis.h"
27 #include "route_time_axis.h"
28 #include "audio_region_view.h"
29 #include "selection.h"
33 using namespace ARDOUR;
37 Editor::set_loop_from_selection (bool play)
39 if (session == 0 || selection->time.empty()) {
43 nframes_t start = selection->time[clicked_selection].start;
44 nframes_t end = selection->time[clicked_selection].end;
46 set_loop_range (start, end, _("set loop range from selection"));
49 session->request_play_loop (true);
50 session->request_locate (start, true);
55 Editor::set_punch_from_selection ()
57 if (session == 0 || selection->time.empty()) {
61 nframes_t start = selection->time[clicked_selection].start;
62 nframes_t end = selection->time[clicked_selection].end;
64 set_punch_range (start, end, _("set punch range from selection"));
68 Editor::set_show_waveforms (bool yn)
70 AudioTimeAxisView* atv;
72 if (_show_waveforms != yn) {
74 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
75 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
76 atv->set_show_waveforms (yn);
83 Editor::set_show_waveforms_recording (bool yn)
85 AudioTimeAxisView* atv;
87 if (_show_waveforms_recording != yn) {
88 _show_waveforms_recording = yn;
89 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
90 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
91 atv->set_show_waveforms_recording (yn);
98 Editor::start_updating ()
100 RouteTimeAxisView* rtv;
102 //cerr << "Editor::start_updating () called" << endl;//DEBUG
103 if (is_mapped() && session) {
104 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
105 if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
111 if (!meters_running) {
112 fast_screen_update_connection = ARDOUR_UI::SuperRapidScreenUpdate.connect (mem_fun(*this, &Editor::fast_update_strips));
113 meters_running = true;
119 Editor::stop_updating ()
121 RouteTimeAxisView* rtv;
123 meters_running = false;
124 fast_screen_update_connection.disconnect();
125 //cerr << "Editor::stop_updating () called" << endl;//DEBUG
126 if (is_mapped() && session) {
127 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
128 if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
138 Editor::toggle_meter_updating()
140 if (Config->get_show_track_meters()) {
148 Editor::fast_update_strips ()
150 RouteTimeAxisView* rtv;
152 if (is_mapped() && session) {
153 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
154 if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {