GMListPianoRoll:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMListPianoRoll
ExtensionExtension

A simple pianoroll for creating graphical interfaces, with limited functionalities

Description

GMListPianoRoll displays a simple configurable pianoroll.

It is however limited compared to other pianoroll implementations : it can be viewed as a 2D checkbox, which manipulates a List, allowing to fill its indices with predefined values. This means that it does not have a time representation, and as such, it is not possible to offset the position of an item on the grid, and it is not possible to stretch the size of an item on the grid (like one would do to increase the sustain of a note).

One must provide a list of entries that can be checked and unchecked on every beat of the grid. Each index of the values List will contain every checked item, or be equal to nil if no entry has been checked.

The size of the grid is determined by both entries and values sizes. Please not that the first entry corresponds to the row on the bottom of the grid, and the last entry correspodns to the topmost row.

It is possible to highlight cases on both horizontal and vertical axis, and to highlight the current beat using a Routine (seee example below).

Class Methods

.new

Creates a new instance of GMListPianoRoll.

Its graphical properties are defined by its associated GMStyle.

Returns:

a GMListPianoRoll instance.

Instance Methods

.action

Sets or gets the Function that will be evaluated when the GMListPianoRoll has been interacted with. The arguments passed to the function depend on the actionMode.

.actionMode

Sets or gets which arguments are passed to the action's Function when the GMListPianoRoll has been interacted with. If set to \values, the whole values List will be passed as argument. If set to \index, the index of the modified value and the new value will be passed as arguments.

.values

Sets or gets the pianoroll values. Takes a Collection containing collections, or nil as argument. The size of the collection determines the horizontal size of the pianoroll (i.e. the number of beats).

.entries

Sets or gets the available pianoroll entries. Takes a Collection as argument. The size of the collection determines the vertical size of the pianoroll.

.beat

Sets or gets the displayed beat. Set to -1 to disable. This will internally defer the graphical update.

.highlights

Sets or gets the policy that highlights columns. Takes an Array containing floats between 0 and 1, that should be the size of the values. The closer the highlight is to 1, the more opaque the highlight will be.

.drawHighlights

Sets or gets wether the horizontal highlights should be displayed.

.vHighlights

Sets or gets the policy that highlights rows. Takes an Array containing floats between 0 and 1, that should be the size of the entries. The closer the highlight is to 1, the more opaque the highlight will be.

.drawVHighlights

Sets or gets wether the vertical highlights should be displayed.

.gridColor

Sets or gets the grid color.

.gridWidth

Sets or gets the grid width.

.boxRatio

Sets or gets the ratio of the checkbox relative to the case size where it is displayed. Valid values are between 0 and 1.

.allowMouseMoveAction

Sets or gets whether the widget should respond to mouse move action when it is being pressed.

Internal Methods

.draw

.prUpdateValues

.prDrawValues

.prDrawHighlights

.prDrawVHighlights

.prDrawGrid

.prDrawBeat

Examples