Ardour  9.0-pre0-582-g084a23a80d
ArdourCanvas::PianoRollHeader Class Reference

#include <prh.h>

Inheritance diagram for ArdourCanvas::PianoRollHeader:
[legend]

Classes

struct  NoteName
 

Public Member Functions

 PianoRollHeader (ArdourCanvas::Item *parent, MidiViewBackground &)
 
void size_request (double &w, double &h) const
 
void render (ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context >) const
 
void instrument_info_change ()
 
void note_range_changed ()
 
void set_note_highlight (uint8_t note)
 
void set_view (MidiView *)
 
- Public Member Functions inherited from ArdourCanvas::Rectangle
 Rectangle (Canvas *)
 
 Rectangle (Canvas *, Rect const &)
 
 Rectangle (Item *)
 
 Rectangle (Item *, Rect const &)
 
void render (Rect const &, Cairo::RefPtr< Cairo::Context >) const
 
void compute_bounding_box () const
 
void _size_allocate (Rect const &)
 
Rect const & get () const
 
Coord x0 () const
 
Coord y0 () const
 
Coord x1 () const
 
Coord y1 () const
 
Distance height () const
 
Distance width () const
 
void set (Rect const &)
 
void set_x0 (Coord)
 
void set_y0 (Coord)
 
void set_x1 (Coord)
 
void set_y1 (Coord)
 
double vertical_fraction (double y) const
 
void set_corner_radius (double d)
 
void set_outline_what (What)
 
void set_outline_all ()
 
void size_request (double &w, double &h) const
 
void dump (std::ostream &) const
 
- Public Member Functions inherited from ArdourCanvas::Item
 Item (Canvas *)
 
 Item (Item *)
 
 Item (Item *, Duple const &p)
 
virtual ~Item ()
 
void redraw () const
 
virtual void prepare_for_render (Rect const &area) const
 
virtual void add_items_at_point (Duple point, std::vector< Item const * > &items) const
 
virtual bool covers (Duple const &point) const
 
void grab ()
 
void ungrab ()
 
void unparent ()
 
void reparent (Item *, bool already_added=false)
 
Itemparent () const
 
uint32_t depth () const
 
const Itemclosest_ancestor_with (const Item &other) const
 
bool common_ancestor_within (uint32_t, const Item &other) const
 
bool is_ancestor_of (const Item &candidate) const
 
bool is_descendant_of (const Item &candidate) const
 
void set_position (Duple)
 
void set_x_position (Coord)
 
void set_y_position (Coord)
 
void move (Duple)
 
Duple position () const
 
Duple window_origin () const
 
Duple canvas_origin () const
 
ScrollGroupscroll_parent () const
 
void set_size_request (double w, double h)
 
void set_size_request_to_display_given_text (const std::vector< std::string > &strings, gint hpadding, gint vpadding)
 
void size_allocate (Rect const &)
 
virtual void size_allocate_children (Rect const &r)
 
Rect allocation () const
 
void set_layout_sensitive (bool)
 
bool layout_sensitive () const
 
Rect bounding_box () const
 
Coord height () const
 
Coord width () const
 
Duple item_to_parent (Duple const &) const
 
Rect item_to_parent (Rect const &) const
 
Duple parent_to_item (Duple const &) const
 
Rect parent_to_item (Rect const &) const
 
void canvas_to_item (Coord &, Coord &) const
 
void item_to_canvas (Coord &, Coord &) const
 
Duple canvas_to_item (Duple const &) const
 
Rect item_to_canvas (Rect const &) const
 
Duple item_to_canvas (Duple const &) const
 
Rect canvas_to_item (Rect const &) const
 
Duple item_to_window (Duple const &, bool rounded=true) const
 
Duple window_to_item (Duple const &) const
 
Rect item_to_window (Rect const &, bool rounded=true) const
 
Rect window_to_item (Rect const &) const
 
void raise_to_top ()
 
void raise (int)
 
void lower_to_bottom ()
 
virtual void hide ()
 
virtual void show ()
 
void block_change_notifications ()
 
void unblock_change_notifications ()
 
bool self_visible () const
 
bool visible () const
 
Canvascanvas () const
 
void set_ignore_events (bool)
 
bool ignore_events () const
 
