Color mixer channels if they are made by a colored track (#5780)
Color mixer channels if they are made by a coloured track using the “Assign to new FX channel option.”
This commit is contained in:
@@ -73,7 +73,13 @@ class FxChannel : public ThreadableJob
|
||||
void unmuteForSolo();
|
||||
|
||||
|
||||
// TODO C++17 and above: use std::optional insteads
|
||||
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;
|
||||
|
||||
|
||||
@@ -418,11 +418,9 @@ void FxLine::setStrokeInnerInactive( const QColor & c )
|
||||
void FxLine::changeColor()
|
||||
{
|
||||
auto channel = Engine::fxMixer()->effectChannel( m_channelIndex );
|
||||
auto new_color = ColorChooser( this ).withPalette( ColorChooser::Palette::Mixer )->getColor( channel->m_color );
|
||||
if( ! new_color.isValid() )
|
||||
{ return; }
|
||||
channel->m_color = new_color;
|
||||
channel->m_hasColor = true;
|
||||
auto new_color = ColorChooser(this).withPalette(ColorChooser::Palette::Mixer)->getColor(channel->m_color);
|
||||
if(!new_color.isValid()) { return; }
|
||||
channel->setColor (new_color);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -439,7 +437,6 @@ void FxLine::resetColor()
|
||||
void FxLine::randomColor()
|
||||
{
|
||||
auto channel = Engine::fxMixer()->effectChannel( m_channelIndex );
|
||||
channel->m_color = ColorChooser::getPalette( ColorChooser::Palette::Mixer )[ rand() % 48 ];
|
||||
channel->m_hasColor = true;
|
||||
channel->setColor (ColorChooser::getPalette(ColorChooser::Palette::Mixer)[rand() % 48]);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -1098,8 +1098,10 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow()
|
||||
void InstrumentTrackView::createFxLine()
|
||||
{
|
||||
int channelIndex = gui->fxMixerView()->addNewChannel();
|
||||
auto channel = Engine::fxMixer()->effectChannel(channelIndex);
|
||||
|
||||
Engine::fxMixer()->effectChannel( channelIndex )->m_name = getTrack()->name();
|
||||
channel->m_name = getTrack()->name();
|
||||
if (getTrack()->useColor()) { channel->setColor (getTrack()->color()); }
|
||||
|
||||
assignFxLine(channelIndex);
|
||||
}
|
||||
|
||||
@@ -1169,8 +1169,10 @@ void SampleTrackWindow::modelChanged()
|
||||
void SampleTrackView::createFxLine()
|
||||
{
|
||||
int channelIndex = gui->fxMixerView()->addNewChannel();
|
||||
auto channel = Engine::fxMixer()->effectChannel(channelIndex);
|
||||
|
||||
Engine::fxMixer()->effectChannel(channelIndex)->m_name = getTrack()->name();
|
||||
channel->m_name = getTrack()->name();
|
||||
if (getTrack()->useColor()) { channel->setColor (getTrack()->color()); }
|
||||
|
||||
assignFxLine(channelIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user