![]() |
Mixxx
|
00001 /*************************************************************************** 00002 enginedeck.cpp - description 00003 ------------------- 00004 begin : Sun Apr 28 2002 00005 copyright : (C) 2002 by 00006 email : 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "controlpushbutton.h" 00019 #include "enginebuffer.h" 00020 #include "enginevinylsoundemu.h" 00021 #include "enginedeck.h" 00022 #include "engineclipping.h" 00023 #include "enginepregain.h" 00024 #include "engineflanger.h" 00025 #include "enginefilterblock.h" 00026 #include "enginevumeter.h" 00027 #include "enginefilteriir.h" 00028 00029 EngineDeck::EngineDeck(const char* group, 00030 ConfigObject<ConfigValue>* pConfig, 00031 EngineChannel::ChannelOrientation defaultOrientation) 00032 : EngineChannel(group, defaultOrientation), 00033 m_pConfig(pConfig) { 00034 m_pPregain = new EnginePregain(group); 00035 m_pFilter = new EngineFilterBlock(group); 00036 m_pFlanger = new EngineFlanger(group); 00037 m_pClipping = new EngineClipping(group); 00038 m_pBuffer = new EngineBuffer(group, pConfig); 00039 m_pVinylSoundEmu = new EngineVinylSoundEmu(pConfig, group); 00040 m_pVUMeter = new EngineVuMeter(group); 00041 } 00042 00043 EngineDeck::~EngineDeck() { 00044 delete m_pBuffer; 00045 delete m_pClipping; 00046 delete m_pFilter; 00047 delete m_pFlanger; 00048 delete m_pPregain; 00049 delete m_pVinylSoundEmu; 00050 delete m_pVUMeter; 00051 } 00052 00053 void EngineDeck::process(const CSAMPLE*, const CSAMPLE * pOut, const int iBufferSize) { 00054 // Process the raw audio 00055 m_pBuffer->process(0, pOut, iBufferSize); 00056 // Emulate vinyl sounds 00057 m_pVinylSoundEmu->process(pOut, pOut, iBufferSize); 00058 // Apply pregain 00059 m_pPregain->process(pOut, pOut, iBufferSize); 00060 // Filter the channel with EQs 00061 m_pFilter->process(pOut, pOut, iBufferSize); 00062 // TODO(XXX) LADSPA 00063 m_pFlanger->process(pOut, pOut, iBufferSize); 00064 // Apply clipping 00065 m_pClipping->process(pOut, pOut, iBufferSize); 00066 // Update VU meter 00067 m_pVUMeter->process(pOut, pOut, iBufferSize); 00068 } 00069 00070 EngineBuffer* EngineDeck::getEngineBuffer() { 00071 return m_pBuffer; 00072 } 00073 00074 bool EngineDeck::isActive() { 00075 return m_pBuffer->isTrackLoaded(); 00076 }