diff options
author | David Robillard <d@drobilla.net> | 2013-01-14 09:10:26 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-14 09:10:26 +0000 |
commit | e9bb96bf484a9b415ba690131300134570099567 (patch) | |
tree | d6575e578127c006d4a514b62a2e21c95e4689ce /src/gui/NodePropertiesWindow.cpp | |
parent | 363eff1806154d5dae2a8374ef80e8319ab53e91 (diff) | |
download | machina-e9bb96bf484a9b415ba690131300134570099567.tar.gz machina-e9bb96bf484a9b415ba690131300134570099567.tar.bz2 machina-e9bb96bf484a9b415ba690131300134570099567.zip |
Make duration spinner in properties dialog functional.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4986 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodePropertiesWindow.cpp')
-rw-r--r-- | src/gui/NodePropertiesWindow.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp index c05b257..6a5f0fc 100644 --- a/src/gui/NodePropertiesWindow.cpp +++ b/src/gui/NodePropertiesWindow.cpp @@ -15,6 +15,12 @@ */ #include <string> + +#include "client/ClientObject.hpp" +#include "machina/URIs.hpp" +#include "raul/TimeStamp.hpp" + +#include "MachinaGUI.hpp" #include "NodePropertiesWindow.hpp" #include "WidgetFactory.hpp" @@ -29,6 +35,7 @@ NodePropertiesWindow::NodePropertiesWindow( BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Gtk::Dialog(cobject) + , _gui(NULL) { property_visible() = false; @@ -63,12 +70,9 @@ NodePropertiesWindow::apply_clicked() action = dynamic_ptr_cast<MidiAction>(_node->exit_action()); action->event()[1] = note; } - - const double duration_dbl = _duration_spinbutton->get_value(); - TimeStamp duration(TimeUnit(TimeUnit::BEATS, 19200), duration_dbl); - _node->set_duration(duration); - _node->set_changed(); #endif + _node->set(URIs::instance().machina_duration, + _gui->forge().make(float(_duration_spinbutton->get_value()))); } void @@ -87,8 +91,10 @@ NodePropertiesWindow::ok_clicked() } void -NodePropertiesWindow::set_node(SPtr<machina::client::ClientObject> node) +NodePropertiesWindow::set_node(MachinaGUI* gui, + SPtr<machina::client::ClientObject> node) { + _gui = gui; _node = node; #if 0 SPtr<MidiAction> enter_action = dynamic_ptr_cast<MidiAction>(node->enter_action()); @@ -102,12 +108,14 @@ NodePropertiesWindow::set_node(SPtr<machina::client::ClientObject> node) } else { _note_spinbutton->hide(); } - _duration_spinbutton->set_value(node->duration().to_double()); #endif + _duration_spinbutton->set_value( + node->get(URIs::instance().machina_duration).get_float()); } void -NodePropertiesWindow::present(Gtk::Window* parent, +NodePropertiesWindow::present(MachinaGUI* gui, + Gtk::Window* parent, SPtr<machina::client::ClientObject> node) { if (!_instance) { @@ -120,7 +128,7 @@ NodePropertiesWindow::present(Gtk::Window* parent, } } - _instance->set_node(node); + _instance->set_node(gui, node); _instance->show(); } |