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 "region_view.h"
28 #include "selection.h"
32 using namespace ARDOUR;
36 Editor::set_loop_from_selection (bool play)
38 if (session == 0 || selection->time.empty()) {
42 nframes_t start = selection->time[clicked_selection].start;
43 nframes_t end = selection->time[clicked_selection].end;
45 set_loop_range (start, end, _("set loop range from selection"));
48 session->request_play_loop (true);
49 session->request_locate (start, true);
54 Editor::set_punch_from_selection ()
56 if (session == 0 || selection->time.empty()) {
60 nframes_t start = selection->time[clicked_selection].start;
61 nframes_t end = selection->time[clicked_selection].end;
63 set_punch_range (start, end, _("set punch range from selection"));
67 Editor::set_show_waveforms (bool yn)
69 AudioTimeAxisView* atv;
71 if (_show_waveforms != yn) {
73 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
74 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
75 atv->set_show_waveforms (yn);
82 Editor::set_show_waveforms_recording (bool yn)
84 AudioTimeAxisView* atv;
86 if (_show_waveforms_recording != yn) {
87 _show_waveforms_recording = yn;
88 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
89 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
90 atv->set_show_waveforms_recording (yn);
97 Editor::start_updating ()
99 AudioTimeAxisView* atv;
101 //cerr << "Editor::start_updating () called" << endl;//DEBUG
102 if (is_mapped() && session) {
103 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
104 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
109 fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun(*this, &Editor::fast_update_strips));
114 Editor::stop_updating ()
117 fast_screen_update_connection.disconnect();
118 AudioTimeAxisView* atv;
120 //cerr << "Editor::stop_updating () called" << endl;//DEBUG
121 if (is_mapped() && session) {
122 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
123 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
133 Editor::toggle_meter_updating()
135 if (Config->get_show_track_meters()) {
143 Editor::fast_update_strips ()
145 AudioTimeAxisView* atv;
147 if (is_mapped() && session) {
148 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
149 if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {