* fixed wrong config.h-inclusion and deprecated macro-names from config.h/lmmsconfig.h at various places - makes Vibed plugin work again

* fixed plugin-instantiation for BitInvader and Vibed
* use int instead of Uint32 in graphModel
* various coding-style fixes



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1170 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-24 22:21:31 +00:00
parent 21da0b432c
commit bdeac9eafe
14 changed files with 87 additions and 63 deletions

View File

@@ -1,5 +1,37 @@
2008-06-24 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/vibed/vibrating_string.h:
* plugins/vibed/nine_button_selector.h:
* plugins/vibed/vibed.h:
* plugins/vibed/vibrating_string.cpp:
* plugins/vibed/string_container.h:
* plugins/vibed/nine_button_selector.cpp:
* plugins/vibed/Makefile.am:
* plugins/vibed/vibed.cpp:
* plugins/singerbot/singerbot.h:
* plugins/audio_file_processor/audio_file_processor.cpp:
* plugins/flp_import/flp_import.cpp:
* include/note_play_handle.h:
* src/tracks/instrument_track.cpp:
* src/core/note_play_handle.cpp:
* src/core/audio/audio_device.cpp:
* src/core/audio/audio_oss.cpp:
- fixed wrong config.h-inclusion and deprecated macro-names from
config.h/lmmsconfig.h - makes Vibed plugin work again
- various coding-style fixes
* plugins/bit_invader/bit_invader.cpp:
* plugins/vibed/vibed.cpp:
fixed plugin-instantiation
* include/graph.h:
* src/gui/widgets/graph.cpp:
* plugins/vibed/vibed.cpp:
* plugins/vibed/vibed.h:
* plugins/bit_invader/bit_invader.cpp:
* plugins/bit_invader/bit_invader.h:
use int instead of Uint32
* plugins/plucked_string_synth/logo.png:
* plugins/plucked_string_synth/plucked_string_synth.cpp:
* plugins/plucked_string_synth/plucked_string_synth.h:

View File

@@ -25,6 +25,8 @@ win32-pkg: all
mkdir -p tmp/lmms/plugins/ladspa/
cp lmms.exe tmp/lmms
find plugins/ -name "*.dll" -maxdepth 2 -exec cp '{}' tmp/lmms/plugins/ ';'
rm tmp/lmms/plugins/caps.dll
rm tmp/lmms/plugins/tap*.dll
cp plugins/ladspa_effect/caps/caps.dll tmp/lmms/plugins/ladspa/
cp plugins/ladspa_effect/tap/tap*.dll tmp/lmms/plugins/ladspa/
PWD=`pwd`

View File

@@ -79,7 +79,7 @@ protected:
virtual void mouseReleaseEvent( QMouseEvent * _me );
protected slots:
void updateGraph( Uint32 _startPos, Uint32 _endPos );
void updateGraph( int _startPos, int _endPos );
void updateGraph( void );
private:
@@ -105,7 +105,7 @@ class EXPORT graphModel : public model
public:
graphModel( float _min,
float _max,
Uint32 _size,
int _size,
:: model * _parent,
bool _default_constructed = FALSE );
@@ -123,12 +123,12 @@ public:
return( m_maxValue );
}
inline Uint32 length( void ) const
inline int length( void ) const
{
return( m_samples.count() );
}
inline const float* samples( void ) const
inline const float * samples( void ) const
{
return( m_samples.data() );
}
@@ -136,9 +136,9 @@ public:
public slots:
void setRange( float _min, float _max );
void setLength( Uint32 _size );
void setLength( int _size );
void setSampleAt( Uint32 _samplePos, float _value );
void setSampleAt( int _samplePos, float _value );
void setSamples( const float * _value );
void setWaveToSine( void );
@@ -153,7 +153,7 @@ public slots:
signals:
void lengthChanged( void );
void samplesChanged( Uint32 startPos, Uint32 endPos );
void samplesChanged( int startPos, int endPos );
void rangeChanged( void );
private:

View File

@@ -27,6 +27,7 @@
#ifndef _NOTE_PLAY_HANDLE_H
#define _NOTE_PLAY_HANDLE_H
#include "lmmsconfig.h"
#include "mixer.h"
#include "note.h"
#include "instrument.h"
@@ -55,7 +56,7 @@ public:
virtual ~notePlayHandle();
const float & frequency( void )
const float & frequency( void ) const
{
return( m_frequency );
}
@@ -250,7 +251,7 @@ public:
void processMidiTime( const midiTime & _time );
void resize( const bpm_t _new_bpm );
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
int patternIndex( void )
{
return( m_patternIndex );
@@ -308,7 +309,7 @@ private:
// sub-note)
bool m_muted; // indicates whether note is muted
track * m_bbTrack; // related BB track
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
int m_patternIndex; // position among relevant notes
#endif

View File

@@ -114,7 +114,8 @@ void audioFileProcessor::playNote( notePlayHandle * _n, bool,
m_loopModel.value() ) == TRUE )
{
applyRelease( _working_buffer, _n );
getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n );
getInstrumentTrack()->processAudioBuffer( _working_buffer,
frames,_n );
}
}

