Rename FxMixer to Mixer (#6239)

... as decided in #6089 and #5592.

This PR replaces every occurrence of "FX" where "Mixer Channel" is meant.
This commit is contained in:
Yashraj Shinde
2022-01-09 12:45:23 +05:30
committed by GitHub
parent 54fff4ff23
commit bf323d2024
281 changed files with 2816 additions and 2788 deletions

View File

@@ -30,7 +30,7 @@
#include "AudioEngineWorkerThread.h"
#include "AudioPort.h"
#include "FxMixer.h"
#include "Mixer.h"
#include "Song.h"
#include "EnvelopeAndLfoParameters.h"
#include "NotePlayHandle.h"
@@ -367,8 +367,8 @@ const surroundSampleFrame * AudioEngine::renderNextBuffer()
swapBuffers();
// prepare master mix (clear internal buffers etc.)
FxMixer * fxMixer = Engine::fxMixer();
fxMixer->prepareMasterMix();
Mixer * mixer = Engine::mixer();
mixer->prepareMasterMix();
handleMetronome();
@@ -419,8 +419,8 @@ const surroundSampleFrame * AudioEngine::renderNextBuffer()
AudioEngineWorkerThread::startAndWaitForJobs();
// STAGE 3: do master mix in FX mixer
fxMixer->masterMix(m_outputBufferWrite);
// STAGE 3: do master mix in mixer
mixer->masterMix(m_outputBufferWrite);
emit nextAudioBuffer(m_outputBufferRead);

View File

@@ -24,7 +24,7 @@ set(LMMS_SRCS
core/Engine.cpp
core/EnvelopeAndLfoParameters.cpp
core/fft_helpers.cpp
core/FxMixer.cpp
core/Mixer.cpp
core/ImportFilter.cpp
core/InlineAutomation.cpp
core/Instrument.cpp

View File

@@ -70,7 +70,8 @@ const std::vector<DataFile::UpgradeMethod> DataFile::UPGRADE_METHODS = {
&DataFile::upgrade_1_1_91 , &DataFile::upgrade_1_2_0_rc3,
&DataFile::upgrade_1_3_0 , &DataFile::upgrade_noHiddenClipNames,
&DataFile::upgrade_automationNodes , &DataFile::upgrade_extendedNoteRange,
&DataFile::upgrade_defaultTripleOscillatorHQ
&DataFile::upgrade_defaultTripleOscillatorHQ,
&DataFile::upgrade_mixerRename
};
// Vector of all versions that have upgrade routines.
@@ -1759,6 +1760,36 @@ void DataFile::upgrade_defaultTripleOscillatorHQ()
}
// Remove FX prefix from mixer and related nodes
void DataFile::upgrade_mixerRename()
{
// Change nodename <fxmixer> to <mixer>
QDomNodeList fxmixer = elementsByTagName("fxmixer");
for (int i = 0; !fxmixer.item(i).isNull(); ++i)
{
fxmixer.item(i).toElement().setTagName("mixer");
}
// Change nodename <fxchannel> to <mixerchannel>
QDomNodeList fxchannel = elementsByTagName("fxchannel");
for (int i = 0; !fxchannel.item(i).isNull(); ++i)
{
fxchannel.item(i).toElement().setTagName("mixerchannel");
}
// Change the attribute fxch of element <instrumenttrack> to mixch
QDomNodeList fxch = elementsByTagName("instrumenttrack");
for(int i = 0; !fxch.item(i).isNull(); ++i)
{
if(fxch.item(i).toElement().hasAttribute("fxch"))
{
fxch.item(i).toElement().setAttribute("mixch", fxch.item(i).toElement().attribute("fxch"));
fxch.item(i).toElement().removeAttribute("fxch");
}
}
}
void DataFile::upgrade()
{
// Runs all necessary upgrade methods

View File

@@ -27,7 +27,7 @@
#include "AudioEngine.h"
#include "BBTrackContainer.h"
#include "ConfigManager.h"
#include "FxMixer.h"
#include "Mixer.h"
#include "Ladspa2LMMS.h"
#include "Lv2Manager.h"
#include "Plugin.h"
@@ -39,7 +39,7 @@
float LmmsCore::s_framesPerTick;
AudioEngine* LmmsCore::s_audioEngine = nullptr;
FxMixer * LmmsCore::s_fxMixer = nullptr;
Mixer * LmmsCore::s_mixer = nullptr;
BBTrackContainer * LmmsCore::s_bbTrackContainer = nullptr;
Song * LmmsCore::s_song = nullptr;
ProjectJournal * LmmsCore::s_projectJournal = nullptr;
@@ -66,7 +66,7 @@ void LmmsCore::init( bool renderOnly )
s_projectJournal = new ProjectJournal;
s_audioEngine = new AudioEngine( renderOnly );
s_song = new Song;
s_fxMixer = new FxMixer;
s_mixer = new Mixer;
s_bbTrackContainer = new BBTrackContainer;
#ifdef LMMS_HAVE_LV2
@@ -100,7 +100,7 @@ void LmmsCore::destroy()
deleteHelper( &s_bbTrackContainer );
deleteHelper( &s_fxMixer );
deleteHelper( &s_mixer );
deleteHelper( &s_audioEngine );
#ifdef LMMS_HAVE_LV2

View File

@@ -1,5 +1,5 @@
/*
* FxMixer.cpp - effect mixer for LMMS
* Mixer.cpp - effect mixer for LMMS
*
* Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -27,7 +27,7 @@
#include "AudioEngine.h"
#include "AudioEngineWorkerThread.h"
#include "BufferManager.h"
#include "FxMixer.h"
#include "Mixer.h"
#include "MixHelpers.h"
#include "Song.h"
@@ -36,7 +36,7 @@
#include "BBTrackContainer.h"
#include "TrackContainer.h" // For TrackContainer::TrackList typedef
FxRoute::FxRoute( FxChannel * from, FxChannel * to, float amount ) :
MixerRoute::MixerRoute( MixerChannel * from, MixerChannel * to, float amount ) :
m_from( from ),
m_to( to ),
m_amount( amount, 0, 1, 0.001, nullptr,
@@ -47,19 +47,19 @@ FxRoute::FxRoute( FxChannel * from, FxChannel * to, float amount ) :
}
FxRoute::~FxRoute()
MixerRoute::~MixerRoute()
{
}
void FxRoute::updateName()
void MixerRoute::updateName()
{
m_amount.setDisplayName(
tr( "Amount to send from channel %1 to channel %2" ).arg( m_from->m_channelIndex ).arg( m_to->m_channelIndex ) );
}
FxChannel::FxChannel( int idx, Model * _parent ) :
MixerChannel::MixerChannel( int idx, Model * _parent ) :
m_fxChain( nullptr ),
m_hasInput( false ),
m_stillRunning( false ),
@@ -82,15 +82,15 @@ FxChannel::FxChannel( int idx, Model * _parent ) :
FxChannel::~FxChannel()
MixerChannel::~MixerChannel()
{
delete[] m_buffer;
}
inline void FxChannel::processed()
inline void MixerChannel::processed()
{
for( const FxRoute * receiverRoute : m_sends )
for( const MixerRoute * receiverRoute : m_sends )
{
if( receiverRoute->receiver()->m_muted == false )
{
@@ -99,7 +99,7 @@ inline void FxChannel::processed()
}
}
void FxChannel::incrementDeps()
void MixerChannel::incrementDeps()
{
int i = m_dependenciesMet++ + 1;
if( i >= m_receives.size() && ! m_queued )
@@ -109,7 +109,7 @@ void FxChannel::incrementDeps()
}
}
void FxChannel::unmuteForSolo()
void MixerChannel::unmuteForSolo()
{
//TODO: Recursively activate every channel, this channel sends to
m_muteModel.setValue(false);
@@ -117,15 +117,15 @@ void FxChannel::unmuteForSolo()
void FxChannel::doProcessing()
void MixerChannel::doProcessing()
{
const fpp_t fpp = Engine::audioEngine()->framesPerPeriod();
if( m_muted == false )
{
for( FxRoute * senderRoute : m_receives )
for( MixerRoute * senderRoute : m_receives )
{
FxChannel * sender = senderRoute->sender();
MixerChannel * sender = senderRoute->sender();
FloatModel * sendModel = senderRoute->amount();
if( ! sendModel ) qFatal( "Error: no send model found from %d to %d", senderRoute->senderIndex(), m_channelIndex );
@@ -188,10 +188,10 @@ void FxChannel::doProcessing()
FxMixer::FxMixer() :
Mixer::Mixer() :
Model( nullptr ),
JournallingObject(),
m_fxChannels()
m_mixerChannels()
{
// create master channel
createChannel();
@@ -200,27 +200,27 @@ FxMixer::FxMixer() :
FxMixer::~FxMixer()
Mixer::~Mixer()
{
while( ! m_fxRoutes.isEmpty() )
while( ! m_mixerRoutes.isEmpty() )
{
deleteChannelSend( m_fxRoutes.first() );
deleteChannelSend( m_mixerRoutes.first() );
}
while( m_fxChannels.size() )
while( m_mixerChannels.size() )
{
FxChannel * f = m_fxChannels[m_fxChannels.size() - 1];
m_fxChannels.pop_back();
MixerChannel * f = m_mixerChannels[m_mixerChannels.size() - 1];
m_mixerChannels.pop_back();
delete f;
}
}
int FxMixer::createChannel()
int Mixer::createChannel()
{
const int index = m_fxChannels.size();
const int index = m_mixerChannels.size();
// create new channel
m_fxChannels.push_back( new FxChannel( index, this ) );
m_mixerChannels.push_back( new MixerChannel( index, this ) );
// reset channel state
clearChannel( index );
@@ -228,36 +228,36 @@ int FxMixer::createChannel()
return index;
}
void FxMixer::activateSolo()
void Mixer::activateSolo()
{
for (int i = 1; i < m_fxChannels.size(); ++i)
for (int i = 1; i < m_mixerChannels.size(); ++i)
{
m_fxChannels[i]->m_muteBeforeSolo = m_fxChannels[i]->m_muteModel.value();
m_fxChannels[i]->m_muteModel.setValue( true );
m_mixerChannels[i]->m_muteBeforeSolo = m_mixerChannels[i]->m_muteModel.value();
m_mixerChannels[i]->m_muteModel.setValue( true );
}
}
void FxMixer::deactivateSolo()
void Mixer::deactivateSolo()
{
for (int i = 1; i < m_fxChannels.size(); ++i)
for (int i = 1; i < m_mixerChannels.size(); ++i)
{
m_fxChannels[i]->m_muteModel.setValue( m_fxChannels[i]->m_muteBeforeSolo );
m_mixerChannels[i]->m_muteModel.setValue( m_mixerChannels[i]->m_muteBeforeSolo );
}
}
void FxMixer::toggledSolo()
void Mixer::toggledSolo()
{
int soloedChan = -1;
bool resetSolo = m_lastSoloed != -1;
//untoggle if lastsoloed is entered
if (resetSolo)
{
m_fxChannels[m_lastSoloed]->m_soloModel.setValue( false );
m_mixerChannels[m_lastSoloed]->m_soloModel.setValue( false );
}
//determine the soloed channel
for (int i = 0; i < m_fxChannels.size(); ++i)
for (int i = 0; i < m_mixerChannels.size(); ++i)
{
if (m_fxChannels[i]->m_soloModel.value() == true)
if (m_mixerChannels[i]->m_soloModel.value() == true)
soloedChan = i;
}
// if no channel is soloed, unmute everything, else mute everything
@@ -271,7 +271,7 @@ void FxMixer::toggledSolo()
activateSolo();
}
// unmute the soloed chan and every channel it sends to
m_fxChannels[soloedChan]->unmuteForSolo();
m_mixerChannels[soloedChan]->unmuteForSolo();
} else {
deactivateSolo();
}
@@ -280,7 +280,7 @@ void FxMixer::toggledSolo()
void FxMixer::deleteChannel( int index )
void Mixer::deleteChannel( int index )
{
// channel deletion is performed between mixer rounds
Engine::audioEngine()->requestChangeInModel();
@@ -295,38 +295,38 @@ void FxMixer::deleteChannel( int index )
if( t->type() == Track::InstrumentTrack )
{
InstrumentTrack* inst = dynamic_cast<InstrumentTrack *>( t );
int val = inst->effectChannelModel()->value(0);
int val = inst->mixerChannelModel()->value(0);
if( val == index )
{
// we are deleting this track's fx send
// we are deleting this track's channel send
// send to master
inst->effectChannelModel()->setValue(0);
inst->mixerChannelModel()->setValue(0);
}
else if( val > index )
{
// subtract 1 to make up for the missing channel
inst->effectChannelModel()->setValue(val-1);
inst->mixerChannelModel()->setValue(val-1);
}
}
else if( t->type() == Track::SampleTrack )
{
SampleTrack* strk = dynamic_cast<SampleTrack *>( t );
int val = strk->effectChannelModel()->value(0);
int val = strk->mixerChannelModel()->value(0);
if( val == index )
{
// we are deleting this track's fx send
// we are deleting this track's channel send
// send to master
strk->effectChannelModel()->setValue(0);
strk->mixerChannelModel()->setValue(0);
}
else if( val > index )
{
// subtract 1 to make up for the missing channel
strk->effectChannelModel()->setValue(val-1);
strk->mixerChannelModel()->setValue(val-1);
}
}
}
FxChannel * ch = m_fxChannels[index];
MixerChannel * ch = m_mixerChannels[index];
// delete all of this channel's sends and receives
while( ! ch->m_sends.isEmpty() )
@@ -344,22 +344,22 @@ void FxMixer::deleteChannel( int index )
else if (m_lastSoloed > index) { --m_lastSoloed; }
// actually delete the channel
m_fxChannels.remove(index);
m_mixerChannels.remove(index);
delete ch;
for( int i = index; i < m_fxChannels.size(); ++i )
for( int i = index; i < m_mixerChannels.size(); ++i )
{
validateChannelName( i, i + 1 );
// set correct channel index
m_fxChannels[i]->m_channelIndex = i;
m_mixerChannels[i]->m_channelIndex = i;
// now check all routes and update names of the send models
for( FxRoute * r : m_fxChannels[i]->m_sends )
for( MixerRoute * r : m_mixerChannels[i]->m_sends )
{
r->updateName();
}
for( FxRoute * r : m_fxChannels[i]->m_receives )
for( MixerRoute * r : m_mixerChannels[i]->m_receives )
{
r->updateName();
}
@@ -370,10 +370,10 @@ void FxMixer::deleteChannel( int index )
void FxMixer::moveChannelLeft( int index )
void Mixer::moveChannelLeft( int index )
{
// can't move master or first channel
if( index <= 1 || index >= m_fxChannels.size() )
if( index <= 1 || index >= m_mixerChannels.size() )
{
return;
}
@@ -397,56 +397,56 @@ void FxMixer::moveChannelLeft( int index )
if( trackList[i]->type() == Track::InstrumentTrack )
{
InstrumentTrack * inst = (InstrumentTrack *) trackList[i];
int val = inst->effectChannelModel()->value(0);
int val = inst->mixerChannelModel()->value(0);
if( val == a )
{
inst->effectChannelModel()->setValue(b);
inst->mixerChannelModel()->setValue(b);
}
else if( val == b )
{
inst->effectChannelModel()->setValue(a);
inst->mixerChannelModel()->setValue(a);
}
}
else if( trackList[i]->type() == Track::SampleTrack )
{
SampleTrack * strk = (SampleTrack *) trackList[i];
int val = strk->effectChannelModel()->value(0);
int val = strk->mixerChannelModel()->value(0);
if( val == a )
{
strk->effectChannelModel()->setValue(b);
strk->mixerChannelModel()->setValue(b);
}
else if( val == b )
{
strk->effectChannelModel()->setValue(a);
strk->mixerChannelModel()->setValue(a);
}
}
}
}
// Swap positions in array
qSwap(m_fxChannels[index], m_fxChannels[index - 1]);
qSwap(m_mixerChannels[index], m_mixerChannels[index - 1]);
// Update m_channelIndex of both channels
m_fxChannels[index]->m_channelIndex = index;
m_fxChannels[index - 1]->m_channelIndex = index -1;
m_mixerChannels[index]->m_channelIndex = index;
m_mixerChannels[index - 1]->m_channelIndex = index -1;
}
void FxMixer::moveChannelRight( int index )
void Mixer::moveChannelRight( int index )
{
moveChannelLeft( index + 1 );
}
FxRoute * FxMixer::createChannelSend( fx_ch_t fromChannel, fx_ch_t toChannel,
MixerRoute * Mixer::createChannelSend( mix_ch_t fromChannel, mix_ch_t toChannel,
float amount )
{
// qDebug( "requested: %d to %d", fromChannel, toChannel );
// find the existing connection
FxChannel * from = m_fxChannels[fromChannel];
FxChannel * to = m_fxChannels[toChannel];
MixerChannel * from = m_mixerChannels[fromChannel];
MixerChannel * to = m_mixerChannels[toChannel];
for( int i=0; i<from->m_sends.size(); ++i )
{
@@ -463,14 +463,14 @@ FxRoute * FxMixer::createChannelSend( fx_ch_t fromChannel, fx_ch_t toChannel,
}
FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount )
MixerRoute * Mixer::createRoute( MixerChannel * from, MixerChannel * to, float amount )
{
if( from == to )
{
return nullptr;
}
Engine::audioEngine()->requestChangeInModel();
FxRoute * route = new FxRoute( from, to, amount );
MixerRoute * route = new MixerRoute( from, to, amount );
// add us to from's sends
from->m_sends.append( route );
@@ -478,8 +478,8 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount )
// add us to to's receives
to->m_receives.append( route );
// add us to fxmixer's list
Engine::fxMixer()->m_fxRoutes.append( route );
// add us to mixer's list
Engine::mixer()->m_mixerRoutes.append( route );
Engine::audioEngine()->doneChangeInModel();
return route;
@@ -487,11 +487,11 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount )
// delete the connection made by createChannelSend
void FxMixer::deleteChannelSend( fx_ch_t fromChannel, fx_ch_t toChannel )
void Mixer::deleteChannelSend( mix_ch_t fromChannel, mix_ch_t toChannel )
{
// delete the send
FxChannel * from = m_fxChannels[fromChannel];
FxChannel * to = m_fxChannels[toChannel];
MixerChannel * from = m_mixerChannels[fromChannel];
MixerChannel * to = m_mixerChannels[toChannel];
// find and delete the send entry
for( int i = 0; i < from->m_sends.size(); ++i )
@@ -505,34 +505,34 @@ void FxMixer::deleteChannelSend( fx_ch_t fromChannel, fx_ch_t toChannel )
}
void FxMixer::deleteChannelSend( FxRoute * route )
void Mixer::deleteChannelSend( MixerRoute * route )
{
Engine::audioEngine()->requestChangeInModel();
// remove us from from's sends
route->sender()->m_sends.remove( route->sender()->m_sends.indexOf( route ) );
// remove us from to's receives
route->receiver()->m_receives.remove( route->receiver()->m_receives.indexOf( route ) );
// remove us from fxmixer's list
Engine::fxMixer()->m_fxRoutes.remove( Engine::fxMixer()->m_fxRoutes.indexOf( route ) );
// remove us from mixer's list
Engine::mixer()->m_mixerRoutes.remove( Engine::mixer()->m_mixerRoutes.indexOf( route ) );
delete route;
Engine::audioEngine()->doneChangeInModel();
}
bool FxMixer::isInfiniteLoop( fx_ch_t sendFrom, fx_ch_t sendTo )
bool Mixer::isInfiniteLoop( mix_ch_t sendFrom, mix_ch_t sendTo )
{
if( sendFrom == sendTo ) return true;
FxChannel * from = m_fxChannels[sendFrom];
FxChannel * to = m_fxChannels[sendTo];
MixerChannel * from = m_mixerChannels[sendFrom];
MixerChannel * to = m_mixerChannels[sendTo];
bool b = checkInfiniteLoop( from, to );
return b;
}
bool FxMixer::checkInfiniteLoop( FxChannel * from, FxChannel * to )
bool Mixer::checkInfiniteLoop( MixerChannel * from, MixerChannel * to )
{
// can't send master to anything
if( from == m_fxChannels[0] )
if( from == m_mixerChannels[0] )
{
return true;
}
@@ -558,16 +558,16 @@ bool FxMixer::checkInfiniteLoop( FxChannel * from, FxChannel * to )
// how much does fromChannel send its output to the input of toChannel?
FloatModel * FxMixer::channelSendModel( fx_ch_t fromChannel, fx_ch_t toChannel )
FloatModel * Mixer::channelSendModel( mix_ch_t fromChannel, mix_ch_t toChannel )
{
if( fromChannel == toChannel )
{
return nullptr;
}
const FxChannel * from = m_fxChannels[fromChannel];
const FxChannel * to = m_fxChannels[toChannel];
const MixerChannel * from = m_mixerChannels[fromChannel];
const MixerChannel * to = m_mixerChannels[toChannel];
for( FxRoute * route : from->m_sends )
for( MixerRoute * route : from->m_sends )
{
if( route->receiver() == to )
{
@@ -580,29 +580,29 @@ FloatModel * FxMixer::channelSendModel( fx_ch_t fromChannel, fx_ch_t toChannel )
void FxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch )
void Mixer::mixToChannel( const sampleFrame * _buf, mix_ch_t _ch )
{
if( m_fxChannels[_ch]->m_muteModel.value() == false )
if( m_mixerChannels[_ch]->m_muteModel.value() == false )
{
m_fxChannels[_ch]->m_lock.lock();
MixHelpers::add( m_fxChannels[_ch]->m_buffer, _buf, Engine::audioEngine()->framesPerPeriod() );
m_fxChannels[_ch]->m_hasInput = true;
m_fxChannels[_ch]->m_lock.unlock();
m_mixerChannels[_ch]->m_lock.lock();
MixHelpers::add( m_mixerChannels[_ch]->m_buffer, _buf, Engine::audioEngine()->framesPerPeriod() );
m_mixerChannels[_ch]->m_hasInput = true;
m_mixerChannels[_ch]->m_lock.unlock();
}
}
void FxMixer::prepareMasterMix()
void Mixer::prepareMasterMix()
{
BufferManager::clear( m_fxChannels[0]->m_buffer,
BufferManager::clear( m_mixerChannels[0]->m_buffer,
Engine::audioEngine()->framesPerPeriod() );
}
void FxMixer::masterMix( sampleFrame * _buf )
void Mixer::masterMix( sampleFrame * _buf )
{
const int fpp = Engine::audioEngine()->framesPerPeriod();
@@ -614,7 +614,7 @@ void FxMixer::masterMix( sampleFrame * _buf )
// about their senders, and can just increment the deps of their
// recipients right away.
AudioEngineWorkerThread::resetJobQueue( AudioEngineWorkerThread::JobQueue::Dynamic );
for( FxChannel * ch : m_fxChannels )
for( MixerChannel * ch : m_mixerChannels )
{
ch->m_muted = ch->m_muteModel.value();
if( ch->m_muted ) // instantly "process" muted channels
@@ -628,10 +628,10 @@ void FxMixer::masterMix( sampleFrame * _buf )
AudioEngineWorkerThread::addJob( ch );
}
}
while (m_fxChannels[0]->state() != ThreadableJob::ProcessingState::Done)
while (m_mixerChannels[0]->state() != ThreadableJob::ProcessingState::Done)
{
bool found = false;
for( FxChannel * ch : m_fxChannels )
for( MixerChannel * ch : m_mixerChannels )
{
const auto s = ch->state();
if (s == ThreadableJob::ProcessingState::Queued
@@ -649,42 +649,42 @@ void FxMixer::masterMix( sampleFrame * _buf )
}
// handle sample-exact data in master volume fader
ValueBuffer * volBuf = m_fxChannels[0]->m_volumeModel.valueBuffer();
ValueBuffer * volBuf = m_mixerChannels[0]->m_volumeModel.valueBuffer();
if( volBuf )
{
for( int f = 0; f < fpp; f++ )
{
m_fxChannels[0]->m_buffer[f][0] *= volBuf->values()[f];
m_fxChannels[0]->m_buffer[f][1] *= volBuf->values()[f];
m_mixerChannels[0]->m_buffer[f][0] *= volBuf->values()[f];
m_mixerChannels[0]->m_buffer[f][1] *= volBuf->values()[f];
}
}
const float v = volBuf
? 1.0f
: m_fxChannels[0]->m_volumeModel.value();
MixHelpers::addSanitizedMultiplied( _buf, m_fxChannels[0]->m_buffer, v, fpp );
: m_mixerChannels[0]->m_volumeModel.value();
MixHelpers::addSanitizedMultiplied( _buf, m_mixerChannels[0]->m_buffer, v, fpp );
// clear all channel buffers and
// reset channel process state
for( int i = 0; i < numChannels(); ++i)
{
BufferManager::clear( m_fxChannels[i]->m_buffer,
BufferManager::clear( m_mixerChannels[i]->m_buffer,
Engine::audioEngine()->framesPerPeriod() );
m_fxChannels[i]->reset();
m_fxChannels[i]->m_queued = false;
m_mixerChannels[i]->reset();
m_mixerChannels[i]->m_queued = false;
// also reset hasInput
m_fxChannels[i]->m_hasInput = false;
m_fxChannels[i]->m_dependenciesMet = 0;
m_mixerChannels[i]->m_hasInput = false;
m_mixerChannels[i]->m_dependenciesMet = 0;
}
}
void FxMixer::clear()
void Mixer::clear()
{
while( m_fxChannels.size() > 1 )
while( m_mixerChannels.size() > 1 )
{
deleteChannel(1);
}
@@ -694,14 +694,14 @@ void FxMixer::clear()
void FxMixer::clearChannel(fx_ch_t index)
void Mixer::clearChannel(mix_ch_t index)
{
FxChannel * ch = m_fxChannels[index];
MixerChannel * ch = m_mixerChannels[index];
ch->m_fxChain.clear();
ch->m_volumeModel.setValue( 1.0f );
ch->m_muteModel.setValue( false );
ch->m_soloModel.setValue( false );
ch->m_name = ( index == 0 ) ? tr( "Master" ) : tr( "FX %1" ).arg( index );
ch->m_name = ( index == 0 ) ? tr( "Master" ) : tr( "Channel %1" ).arg( index );
ch->m_volumeModel.setDisplayName( ch->m_name + ">" + tr( "Volume" ) );
ch->m_muteModel.setDisplayName( ch->m_name + ">" + tr( "Mute" ) );
ch->m_soloModel.setDisplayName( ch->m_name + ">" + tr( "Solo" ) );
@@ -726,29 +726,29 @@ void FxMixer::clearChannel(fx_ch_t index)
}
}
void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
void Mixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
// save channels
for( int i = 0; i < m_fxChannels.size(); ++i )
for( int i = 0; i < m_mixerChannels.size(); ++i )
{
FxChannel * ch = m_fxChannels[i];
MixerChannel * ch = m_mixerChannels[i];
QDomElement fxch = _doc.createElement( QString( "fxchannel" ) );
_this.appendChild( fxch );
QDomElement mixch = _doc.createElement( QString( "mixerchannel" ) );
_this.appendChild( mixch );
ch->m_fxChain.saveState( _doc, fxch );
ch->m_volumeModel.saveSettings( _doc, fxch, "volume" );
ch->m_muteModel.saveSettings( _doc, fxch, "muted" );
ch->m_soloModel.saveSettings( _doc, fxch, "soloed" );
fxch.setAttribute( "num", i );
fxch.setAttribute( "name", ch->m_name );
if( ch->m_hasColor ) fxch.setAttribute( "color", ch->m_color.name() );
ch->m_fxChain.saveState( _doc, mixch );
ch->m_volumeModel.saveSettings( _doc, mixch, "volume" );
ch->m_muteModel.saveSettings( _doc, mixch, "muted" );
ch->m_soloModel.saveSettings( _doc, mixch, "soloed" );
mixch.setAttribute( "num", i );
mixch.setAttribute( "name", ch->m_name );
if( ch->m_hasColor ) mixch.setAttribute( "color", ch->m_color.name() );
// add the channel sends
for( int si = 0; si < ch->m_sends.size(); ++si )
{
QDomElement sendsDom = _doc.createElement( QString( "send" ) );
fxch.appendChild( sendsDom );
mixch.appendChild( sendsDom );
sendsDom.setAttribute( "channel", ch->m_sends[si]->receiverIndex() );
ch->m_sends[si]->amount()->saveSettings( _doc, sendsDom, "amount" );
@@ -757,48 +757,48 @@ void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
}
// make sure we have at least num channels
void FxMixer::allocateChannelsTo(int num)
void Mixer::allocateChannelsTo(int num)
{
while( num > m_fxChannels.size() - 1 )
while( num > m_mixerChannels.size() - 1 )
{
createChannel();
// delete the default send to master
deleteChannelSend( m_fxChannels.size()-1, 0 );
deleteChannelSend( m_mixerChannels.size()-1, 0 );
}
}
void FxMixer::loadSettings( const QDomElement & _this )
void Mixer::loadSettings( const QDomElement & _this )
{
clear();
QDomNode node = _this.firstChild();
while( ! node.isNull() )
{
QDomElement fxch = node.toElement();
QDomElement mixch = node.toElement();
// index of the channel we are about to load
int num = fxch.attribute( "num" ).toInt();
int num = mixch.attribute( "num" ).toInt();
// allocate enough channels
allocateChannelsTo( num );
m_fxChannels[num]->m_volumeModel.loadSettings( fxch, "volume" );
m_fxChannels[num]->m_muteModel.loadSettings( fxch, "muted" );
m_fxChannels[num]->m_soloModel.loadSettings( fxch, "soloed" );
m_fxChannels[num]->m_name = fxch.attribute( "name" );
if( fxch.hasAttribute( "color" ) )
m_mixerChannels[num]->m_volumeModel.loadSettings( mixch, "volume" );
m_mixerChannels[num]->m_muteModel.loadSettings( mixch, "muted" );
m_mixerChannels[num]->m_soloModel.loadSettings( mixch, "soloed" );
m_mixerChannels[num]->m_name = mixch.attribute( "name" );
if( mixch.hasAttribute( "color" ) )
{
m_fxChannels[num]->m_hasColor = true;
m_fxChannels[num]->m_color.setNamedColor( fxch.attribute( "color" ) );
m_mixerChannels[num]->m_hasColor = true;
m_mixerChannels[num]->m_color.setNamedColor( mixch.attribute( "color" ) );
}
m_fxChannels[num]->m_fxChain.restoreState( fxch.firstChildElement(
m_fxChannels[num]->m_fxChain.nodeName() ) );
m_mixerChannels[num]->m_fxChain.restoreState( mixch.firstChildElement(
m_mixerChannels[num]->m_fxChain.nodeName() ) );
// mixer sends
QDomNodeList chData = fxch.childNodes();
QDomNodeList chData = mixch.childNodes();
for( unsigned int i=0; i<chData.length(); ++i )
{
QDomElement chDataItem = chData.at(i).toElement();
@@ -806,8 +806,8 @@ void FxMixer::loadSettings( const QDomElement & _this )
{
int sendTo = chDataItem.attribute( "channel" ).toInt();
allocateChannelsTo( sendTo ) ;
FxRoute * fxr = createChannelSend( num, sendTo, 1.0f );
if( fxr ) fxr->amount()->loadSettings( chDataItem, "amount" );
MixerRoute * mxr = createChannelSend( num, sendTo, 1.0f );
if( mxr ) mxr->amount()->loadSettings( chDataItem, "amount" );
}
}
@@ -820,10 +820,10 @@ void FxMixer::loadSettings( const QDomElement & _this )
}
void FxMixer::validateChannelName( int index, int oldIndex )
void Mixer::validateChannelName( int index, int oldIndex )
{
if( m_fxChannels[index]->m_name == tr( "FX %1" ).arg( oldIndex ) )
if( m_mixerChannels[index]->m_name == tr( "Channel %1" ).arg( oldIndex ) )
{
m_fxChannels[index]->m_name = tr( "FX %1" ).arg( index );
m_mixerChannels[index]->m_name = tr( "Channel %1" ).arg( index );
}
}

View File

@@ -44,8 +44,8 @@
#include "ControllerConnection.h"
#include "embed.h"
#include "EnvelopeAndLfoParameters.h"
#include "FxMixer.h"
#include "FxMixerView.h"
#include "Mixer.h"
#include "MixerView.h"
#include "GuiApplication.h"
#include "ExportFilter.h"
#include "InstrumentTrack.h"
@@ -874,15 +874,15 @@ void Song::clearProject()
{
getGUI()->songEditor()->m_editor->clearAllTracks();
}
if( getGUI() != nullptr && getGUI()->fxMixerView() )
if( getGUI() != nullptr && getGUI()->mixerView() )
{
getGUI()->fxMixerView()->clear();
getGUI()->mixerView()->clear();
}
QCoreApplication::sendPostedEvents();
Engine::getBBTrackContainer()->clearAllTracks();
clearAllTracks();
Engine::fxMixer()->clear();
Engine::mixer()->clear();
if( getGUI() != nullptr && getGUI()->automationEditor() )
{
@@ -1088,15 +1088,15 @@ void Song::loadProject( const QString & fileName )
//Backward compatibility for LMMS <= 0.4.15
PeakController::initGetControllerBySetting();
// Load mixer first to be able to set the correct range for FX channels
node = dataFile.content().firstChildElement( Engine::fxMixer()->nodeName() );
// Load mixer first to be able to set the correct range for mixer channels
node = dataFile.content().firstChildElement( Engine::mixer()->nodeName() );
if( !node.isNull() )
{
Engine::fxMixer()->restoreState( node.toElement() );
Engine::mixer()->restoreState( node.toElement() );
if( getGUI() != nullptr )
{
// refresh FxMixerView
getGUI()->fxMixerView()->refreshDisplay();
// refresh MixerView
getGUI()->mixerView()->refreshDisplay();
}
}
@@ -1238,7 +1238,7 @@ bool Song::saveProjectFile(const QString & filename, bool withResources)
saveState( dataFile, dataFile.content() );
m_globalAutomationTrack->saveState( dataFile, dataFile.content() );
Engine::fxMixer()->saveState( dataFile, dataFile.content() );
Engine::mixer()->saveState( dataFile, dataFile.content() );
if( getGUI() != nullptr )
{
getGUI()->getControllerRackView()->saveState( dataFile, dataFile.content() );

View File

@@ -26,7 +26,7 @@
#include "AudioDevice.h"
#include "AudioEngine.h"
#include "EffectChain.h"
#include "FxMixer.h"
#include "Mixer.h"
#include "Engine.h"
#include "MixHelpers.h"
#include "BufferManager.h"
@@ -38,7 +38,7 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain,
m_bufferUsage( false ),
m_portBuffer( BufferManager::acquire() ),
m_extOutputEnabled( false ),
m_nextFxChannel( 0 ),
m_nextMixerChannel( 0 ),
m_name( "unnamed port" ),
m_effects( _has_effect_chain ? new EffectChain( nullptr ) : nullptr ),
m_volumeModel( volumeModel ),
@@ -222,7 +222,7 @@ void AudioPort::doProcessing()
const bool me = processEffects();
if( me || m_bufferUsage )
{
Engine::fxMixer()->mixToChannel( m_portBuffer, m_nextFxChannel ); // send output to fx mixer
Engine::mixer()->mixToChannel( m_portBuffer, m_nextMixerChannel ); // send output to mixer
// TODO: improve the flow here - convert to pull model
m_bufferUsage = false;
}

View File

@@ -16,7 +16,7 @@ SET(LMMS_SRCS
gui/embed.cpp
gui/ExportProjectDialog.cpp
gui/FileBrowser.cpp
gui/FxMixerView.cpp
gui/MixerView.cpp
gui/GuiApplication.cpp
gui/InstrumentView.cpp
gui/InstrumentTrackView.cpp
@@ -74,8 +74,8 @@ SET(LMMS_SRCS
gui/widgets/EnvelopeAndLfoView.cpp
gui/widgets/FadeButton.cpp
gui/widgets/Fader.cpp
gui/widgets/FxLine.cpp
gui/widgets/FxLineLcdSpinBox.cpp
gui/widgets/MixerLine.cpp
gui/widgets/MixerLineLcdSpinBox.cpp
gui/widgets/Graph.cpp
gui/widgets/GroupBox.cpp
gui/widgets/InstrumentFunctionViews.cpp

View File

@@ -33,7 +33,7 @@
#include "BBEditor.h"
#include "ConfigManager.h"
#include "ControllerRackView.h"
#include "FxMixerView.h"
#include "MixerView.h"
#include "InstrumentTrack.h"
#include "MainWindow.h"
#include "MicrotunerConfig.h"
@@ -138,8 +138,8 @@ GuiApplication::GuiApplication()
connect(m_songEditor, SIGNAL(destroyed(QObject*)), this, SLOT(childDestroyed(QObject*)));
displayInitProgress(tr("Preparing mixer"));
m_fxMixerView = new FxMixerView;
connect(m_fxMixerView, SIGNAL(destroyed(QObject*)), this, SLOT(childDestroyed(QObject*)));
m_mixerView = new MixerView;
connect(m_mixerView, SIGNAL(destroyed(QObject*)), this, SLOT(childDestroyed(QObject*)));
displayInitProgress(tr("Preparing controller rack"));
m_controllerRackView = new ControllerRackView;
@@ -189,15 +189,15 @@ void GuiApplication::displayInitProgress(const QString &msg)
void GuiApplication::childDestroyed(QObject *obj)
{
// when any object that can be reached via getGUI()->mainWindow(), getGUI()->fxMixerView(), etc
// when any object that can be reached via getGUI()->mainWindow(), getGUI()->mixerView(), etc
// is destroyed, ensure that their accessor functions will return null instead of a garbage pointer.
if (obj == m_mainWindow)
{
m_mainWindow = nullptr;
}
else if (obj == m_fxMixerView)
else if (obj == m_mixerView)
{
m_fxMixerView = nullptr;
m_mixerView = nullptr;
}
else if (obj == m_songEditor)
{

View File

@@ -36,9 +36,9 @@
#include "ControllerConnectionDialog.h"
#include "Engine.h"
#include "FadeButton.h"
#include "FxLineLcdSpinBox.h"
#include "FxMixer.h"
#include "FxMixerView.h"
#include "MixerLineLcdSpinBox.h"
#include "Mixer.h"
#include "MixerView.h"
#include "GuiApplication.h"
#include "InstrumentTrack.h"
#include "InstrumentTrackWindow.h"
@@ -219,27 +219,27 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow()
/*! \brief Create and assign a new FX Channel for this track */
void InstrumentTrackView::createFxLine()
/*! \brief Create and assign a new mixer Channel for this track */
void InstrumentTrackView::createMixerLine()
{
int channelIndex = getGUI()->fxMixerView()->addNewChannel();
auto channel = Engine::fxMixer()->effectChannel(channelIndex);
int channelIndex = getGUI()->mixerView()->addNewChannel();
auto channel = Engine::mixer()->mixerChannel(channelIndex);
channel->m_name = getTrack()->name();
if (getTrack()->useColor()) { channel->setColor (getTrack()->color()); }
assignFxLine(channelIndex);
assignMixerLine(channelIndex);
}
/*! \brief Assign a specific FX Channel for this track */
void InstrumentTrackView::assignFxLine(int channelIndex)
/*! \brief Assign a specific mixer Channel for this track */
void InstrumentTrackView::assignMixerLine(int channelIndex)
{
model()->effectChannelModel()->setValue( channelIndex );
model()->mixerChannelModel()->setValue( channelIndex );
getGUI()->fxMixerView()->setCurrentFxLine( channelIndex );
getGUI()->mixerView()->setCurrentMixerLine( channelIndex );
}
@@ -349,38 +349,38 @@ void InstrumentTrackView::midiConfigChanged()
//FIXME: This is identical to SampleTrackView::createFxMenu
QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
//FIXME: This is identical to SampleTrackView::createMixerMenu
QMenu * InstrumentTrackView::createMixerMenu(QString title, QString newMixerLabel)
{
int channelIndex = model()->effectChannelModel()->value();
int channelIndex = model()->mixerChannelModel()->value();
FxChannel *fxChannel = Engine::fxMixer()->effectChannel( channelIndex );
MixerChannel *mixerChannel = Engine::mixer()->mixerChannel( channelIndex );
// If title allows interpolation, pass channel index and name
if ( title.contains( "%2" ) )
{
title = title.arg( channelIndex ).arg( fxChannel->m_name );
title = title.arg( channelIndex ).arg( mixerChannel->m_name );
}
QMenu *fxMenu = new QMenu( title );
QMenu *mixerMenu = new QMenu( title );
fxMenu->addAction( newFxLabel, this, SLOT( createFxLine() ) );
fxMenu->addSeparator();
mixerMenu->addAction( newMixerLabel, this, SLOT( createMixerLine() ) );
mixerMenu->addSeparator();
for (int i = 0; i < Engine::fxMixer()->numChannels(); ++i)
for (int i = 0; i < Engine::mixer()->numChannels(); ++i)
{
FxChannel * currentChannel = Engine::fxMixer()->effectChannel( i );
MixerChannel * currentChannel = Engine::mixer()->mixerChannel( i );
if ( currentChannel != fxChannel )
if ( currentChannel != mixerChannel )
{
auto index = currentChannel->m_channelIndex;
QString label = tr( "FX %1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name );
fxMenu->addAction(label, [this, index](){
assignFxLine(index);
QString label = tr( "%1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name );
mixerMenu->addAction(label, [this, index](){
assignMixerLine(index);
});
}
}
return fxMenu;
return mixerMenu;
}

View File

@@ -40,8 +40,8 @@
#include "Engine.h"
#include "FileBrowser.h"
#include "FileDialog.h"
#include "FxLineLcdSpinBox.h"
#include "FxMixer.h"
#include "MixerLineLcdSpinBox.h"
#include "Mixer.h"
#include "GuiApplication.h"
#include "gui_templates.h"
#include "Instrument.h"
@@ -190,13 +190,13 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
basicControlsLayout->setColumnStretch(5, 1);
// setup spinbox for selecting FX-channel
m_effectChannelNumber = new FxLineLcdSpinBox( 2, nullptr, tr( "FX channel" ), m_itv );
// setup spinbox for selecting Mixer-channel
m_mixerChannelNumber = new MixerLineLcdSpinBox( 2, nullptr, tr( "Mixer channel" ), m_itv );
basicControlsLayout->addWidget( m_effectChannelNumber, 0, 6 );
basicControlsLayout->setAlignment( m_effectChannelNumber, widgetAlignment );
basicControlsLayout->addWidget( m_mixerChannelNumber, 0, 6 );
basicControlsLayout->setAlignment( m_mixerChannelNumber, widgetAlignment );
label = new QLabel( tr( "FX" ), this );
label = new QLabel( tr( "CHANNEL" ), this );
label->setStyleSheet( labelStyleSheet );
basicControlsLayout->addWidget( label, 1, 6);
basicControlsLayout->setAlignment( label, labelAlignment );
@@ -316,7 +316,7 @@ void InstrumentTrackWindow::setInstrumentTrackView( InstrumentTrackView* view )
}
m_itv = view;
m_effectChannelNumber->setTrackView(m_itv);
m_mixerChannelNumber->setTrackView(m_itv);
}
@@ -338,7 +338,7 @@ void InstrumentTrackWindow::modelChanged()
m_volumeKnob->setModel( &m_track->m_volumeModel );
m_panningKnob->setModel( &m_track->m_panningModel );
m_effectChannelNumber->setModel( &m_track->m_effectChannelModel );
m_mixerChannelNumber->setModel( &m_track->m_mixerChannelModel );
m_pianoView->setModel( &m_track->m_piano );
if( m_track->instrument() && m_track->instrument()->flags().testFlag( Instrument::IsNotBendable ) == false )

View File

@@ -48,7 +48,7 @@
#include "ExportProjectDialog.h"
#include "FileBrowser.h"
#include "FileDialog.h"
#include "FxMixerView.h"
#include "MixerView.h"
#include "GuiApplication.h"
#include "ImportFilter.h"
#include "InstrumentTrackView.h"
@@ -526,12 +526,12 @@ void MainWindow::finalize()
m_toolBar );
automation_editor_window->setShortcut( Qt::CTRL + Qt::Key_4 );
ToolButton * fx_mixer_window = new ToolButton(
embed::getIconPixmap( "fx_mixer" ),
tr( "FX Mixer" ) + " (Ctrl+5)",
this, SLOT( toggleFxMixerWin() ),
ToolButton * mixer_window = new ToolButton(
embed::getIconPixmap( "mixer" ),
tr( "Mixer" ) + " (Ctrl+5)",
this, SLOT( toggleMixerWin() ),
m_toolBar );
fx_mixer_window->setShortcut( Qt::CTRL + Qt::Key_5 );
mixer_window->setShortcut( Qt::CTRL + Qt::Key_5 );
ToolButton * controllers_window = new ToolButton(
embed::getIconPixmap( "controller" ),
@@ -561,7 +561,7 @@ void MainWindow::finalize()
m_toolBarLayout->addWidget( bb_editor_window, 1, 2 );
m_toolBarLayout->addWidget( piano_roll_window, 1, 3 );
m_toolBarLayout->addWidget( automation_editor_window, 1, 4 );
m_toolBarLayout->addWidget( fx_mixer_window, 1, 5 );
m_toolBarLayout->addWidget( mixer_window, 1, 5 );
m_toolBarLayout->addWidget( controllers_window, 1, 6 );
m_toolBarLayout->addWidget( project_notes_window, 1, 7 );
m_toolBarLayout->addWidget( microtuner_window, 1, 8 );
@@ -745,7 +745,7 @@ void MainWindow::clearKeyModifiers()
void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
{
// If our widget is the main content of a window (e.g. piano roll, FxMixer, etc),
// If our widget is the main content of a window (e.g. piano roll, Mixer, etc),
// we really care about the position of the *window* - not the position of the widget within its window
if( _w->parentWidget() != nullptr &&
_w->parentWidget()->inherits( "QMdiSubWindow" ) )
@@ -782,7 +782,7 @@ void MainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
qMax( _w->minimumHeight(), _de.attribute( "height" ).toInt() ) );
if( _de.hasAttribute( "visible" ) && !r.isNull() )
{
// If our widget is the main content of a window (e.g. piano roll, FxMixer, etc),
// If our widget is the main content of a window (e.g. piano roll, Mixer, etc),
// we really care about the position of the *window* - not the position of the widget within its window
if ( _w->parentWidget() != nullptr &&
_w->parentWidget()->inherits( "QMdiSubWindow" ) )
@@ -1118,9 +1118,9 @@ void MainWindow::toggleAutomationEditorWin()
void MainWindow::toggleFxMixerWin()
void MainWindow::toggleMixerWin()
{
toggleWindow( getGUI()->fxMixerView() );
toggleWindow( getGUI()->mixerView() );
}
@@ -1154,9 +1154,9 @@ void MainWindow::updateViewMenu()
this,
SLOT( toggleAutomationEditorWin())
);
m_viewMenu->addAction(embed::getIconPixmap( "fx_mixer" ),
tr( "FX Mixer" ) + "\tCtrl+5",
this, SLOT( toggleFxMixerWin() )
m_viewMenu->addAction(embed::getIconPixmap( "mixer" ),
tr( "Mixer" ) + "\tCtrl+5",
this, SLOT( toggleMixerWin() )
);
m_viewMenu->addAction(embed::getIconPixmap( "controller" ),
tr( "Controller Rack" ) + "\tCtrl+6",

View File

@@ -1,5 +1,5 @@
/*
* FxMixerView.cpp - effect-mixer-view for LMMS
* MixerView.cpp - effect-mixer-view for LMMS
*
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -38,10 +38,10 @@
#include "lmms_math.h"
#include "FxMixerView.h"
#include "MixerView.h"
#include "Knob.h"
#include "FxLine.h"
#include "FxMixer.h"
#include "MixerLine.h"
#include "Mixer.h"
#include "GuiApplication.h"
#include "MainWindow.h"
#include "AudioEngine.h"
@@ -52,12 +52,12 @@
#include "BBTrackContainer.h"
#include "TrackContainer.h" // For TrackContainer::TrackList typedef
FxMixerView::FxMixerView() :
MixerView::MixerView() :
QWidget(),
ModelView( nullptr, this ),
SerializingObjectHook()
{
FxMixer * m = Engine::fxMixer();
Mixer * m = Engine::mixer();
m->setHook( this );
//QPalette pal = palette();
@@ -67,8 +67,8 @@ FxMixerView::FxMixerView() :
setAutoFillBackground( true );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
setWindowTitle( tr( "FX-Mixer" ) );
setWindowIcon( embed::getIconPixmap( "fx_mixer" ) );
setWindowTitle( tr( "Mixer" ) );
setWindowIcon( embed::getIconPixmap( "mixer" ) );
// main-layout
QHBoxLayout * ml = new QHBoxLayout;
@@ -91,21 +91,21 @@ FxMixerView::FxMixerView() :
m_racksWidget->setLayout( m_racksLayout );
// add master channel
m_fxChannelViews.resize( m->numChannels() );
m_fxChannelViews[0] = new FxChannelView( this, this, 0 );
m_mixerChannelViews.resize( m->numChannels() );
m_mixerChannelViews[0] = new MixerChannelView( this, this, 0 );
m_racksLayout->addWidget( m_fxChannelViews[0]->m_rackView );
m_racksLayout->addWidget( m_mixerChannelViews[0]->m_rackView );
FxChannelView * masterView = m_fxChannelViews[0];
ml->addWidget( masterView->m_fxLine, 0, Qt::AlignTop );
MixerChannelView * masterView = m_mixerChannelViews[0];
ml->addWidget( masterView->m_mixerLine, 0, Qt::AlignTop );
QSize fxLineSize = masterView->m_fxLine->size();
QSize mixerLineSize = masterView->m_mixerLine->size();
// add mixer channels
for( int i = 1; i < m_fxChannelViews.size(); ++i )
for( int i = 1; i < m_mixerChannelViews.size(); ++i )
{
m_fxChannelViews[i] = new FxChannelView(m_channelAreaWidget, this, i);
chLayout->addWidget( m_fxChannelViews[i]->m_fxLine );
m_mixerChannelViews[i] = new MixerChannelView(m_channelAreaWidget, this, i);
chLayout->addWidget( m_mixerChannelViews[i]->m_mixerLine );
}
// add the scrolling section to the main layout
@@ -113,7 +113,7 @@ FxMixerView::FxMixerView() :
class ChannelArea : public QScrollArea
{
public:
ChannelArea( QWidget * parent, FxMixerView * mv ) :
ChannelArea( QWidget * parent, MixerView * mv ) :
QScrollArea( parent ), m_mv( mv ) {}
~ChannelArea() {}
void keyPressEvent( QKeyEvent * e ) override
@@ -121,29 +121,29 @@ FxMixerView::FxMixerView() :
m_mv->keyPressEvent( e );
}
private:
FxMixerView * m_mv;
MixerView * m_mv;
};
channelArea = new ChannelArea( this, this );
channelArea->setWidget( m_channelAreaWidget );
channelArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
channelArea->setFrameStyle( QFrame::NoFrame );
channelArea->setMinimumWidth( fxLineSize.width() * 6 );
channelArea->setFixedHeight( fxLineSize.height() +
channelArea->setMinimumWidth( mixerLineSize.width() * 6 );
channelArea->setFixedHeight( mixerLineSize.height() +
style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
ml->addWidget( channelArea, 1, Qt::AlignTop );
// show the add new effect channel button
// show the add new mixer channel button
QPushButton * newChannelBtn = new QPushButton( embed::getIconPixmap( "new_channel" ), QString(), this );
newChannelBtn->setObjectName( "newChannelBtn" );
newChannelBtn->setFixedSize( fxLineSize );
newChannelBtn->setFixedSize( mixerLineSize );
connect( newChannelBtn, SIGNAL( clicked() ), this, SLOT( addNewChannel() ) );
ml->addWidget( newChannelBtn, 0, Qt::AlignTop );
// add the stacked layout for the effect racks of fx channels
// add the stacked layout for the effect racks of mixer channels
ml->addWidget( m_racksWidget, 0, Qt::AlignTop | Qt::AlignRight );
setCurrentFxLine( m_fxChannelViews[0]->m_fxLine );
setCurrentMixerLine( m_mixerChannelViews[0]->m_mixerLine );
setLayout( ml );
updateGeometry();
@@ -168,28 +168,28 @@ FxMixerView::FxMixerView() :
setModel( m );
}
FxMixerView::~FxMixerView()
MixerView::~MixerView()
{
for (int i=0; i<m_fxChannelViews.size(); i++)
for (int i=0; i<m_mixerChannelViews.size(); i++)
{
delete m_fxChannelViews.at(i);
delete m_mixerChannelViews.at(i);
}
}
int FxMixerView::addNewChannel()
int MixerView::addNewChannel()
{
// add new fx mixer channel and redraw the form.
FxMixer * mix = Engine::fxMixer();
// add new mixer channel and redraw the form.
Mixer * mix = Engine::mixer();
int newChannelIndex = mix->createChannel();
m_fxChannelViews.push_back(new FxChannelView(m_channelAreaWidget, this,
m_mixerChannelViews.push_back(new MixerChannelView(m_channelAreaWidget, this,
newChannelIndex));
chLayout->addWidget( m_fxChannelViews[newChannelIndex]->m_fxLine );
m_racksLayout->addWidget( m_fxChannelViews[newChannelIndex]->m_rackView );
chLayout->addWidget( m_mixerChannelViews[newChannelIndex]->m_mixerLine );
m_racksLayout->addWidget( m_mixerChannelViews[newChannelIndex]->m_rackView );
updateFxLine(newChannelIndex);
updateMixerLine(newChannelIndex);
updateMaxChannelSelector();
@@ -197,38 +197,38 @@ int FxMixerView::addNewChannel()
}
void FxMixerView::refreshDisplay()
void MixerView::refreshDisplay()
{
// delete all views and re-add them
for( int i = 1; i<m_fxChannelViews.size(); ++i )
for( int i = 1; i<m_mixerChannelViews.size(); ++i )
{
chLayout->removeWidget(m_fxChannelViews[i]->m_fxLine);
m_racksLayout->removeWidget( m_fxChannelViews[i]->m_rackView );
delete m_fxChannelViews[i]->m_fader;
delete m_fxChannelViews[i]->m_muteBtn;
delete m_fxChannelViews[i]->m_soloBtn;
delete m_fxChannelViews[i]->m_fxLine;
delete m_fxChannelViews[i]->m_rackView;
delete m_fxChannelViews[i];
chLayout->removeWidget(m_mixerChannelViews[i]->m_mixerLine);
m_racksLayout->removeWidget( m_mixerChannelViews[i]->m_rackView );
delete m_mixerChannelViews[i]->m_fader;
delete m_mixerChannelViews[i]->m_muteBtn;
delete m_mixerChannelViews[i]->m_soloBtn;
delete m_mixerChannelViews[i]->m_mixerLine;
delete m_mixerChannelViews[i]->m_rackView;
delete m_mixerChannelViews[i];
}
m_channelAreaWidget->adjustSize();
// re-add the views
m_fxChannelViews.resize(Engine::fxMixer()->numChannels());
for( int i = 1; i < m_fxChannelViews.size(); ++i )
m_mixerChannelViews.resize(Engine::mixer()->numChannels());
for( int i = 1; i < m_mixerChannelViews.size(); ++i )
{
m_fxChannelViews[i] = new FxChannelView(m_channelAreaWidget, this, i);
chLayout->addWidget(m_fxChannelViews[i]->m_fxLine);
m_racksLayout->addWidget( m_fxChannelViews[i]->m_rackView );
m_mixerChannelViews[i] = new MixerChannelView(m_channelAreaWidget, this, i);
chLayout->addWidget(m_mixerChannelViews[i]->m_mixerLine);
m_racksLayout->addWidget( m_mixerChannelViews[i]->m_rackView );
}
// set selected fx line to 0
setCurrentFxLine( 0 );
// set selected mixer line to 0
setCurrentMixerLine( 0 );
// update all fx lines
for( int i = 0; i < m_fxChannelViews.size(); ++i )
// update all mixer lines
for( int i = 0; i < m_mixerChannelViews.size(); ++i )
{
updateFxLine( i );
updateMixerLine( i );
}
updateMaxChannelSelector();
@@ -236,7 +236,7 @@ void FxMixerView::refreshDisplay()
// update the and max. channel number for every instrument
void FxMixerView::updateMaxChannelSelector()
void MixerView::updateMaxChannelSelector()
{
TrackContainer::TrackList songTrackList = Engine::getSong()->tracks();
TrackContainer::TrackList bbTrackList = Engine::getBBTrackContainer()->tracks();
@@ -250,21 +250,21 @@ void FxMixerView::updateMaxChannelSelector()
if( trackList[i]->type() == Track::InstrumentTrack )
{
InstrumentTrack * inst = (InstrumentTrack *) trackList[i];
inst->effectChannelModel()->setRange(0,
m_fxChannelViews.size()-1,1);
inst->mixerChannelModel()->setRange(0,
m_mixerChannelViews.size()-1,1);
}
else if( trackList[i]->type() == Track::SampleTrack )
{
SampleTrack * strk = (SampleTrack *) trackList[i];
strk->effectChannelModel()->setRange(0,
m_fxChannelViews.size()-1,1);
strk->mixerChannelModel()->setRange(0,
m_mixerChannelViews.size()-1,1);
}
}
}
}
void FxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
void MixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
MainWindow::saveWidgetState( this, _this );
}
@@ -272,97 +272,97 @@ void FxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
void FxMixerView::loadSettings( const QDomElement & _this )
void MixerView::loadSettings( const QDomElement & _this )
{
MainWindow::restoreWidgetState( this, _this );
}
FxMixerView::FxChannelView::FxChannelView(QWidget * _parent, FxMixerView * _mv,
MixerView::MixerChannelView::MixerChannelView(QWidget * _parent, MixerView * _mv,
int channelIndex )
{
m_fxLine = new FxLine(_parent, _mv, channelIndex);
m_mixerLine = new MixerLine(_parent, _mv, channelIndex);
FxChannel *fxChannel = Engine::fxMixer()->effectChannel(channelIndex);
MixerChannel *mixerChannel = Engine::mixer()->mixerChannel(channelIndex);
m_fader = new Fader( &fxChannel->m_volumeModel,
tr( "FX Fader %1" ).arg( channelIndex ), m_fxLine );
m_fader = new Fader( &mixerChannel->m_volumeModel,
tr( "Fader %1" ).arg( channelIndex ), m_mixerLine );
m_fader->setLevelsDisplayedInDBFS();
m_fader->setMinPeak(dbfsToAmp(-42));
m_fader->setMaxPeak(dbfsToAmp(9));
m_fader->move( 16-m_fader->width()/2,
m_fxLine->height()-
m_mixerLine->height()-
m_fader->height()-5 );
m_muteBtn = new PixmapButton( m_fxLine, tr( "Mute" ) );
m_muteBtn->setModel( &fxChannel->m_muteModel );
m_muteBtn = new PixmapButton( m_mixerLine, tr( "Mute" ) );
m_muteBtn->setModel( &mixerChannel->m_muteModel );
m_muteBtn->setActiveGraphic(
embed::getIconPixmap( "led_off" ) );
m_muteBtn->setInactiveGraphic(
embed::getIconPixmap( "led_green" ) );
m_muteBtn->setCheckable( true );
m_muteBtn->move( 9, m_fader->y()-11);
ToolTip::add( m_muteBtn, tr( "Mute this FX channel" ) );
ToolTip::add( m_muteBtn, tr( "Mute this channel" ) );
m_soloBtn = new PixmapButton( m_fxLine, tr( "Solo" ) );
m_soloBtn->setModel( &fxChannel->m_soloModel );
m_soloBtn = new PixmapButton( m_mixerLine, tr( "Solo" ) );
m_soloBtn->setModel( &mixerChannel->m_soloModel );
m_soloBtn->setActiveGraphic(
embed::getIconPixmap( "led_red" ) );
m_soloBtn->setInactiveGraphic(
embed::getIconPixmap( "led_off" ) );
m_soloBtn->setCheckable( true );
m_soloBtn->move( 9, m_fader->y()-21);
connect(&fxChannel->m_soloModel, SIGNAL( dataChanged() ),
connect(&mixerChannel->m_soloModel, SIGNAL( dataChanged() ),
_mv, SLOT ( toggledSolo() ), Qt::DirectConnection );
ToolTip::add( m_soloBtn, tr( "Solo FX channel" ) );
ToolTip::add( m_soloBtn, tr( "Solo this channel" ) );
// Create EffectRack for the channel
m_rackView = new EffectRackView( &fxChannel->m_fxChain, _mv->m_racksWidget );
m_rackView->setFixedSize( EffectRackView::DEFAULT_WIDTH, FxLine::FxLineHeight );
m_rackView = new EffectRackView( &mixerChannel->m_fxChain, _mv->m_racksWidget );
m_rackView->setFixedSize( EffectRackView::DEFAULT_WIDTH, MixerLine::MixerLineHeight );
}
void FxMixerView::FxChannelView::setChannelIndex( int index )
void MixerView::MixerChannelView::setChannelIndex( int index )
{
FxChannel* fxChannel = Engine::fxMixer()->effectChannel( index );
MixerChannel* mixerChannel = Engine::mixer()->mixerChannel( index );
m_fader->setModel( &fxChannel->m_volumeModel );
m_muteBtn->setModel( &fxChannel->m_muteModel );
m_soloBtn->setModel( &fxChannel->m_soloModel );
m_rackView->setModel( &fxChannel->m_fxChain );
m_fader->setModel( &mixerChannel->m_volumeModel );
m_muteBtn->setModel( &mixerChannel->m_muteModel );
m_soloBtn->setModel( &mixerChannel->m_soloModel );
m_rackView->setModel( &mixerChannel->m_fxChain );
}
void FxMixerView::toggledSolo()
void MixerView::toggledSolo()
{
Engine::fxMixer()->toggledSolo();
Engine::mixer()->toggledSolo();
}
void FxMixerView::setCurrentFxLine( FxLine * _line )
void MixerView::setCurrentMixerLine( MixerLine * _line )
{
// select
m_currentFxLine = _line;
m_racksLayout->setCurrentWidget( m_fxChannelViews[ _line->channelIndex() ]->m_rackView );
m_currentMixerLine = _line;
m_racksLayout->setCurrentWidget( m_mixerChannelViews[ _line->channelIndex() ]->m_rackView );
// set up send knob
for(int i = 0; i < m_fxChannelViews.size(); ++i)
for(int i = 0; i < m_mixerChannelViews.size(); ++i)
{
updateFxLine(i);
updateMixerLine(i);
}
}
void FxMixerView::updateFxLine(int index)
void MixerView::updateMixerLine(int index)
{
FxMixer * mix = Engine::fxMixer();
Mixer * mix = Engine::mixer();
// does current channel send to this channel?
int selIndex = m_currentFxLine->channelIndex();
FxLine * thisLine = m_fxChannelViews[index]->m_fxLine;
thisLine->setToolTip( Engine::fxMixer()->effectChannel( index )->m_name );
int selIndex = m_currentMixerLine->channelIndex();
MixerLine * thisLine = m_mixerChannelViews[index]->m_mixerLine;
thisLine->setToolTip( Engine::mixer()->mixerChannel( index )->m_name );
FloatModel * sendModel = mix->channelSendModel(selIndex, index);
if( sendModel == nullptr )
@@ -384,60 +384,60 @@ void FxMixerView::updateFxLine(int index)
}
void FxMixerView::deleteChannel(int index)
void MixerView::deleteChannel(int index)
{
// can't delete master
if( index == 0 ) return;
// remember selected line
int selLine = m_currentFxLine->channelIndex();
int selLine = m_currentMixerLine->channelIndex();
// in case the deleted channel is soloed or the remaining
// channels will be left in a muted state
Engine::fxMixer()->clearChannel(index);
Engine::mixer()->clearChannel(index);
// delete the real channel
Engine::fxMixer()->deleteChannel(index);
Engine::mixer()->deleteChannel(index);
// delete the view
chLayout->removeWidget(m_fxChannelViews[index]->m_fxLine);
m_racksLayout->removeWidget( m_fxChannelViews[index]->m_rackView );
delete m_fxChannelViews[index]->m_fader;
delete m_fxChannelViews[index]->m_muteBtn;
delete m_fxChannelViews[index]->m_soloBtn;
// delete fxLine later to prevent a crash when deleting from context menu
m_fxChannelViews[index]->m_fxLine->hide();
m_fxChannelViews[index]->m_fxLine->deleteLater();
delete m_fxChannelViews[index]->m_rackView;
delete m_fxChannelViews[index];
chLayout->removeWidget(m_mixerChannelViews[index]->m_mixerLine);
m_racksLayout->removeWidget( m_mixerChannelViews[index]->m_rackView );
delete m_mixerChannelViews[index]->m_fader;
delete m_mixerChannelViews[index]->m_muteBtn;
delete m_mixerChannelViews[index]->m_soloBtn;
// delete mixerLine later to prevent a crash when deleting from context menu
m_mixerChannelViews[index]->m_mixerLine->hide();
m_mixerChannelViews[index]->m_mixerLine->deleteLater();
delete m_mixerChannelViews[index]->m_rackView;
delete m_mixerChannelViews[index];
m_channelAreaWidget->adjustSize();
// make sure every channel knows what index it is
for(int i=index + 1; i<m_fxChannelViews.size(); ++i)
for(int i=index + 1; i<m_mixerChannelViews.size(); ++i)
{
m_fxChannelViews[i]->m_fxLine->setChannelIndex(i-1);
m_mixerChannelViews[i]->m_mixerLine->setChannelIndex(i-1);
}
m_fxChannelViews.remove(index);
m_mixerChannelViews.remove(index);
// select the next channel
if( selLine >= m_fxChannelViews.size() )
if( selLine >= m_mixerChannelViews.size() )
{
selLine = m_fxChannelViews.size()-1;
selLine = m_mixerChannelViews.size()-1;
}
setCurrentFxLine(selLine);
setCurrentMixerLine(selLine);
updateMaxChannelSelector();
}
void FxMixerView::deleteUnusedChannels()
void MixerView::deleteUnusedChannels()
{
TrackContainer::TrackList tracks;
tracks += Engine::getSong()->tracks();
tracks += Engine::getBBTrackContainer()->tracks();
std::vector<bool> inUse(m_fxChannelViews.size(), false);
std::vector<bool> inUse(m_mixerChannelViews.size(), false);
//Populate inUse by checking the destination channel for every track
for (Track* t: tracks)
@@ -448,93 +448,93 @@ void FxMixerView::deleteUnusedChannels()
if (t->type() == Track::InstrumentTrack)
{
InstrumentTrack* inst = dynamic_cast<InstrumentTrack *>(t);
channel = inst->effectChannelModel()->value();
channel = inst->mixerChannelModel()->value();
}
else if (t->type() == Track::SampleTrack)
{
SampleTrack *strack = dynamic_cast<SampleTrack *>(t);
channel = strack->effectChannelModel()->value();
channel = strack->mixerChannelModel()->value();
}
inUse[channel] = true;
}
//Check all channels except master, delete those with no incoming sends
for(int i = m_fxChannelViews.size()-1; i > 0; --i)
for(int i = m_mixerChannelViews.size()-1; i > 0; --i)
{
if (!inUse[i] && Engine::fxMixer()->effectChannel(i)->m_receives.isEmpty())
if (!inUse[i] && Engine::mixer()->mixerChannel(i)->m_receives.isEmpty())
{ deleteChannel(i); }
}
}
void FxMixerView::moveChannelLeft(int index, int focusIndex)
void MixerView::moveChannelLeft(int index, int focusIndex)
{
// can't move master or first channel left or last channel right
if( index <= 1 || index >= m_fxChannelViews.size() ) return;
if( index <= 1 || index >= m_mixerChannelViews.size() ) return;
FxMixer *m = Engine::fxMixer();
Mixer *m = Engine::mixer();
// Move instruments channels
m->moveChannelLeft( index );
// Update widgets models
m_fxChannelViews[index]->setChannelIndex( index );
m_fxChannelViews[index - 1]->setChannelIndex( index - 1 );
m_mixerChannelViews[index]->setChannelIndex( index );
m_mixerChannelViews[index - 1]->setChannelIndex( index - 1 );
// Focus on new position
setCurrentFxLine( focusIndex );
setCurrentMixerLine( focusIndex );
}
void FxMixerView::moveChannelLeft(int index)
void MixerView::moveChannelLeft(int index)
{
moveChannelLeft( index, index - 1 );
}
void FxMixerView::moveChannelRight(int index)
void MixerView::moveChannelRight(int index)
{
moveChannelLeft( index + 1, index + 1 );
}
void FxMixerView::renameChannel(int index)
void MixerView::renameChannel(int index)
{
m_fxChannelViews[index]->m_fxLine->renameChannel();
m_mixerChannelViews[index]->m_mixerLine->renameChannel();
}
void FxMixerView::keyPressEvent(QKeyEvent * e)
void MixerView::keyPressEvent(QKeyEvent * e)
{
switch(e->key())
{
case Qt::Key_Delete:
deleteChannel(m_currentFxLine->channelIndex());
deleteChannel(m_currentMixerLine->channelIndex());
break;
case Qt::Key_Left:
if( e->modifiers() & Qt::AltModifier )
{
moveChannelLeft( m_currentFxLine->channelIndex() );
moveChannelLeft( m_currentMixerLine->channelIndex() );
}
else
{
// select channel to the left
setCurrentFxLine( m_currentFxLine->channelIndex()-1 );
setCurrentMixerLine( m_currentMixerLine->channelIndex()-1 );
}
break;
case Qt::Key_Right:
if( e->modifiers() & Qt::AltModifier )
{
moveChannelRight( m_currentFxLine->channelIndex() );
moveChannelRight( m_currentMixerLine->channelIndex() );
}
else
{
// select channel to the right
setCurrentFxLine( m_currentFxLine->channelIndex()+1 );
setCurrentMixerLine( m_currentMixerLine->channelIndex()+1 );
}
break;
case Qt::Key_Insert:
@@ -546,14 +546,14 @@ void FxMixerView::keyPressEvent(QKeyEvent * e)
case Qt::Key_Enter:
case Qt::Key_Return:
case Qt::Key_F2:
renameChannel( m_currentFxLine->channelIndex() );
renameChannel( m_currentMixerLine->channelIndex() );
break;
}
}
void FxMixerView::closeEvent( QCloseEvent * _ce )
void MixerView::closeEvent( QCloseEvent * _ce )
{
if( parentWidget() )
{
@@ -568,19 +568,19 @@ void FxMixerView::closeEvent( QCloseEvent * _ce )
void FxMixerView::setCurrentFxLine( int _line )
void MixerView::setCurrentMixerLine( int _line )
{
if( _line >= 0 && _line < m_fxChannelViews.size() )
if( _line >= 0 && _line < m_mixerChannelViews.size() )
{
setCurrentFxLine( m_fxChannelViews[_line]->m_fxLine );
setCurrentMixerLine( m_mixerChannelViews[_line]->m_mixerLine );
}
}
void FxMixerView::clear()
void MixerView::clear()
{
Engine::fxMixer()->clear();
Engine::mixer()->clear();
refreshDisplay();
}
@@ -588,39 +588,39 @@ void FxMixerView::clear()
void FxMixerView::updateFaders()
void MixerView::updateFaders()
{
FxMixer * m = Engine::fxMixer();
Mixer * m = Engine::mixer();
// apply master gain
m->effectChannel(0)->m_peakLeft *= Engine::audioEngine()->masterGain();
m->effectChannel(0)->m_peakRight *= Engine::audioEngine()->masterGain();
m->mixerChannel(0)->m_peakLeft *= Engine::audioEngine()->masterGain();
m->mixerChannel(0)->m_peakRight *= Engine::audioEngine()->masterGain();
for( int i = 0; i < m_fxChannelViews.size(); ++i )
for( int i = 0; i < m_mixerChannelViews.size(); ++i )
{
const float opl = m_fxChannelViews[i]->m_fader->getPeak_L();
const float opr = m_fxChannelViews[i]->m_fader->getPeak_R();
const float opl = m_mixerChannelViews[i]->m_fader->getPeak_L();
const float opr = m_mixerChannelViews[i]->m_fader->getPeak_R();
const float fallOff = 1.25;
if( m->effectChannel(i)->m_peakLeft >= opl/fallOff )
if( m->mixerChannel(i)->m_peakLeft >= opl/fallOff )
{
m_fxChannelViews[i]->m_fader->setPeak_L( m->effectChannel(i)->m_peakLeft );
m_mixerChannelViews[i]->m_fader->setPeak_L( m->mixerChannel(i)->m_peakLeft );
// Set to -1 so later we'll know if this value has been refreshed yet.
m->effectChannel(i)->m_peakLeft = -1;
m->mixerChannel(i)->m_peakLeft = -1;
}
else if( m->effectChannel(i)->m_peakLeft != -1 )
else if( m->mixerChannel(i)->m_peakLeft != -1 )
{
m_fxChannelViews[i]->m_fader->setPeak_L( opl/fallOff );
m_mixerChannelViews[i]->m_fader->setPeak_L( opl/fallOff );
}
if( m->effectChannel(i)->m_peakRight >= opr/fallOff )
if( m->mixerChannel(i)->m_peakRight >= opr/fallOff )
{
m_fxChannelViews[i]->m_fader->setPeak_R( m->effectChannel(i)->m_peakRight );
m_mixerChannelViews[i]->m_fader->setPeak_R( m->mixerChannel(i)->m_peakRight );
// Set to -1 so later we'll know if this value has been refreshed yet.
m->effectChannel(i)->m_peakRight = -1;
m->mixerChannel(i)->m_peakRight = -1;
}
else if( m->effectChannel(i)->m_peakRight != -1 )
else if( m->mixerChannel(i)->m_peakRight != -1 )
{
m_fxChannelViews[i]->m_fader->setPeak_R( opr/fallOff );
m_mixerChannelViews[i]->m_fader->setPeak_R( opr/fallOff );
}
}
}

View File

@@ -28,7 +28,7 @@
#include "embed.h"
#include "Engine.h"
#include "FxMixerView.h"
#include "MixerView.h"
#include "gui_templates.h"
#include "GuiApplication.h"
#include "Knob.h"
@@ -114,39 +114,39 @@ SampleTrackView::~SampleTrackView()
//FIXME: This is identical to InstrumentTrackView::createFxMenu
QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
//FIXME: This is identical to InstrumentTrackView::createMixerMenu
QMenu * SampleTrackView::createMixerMenu(QString title, QString newMixerLabel)
{
int channelIndex = model()->effectChannelModel()->value();
int channelIndex = model()->mixerChannelModel()->value();
FxChannel *fxChannel = Engine::fxMixer()->effectChannel(channelIndex);
MixerChannel *mixerChannel = Engine::mixer()->mixerChannel(channelIndex);
// If title allows interpolation, pass channel index and name
if (title.contains("%2"))
{
title = title.arg(channelIndex).arg(fxChannel->m_name);
title = title.arg(channelIndex).arg(mixerChannel->m_name);
}
QMenu *fxMenu = new QMenu(title);
QMenu *mixerMenu = new QMenu(title);
fxMenu->addAction(newFxLabel, this, SLOT(createFxLine()));
fxMenu->addSeparator();
mixerMenu->addAction(newMixerLabel, this, SLOT(createMixerLine()));
mixerMenu->addSeparator();
for (int i = 0; i < Engine::fxMixer()->numChannels(); ++i)
for (int i = 0; i < Engine::mixer()->numChannels(); ++i)
{
FxChannel * currentChannel = Engine::fxMixer()->effectChannel(i);
MixerChannel * currentChannel = Engine::mixer()->mixerChannel(i);
if (currentChannel != fxChannel)
if (currentChannel != mixerChannel)
{
const auto index = currentChannel->m_channelIndex;
QString label = tr("FX %1: %2").arg(currentChannel->m_channelIndex).arg(currentChannel->m_name);
fxMenu->addAction(label, [this, index](){
assignFxLine(index);
QString label = tr("%1: %2").arg(currentChannel->m_channelIndex).arg(currentChannel->m_name);
mixerMenu->addAction(label, [this, index](){
assignMixerLine(index);
});
}
}
return fxMenu;
return mixerMenu;
}
@@ -207,25 +207,25 @@ void SampleTrackView::dropEvent(QDropEvent *de)
/*! \brief Create and assign a new FX Channel for this track */
void SampleTrackView::createFxLine()
/*! \brief Create and assign a new mixer Channel for this track */
void SampleTrackView::createMixerLine()
{
int channelIndex = getGUI()->fxMixerView()->addNewChannel();
auto channel = Engine::fxMixer()->effectChannel(channelIndex);
int channelIndex = getGUI()->mixerView()->addNewChannel();
auto channel = Engine::mixer()->mixerChannel(channelIndex);
channel->m_name = getTrack()->name();
if (getTrack()->useColor()) { channel->setColor (getTrack()->color()); }
assignFxLine(channelIndex);
assignMixerLine(channelIndex);
}
/*! \brief Assign a specific FX Channel for this track */
void SampleTrackView::assignFxLine(int channelIndex)
/*! \brief Assign a specific mixer Channel for this track */
void SampleTrackView::assignMixerLine(int channelIndex)
{
model()->effectChannelModel()->setValue(channelIndex);
model()->mixerChannelModel()->setValue(channelIndex);
getGUI()->fxMixerView()->setCurrentFxLine(channelIndex);
getGUI()->mixerView()->setCurrentMixerLine(channelIndex);
}

View File

@@ -113,13 +113,13 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) :
basicControlsLayout->setColumnStretch(2, 1);
// setup spinbox for selecting FX-channel
m_effectChannelNumber = new FxLineLcdSpinBox(2, nullptr, tr("FX channel"), m_stv);
// setup spinbox for selecting Mixer-channel
m_mixerChannelNumber = new MixerLineLcdSpinBox(2, nullptr, tr("Mixer channel"), m_stv);
basicControlsLayout->addWidget(m_effectChannelNumber, 0, 3);
basicControlsLayout->setAlignment(m_effectChannelNumber, widgetAlignment);
basicControlsLayout->addWidget(m_mixerChannelNumber, 0, 3);
basicControlsLayout->setAlignment(m_mixerChannelNumber, widgetAlignment);
label = new QLabel(tr("FX"), this);
label = new QLabel(tr("CHANNEL"), this);
label->setStyleSheet(labelStyleSheet);
basicControlsLayout->addWidget(label, 1, 3);
basicControlsLayout->setAlignment(label, labelAlignment);
@@ -183,7 +183,7 @@ void SampleTrackWindow::modelChanged()
m_volumeKnob->setModel(&m_track->m_volumeModel);
m_panningKnob->setModel(&m_track->m_panningModel);
m_effectChannelNumber->setModel(&m_track->m_effectChannelModel);
m_mixerChannelNumber->setModel(&m_track->m_mixerChannelModel);
updateName();
}

View File

@@ -168,10 +168,10 @@ void TrackView::update()
/*! \brief Create a menu for assigning/creating channels for this track.
*
*/
QMenu * TrackView::createFxMenu(QString title, QString newFxLabel)
QMenu * TrackView::createMixerMenu(QString title, QString newMixerLabel)
{
Q_UNUSED(title)
Q_UNUSED(newFxLabel)
Q_UNUSED(newMixerLabel)
return nullptr;
}

View File

@@ -1,5 +1,5 @@
/*
* FxLine.cpp - FX line widget
* MixerLine.cpp - Mixer line widget
*
* Copyright (c) 2009 Andrew Kelley <superjoe30/at/gmail/dot/com>
* Copyright (c) 2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
@@ -23,19 +23,19 @@
*
*/
#include "FxLine.h"
#include "MixerLine.h"
#include <cstdlib>
#include <QGraphicsProxyWidget>
#include "CaptionMenu.h"
#include "FxMixer.h"
#include "Mixer.h"
#include "gui_templates.h"
#include "GuiApplication.h"
#include "Song.h"
bool FxLine::eventFilter( QObject *dist, QEvent *event )
bool MixerLine::eventFilter( QObject *dist, QEvent *event )
{
// If we are in a rename, capture the enter/return events and handle them
if ( event->type() == QEvent::KeyPress )
@@ -54,11 +54,11 @@ bool FxLine::eventFilter( QObject *dist, QEvent *event )
return false;
}
const int FxLine::FxLineHeight = 287;
QPixmap * FxLine::s_sendBgArrow = nullptr;
QPixmap * FxLine::s_receiveBgArrow = nullptr;
const int MixerLine::MixerLineHeight = 287;
QPixmap * MixerLine::s_sendBgArrow = nullptr;
QPixmap * MixerLine::s_receiveBgArrow = nullptr;
FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex ) :
MixerLine::MixerLine( QWidget * _parent, MixerView * _mv, int _channelIndex ) :
QWidget( _parent ),
m_mv( _mv ),
m_channelIndex( _channelIndex ),
@@ -78,7 +78,7 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex ) :
s_receiveBgArrow = new QPixmap( embed::getIconPixmap( "receive_bg_arrow", 29, 56 ) );
}
setFixedSize( 33, FxLineHeight );
setFixedSize( 33, MixerLineHeight );
setAttribute( Qt::WA_OpaquePaintEvent, true );
setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );
@@ -97,7 +97,7 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex ) :
m_lcd->move( 4, 58 );
m_lcd->setMarginWidth( 1 );
QString name = Engine::fxMixer()->effectChannel( m_channelIndex )->m_name;
QString name = Engine::mixer()->mixerChannel( m_channelIndex )->m_name;
setToolTip( name );
m_renameLineEdit = new QLineEdit();
@@ -108,7 +108,7 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex ) :
m_renameLineEdit->installEventFilter( this );
QGraphicsScene * scene = new QGraphicsScene();
scene->setSceneRect( 0, 0, 33, FxLineHeight );
scene->setSceneRect( 0, 0, 33, MixerLineHeight );
m_view = new QGraphicsView( this );
m_view->setStyleSheet( "border-style: none; background: transparent;" );
@@ -122,14 +122,13 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex ) :
proxyWidget->setPos( 8, 145 );
connect( m_renameLineEdit, SIGNAL( editingFinished() ), this, SLOT( renameFinished() ) );
connect( &Engine::fxMixer()->effectChannel( m_channelIndex )->m_muteModel, SIGNAL( dataChanged() ), this, SLOT( update() ) );
connect( &Engine::mixer()->mixerChannel( m_channelIndex )->m_muteModel, SIGNAL( dataChanged() ), this, SLOT( update() ) );
}
FxLine::~FxLine()
MixerLine::~MixerLine()
{
delete m_sendKnob;
delete m_sendBtn;
@@ -139,7 +138,7 @@ FxLine::~FxLine()
void FxLine::setChannelIndex( int index )
void MixerLine::setChannelIndex( int index )
{
m_channelIndex = index;
m_lcd->setValue( m_channelIndex );
@@ -148,9 +147,9 @@ void FxLine::setChannelIndex( int index )
void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, bool isActive, bool sendToThis, bool receiveFromThis )
void MixerLine::drawMixerLine( QPainter* p, const MixerLine *mixerLine, bool isActive, bool sendToThis, bool receiveFromThis )
{
auto channel = Engine::fxMixer()->effectChannel( m_channelIndex );
auto channel = Engine::mixer()->mixerChannel( m_channelIndex );
bool muted = channel->m_muteModel.value();
QString name = channel->m_name;
QString elidedName = elideName( name );
@@ -159,25 +158,25 @@ void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, bool isActive, bool
m_renameLineEdit->setText( elidedName );
}
int width = fxLine->rect().width();
int height = fxLine->rect().height();
int width = mixerLine->rect().width();
int height = mixerLine->rect().height();
if( channel->m_hasColor && !muted )
{
p->fillRect( fxLine->rect(), channel->m_color.darker( isActive ? 120 : 150 ) );
p->fillRect( mixerLine->rect(), channel->m_color.darker( isActive ? 120 : 150 ) );
}
else
{
p->fillRect( fxLine->rect(),
isActive ? fxLine->backgroundActive().color() : p->background().color() );
p->fillRect( mixerLine->rect(),
isActive ? mixerLine->backgroundActive().color() : p->background().color() );
}
// inner border
p->setPen( isActive ? fxLine->strokeInnerActive() : fxLine->strokeInnerInactive() );
p->setPen( isActive ? mixerLine->strokeInnerActive() : mixerLine->strokeInnerInactive() );
p->drawRect( 1, 1, width-3, height-3 );
// outer border
p->setPen( isActive ? fxLine->strokeOuterActive() : fxLine->strokeOuterInactive() );
p->setPen( isActive ? mixerLine->strokeOuterActive() : mixerLine->strokeOuterInactive() );
p->drawRect( 0, 0, width-1, height-1 );
// draw the mixer send background
@@ -194,7 +193,7 @@ void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, bool isActive, bool
QString FxLine::elideName( const QString & name )
QString MixerLine::elideName( const QString & name )
{
const int maxTextHeight = 60;
QFontMetrics metrics( m_renameLineEdit->font() );
@@ -205,28 +204,28 @@ QString FxLine::elideName( const QString & name )
void FxLine::paintEvent( QPaintEvent * )
void MixerLine::paintEvent( QPaintEvent * )
{
bool sendToThis = Engine::fxMixer()->channelSendModel( m_mv->currentFxLine()->m_channelIndex, m_channelIndex ) != nullptr;
bool receiveFromThis = Engine::fxMixer()->channelSendModel( m_channelIndex, m_mv->currentFxLine()->m_channelIndex ) != nullptr;
bool sendToThis = Engine::mixer()->channelSendModel( m_mv->currentMixerLine()->m_channelIndex, m_channelIndex ) != nullptr;
bool receiveFromThis = Engine::mixer()->channelSendModel( m_channelIndex, m_mv->currentMixerLine()->m_channelIndex ) != nullptr;
QPainter painter;
painter.begin( this );
drawFxLine( &painter, this, m_mv->currentFxLine() == this, sendToThis, receiveFromThis );
drawMixerLine( &painter, this, m_mv->currentMixerLine() == this, sendToThis, receiveFromThis );
painter.end();
}
void FxLine::mousePressEvent( QMouseEvent * )
void MixerLine::mousePressEvent( QMouseEvent * )
{
m_mv->setCurrentFxLine( this );
m_mv->setCurrentMixerLine( this );
}
void FxLine::mouseDoubleClickEvent( QMouseEvent * )
void MixerLine::mouseDoubleClickEvent( QMouseEvent * )
{
renameChannel();
}
@@ -234,9 +233,9 @@ void FxLine::mouseDoubleClickEvent( QMouseEvent * )
void FxLine::contextMenuEvent( QContextMenuEvent * )
void MixerLine::contextMenuEvent( QContextMenuEvent * )
{
QPointer<CaptionMenu> contextMenu = new CaptionMenu( Engine::fxMixer()->effectChannel( m_channelIndex )->m_name, this );
QPointer<CaptionMenu> contextMenu = new CaptionMenu( Engine::mixer()->mixerChannel( m_channelIndex )->m_name, this );
if( m_channelIndex != 0 ) // no move-options in master
{
contextMenu->addAction( tr( "Move &left" ), this, SLOT( moveChannelLeft() ) );
@@ -267,14 +266,14 @@ void FxLine::contextMenuEvent( QContextMenuEvent * )
void FxLine::renameChannel()
void MixerLine::renameChannel()
{
m_inRename = true;
setToolTip( "" );
m_renameLineEdit->setReadOnly( false );
m_lcd->hide();
m_renameLineEdit->setFixedWidth( 135 );
m_renameLineEdit->setText( Engine::fxMixer()->effectChannel( m_channelIndex )->m_name );
m_renameLineEdit->setText( Engine::mixer()->mixerChannel( m_channelIndex )->m_name );
m_view->setFocus();
m_renameLineEdit->selectAll();
m_renameLineEdit->setFocus();
@@ -283,7 +282,7 @@ void FxLine::renameChannel()
void FxLine::renameFinished()
void MixerLine::renameFinished()
{
m_inRename = false;
m_renameLineEdit->deselect();
@@ -292,56 +291,56 @@ void FxLine::renameFinished()
m_lcd->show();
QString newName = m_renameLineEdit->text();
setFocus();
if( !newName.isEmpty() && Engine::fxMixer()->effectChannel( m_channelIndex )->m_name != newName )
if( !newName.isEmpty() && Engine::mixer()->mixerChannel( m_channelIndex )->m_name != newName )
{
Engine::fxMixer()->effectChannel( m_channelIndex )->m_name = newName;
Engine::mixer()->mixerChannel( m_channelIndex )->m_name = newName;
m_renameLineEdit->setText( elideName( newName ) );
Engine::getSong()->setModified();
}
QString name = Engine::fxMixer()->effectChannel( m_channelIndex )->m_name;
QString name = Engine::mixer()->mixerChannel( m_channelIndex )->m_name;
setToolTip( name );
}
void FxLine::removeChannel()
void MixerLine::removeChannel()
{
FxMixerView * mix = getGUI()->fxMixerView();
MixerView * mix = getGUI()->mixerView();
mix->deleteChannel( m_channelIndex );
}
void FxLine::removeUnusedChannels()
void MixerLine::removeUnusedChannels()
{
FxMixerView * mix = getGUI()->fxMixerView();
MixerView * mix = getGUI()->mixerView();
mix->deleteUnusedChannels();
}
void FxLine::moveChannelLeft()
void MixerLine::moveChannelLeft()
{
FxMixerView * mix = getGUI()->fxMixerView();
MixerView * mix = getGUI()->mixerView();
mix->moveChannelLeft( m_channelIndex );
}
void FxLine::moveChannelRight()
void MixerLine::moveChannelRight()
{
FxMixerView * mix = getGUI()->fxMixerView();
MixerView * mix = getGUI()->mixerView();
mix->moveChannelRight( m_channelIndex );
}
QBrush FxLine::backgroundActive() const
QBrush MixerLine::backgroundActive() const
{
return m_backgroundActive;
}
@@ -349,7 +348,7 @@ QBrush FxLine::backgroundActive() const
void FxLine::setBackgroundActive( const QBrush & c )
void MixerLine::setBackgroundActive( const QBrush & c )
{
m_backgroundActive = c;
}
@@ -357,7 +356,7 @@ void FxLine::setBackgroundActive( const QBrush & c )
QColor FxLine::strokeOuterActive() const
QColor MixerLine::strokeOuterActive() const
{
return m_strokeOuterActive;
}
@@ -365,7 +364,7 @@ QColor FxLine::strokeOuterActive() const
void FxLine::setStrokeOuterActive( const QColor & c )
void MixerLine::setStrokeOuterActive( const QColor & c )
{
m_strokeOuterActive = c;
}
@@ -373,7 +372,7 @@ void FxLine::setStrokeOuterActive( const QColor & c )
QColor FxLine::strokeOuterInactive() const
QColor MixerLine::strokeOuterInactive() const
{
return m_strokeOuterInactive;
}
@@ -381,7 +380,7 @@ QColor FxLine::strokeOuterInactive() const
void FxLine::setStrokeOuterInactive( const QColor & c )
void MixerLine::setStrokeOuterInactive( const QColor & c )
{
m_strokeOuterInactive = c;
}
@@ -389,7 +388,7 @@ void FxLine::setStrokeOuterInactive( const QColor & c )
QColor FxLine::strokeInnerActive() const
QColor MixerLine::strokeInnerActive() const
{
return m_strokeInnerActive;
}
@@ -397,7 +396,7 @@ QColor FxLine::strokeInnerActive() const
void FxLine::setStrokeInnerActive( const QColor & c )
void MixerLine::setStrokeInnerActive( const QColor & c )
{
m_strokeInnerActive = c;
}
@@ -405,7 +404,7 @@ void FxLine::setStrokeInnerActive( const QColor & c )
QColor FxLine::strokeInnerInactive() const
QColor MixerLine::strokeInnerInactive() const
{
return m_strokeInnerInactive;
}
@@ -413,16 +412,16 @@ QColor FxLine::strokeInnerInactive() const
void FxLine::setStrokeInnerInactive( const QColor & c )
void MixerLine::setStrokeInnerInactive( const QColor & c )
{
m_strokeInnerInactive = c;
}
// Ask user for a color, and set it as the mixer line color
void FxLine::selectColor()
void MixerLine::selectColor()
{
auto channel = Engine::fxMixer()->effectChannel( m_channelIndex );
auto channel = Engine::mixer()->mixerChannel( m_channelIndex );
auto new_color = ColorChooser(this).withPalette(ColorChooser::Palette::Mixer)->getColor(channel->m_color);
if(!new_color.isValid()) { return; }
channel->setColor (new_color);
@@ -432,18 +431,18 @@ void FxLine::selectColor()
// Disable the usage of color on this mixer line
void FxLine::resetColor()
void MixerLine::resetColor()
{
Engine::fxMixer()->effectChannel( m_channelIndex )->m_hasColor = false;
Engine::mixer()->mixerChannel( m_channelIndex )->m_hasColor = false;
Engine::getSong()->setModified();
update();
}
// Pick a random color from the mixer palette and set it as our color
void FxLine::randomizeColor()
void MixerLine::randomizeColor()
{
auto channel = Engine::fxMixer()->effectChannel( m_channelIndex );
auto channel = Engine::mixer()->mixerChannel( m_channelIndex );
channel->setColor (ColorChooser::getPalette(ColorChooser::Palette::Mixer)[rand() % 48]);
Engine::getSong()->setModified();
update();

View File

@@ -1,5 +1,5 @@
/*
* FxLineLcdSpinBox.cpp - a specialization of LcdSpnBox for setting FX channels
* MixerLineLcdSpinBox.cpp - a specialization of LcdSpnBox for setting mixer channels
*
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -22,29 +22,29 @@
*
*/
#include "FxLineLcdSpinBox.h"
#include "MixerLineLcdSpinBox.h"
#include "CaptionMenu.h"
#include "FxMixerView.h"
#include "MixerView.h"
#include "GuiApplication.h"
#include "TrackView.h"
void FxLineLcdSpinBox::setTrackView(TrackView * tv)
void MixerLineLcdSpinBox::setTrackView(TrackView * tv)
{
m_tv = tv;
}
void FxLineLcdSpinBox::mouseDoubleClickEvent(QMouseEvent* event)
void MixerLineLcdSpinBox::mouseDoubleClickEvent(QMouseEvent* event)
{
getGUI()->fxMixerView()->setCurrentFxLine(model()->value());
getGUI()->mixerView()->setCurrentMixerLine(model()->value());
getGUI()->fxMixerView()->parentWidget()->show();
getGUI()->fxMixerView()->show();// show fxMixer window
getGUI()->fxMixerView()->setFocus();// set focus to fxMixer window
//engine::getFxMixerView()->raise();
getGUI()->mixerView()->parentWidget()->show();
getGUI()->mixerView()->show();// show Mixer window
getGUI()->mixerView()->setFocus();// set focus to Mixer window
//engine::getMixerView()->raise();
}
void FxLineLcdSpinBox::contextMenuEvent(QContextMenuEvent* event)
void MixerLineLcdSpinBox::contextMenuEvent(QContextMenuEvent* event)
{
// for the case, the user clicked right while pressing left mouse-
// button, the context-menu appears while mouse-cursor is still hidden
@@ -54,10 +54,10 @@ void FxLineLcdSpinBox::contextMenuEvent(QContextMenuEvent* event)
QPointer<CaptionMenu> contextMenu = new CaptionMenu(model()->displayName(), this);
if (QMenu *fxMenu = m_tv->createFxMenu(
tr("Assign to:"), tr("New FX Channel")))
if (QMenu *mixerMenu = m_tv->createMixerMenu(
tr("Assign to:"), tr("New Mixer Channel")))
{
contextMenu->addMenu(fxMenu);
contextMenu->addMenu(mixerMenu);
contextMenu->addSeparator();
}

View File

@@ -1,12 +1,12 @@
#include "SendButtonIndicator.h"
#include "FxMixer.h"
#include "Mixer.h"
QPixmap * SendButtonIndicator::s_qpmOff = nullptr;
QPixmap * SendButtonIndicator::s_qpmOn = nullptr;
SendButtonIndicator:: SendButtonIndicator( QWidget * _parent, FxLine * _owner,
FxMixerView * _mv) :
SendButtonIndicator:: SendButtonIndicator( QWidget * _parent, MixerLine * _owner,
MixerView * _mv) :
QLabel( _parent ),
m_parent( _owner ),
m_mv( _mv )
@@ -21,7 +21,7 @@ SendButtonIndicator:: SendButtonIndicator( QWidget * _parent, FxLine * _owner,
s_qpmOn = new QPixmap( embed::getIconPixmap( "mixer_send_on", 29, 20 ) );
}
// don't do any initializing yet, because the FxMixerView and FxLine
// don't do any initializing yet, because the MixerView and MixerLine
// that were passed to this constructor are not done with their constructors
// yet.
setPixmap( *s_qpmOff );
@@ -29,8 +29,8 @@ SendButtonIndicator:: SendButtonIndicator( QWidget * _parent, FxLine * _owner,
void SendButtonIndicator::mousePressEvent( QMouseEvent * e )
{
FxMixer * mix = Engine::fxMixer();
int from = m_mv->currentFxLine()->channelIndex();
Mixer * mix = Engine::mixer();
int from = m_mv->currentMixerLine()->channelIndex();
int to = m_parent->channelIndex();
FloatModel * sendModel = mix->channelSendModel(from, to);
if( sendModel == nullptr )
@@ -44,15 +44,15 @@ void SendButtonIndicator::mousePressEvent( QMouseEvent * e )
mix->deleteChannelSend( from, to );
}
m_mv->updateFxLine(m_parent->channelIndex());
m_mv->updateMixerLine(m_parent->channelIndex());
updateLightStatus();
}
FloatModel * SendButtonIndicator::getSendModel()
{
FxMixer * mix = Engine::fxMixer();
Mixer * mix = Engine::mixer();
return mix->channelSendModel(
m_mv->currentFxLine()->channelIndex(), m_parent->channelIndex());
m_mv->currentMixerLine()->channelIndex(), m_parent->channelIndex());
}
void SendButtonIndicator::updateLightStatus()

View File

@@ -337,9 +337,9 @@ void TrackOperationsWidget::updateMenu()
{
toMenu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) );
}
if (QMenu *fxMenu = m_trackView->createFxMenu(tr("FX %1: %2"), tr("Assign to new FX Channel")))
if (QMenu *mixerMenu = m_trackView->createMixerMenu(tr("Channel %1: %2"), tr("Assign to new Mixer Channel")))
{
toMenu->addMenu(fxMenu);
toMenu->addMenu(mixerMenu);
}
if (InstrumentTrackView * trackView = dynamic_cast<InstrumentTrackView *>(m_trackView))

View File

@@ -29,7 +29,7 @@
#include "ConfigManager.h"
#include "ControllerConnection.h"
#include "DataFile.h"
#include "FxMixer.h"
#include "Mixer.h"
#include "InstrumentTrackView.h"
#include "Instrument.h"
#include "MidiClient.h"
@@ -56,7 +56,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
m_audioPort( tr( "unnamed_track" ), true, &m_volumeModel, &m_panningModel, &m_mutedModel ),
m_pitchModel( 0, MinPitchDefault, MaxPitchDefault, 1, this, tr( "Pitch" ) ),
m_pitchRangeModel( 1, 1, 60, this, tr( "Pitch range" ) ),
m_effectChannelModel( 0, 0, 0, this, tr( "FX channel" ) ),
m_mixerChannelModel( 0, 0, 0, this, tr( "Mixer channel" ) ),
m_useMasterPitchModel( true, this, tr( "Master pitch") ),
m_instrument( nullptr ),
m_soundShaping( this ),
@@ -71,7 +71,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
m_firstKeyModel.setInitValue(0);
m_lastKeyModel.setInitValue(NumKeys - 1);
m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1, 1);
m_mixerChannelModel.setRange( 0, Engine::mixer()->numChannels()-1, 1);
for( int i = 0; i < NumKeys; ++i )
{
@@ -100,7 +100,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
connect(&m_baseNoteModel, SIGNAL(dataChanged()), this, SLOT(updateBaseNote()), Qt::DirectConnection);
connect(&m_pitchModel, SIGNAL(dataChanged()), this, SLOT(updatePitch()), Qt::DirectConnection);
connect(&m_pitchRangeModel, SIGNAL(dataChanged()), this, SLOT(updatePitchRange()), Qt::DirectConnection);
connect(&m_effectChannelModel, SIGNAL(dataChanged()), this, SLOT(updateEffectChannel()), Qt::DirectConnection);
connect(&m_mixerChannelModel, SIGNAL(dataChanged()), this, SLOT(updateMixerChannel()), Qt::DirectConnection);
}
@@ -651,9 +651,9 @@ void InstrumentTrack::updatePitchRange()
void InstrumentTrack::updateEffectChannel()
void InstrumentTrack::updateMixerChannel()
{
m_audioPort.setNextFxChannel( m_effectChannelModel.value() );
m_audioPort.setNextMixerChannel( m_mixerChannelModel.value() );
}
@@ -808,7 +808,7 @@ void InstrumentTrack::saveTrackSpecificSettings( QDomDocument& doc, QDomElement
m_pitchModel.saveSettings( doc, thisElement, "pitch" );
m_pitchRangeModel.saveSettings( doc, thisElement, "pitchrange" );
m_effectChannelModel.saveSettings( doc, thisElement, "fxch" );
m_mixerChannelModel.saveSettings( doc, thisElement, "mixch" );
m_baseNoteModel.saveSettings( doc, thisElement, "basenote" );
m_firstKeyModel.saveSettings(doc, thisElement, "firstkey");
m_lastKeyModel.saveSettings(doc, thisElement, "lastkey");
@@ -871,10 +871,10 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
m_panningModel.loadSettings( thisElement, "pan" );
m_pitchRangeModel.loadSettings( thisElement, "pitchrange" );
m_pitchModel.loadSettings( thisElement, "pitch" );
m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1 );
m_mixerChannelModel.setRange( 0, Engine::mixer()->numChannels()-1 );
if ( !m_previewMode )
{
m_effectChannelModel.loadSettings( thisElement, "fxch" );
m_mixerChannelModel.loadSettings( thisElement, "mixch" );
}
m_baseNoteModel.loadSettings( thisElement, "basenote" );
m_firstKeyModel.loadSettings(thisElement, "firstkey");
@@ -981,8 +981,8 @@ void InstrumentTrack::setPreviewMode( const bool value )
void InstrumentTrack::replaceInstrument(DataFile dataFile)
{
// loadSettings clears the FX channel, so we save it here and set it back later
int effectChannel = effectChannelModel()->value();
// loadSettings clears the mixer channel, so we save it here and set it back later
int mixerChannel = mixerChannelModel()->value();
InstrumentTrack::removeMidiPortNode(dataFile);
setSimpleSerializing();
@@ -998,7 +998,7 @@ void InstrumentTrack::replaceInstrument(DataFile dataFile)
setSolo(oldSolo);
setMutedBeforeSolo(oldMutedBeforeSolo);
m_effectChannelModel.setValue(effectChannel);
m_mixerChannelModel.setValue(mixerChannel);
Engine::getSong()->setModified();
}

View File

@@ -38,15 +38,15 @@ SampleTrack::SampleTrack(TrackContainer* tc) :
Track(Track::SampleTrack, tc),
m_volumeModel(DefaultVolume, MinVolume, MaxVolume, 0.1f, this, tr("Volume")),
m_panningModel(DefaultPanning, PanningLeft, PanningRight, 0.1f, this, tr("Panning")),
m_effectChannelModel(0, 0, 0, this, tr("FX channel")),
m_mixerChannelModel(0, 0, 0, this, tr("Mixer channel")),
m_audioPort(tr("Sample track"), true, &m_volumeModel, &m_panningModel, &m_mutedModel),
m_isPlaying(false)
{
setName(tr("Sample track"));
m_panningModel.setCenterValue(DefaultPanning);
m_effectChannelModel.setRange(0, Engine::fxMixer()->numChannels()-1, 1);
m_mixerChannelModel.setRange(0, Engine::mixer()->numChannels()-1, 1);
connect(&m_effectChannelModel, SIGNAL(dataChanged()), this, SLOT(updateEffectChannel()));
connect(&m_mixerChannelModel, SIGNAL(dataChanged()), this, SLOT(updateMixerChannel()));
}
@@ -186,7 +186,7 @@ void SampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
#endif
m_volumeModel.saveSettings( _doc, _this, "vol" );
m_panningModel.saveSettings( _doc, _this, "pan" );
m_effectChannelModel.saveSettings( _doc, _this, "fxch" );
m_mixerChannelModel.saveSettings( _doc, _this, "mixch" );
}
@@ -209,8 +209,8 @@ void SampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
}
m_volumeModel.loadSettings( _this, "vol" );
m_panningModel.loadSettings( _this, "pan" );
m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels() - 1 );
m_effectChannelModel.loadSettings( _this, "fxch" );
m_mixerChannelModel.setRange( 0, Engine::mixer()->numChannels() - 1 );
m_mixerChannelModel.loadSettings( _this, "mixch" );
}
@@ -238,7 +238,7 @@ void SampleTrack::setPlayingTcos( bool isPlaying )
void SampleTrack::updateEffectChannel()
void SampleTrack::updateMixerChannel()
{
m_audioPort.setNextFxChannel( m_effectChannelModel.value() );
m_audioPort.setNextMixerChannel( m_mixerChannelModel.value() );
}