LADSPA-base now as library, fixed binary files

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@405 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-09-20 22:36:59 +00:00
parent 392dd0d89e
commit 373f7dffae
427 changed files with 83 additions and 340 deletions

View File

@@ -24,7 +24,6 @@
*
*/
#include "ladspa_manager.h"
#include "mixer.h"
#include "audio_device.h"
#include "config_mgr.h"

View File

@@ -38,7 +38,7 @@
#include "song_editor.h"
#ifdef LADSPA_SUPPORT
#include "ladspa_2_lmms.h"
#include "plugins/ladspa_base/ladspa_2_lmms.h"
#endif

View File

@@ -1,309 +0,0 @@
#if 0
#ifndef SINGLE_SOURCE_COMPILE
/*
* ladspa_browser.h - dialog to display information about installed LADSPA
* plugins
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "ladspa_manager.h"
#ifdef LADSPA_SUPPORT
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QLayout>
#include <QtGui/QWhatsThis>
#else
#include <qlayout.h>
#include <qwhatsthis.h>
#endif
#include "ladspa_browser.h"
#include "tab_bar.h"
#include "tab_button.h"
#include "tab_widget.h"
#include "gui_templates.h"
#include "config_mgr.h"
#include "embed.h"
#include "debug.h"
#include "tooltip.h"
#include "ladspa_description.h"
#include "ladspa_port_dialog.h"
#include "audio_device.h"
#include "buffer_allocator.h"
#include "effect_chain.h"
inline void ladspaBrowser::labelWidget( QWidget * _w, const QString & _txt )
{
QLabel * title = new QLabel( _txt, _w );
QFont f = title->font();
f.setBold( TRUE );
title->setFont( pointSize<12>( f ) );
#ifdef LMMS_DEBUG
assert( dynamic_cast<QBoxLayout *>( _w->layout() ) != NULL );
#endif
dynamic_cast<QBoxLayout *>( _w->layout() )->addSpacing( 5 );
dynamic_cast<QBoxLayout *>( _w->layout() )->addWidget( title );
dynamic_cast<QBoxLayout *>( _w->layout() )->addSpacing( 10 );
}
ladspaBrowser::ladspaBrowser( engine * _engine ) :
QDialog(),
engineObject( _engine )
{
setWindowIcon( embed::getIconPixmap( "setup_general" ) );
setWindowTitle( tr( "LADSPA Plugin Browser" ) );
setModal( TRUE );
QVBoxLayout * vlayout = new QVBoxLayout( this );
vlayout->setSpacing( 0 );
vlayout->setMargin( 0 );
QWidget * settings = new QWidget( this );
QHBoxLayout * hlayout = new QHBoxLayout( settings );
hlayout->setSpacing( 0 );
hlayout->setMargin( 0 );
m_tabBar = new tabBar( settings, QBoxLayout::TopToBottom );
m_tabBar->setExclusive( TRUE );
m_tabBar->setFixedWidth( 72 );
QWidget * ws = new QWidget( settings );
ws->setFixedSize( 500, 400 );
QWidget * available = new QWidget( ws );
available->setFixedSize( 500, 340 );
QVBoxLayout * avl_layout = new QVBoxLayout( available );
avl_layout->setSpacing( 0 );
avl_layout->setMargin( 0 );
labelWidget( available, tr( "Available Effects" ) );
ladspaDescription * available_list = new ladspaDescription(available,
_engine, VALID );
connect( available_list, SIGNAL( doubleClicked( const ladspa_key_t & ) ),
this, SLOT( showPorts( const ladspa_key_t & ) ) );
avl_layout->addWidget( available_list );
QWidget * unavailable = new QWidget( ws );
unavailable->setFixedSize( 500, 340 );
QVBoxLayout * unavl_layout = new QVBoxLayout( unavailable );
unavl_layout->setSpacing( 0 );
unavl_layout->setMargin( 0 );
labelWidget( unavailable, tr( "Unavailable Effects" ) );
ladspaDescription * unavailable_list = new ladspaDescription(unavailable,
_engine, INVALID );
connect( unavailable_list,
SIGNAL( doubleClicked( const ladspa_key_t & ) ),
this, SLOT( showPorts( const ladspa_key_t & ) ) );
unavl_layout->addWidget( unavailable_list );
QWidget * instruments = new QWidget( ws );
instruments->setFixedSize( 500, 340 );
QVBoxLayout * inst_layout = new QVBoxLayout( instruments );
inst_layout->setSpacing( 0 );
inst_layout->setMargin( 0 );
labelWidget( instruments, tr( "Instruments" ) );
ladspaDescription * instruments_list =
new ladspaDescription(instruments, _engine, SOURCE );
connect( instruments_list,
SIGNAL( doubleClicked( const ladspa_key_t & ) ),
this, SLOT( showPorts( const ladspa_key_t & ) ) );
inst_layout->addWidget( instruments_list );
QWidget * analysis = new QWidget( ws );
analysis->setFixedSize( 500, 340 );
QVBoxLayout * anal_layout = new QVBoxLayout( analysis );
anal_layout->setSpacing( 0 );
anal_layout->setMargin( 0 );
labelWidget( analysis, tr( "Analysis Tools" ) );
ladspaDescription * analysis_list =
new ladspaDescription(analysis, _engine, SINK );
connect( analysis_list,
SIGNAL( doubleClicked( const ladspa_key_t & ) ),
this, SLOT( showPorts( const ladspa_key_t & ) ) );
anal_layout->addWidget( analysis_list );
QWidget * other = new QWidget( ws );
other->setFixedSize( 500, 340 );
QVBoxLayout * other_layout = new QVBoxLayout( other );
other_layout->setSpacing( 0 );
other_layout->setMargin( 0 );
labelWidget( other, tr( "Don't know" ) );
ladspaDescription * other_list =
new ladspaDescription(other, _engine, OTHER );
connect( other_list,
SIGNAL( doubleClicked( const ladspa_key_t & ) ),
this, SLOT( showPorts( const ladspa_key_t & ) ) );
other_layout->addWidget( other_list );
#ifndef QT4
#define setIcon setPixmap
#endif
m_tabBar->addTab( available, tr( "Available Effects" ),
0, FALSE, TRUE
)->setIcon( embed::getIconPixmap( "setup_audio" ) );
m_tabBar->addTab( unavailable, tr( "Unavailable Effects" ),
1, FALSE, TRUE
)->setIcon( embed::getIconPixmap(
"unavailable_sound" ) );
m_tabBar->addTab( instruments, tr( "Instruments" ),
2, FALSE, TRUE
)->setIcon( embed::getIconPixmap(
"setup_midi" ) );
m_tabBar->addTab( analysis, tr( "Analysis Tools" ),
3, FALSE, TRUE
)->setIcon( embed::getIconPixmap( "analysis" ) );
m_tabBar->addTab( other, tr( "Don't know" ),
4, TRUE, TRUE
)->setIcon( embed::getIconPixmap( "uhoh" ) );
#undef setIcon
m_tabBar->setActiveTab( 0 );
hlayout->addWidget( m_tabBar );
hlayout->addSpacing( 10 );
hlayout->addWidget( ws );
hlayout->addSpacing( 10 );
hlayout->addStretch();
QWidget * buttons = new QWidget( this );
QHBoxLayout * btn_layout = new QHBoxLayout( buttons );
btn_layout->setSpacing( 0 );
btn_layout->setMargin( 0 );
QPushButton * help_btn = new QPushButton(
embed::getIconPixmap( "help" ), "", buttons );
connect( help_btn, SIGNAL( clicked() ),
this, SLOT( displayHelp() ) );
QPushButton * cancel_btn = new QPushButton(
embed::getIconPixmap( "cancel" ), tr( "Close" ), buttons );
connect( cancel_btn, SIGNAL( clicked() ),
this, SLOT( reject() ) );
btn_layout->addStretch();
btn_layout->addSpacing( 10 );
btn_layout->addWidget( help_btn );
btn_layout->addSpacing( 10 );
btn_layout->addWidget( cancel_btn );
btn_layout->addSpacing( 10 );
vlayout->addWidget( settings );
vlayout->addSpacing( 10 );
vlayout->addWidget( buttons );
vlayout->addSpacing( 10 );
vlayout->addStretch();
show();
#ifdef QT4
this->setWhatsThis(
#else
QWhatsThis::add( this,
#endif
tr(
"This dialog displays information on all of the LADSPA plugins LMMS was "
"able to locate. The plugins are divided into five categories based "
"upon an interpretation of the port types and names.\n\n"
"Available Effects are those that can be used by LMMS. In order for LMMS "
"to be able to use an effect, it must, first and foremost, be an effect, "
"which is to say, it has to have both input channels and output channels. "
"LMMS identifies an input channel as an audio rate port containing 'in' in "
"the name. Output channels are identified by the letters 'out'. Furthermore, "
"the effect must have the same number of inputs and outputs and be real time "
"capable.\n\n"
"Unavailable Effects are those that were identified as effects, but either "
"didn't have the same number of input and output channels or weren't real "
"time capable.\n\n"
"Instruments are plugins for which only output channels were identified.\n\n"
"Analysis Tools are plugins for which only input channels were identified.\n\n"
"Don't Knows are plugins for which no input or output channels were "
"identified.\n\n"
"Double clicking any of the plugins will bring up information on the "
"ports." ) );
}
ladspaBrowser::~ladspaBrowser()
{
}
void ladspaBrowser::showPorts( const ladspa_key_t & _key )
{
ladspaPortDialog ports( _key, eng() );
ports.exec();
}
void ladspaBrowser::displayHelp( void )
{
#ifdef QT4
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
whatsThis() );
#else
QWhatsThis::display( QWhatsThis::textFor( this ),
mapToGlobal( rect().bottomRight() ) );
#endif
}
#include "ladspa_browser.moc"
#endif
#endif
#endif

View File

@@ -1,276 +0,0 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* ladspa_port_dialog.cpp - dialog to test a LADSPA plugin
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "qt3support.h"
#include "ladspa_manager.h"
#ifdef LADSPA_SUPPORT
#ifdef QT4
#include <QtGui/QLayout>
#include <QtGui/QTableWidget>
#else
#include <qlayout.h>
#include <qtable.h>
#define QTableWidget QTable
#endif
#include "ladspa_port_dialog.h"
#include "embed.h"
#include "mixer.h"
ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key,
engine * _engine ) :
QDialog(),
engineObject( _engine ),
m_key( _key ),
m_ladspa( _engine->getLADSPAManager() )
{
setWindowIcon( embed::getIconPixmap( "ports" ) );
setWindowTitle( "Ports" );
setModal( TRUE );
QVBoxLayout * vlayout = new QVBoxLayout( this );
vlayout->setSpacing( 0 );
vlayout->setMargin( 0 );
QWidget * settings = new QWidget( this );
Uint16 pc = m_ladspa->getPortCount( m_key );
QTableWidget * display = new QTableWidget( pc, 7, settings );
QStringList ports;
ports.append( tr( "Name" ) );
ports.append( tr( "Rate" ) );
ports.append( tr( "Direction" ) );
ports.append( tr( "Type" ) );
ports.append( tr( "Min < Default < Max" ) );
ports.append( tr( "Logarithmic" ) );
ports.append( tr( "SR Dependent" ) );
QStringList port_nums;
for(Uint16 row = 0; row < pc; row++)
{
port_nums.append( QString::number( row ) );
Uint8 col = 0;
#ifdef QT3
display->setText( row, col, m_ladspa->getPortName(
m_key, row ) );
#else
display->item( row, col )->setText( m_ladspa->getPortName(
m_key, row ) );
#endif
col++;
if( m_ladspa->isPortAudio( m_key, row ) )
{
#ifdef QT3
display->setText( row, col, tr( "Audio" ) );
#else
display->item( row, col )->setText( tr( "Audio" ) );
#endif
}
else
{
#ifdef QT3
display->setText( row, col, tr( "Control" ) );
#else
display->item( row, col )->setText( tr( "Control" ) );
#endif
}
col++;
if( m_ladspa->isPortInput( m_key, row ) )
{
#ifdef QT3
display->setText( row, col, tr( "Input" ) );
#else
display->item( row, col )->setText( tr( "Input" ) );
#endif
}
else
{
#ifdef QT3
display->setText( row, col, tr( "Output" ) );
#else
display->item( row, col )->setText( tr( "Output" ) );
#endif
}
col++;
if( m_ladspa->isPortToggled( m_key, row ) )
{
#ifdef QT3
display->setText( row, col, tr( "Toggled" ) );
#else
display->item( row, col )->setText( tr( "Toggled" ) );
#endif
}
else if( m_ladspa->isInteger( m_key, row ) )
{
#ifdef QT3
display->setText( row, col, tr( "Integer" ) );
#else
display->item( row, col )->setText( tr( "Integer" ) );
#endif
}
else
{
#ifdef QT3
display->setText( row, col, tr( "Float" ) );
#else
display->item( row, col )->setText( tr( "Float" ) );
#endif
}
col++;
float min = m_ladspa->getLowerBound( m_key, row );
float max = m_ladspa->getUpperBound( m_key, row );
float def = m_ladspa->getDefaultSetting( m_key, row );
QString range = "";
if( m_ladspa->areHintsSampleRateDependent( m_key, row ) )
{
if( min != NOHINT )
{
min *= eng()->getMixer()->sampleRate();
}
if( max != NOHINT )
{
max *= eng()->getMixer()->sampleRate();
}
}
if( min == NOHINT )
{
range += "-Inf < ";
}
else if( m_ladspa->isInteger( m_key, row ) )
{
range += QString::number( static_cast<int>( min ) ) +
" < ";
}
else
{
range += QString::number( min ) + " < ";
}
if( def == NOHINT )
{
range += "None < ";
}
else if( m_ladspa->isInteger( m_key, row ) )
{
range += QString::number( static_cast<int>( def ) ) +
" < ";
}
else
{
range += QString::number( def ) + " < ";
}
if( max == NOHINT )
{
range += "Inf";
}
else if( m_ladspa->isInteger( m_key, row ) )
{
range += QString::number( static_cast<int>( max ) );
}
else
{
range += QString::number( max );
}
if( m_ladspa->isPortOutput( m_key, row ) ||
m_ladspa->isPortToggled( m_key, row ) )
{
range = "";
}
#ifdef QT3
display->setText( row, col, range );
#else
display->item( row, col )->setText( range );
#endif
col++;
if( m_ladspa->isLogarithmic( m_key, row ) )
{
#ifdef QT3
display->setText( row, col, tr( "Yes" ) );
#else
display->item( row, col )->setText( tr( "Yes" ) );
#endif
}
col++;
if( m_ladspa->areHintsSampleRateDependent( m_key, row ) )
{
#ifdef QT3
display->setText( row, col, tr( "Yes" ) );
#else
display->item( row, col )->setText( tr( "Yes" ) );
#endif
}
col++;
}
#ifdef QT3
display->setColumnLabels( ports );
display->setRowLabels( port_nums );
display->setReadOnly( true );
for(Uint8 col = 0; col < ports.count(); col++ )
{
display->adjustColumn( col );
}
#endif
vlayout->addWidget( settings );
setFixedSize( display->width(), display->height() );
show();
}
ladspaPortDialog::~ ladspaPortDialog()
{
}
#include "ladspa_port_dialog.moc"
#endif
#endif

View File

@@ -1,192 +0,0 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* ladspa_subplugin_features.cpp - derivation from
* plugin::descriptor::subPluginFeatures for
* hosting LADSPA-plugins
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "ladspa_manager.h"
#ifdef LADSPA_SUPPORT
#ifdef QT4
#include <QtCore/QString>
#include <QtGui/QLabel>
#include <QtGui/QLayout>
#else
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qstring.h>
#endif
#include "ladspa_subplugin_features.h"
#include "ladspa_base.h"
#include "mixer.h"
#include "audio_device.h"
ladspaSubPluginDescriptionWidget::ladspaSubPluginDescriptionWidget(
QWidget * _parent, engine * _engine,
const ladspa_key_t & _key ) :
QWidget( _parent
#ifdef QT3
, "ladspaSubPluginDescriptionWidget"
#endif
)
{
ladspa2LMMS * lm = _engine->getLADSPAManager();
QVBoxLayout * l = new QVBoxLayout( this );
#ifndef QT3
QGroupBox * groupbox = new QGroupBox( tr( "Description" ), this );
#else
QGroupBox * groupbox = new QGroupBox( 9, Qt::Vertical,
tr( "Description" ), this );
#endif
QLabel * label = new QLabel( groupbox );
label->setText( tr( "Name: " ) + lm->getName( _key ) );
QLabel * maker = new QLabel( groupbox );
maker->setText( tr( "Maker: " ) + lm->getMaker( _key ) );
QLabel * copyright = new QLabel( groupbox );
copyright->setText( tr( "Copyright: " ) + lm->getCopyright( _key ) );
QLabel * requiresRealTime = new QLabel( groupbox );
if( lm->hasRealTimeDependency( _key ) )
{
requiresRealTime->setText( tr( "Requires Real Time: Yes" ) );
}
else
{
requiresRealTime->setText( tr( "Requires Real Time: No" ) );
}
QLabel * realTimeCapable = new QLabel( groupbox );
if( lm->isRealTimeCapable( _key ) )
{
realTimeCapable->setText( tr( "Real Time Capable: Yes" ) );
}
else
{
realTimeCapable->setText( tr( "Real Time Capable: No" ) );
}
QLabel * inplaceBroken = new QLabel( groupbox );
if( lm->isInplaceBroken( _key ) )
{
inplaceBroken->setText( tr( "In Place Broken: Yes" ) );
}
else
{
inplaceBroken->setText( tr( "In Place Broken: No" ) );
}
QLabel * channelsIn = new QLabel( groupbox );
channelsIn->setText( tr( "Channels In: " ) +
QString::number( lm->getDescription( _key )->inputChannels ) );
QLabel * channelsOut = new QLabel( groupbox );
channelsOut->setText( tr( "Channels Out: " ) +
QString::number( lm->getDescription( _key )->outputChannels ) );
l->addWidget( groupbox );
}
ladspaSubPluginFeatures::ladspaSubPluginFeatures( plugin::pluginTypes _type ) :
subPluginFeatures( _type )
{
}
QWidget * ladspaSubPluginFeatures::createDescriptionWidget(
QWidget * _parent, engine * _eng, const key & _key )
{
return( new ladspaSubPluginDescriptionWidget( _parent, _eng,
subPluginKeyToLadspaKey( _key ) ) );
}
void ladspaSubPluginFeatures::listSubPluginKeys( engine * _eng,
plugin::descriptor * _desc, keyList & _kl )
{
ladspa2LMMS * lm = _eng->getLADSPAManager();
l_sortable_plugin_t plugins;
switch( m_type )
{
case plugin::Instrument:
plugins = lm->getInstruments();
break;
case plugin::Effect:
plugins = lm->getValidEffects();
//plugins += lm->getInvalidEffects();
break;
case plugin::AnalysisTools:
plugins = lm->getAnalysisTools();
break;
case plugin::Other:
plugins = lm->getOthers();
break;
default:
break;
}
for( l_sortable_plugin_t::const_iterator it = plugins.begin();
it != plugins.end(); ++it )
{
if( lm->getDescription( ( *it ).second )->inputChannels <=
_eng->getMixer()->audioDev()->channels() )
{
_kl.push_back( ladspaKeyToSubPluginKey(
_desc,
( *it ).first,
( *it ).second ) );
}
}
}
#include "ladspa_subplugin_features.moc"
#endif
#endif

View File

@@ -64,7 +64,6 @@
#include "tooltip.h"
#include "led_checkbox.h"
#include "lcd_spinbox.h"
#include "ladspa_manager.h"
// platform-specific audio-interface-classes
@@ -118,9 +117,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
m_vstDir( configManager::inst()->vstDir() ),
m_artworkDir( configManager::inst()->artworkDir() ),
m_flDir( configManager::inst()->flDir() ),
#ifdef LADSPA_SUPPORT
m_ladDir( configManager::inst()->ladspaDir() ),
#endif
#ifdef HAVE_STK_H
m_stkDir( configManager::inst()->stkDir() ),
#endif
@@ -149,14 +146,10 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
m_tabBar->setFixedWidth( 72 );
QWidget * ws = new QWidget( settings );
#ifdef LADSPA_SUPPORT
#ifdef HAVE_STK_H
ws->setFixedSize( 360, 412 );
#else
ws->setFixedSize( 360, 356 );
#endif
#else
ws->setFixedSize( 360, 300 );
#endif
QWidget * general = new QWidget( ws );
general->setFixedSize( 360, 240 );
@@ -272,14 +265,10 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
QWidget * directories = new QWidget( ws );
#ifdef LADSPA_SUPPORT
#ifdef HAVE_STK_H
directories->setFixedSize( 360, 362 );
#else
directories->setFixedSize( 360, 316 );
#endif
#else
directories->setFixedSize( 360, 260 );
#endif
QVBoxLayout * dir_layout = new QVBoxLayout( directories );
dir_layout->setSpacing( 0 );
@@ -361,7 +350,6 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
fldir_select_btn->move( 320, 20 );
connect( fldir_select_btn, SIGNAL( clicked() ), this,
SLOT( openFLDir() ) );
#ifdef LADSPA_SUPPORT
// LADSPA-dir
tabWidget * lad_tw = new tabWidget( tr(
"LADSPA plugin directories" ).toUpper(),
@@ -380,7 +368,6 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
laddir_select_btn->move( 320, 20 );
connect( laddir_select_btn, SIGNAL( clicked() ), this,
SLOT( openLADSPADir() ) );
#endif
#ifdef HAVE_STK_H
// STK-dir
@@ -410,10 +397,8 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) :
dir_layout->addWidget( artwork_tw );
dir_layout->addSpacing( 10 );
dir_layout->addWidget( fl_tw );
#ifdef LADSPA_SUPPORT
dir_layout->addSpacing( 10 );
dir_layout->addWidget( lad_tw );
#endif
#ifdef HAVE_STK_H
dir_layout->addSpacing( 10 );
dir_layout->addWidget( stk_tw );
@@ -768,9 +753,7 @@ void setupDialog::accept( void )
configManager::inst()->setVSTDir( m_vstDir );
configManager::inst()->setArtworkDir( m_artworkDir );
configManager::inst()->setFLDir( m_flDir );
#ifdef LADSPA_SUPPORT
configManager::inst()->setLADSPADir( m_ladDir );
#endif
#ifdef HAVE_STK_H
configManager::inst()->setSTKDir( m_stkDir );
#endif
@@ -1034,7 +1017,6 @@ void setupDialog::openFLDir( void )
void setupDialog::openLADSPADir( void )
{
#ifdef LADSPA_SUPPORT
#ifdef QT4
QString new_dir = QFileDialog::getExistingDirectory( this,
tr( "Choose LADSPA plugin directory" ),
@@ -1055,7 +1037,6 @@ void setupDialog::openLADSPADir( void )
new_dir );
}
}
#endif
}
@@ -1092,9 +1073,7 @@ void setupDialog::setFLDir( const QString & _fd )
void setupDialog::setLADSPADir( const QString & _fd )
{
#ifdef LADSPA_SUPPORT
m_ladDir = _fd;
#endif
}

View File

@@ -1,146 +0,0 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* ladspa_2_lmms.cpp - class that identifies and instantiates LADSPA effects
* for use with LMMS
*
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "ladspa_manager.h"
#ifdef LADSPA_SUPPORT
#include "ladspa_2_lmms.h"
#ifdef QT3
#define indexOf find
#endif
ladspa2LMMS::ladspa2LMMS( engine * _engine ):
ladspaManager( _engine )
{
l_sortable_plugin_t plugins = getSortedPlugins();
for( l_sortable_plugin_t::iterator it = plugins.begin();
it != plugins.end(); it++ )
{
ladspa_key_t key = (*it).second;
ladspaManagerDescription * desc = getDescription( key );
if( desc->type == SOURCE )
{
m_instruments.append( qMakePair( getName( key ),
key ) );
}
else if( desc->type == TRANSFER &&
( desc->inputChannels == desc->outputChannels &&
( desc->inputChannels == 1 ||
desc->inputChannels == 2 ||
desc->inputChannels == 4 ) &&
isRealTimeCapable( key ) ) )
{
m_validEffects.append( qMakePair( getName( key ),
key ) );
}
else if( desc->type == TRANSFER &&
( desc->inputChannels != desc->outputChannels ||
( desc->inputChannels != 1 &&
desc->inputChannels != 2 &&
desc->inputChannels != 4 ) ||
!isRealTimeCapable( key ) ) )
{
m_invalidEffects.append( qMakePair( getName( key ),
key ) );
}
else if( desc->type == SINK )
{
m_analysisTools.append( qMakePair( getName( key ),
key ) );
}
else if( desc->type == OTHER )
{
m_otherPlugins.append( qMakePair( getName( key ),
key ) );
}
}
}
ladspa2LMMS::~ladspa2LMMS()
{
}
QString ladspa2LMMS::getShortName( const ladspa_key_t & _key )
{
QString name = getName( _key );
if( name.indexOf( "(" ) > 0 )
{
name = name.left( name.indexOf( "(" ) );
}
if( name.indexOf( " - " ) > 0 )
{
name = name.left( name.indexOf( " - " ) );
}
if( name.indexOf( " " ) > 0 )
{
name = name.left( name.indexOf( " " ) );
}
#ifndef QT3
Qt::CaseSensitivity cs = Qt::CaseInsensitive;
#else
bool cs = FALSE;
#endif
if( name.indexOf( " with ", 0, cs ) > 0 )
{
name = name.left( name.indexOf( " with ", 0, cs ) );
}
if( name.indexOf( ",", 0, cs ) > 0 )
{
name = name.left( name.indexOf( ",", 0, cs ) );
}
if( name.length() > 40 )
{
Uint8 i = 40;
while( name[i] != ' ' && i != 0 )
{
i--;
}
name = name.left( i );
}
if( name.length() == 0 )
{
name = "LADSPA Plugin";
}
return( name );
}
#undef indexOf
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -10,8 +10,6 @@
#include "src/lib/embed.cpp"
#include "src/lib/base64.cpp"
#include "src/lib/mmp.cpp"
#include "src/lib/ladspa_manager.cpp"
#include "src/lib/ladspa_2_lmms.cpp"
#include "src/lib/oscillator.cpp"
#include "src/lib/clipboard.cpp"
#include "src/lib/sample_buffer.cpp"
@@ -20,9 +18,6 @@
#include "src/core/effect.cpp"
#include "src/core/effect_select_dialog.cpp"
#include "src/core/effect_control_dialog.cpp"
//#include "src/core/ladspa_browser.cpp"
#include "src/core/ladspa_port_dialog.cpp"
#include "src/core/ladspa_subplugin_features.cpp"
#include "src/core/import_filter.cpp"
#include "src/core/config_mgr.cpp"
#include "src/core/envelope_and_lfo_widget.cpp"
@@ -75,7 +70,6 @@
#include "src/tracks/pattern.cpp"
#include "src/tracks/bb_track.cpp"
#include "src/tracks/sample_track.cpp"
#include "src/widgets/ladspa_description.cpp"
#include "src/widgets/project_notes.cpp"
#include "src/widgets/led_checkbox.cpp"
#include "src/widgets/knob.cpp"
@@ -103,6 +97,5 @@
#include "src/widgets/volume_knob.cpp"
#include "src/widgets/rack_plugin.cpp"
#include "src/widgets/rack_view.cpp"
#include "src/widgets/ladspa_control.cpp"
#include "src/widgets/effect_label.cpp"
#endif

View File

@@ -1,401 +0,0 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* ladspa_control.cpp - widget for controlling a LADSPA port
*
* Copyright (c) 2006 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "ladspa_manager.h"
#ifdef LADSPA_SUPPORT
#ifdef QT4
#include <QtGui/QWhatsThis>
#else
#include <qwhatsthis.h>
#endif
#include "ladspa_control.h"
#include "ladspa_base.h"
#include "tooltip.h"
#include "tempo_sync_knob.h"
ladspaControl::ladspaControl( QWidget * _parent,
port_desc_t * _port,
engine * _engine,
track * _track,
bool _link) :
QWidget( _parent
#ifdef QT3
, "ladspaControl"
#endif
),
journallingObject( _engine ),
m_port( _port ),
m_track( _track ),
m_link( NULL ),
m_toggle( NULL ),
m_knob( NULL )
{
m_layout = new QHBoxLayout( this
#ifdef QT3
, 0, 0, "ladspaControlLayout"
#endif
);
if( _link )
{
m_link = new ledCheckBox( "", this, "", eng(), m_track );
m_link->setChecked( FALSE );
connect( m_link, SIGNAL( toggled( bool ) ),
this, SLOT( portLink( bool ) ) );
m_layout->addWidget( m_link );
toolTip::add( m_link, tr( "Link channels" ) );
}
switch( m_port->data_type )
{
case TOGGLED:
m_toggle = new ledCheckBox( m_port->name, this, "",
eng(), m_track,
ledCheckBox::GREEN );
connect( m_toggle, SIGNAL( toggled( bool ) ),
this, SLOT( ledChange( bool ) ) );
setFixedSize( m_toggle->width(), m_toggle->height() );
if( m_port->def == 1.0f )
{
m_toggle->setChecked( TRUE );
}
if( _link )
{
m_layout->addWidget( m_toggle );
setFixedSize( m_link->width() +
m_toggle->width(),
m_toggle->height() );
}
break;
case INTEGER:
m_knob = new knob( knobBright_26, this,
m_port->name, eng(), m_track);
connect( m_knob, SIGNAL( valueChanged( float ) ),
this, SLOT( knobChange( float ) ) );
m_knob->setLabel( m_port->name );
m_knob->setRange( static_cast<int>( m_port->max ),
static_cast<int>( m_port->min ),
1 + static_cast<int>( m_port->max -
m_port->min ) / 400 );
m_knob->setInitValue(
static_cast<int>( m_port->def ) );
setFixedSize( m_knob->width(), m_knob->height() );
m_knob->setHintText( tr( "Value:" ) + " ", "" );
#ifdef QT4
m_knob->setWhatsThis(
#else
QWhatsThis::add( m_knob,
#endif
tr( "Sorry, no help available." ) );
if( _link )
{
m_layout->addWidget( m_knob );
setFixedSize( m_link->width() +
m_knob->width(),
m_knob->height() );
}
break;
case FLOAT:
m_knob = new knob( knobBright_26, this,
m_port->name, eng(), m_track);
connect( m_knob, SIGNAL( valueChanged( float ) ),
this, SLOT( knobChange( float ) ) );
m_knob->setLabel( m_port->name );
m_knob->setRange( m_port->min, m_port->max,
( m_port->max -
m_port->min ) / 400.0f );
m_knob->setInitValue( m_port->def );
m_knob->setHintText( tr( "Value:" ) + " ", "" );
#ifdef QT4
m_knob->setWhatsThis(
#else
QWhatsThis::add( m_knob,
#endif
tr( "Sorry, no help available." ) );
setFixedSize( m_knob->width(), m_knob->height() );
if( _link )
{
m_layout->addWidget( m_knob );
setFixedSize( m_link->width() +
m_knob->width(),
m_knob->height() );
}
break;
case TIME:
m_knob = new tempoSyncKnob( knobBright_26, this,
m_port->name, eng(), m_track);
connect( m_knob, SIGNAL( valueChanged( float ) ),
this, SLOT( knobChange( float ) ) );
m_knob->setLabel( m_port->name );
m_knob->setRange( m_port->min, m_port->max,
( m_port->max -
m_port->min ) / 400.0f );
m_knob->setInitValue( m_port->def );
m_knob->setHintText( tr( "Value:" ) + " ", "" );
#ifdef QT4
m_knob->setWhatsThis(
#else
QWhatsThis::add( m_knob,
#endif
tr( "Sorry, no help available." ) );
setFixedSize( m_knob->width(), m_knob->height() );
if( _link )
{
m_layout->addWidget( m_knob );
setFixedSize( m_link->width() +
m_knob->width(),
m_knob->height() );
}
break;
default:
break;
}
}
ladspaControl::~ladspaControl()
{
}
LADSPA_Data ladspaControl::getValue( void )
{
LADSPA_Data value = 0.0f;
if( m_processLock.tryLock() )
{
switch( m_port->data_type )
{
case TOGGLED:
value = static_cast<LADSPA_Data>(
m_toggle->isChecked() );
break;
case INTEGER:
case FLOAT:
case TIME:
value = static_cast<LADSPA_Data>(
m_knob->value() );
break;
default:
printf(
"ladspaControl::getValue BAD BAD BAD\n" );
break;
}
m_processLock.unlock();
}
return( value );
}
void ladspaControl::setValue( LADSPA_Data _value )
{
m_processLock.lock();
switch( m_port->data_type )
{
case TOGGLED:
m_toggle->setChecked( static_cast<bool>( _value ) );
break;
case INTEGER:
m_knob->setValue( static_cast<int>( _value ) );
break;
case FLOAT:
case TIME:
m_knob->setValue( static_cast<float>( _value ) );
break;
default:
printf("ladspaControl::setValue BAD BAD BAD\n");
break;
}
m_processLock.unlock();
}
void FASTCALL ladspaControl::saveSettings( QDomDocument & _doc,
QDomElement & _this,
const QString & _name )
{
m_processLock.lock();
if( m_link != NULL )
{
m_link->saveSettings( _doc, _this, _name + "link" );
}
switch( m_port->data_type )
{
case TOGGLED:
m_toggle->saveSettings( _doc, _this, _name );
break;
case INTEGER:
case FLOAT:
case TIME:
m_knob->saveSettings( _doc, _this, _name );
break;
default:
printf("ladspaControl::saveSettings BAD BAD BAD\n");
break;
}
m_processLock.unlock();
}
void FASTCALL ladspaControl::loadSettings( const QDomElement & _this,
const QString & _name )
{
m_processLock.lock();
if( m_link != NULL )
{
m_link->loadSettings( _this, _name + "link" );
}
switch( m_port->data_type )
{
case TOGGLED:
m_toggle->loadSettings( _this, _name );
break;
case INTEGER:
case FLOAT:
case TIME:
m_knob->loadSettings( _this, _name );
break;
default:
printf("ladspaControl::loadSettings BAD BAD BAD\n");
break;
}
m_processLock.unlock();
}
void FASTCALL ladspaControl::linkControls( ladspaControl * _control )
{
m_processLock.lock();
switch( m_port->data_type )
{
case TOGGLED:
ledCheckBox::linkObjects( m_toggle, _control->getToggle() );
break;
case INTEGER:
case FLOAT:
case TIME:
knob::linkObjects( m_knob, _control->getKnob() );
break;
default:
break;
}
m_processLock.unlock();
}
void ladspaControl::ledChange( bool _state )
{
emit( changed( m_port->port_id, static_cast<LADSPA_Data>( _state ) ) );
}
void ladspaControl::knobChange( float _value )
{
emit( changed( m_port->port_id, static_cast<LADSPA_Data>( _value ) ) );
}
void FASTCALL ladspaControl::unlinkControls( ladspaControl * _control )
{
m_processLock.lock();
switch( m_port->data_type )
{
case TOGGLED:
ledCheckBox::unlinkObjects( m_toggle, _control->getToggle() );
break;
case INTEGER:
case FLOAT:
case TIME:
knob::unlinkObjects( m_knob, _control->getKnob() );
break;
default:
break;
}
m_processLock.unlock();
}
void ladspaControl::portLink( bool _state )
{
emit( linkChanged( m_port->control_id, _state ) );
}
void FASTCALL ladspaControl::setLink( bool _state )
{
if( m_link != NULL )
{
m_link->setChecked( _state );
}
}
#include "ladspa_control.moc"
#endif
#endif

View File

@@ -1,266 +0,0 @@
#if 0
#ifndef SINGLE_SOURCE_COMPILE
/*
* left_frame.cpp - presents the plugin selector portion of a ladspa rack
*
* Copyright (c) 2006 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "ladspa_manager.h"
#ifdef LADSPA_SUPPORT
#ifdef QT4
#include <QtCore/QString>
#else
#include <qstring.h>
#endif
#include "ladspa_description.h"
#include "mixer.h"
#include "audio_device.h"
ladspaSubPluginDescriptionWidget::ladspaSubPluginDescriptionWidget( QWidget * _parent, engine * _engine ):
QWidget( _parent
#ifdef QT3
, "ladspaSubPluginDescriptionWidget"
#endif
),
m_ladspaManager( _engine->getLADSPAManager() )
{
m_boxer = new QVBoxLayout( this );
#ifndef QT3
m_grouper = new QGroupBox( tr( "Description" ), this );
#else
m_grouper = new QGroupBox( 9, Qt::Vertical,
tr( "Description" ), this );
#endif
m_label = new QLabel( m_grouper );
m_label->setText( tr( "Label:" ) );
m_maker = new QLabel( m_grouper );
m_maker->setText( tr( "Maker:" ) );
m_copyright = new QLabel( m_grouper );
m_copyright->setText( tr( "Copyright:" ) );
m_requiresRealTime = new QLabel( m_grouper );
m_requiresRealTime->setText( tr( "Requires Real Time:" ) );
m_realTimeCapable = new QLabel( m_grouper );
m_realTimeCapable->setText( tr( "Real Time Capable:" ) );
m_inplaceBroken = new QLabel( m_grouper );
m_inplaceBroken->setText( tr( "Inplace Broken:" ) );
m_channelsIn = new QLabel( m_grouper );
m_channelsIn->setText( tr( "Channels In:" ) );
m_channelsOut = new QLabel( m_grouper );
m_channelsOut->setText( tr( "Channels Out:" ) );
m_boxer->addWidget( m_grouper );
}
ladspaSubPluginDescriptionWidget::~ladspaSubPluginDescriptionWidget()
{
}
void ladspaSubPluginDescriptionWidget::update( const ladspa_key_t & _key )
{
m_label->setText( tr( "Name: " ) +
m_ladspaManager->getName( _key ) );
m_maker->setText( tr( "Maker: " ) +
m_ladspaManager->getMaker( _key ) );
m_copyright->setText( tr( "Copyright: " ) +
m_ladspaManager->getCopyright( _key ) );
if( m_ladspaManager->hasRealTimeDependency( _key ) )
{
m_requiresRealTime->setText( tr( "Requires Real Time: Yes" ) );
}
else
{
m_requiresRealTime->setText( tr( "Requires Real Time: No" ) );
}
if( m_ladspaManager->isRealTimeCapable( _key ) )
{
m_realTimeCapable->setText( tr( "Real Time Capable: Yes" ) );
}
else
{
m_realTimeCapable->setText( tr( "Real Time Capable: No" ) );
}
if( m_ladspaManager->isInplaceBroken( _key ) )
{
m_inplaceBroken->setText( tr( "In Place Broken: Yes" ) );
}
else
{
m_inplaceBroken->setText( tr( "In Place Broken: No" ) );
}
QString chan = QString::number( m_ladspaManager->getDescription(
_key )->inputChannels );
m_channelsIn->setText( tr( "Channels In: " ) + chan );
chan = QString::number( m_ladspaManager->getDescription(
_key )->outputChannels );
m_channelsOut->setText( tr( "Channels Out: " ) + chan );
}
ladspaDescription::ladspaDescription( QWidget * _parent,
engine * _engine,
ladspaPluginType _type ):
QWidget( _parent
#ifdef QT3
, "ladspaDescription"
#endif
)
{
m_ladspaManager = _engine->getLADSPAManager();
setMinimumWidth( 200 );
m_boxer = new QVBoxLayout( this );
#ifndef QT3
m_grouper = new QGroupBox( tr( "Plugins" ), this );
#else
m_grouper = new QGroupBox( 1, Qt::Vertical, tr( "Plugins" ), this );
#endif
l_sortable_plugin_t plugins;
switch( _type )
{
case SOURCE:
plugins = m_ladspaManager->getInstruments();
break;
case TRANSFER:
plugins = m_ladspaManager->getValidEffects();
break;
case VALID:
plugins = m_ladspaManager->getValidEffects();
break;
case INVALID:
plugins = m_ladspaManager->getInvalidEffects();
break;
case SINK:
plugins = m_ladspaManager->getAnalysisTools();
break;
case OTHER:
plugins = m_ladspaManager->getOthers();
break;
default:
break;
}
for( l_sortable_plugin_t::iterator it = plugins.begin();
it != plugins.end(); it++ )
{
if( _type != VALID ||
m_ladspaManager->getDescription(
(*it).second )->inputChannels <=
_engine->getMixer()->audioDev()->channels() )
{
m_pluginNames.append( (*it).first );
m_pluginKeys.append( (*it).second );
}
}
m_pluginList = new Q3ListBox( m_grouper );
m_pluginList->insertStringList( m_pluginNames );
connect( m_pluginList, SIGNAL( highlighted( int ) ),
SLOT( onHighlighted( int ) ) );
connect( m_pluginList, SIGNAL( doubleClicked( QListBoxItem * ) ),
SLOT( onDoubleClicked( QListBoxItem * ) ) );
m_boxer->addWidget( m_grouper );
m_ladspaSubPluginDescriptionWidget = new ladspaSubPluginDescriptionWidget( this, _engine );
connect( this, SIGNAL( highlighted( const ladspa_key_t & ) ),
m_ladspaSubPluginDescriptionWidget,
SLOT( update( const ladspa_key_t & ) ) );
m_boxer->addWidget( m_ladspaSubPluginDescriptionWidget );
if( m_pluginList->numRows() > 0 )
{
m_pluginList->setSelected( 0, true );
m_currentSelection = m_pluginKeys[0];
emit( highlighted( m_currentSelection ) );
}
}
ladspaDescription::~ladspaDescription()
{
delete m_ladspaSubPluginDescriptionWidget;
delete m_pluginList;
delete m_grouper;
delete m_boxer;
}
void ladspaDescription::onHighlighted( int _pluginIndex )
{
m_currentSelection = m_pluginKeys[_pluginIndex];
emit( highlighted( m_currentSelection ) );
}
void ladspaDescription::onDoubleClicked( QListBoxItem * _item )
{
emit( doubleClicked( m_currentSelection ) );
}
void ladspaDescription::onAddButtonReleased()
{
emit( addPlugin( m_currentSelection ) );
}
#include "ladspa_description.moc"
#endif
#endif
#endif