diff options
author | David Robillard <d@drobilla.net> | 2013-01-12 23:38:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-12 23:38:03 +0000 |
commit | 1dad5b5aaa139993fe19e266d08dfc55844e6804 (patch) | |
tree | fd2bed5971853b429f1b74369a778a4d608e6925 /src/gui/NodePropertiesWindow.cpp | |
parent | 8f048287d06afd7d3c2e90f4a503d7666a9cb6fa (diff) | |
download | machina-1dad5b5aaa139993fe19e266d08dfc55844e6804.tar.gz machina-1dad5b5aaa139993fe19e266d08dfc55844e6804.tar.bz2 machina-1dad5b5aaa139993fe19e266d08dfc55844e6804.zip |
Remove Raul::SharedPtr and switch to std::shared_ptr.
Use project local short type aliases for shared_ptr and friends.
Move Raul::Disposable and Raul::Manageable into Raul::Maid.
Use sets to store machina nodes and edges to avoid O(n) searches.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4939 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodePropertiesWindow.cpp')
-rw-r--r-- | src/gui/NodePropertiesWindow.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp index 9a76420..a58d649 100644 --- a/src/gui/NodePropertiesWindow.cpp +++ b/src/gui/NodePropertiesWindow.cpp @@ -20,7 +20,9 @@ #include "WidgetFactory.hpp" using namespace std; -using namespace Machina; + +namespace Machina { +namespace GUI { NodePropertiesWindow* NodePropertiesWindow::_instance = NULL; @@ -57,9 +59,9 @@ NodePropertiesWindow::apply_clicked() _node->set_enter_action(ActionFactory::note_on(note)); _node->set_exit_action(ActionFactory::note_off(note)); } else { - SharedPtr<MidiAction> action = PtrCast<MidiAction>(_node->enter_action()); + SPtr<MidiAction> action = dynamic_ptr_cast<MidiAction>(_node->enter_action()); action->event()[1] = note; - action = PtrCast<MidiAction>(_node->exit_action()); + action = dynamic_ptr_cast<MidiAction>(_node->exit_action()); action->event()[1] = note; } @@ -86,11 +88,11 @@ NodePropertiesWindow::ok_clicked() } void -NodePropertiesWindow::set_node(SharedPtr<Machina::Client::ClientObject> node) +NodePropertiesWindow::set_node(SPtr<Machina::Client::ClientObject> node) { _node = node; #if 0 - SharedPtr<MidiAction> enter_action = PtrCast<MidiAction>(node->enter_action()); + SPtr<MidiAction> enter_action = dynamic_ptr_cast<MidiAction>(node->enter_action()); if (enter_action && ( enter_action->event_size() > 1) && ( (enter_action->event()[0] & 0xF0) == 0x90) ) { _note_spinbutton->set_value(enter_action->event()[1]); @@ -106,8 +108,8 @@ NodePropertiesWindow::set_node(SharedPtr<Machina::Client::ClientObject> node) } void -NodePropertiesWindow::present(Gtk::Window* parent, - SharedPtr<Machina::Client::ClientObject> node) +NodePropertiesWindow::present(Gtk::Window* parent, + SPtr<Machina::Client::ClientObject> node) { if (!_instance) { Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create(); @@ -122,3 +124,6 @@ NodePropertiesWindow::present(Gtk::Window* parent, _instance->set_node(node); _instance->show(); } + +} // namespace Machina +} // namespace GUI |