[softwerk-dev] patch for direct text entry
Status: Beta
Brought to you by:
pbd
|
From: Paul Barton-D. <pb...@op...> - 2000-12-05 02:42:31
|
If you really want instant-text-update of step values, here's a patch.
It also correct the step value display entry box being editable when
the sequence contains raw midi values. reynald - did you bother to try
to hack up the "recorded MIDI is notes on/off only" ? it just occured
to me that its a little more complex than i first suggested ... :)
--p
Index: sequence_ui.cc
===================================================================
RCS file: /cvsroot/softwerk/softwerk/sequence_ui.cc,v
retrieving revision 1.10
diff -c -u -r1.10 sequence_ui.cc
--- sequence_ui.cc 2000/05/05 14:10:05 1.10
+++ sequence_ui.cc 2000/12/05 02:38:35
@@ -578,6 +578,16 @@
noteBox.hide ();
}
+ if (_sequence.is_raw_midi()) {
+ for (step = steps.begin(); step != steps.end(); step++) {
+ (*step)->set_editable (false);
+ }
+ } else {
+ for (step = steps.begin(); step != steps.end(); step++) {
+ (*step)->set_editable (true);
+ }
+ }
+
for (step = steps.begin(); step != steps.end(); step++) {
(*step)->map_state ();
}
Index: softwerk_ui.rc
===================================================================
RCS file: /cvsroot/softwerk/softwerk/softwerk_ui.rc,v
retrieving revision 1.5
diff -c -u -r1.5 softwerk_ui.rc
--- softwerk_ui.rc 2000/11/28 20:07:48 1.5
+++ softwerk_ui.rc 2000/12/05 02:38:35
@@ -157,7 +157,6 @@
style "terminal_marker"
{
-# bg[ACTIVE] = { 0.44, 0.41, 0.54 }
bg[ACTIVE] = { 0, 0.54, 0.97 }
bg[NORMAL] = { 0.42, 0.52, 0.45 }
}
Index: step_ui.cc
===================================================================
RCS file: /cvsroot/softwerk/softwerk/step_ui.cc,v
retrieving revision 1.8
diff -c -u -r1.8 step_ui.cc
--- step_ui.cc 2000/11/28 20:07:48 1.8
+++ step_ui.cc 2000/12/05 02:38:36
@@ -52,7 +52,7 @@
valueDisplay.add_events (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK);
valueDisplay.button_press_event.connect (slot (this,&StepUI::value_display_button_press));
valueDisplay.button_release_event.connect (slot (this,&StepUI::value_display_button_release));
- valueDisplay.activate.connect (slot (this, &StepUI::value_entered));
+ valueDisplay.changed.connect (slot (this, &StepUI::value_changed));
terminalButton.set_usize (10, 10);
terminalButton.set_name ("TerminalMarker");
@@ -167,15 +167,15 @@
ui_is_terminal = !step.is_terminal ();
ui_is_enabled = !step.is_enabled ();
queue_touch ();
-
touch ();
}
void
-StepUI::value_entered ()
+StepUI::value_changed ()
{
- int val = atoi (valueDisplay.get_text().c_str());
+ int val;
+ val = atoi (valueDisplay.get_text().c_str());
step.set (val);
}
Index: step_ui.h
===================================================================
RCS file: /cvsroot/softwerk/softwerk/step_ui.h,v
retrieving revision 1.7
diff -c -u -r1.7 step_ui.h
--- step_ui.h 2000/11/28 20:07:48 1.7
+++ step_ui.h 2000/12/05 02:38:36
@@ -18,6 +18,9 @@
void map_state (); /* called after substantive changes, eg.
after a pattern load.
*/
+ void set_editable (bool yn) {
+ valueDisplay.set_editable (yn);
+ }
friend class SequenceUI;
|