Skip to content

Commit

Permalink
Report correct channel count when registering AudioPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Mar 28, 2016
1 parent 9368a38 commit 9a424c9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/mixer/auxiliary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Auxiliary::Auxiliary(QObject* pParent, const QString& group, int index,
ChannelHandleAndGroup channelGroup = pEngine->registerChannelGroup(group);
EngineAux* pAuxiliary = new EngineAux(channelGroup, pEffectsManager);
pEngine->addChannel(pAuxiliary);
AudioInput auxInput = AudioInput(AudioPath::AUXILIARY, 0, 0, index);
AudioInput auxInput = AudioInput(AudioPath::AUXILIARY, 0, 2, index);
pSoundManager->registerInput(auxInput, pAuxiliary);
}

Expand Down
2 changes: 1 addition & 1 deletion src/mixer/microphone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Microphone::Microphone(QObject* pParent, const QString& group, int index,
EngineMicrophone* pMicrophone =
new EngineMicrophone(channelGroup, pEffectsManager);
pEngine->addChannel(pMicrophone);
AudioInput micInput = AudioInput(AudioPath::MICROPHONE, 0, 0, index);
AudioInput micInput = AudioInput(AudioPath::MICROPHONE, 0, 2, index);
pSoundManager->registerInput(micInput, pMicrophone);

m_pInputConfigured.reset(new ControlObjectSlave(group, "input_configured", this));
Expand Down
17 changes: 6 additions & 11 deletions src/mixer/playermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ PlayerManager::PlayerManager(UserSettingsPointer pConfig,
Q_UNUSED(pSamplerBank);

// register the engine's outputs
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::MASTER),
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::MASTER, 0, 2),
m_pEngine);
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::HEADPHONES),
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::HEADPHONES, 0, 2),
m_pEngine);
for (int o = EngineChannel::LEFT; o <= EngineChannel::RIGHT; o++) {
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::BUS, 0, 0, o),
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::BUS, 0, 2, o),
m_pEngine);
}
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::SIDECHAIN),
m_pSoundManager->registerOutput(AudioOutput(AudioOutput::SIDECHAIN, 0, 2),
m_pEngine);
}

Expand Down Expand Up @@ -354,12 +354,12 @@ void PlayerManager::addDeckInner() {

// Register the deck output with SoundManager (deck is 0-indexed to SoundManager)
m_pSoundManager->registerOutput(
AudioOutput(AudioOutput::DECK, 0, 0, number - 1), m_pEngine);
AudioOutput(AudioOutput::DECK, 0, 2, number - 1), m_pEngine);

// Register vinyl input signal with deck for passthrough support.
EngineDeck* pEngineDeck = pDeck->getEngineDeck();
m_pSoundManager->registerInput(
AudioInput(AudioInput::VINYLCONTROL, 0, 0, number - 1), pEngineDeck);
AudioInput(AudioInput::VINYLCONTROL, 0, 2, number - 1), pEngineDeck);

// Setup equalizer rack for this deck.
EqualizerRackPointer pEqRack = m_pEffectsManager->getEqualizerRack(0);
Expand Down Expand Up @@ -526,11 +526,6 @@ Auxiliary* PlayerManager::getAuxiliary(unsigned int auxiliary) const {
return m_auxiliaries[auxiliary - 1];
}

bool PlayerManager::hasVinylInput(int inputnum) const {
AudioInput vinyl_input(AudioInput::VINYLCONTROL, 0, 0, inputnum);
return m_pSoundManager->getConfig().getInputs().values().contains(vinyl_input);
}

void PlayerManager::slotLoadTrackToPlayer(TrackPointer pTrack, QString group, bool play) {
// Do not lock mutex in this method unless it is changed to access
// PlayerManager state.
Expand Down
3 changes: 0 additions & 3 deletions src/mixer/playermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ class PlayerManager : public QObject, public PlayerManagerInterface {
return QString("[Auxiliary%1]").arg(i + 1);
}

// Used to determine if the user has configured an input for the given vinyl deck.
bool hasVinylInput(int inputnum) const;

public slots:
// Slots for loading tracks into a Player, which is either a Sampler or a Deck
void slotLoadTrackToPlayer(TrackPointer pTrack, QString group, bool play = false);
Expand Down
4 changes: 2 additions & 2 deletions src/soundio/soundmanagerutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ AudioOutput AudioOutput::fromXML(const QDomElement &xml) {
unsigned int index(xml.attribute("index", "0").toUInt());
unsigned int channel(xml.attribute("channel", "0").toUInt());
unsigned int channels(xml.attribute("channel_count", "0").toUInt());
// In Mixxx <1.12.0 we didn't save channels to file since they directly
// In Mixxx < 1.12.0 we didn't save channels to file since they directly
// corresponded to the type. To migrate users over, use mono for all
// microphones and stereo for everything else since previously microphone
// inputs were the only mono AudioPath.
if (channels == 0) {
channels = type == MICROPHONE ? 1 : 2;
channels = 2;
}
return AudioOutput(type, channel, channels, index);
}
Expand Down
4 changes: 2 additions & 2 deletions src/soundio/soundmanagerutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class AudioPath {
*/
class AudioOutput : public AudioPath {
public:
AudioOutput(AudioPathType type = INVALID, unsigned char channelBase = 0,
unsigned char channels = 0,
AudioOutput(AudioPathType type, unsigned char channelBase,
unsigned char channels,
unsigned char index = 0);
virtual ~AudioOutput();
QDomElement toXML(QDomElement *element) const;
Expand Down
2 changes: 1 addition & 1 deletion src/vinylcontrol/vinylcontrolmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ VinylControlManager::VinylControlManager(QObject* pParent,
// VinylControlProcessor.
for (int i = 0; i < kMaximumVinylControlInputs; ++i) {
pSoundManager->registerInput(
AudioInput(AudioInput::VINYLCONTROL, 0, 0, i), m_pProcessor);
AudioInput(AudioInput::VINYLCONTROL, 0, 2, i), m_pProcessor);
}

connect(&m_vinylControlEnabledMapper, SIGNAL(mapped(int)),
Expand Down

0 comments on commit 9a424c9

Please sign in to comment.