30 DEFINE_ARRANGER_OBJECT_OWNER_QML_PROPERTIES (
34 DEFINE_ARRANGER_OBJECT_OWNER_QML_PROPERTIES (
38 Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged)
39 Q_PROPERTY (
double height READ height WRITE setHeight NOTIFY heightChanged)
40 Q_PROPERTY (
bool muted READ muted WRITE setMuted NOTIFY muteChanged)
41 Q_PROPERTY (
bool soloed READ soloed WRITE setSoloed NOTIFY soloChanged)
43 std::uint8_t midiChannel READ midiChannel WRITE setMidiChannel NOTIFY
48 static constexpr double DEFAULT_HEIGHT = 48;
56 static constexpr auto default_format_str = QT_TR_NOOP_UTF8 (
"Lane {}");
62 dsp::TimebaseProvider * timebase_provider_ =
nullptr;
66 Q_DISABLE_COPY_MOVE (TrackLane)
67 ~TrackLane ()
override;
73 QString name ()
const {
return name_.to_qstring (); }
74 void setName (
const QString &name)
76 const auto std_name = utils::Utf8String::from_qstring (name);
77 if (name_ == std_name)
81 Q_EMIT nameChanged (name);
83 Q_SIGNAL
void nameChanged (
const QString &name);
85 double height ()
const {
return height_; }
86 void setHeight (
const double height)
88 if (qFuzzyCompare (height_, height))
92 Q_EMIT heightChanged (height);
94 Q_SIGNAL
void heightChanged (
double height);
96 bool soloed ()
const {
return solo_; }
97 void setSoloed (
bool solo)
103 Q_EMIT soloChanged (solo);
105 Q_SIGNAL
void soloChanged (
bool solo);
107 bool muted ()
const {
return mute_; }
108 void setMuted (
bool mute)
114 Q_EMIT muteChanged (mute);
116 Q_SIGNAL
void muteChanged (
bool mute);
129 if (soloed_lanes_exist_func_ () && !soloed ())
135 std::uint8_t midiChannel ()
const {
return midi_ch_; }
136 void setMidiChannel (std::uint8_t midi_ch)
138 if (midi_ch_ == midi_ch)
142 Q_EMIT midiChannelChanged (midi_ch);
144 Q_SIGNAL
void midiChannelChanged (std::uint8_t midi_ch);
174 static constexpr std::string_view kNameKey =
"name";
175 static constexpr std::string_view kHeightKey =
"height";
176 static constexpr std::string_view kMuteKey =
"mute";
177 static constexpr std::string_view kSoloKey =
"solo";
178 static constexpr std::string_view kMidiChannelKey =
"midiChannel";
179 friend void to_json (nlohmann::json &j,
const TrackLane &lane);
180 friend void from_json (
const nlohmann::json &j, TrackLane &lane);
182 friend void init_from (
184 const TrackLane &other,
190 QPointer<dsp::TimebaseProvider> timebase_provider_;
196 double height_{ DEFAULT_HEIGHT };
209 uint8_t midi_ch_ = 0;
211 BOOST_DESCRIBE_CLASS (
213 (utils::UuidIdentifiableObject<TrackLane>),
216 (name_, height_, mute_, solo_, midi_ch_))