aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-12-05 23:45:51 +0000
committerDavid Robillard <d@drobilla.net>2007-12-05 23:45:51 +0000
commita96b70b1c92b7f2622ebeff9d34c92ba089997f1 (patch)
tree732a8c2b225f619394ef5bb3d4a4a27d682409db
parentf673a148c7104b3aaee4b1332a3631ac15f5f769 (diff)
downloadmachina-a96b70b1c92b7f2622ebeff9d34c92ba089997f1.tar.gz
machina-a96b70b1c92b7f2622ebeff9d34c92ba089997f1.tar.bz2
machina-a96b70b1c92b7f2622ebeff9d34c92ba089997f1.zip
Working mutation operators.
git-svn-id: http://svn.drobilla.net/lad/machina@952 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/engine/Loader.cpp2
-rw-r--r--src/engine/Machine.cpp5
-rw-r--r--src/engine/MachineBuilder.cpp8
-rw-r--r--src/engine/MachineMutation.cpp69
-rw-r--r--src/engine/Node.cpp15
-rw-r--r--src/engine/machina/MachineMutation.hpp4
-rw-r--r--src/engine/machina/Node.hpp5
-rw-r--r--src/gui/MachinaCanvas.cpp2
-rw-r--r--src/gui/MachinaCanvas.hpp6
-rw-r--r--src/gui/MachinaGUI.cpp77
-rw-r--r--src/gui/MachinaGUI.hpp13
-rw-r--r--src/gui/machina.glade218
12 files changed, 322 insertions, 102 deletions
diff --git a/src/engine/Loader.cpp b/src/engine/Loader.cpp
index 27b95fd..3b60223 100644
--- a/src/engine/Loader.cpp
+++ b/src/engine/Loader.cpp
@@ -171,7 +171,7 @@ Loader::load(const Glib::ustring& uri)
SharedPtr<Edge> edge(new Edge(src, dst));
edge->set_probability(prob);
- src->add_outgoing_edge(edge);
+ src->add_edge(edge);
} else {
cerr << "[Loader] WARNING: Ignored edge between unknown nodes "
diff --git a/src/engine/Machine.cpp b/src/engine/Machine.cpp
index 7a99b58..44e8446 100644
--- a/src/engine/Machine.cpp
+++ b/src/engine/Machine.cpp
@@ -59,6 +59,9 @@ Machine::set_sink(SharedPtr<Raul::MIDISink> sink)
SharedPtr<Node>
Machine::random_node()
{
+ if (_nodes.empty())
+ return SharedPtr<Node>();
+
size_t i = rand() % _nodes.size();
// FIXME: O(n) worst case :(
@@ -79,7 +82,7 @@ Machine::random_edge()
for (size_t i = 0; i < _nodes.size() && tail->edges().empty(); ++i)
tail = random_node();
- return tail->random_edge();
+ return tail ? tail->random_edge() : SharedPtr<Edge>();
}
diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp
index fd53487..7f0da03 100644
--- a/src/engine/MachineBuilder.cpp
+++ b/src/engine/MachineBuilder.cpp
@@ -94,16 +94,16 @@ MachineBuilder::connect_nodes(SharedPtr<Machine> m,
if (is_delay_node(tail) && tail->edges().size() == 0) {
// Tail is a delay node, just accumulate the time difference into it
set_node_duration(tail, tail->duration() + head_start_time - tail_end_time);
- tail->add_outgoing_edge(SharedPtr<Edge>(new Edge(tail, head)));
+ tail->add_edge(SharedPtr<Edge>(new Edge(tail, head)));
} else if (head_start_time == tail_end_time) {
// Connect directly
- tail->add_outgoing_edge(SharedPtr<Edge>(new Edge(tail, head)));
+ tail->add_edge(SharedPtr<Edge>(new Edge(tail, head)));
} else {
// Need to actually create a delay node
delay_node = SharedPtr<Node>(new Node());
set_node_duration(delay_node, head_start_time - tail_end_time);
- tail->add_outgoing_edge(SharedPtr<Edge>(new Edge(tail, delay_node)));
- delay_node->add_outgoing_edge(SharedPtr<Edge>(new Edge(delay_node, head)));
+ tail->add_edge(SharedPtr<Edge>(new Edge(tail, delay_node)));
+ delay_node->add_edge(SharedPtr<Edge>(new Edge(delay_node, head)));
m->add_node(delay_node);
}
diff --git a/src/engine/MachineMutation.cpp b/src/engine/MachineMutation.cpp
index 6e98ee0..3c899bc 100644
--- a/src/engine/MachineMutation.cpp
+++ b/src/engine/MachineMutation.cpp
@@ -20,6 +20,7 @@
#include "machina/Edge.hpp"
#include "machina/Machine.hpp"
#include "machina/MachineMutation.hpp"
+#include "machina/ActionFactory.hpp"
using namespace std;
@@ -28,16 +29,80 @@ namespace Mutation {
void
+Compress::mutate(Machine& machine)
+{
+ // Trim disconnected nodes
+ for (Machine::Nodes::iterator i = machine.nodes().begin(); i != machine.nodes().end() ;) {
+ Machine::Nodes::iterator next = i;
+ ++next;
+
+ if ((*i)->edges().empty())
+ machine.remove_node(*i);
+
+ i = next;
+ }
+}
+
+
+void
+AddNode::mutate(Machine& machine)
+{
+ // Create random node
+ SharedPtr<Node> node(new Node(1.0));
+ uint8_t note = rand() % 128;
+ node->set_enter_action(ActionFactory::note_on(note));
+ node->set_exit_action(ActionFactory::note_off(note));
+ machine.add_node(node);
+
+ // Add as a successor to some other random node
+ SharedPtr<Node> tail = machine.random_node();
+ if (tail && tail != node)
+ tail->add_edge(boost::shared_ptr<Edge>(new Edge(tail, node)));
+}
+
+
+void
+RemoveNode::mutate(Machine& machine)
+{
+ SharedPtr<Node> node = machine.random_node();
+ machine.remove_node(node);
+}
+
+
+void
+AdjustNode::mutate(Machine& machine)
+{
+ SharedPtr<Node> node = machine.random_node();
+ if (node) {
+ SharedPtr<MidiAction> enter_action = PtrCast<MidiAction>(node->enter_action());
+ SharedPtr<MidiAction> exit_action = PtrCast<MidiAction>(node->exit_action());
+ if (enter_action && exit_action) {
+ const uint8_t note = rand() % 128;
+ enter_action->event()[1] = note;
+ exit_action->event()[1] = note;
+ }
+ node->set_changed();
+ }
+}
+
+
+void
AddEdge::mutate(Machine& machine)
{
- cout << "ADD" << endl;
+ SharedPtr<Node> tail = machine.random_node();
+ SharedPtr<Node> head = machine.random_node();
+
+ if (tail && head && tail != head && !tail->connected_to(head))
+ tail->add_edge(boost::shared_ptr<Edge>(new Edge(tail, head)));
}
void
RemoveEdge::mutate(Machine& machine)
{
- cout << "REMOVE" << endl;
+ SharedPtr<Node> tail = machine.random_node();
+ if (tail)
+ tail->remove_edge(tail->random_edge());
}
diff --git a/src/engine/Node.cpp b/src/engine/Node.cpp
index fd784e5..0eca0e6 100644
--- a/src/engine/Node.cpp
+++ b/src/engine/Node.cpp
@@ -119,7 +119,7 @@ Node::exit(SharedPtr<Raul::MIDISink> sink, BeatTime time)
void
-Node::add_outgoing_edge(SharedPtr<Edge> edge)
+Node::add_edge(SharedPtr<Edge> edge)
{
assert(edge->tail().lock().get() == this);
@@ -128,11 +128,22 @@ Node::add_outgoing_edge(SharedPtr<Edge> edge)
void
-Node::remove_outgoing_edge(SharedPtr<Edge> edge)
+Node::remove_edge(SharedPtr<Edge> edge)
{
_edges.erase(_edges.find(edge));
}
+
+bool
+Node::connected_to(SharedPtr<Node> node)
+{
+ for (Edges::const_iterator i = _edges.begin(); i != _edges.end(); ++i)
+ if ((*i)->head() == node)
+ return true;
+
+ return false;
+}
+
void
Node::remove_edges_to(SharedPtr<Node> node)
diff --git a/src/engine/machina/MachineMutation.hpp b/src/engine/machina/MachineMutation.hpp
index 34eda30..0a9731c 100644
--- a/src/engine/machina/MachineMutation.hpp
+++ b/src/engine/machina/MachineMutation.hpp
@@ -26,6 +26,10 @@ namespace Mutation {
struct Mutation { virtual void mutate(Machine& machine) = 0; };
+struct Compress { static void mutate(Machine& machine); };
+struct AddNode { static void mutate(Machine& machine); };
+struct RemoveNode { static void mutate(Machine& machine); };
+struct AdjustNode { static void mutate(Machine& machine); };
struct AddEdge { static void mutate(Machine& machine); };
struct RemoveEdge { static void mutate(Machine& machine); };
struct AdjustEdge { static void mutate(Machine& machine); };
diff --git a/src/engine/machina/Node.hpp b/src/engine/machina/Node.hpp
index a916eb6..5926a50 100644
--- a/src/engine/machina/Node.hpp
+++ b/src/engine/machina/Node.hpp
@@ -56,9 +56,10 @@ public:
void enter(SharedPtr<Raul::MIDISink> driver, BeatTime time);
void exit(SharedPtr<Raul::MIDISink> driver, BeatTime time);
- void add_outgoing_edge(SharedPtr<Edge> edge);
- void remove_outgoing_edge(SharedPtr<Edge> edge);
+ void add_edge(SharedPtr<Edge> edge);
+ void remove_edge(SharedPtr<Edge> edge);
void remove_edges_to(SharedPtr<Node> node);
+ bool connected_to(SharedPtr<Node> node);
void write_state(Redland::Model& model);
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 8ed9e40..fb6ae94 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -117,7 +117,7 @@ MachinaCanvas::connect_node(boost::shared_ptr<NodeView> src,
boost::shared_ptr<NodeView> head)
{
SharedPtr<Machina::Edge> edge(new Machina::Edge(src->node(), head->node()));
- src->node()->add_outgoing_edge(edge);
+ src->node()->add_edge(edge);
boost::shared_ptr<Connection> c(new EdgeView(shared_from_this(),
src, head, edge));
diff --git a/src/gui/MachinaCanvas.hpp b/src/gui/MachinaCanvas.hpp
index 631957e..211ebd7 100644
--- a/src/gui/MachinaCanvas.hpp
+++ b/src/gui/MachinaCanvas.hpp
@@ -15,8 +15,8 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#ifndef PATCHAGEPATCHBAYAREA_H
-#define PATCHAGEPATCHBAYAREA_H
+#ifndef MACHINA_CANVAS_HPP_H
+#define MACHINA_CANVAS_HPP_H
#include <string>
#include <raul/SharedPtr.hpp>
@@ -59,4 +59,4 @@ private:
};
-#endif // PATCHAGEPATCHBAYAREA_H
+#endif // MACHINA_CANVAS_HPP_H
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp
index 6c94211..3749d3a 100644
--- a/src/gui/MachinaGUI.cpp
+++ b/src/gui/MachinaGUI.cpp
@@ -61,8 +61,7 @@ MachinaGUI::MachinaGUI(SharedPtr<Machina::Engine> engine)
xml->get_widget("help_about_menuitem", _menu_help_about);
xml->get_widget("help_help_menuitem", _menu_help_help);
xml->get_widget("canvas_scrolledwindow", _canvas_scrolledwindow);
- xml->get_widget("slave_radiobutton", _slave_radiobutton);
- xml->get_widget("bpm_radiobutton", _bpm_radiobutton);
+ xml->get_widget("clock_checkbutton", _clock_checkbutton);
xml->get_widget("bpm_spinbutton", _bpm_spinbutton);
xml->get_widget("quantize_checkbutton", _quantize_checkbutton);
xml->get_widget("quantize_spinbutton", _quantize_spinbutton);
@@ -72,6 +71,11 @@ MachinaGUI::MachinaGUI(SharedPtr<Machina::Engine> engine)
xml->get_widget("zoom_normal_but", _zoom_normal_button);
xml->get_widget("zoom_full_but", _zoom_full_button);
xml->get_widget("arrange_but", _arrange_button);
+ xml->get_widget("mutate_but", _mutate_button);
+ xml->get_widget("compress_but", _compress_button);
+ xml->get_widget("add_node_but", _add_node_button);
+ xml->get_widget("remove_node_but", _remove_node_button);
+ xml->get_widget("adjust_node_but", _adjust_node_button);
xml->get_widget("add_edge_but", _add_edge_button);
xml->get_widget("remove_edge_but", _remove_edge_button);
xml->get_widget("adjust_edge_but", _adjust_edge_button);
@@ -117,17 +121,23 @@ MachinaGUI::MachinaGUI(SharedPtr<Machina::Engine> engine)
sigc::mem_fun(this, &MachinaGUI::menu_help_about));
_menu_help_help->signal_activate().connect(
sigc::mem_fun(this, &MachinaGUI::menu_help_help));
- _slave_radiobutton->signal_toggled().connect(
- sigc::mem_fun(this, &MachinaGUI::tempo_changed));
- _bpm_radiobutton->signal_toggled().connect(
- sigc::mem_fun(this, &MachinaGUI::tempo_changed));
- _bpm_spinbutton->signal_changed().connect(
+ _clock_checkbutton->signal_toggled().connect(
sigc::mem_fun(this, &MachinaGUI::tempo_changed));
_quantize_checkbutton->signal_toggled().connect(
sigc::mem_fun(this, &MachinaGUI::quantize_changed));
_quantize_spinbutton->signal_changed().connect(
sigc::mem_fun(this, &MachinaGUI::quantize_changed));
+ _mutate_button->signal_clicked().connect(
+ sigc::mem_fun(this, &MachinaGUI::mutate));
+ _compress_button->signal_clicked().connect(
+ sigc::mem_fun(this, &MachinaGUI::compress));
+ _add_node_button->signal_clicked().connect(
+ sigc::mem_fun(this, &MachinaGUI::add_node));
+ _remove_node_button->signal_clicked().connect(
+ sigc::mem_fun(this, &MachinaGUI::remove_node));
+ _adjust_node_button->signal_clicked().connect(
+ sigc::mem_fun(this, &MachinaGUI::adjust_node));
_add_edge_button->signal_clicked().connect(
sigc::mem_fun(this, &MachinaGUI::add_edge));
_remove_edge_button->signal_clicked().connect(
@@ -141,7 +151,7 @@ MachinaGUI::MachinaGUI(SharedPtr<Machina::Engine> engine)
_main_window->present();
- _bpm_radiobutton->set_active(true);
+ _clock_checkbutton->set_active(true);
_quantize_checkbutton->set_active(false);
update_toolbar();
@@ -211,11 +221,59 @@ MachinaGUI::arrange()
_canvas->arrange(_menu_view_time_edges->get_active());
}
+
+void
+MachinaGUI::mutate()
+{
+ switch (rand() % 7) {
+ case 0: compress(); break;
+ case 1: add_node(); break;
+ case 2: remove_node(); break;
+ case 3: adjust_node(); break;
+ case 4: add_edge(); break;
+ case 5: remove_edge(); break;
+ case 6: adjust_edge(); default: break;
+ }
+}
+
+
+void
+MachinaGUI::compress()
+{
+ Mutation::Compress::mutate(*_engine->machine().get());
+ _canvas->build(_engine->machine());
+}
+
+
+void
+MachinaGUI::add_node()
+{
+ Mutation::AddNode::mutate(*_engine->machine().get());
+ _canvas->build(_engine->machine());
+}
+
+
+void
+MachinaGUI::remove_node()
+{
+ Mutation::RemoveNode::mutate(*_engine->machine().get());
+ _canvas->build(_engine->machine());
+}
+
+
+void
+MachinaGUI::adjust_node()
+{
+ Mutation::AdjustNode::mutate(*_engine->machine().get());
+ idle_callback(); // update nodes
+}
+
void
MachinaGUI::add_edge()
{
Mutation::AddEdge::mutate(*_engine->machine().get());
+ _canvas->build(_engine->machine());
}
@@ -223,6 +281,7 @@ void
MachinaGUI::remove_edge()
{
Mutation::RemoveEdge::mutate(*_engine->machine().get());
+ _canvas->build(_engine->machine());
}
@@ -239,7 +298,7 @@ MachinaGUI::update_toolbar()
{
_record_button->set_active(_engine->driver()->recording());
_play_button->set_active(_engine->machine()->is_activated());
- _bpm_spinbutton->set_sensitive(_bpm_radiobutton->get_active());
+ _bpm_spinbutton->set_sensitive(_clock_checkbutton->get_active());
_quantize_spinbutton->set_sensitive(_quantize_checkbutton->get_active());
}
diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp
index cc1eee3..c82cd01 100644
--- a/src/gui/MachinaGUI.hpp
+++ b/src/gui/MachinaGUI.hpp
@@ -63,6 +63,11 @@ protected:
void menu_help_about();
void menu_help_help();
void arrange();
+ void mutate();
+ void compress();
+ void add_node();
+ void remove_node();
+ void adjust_node();
void add_edge();
void remove_edge();
void adjust_edge();
@@ -108,8 +113,7 @@ protected:
Gtk::ScrolledWindow* _canvas_scrolledwindow;
Gtk::TextView* _status_text;
Gtk::Expander* _messages_expander;
- Gtk::RadioButton* _slave_radiobutton;
- Gtk::RadioButton* _bpm_radiobutton;
+ Gtk::CheckButton* _clock_checkbutton;
Gtk::SpinButton* _bpm_spinbutton;
Gtk::CheckButton* _quantize_checkbutton;
Gtk::SpinButton* _quantize_spinbutton;
@@ -119,6 +123,11 @@ protected:
Gtk::ToolButton* _zoom_normal_button;
Gtk::ToolButton* _zoom_full_button;
Gtk::ToolButton* _arrange_button;
+ Gtk::ToolButton* _mutate_button;
+ Gtk::ToolButton* _compress_button;
+ Gtk::ToolButton* _add_node_button;
+ Gtk::ToolButton* _remove_node_button;
+ Gtk::ToolButton* _adjust_node_button;
Gtk::ToolButton* _add_edge_button;
Gtk::ToolButton* _remove_edge_button;
Gtk::ToolButton* _adjust_edge_button;
diff --git a/src/gui/machina.glade b/src/gui/machina.glade
index 11f3e7c..2153908 100644
--- a/src/gui/machina.glade
+++ b/src/gui/machina.glade
@@ -213,7 +213,7 @@
<child>
<widget class="GtkToolbar" id="toolbar">
<property name="visible">True</property>
- <property name="toolbar_style">GTK_TOOLBAR_BOTH_HORIZ</property>
+ <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
<property name="show_arrow">False</property>
<child>
<widget class="GtkToggleToolButton" id="record_but">
@@ -259,71 +259,40 @@
<widget class="GtkToolItem" id="toolitem1">
<property name="visible">True</property>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
- <property name="border_width">4</property>
- <property name="spacing">6</property>
<child>
- <widget class="GtkRadioButton" id="slave_radiobutton">
+ <widget class="GtkCheckButton" id="clock_checkbutton">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Slave to JACK transport</property>
- <property name="label" translatable="yes">Slave</property>
- <property name="use_underline">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Internal clock</property>
<property name="response_id">0</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="bpm_spinbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Set internal tempo</property>
+ <property name="adjustment">120 1 640 1 10 10</property>
+ <property name="climb_rate">1</property>
+ </widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox3">
+ <widget class="GtkLabel" id="label8">
<property name="visible">True</property>
- <child>
- <widget class="GtkRadioButton" id="bpm_radiobutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Use internal tempo</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">slave_radiobutton</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="bpm_spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Set internal tempo</property>
- <property name="adjustment">120 1 640 1 10 10</property>
- <property name="climb_rate">1</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> BPM</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="label" translatable="yes"> BPM</property>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
@@ -354,8 +323,8 @@
<widget class="GtkCheckButton" id="quantize_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Quantize recording</property>
- <property name="label" translatable="yes">Quantize: 1/</property>
+ <property name="tooltip" translatable="yes">Quantize recording (beats)</property>
+ <property name="label" translatable="yes">1/</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
@@ -430,16 +399,115 @@
<widget class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
<property name="show_arrow">False</property>
<property name="icon_size">GTK_ICON_SIZE_SMALL_TOOLBAR</property>
<property name="icon_size_set">True</property>
<child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="mutate_but">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Random mutation</property>
+ <property name="stock_id">gtk-dialog-warning</property>
+ <accelerator key="m" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="compress_but">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Compress (merge identical nodes)</property>
+ <property name="stock_id">gtk-convert</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="add_node_but">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Create node</property>
+ <property name="label" translatable="yes">Add Node</property>
+ <property name="stock_id">gtk-new</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="remove_node_but">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Delete node</property>
+ <property name="label" translatable="yes">Delete Node</property>
+ <property name="stock_id">gtk-delete</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="adjust_node_but">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Adjust node</property>
+ <property name="label" translatable="yes">Adjust Node</property>
+ <property name="stock_id">gtk-edit</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkToolButton" id="add_edge_but">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip" translatable="yes">Add random edge</property>
+ <property name="tooltip" translatable="yes">Add edge</property>
<property name="label" translatable="yes">Add Edge</property>
- <property name="stock_id">gtk-add</property>
+ <property name="stock_id">gtk-connect</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -449,9 +517,9 @@
<widget class="GtkToolButton" id="remove_edge_but">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip" translatable="yes">Remove random edge</property>
+ <property name="tooltip" translatable="yes">Remove edge</property>
<property name="label" translatable="yes">Remove Edge</property>
- <property name="stock_id">gtk-remove</property>
+ <property name="stock_id">gtk-disconnect</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -461,9 +529,9 @@
<widget class="GtkToolButton" id="adjust_edge_but">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip" translatable="yes">Adjust random edge probability</property>
- <property name="label" translatable="yes">Mutate Edge Probabililty</property>
- <property name="stock_id">gtk-edit</property>
+ <property name="tooltip" translatable="yes">Adjust edge</property>
+ <property name="label" translatable="yes">Adjust Edge</property>
+ <property name="stock_id">gtk-select-color</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -614,58 +682,58 @@ Selector nodes are shown in green.
<property name="column_spacing">4</property>
<property name="row_spacing">8</property>
<child>
- <widget class="GtkSpinButton" id="node_properties_duration_spinbutton">
+ <widget class="GtkSpinButton" id="node_properties_note_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="adjustment">1 0 999999 1 10 10</property>
+ <property name="adjustment">60 0 127 1 10 10</property>
<property name="climb_rate">1</property>
- <property name="digits">2</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label7">
+ <widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Duration: </property>
+ <property name="label" translatable="yes">Note: </property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label6">
+ <widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Note: </property>
+ <property name="label" translatable="yes">Duration: </property>
</widget>
<packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkSpinButton" id="node_properties_note_spinbutton">
+ <widget class="GtkSpinButton" id="node_properties_duration_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">60 0 127 1 10 10</property>
+ <property name="has_focus">True</property>
+ <property name="adjustment">1 0 999999 1 10 10</property>
<property name="climb_rate">1</property>
+ <property name="digits">2</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>