13
0

* fixed missing get coordinate functions in CanvasHit

* Fixed crash bug when NoteMode = Percussive on MidiRegionView
* Fixed possible MemoryLeaks and added Signal in MidiMultipleChannelSelector

git-svn-id: svn://localhost/ardour2/branches/3.0@3263 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Baier 2008-04-17 21:27:33 +00:00
parent 7ba87f7672
commit accc73a8c1
4 changed files with 14 additions and 10 deletions

View File

@ -39,11 +39,10 @@ public:
{
}
// FIXME
double x1() { return 0.0; }
double y1() { return 0.0; }
double x2() { return 0.0; }
double y2() { return 0.0; }
double x1() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return x1; }
double y1() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return y1; }
double x2() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return x2; }
double y2() { double x1, y1, x2, y2; get_bounds(x1,y1,x2,y2); return y2; }
void set_outline_color(uint32_t c) { property_outline_color_rgba() = c; }
void set_fill_color(uint32_t c) { property_fill_color_rgba() = c; }

View File

@ -67,20 +67,20 @@ SingleMidiChannelSelector::button_toggled(Gtk::ToggleButton *button, uint8_t cha
MidiMultipleChannelSelector::MidiMultipleChannelSelector(uint16_t initial_selection)
: MidiChannelSelector(6, 4, 0, 0)
{
_select_all.add(*new Gtk::Label(_("All")));
_select_all.add(*Gtk::manage(new Gtk::Label(_("All"))));
_select_all.signal_clicked().connect(
sigc::bind(sigc::mem_fun(this, &MidiMultipleChannelSelector::select_all), true));
_select_none.add(*new Gtk::Label(_("None")));
_select_none.add(*Gtk::manage(new Gtk::Label(_("None"))));
_select_none.signal_clicked().connect(
sigc::bind(sigc::mem_fun(this, &MidiMultipleChannelSelector::select_all), false));
_invert_selection.add(*new Gtk::Label(_("Invert")));
_invert_selection.add(*Gtk::manage(new Gtk::Label(_("Invert"))));
_invert_selection.signal_clicked().connect(
sigc::mem_fun(this, &MidiMultipleChannelSelector::invert_selection));
set_homogeneous(false);
attach(*new Gtk::HSeparator(), 0, 4, 4, 5, Gtk::FILL, Gtk::SHRINK, 0, 0);
attach(*Gtk::manage(new Gtk::HSeparator()), 0, 4, 4, 5, Gtk::FILL, Gtk::SHRINK, 0, 0);
set_col_spacing(4, -5);
attach(_select_all, 0, 2, 5, 6);
attach(_select_none, 2, 4, 5, 6);
@ -101,6 +101,7 @@ void
MidiMultipleChannelSelector::button_toggled(Gtk::ToggleButton *button, uint8_t channel)
{
_selected_channels = _selected_channels ^ (1L << channel);
selection_changed.emit(_selected_channels);
}
void
@ -110,6 +111,7 @@ MidiMultipleChannelSelector::select_all(bool on)
Gtk::ToggleButton *button = &_buttons[i / 4][i % 4];
button->set_active(on);
}
selection_changed.emit(_selected_channels);
}
void
@ -123,5 +125,6 @@ MidiMultipleChannelSelector::invert_selection(void)
button->set_active(true);
}
}
selection_changed.emit(_selected_channels);
}

View File

@ -43,6 +43,8 @@ public:
MidiMultipleChannelSelector(uint16_t initial_selection = 1);
const uint16_t get_selected_channels() const { return _selected_channels; }
sigc::signal<void, uint16_t> selection_changed;
protected:
virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr);

View File

@ -753,7 +753,7 @@ MidiRegionView::add_note(const boost::shared_ptr<Note> note)
const double diamond_size = midi_stream_view()->note_height() / 2.0;
const double y = midi_stream_view()->note_to_y(note->note()) + ((diamond_size-2) / 4.0);
CanvasHit* ev_diamond = new CanvasHit(*this, *group, diamond_size);
CanvasHit* ev_diamond = new CanvasHit(*this, *group, diamond_size, note);
ev_diamond->move(x, y);
ev_diamond->show();
ev_diamond->property_fill_color_rgba() = note_fill_color(note->velocity());