improved undo/redo-system

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@109 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-03-21 13:42:28 +00:00
parent bf139a65e4
commit fe9dc8c391
88 changed files with 3327 additions and 772 deletions

View File

@@ -47,7 +47,7 @@
#include "audio_file_processor.h"
#include "song_editor.h"
#include "channel_track.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "paths.h"
#include "interpolation.h"
@@ -72,7 +72,8 @@ plugin::descriptor audiofileprocessor_plugin_descriptor =
"AudioFileProcessor",
QT_TRANSLATE_NOOP( "pluginBrowser",
"simple sampler with various settings for "
"using samples (e.g. drums) in a channel" ),
"using samples (e.g. drums) in an "
"instrument-track" ),
"Tobias Doerffel <tobydox/at/users.sf.net>",
0x0100,
plugin::INSTRUMENT,
@@ -86,7 +87,7 @@ QPixmap * audioFileProcessor::s_artwork = NULL;
audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) :
instrument( _channel_track, &audiofileprocessor_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_sampleBuffer( eng(), "" ),
@@ -103,7 +104,6 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
m_openAudioFileButton = new pixmapButton( this, eng() );
m_openAudioFileButton->setCheckable( FALSE );
m_openAudioFileButton->setCursor( QCursor( Qt::PointingHandCursor ) );
m_openAudioFileButton->move( 200, 90 );
m_openAudioFileButton->setActiveGraphic( embed::getIconPixmap(
@@ -129,6 +129,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
"doesn't sound like the original one..." ) );
m_reverseButton = new pixmapButton( this, eng() );
m_reverseButton->setCheckable( TRUE );
m_reverseButton->move( 160, 124 );
m_reverseButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"reverse_on" ) );
@@ -148,6 +149,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
"crash." ) );
m_loopButton = new pixmapButton( this, eng() );
m_loopButton->setCheckable( TRUE );
m_loopButton->move( 180, 124 );
m_loopButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"loop_on" ) );
@@ -283,27 +285,25 @@ audioFileProcessor::~audioFileProcessor()
void audioFileProcessor::saveSettings( QDomDocument & _doc,
QDomElement & _parent )
QDomElement & _this )
{
QDomElement afp_de = _doc.createElement( nodeName() );
afp_de.setAttribute( "src", m_sampleBuffer.audioFile() );
_this.setAttribute( "src", m_sampleBuffer.audioFile() );
if( m_sampleBuffer.audioFile() == "" )
{
QString s;
afp_de.setAttribute( "sampledata", m_sampleBuffer.toBase64( s ) );
_this.setAttribute( "sampledata", m_sampleBuffer.toBase64( s ) );
}
afp_de.setAttribute( "sframe", QString::number(
_this.setAttribute( "sframe", QString::number(
m_sampleBuffer.startFrame() /
(float)m_sampleBuffer.frames() ) );
afp_de.setAttribute( "eframe", QString::number(
_this.setAttribute( "eframe", QString::number(
m_sampleBuffer.endFrame() /
(float)m_sampleBuffer.frames() ) );
afp_de.setAttribute( "reversed", QString::number(
_this.setAttribute( "reversed", QString::number(
m_reverseButton->isChecked() ) );
afp_de.setAttribute( "looped", QString::number(
_this.setAttribute( "looped", QString::number(
m_loopButton->isChecked() ) );
afp_de.setAttribute( "amp", QString::number( m_ampKnob->value() ) );
_parent.appendChild( afp_de );
_this.setAttribute( "amp", QString::number( m_ampKnob->value() ) );
}
@@ -356,7 +356,7 @@ void audioFileProcessor::setParameter( const QString & _param,
Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
{
const float freq_factor = BASE_FREQ /
( getChannelTrack()->frequency( _n ) *
( getInstrumentTrack()->frequency( _n ) *
DEFAULT_SAMPLE_RATE /
eng()->getMixer()->sampleRate() );
@@ -371,12 +371,12 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
void audioFileProcessor::setAudioFile( const QString & _audio_file )
{
// is current channel-name equal to previous-filename??
if( getChannelTrack()->name() ==
if( getInstrumentTrack()->name() ==
QFileInfo( m_sampleBuffer.audioFile() ).fileName() ||
m_sampleBuffer.audioFile() == "" )
{
// then set it to new one
getChannelTrack()->setName( QFileInfo( _audio_file
getInstrumentTrack()->setName( QFileInfo( _audio_file
).fileName() );
}
// else we don't touch the channel-name, because the user named it self
@@ -395,7 +395,7 @@ void audioFileProcessor::playNote( notePlayHandle * _n )
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
// calculate frequency of note
const float note_freq = getChannelTrack()->frequency( _n ) /
const float note_freq = getInstrumentTrack()->frequency( _n ) /
( eng()->getMixer()->sampleRate() /
DEFAULT_SAMPLE_RATE );
if( m_sampleBuffer.play( buf, _n->totalFramesPlayed(),
@@ -403,7 +403,7 @@ void audioFileProcessor::playNote( notePlayHandle * _n )
m_loopButton->isChecked(),
&_n->m_pluginData ) == TRUE )
{
getChannelTrack()->processAudioBuffer( buf, frames, _n );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
}
bufferAllocator::free( buf );
}
@@ -674,7 +674,7 @@ extern "C"
plugin * lmms_plugin_main( void * _data )
{
return( new audioFileProcessor(
static_cast<channelTrack *>( _data ) ) );
static_cast<instrumentTrack *>( _data ) ) );
}

View File

@@ -52,7 +52,7 @@ class audioFileProcessor : public instrument, public specialBgHandlingWidget
{
Q_OBJECT
public:
audioFileProcessor( channelTrack * _channel_track );
audioFileProcessor( instrumentTrack * _channel_track );
virtual ~audioFileProcessor();
virtual void FASTCALL playNote( notePlayHandle * _n );

View File

@@ -57,7 +57,7 @@ using namespace std;
#include "bit_invader.h"
#include "channel_track.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
@@ -173,7 +173,7 @@ sample_t bSynth::nextStringSample( void )
***********************************************************************/
bitInvader::bitInvader( channelTrack * _channel_track ) :
bitInvader::bitInvader( instrumentTrack * _channel_track ) :
instrument( _channel_track,
&bitinvader_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) )
@@ -565,34 +565,28 @@ bitInvader::~bitInvader()
void bitInvader::saveSettings( QDomDocument & _doc,
QDomElement & _parent )
void bitInvader::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
QDomElement to_de = _doc.createElement( nodeName() );
// Save plugin version
to_de.setAttribute( "version", "0.1" );
_this.setAttribute( "version", "0.1" );
// Save sample length
to_de.setAttribute( "sampleLength", QString::number( sample_length ) );
_this.setAttribute( "sampleLength", QString::number( sample_length ) );
// Save sample shape base64-encoded
QString sampleString;
base64::encode( (const char *)sample_shape,
sample_length * sizeof(float), sampleString );
to_de.setAttribute( "sampleShape", sampleString );
_this.setAttribute( "sampleShape", sampleString );
// save LED normalize
to_de.setAttribute( "interpolation",
_this.setAttribute( "interpolation",
m_interpolationToggle->isChecked() );
// save LED
to_de.setAttribute( "normalize", m_normalizeToggle->isChecked() );
_parent.appendChild( to_de );
_this.setAttribute( "normalize", m_normalizeToggle->isChecked() );
}
@@ -686,7 +680,7 @@ void bitInvader::playNote( notePlayHandle * _n )
if ( _n->totalFramesPlayed() == 0 )
{
float freq = getChannelTrack()->frequency( _n );
float freq = getInstrumentTrack()->frequency( _n );
float factor;
if (!normalize) {
@@ -713,7 +707,7 @@ void bitInvader::playNote( notePlayHandle * _n )
}
}
getChannelTrack()->processAudioBuffer( buf, frames, _n );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
}
@@ -805,7 +799,7 @@ extern "C"
// neccessary for getting instance out of shared lib
plugin * lmms_plugin_main( void * _data )
{
return( new bitInvader( static_cast<channelTrack *>( _data ) ) );
return( new bitInvader( static_cast<instrumentTrack *>( _data ) ) );
}

View File

@@ -75,7 +75,7 @@ class bitInvader : public instrument, public specialBgHandlingWidget
{
Q_OBJECT
public:
bitInvader(channelTrack * _channel_track );
bitInvader(instrumentTrack * _channel_track );
virtual ~bitInvader();
virtual void FASTCALL playNote( notePlayHandle * _n );

View File

@@ -26,7 +26,7 @@
#include "midi_import.h"
#include "track_container.h"
#include "channel_track.h"
#include "instrument_track.h"
#include "pattern.h"
@@ -217,7 +217,7 @@ invalid_format:
}
// now create new channel-track for reading track
channelTrack * ct = dynamic_cast<channelTrack *>(
instrumentTrack * ct = dynamic_cast<instrumentTrack *>(
track::create(
track::CHANNEL_TRACK,
_tc ) );
@@ -226,7 +226,7 @@ invalid_format:
#endif
// TODO: setup program, channel etc.
ct->loadInstrument( "tripleoscillator" );
ct->toggledChannelButton( FALSE );
ct->toggledInstrumentTrackButton( FALSE );
// now create pattern to store notes in
pattern * p = dynamic_cast<pattern *>( ct->createTCO( 0 ) );
@@ -269,7 +269,8 @@ invalid_format:
NOTES_PER_OCTAVE * OCTAVES &&
keys[ev.key()][0] >= 0 )
{
note n( midiTime( ( tick - keys[ev.key()][0] ) / 10 ),
note n( eng(),
midiTime( ( tick - keys[ev.key()][0] ) / 10 ),
midiTime( keys[ev.key()][0] / 10 ),
(tones)( ev.key() % NOTES_PER_OCTAVE ),
(octaves)( ev.key() / NOTES_PER_OCTAVE ),

View File

@@ -1,5 +1,5 @@
/*
* bit_invader.cpp - instrument which uses a usereditable wavetable
* organic.cpp - additive synthesizer for organ-like sounds
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
@@ -57,7 +57,7 @@ using namespace std;
#include "organic.h"
#include "channel_track.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
@@ -102,7 +102,7 @@ QPixmap * organicInstrument::s_artwork = NULL;
***********************************************************************/
organicInstrument::organicInstrument( channelTrack * _channel_track ) :
organicInstrument::organicInstrument( instrumentTrack * _channel_track ) :
instrument( _channel_track,
&organic_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) )
@@ -190,7 +190,7 @@ organicInstrument::organicInstrument( channelTrack * _channel_track ) :
//m_randBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
// createHeuristicMask() ) );
connect( m_randBtn, SIGNAL ( toggled(bool) ),
connect( m_randBtn, SIGNAL ( clicked() ),
this, SLOT( randomiseSettings() ) );
// set harmonics
@@ -232,36 +232,26 @@ organicInstrument::~organicInstrument()
void organicInstrument::saveSettings( QDomDocument & _doc,
QDomElement & _parent )
void organicInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
QDomElement to_de = _doc.createElement( nodeName() );
to_de.setAttribute( "num_osc", QString::number( m_num_oscillators ) );
to_de.setAttribute( "foldback", QString::number( fx1Knob->value() ) );
to_de.setAttribute( "vol", QString::number( volKnob->value() ) );
_this.setAttribute( "num_osc", QString::number( m_num_oscillators ) );
_this.setAttribute( "foldback", QString::number( fx1Knob->value() ) );
_this.setAttribute( "vol", QString::number( volKnob->value() ) );
for( int i = 0; i < m_num_oscillators; ++i )
{
QString is = QString::number( i );
to_de.setAttribute( "vol" + is, QString::number(
_this.setAttribute( "vol" + is, QString::number(
m_osc[i].volKnob->value() ) );
to_de.setAttribute( "pan" + is, QString::number(
_this.setAttribute( "pan" + is, QString::number(
m_osc[i].panKnob->value() ) );
to_de.setAttribute( "harmonic" + is, QString::number(
_this.setAttribute( "harmonic" + is, QString::number(
m_osc[i].harmonic ) );
to_de.setAttribute( "detune" + is, QString::number(
_this.setAttribute( "detune" + is, QString::number(
m_osc[i].detuneKnob->value() ) );
to_de.setAttribute( "wavetype" + is, QString::number(
_this.setAttribute( "wavetype" + is, QString::number(
m_osc[i].waveShape ) );
}
_parent.appendChild( to_de );
}
@@ -306,7 +296,7 @@ void organicInstrument::playNote( notePlayHandle * _n )
{
if( _n->totalFramesPlayed() == 0 )
{
float freq = getChannelTrack()->frequency( _n );
float freq = getInstrumentTrack()->frequency( _n );
oscillator * oscs_l[m_num_oscillators];
oscillator * oscs_r[m_num_oscillators];
@@ -417,7 +407,7 @@ void organicInstrument::playNote( notePlayHandle * _n )
// -- --
getChannelTrack()->processAudioBuffer( buf, frames, _n );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
}
@@ -535,7 +525,7 @@ extern "C"
// neccessary for getting instance out of shared lib
plugin * lmms_plugin_main( void * _data )
{
return( new organicInstrument( static_cast<channelTrack *>( _data ) ) );
return( new organicInstrument( static_cast<instrumentTrack *>( _data ) ) );
}

View File

@@ -1,6 +1,5 @@
/*
* bit_invader.h - declaration of class bitInvader and bSynth which
* are a wavetable synthesizer
* organic.h - additive synthesizer for organ-like sounds
*
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
*
@@ -54,7 +53,7 @@ class organicInstrument : public instrument, public specialBgHandlingWidget
{
Q_OBJECT
public:
organicInstrument(channelTrack * _channel_track );
organicInstrument( instrumentTrack * _channel_track );
virtual ~organicInstrument();
virtual void FASTCALL playNote( notePlayHandle * _n );

View File

@@ -39,7 +39,7 @@
#include "plucked_string_synth.h"
#include "channel_track.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "templates.h"
#include "buffer_allocator.h"
@@ -70,7 +70,7 @@ plugin::descriptor pluckedstringsynth_plugin_descriptor =
// TODO: make this synth stereo for better better spacial (room) feeling and
// add distortion
pluckedStringSynth::pluckedStringSynth( channelTrack * _channel_track ) :
pluckedStringSynth::pluckedStringSynth( instrumentTrack * _channel_track ) :
instrument( _channel_track, &pluckedstringsynth_plugin_descriptor )
{
m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ),
@@ -107,13 +107,11 @@ pluckedStringSynth::~pluckedStringSynth()
void pluckedStringSynth::saveSettings( QDomDocument & _doc,
QDomElement & _parent )
QDomElement & _this )
{
QDomElement pss_de = _doc.createElement( nodeName() );
pss_de.setAttribute( "pick", QString::number( m_pickKnob->value() ) );
pss_de.setAttribute( "pickup", QString::number(
_this.setAttribute( "pick", QString::number( m_pickKnob->value() ) );
_this.setAttribute( "pickup", QString::number(
m_pickupKnob->value() ) );
_parent.appendChild( pss_de );
}
@@ -140,7 +138,7 @@ void pluckedStringSynth::playNote( notePlayHandle * _n )
{
if ( _n->totalFramesPlayed() == 0 )
{
float freq = getChannelTrack()->frequency( _n );
float freq = getInstrumentTrack()->frequency( _n );
_n->m_pluginData = new pluckSynth( freq, m_pickKnob->value(),
m_pickupKnob->value(),
eng()->getMixer()->sampleRate() );
@@ -159,7 +157,7 @@ void pluckedStringSynth::playNote( notePlayHandle * _n )
}
}
getChannelTrack()->processAudioBuffer( buf, frames, _n );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
}
@@ -269,7 +267,7 @@ extern "C"
plugin * lmms_plugin_main( void * _data )
{
return( new pluckedStringSynth(
static_cast<channelTrack *>( _data ) ) );
static_cast<instrumentTrack *>( _data ) ) );
}

View File

@@ -194,7 +194,7 @@ private:
class pluckedStringSynth : public instrument
{
public:
pluckedStringSynth(channelTrack * _channel_track );
pluckedStringSynth( instrumentTrack * _channel_track );
virtual ~pluckedStringSynth();
virtual void FASTCALL playNote( notePlayHandle * _n );

View File

@@ -45,7 +45,7 @@
#include "triple_oscillator.h"
#include "song_editor.h"
#include "channel_track.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "knob.h"
#include "buffer_allocator.h"
@@ -79,7 +79,7 @@ plugin::descriptor tripleoscillator_plugin_descriptor =
}
tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) :
instrument( _channel_track, &tripleoscillator_plugin_descriptor ),
m_modulationAlgo1( oscillator::MIX ),
m_modulationAlgo2( oscillator::MIX )
@@ -505,37 +505,33 @@ tripleOscillator::~tripleOscillator()
void tripleOscillator::saveSettings( QDomDocument & _doc,
QDomElement & _parent )
void tripleOscillator::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
QDomElement to_de = _doc.createElement( nodeName() );
to_de.setAttribute( "modalgo1", QString::number( m_modulationAlgo1 ) );
to_de.setAttribute( "modalgo2", QString::number( m_modulationAlgo2 ) );
_this.setAttribute( "modalgo1", QString::number( m_modulationAlgo1 ) );
_this.setAttribute( "modalgo2", QString::number( m_modulationAlgo2 ) );
for( int i = 0; i < NUM_OF_OSCILLATORS; ++i )
{
QString is = QString::number( i );
to_de.setAttribute( "vol" + is, QString::number(
_this.setAttribute( "vol" + is, QString::number(
m_osc[i].volKnob->value() ) );
to_de.setAttribute( "pan" + is, QString::number(
_this.setAttribute( "pan" + is, QString::number(
m_osc[i].panKnob->value() ) );
to_de.setAttribute( "coarse" + is, QString::number(
_this.setAttribute( "coarse" + is, QString::number(
m_osc[i].coarseKnob->value() ) );
to_de.setAttribute( "finel" + is, QString::number(
_this.setAttribute( "finel" + is, QString::number(
m_osc[i].fineLKnob->value() ) );
to_de.setAttribute( "finer" + is, QString::number(
_this.setAttribute( "finer" + is, QString::number(
m_osc[i].fineRKnob->value() ) );
to_de.setAttribute( "phoffset" + is, QString::number(
_this.setAttribute( "phoffset" + is, QString::number(
m_osc[i].phaseOffsetKnob->value() ) );
to_de.setAttribute( "stphdetun" + is, QString::number(
_this.setAttribute( "stphdetun" + is, QString::number(
m_osc[i].stereoPhaseDetuningKnob->value() ) );
to_de.setAttribute( "wavetype" + is, QString::number(
_this.setAttribute( "wavetype" + is, QString::number(
m_osc[i].waveShape ) );
to_de.setAttribute( "userwavefile" + is,
_this.setAttribute( "userwavefile" + is,
m_osc[i].m_sampleBuffer->audioFile() );
}
_parent.appendChild( to_de );
}
@@ -590,7 +586,7 @@ void tripleOscillator::playNote( notePlayHandle * _n )
{
if( _n->totalFramesPlayed() == 0 )
{
float freq = getChannelTrack()->frequency( _n );
float freq = getInstrumentTrack()->frequency( _n );
oscillator * oscs_l[NUM_OF_OSCILLATORS];
oscillator * oscs_r[NUM_OF_OSCILLATORS];
@@ -695,7 +691,7 @@ void tripleOscillator::playNote( notePlayHandle * _n )
osc_l->update( buf, frames, 0 );
osc_r->update( buf, frames, 1 );
getChannelTrack()->processAudioBuffer( buf, frames, _n );
getInstrumentTrack()->processAudioBuffer( buf, frames, _n );
bufferAllocator::free( buf );
}
@@ -821,7 +817,7 @@ extern "C"
plugin * lmms_plugin_main( void * _data )
{
return( new tripleOscillator(
static_cast<channelTrack *>( _data ) ) );
static_cast<instrumentTrack *>( _data ) ) );
}
}

View File

@@ -45,7 +45,7 @@ class tripleOscillator : public instrument
{
Q_OBJECT
public:
tripleOscillator( channelTrack * _channel );
tripleOscillator( instrumentTrack * _channel );
virtual ~tripleOscillator();
virtual void FASTCALL playNote( notePlayHandle * _n );
@@ -72,7 +72,7 @@ protected slots:
private:
channelTrack * m_channelTrack;
instrumentTrack * m_instrumentTrack;
struct oscillatorData
{

View File

@@ -49,7 +49,7 @@
#endif
#include "channel_track.h"
#include "instrument_track.h"
#include "note_play_handle.h"
#include "buffer_allocator.h"
#include "mixer.h"
@@ -87,7 +87,7 @@ plugin::descriptor vestige_plugin_descriptor =
QPixmap * vestigeInstrument::s_artwork = NULL;
vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
vestigeInstrument::vestigeInstrument( instrumentTrack * _channel_track ) :
instrument( _channel_track, &vestige_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_plugin( NULL ),
@@ -211,33 +211,30 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
void vestigeInstrument::saveSettings( QDomDocument & _doc,
QDomElement & _parent )
void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
QDomElement vst_de = _doc.createElement( nodeName() );
vst_de.setAttribute( "plugin", m_pluginDLL );
_this.setAttribute( "plugin", m_pluginDLL );
m_pluginMutex.lock();
if( m_plugin != NULL )
{
if( m_plugin->pluginWidget() != NULL )
{
vst_de.setAttribute( "guivisible",
_this.setAttribute( "guivisible",
m_plugin->pluginWidget()->isVisible() );
}
const QMap<QString, QString> & dump = m_plugin->parameterDump();
vst_de.setAttribute( "numparams", dump.size() );
_this.setAttribute( "numparams", dump.size() );
for( QMap<QString, QString>::const_iterator it = dump.begin();
it != dump.end(); ++it )
{
#ifdef QT4
vst_de.setAttribute( it.key(), it.value() );
_this.setAttribute( it.key(), it.value() );
#else
vst_de.setAttribute( it.key(), it.data() );
_this.setAttribute( it.key(), it.data() );
#endif
}
}
m_pluginMutex.unlock();
_parent.appendChild( vst_de );
}
@@ -258,9 +255,9 @@ void vestigeInstrument::setParameter( const QString & _param,
{
m_pluginMutex.lock();
bool set_ch_name = ( m_plugin != NULL &&
getChannelTrack()->name() == m_plugin->name() ) ||
getChannelTrack()->name() ==
channelTrack::tr( "Default" );
getInstrumentTrack()->name() == m_plugin->name() ) ||
getInstrumentTrack()->name() ==
instrumentTrack::tr( "Default" );
m_pluginMutex.unlock();
closePlugin();
@@ -305,16 +302,16 @@ void vestigeInstrument::setParameter( const QString & _param,
m_plugin->setTempo( eng()->getSongEditor()->getTempo() );
if( set_ch_name == TRUE )
{
getChannelTrack()->setName( m_plugin->name() );
getInstrumentTrack()->setName( m_plugin->name() );
}
if( m_plugin->pluginWidget() != NULL )
{
#ifdef QT4
m_plugin->pluginWidget()->setWindowIcon(
getChannelTrack()->windowIcon() );
getInstrumentTrack()->windowIcon() );
#else
m_plugin->pluginWidget()->setWindowIcon(
*( getChannelTrack()->windowIcon() ) );
*( getInstrumentTrack()->windowIcon() ) );
#endif
}
m_pluginMutex.unlock();
@@ -339,7 +336,7 @@ void vestigeInstrument::play( void )
m_plugin->process( NULL, buf );
getChannelTrack()->processAudioBuffer( buf, frames, NULL );
getInstrumentTrack()->processAudioBuffer( buf, frames, NULL );
bufferAllocator::free( buf );
}
@@ -355,7 +352,7 @@ void vestigeInstrument::playNote( notePlayHandle * _n )
if( _n->totalFramesPlayed() == 0 && m_plugin != NULL )
{
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0,
getChannelTrack()->masterKey( _n ),
getInstrumentTrack()->masterKey( _n ),
_n->getVolume() ), _n->framesAhead() );
}
m_pluginMutex.unlock();
@@ -370,7 +367,7 @@ void vestigeInstrument::deleteNotePluginData( notePlayHandle * _n )
if( m_plugin != NULL )
{
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
getChannelTrack()->masterKey( _n ),
getInstrumentTrack()->masterKey( _n ),
0 ), 0 );
}
m_pluginMutex.unlock();
@@ -551,7 +548,7 @@ extern "C"
// neccessary for getting instance out of shared lib
plugin * lmms_plugin_main( void * _data )
{
return( new vestigeInstrument( static_cast<channelTrack *>( _data ) ) );
return( new vestigeInstrument( static_cast<instrumentTrack *>( _data ) ) );
}

View File

@@ -53,7 +53,7 @@ class vestigeInstrument : public instrument, public specialBgHandlingWidget
{
Q_OBJECT
public:
vestigeInstrument( channelTrack * _channel_track );
vestigeInstrument( instrumentTrack * _channel_track );
virtual ~vestigeInstrument();
virtual void play( void );