2013-04-04 00:32:52 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2013-2018 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.
|
|
|
|
*/
|
2013-04-04 00:32:52 -04:00
|
|
|
|
2024-09-25 20:38:59 -04:00
|
|
|
#pragma once
|
2013-04-04 00:32:52 -04:00
|
|
|
|
|
|
|
#include <iostream>
|
2024-08-30 14:31:20 -04:00
|
|
|
|
|
|
|
#include "canvas/rectangle.h"
|
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
#include "note_base.h"
|
|
|
|
#include "midi_util.h"
|
|
|
|
|
|
|
|
namespace ArdourCanvas {
|
2014-06-22 11:41:05 -04:00
|
|
|
class Container;
|
2018-07-03 11:21:53 -04:00
|
|
|
class Note;
|
2013-04-04 00:32:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
class Note : public NoteBase
|
|
|
|
{
|
|
|
|
public:
|
2017-09-24 12:03:54 -04:00
|
|
|
typedef Evoral::Note<Temporal::Beats> NoteType;
|
2013-04-04 00:32:52 -04:00
|
|
|
|
2024-01-04 21:07:52 -05:00
|
|
|
Note (MidiView& region,
|
2014-06-21 11:44:22 -04:00
|
|
|
ArdourCanvas::Item* parent,
|
2023-02-16 18:33:28 -05:00
|
|
|
const std::shared_ptr<NoteType> note = std::shared_ptr<NoteType>(),
|
2013-04-04 00:32:52 -04:00
|
|
|
bool with_events = true);
|
|
|
|
|
|
|
|
~Note ();
|
|
|
|
|
|
|
|
ArdourCanvas::Coord x0 () const;
|
|
|
|
ArdourCanvas::Coord y0 () const;
|
|
|
|
ArdourCanvas::Coord x1 () const;
|
|
|
|
ArdourCanvas::Coord y1 () const;
|
|
|
|
|
2016-06-24 10:04:04 -04:00
|
|
|
void set (ArdourCanvas::Rect);
|
2013-04-04 00:32:52 -04:00
|
|
|
void set_x0 (ArdourCanvas::Coord);
|
|
|
|
void set_y0 (ArdourCanvas::Coord);
|
|
|
|
void set_x1 (ArdourCanvas::Coord);
|
|
|
|
void set_y1 (ArdourCanvas::Coord);
|
|
|
|
|
2015-12-05 18:43:08 -05:00
|
|
|
void set_outline_what (ArdourCanvas::Rectangle::What);
|
|
|
|
void set_outline_all ();
|
2013-04-04 00:32:52 -04:00
|
|
|
|
|
|
|
void set_outline_color (uint32_t);
|
|
|
|
void set_fill_color (uint32_t);
|
|
|
|
|
|
|
|
void show ();
|
|
|
|
void hide ();
|
|
|
|
|
|
|
|
void set_ignore_events (bool);
|
|
|
|
|
2023-06-20 16:42:43 -04:00
|
|
|
/* Just changes the visual display of velocity during a drag */
|
2018-07-03 11:28:01 -04:00
|
|
|
void set_velocity (double);
|
2023-06-20 16:42:43 -04:00
|
|
|
double visual_velocity () const;
|
2013-04-04 00:32:52 -04:00
|
|
|
void move_event (double dx, double dy);
|
|
|
|
|
|
|
|
private:
|
2023-06-20 16:42:43 -04:00
|
|
|
ArdourCanvas::Note* _visual_note;
|
2013-04-04 00:32:52 -04:00
|
|
|
};
|
|
|
|
|