hydrogen 1.2.3
InstrumentLine Class Reference

#include <PatternEditorInstrumentList.h>

Inheritance diagram for InstrumentLine:
PixmapWidget WidgetWithScalableFont< 8, 10, 12 > WidgetWithHighlightedList Object< PixmapWidget > Base

Public Slots

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

Public Member Functions

 InstrumentLine (QWidget *pParent)
 
int getNumber () const
 
void setMuted (bool isMuted)
 
void setName (const QString &sName)
 
void setNumber (int nIndex)
 
void setSamplesMissing (bool bSamplesMissing)
 
void setSelected (bool isSelected)
 
void setSoloed (bool soloed)
 
- Public Member Functions inherited from PixmapWidget
 PixmapWidget (QWidget *pParent)
 
 ~PixmapWidget ()
 
void setColor (const QColor &color)
 
void setPixmap (QString sPixmapPath, bool expand_horiz=false)
 
- Public Member Functions inherited from Object< PixmapWidget >
 Object ()
 
 Object (const Object< PixmapWidget > &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.
 

Static Public Attributes

static constexpr int m_nButtonWidth = 18
 
- Static Public Attributes inherited from Base
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 

Private Slots

void functionClearNotes ()
 
void functionCopyAllInstrumentPatterns ()
 
void functionCutNotesAllPatterns ()
 
void functionDeleteNotesAllPatterns ()
 
void functionFillAllNotes ()
 
void functionFillEveryEightNotes ()
 
void functionFillEveryFourNotes ()
 
void functionFillEverySixNotes ()
 
void functionFillEverySixteenNotes ()
 
void functionFillEveryThreeNotes ()
 
void functionFillEveryTwelveNotes ()
 
void functionFillEveryTwoNotes ()
 
void functionFillNotes (int every)
 
void functionPasteAllInstrumentPatterns ()
 
void functionRandomizeVelocity ()
 
void functionRenameInstrument ()
 
void muteClicked ()
 
void sampleWarningClicked ()
 
void selectInstrumentNotes ()
 
void soloClicked ()
 

Private Member Functions

virtual void enterEvent (QEvent *ev)
 
H2Core::PatterngetCurrentPattern ()
 
virtual void leaveEvent (QEvent *ev)
 
virtual void mouseDoubleClickEvent (QMouseEvent *ev) override
 
virtual void mousePressEvent (QMouseEvent *ev) override
 
virtual void paintEvent (QPaintEvent *ev) override
 
void setRowSelection (RowSelection rowSelection)
 
void updateStyleSheet ()
 

Private Attributes

bool m_bEntered
 Whether the cursor entered the boundary of the widget.
 
bool m_bIsSelected
 
int m_nInstrumentNumber
 The related instrument number.
 
QMenu * m_pFunctionPopup
 
QMenu * m_pFunctionPopupSub
 
Buttonm_pMuteBtn
 
QLabel * m_pNameLbl
 
Buttonm_pSampleWarning
 
Buttonm_pSoloBtn
 

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
 
- Protected Types inherited from WidgetWithHighlightedList
enum class  RowSelection { None , Popup , Dialog }
 Specifies whether the row corresponding to m_nRowClicked should be highlighted and determines the lifecycle of the highlighting. More...
 
- Protected Member Functions inherited from Object< PixmapWidget >
 ~Object ()
 
- Protected Member Functions inherited from Base
 ~Base ()
 
- Protected Member Functions inherited from WidgetWithScalableFont< 8, 10, 12 >
constexpr int getPointSize (H2Core::FontTheme::FontSize fontSize) const
 
- Protected Member Functions inherited from WidgetWithHighlightedList
 WidgetWithHighlightedList ()
 
- Static Protected Member Functions inherited from Base
static void registerClass (const char *name, const atomic_obj_cpt_t *counters)
 
- Protected Attributes inherited from PixmapWidget
QColor __color
 
bool __expand_horiz
 
QPixmap m_pixmap
 
QString m_sPixmapPath
 
- Protected Attributes inherited from WidgetWithHighlightedList
int m_nRowClicked
 Helper variable remembering for row was clicked last.
 
RowSelection m_rowSelection
 Determines the highlighting of the row associated with m_nRowClicked.
 
- 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
 

Detailed Description

Definition at line 50 of file PatternEditorInstrumentList.h.

Constructor & Destructor Documentation

◆ InstrumentLine()

InstrumentLine ( QWidget * pParent)
explicit

Definition at line 54 of file PatternEditorInstrumentList.cpp.

Member Function Documentation

◆ enterEvent()

void enterEvent ( QEvent * ev)
privatevirtual

Definition at line 200 of file PatternEditorInstrumentList.cpp.

◆ functionClearNotes

void functionClearNotes ( )
privateslot

Definition at line 425 of file PatternEditorInstrumentList.cpp.

◆ functionCopyAllInstrumentPatterns

void functionCopyAllInstrumentPatterns ( )
privateslot

Definition at line 457 of file PatternEditorInstrumentList.cpp.

◆ functionCutNotesAllPatterns

void functionCutNotesAllPatterns ( )
privateslot

Definition at line 540 of file PatternEditorInstrumentList.cpp.

◆ functionDeleteNotesAllPatterns

void functionDeleteNotesAllPatterns ( )
privateslot

Definition at line 512 of file PatternEditorInstrumentList.cpp.

◆ functionFillAllNotes

void functionFillAllNotes ( )
privateslot

Definition at line 547 of file PatternEditorInstrumentList.cpp.

◆ functionFillEveryEightNotes

void functionFillEveryEightNotes ( )
privateslot

Definition at line 552 of file PatternEditorInstrumentList.cpp.

◆ functionFillEveryFourNotes

void functionFillEveryFourNotes ( )
privateslot

Definition at line 550 of file PatternEditorInstrumentList.cpp.

◆ functionFillEverySixNotes

void functionFillEverySixNotes ( )
privateslot

Definition at line 551 of file PatternEditorInstrumentList.cpp.

◆ functionFillEverySixteenNotes

void functionFillEverySixteenNotes ( )
privateslot

Definition at line 554 of file PatternEditorInstrumentList.cpp.

◆ functionFillEveryThreeNotes

void functionFillEveryThreeNotes ( )
privateslot

Definition at line 549 of file PatternEditorInstrumentList.cpp.

◆ functionFillEveryTwelveNotes

void functionFillEveryTwelveNotes ( )
privateslot

Definition at line 553 of file PatternEditorInstrumentList.cpp.

◆ functionFillEveryTwoNotes

void functionFillEveryTwoNotes ( )
privateslot

Definition at line 548 of file PatternEditorInstrumentList.cpp.

◆ functionFillNotes

void functionFillNotes ( int every)
privateslot

Definition at line 556 of file PatternEditorInstrumentList.cpp.

◆ functionPasteAllInstrumentPatterns

void functionPasteAllInstrumentPatterns ( )
privateslot

Definition at line 480 of file PatternEditorInstrumentList.cpp.

◆ functionRandomizeVelocity

void functionRandomizeVelocity ( )
privateslot

Definition at line 614 of file PatternEditorInstrumentList.cpp.

◆ functionRenameInstrument

void functionRenameInstrument ( )
privateslot

Definition at line 676 of file PatternEditorInstrumentList.cpp.

◆ getCurrentPattern()

H2Core::Pattern * getCurrentPattern ( )
private

Definition at line 407 of file PatternEditorInstrumentList.cpp.

◆ getNumber()

int getNumber ( ) const
inline

Definition at line 124 of file PatternEditorInstrumentList.h.

◆ leaveEvent()

void leaveEvent ( QEvent * ev)
privatevirtual

Definition at line 206 of file PatternEditorInstrumentList.cpp.

◆ mouseDoubleClickEvent()

void mouseDoubleClickEvent ( QMouseEvent * ev)
overrideprivatevirtual

Definition at line 403 of file PatternEditorInstrumentList.cpp.

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent * ev)
overrideprivatevirtual

