CanvasNoteEvent::show_channel_selector(void)
{
if (_channel_selector_widget == 0) {
- cerr << "Note has channel: " << int(_note->channel()) << endl;
SingleMidiChannelSelector* _channel_selector = new SingleMidiChannelSelector(_note->channel());
_channel_selector->show_all();
_channel_selector->channel_selected.connect(
sigc::mem_fun(this, &CanvasNoteEvent::on_channel_change));
+ _channel_selector->clicked.connect (
+ sigc::mem_fun (this, &CanvasNoteEvent::hide_channel_selector));
+
_channel_selector_widget = new Widget(*(_item->property_parent()),
x1(),
y2() + 2,
break;
case GDK_BUTTON_PRESS:
- cerr << "button press, bton = " << ev->button.button << endl;
if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state)) {
show_channel_selector();
return true;
&_buttons[row][column],
channel_nr - 1));
+ _buttons[row][column].signal_button_release_event().connect(
+ sigc::mem_fun(this, &MidiChannelSelector::was_clicked), false);
+
+
int table_row = start_row + row;
int table_column = start_column + column;
attach(_buttons[row][column], table_column, table_column + 1, table_row, table_row + 1);
{
}
+bool
+MidiChannelSelector::was_clicked (GdkEventButton*)
+{
+ clicked ();
+ return false;
+}
+
void
MidiChannelSelector::set_channel_colors(const uint32_t new_channel_colors[16])
{
virtual ~MidiChannelSelector() = 0;
sigc::signal<void, ARDOUR::ChannelMode, uint16_t> mode_changed;
+ sigc::signal<void> clicked;
void set_channel_colors(const uint32_t new_channel_colors[16]);
void set_default_channel_color();
Gtk::Label _button_labels[4][4];
Gtk::ToggleButton _buttons[4][4];
int _recursion_counter;
+ bool was_clicked (GdkEventButton*);
};
class SingleMidiChannelSelector : public MidiChannelSelector
_model->apply_command(*trackview.session(), _diff_command);
_diff_command = 0;
midi_view()->midi_track()->playlist_modified();
-
if (add_or_remove) {
_marked_for_selection.clear();
if (event) {
if (_marked_for_selection.find(note) != _marked_for_selection.end()) {
note_selected(event, true);
- }
+ }
if (_marked_for_velocity.find(note) != _marked_for_velocity.end()) {
event->show_velocity();
}
void
-MidiRegionView::add_note (uint8_t channel, uint8_t number, uint8_t velocity,
+MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity,
Evoral::MusicalTime pos, Evoral::MusicalTime len)
{
boost::shared_ptr<NoteType> new_note (new NoteType (channel, pos, len, number, velocity));
- start_diff_command (_("step add"));
- diff_add_note (new_note, true, false);
- apply_diff();
-
/* potentially extend region to hold new note */
nframes64_t end_frame = _region->position() + beats_to_frames (new_note->end_time());
if (end_frame > region_end) {
_region->set_length (end_frame, this);
- } else {
- redisplay_model ();
}
+
+ start_diff_command (_("step add"));
+ diff_add_note (new_note, true, false);
+ apply_diff();
+
+ // last_step_edit_note = new_note;
}
void
inline MidiStreamView* midi_stream_view() const
{ return midi_view()->midi_view(); }
- void add_note (uint8_t channel, uint8_t number, uint8_t velocity,
+ void step_add_note (uint8_t channel, uint8_t number, uint8_t velocity,
Evoral::MusicalTime pos, Evoral::MusicalTime len);
void set_height (double);
continue;
}
- step_edit_region_view->add_note (buf[0] & 0xf, buf[1], buf[2], step_edit_beat_pos, beats);
+ step_edit_region_view->step_add_note (buf[0] & 0xf, buf[1], buf[2], step_edit_beat_pos, beats);
step_edit_beat_pos += beats;
}
}