void set_data (std::string const &, void *)
 
void * get_data (std::string const &) const
 
virtual void add (Item *)
 
virtual void add_front (Item *)
 
virtual void remove (Item *)
 
void clear (bool with_delete=false)
 
std::list< Item * > const & items () const
 
void raise_child_to_top (Item *)
 
void raise_child (Item *, int)
 
void lower_child_to_bottom (Item *)
 
virtual void child_changed (bool bbox_changed)
 
PackOptions pack_options () const
 
void set_pack_options (PackOptions)
 
std::string whoami () const
 
const std::string & tooltip () const
 
void set_tooltip (const std::string &)
 
void start_tooltip_timeout ()
 
void stop_tooltip_timeout ()
 
std::string whatami () const
 
bool resize_queued () const
 
void queue_resize ()
 
bool scroll_translation () const
 
void disable_scroll_translation ()
 
virtual void layout ()
 
Duple position_offset () const
 
- Public Member Functions inherited from ArdourCanvas::Fill
 Fill (Item &self)
 
 Fill (const Fill &)=delete
 
Filloperator= (const Fill &)=delete
 
virtual ~Fill ()
 
virtual void set_fill_color (Gtkmm2ext::Color)
 
virtual void set_fill (bool)
 
Gtkmm2ext::Color fill_color () const
 
bool fill () const
 
void set_gradient (StopList const &stops, bool is_vertical)
 
void set_pattern (Cairo::RefPtr< Cairo::Pattern >)
 
- Public Member Functions inherited from ArdourCanvas::Outline
 Outline (Item &self)
 
 Outline (const Outline &)=delete
 
Outlineoperator= (const Outline &)=delete
 
virtual ~Outline ()
 
Gtkmm2ext::Color outline_color () const
 
virtual void set_outline_color (Gtkmm2ext::Color)
 
Distance outline_width () const
 
virtual void set_outline_width (Distance)
 
bool outline () const
 
virtual void set_outline (bool)
 

Public Attributes

sigc::signal< void, uint8_t > SetNoteSelection
 
sigc::signal< void, uint8_t > AddNoteSelection
 
sigc::signal< void, uint8_t > ToggleNoteSelection
 
sigc::signal< void, uint8_t > ExtendNoteSelection
 
- Public Attributes inherited from ArdourCanvas::Item
sigc::signal1< bool, GdkEvent *, EventAccumulator< bool > > Event
 
bool _resize_queued
 
double _requested_width
 
double _requested_height
 

Private Types

enum  scr_pos { TOP , BOTTOM , MOVE , NONE }
 
enum  ItemType {
  BLACK_SEPARATOR , BLACK_MIDDLE_SEPARATOR , BLACK , WHITE_SEPARATOR ,
  WHITE_RECT , WHITE_CF , WHITE_EB , WHITE_DGA
}
 

Private Member Functions

void set_min_page_size (double page_size)
 
void render_scroomer (Cairo::RefPtr< Cairo::Context >) const
 
NoteName get_note_name (int note)
 
bool event_handler (GdkEvent *)
 
bool motion_handler (GdkEventMotion *)
 
bool button_press_handler (GdkEventButton *)
 
bool button_release_handler (GdkEventButton *)
 
bool scroll_handler (GdkEventScroll *)
 
bool enter_handler (GdkEventCrossing *)
 
bool leave_handler (GdkEventCrossing *)
 
void invalidate_note_range (int lowest, int highest)
 
void get_path (int note, double x[], double y[]) const
 
void send_note_on (uint8_t note)
 
void send_note_off (uint8_t note)
 
void reset_clicked_note (uint8_t, bool invalidate=true)
 
bool show_scroomer () const
 
void resize ()
 

Private Attributes

MidiViewBackground_midi_context
 
Gtk::Adjustment_adj
 
MidiView_view
 
uint8_t _event [3]
 
Glib::RefPtr< Pango::Layout > _layout
 
Glib::RefPtr< Pango::Layout > _big_c_layout
 
Glib::RefPtr< Pango::Layout > _midnam_layout
 
Pango::FontDescription _font_descript
 
Pango::FontDescription _font_descript_big_c
 
Pango::FontDescription _font_descript_midnam
 
