Skip to content

Commit

Permalink
Rename handle_group to handleGroup globally
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jul 30, 2020
1 parent 39974bc commit 1bbbd48
Show file tree
Hide file tree
Showing 28 changed files with 106 additions and 106 deletions.
24 changes: 12 additions & 12 deletions src/effects/effectchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ void EffectChain::setEnabled(bool enabled) {
emit enabledChanged(enabled);
}

void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handle_group) {
void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handleGroup) {
// TODO(Be): remove m_enabledChannels from this class and move this logic
// to EffectChainSlot
bool bWasAlreadyEnabled = m_enabledInputChannels.contains(handle_group);
bool bWasAlreadyEnabled = m_enabledInputChannels.contains(handleGroup);
if (!bWasAlreadyEnabled) {
m_enabledInputChannels.insert(handle_group);
m_enabledInputChannels.insert(handleGroup);
}

// The allocation of EffectStates below may be expensive, so avoid it if
Expand All @@ -172,7 +172,7 @@ void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handle_grou
EffectsRequest* request = new EffectsRequest();
request->type = EffectsRequest::ENABLE_EFFECT_CHAIN_FOR_INPUT_CHANNEL;
request->pTargetChain = m_pEngineEffectChain;
request->EnableInputChannelForChain.pChannelHandle = &handle_group.handle();
request->EnableInputChannelForChain.pChannelHandle = &handleGroup.handle();

// Allocate EffectStates here in the main thread to avoid allocating
// memory in the realtime audio callback thread. Pointers to the
Expand All @@ -191,7 +191,7 @@ void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handle_grou
if (m_effects[i] != nullptr) {
for (const auto& outputChannel : m_pEffectsManager->registeredOutputChannels()) {
if (kEffectDebugOutput) {
qDebug() << debugString() << "EffectChain::enableForInputChannel creating EffectState for input" << handle_group << "output" << outputChannel;
qDebug() << debugString() << "EffectChain::enableForInputChannel creating EffectState for input" << handleGroup << "output" << outputChannel;
}
statesMap.insert(outputChannel.handle(),
m_effects[i]->createState(bufferParameters));
Expand All @@ -208,25 +208,25 @@ void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handle_grou
request->EnableInputChannelForChain.pEffectStatesMapArray = pEffectStatesMapArray;

m_pEffectsManager->writeRequest(request);
emit channelStatusChanged(handle_group.name(), true);
emit channelStatusChanged(handleGroup.name(), true);
}

bool EffectChain::enabledForChannel(const ChannelHandleAndGroup& handle_group) const {
return m_enabledInputChannels.contains(handle_group);
bool EffectChain::enabledForChannel(const ChannelHandleAndGroup& handleGroup) const {
return m_enabledInputChannels.contains(handleGroup);
}

void EffectChain::disableForInputChannel(const ChannelHandleAndGroup& handle_group) {
if (m_enabledInputChannels.remove(handle_group)) {
void EffectChain::disableForInputChannel(const ChannelHandleAndGroup& handleGroup) {
if (m_enabledInputChannels.remove(handleGroup)) {
if (!m_bAddedToEngine) {
return;
}
EffectsRequest* request = new EffectsRequest();
request->type = EffectsRequest::DISABLE_EFFECT_CHAIN_FOR_INPUT_CHANNEL;
request->pTargetChain = m_pEngineEffectChain;
request->DisableInputChannelForChain.pChannelHandle = &handle_group.handle();
request->DisableInputChannelForChain.pChannelHandle = &handleGroup.handle();
m_pEffectsManager->writeRequest(request);

emit channelStatusChanged(handle_group.name(), false);
emit channelStatusChanged(handleGroup.name(), false);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/effects/effectchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class EffectChain : public QObject {
void setEnabled(bool enabled);

// Activates EffectChain processing for the provided channel.
void enableForInputChannel(const ChannelHandleAndGroup& handle_group);
bool enabledForChannel(const ChannelHandleAndGroup& handle_group) const;
void enableForInputChannel(const ChannelHandleAndGroup& handleGroup);
bool enabledForChannel(const ChannelHandleAndGroup& handleGroup) const;
const QSet<ChannelHandleAndGroup>& enabledChannels() const;
void disableForInputChannel(const ChannelHandleAndGroup& handle_group);
void disableForInputChannel(const ChannelHandleAndGroup& handleGroup);

EffectChainPointer prototype() const;

Expand Down
14 changes: 7 additions & 7 deletions src/effects/effectchainmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ EffectChainManager::~EffectChainManager() {
//qDebug() << debugString() << "destroyed";
}

void EffectChainManager::registerInputChannel(const ChannelHandleAndGroup& handle_group) {
VERIFY_OR_DEBUG_ASSERT(!m_registeredInputChannels.contains(handle_group)) {
void EffectChainManager::registerInputChannel(const ChannelHandleAndGroup& handleGroup) {
VERIFY_OR_DEBUG_ASSERT(!m_registeredInputChannels.contains(handleGroup)) {
return;
}
m_registeredInputChannels.insert(handle_group);
m_registeredInputChannels.insert(handleGroup);

for (auto& pRack : m_standardEffectRacks) {
pRack->registerInputChannel(handle_group);
pRack->registerInputChannel(handleGroup);
}
}

void EffectChainManager::registerOutputChannel(const ChannelHandleAndGroup& handle_group) {
VERIFY_OR_DEBUG_ASSERT(!m_registeredOutputChannels.contains(handle_group)) {
void EffectChainManager::registerOutputChannel(const ChannelHandleAndGroup& handleGroup) {
VERIFY_OR_DEBUG_ASSERT(!m_registeredOutputChannels.contains(handleGroup)) {
return;
}
m_registeredOutputChannels.insert(handle_group);
m_registeredOutputChannels.insert(handleGroup);
}

StandardEffectRackPointer EffectChainManager::addStandardEffectRack() {
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effectchainmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class EffectChainManager : public QObject {
EffectsManager* pEffectsManager);
virtual ~EffectChainManager();

void registerInputChannel(const ChannelHandleAndGroup& handle_group);
void registerInputChannel(const ChannelHandleAndGroup& handleGroup);
const QSet<ChannelHandleAndGroup>& registeredInputChannels() const {
return m_registeredInputChannels;
}

void registerOutputChannel(const ChannelHandleAndGroup& handle_group);
void registerOutputChannel(const ChannelHandleAndGroup& handleGroup);
const QSet<ChannelHandleAndGroup>& registeredOutputChannels() const {
return m_registeredOutputChannels;
}
Expand Down
31 changes: 15 additions & 16 deletions src/effects/effectchainslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ void EffectChainSlot::updateRoutingSwitches() {
}
for (const ChannelInfo* pChannelInfo : m_channelInfoByName) {
if (pChannelInfo->pEnabled->toBool()) {
m_pEffectChain->enableForInputChannel(pChannelInfo->handle_group);
m_pEffectChain->enableForInputChannel(pChannelInfo->handleGroup);
} else {
m_pEffectChain->disableForInputChannel(pChannelInfo->handle_group);
m_pEffectChain->disableForInputChannel(pChannelInfo->handleGroup);
}
}
}
Expand Down Expand Up @@ -314,27 +314,26 @@ EffectSlotPointer EffectChainSlot::addEffectSlot(const QString& group) {
return pSlot;
}

void EffectChainSlot::registerInputChannel(const ChannelHandleAndGroup& handle_group) {
VERIFY_OR_DEBUG_ASSERT(!m_channelInfoByName.contains(handle_group.name())) {
void EffectChainSlot::registerInputChannel(const ChannelHandleAndGroup& handleGroup) {
VERIFY_OR_DEBUG_ASSERT(!m_channelInfoByName.contains(handleGroup.name())) {
return;
}

double initialValue = 0.0;
int deckNumber;
if (PlayerManager::isDeckGroup(handle_group.name(), &deckNumber) &&
(m_iChainSlotNumber + 1) == (unsigned) deckNumber) {
if (PlayerManager::isDeckGroup(handleGroup.name(), &deckNumber) &&
(m_iChainSlotNumber + 1) == (unsigned)deckNumber) {
initialValue = 1.0;
}
ControlPushButton* pEnableControl = new ControlPushButton(
ConfigKey(m_group, QString("group_%1_enable").arg(handle_group.name())),
true, initialValue);
ConfigKey(m_group, QString("group_%1_enable").arg(handleGroup.name())),
true,
initialValue);
pEnableControl->setButtonMode(ControlPushButton::POWERWINDOW);

ChannelInfo* pInfo = new ChannelInfo(handle_group, pEnableControl);
m_channelInfoByName[handle_group.name()] = pInfo;
connect(pEnableControl, &ControlPushButton::valueChanged,
this, [this, handle_group] { slotChannelStatusChanged(handle_group.name()); });

ChannelInfo* pInfo = new ChannelInfo(handleGroup, pEnableControl);
m_channelInfoByName[handleGroup.name()] = pInfo;
connect(pEnableControl, &ControlPushButton::valueChanged, this, [this, handleGroup] { slotChannelStatusChanged(handleGroup.name()); });
}

void EffectChainSlot::slotEffectLoaded(EffectPointer pEffect, unsigned int slotNumber) {
Expand Down Expand Up @@ -433,12 +432,12 @@ void EffectChainSlot::slotControlChainPrevPreset(double v) {
void EffectChainSlot::slotChannelStatusChanged(const QString& group) {
if (m_pEffectChain) {
ChannelInfo* pChannelInfo = m_channelInfoByName.value(group, NULL);
if (pChannelInfo != NULL && pChannelInfo->pEnabled != NULL) {
if (pChannelInfo != nullptr && pChannelInfo->pEnabled != nullptr) {
bool bEnable = pChannelInfo->pEnabled->toBool();
if (bEnable) {
m_pEffectChain->enableForInputChannel(pChannelInfo->handle_group);
m_pEffectChain->enableForInputChannel(pChannelInfo->handleGroup);
} else {
m_pEffectChain->disableForInputChannel(pChannelInfo->handle_group);
m_pEffectChain->disableForInputChannel(pChannelInfo->handleGroup);
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/effects/effectchainslot.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class EffectChainSlot : public QObject {
EffectChainPointer getEffectChain() const;
EffectChainPointer getOrCreateEffectChain(EffectsManager* pEffectsManager);

void registerInputChannel(const ChannelHandleAndGroup& handle_group);
void registerInputChannel(const ChannelHandleAndGroup& handleGroup);

double getSuperParameter() const;
void setSuperParameter(double value, bool force = false);
Expand Down Expand Up @@ -153,15 +153,14 @@ class EffectChainSlot : public QObject {

struct ChannelInfo {
// Takes ownership of pEnabled.
ChannelInfo(const ChannelHandleAndGroup& handle_group, ControlObject* pEnabled)
: handle_group(handle_group),
ChannelInfo(const ChannelHandleAndGroup& handleGroup, ControlObject* pEnabled)
: handleGroup(handleGroup),
pEnabled(pEnabled) {

}
~ChannelInfo() {
delete pEnabled;
}
ChannelHandleAndGroup handle_group;
ChannelHandleAndGroup handleGroup;
ControlObject* pEnabled;
};
QMap<QString, ChannelInfo*> m_channelInfoByName;
Expand Down
22 changes: 11 additions & 11 deletions src/effects/effectrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ void EffectRack::removeFromEngine() {
m_pEngineEffectRack = NULL;
}

void EffectRack::registerInputChannel(const ChannelHandleAndGroup& handle_group) {
void EffectRack::registerInputChannel(const ChannelHandleAndGroup& handleGroup) {
foreach (EffectChainSlotPointer pChainSlot, m_effectChainSlots) {
pChainSlot->registerInputChannel(handle_group);
pChainSlot->registerInputChannel(handleGroup);
}
}

Expand Down Expand Up @@ -260,8 +260,8 @@ EffectChainSlotPointer StandardEffectRack::addEffectChainSlot() {
// Register all the existing channels with the new EffectChain.
const QSet<ChannelHandleAndGroup>& registeredChannels =
m_pEffectChainManager->registeredInputChannels();
for (const ChannelHandleAndGroup& handle_group : registeredChannels) {
pChainSlot->registerInputChannel(handle_group);
for (const ChannelHandleAndGroup& handleGroup : registeredChannels) {
pChainSlot->registerInputChannel(handleGroup);
}

EffectChainSlotPointer pChainSlotPointer = EffectChainSlotPointer(pChainSlot);
Expand Down Expand Up @@ -300,9 +300,9 @@ OutputEffectRack::OutputEffectRack(EffectsManager* pEffectsManager,
// TODO(Be): Remove this hideous hack to get the ChannelHandleAndGroup
const QSet<ChannelHandleAndGroup>& registeredChannels =
m_pEffectChainManager->registeredInputChannels();
for (const ChannelHandleAndGroup& handle_group : registeredChannels) {
if (handle_group.name() == "[MasterOutput]") {
masterHandleAndGroup = &handle_group;
for (const ChannelHandleAndGroup& handleGroup : registeredChannels) {
if (handleGroup.name() == "[MasterOutput]") {
masterHandleAndGroup = &handleGroup;
break;
}
}
Expand Down Expand Up @@ -349,10 +349,10 @@ void PerGroupRack::setupForGroup(const QString& groupName) {

// TODO(rryan): remove.
const ChannelHandleAndGroup* handleAndGroup = nullptr;
for (const ChannelHandleAndGroup& handle_group :
m_pEffectChainManager->registeredInputChannels()) {
if (handle_group.name() == groupName) {
handleAndGroup = &handle_group;
for (const ChannelHandleAndGroup& handleGroup :
m_pEffectChainManager->registeredInputChannels()) {
if (handleGroup.name() == groupName) {
handleAndGroup = &handleGroup;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/effects/effectrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EffectRack : public QObject {
void removeFromEngine();
EngineEffectRack* getEngineEffectRack();

void registerInputChannel(const ChannelHandleAndGroup& handle_group);
void registerInputChannel(const ChannelHandleAndGroup& handleGroup);
int numEffectChainSlots() const;
EffectChainSlotPointer getEffectChainSlot(int i);

Expand Down
8 changes: 4 additions & 4 deletions src/effects/effectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ void EffectsManager::slotBackendRegisteredEffect(EffectManifestPointer pManifest
m_pNumEffectsAvailable->forceSet(m_availableEffectManifests.size());
}

void EffectsManager::registerInputChannel(const ChannelHandleAndGroup& handle_group) {
m_pEffectChainManager->registerInputChannel(handle_group);
void EffectsManager::registerInputChannel(const ChannelHandleAndGroup& handleGroup) {
m_pEffectChainManager->registerInputChannel(handleGroup);
}

const QSet<ChannelHandleAndGroup>& EffectsManager::registeredInputChannels() const {
return m_pEffectChainManager->registeredInputChannels();
}

void EffectsManager::registerOutputChannel(const ChannelHandleAndGroup& handle_group) {
m_pEffectChainManager->registerOutputChannel(handle_group);
void EffectsManager::registerOutputChannel(const ChannelHandleAndGroup& handleGroup) {
m_pEffectChainManager->registerOutputChannel(handleGroup);
}

const QSet<ChannelHandleAndGroup>& EffectsManager::registeredOutputChannels() const {
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effectsmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class EffectsManager : public QObject {
// takes ownership of the backend, and will delete it when EffectsManager is
// being deleted. Not thread safe -- use only from the GUI thread.
void addEffectsBackend(EffectsBackend* pEffectsBackend);
void registerInputChannel(const ChannelHandleAndGroup& handle_group);
void registerOutputChannel(const ChannelHandleAndGroup& handle_group);
void registerInputChannel(const ChannelHandleAndGroup& handleGroup);
void registerOutputChannel(const ChannelHandleAndGroup& handleGroup);
const QSet<ChannelHandleAndGroup>& registeredInputChannels() const;
const QSet<ChannelHandleAndGroup>& registeredOutputChannels() const;

Expand Down
4 changes: 2 additions & 2 deletions src/engine/channelhandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ inline QDebug operator<<(QDebug stream, const ChannelHandleAndGroup& g) {
}

inline uint qHash(
const ChannelHandleAndGroup& handle_group,
const ChannelHandleAndGroup& handleGroup,
uint seed = 0) {
return qHash(handle_group.handle(), seed);
return qHash(handleGroup.handle(), seed);
}

// A helper class used by EngineMaster to assign ChannelHandles to channel group
Expand Down
4 changes: 2 additions & 2 deletions src/engine/channels/engineaux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "engine/effects/engineeffectsmanager.h"
#include "util/sample.h"

EngineAux::EngineAux(const ChannelHandleAndGroup& handle_group, EffectsManager* pEffectsManager)
: EngineChannel(handle_group, EngineChannel::CENTER, pEffectsManager,
EngineAux::EngineAux(const ChannelHandleAndGroup& handleGroup, EffectsManager* pEffectsManager)
: EngineChannel(handleGroup, EngineChannel::CENTER, pEffectsManager,
/*isTalkoverChannel*/ false,
/*isPrimaryDeck*/ false),
m_pInputConfigured(new ControlObject(ConfigKey(getGroup(), "input_configured"))),
Expand Down
2 changes: 1 addition & 1 deletion src/engine/channels/engineaux.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ControlAudioTaperPot;
class EngineAux : public EngineChannel, public AudioDestination {
Q_OBJECT
public:
EngineAux(const ChannelHandleAndGroup& handle_group, EffectsManager* pEffectsManager);
EngineAux(const ChannelHandleAndGroup& handleGroup, EffectsManager* pEffectsManager);
virtual ~EngineAux();

bool isActive();
Expand Down
6 changes: 3 additions & 3 deletions src/engine/channels/enginechannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#include "control/controlobject.h"
#include "control/controlpushbutton.h"

EngineChannel::EngineChannel(const ChannelHandleAndGroup& handle_group,
EngineChannel::EngineChannel(const ChannelHandleAndGroup& handleGroup,
EngineChannel::ChannelOrientation defaultOrientation,
EffectsManager* pEffectsManager,
bool isTalkoverChannel,
bool isPrimaryDeck)
: m_group(handle_group),
: m_group(handleGroup),
m_pEffectsManager(pEffectsManager),
m_vuMeter(getGroup()),
m_pSampleRate(new ControlProxy("[Master]", "samplerate")),
Expand Down Expand Up @@ -53,7 +53,7 @@ EngineChannel::EngineChannel(const ChannelHandleAndGroup& handle_group,
m_pTalkover->setButtonMode(ControlPushButton::POWERWINDOW);

if (m_pEffectsManager != nullptr) {
m_pEffectsManager->registerInputChannel(handle_group);
m_pEffectsManager->registerInputChannel(handleGroup);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/engine/channels/enginechannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class EngineChannel : public EngineObject {
RIGHT,
};

EngineChannel(const ChannelHandleAndGroup& handle_group,
EngineChannel(const ChannelHandleAndGroup& handleGroup,
ChannelOrientation defaultOrientation,
EffectsManager* pEffectsManager,
bool isTalkoverChannel,
Expand Down
5 changes: 3 additions & 2 deletions src/engine/channels/enginedeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
#include "util/sample.h"
#include "waveform/waveformwidgetfactory.h"

EngineDeck::EngineDeck(const ChannelHandleAndGroup& handle_group,
EngineDeck::EngineDeck(
const ChannelHandleAndGroup& handleGroup,
UserSettingsPointer pConfig,
EngineMaster* pMixingEngine,
EffectsManager* pEffectsManager,
EngineChannel::ChannelOrientation defaultOrientation,
bool primaryDeck)
: EngineChannel(handle_group, defaultOrientation, pEffectsManager,
: EngineChannel(handleGroup, defaultOrientation, pEffectsManager,
/*isTalkoverChannel*/ false,
primaryDeck),
m_pConfig(pConfig),
Expand Down
Loading

0 comments on commit 1bbbd48

Please sign in to comment.