Keep master bus color on FX Mixer when switching project

Fixes #6398
This commit is contained in:
Bernhard
2023-11-13 12:37:28 +01:00
committed by GitHub
parent ecc5ff8ca7
commit 609c008a71
5 changed files with 19 additions and 27 deletions

View File

@@ -31,7 +31,7 @@
#include "ThreadableJob.h"
#include <atomic>
#include <optional>
#include <QColor>
namespace lmms
@@ -76,18 +76,13 @@ class MixerChannel : public ThreadableJob
bool requiresProcessing() const override { return true; }
void unmuteForSolo();
void setColor (QColor newColor)
{
m_color = newColor;
m_hasColor = true;
}
// TODO C++17 and above: use std::optional instead
QColor m_color;
bool m_hasColor;
std::optional<QColor> m_color;
std::atomic_int m_dependenciesMet;
void incrementDeps();
void processed();

View File

@@ -32,6 +32,7 @@
#include "AutomatableModel.h"
#include "JournallingObject.h"
#include "lmms_basics.h"
#include <optional>
namespace lmms
@@ -191,11 +192,11 @@ public:
QColor color()
{
return m_color;
return m_color.value();
}
bool useColor()
{
return m_hasColor;
return m_color.has_value();
}
bool isMutedBeforeSolo() const
@@ -241,8 +242,7 @@ private:
QMutex m_processingLock;
QColor m_color;
bool m_hasColor;
std::optional<QColor> m_color;
friend class gui::TrackView;