diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 41987aa98a..a16cb37b63 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1767,7 +1767,7 @@ ARDOUR_UI::transport_record (bool roll) { if (_session) { switch (_session->record_status()) { - case Session::Disabled: + case (RecordState)Disabled: if (_session->ntracks() == 0) { ArdourMessageDialog msg (_main_window, _("Please create one or more tracks before trying to record.\nYou can do this with the \"Add Track or Bus\" option in the Session menu.")); msg.run (); @@ -1778,7 +1778,7 @@ ARDOUR_UI::transport_record (bool roll) transport_roll (); } break; - case Session::Recording: + case (RecordState)Recording: if (roll) { _session->request_stop(); } else { @@ -1786,7 +1786,7 @@ ARDOUR_UI::transport_record (bool roll) } break; - case Session::Enabled: + case (RecordState)Enabled: if (roll) { transport_roll(); } else { diff --git a/gtk2_ardour/ardour_ui3.cc b/gtk2_ardour/ardour_ui3.cc index 86ad0042d8..1763f0238b 100644 --- a/gtk2_ardour/ardour_ui3.cc +++ b/gtk2_ardour/ardour_ui3.cc @@ -230,7 +230,7 @@ ARDOUR_UI::record_state_changed () ActionManager::set_sensitive (ActionManager::rec_sensitive_actions, !_session->actively_recording()); - if (_session->record_status () == Session::Recording && _session->have_rec_enabled_track ()) { + if (_session->record_status () == (RecordState)Recording && _session->have_rec_enabled_track ()) { big_clock->set_active (true); } else { big_clock->set_active (false); diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 18d030dc71..42450ee390 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -200,7 +200,7 @@ AudioStreamView::setup_rec_box () // cerr << "\trolling\n"; if (!rec_active && - _trackview.session()->record_status() == Session::Recording && + _trackview.session()->record_status() == (RecordState)Recording && _trackview.track()->rec_enable_control()->get_value()) { if (_trackview.audio_track()->mode() == Normal && UIConfiguration::instance().get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) { @@ -253,7 +253,7 @@ AudioStreamView::setup_rec_box () create_rec_box(sample_pos, 0); } else if (rec_active && - (_trackview.session()->record_status() != Session::Recording || + (_trackview.session()->record_status() != (RecordState)Recording || !_trackview.track()->rec_enable_control()->get_value())) { screen_update_connection.disconnect(); rec_active = false; diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index cf85dc2d54..793d52820c 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -1688,7 +1688,7 @@ EditorRoutes::idle_update_mute_rec_solo_etc() boost::shared_ptr mt = boost::dynamic_pointer_cast (route); if (trk->rec_enable_control()->get_value()) { - if (_session->record_status() == Session::Recording) { + if (_session->record_status() == (RecordState)Recording) { (*i)[_columns.rec_state] = 1; } else { (*i)[_columns.rec_state] = 2; diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 64de0b3951..a2f7d2ede9 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -459,7 +459,7 @@ MidiStreamView::setup_rec_box () (_trackview.session()->transport_rolling() || _trackview.session()->get_record_enabled())) { if (!rec_active && - _trackview.session()->record_status() == Session::Recording && + _trackview.session()->record_status() == (RecordState)Recording && _trackview.track()->rec_enable_control()->get_value()) { if (UIConfiguration::instance().get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) { @@ -531,7 +531,7 @@ MidiStreamView::setup_rec_box () create_rec_box (_trackview.midi_track()->current_capture_start(), 0); } else if (rec_active && - (_trackview.session()->record_status() != Session::Recording || + (_trackview.session()->record_status() != (RecordState)Recording || !_trackview.track()->rec_enable_control()->get_value())) { screen_update_connection.disconnect(); rec_active = false; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 58a34f02ce..841c0b989e 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -1376,12 +1376,12 @@ RouteUI::blink_rec_display (bool blinkOn) if (track()->rec_enable_control()->get_value()) { switch (_session->record_status ()) { - case Session::Recording: + case (RecordState)Recording: rec_enable_button->set_active_state (Gtkmm2ext::ExplicitActive); break; - case Session::Disabled: - case Session::Enabled: + case (RecordState)Disabled: + case (RecordState)Enabled: if (UIConfiguration::instance().get_blink_rec_arm()) { rec_enable_button->set_active_state ( blinkOn ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off ); } else { diff --git a/gtk2_ardour/transport_control_ui.cc b/gtk2_ardour/transport_control_ui.cc index f7c2a320b3..4fadf4d401 100644 --- a/gtk2_ardour/transport_control_ui.cc +++ b/gtk2_ardour/transport_control_ui.cc @@ -305,16 +305,16 @@ TransportControlUI::blink_rec_enable (bool onoff) return; } - Session::RecordState const r = _session->record_status (); + RecordState const r = _session->record_status (); bool const h = _session->have_rec_enabled_track (); - if (r == Session::Enabled || (r == Session::Recording && !h)) { + if (r == (RecordState)Enabled || (r == (RecordState)Recording && !h)) { if (onoff) { rec_button.set_active_state (Gtkmm2ext::ExplicitActive); } else { rec_button.set_active_state (Gtkmm2ext::Off); } - } else if (r == Session::Recording && h) { + } else if (r == (RecordState)Recording && h) { rec_button.set_active_state (Gtkmm2ext::ExplicitActive); } else { rec_button.unset_active_state (); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index ab1d6bbbd0..876408e6ef 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -195,12 +195,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop private: public: - enum RecordState { - Disabled = 0, - Enabled = 1, - Recording = 2 - }; - /* a new session might have non-empty mix_template, an existing session should always have an empty one. the bus profile can be null if no master out bus is required. */ diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 11d784079d..19f758f5ba 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -847,6 +847,12 @@ enum LocateTransportDisposition { RollIfAppropriate }; +enum RecordState { + Disabled = 0, + Enabled = 1, + Recording = 2 +}; + typedef std::vector CaptureInfos; } // namespace ARDOUR diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index a8b248b7de..d82075b3a0 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -101,7 +101,7 @@ setup_enum_writer () TransportRequestType _TransportRequestType; ShuttleBehaviour _ShuttleBehaviour; ShuttleUnits _ShuttleUnits; - Session::RecordState _Session_RecordState; + RecordState _RecordState; SessionEvent::Type _SessionEvent_Type; SessionEvent::Action _SessionEvent_Action; TimecodeFormat _Session_TimecodeFormat; @@ -442,10 +442,10 @@ setup_enum_writer () REGISTER_ENUM (Semitones); REGISTER (_ShuttleUnits); - REGISTER_CLASS_ENUM (Session, Disabled); - REGISTER_CLASS_ENUM (Session, Enabled); - REGISTER_CLASS_ENUM (Session, Recording); - REGISTER (_Session_RecordState); + REGISTER_ENUM (Disabled); + REGISTER_ENUM (Enabled); + REGISTER_ENUM (Recording); + REGISTER (_RecordState); REGISTER_CLASS_ENUM (SessionEvent, SetTransportSpeed); REGISTER_CLASS_ENUM (SessionEvent, Locate); diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index f2d3d6647c..96e6c16846 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -2595,9 +2595,9 @@ LuaBindings::common (lua_State* L) .beginNamespace ("Session") .beginNamespace ("RecordState") - .addConst ("Disabled", ARDOUR::Session::RecordState(Session::Disabled)) - .addConst ("Enabled", ARDOUR::Session::RecordState(Session::Enabled)) - .addConst ("Recording", ARDOUR::Session::RecordState(Session::Recording)) + .addConst ("Disabled", ARDOUR::RecordState(Disabled)) + .addConst ("Enabled", ARDOUR::RecordState(Enabled)) + .addConst ("Recording", ARDOUR::RecordState(Recording)) .endNamespace () .endNamespace () // end Session enums diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 6a522d3a5f..6555cfcf2f 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -712,7 +712,7 @@ MidiTrack::MidiControl::actually_set_value (double val, PBD::Controllable::Group void MidiTrack::set_step_editing (bool yn) { - if (_session.record_status() != Session::Disabled) { + if (_session.record_status() != (RecordState)Disabled) { return; } diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc index 6343d81e39..9b47cb62d4 100644 --- a/libs/surfaces/cc121/cc121.cc +++ b/libs/surfaces/cc121/cc121.cc @@ -643,13 +643,13 @@ CC121::map_recenable_state () bool onoff; switch (_session->record_status()) { - case Session::Disabled: + case (RecordState)Disabled: onoff = false; break; - case Session::Enabled: + case (RecordState)Enabled: onoff = blink_state; break; - case Session::Recording: + case (RecordState)Recording: if (_session->have_rec_enabled_track ()) { onoff = true; } else { diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index cc67bf4ab2..7cdd3a08ca 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -367,7 +367,7 @@ void BasicUI::rec_enable_toggle () { switch (_session->record_status()) { - case Session::Disabled: + case (RecordState)Disabled: if (_session->ntracks() == 0) { // string txt = _("Please create 1 or more track\nbefore trying to record.\nCheck the Session menu."); // MessageDialog msg (*editor, txt); @@ -376,8 +376,8 @@ BasicUI::rec_enable_toggle () } _session->maybe_enable_record (); break; - case Session::Recording: - case Session::Enabled: + case (RecordState)Recording: + case (RecordState)Enabled: _session->disable_record (false, true); } } diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index ce49519e66..d4cfc1266d 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -660,13 +660,13 @@ FaderPort::map_recenable_state () bool onoff; switch (_session->record_status()) { - case Session::Disabled: + case (RecordState)Disabled: onoff = false; break; - case Session::Enabled: + case (RecordState)Enabled: onoff = blink_state; break; - case Session::Recording: + case (RecordState)Recording: if (_session->have_rec_enabled_track ()) { onoff = true; } else { diff --git a/libs/surfaces/faderport8/callbacks.cc b/libs/surfaces/faderport8/callbacks.cc index 0a920ff67e..b2339adceb 100644 --- a/libs/surfaces/faderport8/callbacks.cc +++ b/libs/surfaces/faderport8/callbacks.cc @@ -149,15 +149,15 @@ void FaderPort8::notify_record_state_changed () { switch (_session->record_status ()) { - case Session::Disabled: + case (RecordState)Disabled: _ctrls.button (FP8Controls::BtnRecord).set_active (0); _ctrls.button (FP8Controls::BtnRecord).set_blinking (false); break; - case Session::Enabled: + case (RecordState)Enabled: _ctrls.button (FP8Controls::BtnRecord).set_active (true); _ctrls.button (FP8Controls::BtnRecord).set_blinking (true); break; - case Session::Recording: + case (RecordState)Recording: _ctrls.button (FP8Controls::BtnRecord).set_active (true); _ctrls.button (FP8Controls::BtnRecord).set_blinking (false); break; diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index f31447782c..33c0fa190e 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1398,15 +1398,15 @@ MackieControlProtocol::notify_record_state_changed () LedState ls; switch (_session->record_status()) { - case Session::Disabled: + case (RecordState)Disabled: DEBUG_TRACE (DEBUG::MackieControl, "record state changed to disabled, LED off\n"); ls = off; break; - case Session::Recording: + case (RecordState)Recording: DEBUG_TRACE (DEBUG::MackieControl, "record state changed to recording, LED on\n"); ls = on; break; - case Session::Enabled: + case (RecordState)Enabled: if(_device_info.is_qcon()){ // For qcon the rec button is two state only (on/off) diff --git a/libs/surfaces/maschine2/callbacks.cc b/libs/surfaces/maschine2/callbacks.cc index c93d138cc5..ede1a39db4 100644 --- a/libs/surfaces/maschine2/callbacks.cc +++ b/libs/surfaces/maschine2/callbacks.cc @@ -109,15 +109,15 @@ void Maschine2::notify_record_state_changed () { switch (_session->record_status ()) { - case Session::Disabled: + case (RecordState)Disabled: _ctrl->button (M2Contols::Rec)->set_color (0); _ctrl->button (M2Contols::Rec)->set_blinking (false); break; - case Session::Enabled: + case (RecordState)Enabled: _ctrl->button (M2Contols::Rec)->set_color (COLOR_WHITE); _ctrl->button (M2Contols::Rec)->set_blinking (true); break; - case Session::Recording: + case (RecordState)Recording: _ctrl->button (M2Contols::Rec)->set_color (COLOR_WHITE); _ctrl->button (M2Contols::Rec)->set_blinking (false); break; diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index af83632644..e8b536fab5 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -888,15 +888,15 @@ Push2::notify_record_state_changed () } switch (_session->record_status ()) { - case Session::Disabled: + case (RecordState)Disabled: b->second->set_color (LED::White); b->second->set_state (LED::NoTransition); break; - case Session::Enabled: + case (RecordState)Enabled: b->second->set_color (LED::Red); b->second->set_state (LED::Blinking4th); break; - case Session::Recording: + case (RecordState)Recording: b->second->set_color (LED::Red); b->second->set_state (LED::OneShot24th); break; diff --git a/libs/surfaces/us2400/us2400_control_protocol.cc b/libs/surfaces/us2400/us2400_control_protocol.cc index 6dc976a885..07ddd28abe 100644 --- a/libs/surfaces/us2400/us2400_control_protocol.cc +++ b/libs/surfaces/us2400/us2400_control_protocol.cc @@ -1110,15 +1110,15 @@ US2400Protocol::notify_record_state_changed () LedState ls; switch (_session->record_status()) { - case Session::Disabled: + case (RecordState)Disabled: DEBUG_TRACE (DEBUG::US2400, "record state changed to disabled, LED off\n"); ls = off; break; - case Session::Recording: + case (RecordState)Recording: DEBUG_TRACE (DEBUG::US2400, "record state changed to recording, LED on\n"); ls = on; break; - case Session::Enabled: + case (RecordState)Enabled: DEBUG_TRACE (DEBUG::US2400, "record state changed to enabled, LED flashing\n"); ls = flashing; break;