Initial import of gtk2_ardour.
[ardour.git] / gtk2_ardour / editor_audiotrack.cc
1 #include <ardour/location.h>
2 #include <ardour/diskstream.h>
3
4 #include "editor.h"
5 #include "editing.h"
6 #include "audio_time_axis.h"
7 #include "regionview.h"
8 #include "selection.h"
9
10 using namespace ARDOUR;
11
12 void
13 Editor::set_route_loop_selection ()
14 {
15         if (session == 0 || selection->time.empty()) {
16                 return;
17         }
18
19         jack_nframes_t start = selection->time[clicked_selection].start;
20         jack_nframes_t end = selection->time[clicked_selection].end;
21
22         Location* loc = transport_loop_location();
23
24         if (loc) {
25                 
26                 loc->set (start, end);
27
28                 // enable looping, reposition and start rolling
29                 session->request_auto_loop (true);
30                 session->request_locate (loc->start(), true);
31         }
32
33 }
34
35 void
36 Editor::set_show_waveforms (bool yn)
37 {
38         AudioTimeAxisView* atv;
39
40         if (_show_waveforms != yn) {
41                 _show_waveforms = yn;
42                 for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
43                         if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
44                                 atv->set_show_waveforms (yn);
45                         }
46                 }
47                 DisplayControlChanged (Editing::ShowWaveforms);
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                 DisplayControlChanged (Editing::ShowWaveformsRecording);
64         }
65 }