hydrogen 1.2.3
LayerPreview Class Reference

#include <LayerPreview.h>

Inheritance diagram for LayerPreview:
WidgetWithScalableFont< 5, 6, 7 > Object< LayerPreview > EventListener Base

Public Slots

void onPreferencesChanged (H2Core::Preferences::Changes changes)
 

Public Member Functions

 LayerPreview (QWidget *pParent)
 
 ~LayerPreview ()
 
virtual void mouseMoveEvent (QMouseEvent *ev) override
 
virtual void mousePressEvent (QMouseEvent *ev) override
 
virtual void mouseReleaseEvent (QMouseEvent *ev) override
 
void paintEvent (QPaintEvent *ev) override
 
void set_selected_component (int SelectedComponent)
 
void setSelectedLayer (int nSelectedLayer)
 
void updateAll ()
 
- Public Member Functions inherited from Object< LayerPreview >
 Object ()
 
 Object (const Object< LayerPreview > &other)
 
- Public Member Functions inherited from Base
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 
virtual QString toQString (const QString &sPrefix="", bool bShort=true) const
 Formatted string version for debugging purposes.
 
- Public Member Functions inherited from EventListener
virtual ~EventListener ()
 
virtual void actionModeChangeEvent (int nValue)
 
virtual void bbtChangedEvent ()
 
virtual void driverChangedEvent ()
 
virtual void errorEvent (int nErrorCode)
 
virtual void gridCellToggledEvent ()
 
virtual void instrumentParametersChangedEvent (int nInstrumentNumber)
 
virtual void jacksessionEvent (int nValue)
 
virtual void jackTimebaseStateChangedEvent ()
 
virtual void jackTransportActivationEvent ()
 
virtual void loopModeActivationEvent ()
 
virtual void metronomeEvent (int nValue)
 
virtual void midiActivityEvent ()
 
virtual void midiMapChangedEvent ()
 
virtual void nextPatternsChangedEvent ()
 
virtual void nextShotEvent ()
 
virtual void noteOnEvent (int nInstrument)
 
virtual void patternEditorLockedEvent ()
 
virtual void patternModifiedEvent ()
 
virtual void playbackTrackChangedEvent ()
 
virtual void playingPatternsChangedEvent ()
 
virtual void playlistLoadSongEvent (int nIndex)
 
virtual void progressEvent (int nValue)
 
virtual void quitEvent (int nValue)
 
virtual void relocationEvent ()
 
virtual void selectedPatternChangedEvent ()
 
virtual void songModeActivationEvent ()
 
virtual void songModifiedEvent ()
 
virtual void songSizeChangedEvent ()
 
virtual void soundLibraryChangedEvent ()
 
virtual void stackedModeActivationEvent (int nValue)
 
virtual void stateChangedEvent (H2Core::AudioEngine::State state)
 
virtual void tempoChangedEvent (int nValue)
 
virtual void timelineActivationEvent ()
 
virtual void timelineUpdateEvent (int nValue)
 
virtual void undoRedoActionEvent (int nValue)
 
virtual void updatePreferencesEvent (int nValue)
 
virtual void XRunEvent ()
 

Private Member Functions

virtual void drumkitLoadedEvent () override
 
int getMidiVelocityFromRaw (const float raw)
 convert a raw velocity value (0.0 to 1.0) into a MIDI velocity value (0 to 127)
 
int getPointSizeButton () const
 Used to detect changed in the font.
 
virtual void selectedInstrumentChangedEvent () override
 
void showLayerEndVelocity (const std::shared_ptr< H2Core::InstrumentLayer > pLayer, const QMouseEvent *pEvent)
 display a layer's end velocity in a tooltip
 
void showLayerStartVelocity (const std::shared_ptr< H2Core::InstrumentLayer > pLayer, const QMouseEvent *pEvent)
 display a layer's start velocity in a tooltip
 
virtual void updateSongEvent (int) override
 

Private Attributes

bool m_bGrabLeft
 
bool m_bMouseGrab
 
int m_nSelectedComponent
 
int m_nSelectedLayer
 
std::shared_ptr< H2Core::Instrumentm_pInstrument
 
QPixmap m_speakerPixmap
 

Static Private Attributes

