merged with 1697 revision of trunk (which is post-rc1 but pre-rc2
[ardour.git] / gtk2_ardour / editor_audiotrack.cc
1 #include <ardour/location.h>
2 #include <ardour/audio_diskstream.h>
3
4 #include "editor.h"
5 #include "editing.h"
6 #include "audio_time_axis.h"
7 #include "region_view.h"
8 #include "selection.h"
9
10 using namespace ARDOUR;
11 using namespace PBD;
12
13 void
14 Editor::set_route_loop_selection ()
15 {
16         if (session == 0 || selection->time.empty()) {
17                 return;
18         }
19
20         nframes_t start = selection->time[clicked_selection].start;
21         nframes_t end = selection->time[clicked_selection].end;
22
23         Location* loc = transport_loop_location();
24
25         if (loc) {
26                 
27                 loc->set (start, end);
28
29                 // enable looping, reposition and start rolling
30                 session->request_play_loop (true);
31                 session->request_locate (loc->start(), true);
32         }
33
34 }
35
36 void
37 Editor::set_show_waveforms (bool yn)
38 {
39         AudioTimeAxisView* atv;
40
41         if (_show_waveforms != yn) {
42                 _show_waveforms = 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 (yn);
46                         }
47                 }
48         }
49 }
50
51 void
52 Editor::set_show_waveforms_recording (bool yn)
53 {
54         AudioTimeAxisView* atv;
55
56         if (_show_waveforms_recording != yn) {
57                 _show_waveforms_recording = yn;
58                 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
59                         if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
60                                 atv->set_show_waveforms_recording (yn);
61                         }
62                 }
63         }
64 }