![]() |
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 "ladspapresetknob.h" 00011 00012 #include <QtCore> 00013 #include <QtXml> 00014 00015 LADSPAPresetKnob::LADSPAPresetKnob() 00016 { 00017 } 00018 00019 LADSPAPresetKnob::LADSPAPresetKnob(QDomElement element) 00020 { 00021 QDomElement labelElement = element.firstChildElement(QString("Label")); 00022 QDomElement minElement = element.firstChildElement(QString("Min")); 00023 QDomElement maxElement = element.firstChildElement(QString("Max")); 00024 QDomElement defaultElement = element.firstChildElement(QString("Default")); 00025 m_qLabel = labelElement.text(); 00026 m_fMin = minElement.text().toFloat(); 00027 m_fMax = maxElement.text().toFloat(); 00028 m_fDefault = defaultElement.text().toFloat(); 00029 00030 QDomNodeList connectionNodeList = element.elementsByTagName(QString("Connection")); 00031 m_Connections.resize(connectionNodeList.count()); 00032 for (int i = 0; i < connectionNodeList.count(); i++) 00033 { 00034 QDomElement connectionElement = connectionNodeList.item(i).toElement(); 00035 QDomElement pluginElement = connectionElement.firstChildElement(QString("Plugin")); 00036 QDomElement portElement = connectionElement.firstChildElement(QString("Port")); 00037 m_Connections[i].plugin = pluginElement.text().toULong(); 00038 m_Connections[i].port = portElement.text().toULong(); 00039 } 00040 } 00041 00042 LADSPAPresetKnob::~LADSPAPresetKnob() 00043 { 00044 } 00045 00046 LADSPAPortConnectionVector * LADSPAPresetKnob::getConnections() 00047 { 00048 return &m_Connections; 00049 } 00050 00051 QString LADSPAPresetKnob::getLabel() 00052 { 00053 return m_qLabel; 00054 } 00055 00056 LADSPA_Data LADSPAPresetKnob::getMin() 00057 { 00058 return m_fMin; 00059 } 00060 00061 LADSPA_Data LADSPAPresetKnob::getMax() 00062 { 00063 return m_fMax; 00064 } 00065 00066 LADSPA_Data LADSPAPresetKnob::getDefault() 00067 { 00068 return m_fDefault; 00069 }