drumstick 2.0.0
PianoPalette Class Reference

The PianoPalette class. More...

#include <pianopalette.h>

Public Member Functions

 PianoPalette (const int id)
 PianoPalette::PianoPalette Constructor.
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.
int getNumColors () const
 PianoPalette::getNumColors palette policy colors size.
bool isHighLight () const
 PianoPalette::isHighLight palette function.
bool isBackground () const
 PianoPalette::isBackground palette function.
bool isForeground () const
 PianoPalette::isForeground palette function.
QString paletteName () const
 PianoPalette::paletteName palette policy name.
void setPaletteName (const QString &name)
 PianoPalette::setPaletteName changes the palette name.
QString paletteText () const
 PianoPalette::paletteText gets the palette description.
void setPaletteText (const QString &text)
 PianoPalette::setPaletteText changes the palette description.
QColor getColor (const int i) const
 PianoPalette::getColor gets a palette color.
void setColor (const int n, const QString &s, const QColor &c)
 PianoPalette::setColor changes a palette color.
void setColor (const int n, const QColor &c)
 PianoPalette::setColor changes a palette color.
QString getColorName (const int i) const
 PianoPalette::getColorName gets a palette color name.
void setColorName (const int n, const QString &s)
 PianoPalette::setColorName changes a palette color name.
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.
bool operator!= (const PianoPalette &other) const
 PianoPalette::operator != compares two palettes.

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.

Detailed Description

The PianoPalette class.

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

Examples
vpiano.cpp.

Definition at line 59 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 initialize(), resetColors(), and retranslateStrings().

Referenced by operator!=(), and operator==().

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 445 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 458 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 470 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 375 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 385 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 365 of file pianopalette.cpp.

References drumstick::widgets::PAL_CHANNELS, drumstick::widgets::PAL_DOUBLE, 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 569 of file pianopalette.cpp.

References PianoPalette().

◆ 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 557 of file pianopalette.cpp.

References PianoPalette().

◆ paletteId()

int paletteId ( ) const

PianoPalette::paletteId palette policy.

Returns
the palette policy identifier

Definition at line 395 of file pianopalette.cpp.

◆ paletteName()

QString paletteName ( ) const

PianoPalette::paletteName palette policy name.

Returns
the name of the palette

Definition at line 480 of file pianopalette.cpp.

◆ paletteText()

QString paletteText ( ) const

PianoPalette::paletteText gets the palette description.

Returns
new description of the palette

Definition at line 502 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 421 of file pianopalette.cpp.

◆ setColor() [2/2]

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

PianoPalette::setColor changes a palette color.

Parameters
nthe color number
sthe color name
cthe color value

Definition at line 407 of file pianopalette.cpp.

Referenced by loadColors(), resetPaletteChannels(), resetPaletteDouble(), resetPaletteFont(), resetPaletteKeys(), resetPaletteScale(), and resetPaletteSingle().

◆ setColorName()

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

PianoPalette::setColorName changes a palette color name.

Parameters
nthe color number
sthe color name

Definition at line 433 of file pianopalette.cpp.

Referenced by retranslatePaletteChannels(), retranslatePaletteDouble(), retranslatePaletteFont(), retranslatePaletteKeys(), retranslatePaletteScale(), and retranslatePaletteSingle().

◆ setPaletteName()

void setPaletteName ( const QString & name)

PianoPalette::setPaletteName changes the palette name.

Parameters
namenew name of the palette

Definition at line 490 of file pianopalette.cpp.

Referenced by retranslateStrings().

◆ setPaletteText()

void setPaletteText ( const QString & help)

PianoPalette::setPaletteText changes the palette description.

Parameters
helpnew palette description string

Definition at line 512 of file pianopalette.cpp.

Referenced by retranslateStrings().


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