mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 04:36:30 +01:00
save&restore for track monitor state
git-svn-id: svn://localhost/ardour2/branches/3.0@10263 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
96dcffcb22
commit
56da993d83
4 changed files with 54 additions and 8 deletions
|
|
@ -89,7 +89,7 @@ class Track : public Route, public PublicDiskstream
|
||||||
|
|
||||||
XMLNode& get_state();
|
XMLNode& get_state();
|
||||||
XMLNode& get_template();
|
XMLNode& get_template();
|
||||||
virtual int set_state (const XMLNode&, int version) = 0;
|
int set_state (const XMLNode&, int version);
|
||||||
static void zero_diskstream_id_in_xml (XMLNode&);
|
static void zero_diskstream_id_in_xml (XMLNode&);
|
||||||
|
|
||||||
boost::shared_ptr<PBD::Controllable> rec_enable_control() { return _rec_enable_control; }
|
boost::shared_ptr<PBD::Controllable> rec_enable_control() { return _rec_enable_control; }
|
||||||
|
|
@ -162,7 +162,8 @@ class Track : public Route, public PublicDiskstream
|
||||||
PBD::Signal0<void> AlignmentStyleChanged;
|
PBD::Signal0<void> AlignmentStyleChanged;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual XMLNode& state (bool full) = 0;
|
XMLNode& state (bool full);
|
||||||
|
int _set_state (const XMLNode&, int version, bool);
|
||||||
|
|
||||||
boost::shared_ptr<Diskstream> _diskstream;
|
boost::shared_ptr<Diskstream> _diskstream;
|
||||||
MeterPoint _saved_meter_point;
|
MeterPoint _saved_meter_point;
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
XMLNode *child;
|
XMLNode *child;
|
||||||
|
|
||||||
if (call_base) {
|
if (call_base) {
|
||||||
if (Route::_set_state (node, version, call_base)) {
|
if (Track::_set_state (node, version, call_base)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -263,7 +263,7 @@ AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
XMLNode&
|
XMLNode&
|
||||||
AudioTrack::state (bool full_state)
|
AudioTrack::state (bool full_state)
|
||||||
{
|
{
|
||||||
XMLNode& root (Route::state(full_state));
|
XMLNode& root (Track::state(full_state));
|
||||||
XMLNode* freeze_node;
|
XMLNode* freeze_node;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,11 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
const XMLProperty *prop;
|
const XMLProperty *prop;
|
||||||
XMLNodeConstIterator iter;
|
XMLNodeConstIterator iter;
|
||||||
|
|
||||||
if (Route::_set_state (node, version, call_base)) {
|
if (call_base) {
|
||||||
|
if (Track::_set_state (node, version, call_base)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// No destructive MIDI tracks (yet?)
|
// No destructive MIDI tracks (yet?)
|
||||||
_mode = Normal;
|
_mode = Normal;
|
||||||
|
|
@ -209,7 +211,7 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
XMLNode&
|
XMLNode&
|
||||||
MidiTrack::state(bool full_state)
|
MidiTrack::state(bool full_state)
|
||||||
{
|
{
|
||||||
XMLNode& root (Route::state(full_state));
|
XMLNode& root (Track::state(full_state));
|
||||||
XMLNode* freeze_node;
|
XMLNode* freeze_node;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
|
|
@ -355,7 +357,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
|
||||||
_input->process_input (_meter, start_frame, end_frame, nframes);
|
_input->process_input (_meter, start_frame, end_frame, nframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diskstream->record_enabled() && !can_record && !_session.config.get_auto_input()) {
|
if (should_monitor_input ()) {
|
||||||
|
|
||||||
/* not actually recording, but we want to hear the input material anyway,
|
/* not actually recording, but we want to hear the input material anyway,
|
||||||
at least potentially (depending on monitoring options)
|
at least potentially (depending on monitoring options)
|
||||||
|
|
|
||||||
|
|
@ -64,13 +64,46 @@ Track::init ()
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNode&
|
XMLNode&
|
||||||
Track::get_state ()
|
Track::get_state ()
|
||||||
{
|
{
|
||||||
return state (true);
|
return state (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XMLNode&
|
||||||
|
Track::state (bool full)
|
||||||
|
{
|
||||||
|
XMLNode& root (Route::state (full));
|
||||||
|
root.add_property (X_("monitoring"), enum_2_string (_monitoring));
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
Track::set_state (const XMLNode& node, int version)
|
||||||
|
{
|
||||||
|
return _set_state (node, version, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
Track::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
|
{
|
||||||
|
if (call_base) {
|
||||||
|
if (Route::_set_state (node, version, call_base)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const XMLProperty* prop;
|
||||||
|
|
||||||
|
if ((prop = node.property (X_("monitoring"))) != 0) {
|
||||||
|
_monitoring = MonitorChoice (string_2_enum (prop->value(), _monitoring));
|
||||||
|
} else {
|
||||||
|
_monitoring = MonitorAuto;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
XMLNode&
|
XMLNode&
|
||||||
Track::get_template ()
|
Track::get_template ()
|
||||||
|
|
@ -740,3 +773,13 @@ Track::set_monitoring (MonitorChoice mc)
|
||||||
MonitoringChanged (); /* EMIT SIGNAL */
|
MonitoringChanged (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Track::should_monitor_input ()
|
||||||
|
{
|
||||||
|
return (_monitoring & MonitorInput) ||
|
||||||
|
(!(_monitoring & MonitorDisk) &&
|
||||||
|
(diskstream->record_enabled() &&
|
||||||
|
!can_record &&
|
||||||
|
!_session.config.get_auto_input()));
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue