aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/NodePropertiesWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-12-02 04:43:48 +0000
committerDavid Robillard <d@drobilla.net>2007-12-02 04:43:48 +0000
commit0e03c5f94d91086ac1b9f3b42cee4459290e353e (patch)
tree4ae2e6f69c5b127bc2d0ba2920a7e9a2741c0339 /src/gui/NodePropertiesWindow.cpp
parent377f82ab766acf2c52674c11d507aeaee4349f46 (diff)
downloadmachina-0e03c5f94d91086ac1b9f3b42cee4459290e353e.tar.gz
machina-0e03c5f94d91086ac1b9f3b42cee4459290e353e.tar.bz2
machina-0e03c5f94d91086ac1b9f3b42cee4459290e353e.zip
Ability to add notes to non-MIDI-note nodes (ie make noise with mouse only).
Fix note label display. Canvas prettiness ++. git-svn-id: http://svn.drobilla.net/lad/machina@937 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodePropertiesWindow.cpp')
-rw-r--r--src/gui/NodePropertiesWindow.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp
index 6ba3e47..9f2e77a 100644
--- a/src/gui/NodePropertiesWindow.cpp
+++ b/src/gui/NodePropertiesWindow.cpp
@@ -17,6 +17,7 @@
#include <string>
#include "machina/MidiAction.hpp"
+#include "machina/ActionFactory.hpp"
#include "NodePropertiesWindow.hpp"
#include "GladeXml.hpp"
@@ -52,8 +53,20 @@ NodePropertiesWindow::~NodePropertiesWindow()
void
NodePropertiesWindow::apply_clicked()
{
+ const uint8_t note = _note_spinbutton->get_value();
+ if (!_node->enter_action()) {
+ _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());
+ action->event()[1] = note;
+ action = PtrCast<MidiAction>(_node->exit_action());
+ action->event()[1] = note;
+ }
+
double duration = _duration_spinbutton->get_value();
_node->set_duration(duration);
+ _node->set_changed();
}
@@ -83,6 +96,9 @@ NodePropertiesWindow::set_node(SharedPtr<Machina::Node> node)
&& (enter_action->event()[0] & 0xF0) == 0x90) {
_note_spinbutton->set_value(enter_action->event()[1]);
_note_spinbutton->show();
+ } else if (!enter_action) {
+ _note_spinbutton->set_value(60);
+ _note_spinbutton->show();
} else {
_note_spinbutton->hide();
}