MythTV  master
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
Piano Class Reference

#include <visualize.h>

Inheritance diagram for Piano:
Inheritance graph
[legend]
Collaboration diagram for Piano:
Collaboration graph
[legend]

Classes

struct  piano_key_data
 

Public Member Functions

 Piano ()
 
 ~Piano () override
 
void resize (const QSize &size) override
 
bool process (VisualNode *node) override
 
bool processUndisplayed (VisualNode *node) override
 
unsigned long getDesiredSamples (void) override
 
bool draw (QPainter *p, const QColor &back=Qt::black) override
 
void handleKeyPress (const QString &action) override
 
- Public Member Functions inherited from VisualBase
 VisualBase (bool screensaverenable=false)
 
virtual ~VisualBase (void)
 
virtual int getDesiredFPS (void)
 

Protected Member Functions

bool process_all_types (VisualNode *node, bool this_will_be_displayed)
 
void zero_analysis (void)
 

Static Protected Member Functions

static double clamp (double cur, double max, double min)
 

Protected Attributes

QColor m_whiteStartColor {245,245,245}
 
QColor m_whiteTargetColor {Qt::red}
 
QColor m_blackStartColor {10,10,10}
 
QColor m_blackTargetColor {Qt::red}
 
std::vector< QRect > m_rects {}
 
QSize m_size
 
std::chrono::milliseconds m_offsetProcessed {0ms}
 
piano_key_datam_pianoData {nullptr}
 
piano_audiom_audioData {nullptr}
 
std::vector< double > m_magnitude {}
 
- Protected Attributes inherited from VisualBase
int m_fps {20}
 
bool m_xscreensaverenable {true}
 

Static Private Attributes

static constexpr unsigned long kPianoAudioSize { 4096 }
 
static constexpr unsigned int kPianoNumKeys { 88 }
 
static constexpr double kPianoRmsNegligible { .001 }
 
static constexpr double kPianoSpectrumSmoothing { 0.95 }
 
static constexpr goertzel_data kPianoMinVol { -10 }
 
static constexpr double kPianoKeypressTooLight { .2 }
 

Additional Inherited Members

- Static Public Member Functions inherited from VisualBase
static void drawWarning (QPainter *p, const QColor &back, QSize size, const QString &warning, int fontsize=28)
 

Detailed Description

Definition at line 215 of file visualize.h.

Constructor & Destructor Documentation

◆ Piano()

Piano::Piano ( )

Definition at line 905 of file visualize.cpp.

◆ ~Piano()

Piano::~Piano ( )
override

Definition at line 951 of file visualize.cpp.

Member Function Documentation

◆ resize()

void Piano::resize ( const QSize &  size)
overridevirtual

Implements VisualBase.

Definition at line 975 of file visualize.cpp.

◆ process()

bool Piano::process ( VisualNode node)
overridevirtual

Implements VisualBase.

Definition at line 1071 of file visualize.cpp.

◆ processUndisplayed()

bool Piano::processUndisplayed ( VisualNode node)
overridevirtual

Reimplemented from VisualBase.

Definition at line 1065 of file visualize.cpp.

◆ getDesiredSamples()

unsigned long Piano::getDesiredSamples ( void  )
overridevirtual

Reimplemented from VisualBase.

Definition at line 1055 of file visualize.cpp.

◆ draw()

bool Piano::draw ( QPainter *  p,
const QColor &  back = Qt::black 
)
overridevirtual

Implements VisualBase.

Definition at line 1217 of file visualize.cpp.

◆ handleKeyPress()

void Piano::handleKeyPress ( const QString &  action)
inlineoverridevirtual

Implements VisualBase.

Definition at line 258 of file visualize.h.

◆ clamp()

double Piano::clamp ( double  cur,
double  max,
double  min 
)
inlinestaticprotected

Definition at line 1208 of file visualize.cpp.

Referenced by draw().

◆ process_all_types()

bool Piano::process_all_types ( VisualNode node,
bool  this_will_be_displayed 
)
protected

Definition at line 1079 of file visualize.cpp.

Referenced by process(), and processUndisplayed().

◆ zero_analysis()

void Piano::zero_analysis ( void  )
protected

Definition at line 959 of file visualize.cpp.

Referenced by Piano(), process_all_types(), and resize().

Member Data Documentation

◆ kPianoAudioSize

constexpr unsigned long Piano::kPianoAudioSize { 4096 }
staticconstexprprivate

Definition at line 221 of file visualize.h.

Referenced by getDesiredSamples(), and Piano().

◆ kPianoNumKeys

constexpr unsigned int Piano::kPianoNumKeys { 88 }
staticconstexprprivate

Definition at line 222 of file visualize.h.

Referenced by draw(), Piano(), process_all_types(), resize(), and zero_analysis().

◆ kPianoRmsNegligible

constexpr double Piano::kPianoRmsNegligible { .001 }
staticconstexprprivate

Definition at line 227 of file visualize.h.

Referenced by draw(), and zero_analysis().

◆ kPianoSpectrumSmoothing

constexpr double Piano::kPianoSpectrumSmoothing { 0.95 }
staticconstexprprivate

Definition at line 228 of file visualize.h.

Referenced by draw().

◆ kPianoMinVol

constexpr goertzel_data Piano::kPianoMinVol { -10 }
staticconstexprprivate

Definition at line 229 of file visualize.h.

Referenced by process_all_types().

◆ kPianoKeypressTooLight

constexpr double Piano::kPianoKeypressTooLight { .2 }
staticconstexprprivate

Definition at line 230 of file visualize.h.

Referenced by draw().

◆ m_whiteStartColor

QColor Piano::m_whiteStartColor {245,245,245}
protected

Definition at line 266 of file visualize.h.

Referenced by draw().

◆ m_whiteTargetColor

QColor Piano::m_whiteTargetColor {Qt::red}
protected

Definition at line 267 of file visualize.h.

Referenced by draw().

◆ m_blackStartColor

QColor Piano::m_blackStartColor {10,10,10}
protected

Definition at line 268 of file visualize.h.

Referenced by draw().

◆ m_blackTargetColor

QColor Piano::m_blackTargetColor {Qt::red}
protected

Definition at line 269 of file visualize.h.

Referenced by draw().

◆ m_rects

std::vector<QRect> Piano::m_rects {}
protected

Definition at line 271 of file visualize.h.

Referenced by draw(), and resize().

◆ m_size

QSize Piano::m_size
protected

Definition at line 272 of file visualize.h.

Referenced by draw(), and resize().

◆ m_offsetProcessed

std::chrono::milliseconds Piano::m_offsetProcessed {0ms}
protected

Definition at line 274 of file visualize.h.

Referenced by process_all_types(), and zero_analysis().

◆ m_pianoData

piano_key_data* Piano::m_pianoData {nullptr}
protected

Definition at line 276 of file visualize.h.

Referenced by draw(), Piano(), process_all_types(), resize(), zero_analysis(), and ~Piano().

◆ m_audioData

piano_audio* Piano::m_audioData {nullptr}
protected

Definition at line 277 of file visualize.h.

Referenced by Piano(), process_all_types(), and ~Piano().

◆ m_magnitude

std::vector<double> Piano::m_magnitude {}
protected

Definition at line 279 of file visualize.h.

Referenced by draw(), and resize().


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