hydrogen 1.1.1
LayerPreview Class Reference

#include <LayerPreview.h>

Inheritance diagram for LayerPreview:
Object EventListener

Public Member Functions

 LayerPreview (QWidget *pParent)
 
 ~LayerPreview ()
 
void updateAll ()
 
void paintEvent (QPaintEvent *ev) override
 
virtual void mousePressEvent (QMouseEvent *ev) override
 
virtual void mouseReleaseEvent (QMouseEvent *ev) override
 
virtual void mouseMoveEvent (QMouseEvent *ev) override
 
void set_selected_component (int SelectedComponent)
 
- Public Member Functions inherited from Object
 ~Object ()
 destructor More...
 
 Object (const Object &obj)
 copy constructor More...
 
 Object (const char *class_name)
 constructor More...
 
const char * class_name () const
 return the class name More...
 
virtual QString toQString (const QString &sPrefix, bool bShort=true) const
 Formatted string version for debugging purposes. More...
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG. More...
 
- Public Member Functions inherited from EventListener
virtual void stateChangedEvent (int nState)
 
virtual void patternChangedEvent ()
 
virtual void patternModifiedEvent ()
 
virtual void songModifiedEvent ()
 
virtual void selectedPatternChangedEvent ()
 
virtual void selectedInstrumentChangedEvent ()
 
virtual void parametersInstrumentChangedEvent ()
 
virtual void midiActivityEvent ()
 
virtual void noteOnEvent (int nInstrument)
 
virtual void XRunEvent ()
 
virtual void errorEvent (int nErrorCode)
 
virtual void metronomeEvent (int nValue)
 
virtual void rubberbandbpmchangeEvent ()
 
virtual void progressEvent (int nValue)
 
virtual void jacksessionEvent (int nValue)
 
virtual void playlistLoadSongEvent (int nIndex)
 
virtual void undoRedoActionEvent (int nValue)
 
virtual void tempoChangedEvent (int nValue)
 
virtual void updateSongEvent (int nValue)
 
virtual void quitEvent (int nValue)
 
virtual void timelineActivationEvent (int nValue)
 
virtual void timelineUpdateEvent (int nValue)
 
virtual void jackTransportActivationEvent (int nValue)
 
virtual void jackTimebaseActivationEvent (int nValue)
 
virtual void songModeActivationEvent (int nValue)
 
virtual void loopModeActivationEvent (int nValue)
 
virtual void updatePreferencesEvent (int nValue)
 
virtual void actionModeChangeEvent (int nValue)
 
virtual ~EventListener ()
 

Private Member Functions

int getMidiVelocityFromRaw (const float raw)
 convert a raw velocity value (0.0 to 1.0) into a MIDI velocity value (0 to 127) More...
 
void showLayerStartVelocity (const InstrumentLayer *pLayer, const QMouseEvent *pEvent)
 display a layer's start velocity in a tooltip More...
 
void showLayerEndVelocity (const InstrumentLayer *pLayer, const QMouseEvent *pEvent)
 display a layer's end velocity in a tooltip More...
 
virtual void selectedInstrumentChangedEvent () override
 

Private Attributes

QPixmap m_speakerPixmap
 
H2Core::Instrumentm_pInstrument
 
int m_nSelectedLayer
 
int m_nSelectedComponent
 
bool m_bMouseGrab
 
bool m_bGrabLeft
 

Static Private Attributes

static const int m_nLayerHeight = 10
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void set_count (bool flag)
 enable/disable class instances counting More...
 
static bool count_active ()
 return true if class instances counting is enabled More...
 
static unsigned objects_count ()
 return the number of objects More...
 
static void write_objects_map_to (std::ostream &out)
 output the full objects map to a given ostream More...
 
static void write_objects_map_to_cerr ()
 output objects map to stderr More...
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation ! More...
 
static Loggerlogger ()
 return the logger instance More...
 
- Static Public Attributes inherited from Object
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes. More...
 
- Static Protected Attributes inherited from Object
static Logger__logger = nullptr
 logger instance pointer More...
 

Constructor & Destructor Documentation

◆ LayerPreview()

LayerPreview ( QWidget *  pParent)
explicit

◆ ~LayerPreview()

Member Function Documentation

◆ getMidiVelocityFromRaw()

int getMidiVelocityFromRaw ( const float  raw)
private

convert a raw velocity value (0.0 to 1.0) into a MIDI velocity value (0 to 127)

Parameters
rawRaw velocity value
Returns
MIDI velocity value

◆ mouseMoveEvent()

void mouseMoveEvent ( QMouseEvent *  ev)
overridevirtual

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent *  ev)
overridevirtual

◆ mouseReleaseEvent()

void mouseReleaseEvent ( QMouseEvent *  ev)
overridevirtual

◆ paintEvent()

void paintEvent ( QPaintEvent *  ev)
override

◆ selectedInstrumentChangedEvent()

void selectedInstrumentChangedEvent ( )
overrideprivatevirtual

Reimplemented from EventListener.

◆ set_selected_component()

void set_selected_component ( int  SelectedComponent)

◆ showLayerEndVelocity()

void showLayerEndVelocity ( const InstrumentLayer pLayer,
const QMouseEvent *  pEvent 
)
private

display a layer's end velocity in a tooltip

Parameters
pLayerThe layer
pEventThe event carrying mouse position

◆ showLayerStartVelocity()

void showLayerStartVelocity ( const InstrumentLayer pLayer,
const QMouseEvent *  pEvent 
)
private

display a layer's start velocity in a tooltip

Parameters
pLayerThe layer
pEventThe event carrying mouse position

◆ updateAll()

void updateAll ( )

Field Documentation

◆ m_bGrabLeft

bool m_bGrabLeft
private

◆ m_bMouseGrab

bool m_bMouseGrab
private

◆ m_nLayerHeight

const int m_nLayerHeight = 10
staticprivate

◆ m_nSelectedComponent

int m_nSelectedComponent
private

◆ m_nSelectedLayer

int m_nSelectedLayer
private

◆ m_pInstrument

H2Core::Instrument* m_pInstrument
private

◆ m_speakerPixmap

QPixmap m_speakerPixmap
private