Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************
- dlgprefkey.cpp - description
- -------------------
- begin : Thu Jun 7 2012
- copyright : (C) 2012 by Keith Salisbury
- email : keithsalisbury@gmail.com
- ***************************************************************************/
- /***************************************************************************
- * *
- * 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. *
- * *
- ***************************************************************************/
- #include <qlineedit.h>
- #include <qfiledialog.h>
- #include <qwidget.h>
- #include <qspinbox.h>
- #include <qcheckbox.h>
- #include <qlabel.h>
- #include <qstring.h>
- #include <qpushbutton.h>
- #include <QtCore>
- #include <QMessageBox>
- #include "track/key_preferences.h"
- #include "dlgprefkey.h"
- #include "xmlparse.h"
- #include "controlobject.h"
- //#include "dlgprefbeats.h"
- #include "vamp/vampanalyser.h"
- using Vamp::Plugin;
- using Vamp::PluginHostAdapter;
- using Vamp::HostExt::PluginLoader;
- using Vamp::HostExt::PluginWrapper;
- using Vamp::HostExt::PluginInputDomainAdapter;
- #define CONFIG_KEY "[KEY]"
- bool firs = true;
- DlgPrefKey::DlgPrefKey(QWidget * parent,
- ConfigObject<ConfigValue> * _config) : QWidget(parent),m_pconfig(_config)
- //Ui::DlgPrefKey()
- {
- //config = _config;
- //m_pconfig = _config;
- setupUi(this);
- //m_selectedAnalyser = "qm-tempotracker:0";
- //setupUi(this);
- // populate();
- loadSettings();
- //Connections
- // connect(plugincombo, SIGNAL(currentIndexChanged(int)),
- // this, SLOT(pluginSelected(int)));
- connect(banalyserenabled, SIGNAL(stateChanged(int)),
- this, SLOT(analyserEnabled(int)));
- connect(bfastAnalysisEnabled, SIGNAL(stateChanged(int)),
- this, SLOT(fastAnalysisEnabled(int)));
- connect(bfirstLastEnabled, SIGNAL(stateChanged(int)),
- this, SLOT(firstLastEnabled(int)));
- // connect(reset, SIGNAL(clicked(bool)), this, SLOT(setDefaults()));
- connect(breanalyzeEnabled, SIGNAL(stateChanged(int)),
- this, SLOT(reanalyzeEnabled(int)));
- connect(bskipRelevantEnabled, SIGNAL(stateChanged(int)),
- this, SLOT(skipRelevantEnabled(int)));
- connect(b1, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged1(char)));
- connect(b2, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged2(char)));
- connect(b3, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged3(char)));
- connect(b4, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged4(char)));
- connect(b5, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged5(char)));
- connect(b6, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged6(char)));
- connect(b7, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged7(char)));
- connect(b8, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged8(char)));
- connect(b9, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged9(char)));
- connect(b10, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged10(char)));
- connect(b11, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged11(char)));
- connect(b12, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged12(char)));
- connect(b13, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged13(char)));
- connect(b14, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged14(char)));
- connect(b15, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged15(char)));
- connect(b16, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged16(char)));
- connect(b17, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged17(char)));
- connect(b18, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged18(char)));
- connect(b19, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged19(char)));
- connect(b20, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged20(char)));
- connect(b21, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged21(char)));
- connect(b22, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged22(char)));
- connect(b23, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged23(char)));
- connect(b24, SIGNAL(valueChanged(char)),
- this, SLOT(notationValueChanged24(char)));
- // connect(txtMaxBpm, SIGNAL(valueChanged(int)),
- // this, SLOT(maxBpmRangeChanged(int)));
- //connect(bReanalyse,SIGNAL(stateChanged(int)),
- // this, SLOT(slotReanalyzeChanged(int)));
- }
- DlgPrefKey::~DlgPrefKey()
- {
- }
- void DlgPrefKey::loadSettings(){
- //if(m_pconfig->getValueString(
- // ConfigKey(VAMP_CONFIG_KEY, VAMP_ANALYSER_KEY_PLUGIN_ID))==QString("")) {
- //setDefaults();
- // Write to config file so AnalyzerBeats can get the data
- //return;
- //}
- // QString pluginid = m_pconfig->getValueString(
- // ConfigKey(VAMP_CONFIG_KEY, VAMP_ANALYSER_BEAT_PLUGIN_ID));
- //m_selectedAnalyser = pluginid;
- m_banalyserEnabled = static_cast<bool>(m_pconfig->getValueString(
- ConfigKey(KEY_CONFIG_KEY, KEY_DETECTION_ENABLED)).toInt());
- m_bfastAnalysisEnabled = static_cast<bool>(m_pconfig->getValueString(
- ConfigKey(KEY_CONFIG_KEY, KEY_FAST_ANALYSIS)).toInt());
- m_bfirstLastEnabled = static_cast<bool>(m_pconfig->getValueString(
- ConfigKey(KEY_CONFIG_KEY, KEY_FIRST_LAST)).toInt());
- m_breanalyzeEnabled = static_cast<bool>(m_pconfig->getValueString(
- ConfigKey(KEY_CONFIG_KEY, KEY_REANALYZE)).toInt());
- m_bskipRelevantEnabled = static_cast<bool>(m_pconfig->getValueString(
- ConfigKey(KEY_CONFIG_KEY, KEY_SKIP_RELEVANT)).toInt());
- m_b1 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N1));
- m_b2 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N2));
- m_b3 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N3));
- m_b4 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N4));
- m_b5 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N5));
- m_b6 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N6));
- m_b7 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N7));
- m_b8 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N8));
- m_b9 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N9));
- m_b10 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N10));
- m_b11 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N11));
- m_b12 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N12));
- m_b13 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N13));
- m_b14 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N14));
- m_b15 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N15));
- m_b16 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N16));
- m_b17 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N17));
- m_b18 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N18));
- m_b19 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N19));
- m_b20 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N20));
- m_b21 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N21));
- m_b22 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N22));
- m_b23 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N23));
- m_b24 = m_pconfig->getValueString(ConfigKey(KEY_CONFIG_KEY, KEY_N24));
- slotApply();
- // if (!m_listIdentifier.contains(pluginid)) {
- // setDefaults();
- //}
- // m_minBpm = m_pconfig->getValueString(ConfigKey(BPM_CONFIG_KEY, BPM_RANGE_START)).toInt();
- //m_maxBpm = m_pconfig->getValueString(ConfigKey(BPM_CONFIG_KEY, BPM_RANGE_END)).toInt();
- slotUpdate();
- }
- void DlgPrefKey::setDefaults() {
- //if (!m_listIdentifier.contains("qm-tempotracker:0")) {
- // qDebug() << "DlgPrefBeats: qm-tempotracker Vamp plugin not found";
- //return;
- //}
- //m_selectedAnalyser = "qm-tempotracker:0";
- m_banalyserEnabled = false;
- m_bfastAnalysisEnabled = false;
- m_bfirstLastEnabled = false;
- m_breanalyzeEnabled = false;
- //m_FastAnalysisEnabled = false;
- m_bskipRelevantEnabled = false;
- m_b1 = 'C';
- m_b2 = 'C#';
- m_b3 = 'D';
- m_b4 = 'D#';
- m_b5 = 'E';
- m_b6 = 'F';
- m_b7 = 'F#';
- m_b8 = 'G';
- m_b9 = 'G#';
- m_b10 = 'A';
- m_b11 = 'A#';
- m_b12 = 'B';
- m_b13 = 'c';
- m_b14 = 'c#';
- m_b15 = 'd';
- m_b16 = 'd#';
- m_b17 = 'e';
- m_b18 = 'f';
- m_b19 = 'f#';
- m_b20 = 'g';
- m_b21 = 'g#';
- m_b22 = 'a';
- m_b23 = 'a#';
- m_b24 = 'b';
- //m_minBpm = 70;
- //m_maxBpm = 140;
- //slotApply();
- slotUpdate();
- }
- void DlgPrefKey::analyserEnabled(int i){
- m_banalyserEnabled = static_cast<bool>(i);
- slotUpdate();
- }
- void DlgPrefKey::fastAnalysisEnabled(int i){
- m_bfastAnalysisEnabled = static_cast<bool>(i);
- slotUpdate();
- }
- void DlgPrefKey::firstLastEnabled(int i){
- m_bfirstLastEnabled = static_cast<bool>(i);
- slotUpdate();
- }
- void DlgPrefKey::reanalyzeEnabled(int i){
- m_breanalyzeEnabled = static_cast<bool>(i);
- slotUpdate();
- }
- void DlgPrefKey::skipRelevantEnabled(int i){
- m_bskipRelevantEnabled = static_cast<bool>(i);
- qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged1(char i){
- m_b1 = i;
- qDebug()<<m_b1;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged2(char i){
- m_b2 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged3(char i){
- m_b3 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged4(char i){
- m_b4 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged5(char i){
- m_b5 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged6(char i){
- m_b6 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged7(char i){
- m_b7 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged8(char i){
- m_b8 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged9(char i){
- m_b9 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged10(char i){
- m_b10 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged11(char i){
- m_b11 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged12(char i){
- m_b12 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged13(char i){
- m_b13 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged14(char i){
- m_b14 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged15(char i){
- m_b15 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged16(char i){
- m_b16 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged17(char i){
- m_b17 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged18(char i){
- m_b18 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged19(char i){
- m_b19 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged20(char i){
- m_b20 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged21(char i){
- m_b21 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged22(char i){
- m_b22 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged23(char i){
- m_b23 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::notationValueChanged24(char i){
- m_b24 = i;
- //qDebug()<<m_bskipRelevantEnabled;
- slotUpdate();
- }
- void DlgPrefKey::slotApply()
- {
- //int selected = m_listIdentifier.indexOf(m_selectedAnalyser);
- //if (selected == -1)
- // return;
- //m_pconfig->set(ConfigKey(
- // VAMP_CONFIG_KEY, VAMP_ANALYSER_BEAT_LIBRARY), ConfigValue(m_listLibrary[selected]));
- //m_pconfig->set(ConfigKey(
- // VAMP_CONFIG_KEY, VAMP_ANALYSER_BEAT_PLUGIN_ID), ConfigValue(m_selectedAnalyser));
- m_pconfig->set(ConfigKey(
- KEY_CONFIG_KEY, KEY_DETECTION_ENABLED), ConfigValue(m_banalyserEnabled ? 1 : 0));
- m_pconfig->set(ConfigKey(
- KEY_CONFIG_KEY, KEY_FAST_ANALYSIS), ConfigValue(m_bfastAnalysisEnabled ? 1 : 0));
- m_pconfig->set(ConfigKey(
- KEY_CONFIG_KEY, KEY_FIRST_LAST), ConfigValue(m_bfirstLastEnabled ? 1 : 0));
- m_pconfig->set(ConfigKey(
- KEY_CONFIG_KEY, KEY_REANALYZE), ConfigValue(m_breanalyzeEnabled ? 1 : 0));
- m_pconfig->set(ConfigKey(
- KEY_CONFIG_KEY, KEY_SKIP_RELEVANT), ConfigValue(m_bskipRelevantEnabled ? 1 : 0));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N1), ConfigValue(m_b1));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N2), ConfigValue(m_b2));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N3), ConfigValue(m_b3));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N4), ConfigValue(m_b4));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N5), ConfigValue(m_b5));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N6), ConfigValue(m_b6));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N7), ConfigValue(m_b7));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N8), ConfigValue(m_b8));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N9), ConfigValue(m_b9));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N10), ConfigValue(m_b10));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N11), ConfigValue(m_b11));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N12), ConfigValue(m_b12));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N13), ConfigValue(m_b13));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N14), ConfigValue(m_b14));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N15), ConfigValue(m_b15));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N16), ConfigValue(m_b16));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N17), ConfigValue(m_b17));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N18), ConfigValue(m_b18));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N19), ConfigValue(m_b19));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N20), ConfigValue(m_b20));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N21), ConfigValue(m_b21));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N22), ConfigValue(m_b22));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N23), ConfigValue(m_b23));
- m_pconfig->set(ConfigKey(KEY_CONFIG_KEY, KEY_N24), ConfigValue(m_b24));
- // m_pconfig->set(ConfigKey(
- // KEY_CONFIG_KEY, KEY_SKIP_RELEVANT), ConfigValue(1));
- // m_pconfig->set(ConfigKey(
- // BPM_CONFIG_KEY, BPM_FAST_ANALYSIS_ENABLED), ConfigValue(m_FastAnalysisEnabled ? 1 : 0));
- //m_pconfig->set(ConfigKey(BPM_CONFIG_KEY, BPM_RANGE_START), ConfigValue(m_minBpm));
- //m_pconfig->set(ConfigKey(BPM_CONFIG_KEY, BPM_RANGE_END), ConfigValue(m_maxBpm));
- m_pconfig->Save();
- }
- void DlgPrefKey::slotUpdate()
- {
- //bfixedtempo->setEnabled(m_banalyserEnabled);
- //boffset->setEnabled((m_banalyserEnabled && m_bfixedtempoEnabled));
- //plugincombo->setEnabled(m_banalyserEnabled);
- banalyserenabled->setChecked(m_banalyserEnabled);
- bfastAnalysisEnabled->setChecked(m_bfastAnalysisEnabled);
- //txtMaxBpm->setEnabled(m_banalyserEnabled && m_bfixedtempoEnabled);
- // txtMinBpm->setEnabled(m_banalyserEnabled && m_bfixedtempoEnabled);
- bfirstLastEnabled->setChecked(m_bfirstLastEnabled);
- breanalyzeEnabled->setChecked(m_breanalyzeEnabled);
- bskipRelevantEnabled->setChecked(m_bskipRelevantEnabled);
- b1->setEnabled(1);
- b2->setEnabled(1);
- b3->setEnabled(1);
- b4->setEnabled(1);
- b5->setEnabled(1);
- b6->setEnabled(1);
- b7->setEnabled(1);
- b8->setEnabled(1);
- b9->setEnabled(1);
- b10->setEnabled(1);
- b11->setEnabled(1);
- b12->setEnabled(1);
- b13->setEnabled(1);
- b14->setEnabled(1);
- b15->setEnabled(1);
- b16->setEnabled(1);
- b17->setEnabled(1);
- b18->setEnabled(1);
- b19->setEnabled(1);
- b20->setEnabled(1);
- b21->setEnabled(1);
- b22->setEnabled(1);
- b23->setEnabled(1);
- b24->setEnabled(1);
- slotApply();
- //if(!m_banalyserEnabled)
- // return;
- //bfixedtempo->setChecked(m_bfixedtempoEnabled);
- //boffset->setChecked(m_boffsetEnabled);
- //bFastAnalysis->setChecked(m_FastAnalysisEnabled);
- //int comboselected = m_listIdentifier.indexOf(m_selectedAnalyser);
- //if( comboselected==-1){
- // qDebug()<<"DlgPrefBeats: Plugin not found in slotUpdate()";
- //return;
- //}
- //plugincombo->setCurrentIndex(comboselected);
- //txtMaxBpm->setValue(m_maxBpm);
- //txtMinBpm->setValue(m_minBpm);
- //bReanalyse->setChecked(m_bReanalyze);
- }
- //void DlgPrefBeats::populate() {
- // VampAnalyser::initializePluginPaths();
- // QString selectedAnalyser = m_selectedAnalyser;
- // m_listIdentifier.clear();
- // m_listName.clear();
- // m_listLibrary.clear();
- // disconnect(plugincombo, SIGNAL(currentIndexChanged(int)),
- // this, SLOT(pluginSelected(int)));
- // plugincombo->clear();
- // plugincombo->setDuplicatesEnabled(false);
- // connect(plugincombo, SIGNAL(currentIndexChanged(int)),
- // this, SLOT(pluginSelected(int)));
- // VampPluginLoader *loader = VampPluginLoader::getInstance();
- // std::vector<PluginLoader::PluginKey> plugins = loader->listPlugins();
- // qDebug() << "VampPluginLoader::listPlugins() returned" << plugins.size() << "plugins";
- // for (unsigned int iplugin=0; iplugin < plugins.size(); iplugin++) {
- // Plugin *plugin = loader->loadPlugin(plugins[iplugin], 48000);
- // //TODO: find a way to add beat trackers only
- // if (plugin) {
- // Plugin::OutputList outputs = plugin->getOutputDescriptors();
- // for (unsigned int ioutput=0; ioutput < outputs.size(); ioutput++) {
- // QString displayname = QString::fromStdString(plugin->getIdentifier()) + ":"
- // + QString::number(ioutput);
- // QString displaynametext = QString::fromStdString(plugin->getName());
- // qDebug() << "Plugin output displayname:" << displayname << displaynametext;
- // bool goodones = ((displayname.contains("mixxxbpmdetection")||
- // displayname.contains("qm-tempotracker:0"))||
- // displayname.contains("beatroot:0")||
- // displayname.contains("marsyas_ibt:0")||
- // displayname.contains("aubiotempo:0")
- // );
- // bool goodones = ((displaynametext.contains("Beat Track")));
- //validate and add rows to qcombobox
- // m_listVersion << QString::number(plugin->getPluginVersion());
- // m_listMaker << QString::fromStdString(plugin->getMaker());
- // m_listCopyright << QString::fromStdString(plugin->getCopyright());
- // m_listOutput << QString::number(ioutput);
- // m_listDescription << QString::fromStdString(outputs[ioutput].description);
- // if (goodones) {
- // m_listName << displaynametext;
- // QString pluginlibrary = QString::fromStdString(plugins[iplugin]).section(":",0,0);
- // m_listLibrary << pluginlibrary;
- // QString displayname = QString::fromStdString(plugin->getIdentifier()) + ":"
- // + QString::number(ioutput);
- // m_listIdentifier << displayname;
- // plugincombo->addItem(displaynametext, displayname);
- // }
- // }
- // delete plugin;
- // plugin = 0;
- // }
- // }
- // m_selectedAnalyser = selectedAnalyser;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement