29 DEFINE_ARRANGER_OBJECT_OWNER_QML_PROPERTIES (
33 DEFINE_ARRANGER_OBJECT_OWNER_QML_PROPERTIES (
37 Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged)
38 Q_PROPERTY (
double height READ height WRITE setHeight NOTIFY heightChanged)
39 Q_PROPERTY (
bool muted READ muted WRITE setMuted NOTIFY muteChanged)
40 Q_PROPERTY (
bool soloed READ soloed WRITE setSoloed NOTIFY soloChanged)
42 std::uint8_t midiChannel READ midiChannel WRITE setMidiChannel NOTIFY
47 static constexpr double DEFAULT_HEIGHT = 48;
55 static constexpr auto default_format_str = QT_TR_NOOP_UTF8 (
"Lane {}");
64 :
utils::UuidIdentifiableObject<TrackLane> (parent),
65 arrangement::ArrangerObjectOwner<
66 arrangement::MidiRegion> (dependencies.registry_, *this),
67 arrangement::ArrangerObjectOwner<
68 arrangement::AudioRegion> (dependencies.registry_, *this),
69 soloed_lanes_exist_func_ (
70 std::move (dependencies.soloed_lanes_exist_func_))
80 QString name ()
const {
return name_.to_qstring (); }
81 void setName (
const QString &name)
83 const auto std_name = utils::Utf8String::from_qstring (name);
84 if (name_ == std_name)
88 Q_EMIT nameChanged (name);
90 Q_SIGNAL
void nameChanged (
const QString &name);
92 double height ()
const {
return height_; }
93 void setHeight (
const double height)
95 if (qFuzzyCompare (height_, height))
99 Q_EMIT heightChanged (height);
101 Q_SIGNAL
void heightChanged (
double height);
103 bool soloed ()
const {
return solo_; }
104 void setSoloed (
bool solo)
110 Q_EMIT soloChanged (solo);
112 Q_SIGNAL
void soloChanged (
bool solo);
114 bool muted ()
const {
return mute_; }
115 void setMuted (
bool mute)
121 Q_EMIT muteChanged (mute);
123 Q_SIGNAL
void muteChanged (
bool mute);
136 if (soloed_lanes_exist_func_ () && !soloed ())
142 std::uint8_t midiChannel ()
const {
return midi_ch_; }
143 void setMidiChannel (std::uint8_t midi_ch)
145 if (midi_ch_ == midi_ch)
149 Q_EMIT midiChannelChanged (midi_ch);
151 Q_SIGNAL
void midiChannelChanged (std::uint8_t midi_ch);
172 return "midiRegions";
177 return "audioRegions";
181 static constexpr std::string_view kNameKey =
"name";
182 static constexpr std::string_view kHeightKey =
"height";
183 static constexpr std::string_view kMuteKey =
"mute";
184 static constexpr std::string_view kSoloKey =
"solo";
185 static constexpr std::string_view kMidiChannelKey =
"midiChannel";
186 friend void to_json (nlohmann::json &j,
const TrackLane &lane);
187 friend void from_json (
const nlohmann::json &j, TrackLane &lane);
189 friend void init_from (
191 const TrackLane &other,
201 double height_{ DEFAULT_HEIGHT };
214 uint8_t midi_ch_ = 0;
216 BOOST_DESCRIBE_CLASS (
218 (utils::UuidIdentifiableObject<TrackLane>),
221 (name_, height_, mute_, solo_, midi_ch_))