From bdeac9eafe6cd7ff4201afcbc81a91319ba37ef2 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 24 Jun 2008 22:21:31 +0000 Subject: [PATCH] * 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 --- ChangeLog | 32 +++++++++++++++++ Makefile.am | 2 ++ include/graph.h | 14 ++++---- include/note_play_handle.h | 7 ++-- .../audio_file_processor.cpp | 3 +- plugins/bit_invader/bit_invader.cpp | 8 ++--- plugins/bit_invader/bit_invader.h | 2 +- plugins/flp_import/flp_import.cpp | 7 ++-- plugins/singerbot/singerbot.h | 18 +++++----- src/core/audio/audio_device.cpp | 4 --- src/core/audio/audio_oss.cpp | 5 --- src/core/note_play_handle.cpp | 4 +-- src/gui/widgets/graph.cpp | 34 +++++++++---------- src/tracks/instrument_track.cpp | 10 +++--- 14 files changed, 87 insertions(+), 63 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2139e0276..a55735d9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,37 @@ 2008-06-24 Tobias Doerffel + * 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: diff --git a/Makefile.am b/Makefile.am index e5b666492..7d920a64f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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` diff --git a/include/graph.h b/include/graph.h index 49cb551e5..8e50dd45a 100644 --- a/include/graph.h +++ b/include/graph.h @@ -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: diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 6b762a02d..482750bfb 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -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 diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 74254525d..0fcaef160 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -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 ); } } diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 609948f27..5099db9e6 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -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( _data ) ) ); } diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index 9e87d29f5..191c8fe81 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -87,7 +87,7 @@ public: protected slots: void lengthChanged( void ); - void samplesChanged( Uint32, Uint32 ); + void samplesChanged( int, int ); void normalize( void ); diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/flp_import.cpp index 9ae0046dc..1a2129bb5 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/flp_import.cpp @@ -52,12 +52,9 @@ #include "tempo_sync_knob.h" #include "track_container.h" #include "embed.h" +#include "lmmsconfig.h" -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef HAVE_CTYPE_H +#ifdef LMMS_HAVE_CTYPE_H #include #endif diff --git a/plugins/singerbot/singerbot.h b/plugins/singerbot/singerbot.h index 170889206..e6c421830 100644 --- a/plugins/singerbot/singerbot.h +++ b/plugins/singerbot/singerbot.h @@ -2,6 +2,8 @@ * singerbot.h - declaration of class singerBot, a singing bot instrument plugin * * Copyright (c) 2007 Javier Serrano Polo + * Copyright (c) 2008 Tobias Doerffel + * * * 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 -#endif +#include "lmmsconfig.h" #ifndef USE_3RDPARTY_LIBSRC #include @@ -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; } ; diff --git a/src/core/audio/audio_device.cpp b/src/core/audio/audio_device.cpp index afe1a2c9d..0b68c110a 100644 --- a/src/core/audio/audio_device.cpp +++ b/src/core/audio/audio_device.cpp @@ -25,10 +25,6 @@ */ -#ifdef HAVE_CONFIG_H -#include -#endif - #include diff --git a/src/core/audio/audio_oss.cpp b/src/core/audio/audio_oss.cpp index 5f696931c..5887d7593 100644 --- a/src/core/audio/audio_oss.cpp +++ b/src/core/audio/audio_oss.cpp @@ -39,11 +39,6 @@ #include "gui_templates.h" #include "templates.h" - -#ifdef LMMS_HAVE_CONFIG_H -#include -#endif - #ifdef LMMS_HAVE_UNISTD_H #include #endif diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index ace83e962..e31dc7b3b 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -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 } diff --git a/src/gui/widgets/graph.cpp b/src/gui/widgets/graph.cpp index 1cc0306f3..79890c87a 100644 --- a/src/gui/widgets/graph.cpp +++ b/src/gui/widgets/graph.cpp @@ -52,8 +52,8 @@ graph::graph( QWidget * _parent, graphStyle _style ) : graphModel * gModel = castModel(); - 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(); - 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( 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( 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( 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( 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( 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; } diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 737f606ad..49c756f80 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -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 );