lot of bugfixes, especially in VST-support-layer and some nice new features
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@44 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -89,8 +89,7 @@ QPixmap * audioFileProcessor::s_artwork = NULL;
|
||||
|
||||
|
||||
audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
audiofileprocessor_plugin_descriptor.public_name ),
|
||||
instrument( _channel_track, &audiofileprocessor_plugin_descriptor ),
|
||||
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
|
||||
m_sampleBuffer( "" ),
|
||||
m_drawMethod( sampleBuffer::LINE_CONNECT )
|
||||
@@ -298,6 +297,10 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc,
|
||||
{
|
||||
QDomElement afp_de = _doc.createElement( nodeName() );
|
||||
afp_de.setAttribute( "src", m_sampleBuffer.audioFile() );
|
||||
if( m_sampleBuffer.audioFile() == "" )
|
||||
{
|
||||
afp_de.setAttribute( "sampledata", m_sampleBuffer.toBase64() );
|
||||
}
|
||||
afp_de.setAttribute( "sframe", QString::number(
|
||||
m_sampleBuffer.startFrame() /
|
||||
(float)m_sampleBuffer.frames() ) );
|
||||
@@ -317,7 +320,14 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc,
|
||||
|
||||
void audioFileProcessor::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
setAudioFile( _this.attribute( "src" ) );
|
||||
if( _this.attribute( "src" ) != "" )
|
||||
{
|
||||
setAudioFile( _this.attribute( "src" ) );
|
||||
}
|
||||
else if( _this.attribute( "sampledata" ) != "" )
|
||||
{
|
||||
m_sampleBuffer.loadFromBase64( _this.attribute( "srcdata" ) );
|
||||
}
|
||||
setStartAndEndKnob( _this.attribute( "sframe" ).toFloat(),
|
||||
_this.attribute( "eframe" ).toFloat() );
|
||||
m_reverseButton->setChecked( _this.attribute( "reversed" ).toInt() );
|
||||
@@ -339,10 +349,14 @@ QString audioFileProcessor::nodeName( void ) const
|
||||
void audioFileProcessor::setParameter( const QString & _param,
|
||||
const QString & _value )
|
||||
{
|
||||
if( _param == "audiofile" )
|
||||
if( _param == "samplefile" )
|
||||
{
|
||||
setAudioFile( _value );
|
||||
}
|
||||
else if( _param == "sampledata" )
|
||||
{
|
||||
m_sampleBuffer.loadFromBase64( _value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* audio_file_processor.h - declaration of class audioFileProcessor
|
||||
* (instrument-plugin for using audio-files)
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* plucked_string_synth.cpp - instrument which uses the Karplus-Strong-algorithm
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -70,8 +70,7 @@ plugin::descriptor pluckedstringsynth_plugin_descriptor =
|
||||
// add distortion
|
||||
|
||||
pluckedStringSynth::pluckedStringSynth( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
pluckedstringsynth_plugin_descriptor.public_name )
|
||||
instrument( _channel_track, &pluckedstringsynth_plugin_descriptor )
|
||||
{
|
||||
m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ) );
|
||||
m_pickKnob->setRange( 0.0f, 0.5f, 0.005f );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* plucked_string_sytn.h - declaration of class pluckedStringSynth which
|
||||
* is a synth for plucked string-sounds
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* triple_oscillator.cpp - powerful instrument with three oscillators
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -77,14 +77,14 @@ plugin::descriptor tripleoscillator_plugin_descriptor =
|
||||
|
||||
|
||||
tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
tripleoscillator_plugin_descriptor.public_name ),
|
||||
instrument( _channel_track, &tripleoscillator_plugin_descriptor ),
|
||||
m_modulationAlgo1( oscillator::MIX ),
|
||||
m_modulationAlgo2( oscillator::MIX )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
pal.setBrush( backgroundRole(),
|
||||
PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
@@ -92,7 +92,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_fm1OscBtn = new pixmapButton( this );
|
||||
m_fm1OscBtn->move( 80, 50 );
|
||||
m_fm1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) );
|
||||
m_fm1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_active" ) );
|
||||
m_fm1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_inactive" ) );
|
||||
m_fm1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
@@ -105,7 +106,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_am1OscBtn = new pixmapButton( this );
|
||||
m_am1OscBtn->move( 120, 50 );
|
||||
m_am1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) );
|
||||
m_am1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_active" ) );
|
||||
m_am1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_inactive" ) );
|
||||
m_am1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
@@ -118,11 +120,12 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_mix1OscBtn = new pixmapButton( this );
|
||||
m_mix1OscBtn->move( 160, 50 );
|
||||
m_mix1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) );
|
||||
m_mix1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_active" ) );
|
||||
m_mix1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_inactive" ) );
|
||||
m_mix1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_mix1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_mix1OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( mix1BtnToggled( bool ) ) );
|
||||
toolTip::add( m_mix1OscBtn, tr( "mix output of oscillator 1 & 2" ) );
|
||||
@@ -133,8 +136,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
"sync_active" ) );
|
||||
m_sync1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"sync_inactive" ) );
|
||||
m_sync1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_sync1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_sync1OscBtn, SIGNAL( toggled( bool ) ), this, SLOT(
|
||||
sync1BtnToggled( bool ) ) );
|
||||
toolTip::add( m_sync1OscBtn, tr( "synchronize oscillator 1 with "
|
||||
@@ -169,7 +172,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_fm2OscBtn = new pixmapButton( this );
|
||||
m_fm2OscBtn->move( 80, 70 );
|
||||
m_fm2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) );
|
||||
m_fm2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_active" ) );
|
||||
m_fm2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_inactive" ) );
|
||||
m_fm2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
@@ -182,8 +186,10 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_am2OscBtn = new pixmapButton( this );
|
||||
m_am2OscBtn->move( 120, 70 );
|
||||
m_am2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) );
|
||||
m_am2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("am_inactive" ) );
|
||||
m_am2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_active" ) );
|
||||
m_am2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_inactive" ) );
|
||||
m_am2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
connect( m_am2OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
@@ -194,11 +200,12 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_mix2OscBtn = new pixmapButton( this );
|
||||
m_mix2OscBtn->move( 160, 70 );
|
||||
m_mix2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) );
|
||||
m_mix2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_active" ) );
|
||||
m_mix2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_inactive" ) );
|
||||
m_mix2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_mix2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_mix2OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( mix2BtnToggled( bool ) ) );
|
||||
toolTip::add( m_mix2OscBtn, tr("mix output of oscillator 2 & 3" ) );
|
||||
@@ -209,8 +216,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
"sync_active" ) );
|
||||
m_sync2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"sync_inactive" ) );
|
||||
m_sync2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_sync2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_sync2OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( sync2BtnToggled( bool ) ) );
|
||||
toolTip::add( m_sync2OscBtn, tr( "synchronize oscillator 2 with "
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* triple_oscillator.h - declaration of class tripleOscillator a powerful
|
||||
* instrument-plugin with 3 oscillators
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -16,6 +16,7 @@ inline T readValue( int _fd = 0 )
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void writeValue( const T & _i, int _fd = 1 )
|
||||
{
|
||||
@@ -23,44 +24,6 @@ inline void writeValue( const T & _i, int _fd = 1 )
|
||||
}
|
||||
|
||||
|
||||
enum vstRemoteCommands
|
||||
{
|
||||
// client -> server
|
||||
LOAD_VST_PLUGIN = 0,
|
||||
CLOSE_VST_PLUGIN,
|
||||
PROCESS = 10,
|
||||
ENQUEUE_MIDI_EVENT = 11,
|
||||
SET_SAMPLE_RATE = 20,
|
||||
SET_BUFFER_SIZE,
|
||||
GET_SHM_KEY_AND_SIZE,
|
||||
GET_VST_VERSION = 30,
|
||||
GET_NAME,
|
||||
GET_VENDOR_STRING,
|
||||
GET_PRODUCT_STRING,
|
||||
|
||||
// server -> client
|
||||
SET_SHM_KEY_AND_SIZE = 100,
|
||||
SET_INPUT_COUNT,
|
||||
SET_OUTPUT_COUNT,
|
||||
SET_XID,
|
||||
INITIALIZATION_DONE,
|
||||
FAILED_LOADING_PLUGIN,
|
||||
QUIT_ACK,
|
||||
GET_SAMPLE_RATE = 110,
|
||||
GET_BUFFER_SIZE,
|
||||
GET_BPM,
|
||||
SET_VST_VERSION,
|
||||
SET_NAME,
|
||||
SET_VENDOR_STRING,
|
||||
SET_PRODUCT_STRING,
|
||||
PROCESS_DONE = 120,
|
||||
|
||||
DEBUG_MSG = 200,
|
||||
UNDEFINED_CMD
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
static inline std::string readString( int _fd = 0 )
|
||||
@@ -84,4 +47,73 @@ static inline void writeString( const char * _str, int _fd = 1 )
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
struct vstParameterDumpItem
|
||||
{
|
||||
Sint32 index;
|
||||
char shortLabel[8];
|
||||
float value;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
// summarized version of VstParameterProperties-struct - useful because client
|
||||
// doesn't have to know about the latter one
|
||||
struct vstParamProperties
|
||||
{
|
||||
char label[64];
|
||||
char shortLabel[8];
|
||||
char categoryLabel[24];
|
||||
float minValue;
|
||||
float maxValue;
|
||||
float step;
|
||||
Sint16 category;
|
||||
} ;
|
||||
|
||||
|
||||
enum vstRemoteCommands
|
||||
{
|
||||
// client -> server
|
||||
VST_LOAD_PLUGIN = 0,
|
||||
VST_CLOSE_PLUGIN,
|
||||
VST_SHOW_EDITOR,
|
||||
VST_PROCESS,
|
||||
VST_ENQUEUE_MIDI_EVENT,
|
||||
VST_SAMPLE_RATE,
|
||||
VST_BUFFER_SIZE,
|
||||
VST_BPM,
|
||||
VST_GET_PARAMETER_COUNT = 20,
|
||||
VST_GET_PARAMETER_DUMP,
|
||||
VST_SET_PARAMETER_DUMP,
|
||||
VST_GET_PARAMETER_PROPERTIES,
|
||||
|
||||
// server -> client
|
||||
VST_INITIALIZATION_DONE = 100,
|
||||
VST_FAILED_LOADING_PLUGIN,
|
||||
VST_QUIT_ACK,
|
||||
VST_SHM_KEY_AND_SIZE,
|
||||
VST_INPUT_COUNT,
|
||||
VST_OUTPUT_COUNT,
|
||||
VST_PLUGIN_XID,
|
||||
VST_PROCESS_DONE,
|
||||
VST_PLUGIN_NAME,
|
||||
VST_PLUGIN_VERSION,
|
||||
VST_PLUGIN_VENDOR_STRING,
|
||||
VST_PLUGIN_PRODUCT_STRING,
|
||||
VST_PARAMETER_COUNT,
|
||||
VST_PARAMETER_DUMP,
|
||||
VST_PARAMETER_PROPERTIES,
|
||||
VST_GET_SAMPLE_RATE = 120,
|
||||
VST_GET_BUFFER_SIZE,
|
||||
|
||||
VST_DEBUG_MSG = 200,
|
||||
VST_UNDEFINED_CMD
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.cpp - instrument-plugin for hosting VST-plugins
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "vestige.h"
|
||||
#include "text_float.h"
|
||||
#include "fstclient.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
@@ -71,8 +72,7 @@ plugin::descriptor vestige_plugin_descriptor =
|
||||
STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ),
|
||||
"VeSTige",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser",
|
||||
"experimental VST-hoster for using VST-plugins "
|
||||
"within LMMS" ),
|
||||
"VST-host for using VST(i)-plugins within LMMS" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
plugin::INSTRUMENT,
|
||||
@@ -86,15 +86,17 @@ QPixmap * vestigeInstrument::s_artwork = NULL;
|
||||
|
||||
|
||||
vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track, vestige_plugin_descriptor.public_name ),
|
||||
instrument( _channel_track, &vestige_plugin_descriptor ),
|
||||
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
|
||||
m_plugin( NULL )
|
||||
m_plugin( NULL ),
|
||||
m_pluginMutex()
|
||||
{
|
||||
if( s_artwork == NULL )
|
||||
{
|
||||
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
|
||||
"artwork" ) );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), *s_artwork);
|
||||
@@ -103,6 +105,9 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
setErasePixmap( *s_artwork );
|
||||
#endif
|
||||
|
||||
connect( songEditor::inst(), SIGNAL( bpmChanged( int ) ),
|
||||
this, SLOT( changeBPM( int ) ) );
|
||||
|
||||
m_openPluginButton = new pixmapButton( this );
|
||||
m_openPluginButton->setCheckable( FALSE );
|
||||
m_openPluginButton->setCursor( Qt::PointingHandCursor );
|
||||
@@ -127,7 +132,9 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
"and you can select your file." ) );
|
||||
|
||||
m_toggleGUIButton = new QPushButton( tr( "Show/hide VST-GUI" ), this );
|
||||
m_toggleGUIButton->setGeometry( 20, 120, 128, 24 );
|
||||
m_toggleGUIButton->setGeometry( 20, 120, 160, 24 );
|
||||
m_toggleGUIButton->setIconSet( embed::getIconPixmap( "zoom" ) );
|
||||
m_toggleGUIButton->setFont( pointSize<8>( m_toggleGUIButton->font() ) );
|
||||
connect( m_toggleGUIButton, SIGNAL( clicked() ), this,
|
||||
SLOT( toggleGUI() ) );
|
||||
#ifdef QT4
|
||||
@@ -138,6 +145,14 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
tr( "Click here to show or hide the graphical user interface "
|
||||
"(GUI) of your VST-plugin." ) );
|
||||
|
||||
QPushButton * note_off_all_btn = new QPushButton( tr( "Turn off all "
|
||||
"notes" ), this );
|
||||
note_off_all_btn->setGeometry( 20, 150, 160, 24 );
|
||||
note_off_all_btn->setIconSet( embed::getIconPixmap( "state_stop" ) );
|
||||
note_off_all_btn->setFont( pointSize<8>( note_off_all_btn->font() ) );
|
||||
connect( note_off_all_btn, SIGNAL( clicked() ), this,
|
||||
SLOT( noteOffAll() ) );
|
||||
|
||||
// now we need a play-handle which cares for calling play()
|
||||
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
|
||||
mixer::inst()->addPlayHandle( iph );
|
||||
@@ -159,6 +174,36 @@ vestigeInstrument::~vestigeInstrument()
|
||||
|
||||
void vestigeInstrument::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
setParameter( "plugin", _this.attribute( "plugin" ) );
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
if( _this.attribute( "guivisible" ).toInt() )
|
||||
{
|
||||
m_plugin->pluginWidget()->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plugin->pluginWidget()->hide();
|
||||
}
|
||||
}
|
||||
const Sint32 num_params = _this.attribute(
|
||||
"numparams" ).toInt();
|
||||
if( num_params > 0 )
|
||||
{
|
||||
QMap<QString, QString> dump;
|
||||
for( Sint32 i = 0; i < num_params; ++i )
|
||||
{
|
||||
const QString key = "param" +
|
||||
QString::number( i );
|
||||
dump[key] = _this.attribute( key );
|
||||
}
|
||||
m_plugin->setParameterDump( dump );
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -168,6 +213,24 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
QDomElement vst_de = _doc.createElement( nodeName() );
|
||||
vst_de.setAttribute( "plugin", m_pluginDLL );
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
vst_de.setAttribute( "guivisible",
|
||||
m_plugin->pluginWidget()->isVisible() );
|
||||
}
|
||||
const QMap<QString, QString> & dump = m_plugin->parameterDump();
|
||||
vst_de.setAttribute( "numparams", dump.size() );
|
||||
for( QMap<QString, QString>::const_iterator it = dump.begin();
|
||||
it != dump.end(); ++it )
|
||||
{
|
||||
vst_de.setAttribute( it.key(), it.data() );
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
_parent.appendChild( vst_de );
|
||||
}
|
||||
|
||||
@@ -185,8 +248,15 @@ QString vestigeInstrument::nodeName( void ) const
|
||||
void vestigeInstrument::setParameter( const QString & _param,
|
||||
const QString & _value )
|
||||
{
|
||||
if( _param == "plugin" )
|
||||
if( _param == "plugin" && _value != "" )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
bool set_ch_name = ( m_plugin != NULL &&
|
||||
getChannelTrack()->name() == m_plugin->name() ) ||
|
||||
getChannelTrack()->name() ==
|
||||
channelTrack::tr( "Default" );
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
closePlugin();
|
||||
|
||||
m_pluginDLL = _value;
|
||||
@@ -195,9 +265,12 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
tr( "Please wait while loading VST-plugin..." ),
|
||||
PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ),
|
||||
0 );
|
||||
m_pluginMutex.lock();
|
||||
m_plugin = new remoteVSTPlugin( m_pluginDLL );
|
||||
if( m_plugin->failed() )
|
||||
{
|
||||
m_pluginMutex.unlock();
|
||||
closePlugin();
|
||||
delete tf;
|
||||
QMessageBox::information( this,
|
||||
tr( "Failed loading VST-plugin" ),
|
||||
@@ -208,7 +281,6 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
"contact an LMMS-developer!"
|
||||
).arg( m_pluginDLL ),
|
||||
QMessageBox::Ok );
|
||||
closePlugin();
|
||||
return;
|
||||
}
|
||||
/* if( m_plugin->vstVersion() < 2000 )
|
||||
@@ -224,6 +296,17 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
return;
|
||||
}*/
|
||||
m_plugin->showEditor();
|
||||
m_plugin->setBPM( songEditor::inst()->getBPM() );
|
||||
if( set_ch_name == TRUE )
|
||||
{
|
||||
getChannelTrack()->setName( m_plugin->name() );
|
||||
}
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
m_plugin->pluginWidget()->setWindowIcon(
|
||||
*( getChannelTrack()->windowIcon() ) );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
update();
|
||||
delete tf;
|
||||
}
|
||||
@@ -234,6 +317,7 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
|
||||
void vestigeInstrument::play( void )
|
||||
{
|
||||
QMutexLocker ml( &m_pluginMutex );
|
||||
if( m_plugin == NULL )
|
||||
{
|
||||
return;
|
||||
@@ -256,11 +340,14 @@ void vestigeInstrument::play( void )
|
||||
|
||||
void vestigeInstrument::playNote( notePlayHandle * _n )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( _n->totalFramesPlayed() == 0 && m_plugin != NULL )
|
||||
{
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0, _n->key(),
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0,
|
||||
getChannelTrack()->masterKey( _n ),
|
||||
_n->getVolume() ), _n->framesAhead() );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -268,11 +355,14 @@ void vestigeInstrument::playNote( notePlayHandle * _n )
|
||||
|
||||
void vestigeInstrument::deleteNotePluginData( notePlayHandle * _n )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0, _n->key(),
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
|
||||
getChannelTrack()->masterKey( _n ),
|
||||
0 ), 0 );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -337,6 +427,7 @@ void vestigeInstrument::openPlugin( void )
|
||||
|
||||
void vestigeInstrument::toggleGUI( void )
|
||||
{
|
||||
QMutexLocker ml( &m_pluginMutex );
|
||||
if( m_plugin == NULL )
|
||||
{
|
||||
return;
|
||||
@@ -359,6 +450,36 @@ void vestigeInstrument::toggleGUI( void )
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::noteOffAll( void )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
for( int key = 0; key < OCTAVES * NOTES_PER_OCTAVE; ++key )
|
||||
{
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
|
||||
key, 0 ), 0 );
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::changeBPM( int _new_val )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->setBPM( _new_val );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
@@ -372,8 +493,9 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
|
||||
p.drawPixmap( 0, 0, *s_artwork );
|
||||
|
||||
QString plugin_name = ( m_plugin ) ?
|
||||
QString( m_plugin->name() )
|
||||
QString plugin_name = ( m_plugin != NULL ) ?
|
||||
m_plugin->name()/* + QString::number(
|
||||
m_plugin->version() )*/
|
||||
:
|
||||
tr( "No VST-plugin loaded" );
|
||||
QFont f = p.font();
|
||||
@@ -383,6 +505,7 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
|
||||
p.drawText( 20, 80, plugin_name );
|
||||
|
||||
// m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
p.setPen( QColor( 64, 128, 64 ) );
|
||||
@@ -391,6 +514,8 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
p.drawText( 20, 94, tr( "by" ) + " " +
|
||||
m_plugin->vendorString() );
|
||||
}
|
||||
// m_pluginMutex.unlock();
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
@@ -401,8 +526,10 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
|
||||
void vestigeInstrument::closePlugin( void )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
delete m_plugin;
|
||||
m_plugin = NULL;
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.h - instrument VeSTige for hosting VST-plugins
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -31,16 +31,15 @@
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
#include <QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvaluevector.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "fstclient.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
|
||||
|
||||
@@ -76,6 +75,8 @@ public:
|
||||
protected slots:
|
||||
void openPlugin( void );
|
||||
void toggleGUI( void );
|
||||
void noteOffAll( void );
|
||||
void changeBPM( int _new_val );
|
||||
|
||||
|
||||
protected:
|
||||
@@ -89,6 +90,7 @@ private:
|
||||
|
||||
|
||||
remoteVSTPlugin * m_plugin;
|
||||
QMutex m_pluginMutex;
|
||||
|
||||
|
||||
pixmapButton * m_openPluginButton;
|
||||
|
||||
Reference in New Issue
Block a user