2 Copyright (C) 2002-2006 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.
21 #ifndef __ardour_audio_track_h__
22 #define __ardour_audio_track_h__
24 #include <ardour/route.h>
29 class AudioDiskstream;
33 class AudioTrack : public Route
36 AudioTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
37 AudioTrack (Session&, const XMLNode&);
40 int set_name (string str, void *src);
42 int roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame,
44 jack_nframes_t offset, int declick, bool can_record, bool rec_monitors_input);
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 int silent_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame,
48 jack_nframes_t offset, bool can_record, bool rec_monitors_input);
50 void toggle_monitor_input ();
52 bool can_record() const { return true; }
53 void set_record_enable (bool yn, void *src);
55 AudioDiskstream& disk_stream() const { return *diskstream; }
56 int set_diskstream (AudioDiskstream&, void *);
57 int use_diskstream (string name);
58 int use_diskstream (id_t id);
60 TrackMode mode() const { return _mode; }
61 void set_mode (TrackMode m);
62 sigc::signal<void> ModeChanged;
64 jack_nframes_t update_total_latency();
65 void set_latency_delay (jack_nframes_t);
67 int export_stuff (vector<Sample*>& buffers, char * workbuf, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t end_frame);
69 sigc::signal<void,void*> diskstream_changed;
77 FreezeState freeze_state() const;
79 sigc::signal<void> FreezeChange;
81 void freeze (InterThreadInfo&);
84 void bounce (InterThreadInfo&);
85 void bounce_range (jack_nframes_t start, jack_nframes_t end, InterThreadInfo&);
88 XMLNode& get_template();
89 int set_state(const XMLNode& node);
91 MIDI::Controllable& midi_rec_enable_control() {
92 return _midi_rec_enable_control;
95 void reset_midi_control (MIDI::Port*, bool);
96 void send_all_midi_feedback ();
98 bool record_enabled() const;
99 void set_meter_point (MeterPoint, void* src);
102 AudioDiskstream *diskstream;
103 MeterPoint _saved_meter_point;
106 XMLNode& state (bool full);
108 void passthru_silence (jack_nframes_t start_frame, jack_nframes_t end_frame,
109 jack_nframes_t nframes, jack_nframes_t offset, int declick,
112 uint32_t n_process_buffers ();
115 struct FreezeRecordInsertInfo {
116 FreezeRecordInsertInfo(XMLNode& st)
117 : state (st), insert (0) {}
125 struct FreezeRecord {
128 have_mementos = false;
133 AudioPlaylist* playlist;
134 vector<FreezeRecordInsertInfo*> insert_info;
139 FreezeRecord _freeze_record;
140 XMLNode* pending_state;
142 void diskstream_record_enable_changed (void *src);
143 void diskstream_input_channel_changed (void *src);
145 void input_change_handler (void *src);
147 sigc::connection recenable_connection;
148 sigc::connection ic_connection;
150 int deprecated_use_diskstream_connections ();
151 void set_state_part_two ();
152 void set_state_part_three ();
154 struct MIDIRecEnableControl : public MIDI::Controllable {
155 MIDIRecEnableControl (AudioTrack&, MIDI::Port *);
156 void set_value (float);
157 void send_feedback (bool);
158 MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force = false);
164 MIDIRecEnableControl _midi_rec_enable_control;
169 }; /* namespace ARDOUR*/
171 #endif /* __ardour_audio_track_h__ */