2616705918c3c4e00e2c5b0debb019702aaee151
[ardour.git] / libs / ardour / ardour / audio_track.h
1 /*
2     Copyright (C) 2002-2006 Paul Davis 
3
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.
8
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.
13
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.
17
18     $Id$
19 */
20
21 #ifndef __ardour_audio_track_h__
22 #define __ardour_audio_track_h__
23
24 #include <ardour/track.h>
25
26 namespace ARDOUR {
27
28 class Session;
29 class AudioDiskstream;
30 class AudioPlaylist;
31 class RouteGroup;
32
33 class AudioTrack : public Track
34 {
35   public:
36         AudioTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
37         AudioTrack (Session&, const XMLNode&);
38         ~AudioTrack ();
39         
40         int set_name (string str, void *src);
41
42         int roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame, 
43                 jack_nframes_t offset, int declick, bool can_record, bool rec_monitors_input);
44         
45         int no_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame, 
46                 jack_nframes_t offset, bool state_changing, bool can_record, bool rec_monitors_input);
47         
48         int silent_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame, 
49                 jack_nframes_t offset, bool can_record, bool rec_monitors_input);
50
51         void set_record_enable (bool yn, void *src);
52
53         AudioDiskstream& audio_diskstream() const;
54
55         int use_diskstream (string name);
56         int use_diskstream (const PBD::ID& id);
57
58         void set_mode (TrackMode m);
59
60         void set_latency_delay (jack_nframes_t);
61         
62         int export_stuff (vector<Sample*>& buffers, char * workbuf, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t end_frame);
63
64         void freeze (InterThreadInfo&);
65         void unfreeze ();
66
67         void bounce (InterThreadInfo&);
68         void bounce_range (jack_nframes_t start, jack_nframes_t end, InterThreadInfo&);
69
70         int set_state(const XMLNode& node);
71
72         bool record_enabled() const;
73
74   protected:
75         XMLNode& state (bool full);
76
77         void passthru_silence (jack_nframes_t start_frame, jack_nframes_t end_frame, 
78                                jack_nframes_t nframes, jack_nframes_t offset, int declick,
79                                bool meter);
80
81         uint32_t n_process_buffers ();
82         
83   private:
84         int  set_diskstream (AudioDiskstream&, void *);
85         int  deprecated_use_diskstream_connections ();
86         void set_state_part_two ();
87         void set_state_part_three ();
88 };
89
90 } // namespace ARDOUR
91
92 #endif /* __ardour_audio_track_h__ */