drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
PianoPalette Class Reference

The PianoPalette class. More...

#include <pianopalette.h>

Public Member Functions

 PianoPalette (const int id)
 PianoPalette::PianoPalette Constructor. More...
 
void resetColors ()
 PianoPalette::resetColors resets the colors to the standard values according to the palette policy identifier.
 
void retranslateStrings ()
 PianoPalette::retranslateStrings retranslates the names and description texts according to the palette policy.
 
int paletteId () const
 PianoPalette::paletteId palette policy. More...
 
int getNumColors () const
 PianoPalette::getNumColors palette policy colors size. More...
 
bool isHighLight () const
 PianoPalette::isHighLight palette function. More...
 
bool isBackground () const
 PianoPalette::isBackground palette function. More...
 
bool isForeground () const
 PianoPalette::isForeground palette function. More...
 
QString paletteName () const
 PianoPalette::paletteName palette policy name. More...
 
void setPaletteName (const QString &name)
 PianoPalette::setPaletteName changes the palette name. More...
 
QString paletteText () const
 PianoPalette::paletteText gets the palette description. More...
 
void setPaletteText (const QString &text)
 PianoPalette::setPaletteText changes the palette description. More...
 
QColor getColor (const int i) const
 PianoPalette::getColor gets a palette color. More...
 
void setColor (const int n, const QString &s, const QColor &c)
 PianoPalette::setColor changes a palette color. More...
 
void setColor (const int n, const QColor &c)
 PianoPalette::setColor changes a palette color. More...
 
QString getColorName (const int i) const
 PianoPalette::getColorName gets a palette color name. More...
 
void setColorName (const int n, const QString &s)
 PianoPalette::setColorName changes a palette color name. More...
 
void saveColors () const
 PianoPalette::saveColors stores the set of colors as persistent settings.
 
void loadColors ()
 PianoPalette::loadColors loads the set of colors from persistent settings.
 
bool operator== (const PianoPalette &other) const
 PianoPalette::operator == compares two palettes. More...
 
bool operator!= (const PianoPalette &other) const
 PianoPalette::operator != compares two palettes. More...
 

Static Public Attributes

static const QString QSTR_PALETTEPREFIX = QStringLiteral("Palette_")
 PianoPalette::QSTR_PALETTEPREFIX is the string prefix for all the settings stored as persisting settings.
 

Protected Member Functions

void initialize ()
 PianoPalette::initialize reserves and initializes space to store colors according to the palette policy identifier.
 
void resetPaletteSingle ()
 PianoPalette::resetPaletteSingle resets the colors to the standard values for the PAL_SINGLE palette policy.
 
void resetPaletteDouble ()
 PianoPalette::resetPaletteDouble resets the colors to the standard values for the PAL_DOUBLE palette policy.
 
void resetPaletteChannels ()
 PianoPalette::resetPaletteChannels resets the colors to the standard values for the PAL_CHANNELS palette policy.
 
void resetPaletteScale ()
 PianoPalette::resetPaletteScale resets the colors to the standard values for the PAL_SCALE palette policy.
 
void resetPaletteKeys ()
 PianoPalette::resetPaletteKeys resets the colors to the standard values for the PAL_KEYS palette policy.
 
void resetPaletteFont ()
 PianoPalette::resetPaletteFont resets the colors to the standard values for the PAL_FONT palette policy.
 
void retranslatePaletteSingle ()
 PianoPalette::retranslatePaletteSingle retranslates the color names for the PAL_SINGLE palette policy.
 
void retranslatePaletteDouble ()
 PianoPalette::retranslatePaletteDouble retranslates the color names for the PAL_DOUBLE palette policy.
 
void retranslatePaletteChannels ()
 PianoPalette::retranslatePaletteChannels retranslates the color names for the PAL_CHANNELS palette policy.
 
void retranslatePaletteScale ()
 PianoPalette::retranslatePaletteScale retranslates the color names for the PAL_SCALE palette policy.
 
void retranslatePaletteKeys ()
 PianoPalette::retranslatePaletteKeys retranslates the color names for the PAL_KEYS palette policy.
 
void retranslatePaletteFont ()
 PianoPalette::retranslatePaletteFont retranslates the color names for the PAL_FONT palette policy.
 

Friends

QDataStream & operator<< (QDataStream &stream, const PianoPalette &palette)
 Serialize a PianoPalette instance into a QDataStream. More...
 
QDataStream & operator>> (QDataStream &stream, PianoPalette &palette)
 Deserialize a PianoPalette instance from a QDataStream. More...
 

Detailed Description

The PianoPalette class.

PianoPalette represents a set of colors used to paint the PianoKeybd widgets

