aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-13 20:46:13 +0000
committerDavid Robillard <d@drobilla.net>2013-01-13 20:46:13 +0000
commitac0438352410a5af5d64d2268d3541b47e8a2669 (patch)
tree0fc9f575b80493fda4df0e8121a3b34b51a6cbc7 /src/gui
parentb73a80441f0ddd09654a6d4cc337d11f51d0e1c1 (diff)
downloadmachina-ac0438352410a5af5d64d2268d3541b47e8a2669.tar.gz
machina-ac0438352410a5af5d64d2268d3541b47e8a2669.tar.bz2
machina-ac0438352410a5af5d64d2268d3541b47e8a2669.zip
Fix step recording.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4965 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/MachinaGUI.cpp26
-rw-r--r--src/gui/MachinaGUI.hpp5
-rw-r--r--src/gui/machina.ui49
3 files changed, 45 insertions, 35 deletions
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp
index 1b2b1f5..1d4d272 100644
--- a/src/gui/MachinaGUI.cpp
+++ b/src/gui/MachinaGUI.cpp
@@ -71,13 +71,13 @@ MachinaGUI::MachinaGUI(SPtr<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("step_record_checkbutton", _step_record_checkbutton);
xml->get_widget("bpm_spinbutton", _bpm_spinbutton);
xml->get_widget("quantize_checkbutton", _quantize_checkbutton);
xml->get_widget("quantize_spinbutton", _quantize_spinbutton);
- xml->get_widget("record_but", _record_button);
xml->get_widget("stop_but", _stop_button);
xml->get_widget("play_but", _play_button);
+ xml->get_widget("record_but", _record_button);
+ xml->get_widget("step_record_but", _step_record_button);
xml->get_widget("zoom_normal_but", _zoom_normal_button);
xml->get_widget("zoom_full_but", _zoom_full_button);
xml->get_widget("chain_but", _chain_button);
@@ -101,12 +101,14 @@ MachinaGUI::MachinaGUI(SPtr<machina::Engine> engine)
_canvas_scrolledwindow->property_hadjustment().get_value()->set_step_increment(10);
_canvas_scrolledwindow->property_vadjustment().get_value()->set_step_increment(10);
- _record_button->signal_toggled().connect(
- sigc::mem_fun(this, &MachinaGUI::record_toggled));
_stop_button->signal_toggled().connect(
sigc::mem_fun(this, &MachinaGUI::stop_toggled));
_play_button->signal_toggled().connect(
sigc::mem_fun(this, &MachinaGUI::play_toggled));
+ _record_button->signal_toggled().connect(
+ sigc::mem_fun(this, &MachinaGUI::record_toggled));
+ _step_record_button->signal_toggled().connect(
+ sigc::mem_fun(this, &MachinaGUI::step_record_toggled));
_zoom_normal_button->signal_clicked().connect(sigc::bind(
sigc::mem_fun(this, &MachinaGUI::zoom), 1.0));
@@ -179,7 +181,6 @@ MachinaGUI::MachinaGUI(SPtr<machina::Engine> engine)
_main_window->present();
- _step_record_checkbutton->show();
_quantize_checkbutton->set_active(false);
update_toolbar();
@@ -371,6 +372,7 @@ MachinaGUI::update_toolbar()
{
const Driver::PlayState state = _engine->driver()->play_state();
_record_button->set_active(state == Driver::PlayState::RECORDING);
+ _step_record_button->set_active(state == Driver::PlayState::STEP_RECORDING);
_play_button->set_active(state == Driver::PlayState::PLAYING);
_quantize_spinbutton->set_sensitive(_quantize_checkbutton->get_active());
}
@@ -666,7 +668,8 @@ MachinaGUI::stop_toggled()
if (_stop_button->get_active()) {
const Driver::PlayState old_state = _engine->driver()->play_state();
_engine->driver()->set_play_state(Driver::PlayState::STOPPED);
- if (old_state == Driver::PlayState::RECORDING) {
+ if (old_state == Driver::PlayState::RECORDING ||
+ old_state == Driver::PlayState::STEP_RECORDING) {
rebuild_canvas();
}
}
@@ -678,7 +681,8 @@ MachinaGUI::play_toggled()
if (_play_button->get_active()) {
const Driver::PlayState old_state = _engine->driver()->play_state();
_engine->driver()->set_play_state(Driver::PlayState::PLAYING);
- if (old_state == Driver::PlayState::RECORDING) {
+ if (old_state == Driver::PlayState::RECORDING ||
+ old_state == Driver::PlayState::STEP_RECORDING) {
rebuild_canvas();
}
}
@@ -693,6 +697,14 @@ MachinaGUI::record_toggled()
}
void
+MachinaGUI::step_record_toggled()
+{
+ if (_step_record_button->get_active()) {
+ _engine->driver()->set_play_state(Driver::PlayState::STEP_RECORDING);
+ }
+}
+
+void
MachinaGUI::chain_toggled()
{
if (_chain_button->get_active()) {
diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp
index 061cc8a..d794fbb 100644
--- a/src/gui/MachinaGUI.hpp
+++ b/src/gui/MachinaGUI.hpp
@@ -109,6 +109,7 @@ protected:
void stop_toggled();
void play_toggled();
void record_toggled();
+ void step_record_toggled();
void chain_toggled();
void fan_toggled();
@@ -152,13 +153,13 @@ protected:
Gtk::ScrolledWindow* _canvas_scrolledwindow;
Gtk::TextView* _status_text;
Gtk::Expander* _messages_expander;
- Gtk::ToggleToolButton* _step_record_checkbutton;
Gtk::SpinButton* _bpm_spinbutton;
Gtk::CheckButton* _quantize_checkbutton;
Gtk::SpinButton* _quantize_spinbutton;
- Gtk::ToggleToolButton* _record_button;
Gtk::ToggleToolButton* _stop_button;
Gtk::ToggleToolButton* _play_button;
+ Gtk::ToggleToolButton* _record_button;
+ Gtk::ToggleToolButton* _step_record_button;
Gtk::ToolButton* _zoom_normal_button;
Gtk::ToolButton* _zoom_full_button;
Gtk::RadioButton* _chain_button;
diff --git a/src/gui/machina.ui b/src/gui/machina.ui
index eeea2f4..cc66256 100644
--- a/src/gui/machina.ui
+++ b/src/gui/machina.ui
@@ -2,13 +2,6 @@
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkAdjustment" id="bpm_adjustment">
- <property name="lower">1</property>
- <property name="upper">480</property>
- <property name="value">120</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
<object class="GtkRadioAction" id="record_action">
<property name="stock_id">gtk-media-record</property>
<property name="draw_as_radio">True</property>
@@ -18,6 +11,12 @@
<property name="draw_as_radio">True</property>
<property name="group">record_action</property>
</object>
+ <object class="GtkRadioAction" id="step_record_action">
+ <property name="label" translatable="yes">Step record</property>
+ <property name="stock_id">gtk-add</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">record_action</property>
+ </object>
<object class="GtkRadioAction" id="stop_action">
<property name="stock_id">gtk-media-stop</property>
<property name="draw_as_radio">True</property>
@@ -66,6 +65,20 @@ along with Machina; if not, write to the Free Software Foundation, Inc.,
</object>
</child>
</object>
+ <object class="GtkAdjustment" id="bpm_adjustment">
+ <property name="lower">1</property>
+ <property name="upper">480</property>
+ <property name="value">120</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="quantize_adjustment">
+ <property name="lower">1</property>
+ <property name="upper">256</property>
+ <property name="value">16</property>
+ <property name="step_increment">2</property>
+ <property name="page_increment">8</property>
+ </object>
<object class="GtkDialog" id="help_dialog">
<property name="can_focus">False</property>
<property name="border_width">8</property>
@@ -387,6 +400,7 @@ press stop or play and the new nodes will be added to the machine.
<property name="related_action">stop_action</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Stop</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -420,22 +434,12 @@ press stop or play and the new nodes will be added to the machine.
</packing>
</child>
<child>
- <object class="GtkSeparatorToolItem" id="separatortoolitem4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkToggleToolButton" id="step_record_checkbutton">
- <property name="use_action_appearance">False</property>
+ <object class="GtkToggleToolButton" id="step_record_but">
+ <property name="related_action">step_record_action</property>
<property name="visible">True</property>
<property name="can_focus">False</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_text" translatable="yes">Step record</property>
- <property name="stock_id">gtk-add</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1087,11 +1091,4 @@ press stop or play and the new nodes will be added to the machine.
<action-widget response="-5">node_properties_ok_button</action-widget>
</action-widgets>
</object>
- <object class="GtkAdjustment" id="quantize_adjustment">
- <property name="lower">1</property>
- <property name="upper">256</property>
- <property name="value">16</property>
- <property name="step_increment">2</property>
- <property name="page_increment">8</property>
- </object>
</interface>