diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2018-09-20 11:30:28 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2018-09-20 11:30:28 -0400 |
commit | 9cdbeaa07d916da8ee84e2172895b38965740604 (patch) | |
tree | 629481a13f63bde590f13ebbe27cb99961081f34 /libs/ardour/ardour | |
parent | 5ffd2078da6eef5bbfc6ac2233973dd1cd99d44c (diff) |
switch transport masters to use properties and notify via PropertyChanged
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/transport_master.h | 36 | ||||
-rw-r--r-- | libs/ardour/ardour/types_convert.h | 4 |
2 files changed, 27 insertions, 13 deletions
diff --git a/libs/ardour/ardour/transport_master.h b/libs/ardour/ardour/transport_master.h index ecb6f28023..b41d107015 100644 --- a/libs/ardour/ardour/transport_master.h +++ b/libs/ardour/ardour/transport_master.h @@ -28,16 +28,19 @@ #include <ltc.h> +#include "pbd/properties.h" #include "pbd/signals.h" +#include "pbd/stateful.h" #include "temporal/time.h" #include "ardour/libardour_visibility.h" +#include "ardour/region.h" /* for Properties::locked */ #include "ardour/types.h" + #include "midi++/parser.h" #include "midi++/types.h" - /* used for delta_string(): */ #define PLUSMINUS(A) ( ((A)<0) ? "-" : (((A)>0) ? "+" : "\u00B1") ) #define LEADINGZERO(A) ( (A)<10 ? " " : (A)<100 ? " " : (A)<1000 ? " " : "" ) @@ -52,6 +55,13 @@ class MidiPort; class AudioPort; class Port; +namespace Properties { + LIBARDOUR_API extern PBD::PropertyDescriptor<bool> fr2997; + LIBARDOUR_API extern PBD::PropertyDescriptor<bool> collect; + LIBARDOUR_API extern PBD::PropertyDescriptor<bool> connected; + LIBARDOUR_API extern PBD::PropertyDescriptor<bool> sclock_synced; + LIBARDOUR_API extern PBD::PropertyDescriptor<ARDOUR::TransportRequestType> allowed_transport_requests; +}; /** * @class TransportMaster @@ -62,7 +72,7 @@ class Port; * Ardour (GUI, control surfaces, OSC, etc.) * */ -class LIBARDOUR_API TransportMaster { +class LIBARDOUR_API TransportMaster : public PBD::Stateful { public: TransportMaster (SyncSource t, std::string const & name); @@ -218,6 +228,7 @@ class LIBARDOUR_API TransportMaster { XMLNode& get_state(); static const std::string state_node_name; + static void make_property_quarks (); virtual void set_session (Session*); @@ -240,14 +251,15 @@ class LIBARDOUR_API TransportMaster { void set_request_mask (TransportRequestType); protected: SyncSource _type; - std::string _name; + PBD::Property<std::string> _name; Session* _session; - bool _connected; sampleoffset_t _current_delta; - bool _collect; bool _pending_collect; - TransportRequestType _request_mask; /* lists transport requests still accepted when we're in control */ - bool _sclock_synced; + PBD::Property<TransportRequestType> _request_mask; /* lists transport requests still accepted when we're in control */ + PBD::Property<bool> _locked; + PBD::Property<bool> _sclock_synced; + PBD::Property<bool> _collect; + PBD::Property<bool> _connected; /* DLL - chase incoming data */ @@ -265,6 +277,8 @@ class LIBARDOUR_API TransportMaster { bool connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn); PBD::ScopedConnection backend_connection; + + virtual void register_properties (); }; struct LIBARDOUR_API SafeTime { @@ -300,7 +314,7 @@ class LIBARDOUR_API TransportMasterViaMIDI { class LIBARDOUR_API TimecodeTransportMaster : public TransportMaster { public: - TimecodeTransportMaster (std::string const & name, SyncSource type) : TransportMaster (type, name) {} + TimecodeTransportMaster (std::string const & name, SyncSource type); virtual Timecode::TimecodeFormat apparent_timecode_format() const = 0; samplepos_t timecode_offset; @@ -309,9 +323,11 @@ class LIBARDOUR_API TimecodeTransportMaster : public TransportMaster { bool fr2997() const { return _fr2997; } void set_fr2997 (bool); - private: - bool _fr2997; + protected: + void register_properties (); + private: + PBD::Property<bool> _fr2997; }; class LIBARDOUR_API MTC_TransportMaster : public TimecodeTransportMaster, public TransportMasterViaMIDI { diff --git a/libs/ardour/ardour/types_convert.h b/libs/ardour/ardour/types_convert.h index dcdc49fae3..8c3c87a651 100644 --- a/libs/ardour/ardour/types_convert.h +++ b/libs/ardour/ardour/types_convert.h @@ -64,17 +64,15 @@ DEFINE_ENUM_CONVERT(ARDOUR::NoteMode) DEFINE_ENUM_CONVERT(ARDOUR::ChannelMode) DEFINE_ENUM_CONVERT(ARDOUR::MonitorChoice) DEFINE_ENUM_CONVERT(ARDOUR::PluginType) - DEFINE_ENUM_CONVERT(ARDOUR::AlignStyle) DEFINE_ENUM_CONVERT(ARDOUR::AlignChoice) - DEFINE_ENUM_CONVERT(ARDOUR::RegionEquivalence) DEFINE_ENUM_CONVERT(ARDOUR::WaveformScale) DEFINE_ENUM_CONVERT(ARDOUR::WaveformShape) DEFINE_ENUM_CONVERT(ARDOUR::VUMeterStandard) DEFINE_ENUM_CONVERT(ARDOUR::MeterLineUp) - DEFINE_ENUM_CONVERT(ARDOUR::MidiPortFlags) +DEFINE_ENUM_CONVERT(ARDOUR::TransportRequestType) DEFINE_ENUM_CONVERT(MusicalMode::Type) |