aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/MachinaCanvas.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-17 03:48:38 +0000
committerDavid Robillard <d@drobilla.net>2008-11-17 03:48:38 +0000
commitcbfd2dafcf8979e177abccf382dadaabdab6a45b (patch)
tree935dbd1117fa89ad280207b6c7722da1a3a5fccf /src/gui/MachinaCanvas.cpp
parente091b5eea5f533fe61c5559a10f1388aeca096e2 (diff)
downloadmachina-cbfd2dafcf8979e177abccf382dadaabdab6a45b.tar.gz
machina-cbfd2dafcf8979e177abccf382dadaabdab6a45b.tar.bz2
machina-cbfd2dafcf8979e177abccf382dadaabdab6a45b.zip
Compile.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@1755 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/MachinaCanvas.cpp')
-rw-r--r--src/gui/MachinaCanvas.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 717960e..222f1a8 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -17,6 +17,7 @@
#include <map>
#include "raul/SharedPtr.hpp"
+#include "raul/TimeStamp.hpp"
#include "machina/Node.hpp"
#include "machina/Machine.hpp"
#include "machina/Action.hpp"
@@ -27,6 +28,7 @@
#include "NodeView.hpp"
#include "EdgeView.hpp"
+using namespace Raul;
using namespace FlowCanvas;
@@ -57,11 +59,12 @@ MachinaCanvas::node_clicked(WeakPtr<NodeView> item, GdkEventButton* event)
SharedPtr<NodeView> last = _last_clicked.lock();
if (last) {
- if (node != last)
+ if (node != last) {
if (get_connection(last, node))
disconnect_node(last, node);
else
connect_node(last, node);
+ }
last->set_default_base_color();
_last_clicked.reset();
@@ -78,7 +81,7 @@ bool
MachinaCanvas::canvas_event(GdkEvent* event)
{
static int last = 0;
-
+
SharedPtr<Machina::Machine> machine = _app->machine();
if (!machine)
return false;
@@ -92,7 +95,8 @@ MachinaCanvas::canvas_event(GdkEvent* event)
string name = string("Note")+(char)(last++ +'0');
- SharedPtr<Machina::Node> node(new Machina::Node(1.0, false));
+ TimeDuration dur(TimeUnit(TimeUnit::BEATS, 0), 1.0);
+ SharedPtr<Machina::Node> node(new Machina::Node(dur, false));
SharedPtr<NodeView> view(new NodeView(_app->window(), shared_from_this(), node,
name, x, y));