Definition at line 363 of file PatternEditorInstrumentList.cpp.

◆ muteClicked

void muteClicked ( )
privateslot

Definition at line 302 of file PatternEditorInstrumentList.cpp.

◆ onPreferencesChanged

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

Definition at line 712 of file PatternEditorInstrumentList.cpp.

◆ paintEvent()

void paintEvent ( QPaintEvent * ev)
overrideprivatevirtual

Reimplemented from PixmapWidget.

Definition at line 212 of file PatternEditorInstrumentList.cpp.

◆ sampleWarningClicked

void sampleWarningClicked ( )
privateslot

Definition at line 350 of file PatternEditorInstrumentList.cpp.

◆ selectInstrumentNotes

void selectInstrumentNotes ( )
privateslot

Definition at line 358 of file PatternEditorInstrumentList.cpp.

◆ setMuted()

void setMuted ( bool isMuted)

Definition at line 273 of file PatternEditorInstrumentList.cpp.

◆ setName()

void setName ( const QString & sName)

Definition at line 161 of file PatternEditorInstrumentList.cpp.

◆ setNumber()

void setNumber ( int nIndex)

Definition at line 263 of file PatternEditorInstrumentList.cpp.

◆ setRowSelection()

void setRowSelection ( RowSelection rowSelection)
private

Definition at line 153 of file PatternEditorInstrumentList.cpp.

◆ setSamplesMissing()

void setSamplesMissing ( bool bSamplesMissing)

Definition at line 291 of file PatternEditorInstrumentList.cpp.

◆ setSelected()

void setSelected ( bool isSelected)

Definition at line 170 of file PatternEditorInstrumentList.cpp.

◆ setSoloed()

void setSoloed ( bool soloed)

Definition at line 282 of file PatternEditorInstrumentList.cpp.

◆ soloClicked

void soloClicked ( )
privateslot

Definition at line 327 of file PatternEditorInstrumentList.cpp.

◆ updateStyleSheet()

void updateStyleSheet ( )
private

Definition at line 182 of file PatternEditorInstrumentList.cpp.

Field Documentation

◆ m_bEntered

bool m_bEntered
private

Whether the cursor entered the boundary of the widget.

Definition at line 121 of file PatternEditorInstrumentList.h.

◆ m_bIsSelected

bool m_bIsSelected
private

Definition at line 104 of file PatternEditorInstrumentList.h.

◆ m_nButtonWidth

constexpr int m_nButtonWidth = 18
staticconstexpr

Definition at line 69 of file PatternEditorInstrumentList.h.

◆ m_nInstrumentNumber

int m_nInstrumentNumber
private

The related instrument number.

Definition at line 105 of file PatternEditorInstrumentList.h.

◆ m_pFunctionPopup

QMenu* m_pFunctionPopup
private

Definition at line 101 of file PatternEditorInstrumentList.h.

◆ m_pFunctionPopupSub

QMenu* m_pFunctionPopupSub
private

Definition at line 102 of file PatternEditorInstrumentList.h.

◆ m_pMuteBtn

Button* m_pMuteBtn
private

Definition at line 106 of file PatternEditorInstrumentList.h.

◆ m_pNameLbl

QLabel* m_pNameLbl
private

Definition at line 103 of file PatternEditorInstrumentList.h.

◆ m_pSampleWarning

Button* m_pSampleWarning
private

Definition at line 108 of file PatternEditorInstrumentList.h.

◆ m_pSoloBtn

Button* m_pSoloBtn
private

Definition at line 107 of file PatternEditorInstrumentList.h.