/*
- Copyright (C) 2007 Paul Davis
- Author: David Robillard
-
- 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) 2013-2018 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2014-2015 David Robillard <d@drobilla.net>
+ * Copyright (C) 2015 Tim Mayberry <mojofunk@gmail.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 __gtk_ardour_note_base_h__
#define __gtk_ardour_note_base_h__
#include <boost/shared_ptr.hpp>
+#include "temporal/beats.h"
#include "canvas/types.h"
+#include "gtkmm2ext/colors.h"
#include "rgb_macros.h"
#include "ui_config.h"
*/
class NoteBase : public sigc::trackable
{
- public:
- typedef Evoral::Note<Evoral::Beats> NoteType;
+public:
+ typedef Evoral::Note<Temporal::Beats> NoteType;
NoteBase (MidiRegionView& region, bool, const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>());
virtual ~NoteBase ();
static void set_colors ();
- inline static uint32_t meter_style_fill_color(uint8_t vel, bool selected) {
- if (selected) {
- return _selected_mod_col;
- } else if (vel < 64) {
- return UINT_INTERPOLATE(_min_col, _mid_col,
- (vel / (double)63.0));
- } else {
- return UINT_INTERPOLATE(_mid_col, _max_col,
- ((vel-64) / (double)63.0));
- }
- }
+ static Gtkmm2ext::Color meter_style_fill_color(uint8_t vel, bool selected);
/// calculate outline colors from fill colors of notes
inline static uint32_t calculate_outline(uint32_t color, bool selected=false) {
if (selected) {
- return _selected_outline_col;
+ return _selected_col;
} else {
return UINT_INTERPOLATE(color, 0x000000ff, 0.5);
}
private:
bool event_handler (GdkEvent *);
- static uint32_t _selected_mod_col;
- static uint32_t _selected_outline_col;
- static uint32_t _selected_col;
- static uint32_t _min_col;
- static uint32_t _mid_col;
- static uint32_t _max_col;
+ static Gtkmm2ext::Color _selected_col;
+ static Gtkmm2ext::SVAModifier color_modifier;
+ static Gtkmm2ext::Color velocity_color_table[128];
static bool _color_init;
};