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 {}");
60 structure::arrangement::ArrangerObjectRegistry &obj_registry_;
61 dsp::FileAudioSourceRegistry &file_audio_source_registry_;
67 arrangement::ArrangerObjectOwner<arrangement::MidiRegion> (
68 dependencies.obj_registry_,
69 dependencies.file_audio_source_registry_,
71 arrangement::ArrangerObjectOwner<arrangement::AudioRegion> (
72 dependencies.obj_registry_,
73 dependencies.file_audio_source_registry_,
75 soloed_lanes_exist_func_ (
76 std::move (dependencies.soloed_lanes_exist_func_))
86 QString name ()
const {
return name_.to_qstring (); }
87 void setName (
const QString &name)
89 const auto std_name = utils::Utf8String::from_qstring (name);
90 if (name_ == std_name)
94 Q_EMIT nameChanged (name);
96 Q_SIGNAL
void nameChanged (
const QString &name);
98 double height ()
const {
return height_; }
99 void setHeight (
const double height)
105 Q_EMIT heightChanged (height);
107 Q_SIGNAL
void heightChanged (
double height);
109 bool soloed ()
const {
return solo_; }
110 void setSoloed (
bool solo)
116 Q_EMIT soloChanged (solo);
118 Q_SIGNAL
void soloChanged (
bool solo);
120 bool muted ()
const {
return mute_; }
121 void setMuted (
bool mute)
127 Q_EMIT muteChanged (mute);
129 Q_SIGNAL
void muteChanged (
bool mute);
142 if (soloed_lanes_exist_func_ () && !soloed ())
148 std::uint8_t midiChannel ()
const {
return midi_ch_; }
149 void setMidiChannel (std::uint8_t midi_ch)
151 if (midi_ch_ == midi_ch)
155 Q_EMIT midiChannelChanged (midi_ch);
157 Q_SIGNAL
void midiChannelChanged (std::uint8_t midi_ch);
178 return "midiRegions";
183 return "audioRegions";
187 static constexpr std::string_view kNameKey =
"name";
188 static constexpr std::string_view kHeightKey =
"height";
189 static constexpr std::string_view kMuteKey =
"mute";
190 static constexpr std::string_view kSoloKey =
"solo";
191 static constexpr std::string_view kMidiChannelKey =
"midiChannel";
192 friend void to_json (nlohmann::json &j,
const TrackLane &lane);
193 friend void from_json (
const nlohmann::json &j, TrackLane &lane);
195 friend void init_from (
197 const TrackLane &other,
207 double height_{ DEFAULT_HEIGHT };
220 uint8_t midi_ch_ = 0;
222 BOOST_DESCRIBE_CLASS (
224 (utils::UuidIdentifiableObject<TrackLane>),
227 (name_, height_, mute_, solo_, midi_ch_))