예제 #1
0
PlayerManager::PlayerManager(ConfigObject<ConfigValue>* pConfig,
                             SoundManager* pSoundManager,
                             EffectsManager* pEffectsManager,
                             EngineMaster* pEngine) :
    m_mutex(QMutex::Recursive),
    m_pConfig(pConfig),
    m_pSoundManager(pSoundManager),
    m_pEffectsManager(pEffectsManager),
    m_pEngine(pEngine),
    // NOTE(XXX) LegacySkinParser relies on these controls being COs and
    // not COTMs listening to a CO.
    m_pAnalyserQueue(NULL),
    m_pCONumDecks(new ControlObject(ConfigKey("[Master]", "num_decks"), true, true)),
    m_pCONumSamplers(new ControlObject(ConfigKey("[Master]", "num_samplers"), true, true)),
    m_pCONumPreviewDecks(new ControlObject(ConfigKey("[Master]", "num_preview_decks"), true, true)) {

    connect(m_pCONumDecks, SIGNAL(valueChanged(double)),
            this, SLOT(slotNumDecksControlChanged(double)),
            Qt::DirectConnection);
    connect(m_pCONumDecks, SIGNAL(valueChangedFromEngine(double)),
            this, SLOT(slotNumDecksControlChanged(double)),
            Qt::DirectConnection);
    connect(m_pCONumSamplers, SIGNAL(valueChanged(double)),
            this, SLOT(slotNumSamplersControlChanged(double)),
            Qt::DirectConnection);
    connect(m_pCONumSamplers, SIGNAL(valueChangedFromEngine(double)),
            this, SLOT(slotNumSamplersControlChanged(double)),
            Qt::DirectConnection);
    connect(m_pCONumPreviewDecks, SIGNAL(valueChanged(double)),
            this, SLOT(slotNumPreviewDecksControlChanged(double)),
            Qt::DirectConnection);
    connect(m_pCONumPreviewDecks, SIGNAL(valueChangedFromEngine(double)),
            this, SLOT(slotNumPreviewDecksControlChanged(double)),
            Qt::DirectConnection);

    // This is parented to the PlayerManager so does not need to be deleted
    SamplerBank* pSamplerBank = new SamplerBank(this);
    Q_UNUSED(pSamplerBank);

    // Redundant
    m_pCONumDecks->set(0);
    m_pCONumSamplers->set(0);
    m_pCONumPreviewDecks->set(0);

    // register the engine's outputs
    m_pSoundManager->registerOutput(AudioOutput(AudioOutput::MASTER),
                                    m_pEngine);
    m_pSoundManager->registerOutput(AudioOutput(AudioOutput::HEADPHONES),
                                    m_pEngine);
    for (int o = EngineChannel::LEFT; o <= EngineChannel::RIGHT; o++) {
        m_pSoundManager->registerOutput(AudioOutput(AudioOutput::BUS, 0, 0, o),
                                        m_pEngine);
    }
}
예제 #2
0
void EngineMaster::registerNonEngineChannelSoundIO(SoundManager* pSoundManager) {
    pSoundManager->registerInput(AudioInput(AudioPath::RECORD_BROADCAST, 0, 2),
                                 m_pEngineSideChain);

    pSoundManager->registerOutput(AudioOutput(AudioOutput::MASTER, 0, 2), this);
    pSoundManager->registerOutput(AudioOutput(AudioOutput::HEADPHONES, 0, 2), this);
    pSoundManager->registerOutput(AudioOutput(AudioOutput::BOOTH, 0, 2), this);
    for (int o = EngineChannel::LEFT; o <= EngineChannel::RIGHT; o++) {
        pSoundManager->registerOutput(AudioOutput(AudioOutput::BUS, 0, 2, o), this);
    }
    pSoundManager->registerOutput(AudioOutput(AudioOutput::RECORD_BROADCAST, 0, 2), this);
}
예제 #3
0
/**
 * Constructs and returns an AudioOutput given an XML element representing it.
 * @note This method is static.
 */
AudioOutput AudioOutput::fromXML(const QDomElement &xml) {
    AudioPathType type(AudioPath::getTypeFromString(xml.attribute("type")));
    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
    // 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;
    }
    return AudioOutput(type, channel, channels, index);
}