View File

@@ -161,8 +161,8 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) :
this, SLOT( lengthChanged( ) )
);
connect( &m_graph, SIGNAL( samplesChanged( Uint32, Uint32 ) ),
this, SLOT( samplesChanged( Uint32, Uint32 ) ) );
connect( &m_graph, SIGNAL( samplesChanged( int, int ) ),
this, SLOT( samplesChanged( int, int ) ) );
}
@@ -234,7 +234,7 @@ void bitInvader::lengthChanged( void )
}
void bitInvader::samplesChanged( Uint32 _begin, Uint32 _end )
void bitInvader::samplesChanged( int _begin, int _end )
{
normalize();
//engine::getSongEditor()->setModified();
@@ -551,7 +551,7 @@ extern "C"
{
// neccessary for getting instance out of shared lib
plugin * PLUGIN_EXPORT lmms_plugin_main( void * _data )
plugin * PLUGIN_EXPORT lmms_plugin_main( model *, void * _data )
{
return( new bitInvader( static_cast<instrumentTrack *>( _data ) ) );
}

View File

@@ -87,7 +87,7 @@ public:
protected slots:
void lengthChanged( void );
void samplesChanged( Uint32, Uint32 );
void samplesChanged( int, int );
void normalize( void );

View File

@@ -52,12 +52,9 @@
#include "tempo_sync_knob.h"
#include "track_container.h"
#include "embed.h"
#include "lmmsconfig.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_CTYPE_H
#ifdef LMMS_HAVE_CTYPE_H
#include <ctype.h>
#endif

View File

@@ -2,6 +2,8 @@
* singerbot.h - declaration of class singerBot, a singing bot instrument plugin
*
* Copyright (c) 2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,9 +28,7 @@
#ifndef _SINGERBOT_H
#define _SINGERBOT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "lmmsconfig.h"
#ifndef USE_3RDPARTY_LIBSRC
#include <samplerate.h>
@@ -50,7 +50,7 @@ class singerBotView;
class singerBot : public instrument
{
Q_OBJECT
Q_OBJECT
public:
singerBot( instrumentTrack * _track );
virtual ~singerBot();
@@ -69,7 +69,7 @@ public:
virtual pluginView * instantiateView( QWidget * _parent );
void setPlainText( const QString & _plain_text, bool _emitDataChanged = TRUE );
const QString & getPlainText();
const QString & getPlainText();
private:
typedef struct
@@ -105,9 +105,9 @@ private:
void synth_read( handle_data * _hdata );
const char * addSuffix( const char * _s );
void showHandleData( handle_data * _hdata );
void showHandleData( handle_data * _hdata );
friend class singerBotView;
friend class singerBotView;
} ;
@@ -123,10 +123,10 @@ public:
public slots:
void viewTextChanged( void );
void modelTextChanged( void );
void modelTextChanged( void );
private:
QTextEdit * m_lyrics;
QTextEdit * m_lyrics;
} ;

View File

@@ -25,10 +25,6 @@
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cstring>

View File

@@ -39,11 +39,6 @@
#include "gui_templates.h"
#include "templates.h"
#ifdef LMMS_HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef LMMS_HAVE_UNISTD_H
#include <unistd.h>
#endif

View File

@@ -70,7 +70,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
m_arpNote( _arp_note ),
m_muted( FALSE ),
m_bbTrack( NULL ),
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
m_patternIndex( 0 ),
#endif
m_orig_bpm( engine::getSong()->getTempo() )
@@ -91,7 +91,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
_parent->m_arpNote = arpNote() && _parent->baseNote();
m_bbTrack = _parent->m_bbTrack;
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
m_patternIndex = _parent->m_patternIndex;
#endif
}

View File

