50 ((
StepEntry*)arg)->note_off_event_handler (note);
61 , _current_note_length (1.0)
62 , _current_note_velocity (64)
63 , triplet_button (
"3")
64 , dot_adjustment (0.0, 0.0, 3.0, 1.0, 1.0)
65 , beat_resync_button (
_(
">beat"))
66 , bar_resync_button (
_(
">bar"))
67 , resync_button (
_(
">EP"))
68 , sustain_button (
_(
"sustain"))
69 , rest_button (
_(
"rest"))
70 , grid_rest_button (
_(
"g-rest"))
71 , back_button (
_(
"back"))
72 , channel_adjustment (1, 1, 16, 1, 4)
73 , channel_spinner (channel_adjustment)
74 , octave_adjustment (4, 0, 10, 1, 4)
75 , octave_spinner (octave_adjustment)
76 , length_divisor_adjustment (1.0, 1.0, 128, 1.0, 4.0)
77 , length_divisor_spinner (length_divisor_adjustment)
78 , velocity_adjustment (64.0, 0.0, 127.0, 1.0, 4.0)
79 , velocity_spinner (velocity_adjustment)
80 , bank_adjustment (0, 0.0, 127.0, 1.0, 4.0)
81 , bank_spinner (bank_adjustment)
82 , bank_button (
_(
"+"))
83 , program_adjustment (0, 0.0, 127.0, 1.0, 4.0)
84 , program_spinner (program_adjustment)
85 , program_button (
_(
"+"))
99 uint16_t chn_mask =
se->channel_selector().get_selected_channels();
101 for (uint32_t i = 0; i < 16; ++i) {
102 if (chn_mask & (1<<i)) {
121 w = manage (
new Image (::
get_icon (
X_(
"wholenote"))));
124 w = manage (
new Image (::
get_icon (
X_(
"halfnote"))));
127 w = manage (
new Image (::
get_icon (
X_(
"quarternote"))));
130 w = manage (
new Image (::
get_icon (
X_(
"eighthnote"))));
133 w = manage (
new Image (::
get_icon (
X_(
"sixteenthnote"))));
136 w = manage (
new Image (::
get_icon (
X_(
"thirtysecondnote"))));
139 w = manage (
new Image (::
get_icon (
X_(
"sixtyfourthnote"))));
146 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_1_button.gobj()), act->gobj());
148 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_2_button.gobj()), act->gobj());
150 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_4_button.gobj()), act->gobj());
152 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_8_button.gobj()), act->gobj());
154 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_16_button.gobj()), act->gobj());
156 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_32_button.gobj()), act->gobj());
158 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
length_64_button.gobj()), act->gobj());
208 w = manage (
new Image (::
get_icon (
X_(
"pianississimo"))));
211 w = manage (
new Image (::
get_icon (
X_(
"pianissimo"))));
214 w = manage (
new Image (::
get_icon (
X_(
"piano"))));
217 w = manage (
new Image (::
get_icon (
X_(
"mezzopiano"))));
220 w = manage (
new Image (::
get_icon (
X_(
"mezzoforte"))));
223 w = manage (
new Image (::
get_icon (
X_(
"forte"))));
226 w = manage (
new Image (::
get_icon (
X_(
"fortissimo"))));
229 w = manage (
new Image (::
get_icon (
X_(
"fortississimo"))));
234 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_ppp_button.gobj()), act->gobj());
236 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_pp_button.gobj()), act->gobj());
238 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_p_button.gobj()), act->gobj());
240 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_mp_button.gobj()), act->gobj());
242 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_mf_button.gobj()), act->gobj());
244 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_f_button.gobj()), act->gobj());
246 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_ff_button.gobj()), act->gobj());
248 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
velocity_fff_button.gobj()), act->gobj());
294 Label* l = manage (
new Label);
295 l->set_markup (
"<b><big>-</big></b>");
299 l = manage (
new Label);
300 l->set_markup (
"<b><big>.</big></b>");
304 l = manage (
new Label);
305 l->set_markup (
"<b><big>..</big></b>");
309 l = manage (
new Label);
310 l->set_markup (
"<b><big>...</big></b>");
314 w = manage (
new Image (::
get_icon (
X_(
"chord"))));
347 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
back_button.gobj()),
false);
348 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
back_button.gobj()), act->gobj());
350 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
resync_button.gobj()),
false);
351 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
resync_button.gobj()), act->gobj());
353 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
triplet_button.gobj()),
false);
354 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
triplet_button.gobj()), act->gobj());
356 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
dot0_button.gobj()),
false);
357 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
dot0_button.gobj()), act->gobj());
359 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
dot1_button.gobj()),
false);
360 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
dot1_button.gobj()), act->gobj());
362 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
dot2_button.gobj()),
false);
363 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
dot2_button.gobj()), act->gobj());
365 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
dot3_button.gobj()),
false);
366 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
dot3_button.gobj()), act->gobj());
368 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
chord_button.gobj()),
false);
369 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
chord_button.gobj()), act->gobj());
371 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
rest_button.gobj()),
false);
372 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
rest_button.gobj()), act->gobj());
374 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
grid_rest_button.gobj()),
false);
375 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
grid_rest_button.gobj()), act->gobj());
377 gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (
sustain_button.gobj()),
false);
378 gtk_activatable_set_related_action (GTK_ACTIVATABLE (
sustain_button.gobj()), act->gobj());
393 v = manage (
new VBox);
394 l = manage (
new Label (
_(
"Channel")));
396 v->pack_start (*l,
false,
false);
400 v = manage (
new VBox);
401 l = manage (
new Label (
_(
"1/Note")));
403 v->pack_start (*l,
false,
false);
407 v = manage (
new VBox);
408 l = manage (
new Label (
_(
"Velocity")));
410 v->pack_start (*l,
false,
false);
414 v = manage (
new VBox);
415 l = manage (
new Label (
_(
"Octave")));
417 v->pack_start (*l,
false,
false);
421 v = manage (
new VBox);
422 l = manage (
new Label (
_(
"Bank")));
424 v->pack_start (*l,
false,
false);
429 v = manage (
new VBox);
430 l = manage (
new Label (
_(
"Program")));
432 v->pack_start (*l,
false,
false);
444 piano->set_flags (Gtk::CAN_FOCUS);
466 RefPtr<RadioAction> r = RefPtr<RadioAction>::cast_dynamic (act);
468 r->set_active (
true);
471 r = RefPtr<RadioAction>::cast_dynamic (act);
473 r->set_active (
true);
499 if (!gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
513 if (!gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
538 RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
539 bool triplets = tact->get_active ();
542 base_time *= (2.0/3.0);
548 dots = pow (2.0, dots);
549 base_time *= 1 + ((dots - 1.0)/dots);
577 ArdourWindow::on_show ();
641 RadioAction::Group note_length_group;
660 RadioAction::Group note_velocity_group;
682 RadioAction::Group dot_group;
711 std::string binding_file;
733 if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION(act))) {
734 gint v = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (act));
743 RefPtr<RadioAction> ract;
745 bool inconsistent =
true;
746 vector<const char*> dot_actions;
748 dot_actions.push_back (
"StepEditing/no-dotted");
749 dot_actions.push_back (
"StepEditing/toggle-dotted");
750 dot_actions.push_back (
"StepEditing/toggle-double-dotted");
751 dot_actions.push_back (
"StepEditing/toggle-triple-dotted");
753 for (vector<const char*>::iterator i = dot_actions.begin(); i != dot_actions.end(); ++i) {
758 ract = RefPtr<RadioAction>::cast_dynamic (act);
761 if (ract->property_value() == val) {
762 ract->set_active (
true);
763 inconsistent =
false;
884 if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION(act))) {
885 gint v = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (act));
901 if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION(act))) {
902 gint v = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (act));
911 RefPtr<RadioAction> ract;
913 bool inconsistent =
true;
914 vector<const char*> velocity_actions;
916 velocity_actions.push_back (
"StepEditing/note-velocity-ppp");
917 velocity_actions.push_back (
"StepEditing/note-velocity-pp");
918 velocity_actions.push_back (
"StepEditing/note-velocity-p");
919 velocity_actions.push_back (
"StepEditing/note-velocity-mp");
920 velocity_actions.push_back (
"StepEditing/note-velocity-mf");
921 velocity_actions.push_back (
"StepEditing/note-velocity-f");
922 velocity_actions.push_back (
"StepEditing/note-velocity-ff");
923 velocity_actions.push_back (
"StepEditing/note-velocity-fff");
925 for (vector<const char*>::iterator i = velocity_actions.begin(); i != velocity_actions.end(); ++i) {
930 ract = RefPtr<RadioAction>::cast_dynamic (act);
933 if (ract->property_value() == val) {
934 ract->set_active (
true);
935 inconsistent =
false;
956 RefPtr<RadioAction> ract;
958 bool inconsistent =
true;
959 vector<const char*> length_actions;
961 length_actions.push_back (
"StepEditing/note-length-whole");
962 length_actions.push_back (
"StepEditing/note-length-half");
963 length_actions.push_back (
"StepEditing/note-length-quarter");
964 length_actions.push_back (
"StepEditing/note-length-eighth");
965 length_actions.push_back (
"StepEditing/note-length-sixteenth");
966 length_actions.push_back (
"StepEditing/note-length-thirtysecond");
967 length_actions.push_back (
"StepEditing/note-length-sixtyfourth");
969 for (vector<const char*>::iterator i = length_actions.begin(); i != length_actions.end(); ++i) {
974 ract = RefPtr<RadioAction>::cast_dynamic (act);
977 if (ract->property_value() == val) {
978 ract->set_active (
true);
979 inconsistent =
false;
1000 if (ev->button == 1) {
1010 if (ev->button == 1) {
1011 GtkAction* act = gtk_activatable_get_related_action (GTK_ACTIVATABLE (btn->gobj()));
1014 gtk_radio_action_set_current_value (GTK_RADIO_ACTION(act), v);
1051 int il = (int) lrintf (l);
1067 int il = (int) lrintf (l);
1100 }
else if (l < 32) {
1102 }
else if (l < 48) {
1104 }
else if (l < 64) {
1106 }
else if (l < 80) {
1108 }
else if (l < 96) {
1110 }
else if (l < 112) {
1112 }
else if (l < 127) {
1126 }
else if (l > 96) {
1128 }
else if (l > 80) {
1130 }
else if (l > 64) {
1132 }
else if (l > 48) {
1134 }
else if (l > 32) {
1136 }
else if (l > 16) {
Gtk::Adjustment bank_adjustment
Gtk::Adjustment program_adjustment
Gtk::RadioButton velocity_mf_button
Gtk::ToggleButton triplet_button
void step_edit_bar_sync()
Gtk::ToggleButton dot0_button
Gtk::Button beat_resync_button
Evoral::Beats note_length()
Gtk::Adjustment channel_adjustment
Gtk::HBox note_length_box
void velocity_value_change()
Gtk::ToggleButton dot3_button
void note_length_change(GtkAction *)
Gtk::SpinButton program_spinner
Gtk::RadioButton velocity_mp_button
static ARDOUR_UI * instance()
Gtk::RadioButton velocity_p_button
bool forward_key_press(GdkEventKey *ev)
void move_step_edit_beat_pos(Evoral::Beats beats)
bool activate(KeyboardKey, Operation)
Gtk::HBox note_velocity_box
void insert_note(uint8_t)
Gtk::Adjustment dot_adjustment
int step_add_program_change(uint8_t channel, uint8_t program)
bool on_key_release_event(GdkEventKey *)
Gtk::Adjustment velocity_adjustment
Gtk::RadioButton velocity_pp_button
Glib::RefPtr< Gtk::Action > register_radio_action(const char *path, Gtk::RadioAction::Group &, const char *name, const char *label, sigc::slot< void, GtkAction * > sl, int value)
void dot_change(GtkAction *)
static void _rest_event_handler(GtkWidget *, gpointer arg)
GtkWidget * piano_keyboard_new(void)
Gtk::Adjustment length_divisor_adjustment
Gtk::Adjustment octave_adjustment
bool find_file(const Searchpath &search_path, const string &filename, std::string &result)
int step_add_note(uint8_t channel, uint8_t pitch, uint8_t velocity, Evoral::Beats beat_duration)
Gtk::SpinButton velocity_spinner
void note_off_event_handler(int note)
Gtk::RadioButton velocity_ppp_button
Gtk::ToggleButton dot1_button
int current_octave() const
void rest_event_handler()
Gtk::RadioButton velocity_ff_button
bool radio_button_press(GdkEventButton *)
int step_add_bank_change(uint8_t channel, uint8_t bank)
Gtk::SpinButton channel_spinner
void step_edit_sustain(Evoral::Beats beats)
uint8_t note_velocity() const
void step_edit_toggle_chord()
Gtk::Button program_button
Glib::RefPtr< Gtk::Action > find_action(const std::string &name)
void sync_to_edit_point()
Gtk::Button resync_button
void set_action_map(ActionMap &)
void next_note_velocity()
void length_value_change()
Gtkmm2ext::Bindings bindings
Gtk::RadioButton length_2_button
LIBARDOUR_API PBD::Searchpath ardour_config_search_path()
void step_edit_beat_sync()
void set_tip(Gtk::Widget &w, const gchar *tip)
Gtk::ToggleButton dot2_button
Gtk::RadioButton length_32_button
Gtk::RadioButton velocity_f_button
uint8_t note_channel() const
bool load(const std::string &path)
Gtk::RadioButton velocity_fff_button
void prev_note_velocity()
static void _note_off_event_handler(GtkWidget *, int note, gpointer arg)
void resync_step_edit_to_edit_point()
Gtk::SpinButton length_divisor_spinner
Gtk::ToggleButton chord_button
void step_edit_rest(Evoral::Beats beats)
void note_velocity_change(GtkAction *)
LIBEVORAL_API uint64_t Beats
bool on_key_press_event(GdkEventKey *)
Gtkmm2ext::ActionMap myactions
Gtk::RadioButton length_8_button
Gtk::RadioButton length_1_button
Gtk::SpinButton octave_spinner
Glib::RefPtr< Gtk::Action > register_toggle_action(const char *path, const char *name, const char *label, sigc::slot< void > sl)
Glib::RefPtr< Gtk::Action > register_action(const char *path, const char *name, const char *label, sigc::slot< void > sl)
Glib::RefPtr< Gdk::Pixbuf > get_icon(const char *cname)
Gtk::RadioButton length_16_button
Gtk::SpinButton bank_spinner
Gtk::RadioButton length_12_button
Gtk::RadioButton length_64_button
void set_step_edit_cursor_width(Evoral::Beats beats)
Gtk::Button bar_resync_button
Gtk::Button grid_rest_button
Gtk::RadioButton length_4_button
std::string string_compose(const std::string &fmt, const T1 &o1)
Gtk::Button sustain_button
bool radio_button_release(GdkEventButton *, Gtk::RadioButton *, int)