diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index c28f71352f..700a7bfec1 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1397,7 +1397,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) ArdourCanvas::Rect bbox; if (obbox) { - bbox = obbox.get (); + bbox = obbox.value (); } last_track_bottom_edge += bbox.height (); @@ -5124,7 +5124,7 @@ FeatureLineDrag::motion (GdkEvent*, bool) boost::optional bbox = _line->bounding_box (); assert (bbox); - _line->set (ArdourCanvas::Duple (cx, 2.0), ArdourCanvas::Duple (cx, bbox.get ().height ())); + _line->set (ArdourCanvas::Duple (cx, 2.0), ArdourCanvas::Duple (cx, bbox.value ().height ())); float* pos = new float; *pos = cx; diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc index 8523e52d0b..ffbb9841ee 100644 --- a/gtk2_ardour/note_base.cc +++ b/gtk2_ardour/note_base.cc @@ -260,16 +260,16 @@ NoteBase::set_mouse_fractions (GdkEvent* ev) /* hmm, something wrong here. w2i should give item-local coordinates but it doesn't. for now, finesse this. */ - ix = ix - bbox.get().x0; - iy = iy - bbox.get().y0; + ix = ix - bbox.value().x0; + iy = iy - bbox.value().y0; /* fraction of width/height */ double xf; double yf; bool notify = false; - xf = ix / bbox.get().width (); - yf = iy / bbox.get().height (); + xf = ix / bbox.value().width (); + yf = iy / bbox.value().height (); if (xf != _mouse_x_fraction || yf != _mouse_y_fraction) { notify = true; diff --git a/gtk2_ardour/visibility_group.cc b/gtk2_ardour/visibility_group.cc index a71f6734ec..37c1d5493b 100644 --- a/gtk2_ardour/visibility_group.cc +++ b/gtk2_ardour/visibility_group.cc @@ -94,7 +94,7 @@ VisibilityGroup::should_actually_be_visible (Member const & m) const if (m.override) { boost::optional o = m.override (); if (o) { - return o.get (); + return o.value (); } } diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index 0e9d914bec..c0e8607b32 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -533,7 +533,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp if (_midi_write_source) { assert (_capture_start_sample); - timepos_t start (_capture_start_sample.get()); + timepos_t start (_capture_start_sample.value()); if (time_domain() != Temporal::AudioTime) { start = timepos_t (start.beats()); diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc index 53ea395ace..d7fb757501 100644 --- a/libs/ardour/transport_fsm.cc +++ b/libs/ardour/transport_fsm.cc @@ -609,7 +609,7 @@ void TransportFSM::start_locate_after_declick () { DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("start_locate_after_declick, have crals ? %1 roll will be %2\n", (bool) current_roll_after_locate_status, - current_roll_after_locate_status ? current_roll_after_locate_status.get() : compute_should_roll (_last_locate.ltd))); + current_roll_after_locate_status.value_or (compute_should_roll (_last_locate.ltd)))); /* we only get here because a locate request arrived while we were rolling. We declicked and that is now finished */ @@ -683,14 +683,8 @@ TransportFSM::schedule_butler_for_transport_work () const bool TransportFSM::should_roll_after_locate () const { - bool roll; - - if (current_roll_after_locate_status) { - roll = current_roll_after_locate_status.get(); - current_roll_after_locate_status = boost::none; // used it - } else { - roll = api->should_roll_after_locate (); - } + bool roll = current_roll_after_locate_status.value_or (api->should_roll_after_locate ()); + current_roll_after_locate_status = boost::none; // used it DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("should_roll_after_locate() ? %1\n", roll)); return roll; diff --git a/libs/canvas/test/arrow.cc b/libs/canvas/test/arrow.cc index ab973bcd2a..2be958c6db 100644 --- a/libs/canvas/test/arrow.cc +++ b/libs/canvas/test/arrow.cc @@ -30,8 +30,8 @@ ArrowTest::bounding_box () boost::optional bbox = arrow.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == -6); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 6); - CPPUNIT_ASSERT (bbox.get().y1 == 128); + CPPUNIT_ASSERT (bbox.value().x0 == -6); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 6); + CPPUNIT_ASSERT (bbox.value().y1 == 128); } diff --git a/libs/canvas/test/group.cc b/libs/canvas/test/group.cc index 31b7d13e49..a6d7d8de54 100644 --- a/libs/canvas/test/group.cc +++ b/libs/canvas/test/group.cc @@ -27,20 +27,20 @@ GroupTest::bounding_box () /* check the bounding box */ CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 64); - CPPUNIT_ASSERT (bbox.get().y1 == 64); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 64); + CPPUNIT_ASSERT (bbox.value().y1 == 64); /* check that adding an item resets the bbox */ Rectangle e (canvas.root(), Rect (64, 64, 128, 128)); bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 128.25); - CPPUNIT_ASSERT (bbox.get().y1 == 128.25); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 128.25); + CPPUNIT_ASSERT (bbox.value().y1 == 128.25); } /* Check that a group containing only items with no bounding box itself has no bounding box */ @@ -118,28 +118,28 @@ GroupTest::children_changing () /* Check that initial bbox */ boost::optional bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 32); - CPPUNIT_ASSERT (bbox.get().y1 == 32); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 32); + CPPUNIT_ASSERT (bbox.value().y1 == 32); /* Change the rectangle's size and check the parent */ a.set (Rect (0, 0, 48, 48)); bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 48); - CPPUNIT_ASSERT (bbox.get().y1 == 48); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 48); + CPPUNIT_ASSERT (bbox.value().y1 == 48); /* Change the rectangle's line width and check the parent */ a.set_outline_width (1); bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == -0.5); - CPPUNIT_ASSERT (bbox.get().y0 == -0.5); - CPPUNIT_ASSERT (bbox.get().x1 == 48.5); - CPPUNIT_ASSERT (bbox.get().y1 == 48.5); + CPPUNIT_ASSERT (bbox.value().x0 == -0.5); + CPPUNIT_ASSERT (bbox.value().y0 == -0.5); + CPPUNIT_ASSERT (bbox.value().x1 == 48.5); + CPPUNIT_ASSERT (bbox.value().y1 == 48.5); } /* Check that a group notices when its grandchildren change */ @@ -158,34 +158,34 @@ GroupTest::grandchildren_changing () /* Check the initial bboxes */ boost::optional bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 32); - CPPUNIT_ASSERT (bbox.get().y1 == 32); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 32); + CPPUNIT_ASSERT (bbox.value().y1 == 32); bbox = B.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 32); - CPPUNIT_ASSERT (bbox.get().y1 == 32); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 32); + CPPUNIT_ASSERT (bbox.value().y1 == 32); /* Change the grandchild and check its parent and grandparent */ a.set (Rect (0, 0, 48, 48)); bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 48); - CPPUNIT_ASSERT (bbox.get().y1 == 48); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 48); + CPPUNIT_ASSERT (bbox.value().y1 == 48); bbox = B.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == 0); - CPPUNIT_ASSERT (bbox.get().y0 == 0); - CPPUNIT_ASSERT (bbox.get().x1 == 48); - CPPUNIT_ASSERT (bbox.get().y1 == 48); + CPPUNIT_ASSERT (bbox.value().x0 == 0); + CPPUNIT_ASSERT (bbox.value().y0 == 0); + CPPUNIT_ASSERT (bbox.value().x1 == 48); + CPPUNIT_ASSERT (bbox.value().y1 == 48); } /* Basic tests on the code to find items at a particular point */ @@ -271,14 +271,14 @@ GroupTest::torture_add_items_at_point () /* work it out ourselves */ vector items_B; - if (canvas.root()->bounding_box() && canvas.root()->bounding_box().get().contains (test)) { + if (canvas.root()->bounding_box() && canvas.root()->bounding_box().value().contains (test)) { items_B.push_back (canvas.root()); } for (list::iterator j = rectangles.begin(); j != rectangles.end(); ++j) { boost::optional bbox = (*j)->bounding_box (); assert (bbox); - if (bbox.get().contains (test)) { + if (bbox.value().contains (test)) { items_B.push_back (*j); } } diff --git a/libs/canvas/test/polygon.cc b/libs/canvas/test/polygon.cc index 353246ffe0..d117bb9223 100644 --- a/libs/canvas/test/polygon.cc +++ b/libs/canvas/test/polygon.cc @@ -31,10 +31,10 @@ PolygonTest::bounding_box () */ boost::optional bbox = polygon.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == -6.25); - CPPUNIT_ASSERT (bbox.get().x1 == 6.25); - CPPUNIT_ASSERT (bbox.get().y0 == -6.25); - CPPUNIT_ASSERT (bbox.get().y1 == 6.25); + CPPUNIT_ASSERT (bbox.value().x0 == -6.25); + CPPUNIT_ASSERT (bbox.value().x1 == 6.25); + CPPUNIT_ASSERT (bbox.value().y0 == -6.25); + CPPUNIT_ASSERT (bbox.value().y1 == 6.25); /* and its parent group should have noticed and adjusted its bounding box @@ -42,8 +42,8 @@ PolygonTest::bounding_box () bbox = group.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); - CPPUNIT_ASSERT (bbox.get().x0 == -6.25); - CPPUNIT_ASSERT (bbox.get().x1 == 6.25); - CPPUNIT_ASSERT (bbox.get().y0 == -6.25); - CPPUNIT_ASSERT (bbox.get().y1 == 6.25); + CPPUNIT_ASSERT (bbox.value().x0 == -6.25); + CPPUNIT_ASSERT (bbox.value().x1 == 6.25); + CPPUNIT_ASSERT (bbox.value().y0 == -6.25); + CPPUNIT_ASSERT (bbox.value().y1 == 6.25); }