@@ -52,8 +52,8 @@ graph::graph( QWidget * _parent, graphStyle _style ) :
graphModel * gModel = castModel<graphModel>();
QObject::connect( gModel, SIGNAL( samplesChanged( Uint32, Uint32 ) ),
this, SLOT( updateGraph( Uint32, Uint32 ) ) );
QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ),
this, SLOT( updateGraph( int, int ) ) );
QObject::connect( gModel, SIGNAL( lengthChanged( ) ),
this, SLOT( updateGraph( ) ) );
@@ -321,15 +321,15 @@ void graph::modelChanged( void )
{
graphModel * gModel = castModel<graphModel>();
QObject::connect( gModel, SIGNAL( samplesChanged( Uint32, Uint32 ) ),
this, SLOT( updateGraph( Uint32, Uint32 ) ) );
QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ),
this, SLOT( updateGraph( int, int ) ) );
QObject::connect( gModel, SIGNAL( lengthChanged( ) ),
this, SLOT( updateGraph( ) ) );
}
void graph::updateGraph( Uint32 _startPos, Uint32 _endPos )
void graph::updateGraph( int _startPos, int _endPos )
{
// Can optimize by only drawing changed position
update();
@@ -342,7 +342,7 @@ void graph::updateGraph( void )
}
graphModel::graphModel( float _min, float _max, Uint32 _length,
graphModel::graphModel( float _min, float _max, int _length,
::model * _parent, bool _default_constructed ) :
model( _parent, _default_constructed ),
m_samples( _length ),
@@ -369,7 +369,7 @@ void graphModel::setRange( float _min, float _max )
if( !m_samples.isEmpty() )
{
// Trim existing values
for( Uint32 i=0; i < length(); i++ )
for( int i=0; i < length(); i++ )
{
m_samples[i] = fmaxf( _min, fminf( m_samples[i], _max ) );
}
@@ -381,7 +381,7 @@ void graphModel::setRange( float _min, float _max )
void graphModel::setLength( Uint32 _length )
void graphModel::setLength( int _length )
{
if( _length != length() )
{
@@ -392,7 +392,7 @@ void graphModel::setLength( Uint32 _length )
void graphModel::setSampleAt( Uint32 _x, float _val )
void graphModel::setSampleAt( int _x, float _val )
{
// boundary check
if ( _x >= 0 && _x < length() &&
@@ -418,7 +418,7 @@ void graphModel::setSamples( const float * _samples )
void graphModel::setWaveToSine( void )
{
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
m_samples[i] = oscillator::sinSample(
i / static_cast<float>( length() ) );
@@ -431,7 +431,7 @@ void graphModel::setWaveToSine( void )
void graphModel::setWaveToTriangle( void )
{
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
m_samples[i] = oscillator::triangleSample(
i / static_cast<float>( length() ) );
@@ -444,7 +444,7 @@ void graphModel::setWaveToTriangle( void )
void graphModel::setWaveToSaw( void )
{
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
m_samples[i] = oscillator::sawSample(
i / static_cast<float>( length() ) );
@@ -457,7 +457,7 @@ void graphModel::setWaveToSaw( void )
void graphModel::setWaveToSquare( void )
{
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
m_samples[i] = oscillator::squareSample(
i / static_cast<float>( length() ) );
@@ -470,7 +470,7 @@ void graphModel::setWaveToSquare( void )
void graphModel::setWaveToNoise( void )
{
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
m_samples[i] = oscillator::noiseSample(
i / static_cast<float>( length() ) );
@@ -488,7 +488,7 @@ void graphModel::smooth( void )
// Smoothing
m_samples[0] = ( temp[0] + temp[length()-1] ) * 0.5f;
for ( Uint32 i=1; i < length(); i++ )
for ( int i=1; i < length(); i++ )
{
m_samples[i] = ( temp[i-1] + temp[i] ) * 0.5f;
}
@@ -501,7 +501,7 @@ void graphModel::smooth( void )
void graphModel::normalize( void )
{
float max = 0.0001f;
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
if( fabsf(m_samples[i]) > max && m_samples[i] != 0.0f )
{
@@ -509,7 +509,7 @@ void graphModel::normalize( void )
}
}
for( Uint32 i = 0; i < length(); i++ )
for( int i = 0; i < length(); i++ )
{
m_samples[i] /= max;
}

View File

@@ -580,7 +580,7 @@ bool instrumentTrack::play( const midiTime & _start,
const noteVector & notes = p->notes();
// ...and set our index to zero
noteVector::const_iterator it = notes.begin();
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
int note_idx = 0;
#endif
@@ -593,7 +593,7 @@ bool instrumentTrack::play( const midiTime & _start,
// skip notes which are posated before start-tact
while( it != notes.end() && ( *it )->pos() < cur_start )
{
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
if( ( *it )->length() != 0 )
{
++note_idx;
@@ -618,13 +618,13 @@ bool instrumentTrack::play( const midiTime & _start,
note_frames,
*cur_note );
note_play_handle->setBBTrack( bb_track );
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
note_play_handle->setPatternIndex( note_idx );
#endif
engine::getMixer()->addPlayHandle(
note_play_handle );
played_a_note = TRUE;
#if SINGERBOT_SUPPORT
#if LMMS_SINGERBOT_SUPPORT
++note_idx;
#endif
}
@@ -881,7 +881,7 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
m_midiInputAction->setText( tr( "MIDI input" ) );
m_midiOutputAction->setText( tr( "MIDI output" ) );
m_tswActivityIndicator = new fadeButton( QColor( 37, 57, 42 ),
m_tswActivityIndicator = new fadeButton( QColor( 56, 60, 72 ),
QColor( 64, 255, 16 ),
getTrackSettingsWidget() );
m_tswActivityIndicator->setGeometry( 212, 2, 8, 28 );