Examples
vpiano.cpp.

Definition at line 70 of file pianopalette.h.

Constructor & Destructor Documentation

◆ PianoPalette()

PianoPalette ( const int  id)
explicit

PianoPalette::PianoPalette Constructor.

Parameters
idThe Palette Policy identifier

Definition at line 43 of file pianopalette.cpp.

References PianoPalette::initialize(), PianoPalette::resetColors(), and PianoPalette::retranslateStrings().

Member Function Documentation

◆ getColor()

QColor getColor ( const int  i) const

PianoPalette::getColor gets a palette color.

Parameters
ithe color number
Returns
the color value

Definition at line 460 of file pianopalette.cpp.

◆ getColorName()

QString getColorName ( const int  i) const

PianoPalette::getColorName gets a palette color name.

Parameters
ithe color number
Returns
the color name

Definition at line 473 of file pianopalette.cpp.

◆ getNumColors()

int getNumColors ( ) const

PianoPalette::getNumColors palette policy colors size.

Returns
the number of colors represented by the palette

Definition at line 485 of file pianopalette.cpp.

◆ isBackground()

bool isBackground ( ) const

PianoPalette::isBackground palette function.

Returns
true if the palette is used for painting the keys background

Definition at line 389 of file pianopalette.cpp.

References drumstick::widgets::PAL_KEYS, and drumstick::widgets::PAL_SCALE.

◆ isForeground()

bool isForeground ( ) const

PianoPalette::isForeground palette function.

Returns
true if the palette is used to paint text over the keys

Definition at line 400 of file pianopalette.cpp.

References drumstick::widgets::PAL_FONT.

◆ isHighLight()

bool isHighLight ( ) const

PianoPalette::isHighLight palette function.

Returns
true if the palette is used for keys highlighting

Definition at line 376 of file pianopalette.cpp.

References drumstick::widgets::PAL_CHANNELS, drumstick::widgets::PAL_DOUBLE, drumstick::widgets::PAL_HISCALE, and drumstick::widgets::PAL_SINGLE.

◆ operator!=()

bool operator!= ( const PianoPalette other) const

PianoPalette::operator != compares two palettes.

Parameters
otheranother palette object
Returns
true if both palettes are different

Definition at line 584 of file pianopalette.cpp.

◆ operator==()

bool operator== ( const PianoPalette other) const

PianoPalette::operator == compares two palettes.

Parameters
otheranother palette object
Returns
true if both palettes are equal

Definition at line 572 of file pianopalette.cpp.

◆ paletteId()

int paletteId ( ) const

PianoPalette::paletteId palette policy.

Returns
the palette policy identifier

Definition at line 410 of file pianopalette.cpp.

◆ paletteName()

QString paletteName ( ) const

PianoPalette::paletteName palette policy name.

Returns
the name of the palette

Definition at line 495 of file pianopalette.cpp.

◆ paletteText()

QString paletteText ( ) const

PianoPalette::paletteText gets the palette description.

Returns
new description of the palette

Definition at line 517 of file pianopalette.cpp.

◆ setColor() [1/2]

void setColor ( const int  n,
const QColor &  c 
)

PianoPalette::setColor changes a palette color.

Parameters
nthe color number
cthe color value

Definition at line 436 of file pianopalette.cpp.

◆ setColor() [2/2]

void setColor ( const int  n,
const QString &  s,
const QColor &  c 
)

◆ setColorName()

void setColorName ( const int  n,
const QString &  s 
)

◆ setPaletteName()

void setPaletteName ( const QString &  name)

PianoPalette::setPaletteName changes the palette name.

Parameters
namenew name of the palette

Definition at line 505 of file pianopalette.cpp.

Referenced by PianoPalette::retranslateStrings().

◆ setPaletteText()

void setPaletteText ( const QString &  help)

PianoPalette::setPaletteText changes the palette description.

Parameters
helpnew palette description string

Definition at line 527 of file pianopalette.cpp.

Referenced by PianoPalette::retranslateStrings().

Friends And Related Function Documentation

◆ operator<<

QDataStream & operator<< ( QDataStream &  stream,
const PianoPalette palette 
)
friend

Serialize a PianoPalette instance into a QDataStream.

Parameters
streama QDataStream
paletteinstance
Returns
the QDataStream

Definition at line 595 of file pianopalette.cpp.

◆ operator>>

QDataStream & operator>> ( QDataStream &  stream,
PianoPalette palette 
)
friend

Deserialize a PianoPalette instance from a QDataStream.

Parameters
streama QDataStream
paletteinstance
Returns
the QDataStream

Definition at line 611 of file pianopalette.cpp.


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