2010-08-02 17:52:21 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2010 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __gtk2_ardour_step_entry_h__
|
|
|
|
#define __gtk2_ardour_step_entry_h__
|
|
|
|
|
|
|
|
#include <gtkmm/togglebutton.h>
|
|
|
|
#include <gtkmm/radiobutton.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/adjustment.h>
|
2010-08-06 15:02:21 -04:00
|
|
|
#include <gtkmm2ext/bindings.h>
|
2010-08-02 17:52:21 -04:00
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
#include "gtk_pianokeyboard.h"
|
|
|
|
|
|
|
|
class MidiTimeAxisView;
|
|
|
|
|
|
|
|
class StepEntry : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StepEntry (MidiTimeAxisView&);
|
|
|
|
~StepEntry ();
|
|
|
|
|
|
|
|
void note_off_event_handler (int note);
|
2010-08-03 15:22:57 -04:00
|
|
|
void rest_event_handler ();
|
|
|
|
|
2010-08-04 13:04:20 -04:00
|
|
|
Evoral::MusicalTime note_length() const;
|
|
|
|
uint8_t note_velocity() const;
|
|
|
|
uint8_t note_channel() const;
|
2010-08-10 17:27:04 -04:00
|
|
|
|
|
|
|
int current_octave () const { return (int) floor (octave_adjustment.get_value()); }
|
|
|
|
|
2010-08-02 17:52:21 -04:00
|
|
|
private:
|
2010-08-10 17:27:04 -04:00
|
|
|
Evoral::MusicalTime _current_note_length;
|
|
|
|
uint8_t _current_note_velocity;
|
|
|
|
|
2010-08-02 17:52:21 -04:00
|
|
|
Gtk::VBox packer;
|
|
|
|
Gtk::HBox upper_box;
|
|
|
|
Gtk::HBox note_length_box;
|
|
|
|
Gtk::HBox note_velocity_box;
|
|
|
|
|
|
|
|
Gtk::ToggleButton chord_button;
|
|
|
|
Gtk::ToggleButton triplet_button;
|
|
|
|
Gtk::ToggleButton dot_button;
|
2010-08-04 13:04:20 -04:00
|
|
|
Gtk::ToggleButton restart_button;
|
2010-08-02 17:52:21 -04:00
|
|
|
|
2010-08-04 16:28:10 -04:00
|
|
|
Gtk::VBox resync_box;
|
|
|
|
Gtk::Button beat_resync_button;
|
|
|
|
Gtk::Button bar_resync_button;
|
|
|
|
|
2010-08-02 17:52:21 -04:00
|
|
|
Gtk::Button sustain_button;
|
|
|
|
Gtk::Button rest_button;
|
2010-08-04 13:04:20 -04:00
|
|
|
Gtk::Button grid_rest_button;
|
|
|
|
Gtk::VBox rest_box;
|
2010-08-02 17:52:21 -04:00
|
|
|
|
|
|
|
Gtk::RadioButton length_1_button;
|
|
|
|
Gtk::RadioButton length_2_button;
|
|
|
|
Gtk::RadioButton length_4_button;
|
|
|
|
Gtk::RadioButton length_8_button;
|
|
|
|
Gtk::RadioButton length_12_button;
|
|
|
|
Gtk::RadioButton length_16_button;
|
|
|
|
Gtk::RadioButton length_32_button;
|
|
|
|
Gtk::RadioButton length_64_button;
|
|
|
|
|
|
|
|
Gtk::RadioButton velocity_ppp_button;
|
|
|
|
Gtk::RadioButton velocity_pp_button;
|
|
|
|
Gtk::RadioButton velocity_p_button;
|
|
|
|
Gtk::RadioButton velocity_mp_button;
|
|
|
|
Gtk::RadioButton velocity_mf_button;
|
|
|
|
Gtk::RadioButton velocity_f_button;
|
|
|
|
Gtk::RadioButton velocity_ff_button;
|
|
|
|
Gtk::RadioButton velocity_fff_button;
|
|
|
|
|
|
|
|
Gtk::Adjustment channel_adjustment;
|
|
|
|
Gtk::SpinButton channel_spinner;
|
|
|
|
|
2010-08-10 17:27:04 -04:00
|
|
|
Gtk::Adjustment octave_adjustment;
|
|
|
|
Gtk::SpinButton octave_spinner;
|
|
|
|
|
|
|
|
Gtk::Adjustment length_divisor_adjustment;
|
|
|
|
Gtk::SpinButton length_divisor_spinner;
|
|
|
|
|
|
|
|
Gtk::Adjustment velocity_adjustment;
|
|
|
|
Gtk::SpinButton velocity_spinner;
|
|
|
|
|
2010-08-11 14:21:37 -04:00
|
|
|
Gtk::Adjustment bank_adjustment;
|
|
|
|
Gtk::SpinButton bank_spinner;
|
|
|
|
Gtk::Button bank_button;
|
|
|
|
|
|
|
|
Gtk::Adjustment program_adjustment;
|
|
|
|
Gtk::SpinButton program_spinner;
|
|
|
|
Gtk::Button program_button;
|
|
|
|
|
2010-08-10 17:27:04 -04:00
|
|
|
void length_changed ();
|
|
|
|
void velocity_changed ();
|
|
|
|
void velocity_value_change ();
|
|
|
|
void length_value_change ();
|
|
|
|
|
2010-08-02 17:52:21 -04:00
|
|
|
PianoKeyboard* _piano;
|
|
|
|
Gtk::Widget* piano;
|
|
|
|
MidiTimeAxisView* _mtv;
|
|
|
|
|
2010-08-11 14:21:37 -04:00
|
|
|
void bank_click ();
|
|
|
|
void program_click ();
|
2010-08-02 17:52:21 -04:00
|
|
|
void rest_click ();
|
2010-08-04 13:04:20 -04:00
|
|
|
void grid_rest_click ();
|
2010-08-02 17:52:21 -04:00
|
|
|
void sustain_click ();
|
2010-08-03 00:13:05 -04:00
|
|
|
void chord_toggled ();
|
|
|
|
void triplet_toggled ();
|
2010-08-04 16:28:10 -04:00
|
|
|
void beat_resync_click ();
|
|
|
|
void bar_resync_click ();
|
2010-08-03 15:22:57 -04:00
|
|
|
|
|
|
|
bool piano_enter_notify_event (GdkEventCrossing *ev);
|
|
|
|
bool on_key_release_event (GdkEventKey*);
|
|
|
|
bool on_key_press_event (GdkEventKey*);
|
2010-08-04 13:04:20 -04:00
|
|
|
|
|
|
|
void on_show ();
|
2010-08-06 15:02:21 -04:00
|
|
|
|
|
|
|
/* actions */
|
|
|
|
|
|
|
|
void register_actions ();
|
|
|
|
Gtkmm2ext::ActionMap myactions;
|
|
|
|
|
2010-08-10 17:27:04 -04:00
|
|
|
void insert_note (uint8_t);
|
|
|
|
void insert_rest ();
|
|
|
|
void insert_grid_rest ();
|
|
|
|
|
2010-08-06 15:02:21 -04:00
|
|
|
void insert_a ();
|
|
|
|
void insert_asharp ();
|
|
|
|
void insert_b ();
|
|
|
|
void insert_c ();
|
|
|
|
void insert_csharp ();
|
|
|
|
void insert_d ();
|
|
|
|
void insert_dsharp ();
|
|
|
|
void insert_e ();
|
|
|
|
void insert_f ();
|
|
|
|
void insert_fsharp ();
|
|
|
|
void insert_g ();
|
2010-08-10 17:27:04 -04:00
|
|
|
void insert_gsharp ();
|
2010-08-06 15:02:21 -04:00
|
|
|
|
2010-08-10 17:27:04 -04:00
|
|
|
void note_length_change (GtkAction*);
|
|
|
|
void note_velocity_change (GtkAction*);
|
|
|
|
|
|
|
|
bool radio_button_press (GdkEventButton*);
|
|
|
|
bool radio_button_release (GdkEventButton*, Gtk::RadioButton*, int);
|
2010-08-06 15:02:21 -04:00
|
|
|
|
|
|
|
void load_bindings ();
|
|
|
|
Gtkmm2ext::Bindings bindings;
|
2010-08-02 17:52:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_step_entry_h__ */
|