1818#include " theatre/fixture.h"
1919#include " theatre/fixturecontrol.h"
2020#include " theatre/fixturegroup.h"
21+ #include " theatre/fixturetype.h"
2122#include " theatre/management.h"
2223#include " theatre/managementtools.h"
2324#include " theatre/theatre.h"
@@ -160,8 +161,8 @@ void VisualizationWidget::updateMidiColors() {
160161 size_t pad = 0 ;
161162 for (const system::TrackablePtr<theatre::Fixture> &fixture : fixtures) {
162163 if (fixture->IsVisible ()) {
163- const glight::theatre::FixtureType &type = fixture->Type ();
164- const size_t shape_count = type .ShapeCount ();
164+ const glight::theatre::FixtureMode &mode = fixture->Mode ();
165+ const size_t shape_count = mode. Type () .ShapeCount ();
165166 for (size_t shape_index = 0 ; shape_index != shape_count;
166167 ++shape_index) {
167168 const theatre::Color color =
@@ -617,8 +618,7 @@ void VisualizationWidget::onDistributeEvenly() {
617618}
618619
619620void VisualizationWidget::onAddFixtures () {
620- sub_window_ = std::make_unique<windows::AddFixtureWindow>(_eventTransmitter,
621- *_management);
621+ sub_window_ = std::make_unique<windows::AddFixtureWindow>();
622622 sub_window_->set_transient_for (*main_window_);
623623 sub_window_->set_modal (true );
624624 sub_window_->show ();
@@ -743,7 +743,7 @@ void VisualizationWidget::SetTilt(const theatre::Coordinate2D &position) {
743743 bool is_changed = false ;
744744 for (const system::ObservingPtr<theatre::Fixture> &fixture :
745745 _selectedFixtures) {
746- if (fixture->Type ().CanBeamTilt ()) {
746+ if (fixture->Mode (). Type ().CanBeamTilt ()) {
747747 constexpr theatre::Coordinate2D offset (0.5 , 0.5 );
748748 const theatre::Coordinate2D direction =
749749 position - fixture->GetXY () - offset;
@@ -752,8 +752,8 @@ void VisualizationWidget::SetTilt(const theatre::Coordinate2D &position) {
752752 direction.Y () * direction.Y ());
753753 double tilt = std::atan (z / dist) - fixture->StaticTilt ();
754754 if (fixture->IsUpsideDown ()) tilt = -tilt;
755- const double begin_tilt = fixture->Type ().MinTilt ();
756- const double end_tilt = fixture->Type ().MaxTilt ();
755+ const double begin_tilt = fixture->Mode (). Type ().MinTilt ();
756+ const double end_tilt = fixture->Mode (). Type ().MaxTilt ();
757757 const double min_value = std::min (begin_tilt, end_tilt);
758758 const double max_value = std::max (begin_tilt, end_tilt);
759759 tilt = system::RadialClamp (tilt, min_value, max_value);
@@ -778,15 +778,15 @@ void VisualizationWidget::SetPan(const theatre::Coordinate2D &position) {
778778 bool is_changed = false ;
779779 for (const system::ObservingPtr<theatre::Fixture> &fixture :
780780 _selectedFixtures) {
781- if (fixture->Type ().CanBeamRotate ()) {
781+ if (fixture->Mode (). Type ().CanBeamRotate ()) {
782782 constexpr theatre::Coordinate2D offset (0.5 , 0.5 );
783783 const theatre::Coordinate2D direction =
784784 position - fixture->GetXY () - offset;
785785 const bool is_zero = direction.Y () == 0.0 && direction.X () == 0.0 ;
786786 const double angle =
787787 is_zero ? 0.0 : std::atan2 (direction.Y (), direction.X ());
788- double begin_pan = fixture->Type ().MinPan ();
789- double end_pan = fixture->Type ().MaxPan ();
788+ double begin_pan = fixture->Mode (). Type ().MinPan ();
789+ double end_pan = fixture->Mode (). Type ().MaxPan ();
790790 if (fixture->IsUpsideDown ()) {
791791 std::swap (begin_pan, end_pan);
792792 }
0 commit comments