/***************************************************************************
* Copyright (C) 2002-2003 Nick Lamb <njl195@zepler.org.uk> *
* Copyright (C) 2005 Giacomo Lozito <city_hunter@users.sf.net> *
* Copyright (C) 2009-2015 by Ilya Kotov <forkotov02@hotmail.ru> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <QSettings>
#include <QByteArray>
#include <QDir>
#include <QFileInfo>
#include <QSettings>
#include <math.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <qmmp/qmmp.h>
#include <qmmp/audioparameters.h>
#include "ladspahost.h"
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
LADSPAHost *LADSPAHost::m_instance = 0;
/* Based on xmms_ladspa */
LADSPAHost::LADSPAHost(QObject *parent) : QObject(parent)
{
m_chan = 2;
m_freq = 44100;
m_instance = this;
loadModules();
QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
int p = settings.value("LADSPA/plugins_number", 0).toInt();
for(int i = 0; i < p; ++i)
{
QString section = QString("LADSPA_%1/").arg(i);
settings.beginGroup(section);