latched rec-enable
git-svn-id: svn://localhost/trunk/ardour2@277 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2a25079173
commit
cd87dceb0f
|
@ -194,6 +194,7 @@
|
|||
<separator/>
|
||||
<menuitem action='StopPluginsWithTransport'/>
|
||||
<menuitem action='DoNotRunPluginsWhileRecording'/>
|
||||
<menuitem action='LatchedRecordEnable'/>
|
||||
<separator/>
|
||||
<menuitem action='VerifyRemoveLastCapture'/>
|
||||
<menuitem action='StopRecordingOnXrun'/>
|
||||
|
|
|
@ -1052,7 +1052,7 @@ ARDOUR_UI::transport_record ()
|
|||
break;
|
||||
case Session::Recording:
|
||||
case Session::Enabled:
|
||||
session->disable_record ();
|
||||
session->disable_record (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -1242,7 +1242,6 @@ Session::get_template()
|
|||
|
||||
disable_record ();
|
||||
|
||||
cerr << "STart get template\n";
|
||||
return state(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user