2 Copyright (C) 2002 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>
32 class AudioTrack : public Route
35 AudioTrack (Session&, string name, Route::Flag f = Route::Flag (0));
36 AudioTrack (Session&, const XMLNode&);
39 int set_name (string str, void *src);
41 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 int no_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame,
45 jack_nframes_t offset, bool state_changing, bool can_record, bool rec_monitors_input);
46 int silent_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame,
47 jack_nframes_t offset, bool can_record, bool rec_monitors_input);
49 void toggle_monitor_input ();
51 bool can_record() const { return true; }
52 void set_record_enable (bool yn, void *src);
54 DiskStream& disk_stream() const { return *diskstream; }
55 int set_diskstream (DiskStream&, void *);
56 int use_diskstream (string name);
57 int use_diskstream (id_t id);
59 jack_nframes_t update_total_latency();
60 void set_latency_delay (jack_nframes_t);
62 int export_stuff (vector<Sample*>& buffers, uint32_t nbufs, jack_nframes_t nframes, jack_nframes_t end_frame);
64 sigc::signal<void,void*> diskstream_changed;
72 FreezeState freeze_state() const;
74 sigc::signal<void> FreezeChange;
76 void freeze (InterThreadInfo&);
79 void bounce (InterThreadInfo&);
80 void bounce_range (jack_nframes_t start, jack_nframes_t end, InterThreadInfo&);
83 int set_state(const XMLNode& node);
85 MIDI::Controllable& midi_rec_enable_control() {
86 return _midi_rec_enable_control;
89 void reset_midi_control (MIDI::Port*, bool);
90 void send_all_midi_feedback ();
92 bool record_enabled() const;
93 void set_meter_point (MeterPoint, void* src);
96 DiskStream *diskstream;
97 MeterPoint _saved_meter_point;
99 void passthru_silence (jack_nframes_t start_frame, jack_nframes_t end_frame,
100 jack_nframes_t nframes, jack_nframes_t offset, int declick,
103 uint32_t n_process_buffers ();
106 struct FreezeRecordInsertInfo {
107 FreezeRecordInsertInfo(XMLNode& st)
108 : state (st), insert (0) {}
116 struct FreezeRecord {
119 have_mementos = false;
124 AudioPlaylist* playlist;
125 vector<FreezeRecordInsertInfo*> insert_info;
130 FreezeRecord _freeze_record;
131 XMLNode* pending_state;
133 void diskstream_record_enable_changed (void *src);
134 void diskstream_input_channel_changed (void *src);
136 void input_change_handler (void *src);
138 sigc::connection recenable_connection;
139 sigc::connection ic_connection;
141 XMLNode& state(bool);
143 int deprecated_use_diskstream_connections ();
144 void set_state_part_two ();
145 void set_state_part_three ();
147 struct MIDIRecEnableControl : public MIDI::Controllable {
148 MIDIRecEnableControl (AudioTrack&, MIDI::Port *);
149 void set_value (float);
150 void send_feedback (bool);
151 MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool val, bool force = false);
157 MIDIRecEnableControl _midi_rec_enable_control;
160 }; /* namespace ARDOUR*/
162 #endif /* __ardour_audio_track_h__ */