the BIG CONFIG patch
[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         jack_nframes_t start = selection->time[clicked_selection].start;
21         jack_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                 DisplayControlChanged (Editing::ShowWaveforms);
49         }
50 }
51
52 void
53 Editor::set_show_waveforms_recording (bool yn)
54 {
55         AudioTimeAxisView* atv;
56
57         if (_show_waveforms_recording != yn) {
58                 _show_waveforms_recording = yn;
59                 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
60                         if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
61                                 atv->set_show_waveforms_recording (yn);
62                         }
63                 }
64                 DisplayControlChanged (Editing::ShowWaveformsRecording);
65         }
66 }