Skip to content

Commit

Permalink
Merge pull request mixxxdj#289 from ywwg/mac-disable-reverb
Browse files Browse the repository at this point in the history
Create new appstore scons option for Mac App Store builds.
  • Loading branch information
ywwg committed Jul 8, 2014
2 parents ef15048 + 1d0eded commit 6e91e44
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ available_features = [features.Mad,
features.HSS1394,
features.HID,
features.Bulk,
features.MacAppStoreException,
features.VinylControl,
features.Shoutcast,
features.Opus,
Expand Down
26 changes: 26 additions & 0 deletions build/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ def description(self):
def enabled(self, build):
build.flags['vinylcontrol'] = util.get_flags(build.env,
'vinylcontrol', 0)
# Existence of the macappstore option forces vinylcontrol off due to
# licensing issues.
if build.flags.has_key('macappstore') and int(build.flags['macappstore']):
return False
if int(build.flags['vinylcontrol']):
return True
return False
Expand Down Expand Up @@ -1285,3 +1289,25 @@ def configure(self, build, conf):

def sources(self, build):
return ['library/dao/autodjcratesdao.cpp']

class MacAppStoreException(Feature):
def description(self):
return "Build for Mac App Store"

def enabled(self, build):
build.flags['macappstore'] = util.get_flags(build.env,
'macappstore', 0)
if int(build.flags['macappstore']):
# Existence of the macappstore option forces vinylcontrol off due to
# licensing issues.
build.flags['vinylcontrol'] = 0
return True
return False

def add_options(self, build, vars):
vars.Add('macappstore', 'Set to 1 to indicate the build is for the Mac App Store', 1)

def configure(self, build, conf):
if not self.enabled(build):
return
build.env.Append(CPPDEFINES='__MACAPPSTORE__')
2 changes: 2 additions & 0 deletions src/effects/effectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,14 @@ void EffectsManager::setupDefaults() {
pChain->addEffect(pEffect);
m_pEffectChainManager->addEffectChain(pChain);

#ifndef __MACAPPSTORE__
pChain = EffectChainPointer(new EffectChain(
this, "org.mixxx.effectchain.reverb"));
pChain->setName(tr("Reverb"));
pEffect = instantiateEffect("org.mixxx.effects.reverb");
pChain->addEffect(pEffect);
m_pEffectChainManager->addEffectChain(pChain);
#endif

pChain = EffectChainPointer(new EffectChain(
this, "org.mixxx.effectchain.echo"));
Expand Down
4 changes: 4 additions & 0 deletions src/effects/native/nativebackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
#include "effects/native/bitcrushereffect.h"
#include "effects/native/butterwortheqeffect.h"
#include "effects/native/filtereffect.h"
#ifndef __MACAPPSTORE__
#include "effects/native/reverbeffect.h"
#endif
#include "effects/native/echoeffect.h"

NativeBackend::NativeBackend(QObject* pParent)
: EffectsBackend(pParent, tr("Native")) {
registerEffect<FlangerEffect>();
registerEffect<BitCrusherEffect>();
registerEffect<FilterEffect>();
#ifndef __MACAPPSTORE__
registerEffect<ReverbEffect>();
#endif
registerEffect<EchoEffect>();
registerEffect<ButterworthEQEffect>();
}
Expand Down
2 changes: 2 additions & 0 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,7 @@ void MixxxMainWindow::slotControlVinylControl(int deck) {
}

void MixxxMainWindow::slotControlPassthrough(int index) {
#ifdef __VINYLCONTROL__
if (index >= kMaximumVinylControlInputs || index >= m_iNumConfiguredDecks) {
qWarning() << "Tried to activate passthrough on a deck that we "
"haven't configured -- ignoring request.";
Expand All @@ -1593,6 +1594,7 @@ void MixxxMainWindow::slotControlPassthrough(int index) {
m_pPrefDlg->show();
m_pPrefDlg->showSoundHardwarePage();
}
#endif
}

void MixxxMainWindow::slotControlAuxiliary(int index) {
Expand Down

0 comments on commit 6e91e44

Please sign in to comment.