bool _active_notes [128]
 
uint8_t _highlighted_note
 
uint8_t _clicked_note
 
double _grab_y
 
bool _dragging
 
double _scroomer_size
 
bool _scroomer_drag
 
double _old_y
 
double _fract
 
double _fract_top
 
double _min_page_size
 
scr_pos _scroomer_state
 
scr_pos _scroomer_button_state
 
double _saved_top_val
 
double _saved_bottom_val
 
bool _mini_map_display
 
bool entered
 
NoteName note_names [128]
 
bool have_note_names
 
PBD::ScopedConnection height_connection
 

Additional Inherited Members

- Public Types inherited from ArdourCanvas::Rectangle
enum  What {
  NOTHING = 0x0 , LEFT = 0x1 , RIGHT = 0x2 , TOP = 0x4 ,
  BOTTOM = 0x8 , ALL = LEFT|RIGHT|TOP|BOTTOM
}
 
- Public Types inherited from ArdourCanvas::Fill
typedef std::vector< std::pair< double, Gtkmm2ext::Color > > StopList
 
- Static Public Attributes inherited from ArdourCanvas::Item
static int default_items_per_cell
 
- Protected Member Functions inherited from ArdourCanvas::Item
void begin_change ()
 
void end_change ()
 
void begin_visual_change ()
 
void end_visual_change ()
 
void set_bbox_clean () const
 
void set_bbox_dirty () const
 
bool bbox_dirty () const
 
void invalidate_lut () const
 
void clear_items (bool with_delete)
 
void ensure_lut () const
 
void add_child_bounding_boxes (bool include_hidden=false) const
 
void render_children (Rect const &area, Cairo::RefPtr< Cairo::Context > context) const
 
void prepare_for_render_children (Rect const &area) const
 
Duple scroll_offset () const
 
- Protected Member Functions inherited from ArdourCanvas::Fill
void setup_fill_context (Cairo::RefPtr< Cairo::Context >) const
 
void setup_gradient_context (Cairo::RefPtr< Cairo::Context >, Rect const &, Duple const &) const
 
- Protected Member Functions inherited from ArdourCanvas::Outline
void setup_outline_context (Cairo::RefPtr< Cairo::Context >) const
 
- Protected Attributes inherited from ArdourCanvas::Rectangle
Rect _rect
 
- Protected Attributes inherited from ArdourCanvas::Item
Canvas_canvas
 
Item_parent
 
ScrollGroup_scroll_parent
 
Duple _position
 
bool _visible
 
Rect _pre_change_bounding_box
 
Rect _bounding_box
 
PackOptions _pack_options
 
Rect _allocation
 
bool _layout_sensitive
 
std::map< std::string, void * > _data
 
LookupTable_lut
 
std::list< Item * > _items
 
- Protected Attributes inherited from ArdourCanvas::Fill
Item_self
 
Gtkmm2ext::Color _fill_color
 
bool _fill
 
bool _transparent
 
StopList _stops
 
bool _vertical_gradient
 
Cairo::RefPtr< Cairo::Pattern > _pattern
 
- Protected Attributes inherited from ArdourCanvas::Outline
Item_self
 
Gtkmm2ext::Color _outline_color
 
Distance _outline_width
 
bool _outline
 

Detailed Description

Definition at line 41 of file prh.h.

Member Enumeration Documentation

◆ ItemType

Enumerator
BLACK_SEPARATOR 
BLACK_MIDDLE_SEPARATOR 
BLACK 
WHITE_SEPARATOR 
WHITE_RECT 
WHITE_CF 
WHITE_EB 
WHITE_DGA 

Definition at line 114 of file prh.h.

◆ scr_pos

Enumerator
TOP 
BOTTOM 
MOVE 
NONE 

Definition at line 84 of file prh.h.

Constructor & Destructor Documentation

◆ PianoRollHeader()

ArdourCanvas::PianoRollHeader::PianoRollHeader ( ArdourCanvas::Item parent,
MidiViewBackground  
)

Member Function Documentation

◆ button_press_handler()

bool ArdourCanvas::PianoRollHeader::button_press_handler ( GdkEventButton )
private

◆ button_release_handler()

bool ArdourCanvas::PianoRollHeader::button_release_handler ( GdkEventButton )
private

◆ enter_handler()

bool ArdourCanvas::PianoRollHeader::enter_handler ( GdkEventCrossing )
private

◆ event_handler()

bool ArdourCanvas::PianoRollHeader::event_handler ( GdkEvent )
private

◆ get_note_name()

NoteName ArdourCanvas::PianoRollHeader::get_note_name ( int  note)
private

◆ get_path()

void ArdourCanvas::PianoRollHeader::get_path ( int  note,
double  x[],
double  y[] 
) const
private

◆ instrument_info_change()

void ArdourCanvas::PianoRollHeader::instrument_info_change ( )

◆ invalidate_note_range()

void ArdourCanvas::PianoRollHeader::invalidate_note_range ( int  lowest,
int  highest 
)
private

◆ leave_handler()

bool ArdourCanvas::PianoRollHeader::leave_handler ( GdkEventCrossing )
private

◆ motion_handler()

bool ArdourCanvas::PianoRollHeader::motion_handler ( GdkEventMotion )
private

◆ note_range_changed()

void ArdourCanvas::PianoRollHeader::note_range_changed ( )

◆ render()

void ArdourCanvas::PianoRollHeader::render ( ArdourCanvas::Rect const &  area,
Cairo::RefPtr< Cairo::Context >   
) const
virtual

Render this item to a Cairo context.

Parameters
areaArea to draw, in window coordinates

Items must convert their own coordinates into window coordinates because Cairo is limited to a fixed point coordinate space that does not extend as far as the Ardour timeline. All rendering must be done using coordinates that do not exceed the (rough) limits of the canvas' window, to avoid odd errors within Cairo as it converts doubles into its fixed point format and then tesselates the results.

Implements ArdourCanvas::Item.

◆ render_scroomer()

void ArdourCanvas::PianoRollHeader::render_scroomer ( Cairo::RefPtr< Cairo::Context >  ) const
private

◆ reset_clicked_note()

void ArdourCanvas::PianoRollHeader::reset_clicked_note ( uint8_t  ,
bool  invalidate = true 
)
private

◆ resize()

void ArdourCanvas::PianoRollHeader::resize ( )
private

◆ scroll_handler()

bool ArdourCanvas::PianoRollHeader::scroll_handler ( GdkEventScroll )
private

◆ send_note_off()

void ArdourCanvas::PianoRollHeader::send_note_off ( uint8_t  note)
private

◆ send_note_on()

void ArdourCanvas::PianoRollHeader::send_note_on ( uint8_t  note)
private

◆ set_min_page_size()

void ArdourCanvas::PianoRollHeader::set_min_page_size ( double  page_size)
private

◆ set_note_highlight()

void ArdourCanvas::PianoRollHeader::set_note_highlight ( uint8_t  note)

◆ set_view()

void ArdourCanvas::PianoRollHeader::set_view ( MidiView )

◆ show_scroomer()

bool ArdourCanvas::PianoRollHeader::show_scroomer ( ) const
private

◆ size_request()

void ArdourCanvas::PianoRollHeader::size_request ( double &  w,
double &  h 
) const
virtual

Reimplemented from ArdourCanvas::Item.

Member Data Documentation

◆ _active_notes

bool ArdourCanvas::PianoRollHeader::_active_notes[128]
private

Definition at line 73 of file prh.h.

◆ _adj

Gtk::Adjustment& ArdourCanvas::PianoRollHeader::_adj
private

Definition at line 62 of file prh.h.

◆ _big_c_layout

Glib::RefPtr<Pango::Layout> ArdourCanvas::PianoRollHeader::_big_c_layout
mutableprivate

Definition at line 68 of file prh.h.

◆ _clicked_note

uint8_t ArdourCanvas::PianoRollHeader::_clicked_note
private

Definition at line 75 of file prh.h.

◆ _dragging

bool ArdourCanvas::PianoRollHeader::_dragging
private

Definition at line 77 of file prh.h.

◆ _event

uint8_t ArdourCanvas::PianoRollHeader::_event[3]
private

Definition at line 65 of file prh.h.

◆ _font_descript

Pango::FontDescription ArdourCanvas::PianoRollHeader::_font_descript
mutableprivate

Definition at line 70 of file prh.h.

◆ _font_descript_big_c

Pango::FontDescription ArdourCanvas::PianoRollHeader::_font_descript_big_c
private

Definition at line 71 of file prh.h.

◆ _font_descript_midnam

Pango::FontDescription ArdourCanvas::PianoRollHeader::_font_descript_midnam
mutableprivate

Definition at line 72 of file prh.h.

◆ _fract

double ArdourCanvas::PianoRollHeader::_fract
private

Definition at line 81 of file prh.h.

◆ _fract_top

double ArdourCanvas::PianoRollHeader::_fract_top
private

Definition at line 82 of file prh.h.

◆ _grab_y

double ArdourCanvas::PianoRollHeader::_grab_y
private

Definition at line 76 of file prh.h.

◆ _highlighted_note

uint8_t ArdourCanvas::PianoRollHeader::_highlighted_note
private

Definition at line 74 of file prh.h.

◆ _layout

Glib::RefPtr<Pango::Layout> ArdourCanvas::PianoRollHeader::_layout
mutableprivate

Definition at line 67 of file prh.h.

◆ _midi_context

MidiViewBackground& ArdourCanvas::PianoRollHeader::_midi_context
private

Definition at line 61 of file prh.h.

◆ _midnam_layout

Glib::RefPtr<Pango::Layout> ArdourCanvas::PianoRollHeader::_midnam_layout
mutableprivate

Definition at line 69 of file prh.h.

◆ _min_page_size

double ArdourCanvas::PianoRollHeader::_min_page_size
private

Definition at line 83 of file prh.h.

◆ _mini_map_display

bool ArdourCanvas::PianoRollHeader::_mini_map_display
mutableprivate

Definition at line 89 of file prh.h.

◆ _old_y

double ArdourCanvas::PianoRollHeader::_old_y
private

Definition at line 80 of file prh.h.

◆ _saved_bottom_val

double ArdourCanvas::PianoRollHeader::_saved_bottom_val
private

Definition at line 88 of file prh.h.

◆ _saved_top_val

double ArdourCanvas::PianoRollHeader::_saved_top_val
private

Definition at line 87 of file prh.h.

◆ _scroomer_button_state

scr_pos ArdourCanvas::PianoRollHeader::_scroomer_button_state
private

Definition at line 86 of file prh.h.

◆ _scroomer_drag

bool ArdourCanvas::PianoRollHeader::_scroomer_drag
private

Definition at line 79 of file prh.h.

◆ _scroomer_size

double ArdourCanvas::PianoRollHeader::_scroomer_size
mutableprivate

Definition at line 78 of file prh.h.

◆ _scroomer_state

scr_pos ArdourCanvas::PianoRollHeader::_scroomer_state
private

Definition at line 85 of file prh.h.

◆ _view

MidiView* ArdourCanvas::PianoRollHeader::_view
private

Definition at line 63 of file prh.h.

◆ AddNoteSelection

sigc::signal<void,uint8_t> ArdourCanvas::PianoRollHeader::AddNoteSelection

Definition at line 54 of file prh.h.

◆ entered

bool ArdourCanvas::PianoRollHeader::entered
private

Definition at line 90 of file prh.h.

◆ ExtendNoteSelection

sigc::signal<void,uint8_t> ArdourCanvas::PianoRollHeader::ExtendNoteSelection

Definition at line 56 of file prh.h.

◆ have_note_names

bool ArdourCanvas::PianoRollHeader::have_note_names
private

Definition at line 99 of file prh.h.

◆ height_connection

PBD::ScopedConnection ArdourCanvas::PianoRollHeader::height_connection
private

Definition at line 100 of file prh.h.

◆ note_names

NoteName ArdourCanvas::PianoRollHeader::note_names[128]
private

Definition at line 98 of file prh.h.

◆ SetNoteSelection

sigc::signal<void,uint8_t> ArdourCanvas::PianoRollHeader::SetNoteSelection

Definition at line 53 of file prh.h.

◆ ToggleNoteSelection

sigc::signal<void,uint8_t> ArdourCanvas::PianoRollHeader::ToggleNoteSelection

Definition at line 55 of file prh.h.


The documentation for this class was generated from the following file: