/*
- Copyright (C) 2008 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.
-*/
+ * Copyright (C) 2008-2009 David Robillard <d@drobilla.net>
+ * Copyright (C) 2010-2012 Paul Davis <paul@linuxaudiosystems.com>
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#ifndef __ardour_piano_roll_header_h__
#define __ardour_piano_roll_header_h__
-#include <ardour/types.h>
+#include "ardour/types.h"
#include <gtkmm/drawingarea.h>
class MidiTimeAxisView;
class MidiStreamView;
+class PublicEditor;
class PianoRollHeader : public Gtk::DrawingArea {
public:
void on_size_allocate(Gtk::Allocation& a);
void note_range_changed();
+ void set_note_highlight (uint8_t note);
struct Color {
Color();
Color(double _r, double _g, double _b);
inline void set(const Color& c);
-
+
double r;
double g;
double b;
};
+ sigc::signal<void,uint8_t> SetNoteSelection;
+ sigc::signal<void,uint8_t> AddNoteSelection;
+ sigc::signal<void,uint8_t> ToggleNoteSelection;
+ sigc::signal<void,uint8_t> ExtendNoteSelection;
+
private:
static Color white;
static Color white_highlight;
void send_note_on(uint8_t note);
void send_note_off(uint8_t note);
+ void reset_clicked_note(uint8_t, bool invalidate = true);
+
MidiStreamView& _view;
uint8_t _event[3];
uint8_t _clicked_note;
double _grab_y;
bool _dragging;
-
+
double _note_height;
double _black_note_width;
+
+ PublicEditor& editor() const;
};
#endif /* __ardour_piano_roll_header_h__ */