laptop navigation
This commit is contained in:
parent
758dbadc9d
commit
16d7f273b2
19
jacker.glade
19
jacker.glade
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkWindow" id="main">
|
||||
<property name="title" translatable="yes">Jacker</property>
|
||||
<property name="window_position">center</property>
|
||||
|
@ -93,8 +93,8 @@
|
|||
<child>
|
||||
<object class="GtkImageMenuItem" id="menuitem_song">
|
||||
<property name="visible">True</property>
|
||||
<property name="related_action">show_song_action</property>
|
||||
<property name="use_action_appearance">True</property>
|
||||
<property name="related_action">show_song_action</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
|
@ -102,8 +102,8 @@
|
|||
<child>
|
||||
<object class="GtkImageMenuItem" id="menuitem_pattern">
|
||||
<property name="visible">True</property>
|
||||
<property name="related_action">show_pattern_action</property>
|
||||
<property name="use_action_appearance">True</property>
|
||||
<property name="related_action">show_pattern_action</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
|
@ -147,8 +147,8 @@
|
|||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
<property name="visible">True</property>
|
||||
<property name="related_action">play_action</property>
|
||||
<property name="use_action_appearance">True</property>
|
||||
<property name="related_action">play_action</property>
|
||||
<property name="label" translatable="yes">toolbutton1</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
|
@ -160,8 +160,8 @@
|
|||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton2">
|
||||
<property name="visible">True</property>
|
||||
<property name="related_action">stop_action</property>
|
||||
<property name="use_action_appearance">True</property>
|
||||
<property name="related_action">stop_action</property>
|
||||
<property name="label" translatable="yes">toolbutton2</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
|
@ -578,7 +578,10 @@
|
|||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="pattern_frame">
|
||||
<property name="width_request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="single_line_mode">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
|
@ -596,7 +599,9 @@
|
|||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="pattern_column">
|
||||
<property name="width_request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
|
@ -614,7 +619,9 @@
|
|||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="pattern_value">
|
||||
<property name="width_request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
|
@ -699,8 +706,8 @@
|
|||
<child>
|
||||
<object class="GtkImageMenuItem" id="menuitem5">
|
||||
<property name="visible">True</property>
|
||||
<property name="related_action">add_track_action</property>
|
||||
<property name="use_action_appearance">True</property>
|
||||
<property name="related_action">add_track_action</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
|
|
|
@ -36,6 +36,14 @@ static const guint16 piano_scancodes[] = {
|
|||
#endif
|
||||
};
|
||||
|
||||
enum {
|
||||
#if defined(WIN32)
|
||||
#else
|
||||
ScanOctaveDown = 0x14,
|
||||
ScanOctaveUp = 0x15,
|
||||
#endif
|
||||
};
|
||||
|
||||
static const char TargetFormatPattern[] = "jacker_pattern_block";
|
||||
|
||||
//=============================================================================
|
||||
|
@ -186,6 +194,7 @@ bool CellRendererNote::on_key_press_event(GdkEventKey* event_key,
|
|||
if ((event_key->keyval >= GDK_0) && (event_key->keyval <= GDK_9)) {
|
||||
int octave = event_key->keyval - GDK_0;
|
||||
event.value = 12*octave + note;
|
||||
view->set_octave(octave);
|
||||
view->navigate(0,1);
|
||||
return true;
|
||||
}
|
||||
|
@ -1474,8 +1483,15 @@ bool PatternView::on_key_press_event(GdkEventKey* event) {
|
|||
}
|
||||
} break;
|
||||
}
|
||||
switch (event->hardware_keycode) {
|
||||
case ScanOctaveUp: set_octave(get_octave()+1); return true;
|
||||
case ScanOctaveDown: set_octave(get_octave()-1); return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "No handler for %s\n", gdk_keyval_name(event->keyval));
|
||||
fprintf(stderr, "No handler for %s (0x%02x)\n",
|
||||
gdk_keyval_name(event->keyval), event->hardware_keycode);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1667,7 +1683,11 @@ void PatternView::update_navigation_status() {
|
|||
value = event->second.value;
|
||||
}
|
||||
|
||||
_navigation_status_request(measure.get_string(),
|
||||
char timestr[64];
|
||||
sprintf(timestr, "%s #%i",
|
||||
measure.get_string().c_str(), cursor.get_channel());
|
||||
|
||||
_navigation_status_request(timestr,
|
||||
model->get_param_name(param),
|
||||
model->format_param_value(param,value));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue