summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/AlsaDriver.cpp6
-rw-r--r--src/JackDriver.cpp5
-rw-r--r--src/PatchageModule.cpp10
3 files changed, 6 insertions, 15 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp
index f744b5f..56bef22 100644
--- a/src/AlsaDriver.cpp
+++ b/src/AlsaDriver.cpp
@@ -218,10 +218,8 @@ AlsaDriver::create_port(boost::shared_ptr<PatchageModule> parent,
new PatchagePort(parent, ALSA_MIDI, name, is_input,
_app->state_manager()->get_port_color(ALSA_MIDI)));
- boost::shared_ptr<PatchageCanvas> canvas
- = boost::dynamic_pointer_cast<PatchageCanvas>(parent->canvas().lock());
- if (canvas)
- canvas->index_port(PortID(addr, is_input), ret);
+ dynamic_cast<PatchageCanvas*>(parent->canvas())->index_port(
+ PortID(addr, is_input), ret);
ret->alsa_addr(addr);
return ret;
diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp
index 420d3fa..5b2d180 100644
--- a/src/JackDriver.cpp
+++ b/src/JackDriver.cpp
@@ -214,10 +214,7 @@ JackDriver::create_port(boost::shared_ptr<PatchageModule> parent, jack_port_t* p
_app->state_manager()->get_port_color(port_type)));
if (id.type != PortID::NULL_PORT_ID) {
- boost::shared_ptr<PatchageCanvas> canvas
- = boost::dynamic_pointer_cast<PatchageCanvas>(parent->canvas().lock());
- if (canvas)
- canvas->index_port(id, ret);
+ dynamic_cast<PatchageCanvas*>(parent->canvas())->index_port(id, ret);
}
return ret;
diff --git a/src/PatchageModule.cpp b/src/PatchageModule.cpp
index f88dd7c..813a45d 100644
--- a/src/PatchageModule.cpp
+++ b/src/PatchageModule.cpp
@@ -22,7 +22,7 @@
PatchageModule::PatchageModule(
Patchage* app, const std::string& name, ModuleType type, double x, double y)
- : Module(app->canvas(), name, x, y)
+ : Module(*app->canvas().get(), name, x, y)
, _app(app)
, _type(type)
{
@@ -79,17 +79,13 @@ PatchageModule::create_menu()
void
PatchageModule::load_location()
{
- boost::shared_ptr<FlowCanvas::Canvas> canvas = _canvas.lock();
- if (!canvas)
- return;
-
Coord loc;
if (_app->state_manager()->get_module_location(_name, _type, loc))
move_to(loc.x, loc.y);
else
- move_to((canvas->width()/2) - 100 + rand() % 400,
- (canvas->height()/2) - 100 + rand() % 400);
+ move_to((_canvas->width()/2) - 100 + rand() % 400,
+ (_canvas->height()/2) - 100 + rand() % 400);
}
void