* 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:
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user