summaryrefslogtreecommitdiff
path: root/gtk2_ardour/step_entry.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-08-03 04:13:05 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-08-03 04:13:05 +0000
commit64f9fac9a8ad94182fca885f09fd53a228561c01 (patch)
tree29595a1be0819726ad7366a3dc184332f3f509f0 /gtk2_ardour/step_entry.cc
parente0edca5a2abd65d869348e4bddb9d07ecc156450 (diff)
make step entry chord & triplet buttons do their thing, or something close to it
git-svn-id: svn://localhost/ardour2/branches/3.0@7530 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/step_entry.cc')
-rw-r--r--gtk2_ardour/step_entry.cc29
1 files changed, 23 insertions, 6 deletions
diff --git a/gtk2_ardour/step_entry.cc b/gtk2_ardour/step_entry.cc
index aa81fead3d..666890996b 100644
--- a/gtk2_ardour/step_entry.cc
+++ b/gtk2_ardour/step_entry.cc
@@ -17,6 +17,8 @@
*/
+#include <iostream>
+
#include "midi_time_axis.h"
#include "step_entry.h"
#include "utils.h"
@@ -169,6 +171,8 @@ StepEntry::StepEntry (MidiTimeAxisView& mtv)
g_signal_connect(G_OBJECT(_piano), "note-off", G_CALLBACK(_note_off_event_handler), this);
rest_button.signal_clicked().connect (sigc::mem_fun (*this, &StepEntry::rest_click));
+ chord_button.signal_toggled().connect (sigc::mem_fun (*this, &StepEntry::chord_toggled));
+ triplet_button.signal_toggled().connect (sigc::mem_fun (*this, &StepEntry::triplet_toggled));
packer.set_spacing (6);
packer.pack_start (upper_box, false, false);
@@ -226,14 +230,11 @@ StepEntry::note_off_event_handler (int note)
velocity = 127;
}
- if (!triplet_button.get_active()) {
- _mtv->step_add_note (channel_adjustment.get_value(), note, velocity, length);
- } else {
+ if (_mtv->step_edit_within_triplet()) {
length *= 2.0/3.0;
- _mtv->step_add_note (channel_adjustment.get_value(), note, velocity, length);
- _mtv->step_add_note (channel_adjustment.get_value(), note, velocity, length);
- _mtv->step_add_note (channel_adjustment.get_value(), note, velocity, length);
}
+
+ _mtv->step_add_note (channel_adjustment.get_value(), note, velocity, length);
}
void
@@ -241,3 +242,19 @@ StepEntry::rest_click ()
{
_mtv->step_edit_rest ();
}
+
+void
+StepEntry::triplet_toggled ()
+{
+ if (triplet_button.get_active () != _mtv->step_edit_within_triplet()) {
+ _mtv->step_edit_toggle_triplet ();
+ }
+}
+
+void
+StepEntry::chord_toggled ()
+{
+ if (chord_button.get_active() != _mtv->step_edit_within_chord ()) {
+ _mtv->step_edit_toggle_chord ();
+ }
+}