|
|
The DisplayParams class holds data related to how a TSE3 object should be drawn on the screen by some application that uses the TSE3 library.
This is perhaps unusual for a pure 'sequencer engine' library, however it is a useful piece of application support. It also ensures that different applications based on TSE3 will display Song data in a relatively similar manner (as deemed appropriate).
Obviously, TSE3 does not use these display values itself (since it does no displaying whatsoever). An application is not required to use the information in this class; however for inter-application constency it is encouraged.
The classes that contain a DisplayParams object are:
The Part's DisplayParams are considered to 'override' that of it's Phrase.
The DisplayParams object allows an object to be displayed in a number of different states (see the DrawingStyle enum type). For some of these states the DisplayParams object holds extra information (for example a specific colour).
Use the following command classes to manipute this object in a undo/redo environment.
DisplayParams ()
| DisplayParams |
The default DisplayParams has the DrawingStyle None (but the colour() set to white, and presetColour() set to Verse).
DisplayParams (const DisplayParams &)
| DisplayParams |
~DisplayParams ()
| ~DisplayParams |
[virtual]
DisplayParams & operator= (const DisplayParams &)
| operator= |
Reimplemented from Notifier.
enum DrawingStyle { Default, PresetColour, Colour, None } | DrawingStyle |
Enum type describing how colour should be displayed.
The values are:
Default
Do whatever the default for this displayable
object is. Usually this will be the same as
None - some default system drawing style will
be used. Default may allow a colour to be
used, for example when a Part is set to
Default but its Phrase is set to
UseColour.
PresetColour
Display the object using the preset colour
defined by this DisplayParams object (see
presetColour())
Colour
Display the object using the colour defined
by this DisplayParams object (see colour()).
None
Force no colour to be used, and the object to
be displayed with some system default drawing
style.
enum PresetColours { Intro, Verse, Chorus, Bridge, Coda, Refrain, Melody, Solo, Backing, Brass, Percussion, Drums, Guitar, Bass, Flute, Strings, Keyboard, Piano, Saxophone, NoPresetColours } | PresetColours |
As enum type describing a number of preset 'global' colours. The user may choose to display a DisplayParams object with a specific colour (see setColour()) or use a global colour from this list.
The PresetColours object provides a central definiton of the colour rgb values.
The final anum value (NoPresetColours
) is not a valid value
but a descrition of the number of PresetColours available.
const char * presetColourString (int pc)
| presetColourString |
[static]
Returns a string containing a English representation of the specified PresetColours value.
Parameters:
pc | PresetColours value to get string for |
Returns: String represeting pc
int style ()
| style |
Returns the drawing style of this displayable object.
The value is defined by the DrawingStyle enum type.
Returns: Whether to use to r, g, b values
See also: setStyle, colour, DrawingStyle
void setStyle (int s)
| setStyle |
Sets the draing style of this displayable object. The value is defined by the DrawingStyle enum type.
See also: style
int presetColour ()
| presetColour |
[const]
Returns the selected preset colour in the reference parameters. The colour is defined by the PresetColours enum type.
This describes the colour used when in the PresetColour style().
Note that although you can specify both a presetColour and a colour, only one of them (or possibly neither) will be used at any once time, as specified by the style() method.
Returns: Current preset colour
See also: setPresetColour
void setPresetColour (int pc)
| setPresetColour |
Sets the preset colour value.
Parameters:
pc | New preset colour |
See also: presetColour
void colour (int &r, int &g, int &b)
| colour |
Returns the selected colour in the reference parameters. The colour is returned as RGB values, each between 0-255.
This is the colour used when in the Colour style().
Note that although you can specify both a presetColour and a colour, only one of them (or possibly neither) will be used at any once time, as specified by the style() method.
Parameters:
r | Integer the blue value is returned in (0-255) |
g | Integer the green value is returned in (0-255) |
b | Integer the red value is returned in (0-255) |
See also: setColour
void setColour (int r, int g, int b)
| setColour |
Sets the colour value.
Parameters:
r | New blue value (0-255) |
g | New green value (0-255) |
b | New red value (0-255) |
See also: colour
void save (std::ostream &o, int i)
| save |
[const virtual]
Reimplemented from Serializable for internal purposes..
void load (std::istream &in, SerializableLoadInfo &info)
| load |
[virtual]
Reimplemented from Serializable for internal purposes..