summaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/auxiliary.cpp19
-rw-r--r--src/mixer/auxiliary.h12
-rw-r--r--src/mixer/microphone.cpp4
-rw-r--r--src/mixer/microphone.h6
-rw-r--r--src/mixer/playermanager.cpp2
-rw-r--r--src/mixer/playermanager.h4
6 files changed, 41 insertions, 6 deletions
diff --git a/src/mixer/auxiliary.cpp b/src/mixer/auxiliary.cpp
index c6a7c08fca..1d453cc958 100644
--- a/src/mixer/auxiliary.cpp
+++ b/src/mixer/auxiliary.cpp
@@ -1,7 +1,8 @@
#include "mixer/auxiliary.h"
-#include "engine/channels/engineaux.h"
+#include "control/controlproxy.h"
#include "engine/enginemaster.h"
+#include "engine/channels/engineaux.h"
#include "soundio/soundmanager.h"
#include "soundio/soundmanagerutil.h"
@@ -14,7 +15,23 @@ Auxiliary::Auxiliary(QObject* pParent, const QString& group, int index,
pEngine->addChannel(pAuxiliary);
AudioInput auxInput = AudioInput(AudioPath::AUXILIARY, 0, 2, index);
pSoundManager->registerInput(auxInput, pAuxiliary);
+
+ m_pInputConfigured = make_parented<ControlProxy>(group, "input_configured", this);
+ m_pAuxMasterEnabled = make_parented<ControlProxy>(group, "master", this);
+ m_pAuxMasterEnabled->connectValueChanged(this, &Auxiliary::slotAuxMasterEnabled);
}
Auxiliary::~Auxiliary() {
}
+
+void Auxiliary::slotAuxMasterEnabled(double v) {
+ bool configured = m_pInputConfigured->toBool();
+ bool auxMasterEnable = v > 0.0;
+
+ // Warn the user if they try to enable master on a auxiliary with no
+ // configured input.
+ if (!configured && auxMasterEnable) {
+ m_pAuxMasterEnabled->set(0.0);
+ emit(noAuxiliaryInputConfigured());
+ }
+}
diff --git a/src/mixer/auxiliary.h b/src/mixer/auxiliary.h
index e350aaf7af..ef44f6bec1 100644
--- a/src/mixer/auxiliary.h
+++ b/src/mixer/auxiliary.h
@@ -5,7 +5,9 @@
#include <QString>
#include "mixer/baseplayer.h"
+#include "util/parented_ptr.h"
+class ControlProxy;
class EffectsManager;
class EngineMaster;
class SoundManager;
@@ -20,6 +22,16 @@ class Auxiliary : public BasePlayer {
EngineMaster* pMixingEngine,
EffectsManager* pEffectsManager);
virtual ~Auxiliary();
+
+ signals:
+ void noAuxiliaryInputConfigured();
+
+ private slots:
+ void slotAuxMasterEnabled(double v);
+
+ private:
+ parented_ptr<ControlProxy> m_pInputConfigured;
+ parented_ptr<ControlProxy> m_pAuxMasterEnabled;
};
#endif /* MIXER_AUXILIARY_H */
diff --git a/src/mixer/microphone.cpp b/src/mixer/microphone.cpp
index 12cf31b0f6..aa3ddcaf67 100644
--- a/src/mixer/microphone.cpp
+++ b/src/mixer/microphone.cpp
@@ -17,8 +17,8 @@ Microphone::Microphone(QObject* pParent, const QString& group, int index,
AudioInput micInput = AudioInput(AudioPath::MICROPHONE, 0, 2, index);
pSoundManager->registerInput(micInput, pMicrophone);
- m_pInputConfigured.reset(new ControlProxy(group, "input_configured", this));
- m_pTalkoverEnabled.reset(new ControlProxy(group, "talkover", this));
+ m_pInputConfigured = make_parented<ControlProxy>(group, "input_configured", this);
+ m_pTalkoverEnabled = make_parented<ControlProxy>(group, "talkover", this);
m_pTalkoverEnabled->connectValueChanged(this, &Microphone::slotTalkoverEnabled);
}
diff --git a/src/mixer/microphone.h b/src/mixer/microphone.h
index b85a5e2a94..4c434e8236 100644
--- a/src/mixer/microphone.h
+++ b/src/mixer/microphone.h
@@ -2,10 +2,10 @@
#define MIXER_MICROPHONE_H
#include <QObject>
-#include <QScopedPointer>
#include <QString>
#include "mixer/baseplayer.h"
+#include "util/parented_ptr.h"
class ControlProxy;
class EffectsManager;
@@ -30,8 +30,8 @@ class Microphone : public BasePlayer {
void slotTalkoverEnabled(double v);
private:
- QScopedPointer<ControlProxy> m_pInputConfigured;
- QScopedPointer<ControlProxy> m_pTalkoverEnabled;
+ parented_ptr<ControlProxy> m_pInputConfigured;
+ parented_ptr<ControlProxy> m_pTalkoverEnabled;
};
#endif /* MIXER_MICROPHONE_H */
diff --git a/src/mixer/playermanager.cpp b/src/mixer/playermanager.cpp
index 3ce943786d..727faa1899 100644
--- a/src/mixer/playermanager.cpp
+++ b/src/mixer/playermanager.cpp
@@ -501,6 +501,8 @@ void PlayerManager::addAuxiliaryInner() {
Auxiliary* pAuxiliary = new Auxiliary(this, group, index, m_pSoundManager,
m_pEngine, m_pEffectsManager);
+ connect(pAuxiliary, SIGNAL(noAuxiliaryInputConfigured()),
+ this, SIGNAL(noAuxiliaryInputConfigured()));
m_auxiliaries.append(pAuxiliary);
}
diff --git a/src/mixer/playermanager.h b/src/mixer/playermanager.h
index 8298167184..b868764afe 100644
--- a/src/mixer/playermanager.h
+++ b/src/mixer/playermanager.h
@@ -217,6 +217,10 @@ class PlayerManager : public QObject, public PlayerManagerInterface {
// there is no input configured.
void noMicrophoneInputConfigured();
+ // Emitted when the user tries to enable an auxiliary master control when
+ // there is no input configured.
+ void noAuxiliaryInputConfigured();
+
// Emitted when the user tries to enable deck passthrough when there is no
// input configured.
void noDeckPassthroughInputConfigured();