20 #include <gtkmm/stock.h>
21 #include <gtkmm/table.h>
45 , _channel_all (
_(
"Set selected notes to this channel"))
46 , _pitch_all (
_(
"Set selected notes to this pitch"))
47 , _velocity_all (
_(
"Set selected notes to this velocity"))
48 , _time_clock (
X_(
"notetime"), true,
"", true, false)
49 , _time_all (
_(
"Set selected notes to this time"))
50 , _length_clock (
X_(
"notelength"), true,
"", true, false, true)
51 , _length_all (
_(
"Set selected notes to this length"))
53 Table* table = manage (
new Table (4, 2));
54 table->set_spacings (6);
59 table->attach (*l, 0, 1, r, r + 1);
60 table->attach (
_channel, 1, 2, r, r + 1);
69 table->attach (*l, 0, 1, r, r + 1);
70 table->attach (
_pitch, 1, 2, r, r + 1);
75 _pitch.set_increments (1, 10);
79 table->attach (*l, 0, 1, r, r + 1);
80 table->attach (
_velocity, 1, 2, r, r + 1);
89 table->attach (*l, 0, 1, r, r + 1);
91 table->attach (
_time_all, 2, 3, r, r + 1);
99 table->attach (*l, 0, 1, r, r + 1);
116 int test_channel = (*
_events.begin())->note()->channel ();
117 int test_pitch = (*
_events.begin())->note()->note ();
118 int test_velocity = (*
_events.begin())->note()->velocity ();
122 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
123 if ((*i)->note()->channel() != test_channel) {
127 if ((*i)->note()->note() != test_pitch) {
131 if ((*i)->note()->velocity() != test_velocity) {
135 if ((*i)->note()->time () != test_time) {
139 if ((*i)->note()->length () != test_length) {
144 get_vbox()->pack_start (*table);
146 add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
147 add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_ACCEPT);
148 set_default_response (Gtk::RESPONSE_ACCEPT);
154 if (r != RESPONSE_ACCEPT) {
167 bool had_change =
false;
170 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
171 if (
_channel.get_value_as_int() - 1 != (*i)->note()->channel()) {
179 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
180 if (
_pitch.get_value_as_int() != (*i)->note()->note()) {
188 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
189 if (
_velocity.get_value_as_int() != (*i)->note()->velocity()) {
199 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
200 if (t != (*i)->note()->time()) {
210 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
211 if (d != (*i)->note()->length()) {
224 for (set<NoteBase*>::iterator i =
_events.begin(); i !=
_events.end(); ++i) {
225 (*i)->set_selected ((*i)->selected());
framepos_t current_time(framepos_t position=0) const
std::set< NoteBase * > _events
TimeAxisView & get_time_axis_view() const
void set(framepos_t, bool force=false, ARDOUR::framecnt_t offset=0)
void set_session(ARDOUR::Session *s)
void change_note_channel(NoteBase *, int8_t, bool relative=false)
Gtk::CheckButton _time_all
Gtk::CheckButton _velocity_all
void change_note_velocity(NoteBase *ev, int8_t vel, bool relative=false)
MidiRegionView * _region_view
void change_note_time(NoteBase *ev, ARDOUR::MidiModel::TimeType, bool relative=false)
EditNoteDialog(MidiRegionView *rv, std::set< NoteBase * > n)
ARDOUR::Session * session() const
ARDOUR::BeatsFramesConverter const & source_relative_time_converter() const
ARDOUR::BeatsFramesConverter const & region_relative_time_converter() const
LIBGTKMM2EXT_API Gtk::Label * left_aligned_label(std::string const &)
Evoral::Beats from(framepos_t frames) const
Gtk::CheckButton _length_all
Gtk::CheckButton _pitch_all
void change_note_length(NoteBase *, ARDOUR::MidiModel::TimeType)
void change_note_note(NoteBase *ev, int8_t note, bool relative=false)
framepos_t current_duration(framepos_t position=0) const
Gtk::CheckButton _channel_all
void apply_diff(bool as_subcommand=false)
Gtk::SpinButton _velocity
framepos_t to(Evoral::Beats beats) const
void start_note_diff_command(std::string name="midi edit")