static const int m_nLayerHeight = 10
 

Additional Inherited Members

- Static Public Member Functions inherited from Base
static const char * _class_name ()
 return the class name
 
static QString base_clock (const QString &sMsg)
 Measures the current time and stores it in __last_clock.
 
static QString base_clock_in (const QString &sMsg)
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation !
 
static bool count_active ()
 
static int getAliveObjectCount ()
 
static object_map_t getObjectMap ()
 
static Loggerlogger ()
 return the logger instance
 
static int objects_count ()
 
static void printObjectMapDiff (object_map_t map)
 Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.
 
static void set_count (bool flag)
 enable/disable class instances counting
 
static void write_objects_map_to (std::ostream &out, object_map_t *map=nullptr)
 output the full objects map to a given ostream
 
static void write_objects_map_to_cerr ()
 output objects map to stderr
 
- Static Public Attributes inherited from Base
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 
- Protected Member Functions inherited from WidgetWithScalableFont< 5, 6, 7 >
constexpr int getPointSize (H2Core::FontTheme::FontSize fontSize) const
 
- Protected Member Functions inherited from Object< LayerPreview >
 ~Object ()
 
 Object ()
 
 Object (const Object< LayerPreview > &other)
 
- Protected Member Functions inherited from Base
 ~Base ()
 
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 
virtual QString toQString (const QString &sPrefix="", bool bShort=true) const
 Formatted string version for debugging purposes.
 
- Protected Member Functions inherited from EventListener
virtual ~EventListener ()
 
virtual void actionModeChangeEvent (int nValue)
 
virtual void bbtChangedEvent ()
 
virtual void driverChangedEvent ()
 
virtual void errorEvent (int nErrorCode)
 
virtual void gridCellToggledEvent ()
 
virtual void instrumentParametersChangedEvent (int nInstrumentNumber)
 
virtual void jacksessionEvent (int nValue)
 
virtual void jackTimebaseStateChangedEvent ()
 
virtual void jackTransportActivationEvent ()
 
virtual void loopModeActivationEvent ()
 
virtual void metronomeEvent (int nValue)
 
virtual void midiActivityEvent ()
 
virtual void midiMapChangedEvent ()
 
virtual void nextPatternsChangedEvent ()
 
virtual void nextShotEvent ()
 
virtual void noteOnEvent (int nInstrument)
 
virtual void patternEditorLockedEvent ()
 
virtual void patternModifiedEvent ()
 
virtual void playbackTrackChangedEvent ()
 
virtual void playingPatternsChangedEvent ()
 
virtual void playlistLoadSongEvent (int nIndex)
 
virtual void progressEvent (int nValue)
 
virtual void quitEvent (int nValue)
 
virtual void relocationEvent ()
 
virtual void selectedPatternChangedEvent ()
 
virtual void songModeActivationEvent ()
 
virtual void songModifiedEvent ()
 
virtual void songSizeChangedEvent ()
 
virtual void soundLibraryChangedEvent ()
 
virtual void stackedModeActivationEvent (int nValue)
 
virtual void stateChangedEvent (H2Core::AudioEngine::State state)
 
virtual void tempoChangedEvent (int nValue)
 
virtual void timelineActivationEvent ()
 
virtual void timelineUpdateEvent (int nValue)
 
virtual void undoRedoActionEvent (int nValue)
 
virtual void updatePreferencesEvent (int nValue)
 
virtual void XRunEvent ()
 
- Static Protected Member Functions inherited from Base
static void registerClass (const char *name, const atomic_obj_cpt_t *counters)
 
static const char * _class_name ()
 return the class name
 
static QString base_clock (const QString &sMsg)
 Measures the current time and stores it in __last_clock.
 
static QString base_clock_in (const QString &sMsg)
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation !
 
static bool count_active ()
 
static int getAliveObjectCount ()
 
static object_map_t getObjectMap ()
 
static Loggerlogger ()
 return the logger instance
 
static int objects_count ()
 
static void printObjectMapDiff (object_map_t map)
 Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.
 
static void set_count (bool flag)
 enable/disable class instances counting
 
static void write_objects_map_to (std::ostream &out, object_map_t *map=nullptr)
 output the full objects map to a given ostream
 
