2 Copyright (C) 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.
19 #ifndef __ardour_track_h__
20 #define __ardour_track_h__
22 #include <ardour/route.h>
31 class Track : public Route
34 Track (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO);
38 int set_name (string str, void *src);
40 virtual int roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame,
41 jack_nframes_t offset, int declick, bool can_record, bool rec_monitors_input) = 0;
43 virtual int no_roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame,
44 jack_nframes_t offset, bool state_changing, bool can_record, bool rec_monitors_input) = 0;
46 virtual 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) = 0;
49 void toggle_monitor_input ();
51 virtual bool can_record();
53 Diskstream& diskstream() const { return *_diskstream; }
55 virtual int use_diskstream (string name) = 0;
56 virtual int use_diskstream (const PBD::ID& id) = 0;
58 TrackMode mode() const { return _mode; }
59 void set_mode (TrackMode m);
61 jack_nframes_t update_total_latency();
62 void set_latency_delay (jack_nframes_t);
70 FreezeState freeze_state() const;
72 virtual void freeze (InterThreadInfo&) = 0;
73 virtual void unfreeze () = 0;
75 virtual void bounce (InterThreadInfo&) = 0;
76 virtual void bounce_range (jack_nframes_t start, jack_nframes_t end, InterThreadInfo&) = 0;
79 XMLNode& get_template();
80 virtual int set_state(const XMLNode& node) = 0;
82 PBD::Controllable& rec_enable_control() { return _rec_enable_control; }
84 bool record_enabled() const;
85 void set_record_enable (bool yn, void *src);
87 void set_meter_point (MeterPoint, void* src);
89 sigc::signal<void> ModeChanged;
90 sigc::signal<void> DiskstreamChanged;
91 sigc::signal<void> FreezeChange;
94 Track (Session& sess, const XMLNode& node, DataType default_type = DataType::AUDIO);
96 virtual XMLNode& state (bool full) = 0;
98 virtual void passthru_silence (jack_nframes_t start_frame, jack_nframes_t end_frame,
99 jack_nframes_t nframes, jack_nframes_t offset, int declick, bool meter) = 0;
101 virtual ChanCount n_process_buffers () = 0;
103 Diskstream *_diskstream;
104 MeterPoint _saved_meter_point;
108 struct FreezeRecordInsertInfo {
109 FreezeRecordInsertInfo(XMLNode& st, boost::shared_ptr<Insert> ins)
110 : state (st), insert (ins) {}
113 boost::shared_ptr<Insert> insert;
118 struct FreezeRecord {
121 , have_mementos(false)
127 vector<FreezeRecordInsertInfo*> insert_info;
132 struct RecEnableControllable : public PBD::Controllable {
133 RecEnableControllable (Track&);
135 void set_value (float);
136 float get_value (void) const;
141 //virtual void diskstream_record_enable_changed (void *src) = 0;
142 //virtual void diskstream_input_channel_changed (void *src) = 0;
144 //virtual void input_change_handler (void *src) = 0;
146 virtual void set_state_part_two () = 0;
148 FreezeRecord _freeze_record;
149 XMLNode* pending_state;
150 sigc::connection recenable_connection;
151 sigc::connection ic_connection;
152 RecEnableControllable _rec_enable_control;
156 }; /* namespace ARDOUR*/
158 #endif /* __ardour_track_h__ */