summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour.menus1
-rw-r--r--gtk2_ardour/ardour_ui.cc2
-rw-r--r--gtk2_ardour/ardour_ui.h1
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc2
-rw-r--r--gtk2_ardour/ardour_ui_options.cc7
-rw-r--r--gtk2_ardour/route_ui.cc3
-rw-r--r--gtk2_ardour/streamview.cc3
-rw-r--r--libs/ardour/ardour/configuration.h5
-rw-r--r--libs/ardour/ardour/session.h5
-rw-r--r--libs/ardour/configuration.cc21
-rw-r--r--libs/ardour/session.cc25
-rw-r--r--libs/ardour/session_midi.cc2
-rw-r--r--libs/ardour/session_state.cc1
-rw-r--r--libs/ardour/session_transport.cc14
14 files changed, 71 insertions, 21 deletions
diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus
index 67d9aca462..4874eddc2a 100644
--- a/gtk2_ardour/ardour.menus
+++ b/gtk2_ardour/ardour.menus
@@ -194,6 +194,7 @@
<separator/>
<menuitem action='StopPluginsWithTransport'/>
<menuitem action='DoNotRunPluginsWhileRecording'/>
+ <menuitem action='LatchedRecordEnable'/>
<separator/>
<menuitem action='VerifyRemoveLastCapture'/>
<menuitem action='StopRecordingOnXrun'/>
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index de23ebdcc3..686652c4eb 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1052,7 +1052,7 @@ ARDOUR_UI::transport_record ()
break;
case Session::Recording:
case Session::Enabled:
- session->disable_record ();
+ session->disable_record (true);
}
}
}
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index e5f7f4d96e..f0637ad535 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -690,6 +690,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void toggle_SoloViaBus();
void toggle_AutomaticallyCreateCrossfades();
void toggle_UnmuteNewFullCrossfades();
+ void toggle_LatchedRecordEnable ();
void mtc_port_changed ();
void map_some_session_state (const char* group, const char* action, bool (ARDOUR::Session::*get)() const);
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index d10683ec9e..b065f55a06 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -380,6 +380,8 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
ActionManager::session_sensitive_actions.push_back (act);
+
+ ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable));
act = ActionManager::register_toggle_action (option_actions, X_("VerifyRemoveLastCapture"), _("Verify remove last capture"), mem_fun (*this, &ARDOUR_UI::toggle_VerifyRemoveLastCapture));
ActionManager::session_sensitive_actions.push_back (act);
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 5a15bd7de3..14b385e175 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -239,6 +239,13 @@ ARDOUR_UI::toggle_StopPluginsWithTransport()
{
toggle_config_state ("options", "StopPluginsWithTransport", &Configuration::set_plugins_stop_with_transport);
}
+
+void
+ARDOUR_UI::toggle_LatchedRecordEnable()
+{
+ toggle_config_state ("options", "LatchedRecordEnable", &Configuration::set_latched_record_enable);
+}
+
void
ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording()
{
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index ed93c55811..e974b88a97 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -76,8 +76,7 @@ RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
get_diskstream()->record_enable_changed.connect (mem_fun (*this, &RouteUI::route_rec_enable_changed));
- _session.RecordEnabled.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
- _session.RecordDisabled.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
+ _session.RecordStateChanged.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
rec_enable_button = manage (new BindableToggleButton (& at->midi_rec_enable_control(), r_name ));
rec_enable_button->set_bind_button_state (2, GDK_CONTROL_MASK);
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index a8b7499644..e661b5d49c 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -82,8 +82,7 @@ StreamView::StreamView (AudioTimeAxisView& tv)
_trackview.audio_track()->diskstream_changed.connect (mem_fun (*this, &StreamView::diskstream_changed));
_trackview.session().TransportStateChange.connect (mem_fun (*this, &StreamView::transport_changed));
_trackview.get_diskstream()->record_enable_changed.connect (mem_fun (*this, &StreamView::rec_enable_changed));
- _trackview.session().RecordEnabled.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed));
- _trackview.session().RecordDisabled.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed));
+ _trackview.session().RecordStateChanged.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed));
}
rec_updating = false;
diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h
index fd44d27329..c0a1301318 100644
--- a/libs/ardour/ardour/configuration.h
+++ b/libs/ardour/ardour/configuration.h
@@ -64,6 +64,9 @@ class Configuration : public Stateful
XMLNode * get_keys() const;
void set_keys(XMLNode *);
+ void set_latched_record_enable (bool yn);
+ bool get_latched_record_enable();
+
void set_use_vst (bool yn);
bool get_use_vst();
@@ -243,6 +246,8 @@ class Configuration : public Stateful
bool quieten_at_speed_is_user;
uint32_t midi_feedback_interval_ms;
bool midi_feedback_interval_ms_is_user;
+ bool latched_record_enable;
+ bool latched_record_enable_is_user;
XMLNode *key_node;
bool user_configuration;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 2bdd99c614..297ce0d94a 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -317,7 +317,7 @@ class Session : public sigc::trackable, public Stateful
bool record_enabling_legal () const;
void maybe_enable_record ();
- void disable_record ();
+ void disable_record (bool force = false);
void step_back_from_record ();
sigc::signal<void> going_away;
@@ -332,8 +332,7 @@ class Session : public sigc::trackable, public Stateful
/* Record status signals */
- sigc::signal<void> RecordEnabled;
- sigc::signal<void> RecordDisabled;
+ sigc::signal<void> RecordStateChanged;
/* Transport mechanism signals */
diff --git a/libs/ardour/configuration.cc b/libs/ardour/configuration.cc
index 28f13aabb8..61d288ab51 100644
--- a/libs/ardour/configuration.cc
+++ b/libs/ardour/configuration.cc
@@ -291,6 +291,9 @@ Configuration::state (bool user_only)
snprintf (buf, sizeof (buf), "%f", speed_quietning);
node->add_child_nocopy(option_node("quieten-at-speed", buf));
}
+ if (!user_only || latched_record_enable_is_user) {
+ node->add_child_nocopy(option_node("latched-record-enable", latched_record_enable?"yes":"no"));
+ }
/* use-vst is always per-user */
node->add_child_nocopy (option_node ("use-vst", use_vst?"yes":"no"));
@@ -431,6 +434,8 @@ Configuration::set_state (const XMLNode& root)
}
} else if (option_name == "midi-feedback-interval-ms") {
set_midi_feedback_interval_ms (atoi (option_value.c_str()));
+ } else if (option_name == "latched-record-enable") {
+ set_latched_record_enable (option_value == "yes");
}
}
@@ -526,6 +531,7 @@ Configuration::set_defaults ()
timecode_source_is_synced_is_user = false;
quieten_at_speed_is_user = false;
midi_feedback_interval_ms_is_user = false;
+ latched_record_enable_is_user = false;
}
Configuration::MidiPortDescriptor::MidiPortDescriptor (const XMLNode& node)
@@ -1130,3 +1136,18 @@ Configuration::set_quieten_at_speed (float gain_coefficient)
quieten_at_speed_is_user = true;
}
}
+
+void
+Configuration::set_latched_record_enable (bool yn)
+{
+ latched_record_enable = yn;
+ if (user_configuration) {
+ latched_record_enable_is_user = true;
+ }
+}
+
+bool
+Configuration::get_latched_record_enable ()
+{
+ return latched_record_enable;
+}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index bcc7c13bb5..90458fa2fd 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -1249,21 +1249,30 @@ Session::enable_record ()
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
- //cerr << "switching to input" << __FILE__ << __LINE__ << endl << endl;
(*i)->monitor_input (true);
}
}
}
- RecordEnabled ();
+ RecordStateChanged ();
}
}
void
-Session::disable_record ()
+Session::disable_record (bool force)
{
- if (atomic_read (&_record_status) != Disabled) {
- atomic_set (&_record_status, Disabled);
+ RecordState rs;
+
+ if ((rs = (RecordState) atomic_read (&_record_status)) != Disabled) {
+
+ if (!Config->get_latched_record_enable () || force) {
+ atomic_set (&_record_status, Disabled);
+ } else {
+ if (rs == Recording) {
+ atomic_set (&_record_status, Enabled);
+ }
+ }
+
send_mmc_in_another_thread (MIDI::MachineControl::cmdRecordExit);
if (Config->get_use_hardware_monitoring() && auto_input) {
@@ -1275,15 +1284,13 @@ Session::disable_record ()
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)->record_enabled ()) {
- //cerr << "switching from input" << __FILE__ << __LINE__ << endl << endl;
(*i)->monitor_input (false);
}
}
}
- RecordDisabled ();
+ RecordStateChanged (); /* emit signal */
remove_pending_capture_state ();
-
}
}
@@ -1321,7 +1328,7 @@ Session::maybe_enable_record ()
}
} else {
send_mmc_in_another_thread (MIDI::MachineControl::cmdRecordPause);
- RecordEnabled (); /* EMIT SIGNAL */
+ RecordStateChanged (); /* EMIT SIGNAL */
}
set_dirty();
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index f793dba956..2b7afa354a 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -623,7 +623,7 @@ Session::mmc_record_strobe (MIDI::MachineControl &mmc)
save_state ("", true);
atomic_set (&_record_status, Enabled);
- RecordEnabled (); /* EMIT SIGNAL */
+ RecordStateChanged (); /* EMIT SIGNAL */
request_transport_speed (1.0);
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index d580680f63..09834fa27a 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -1242,7 +1242,6 @@ Session::get_template()
disable_record ();
- cerr << "STart get template\n";
return state(false);
}
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 096267d0dd..e2a9f23890 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -386,8 +386,18 @@ Session::non_realtime_stop (bool abort)
deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
if (did_record) {
- atomic_set (&_record_status, Disabled);
- RecordDisabled (); /* EMIT SIGNAL */
+
+ /* XXX its a little odd that we're doing this here
+ when realtime_stop(), which has already executed,
+ will have done this.
+ */
+
+ if (!Config->get_latched_record_enable()) {
+ atomic_set (&_record_status, Disabled);
+ } else {
+ atomic_set (&_record_status, Enabled);
+ }
+ RecordStateChanged (); /* emit signal */
}
if ((post_transport_work & PostTransportLocate) && get_record_enabled()) {