static void write_objects_map_to_cerr ()
 output objects map to stderr
 
- Static Protected Attributes inherited from Base
static bool __count = false
 should we count class instances
 
static timeval __last_clock = { 0, 0 }
 
static Logger__logger = nullptr
 
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 

Detailed Description

Definition at line 41 of file LayerPreview.h.

Constructor & Destructor Documentation

◆ LayerPreview()

LayerPreview ( QWidget * pParent)
explicit

Definition at line 44 of file LayerPreview.cpp.

◆ ~LayerPreview()

Definition at line 76 of file LayerPreview.cpp.

Member Function Documentation

◆ drumkitLoadedEvent()

void drumkitLoadedEvent ( )
overrideprivatevirtual

Reimplemented from EventListener.

Definition at line 203 of file LayerPreview.cpp.

◆ 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

Definition at line 442 of file LayerPreview.cpp.

◆ getPointSizeButton()

int getPointSizeButton ( ) const
private

Used to detect changed in the font.

Definition at line 469 of file LayerPreview.cpp.

◆ mouseMoveEvent()

void mouseMoveEvent ( QMouseEvent * ev)
overridevirtual

Definition at line 353 of file LayerPreview.cpp.

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent * ev)
overridevirtual

Definition at line 282 of file LayerPreview.cpp.

◆ mouseReleaseEvent()

void mouseReleaseEvent ( QMouseEvent * ev)
overridevirtual

Definition at line 249 of file LayerPreview.cpp.

◆ onPreferencesChanged

void onPreferencesChanged ( H2Core::Preferences::Changes changes)
slot

Definition at line 490 of file LayerPreview.cpp.

◆ paintEvent()

void paintEvent ( QPaintEvent * ev)
override

Definition at line 86 of file LayerPreview.cpp.

◆ selectedInstrumentChangedEvent()

void selectedInstrumentChangedEvent ( )
overrideprivatevirtual

Reimplemented from EventListener.

Definition at line 214 of file LayerPreview.cpp.

◆ set_selected_component()

void set_selected_component ( int SelectedComponent)

Definition at line 81 of file LayerPreview.cpp.

◆ setSelectedLayer()

void setSelectedLayer ( int nSelectedLayer)
inline

Definition at line 104 of file LayerPreview.h.

◆ showLayerEndVelocity()

void showLayerEndVelocity ( const std::shared_ptr< H2Core::InstrumentLayer > pLayer,
const QMouseEvent * pEvent )
private

display a layer's end velocity in a tooltip

Parameters
pLayerThe layer
pEventThe event carrying mouse position

Definition at line 458 of file LayerPreview.cpp.

◆ showLayerStartVelocity()

void showLayerStartVelocity ( const std::shared_ptr< H2Core::InstrumentLayer > pLayer,
const QMouseEvent * pEvent )
private

display a layer's start velocity in a tooltip

Parameters
pLayerThe layer
pEventThe event carrying mouse position

Definition at line 447 of file LayerPreview.cpp.

◆ updateAll()

void updateAll ( )

Definition at line 437 of file LayerPreview.cpp.

◆ updateSongEvent()

void updateSongEvent ( int nValue)
overrideprivatevirtual

Reimplemented from EventListener.

Definition at line 207 of file LayerPreview.cpp.

Field Documentation

◆ m_bGrabLeft

bool m_bGrabLeft
private

Definition at line 70 of file LayerPreview.h.

◆ m_bMouseGrab

bool m_bMouseGrab
private

Definition at line 69 of file LayerPreview.h.

◆ m_nLayerHeight

const int m_nLayerHeight = 10
staticprivate

Definition at line 64 of file LayerPreview.h.

◆ m_nSelectedComponent

int m_nSelectedComponent
private

Definition at line 68 of file LayerPreview.h.

◆ m_nSelectedLayer

int m_nSelectedLayer
private

Definition at line 67 of file LayerPreview.h.

◆ m_pInstrument

std::shared_ptr<H2Core::Instrument> m_pInstrument
private

Definition at line 66 of file LayerPreview.h.

◆ m_speakerPixmap

QPixmap m_speakerPixmap
private

Definition at line 65 of file LayerPreview.h.