77 setWindowTitle ( tr (
"Director" ) );
85 m_Color = pPref->getColorTheme()->m_accentColor;
102 if(ev->key() == Qt::Key_Escape) {
119 auto pSong = pHydrogen->getSong();
120 if ( pSong ==
nullptr ) {
128 QStringList list = pSong->getFilename().split(
"/");
130 if ( !list.isEmpty() ){
153 auto pTimeline = pHydrogen->getTimeline();
154 auto pSong = pHydrogen->getSong();
156 if ( pSong ==
nullptr ) {
160 const int nColumns = pSong->getPatternGroupVector()->size();
162 bool bRequiresUpdate =
false;
164 if (
m_nBar == nColumns ) {
166 m_sTagNext != pTimeline->getTagAtColumn( 0 ) ) {
172 bRequiresUpdate =
true;
178 bRequiresUpdate =
true;
183 bRequiresUpdate =
true;
186 return bRequiresUpdate;
195 m_pTimer->start(
static_cast<int>( 1000 / ( pPos->getBpm() / 60 )) / 2 );
202 m_Color = pPref->getColorTheme()->m_buttonRedColor;
208 m_Color = pPref->getColorTheme()->m_accentColor;
225 const QString sFontFamily = pPref->getApplicationFontFamily();
229 auto shrinkTillItFits = [&]( QFont* pFont,
const QRect& rect,
const QString& sLabel ) {
230 if ( sLabel.isEmpty() ) {
234 while ( ( QFontMetrics( *pFont ).size( Qt::TextSingleLine, sLabel ).width() >
236 pFont->pointSize() > 1 ) {
237 pFont->setPointSize( pFont->pointSize() - 1 );
259 m_rectSongName = QRect( QPoint( width() * 5/100 , height () * 2/100 ),
260 QSize( width() * 90/100, height() * 21/100) );
262 QSize( width() * 90/100, height() * 14/100) );
263 m_rectTagNext = QRect( QPoint( width() * 5/100 , height() * 83/100 ),
264 QSize( width() * 90/100, height() * 11/100) );
274 QDialog::resizeEvent( ev );
280 QPainter painter(
this);
283 const QString sFontFamily = pPref->getApplicationFontFamily();
291 painter.setPen( QPen( pPref->getColorTheme()->m_highlightColor, 1 , Qt::SolidLine ) );
293 painter.drawRect(
m_nFlashingArea, height() * 25/100, width() * 42.5/100,
298 QColor textColor = pPref->getColorTheme()->m_windowTextColor;
299 painter.setPen( textColor );
300 painter.setFont(QFont( sFontFamily, height() * 25/100 ));
301 QRect r1(QPoint( width() * 5/100 , height() * 25/100 ), QSize( width() * 42.5/100, height() * 35/100));
302 painter.drawText( r1, Qt::AlignCenter, QString(
"%1").arg(
m_nBar) );
305 QRect r2(QPoint( width() * 52.5/100 , height() * 25/100 ), QSize( width() * 42.5/100, height() * 35/100));
306 painter.drawText( r2, Qt::AlignCenter, QString(
"%1").arg(
m_nBeat) );
virtual void timelineUpdateEvent(int nValue) override
virtual void paintEvent(QPaintEvent *) override
void updateMetronomBackground()
Director(QWidget *pParent)
void onPreferencesChanged(H2Core::Preferences::Changes changes)
virtual void closeEvent(QCloseEvent *ev) override
virtual void updateSongEvent(int nValue) override
virtual void keyPressEvent(QKeyEvent *ev) override
virtual void tempoChangedEvent(int nValue) override
void resizeEvent(QResizeEvent *event) override
void updateLabelContainers()
void updateFontSize(FontUpdate update)
virtual void bbtChangedEvent() override
const std::shared_ptr< TransportPosition > getTransportPosition() const
static const QString songs_ext
static Hydrogen * get_instance()
Returns the current Hydrogen instance __instance.
AudioEngine * getAudioEngine() const
static Preferences * get_instance()
Returns a pointer to the current Preferences singleton stored in __instance.
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
@ Font
Either the font size or font family have changed.
@ Colors
At least one of the colors has changed.
void addEventListener(EventListener *pListener)
static HydrogenApp * get_instance()
Returns the instance of HydrogenApp class.
static QColor makeTextColorInactive(QColor color)
If a widget is marked inactive the value of its text color are reduced by this factor.