![]() |
Mixxx
|
00001 /*************************************************************************** 00002 * * 00003 * This program is free software; you can redistribute it and/or modify * 00004 * it under the terms of the GNU General Public License as published by * 00005 * the Free Software Foundation; either version 2 of the License, or * 00006 * (at your option) any later version. * 00007 * * 00008 ***************************************************************************/ 00009 00010 #include <QtCore> 00011 #include "ladspainstance.h" 00012 #include "controlpushbutton.h" 00013 00014 ControlObjectThreadMain *LADSPAInstance::m_pControlObjectSampleRate = NULL; 00015 00016 LADSPAInstance::LADSPAInstance(const LADSPA_Descriptor * descriptor, int slot) 00017 { 00018 m_pDescriptor = descriptor; 00019 00020 if (m_pControlObjectSampleRate == NULL) 00021 { 00022 m_pControlObjectSampleRate = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey("[Master]", "samplerate"))); 00023 } 00024 00025 if (LADSPA_IS_INPLACE_BROKEN(m_pDescriptor->Properties)) 00026 { 00027 qDebug() << "LADSPA: Inplace broken!"; 00028 } 00029 00030 remove = 0; 00031 00032 QString slotString; 00033 slotString.setNum(slot); 00034 ConfigKey * key = new ConfigKey("[LADSPA]", "EnableEffect" + slotString); 00035 m_pControlObjectEnable = ControlObject::getControl(*key); 00036 key = new ConfigKey("[LADSPA]", "DryWet" + slotString); 00037 m_pControlObjectDryWet = ControlObject::getControl(*key); 00038 } 00039 00040 const LADSPA_Descriptor * LADSPAInstance::getDescriptor() 00041 { 00042 return m_pDescriptor; 00043 } 00044 00045 int LADSPAInstance::getSampleRate() 00046 { 00047 return (int)m_pControlObjectSampleRate->get(); 00048 } 00049 00050 LADSPAInstance::~LADSPAInstance() 00051 { 00052 } 00053 00054 bool LADSPAInstance::isInplaceBroken() 00055 { 00056 return LADSPA_IS_INPLACE_BROKEN(getDescriptor()->Properties); 00057 } 00058 00059 bool LADSPAInstance::isEnabled() 00060 { 00061 // qDebug() << "isEnabled() == " << m_pControlObjectEnable->get(); 00062 return m_pControlObjectEnable->get() > 0.0; 00063 } 00064 00065 float LADSPAInstance::getWet() 00066 { 00067 return m_pControlObjectDryWet->get(); 00068 }