Replaced [S/U]int[8/16/32] with types from stdint.h or plain integers
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AudioDevice.h - base-class for audio-devices, used by LMMS-mixer
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -130,11 +130,11 @@ protected:
|
||||
|
||||
// convert a given audio-buffer to a buffer in signed 16-bit samples
|
||||
// returns num of bytes in outbuf
|
||||
Uint32 convertToS16( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain,
|
||||
int_sample_t * _output_buffer,
|
||||
const bool _convert_endian = FALSE );
|
||||
int convertToS16( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain,
|
||||
int_sample_t * _output_buffer,
|
||||
const bool _convert_endian = false );
|
||||
|
||||
// clear given signed-int-16-buffer
|
||||
void clearS16Buffer( int_sample_t * _outbuf,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AudioDummy.h - dummy audio-device
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -95,19 +95,14 @@ private:
|
||||
while( true )
|
||||
{
|
||||
timer.reset();
|
||||
const surroundSampleFrame * b =
|
||||
mixer()->nextBuffer();
|
||||
const surroundSampleFrame* b = mixer()->nextBuffer();
|
||||
if( !b )
|
||||
{
|
||||
break;
|
||||
}
|
||||
delete[] b;
|
||||
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
mixer()->framesPerPeriod() *
|
||||
1000000.0f /
|
||||
mixer()->processingSampleRate() -
|
||||
timer.elapsed() );
|
||||
const int microseconds = static_cast<int>( mixer()->framesPerPeriod() * 1000000.0f / mixer()->processingSampleRate() - timer.elapsed() );
|
||||
if( microseconds > 0 )
|
||||
{
|
||||
usleep( microseconds );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AudioFileDevice.h - base-class for audio-device-classes which write
|
||||
* their output into a file
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
Sint32 writeData( const void * _data, Sint32 _len );
|
||||
int writeData( const void* data, int len );
|
||||
|
||||
inline bool useVBR() const
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AudioFileOgg.h - Audio-device which encodes wave-stream and writes it
|
||||
* into an OGG-file. This is used for song-export.
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
|
||||
bool startEncoding();
|
||||
void finishEncoding();
|
||||
inline Sint32 writePage();
|
||||
inline int writePage();
|
||||
|
||||
|
||||
bool m_ok;
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
bitrate_t m_minBitrate;
|
||||
bitrate_t m_maxBitrate;
|
||||
|
||||
Uint32 m_serialNo;
|
||||
uint32_t m_serialNo;
|
||||
|
||||
vorbis_comment * m_comments;
|
||||
|
||||
|
||||
@@ -37,8 +37,7 @@ public:
|
||||
virtual ~AutomationTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual QString nodeName() const
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
QScrollArea * m_scrollArea;
|
||||
QPushButton * m_addButton;
|
||||
|
||||
Uint32 m_lastY;
|
||||
int m_lastY;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Effect.h - base class for effects
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -101,11 +101,8 @@ public:
|
||||
|
||||
inline f_cnt_t timeout() const
|
||||
{
|
||||
const float samples =
|
||||
engine::mixer()->processingSampleRate() *
|
||||
m_autoQuitModel.value() / 1000.0f;
|
||||
return 1 + ( static_cast<Uint32>( samples ) /
|
||||
engine::mixer()->framesPerPeriod() );
|
||||
const float samples = engine::mixer()->processingSampleRate() * m_autoQuitModel.value() / 1000.0f;
|
||||
return 1 + ( static_cast<int>( samples ) / engine::mixer()->framesPerPeriod() );
|
||||
}
|
||||
|
||||
inline float wetLevel() const
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* effect_rack_view.h - view for effectChain-model
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn@netscape.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
groupBox * m_effectsGroupBox;
|
||||
QScrollArea * m_scrollArea;
|
||||
|
||||
Uint32 m_lastY;
|
||||
int m_lastY;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* InstrumentFunctions.h - models for instrument-functions-tab
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
static const int MAX_CHORD_POLYPHONY = 10;
|
||||
|
||||
private:
|
||||
typedef Sint8 ChordSemiTones [MAX_CHORD_POLYPHONY];
|
||||
typedef int8_t ChordSemiTones [MAX_CHORD_POLYPHONY];
|
||||
|
||||
public:
|
||||
ChordCreator( Model * _parent );
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
bool hasSemiTone( Sint8 semi_tone ) const;
|
||||
bool hasSemiTone( int8_t semiTone ) const;
|
||||
|
||||
Sint8 last() const
|
||||
int8_t last() const
|
||||
{
|
||||
return m_semiTones[size() - 1];
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
return m_name;
|
||||
}
|
||||
|
||||
Sint8 operator [] ( int n ) const
|
||||
int8_t operator [] ( int n ) const
|
||||
{
|
||||
return m_semiTones[n];
|
||||
}
|
||||
|
||||
@@ -120,8 +120,7 @@ public:
|
||||
|
||||
// play everything in given frame-range - creates note-play-handles
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
// create new view for me
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* LadspaBase.h - basic declarations concerning LADSPA
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -55,8 +55,8 @@ typedef struct PortDescription
|
||||
{
|
||||
QString name;
|
||||
ch_cnt_t proc;
|
||||
Uint16 port_id;
|
||||
Uint16 control_id;
|
||||
uint16_t port_id;
|
||||
uint16_t control_id;
|
||||
buffer_rate_t rate;
|
||||
buffer_data_t data_type;
|
||||
float scale;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LadspaControl.h - model for controlling a LADSPA port
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
@@ -72,8 +72,7 @@ public:
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent,
|
||||
const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this,
|
||||
const QString & _name );
|
||||
virtual void loadSettings( const QDomElement & _this, const QString & _name );
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "port";
|
||||
@@ -81,8 +80,8 @@ public:
|
||||
|
||||
|
||||
signals:
|
||||
void changed( Uint16 _port, LADSPA_Data _value );
|
||||
void linkChanged( Uint16 _port, bool _state );
|
||||
void changed( int _port, LADSPA_Data _value );
|
||||
void linkChanged( int _port, bool _state );
|
||||
|
||||
|
||||
protected slots:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiAlsaRaw.h - midi-client for RawMIDI via ALSA
|
||||
* MidiAlsaRaw.h - MIDI client for RawMIDI via ALSA
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const Uint8 _c );
|
||||
virtual void sendByte( const unsigned char c );
|
||||
virtual void run();
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiClient.h - base-class for MIDI clients like ALSA-sequencer-client
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -140,7 +140,7 @@ protected:
|
||||
|
||||
|
||||
|
||||
const Uint8 RAW_MIDI_PARSE_BUF_SIZE = 16;
|
||||
const int RAW_MIDI_PARSE_BUF_SIZE = 16;
|
||||
|
||||
|
||||
class MidiClientRaw : public MidiClient
|
||||
@@ -158,37 +158,35 @@ public:
|
||||
|
||||
protected:
|
||||
// generic raw-MIDI-parser which generates appropriate MIDI-events
|
||||
void parseData( const Uint8 _c );
|
||||
void parseData( const unsigned char c );
|
||||
|
||||
// to be implemented by actual client-implementation
|
||||
virtual void sendByte( const Uint8 _c ) = 0;
|
||||
virtual void sendByte( const unsigned char c ) = 0;
|
||||
|
||||
|
||||
private:
|
||||
// this does MIDI-event-process
|
||||
void processParsedEvent();
|
||||
virtual void processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time,
|
||||
const MidiPort * _port );
|
||||
virtual void processOutEvent( const midiEvent& event, const midiTime& time, const MidiPort* port );
|
||||
|
||||
// small helper function returning length of a certain event - this
|
||||
// is necessary for parsing raw-MIDI-data
|
||||
static Uint8 eventLength( const Uint8 _event );
|
||||
static int eventLength( const unsigned char event );
|
||||
|
||||
|
||||
// data being used for parsing
|
||||
struct midiParserData
|
||||
{
|
||||
Uint8 m_status; // identifies the type of event, that
|
||||
uint8_t m_status; // identifies the type of event, that
|
||||
// is currently received ('Noteon',
|
||||
// 'Pitch Bend' etc).
|
||||
Uint8 m_channel; // The channel of the event that is
|
||||
uint8_t m_channel; // The channel of the event that is
|
||||
// received (in case of a channel event)
|
||||
Uint32 m_bytes; // How many bytes have been read for
|
||||
uint32_t m_bytes; // How many bytes have been read for
|
||||
// the current event?
|
||||
Uint32 m_bytesTotal; // How many bytes does the current
|
||||
uint32_t m_bytesTotal; // How many bytes does the current
|
||||
// event type include?
|
||||
Uint32 m_buffer[RAW_MIDI_PARSE_BUF_SIZE];
|
||||
uint32_t m_buffer[RAW_MIDI_PARSE_BUF_SIZE];
|
||||
// buffer for incoming data
|
||||
midiEvent m_midiEvent; // midi-event
|
||||
} m_midiParseData;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiOss.h - OSS raw MIDI client
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
virtual void sendByte( const Uint8 _c );
|
||||
virtual void sendByte( const unsigned char c );
|
||||
virtual void run();
|
||||
|
||||
|
||||
|
||||
@@ -122,8 +122,7 @@ public:
|
||||
virtual ~SampleTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
|
||||
|
||||
@@ -109,10 +109,8 @@ public:
|
||||
bbTrack( TrackContainer* tc );
|
||||
virtual ~bbTrack();
|
||||
|
||||
virtual bool play( const midiTime & _start,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
virtual trackView * createView( TrackContainerView* tcv );
|
||||
virtual trackContentObject * createTCO( const midiTime & _pos );
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ public:
|
||||
virtual ~bbTrackContainer();
|
||||
|
||||
virtual bool play( midiTime _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 );
|
||||
|
||||
virtual void updateAfterTrackAdd();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* cpuload_widget.h - widget for displaying CPU-load (partly based on
|
||||
* Hydrogen's CPU-load-widget)
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -51,7 +51,7 @@ protected slots:
|
||||
|
||||
|
||||
private:
|
||||
Uint8 m_currentLoad;
|
||||
int m_currentLoad;
|
||||
|
||||
QPixmap m_temp;
|
||||
QPixmap m_background;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* endian_handling.h - handle endianess
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ENDIAN_HANDLING_H
|
||||
#define _ENDIAN_HANDLING_H
|
||||
|
||||
@@ -37,18 +36,18 @@ inline bool isLittleEndian()
|
||||
}
|
||||
|
||||
|
||||
inline Sint16 swap16IfBE( Sint16 _i )
|
||||
inline int16_t swap16IfBE( int16_t i )
|
||||
{
|
||||
return( isLittleEndian() ? _i : ( ( _i & 0xFF ) << 8) | ( ( _i >> 8 ) & 0xFF ) );
|
||||
return( isLittleEndian() ? i : ( ( i & 0xFF ) << 8) | ( ( i >> 8 ) & 0xFF ) );
|
||||
}
|
||||
|
||||
|
||||
inline Sint32 swap32IfBE( Sint32 _i )
|
||||
inline int32_t swap32IfBE( int32_t i )
|
||||
{
|
||||
return( isLittleEndian() ? _i : ( ( _i & 0xff000000 ) >> 24 ) |
|
||||
( ( _i & 0x00ff0000 ) >> 8 ) |
|
||||
( ( _i & 0x0000ff00 ) << 8 ) |
|
||||
( ( _i & 0x000000ff ) << 24 ) );
|
||||
return( isLittleEndian() ? i : ( ( i & 0xff000000 ) >> 24 ) |
|
||||
( ( i & 0x00ff0000 ) >> 8 ) |
|
||||
( ( i & 0x0000ff00 ) << 8 ) |
|
||||
( ( i & 0x000000ff ) << 24 ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,10 +73,10 @@ enum ladspaPluginType
|
||||
typedef struct ladspaManagerStorage
|
||||
{
|
||||
LADSPA_Descriptor_Function descriptorFunction;
|
||||
Uint32 index;
|
||||
uint32_t index;
|
||||
ladspaPluginType type;
|
||||
Uint16 inputChannels;
|
||||
Uint16 outputChannels;
|
||||
uint16_t inputChannels;
|
||||
uint16_t outputChannels;
|
||||
} ladspaManagerDescription;
|
||||
|
||||
|
||||
@@ -123,20 +123,20 @@ public:
|
||||
|
||||
/* This indicates the number of ports (input AND output) present on
|
||||
the plugin. */
|
||||
Uint32 getPortCount( const ladspa_key_t & _plugin );
|
||||
uint32_t getPortCount( const ladspa_key_t & _plugin );
|
||||
|
||||
|
||||
/* Indicates that the port is an input. */
|
||||
bool isPortInput( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortInput( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that the port is an output. */
|
||||
bool isPortOutput( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortOutput( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that the port is an audio. */
|
||||
bool isPortAudio( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortAudio( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that the port is an control. */
|
||||
bool isPortControl( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortControl( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that any bounds specified should be interpreted as
|
||||
multiples of the sample rate. For instance, a frequency range from
|
||||
@@ -145,42 +145,42 @@ public:
|
||||
Hosts that support bounds at all must support this hint to retain
|
||||
meaning. */
|
||||
bool areHintsSampleRateDependent( const ladspa_key_t & _plugin,
|
||||
Uint32 _port );
|
||||
uint32_t _port );
|
||||
|
||||
/* Returns the lower boundary value for the given port. If
|
||||
no lower bound is provided by the plug-in, returns -999e-99. When
|
||||
areHintsSampleRateDependent() is also true then this value should be
|
||||
multiplied by the relevant sample rate. */
|
||||
float getLowerBound( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
float getLowerBound( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Returns the upper boundary value for the given port. If
|
||||
no upper bound is provided by the plug-in, returns -999e-99. When
|
||||
areHintsSampleRateDependent() is also true then this value should be
|
||||
multiplied by the relevant sample rate. */
|
||||
float getUpperBound( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
float getUpperBound( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates whether the given port should be considered 0 or 1
|
||||
boolean switch. */
|
||||
bool isPortToggled( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isPortToggled( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Retrieves any default setting hints offered by the plug-in for
|
||||
the given port. */
|
||||
float getDefaultSetting( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
float getDefaultSetting( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that it is likely that the user will find it more
|
||||
intuitive to view values using a logarithmic scale. This is
|
||||
particularly useful for frequencies and gains. */
|
||||
bool isLogarithmic( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isLogarithmic( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Indicates that a user interface would probably wish to provide a
|
||||
stepped control taking only integer values. Any bounds set should be
|
||||
slightly wider than the actual integer range required to avoid floating
|
||||
point rounding errors. For instance, the integer set {0,1,2,3} might
|
||||
be described as [-0.1, 3.1]. */
|
||||
bool isInteger( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
bool isInteger( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
/* Returns the name of the port. */
|
||||
QString getPortName( const ladspa_key_t & _plugin, Uint32 _port );
|
||||
QString getPortName( const ladspa_key_t & _plugin, uint32_t _port );
|
||||
|
||||
|
||||
/* This may be used by the plugin developer to pass any custom
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
|
||||
/* Returns a handle to an instantiation of the given plug-in. */
|
||||
LADSPA_Handle instantiate( const ladspa_key_t & _plugin,
|
||||
Uint32 _sample_rate );
|
||||
uint32_t _sample_rate );
|
||||
|
||||
/* This method calls a function pointer that connects a port on an
|
||||
instantiated plugin to a memory location at which a block of data
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
run() or runAdding() is called. */
|
||||
bool connectPort( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _port,
|
||||
uint32_t _port,
|
||||
LADSPA_Data * _data_location );
|
||||
|
||||
/* This method calls a function pointer that initialises a plugin
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
activate() has been called again. */
|
||||
bool run( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _sample_count );
|
||||
uint32_t _sample_count );
|
||||
|
||||
/* This method calls a function pointer that runs an instance of a
|
||||
plugin for a block. This has identical behaviour to run() except
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
the function setRunAddingGain() must be provided also. */
|
||||
bool runAdding( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _sample_count );
|
||||
uint32_t _sample_count );
|
||||
|
||||
/* This method calls a function pointer that sets the output gain for
|
||||
use when runAdding() is called (see above). If this function is
|
||||
@@ -325,8 +325,8 @@ public:
|
||||
private:
|
||||
void addPlugins( LADSPA_Descriptor_Function _descriptor_func,
|
||||
const QString & _file );
|
||||
Uint16 getPluginInputs( const LADSPA_Descriptor * _descriptor );
|
||||
Uint16 getPluginOutputs( const LADSPA_Descriptor * _descriptor );
|
||||
uint16_t getPluginInputs( const LADSPA_Descriptor * _descriptor );
|
||||
uint16_t getPluginOutputs( const LADSPA_Descriptor * _descriptor );
|
||||
|
||||
typedef QMap<ladspa_key_t, ladspaManagerDescription *>
|
||||
ladspaManagerMapType;
|
||||
|
||||
@@ -34,35 +34,26 @@
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned char Uint8;
|
||||
typedef signed char Sint8;
|
||||
typedef unsigned short Uint16;
|
||||
typedef signed short Sint16;
|
||||
typedef unsigned int Uint32;
|
||||
typedef signed int Sint32;
|
||||
|
||||
|
||||
typedef Uint32 minute_t;
|
||||
typedef Sint8 second_t;
|
||||
typedef Sint32 tact_t;
|
||||
typedef Sint32 tick_t;
|
||||
typedef Uint8 volume_t;
|
||||
typedef Sint8 panning_t;
|
||||
typedef int32_t tact_t;
|
||||
typedef int32_t tick_t;
|
||||
typedef uint8_t volume_t;
|
||||
typedef int8_t panning_t;
|
||||
|
||||
|
||||
typedef float sample_t; // standard sample-type
|
||||
typedef Sint16 int_sample_t; // 16-bit-int-sample
|
||||
typedef int16_t int_sample_t; // 16-bit-int-sample
|
||||
|
||||
|
||||
typedef Uint32 sample_rate_t; // sample-rate
|
||||
typedef Sint16 fpp_t; // frames per period (0-16384)
|
||||
typedef Sint32 f_cnt_t; // standard frame-count
|
||||
typedef Uint8 ch_cnt_t; // channel-count (0-SURROUND_CHANNELS)
|
||||
typedef Uint16 bpm_t; // tempo (MIN_BPM to MAX_BPM)
|
||||
typedef Uint16 bitrate_t; // bitrate in kbps
|
||||
typedef Sint8 fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL)
|
||||
typedef uint32_t sample_rate_t; // sample-rate
|
||||
typedef int16_t fpp_t; // frames per period (0-16384)
|
||||
typedef int32_t f_cnt_t; // standard frame-count
|
||||
typedef uint8_t ch_cnt_t; // channel-count (0-SURROUND_CHANNELS)
|
||||
typedef uint16_t bpm_t; // tempo (MIN_BPM to MAX_BPM)
|
||||
typedef uint16_t bitrate_t; // bitrate in kbps
|
||||
typedef uint16_t fx_ch_t; // FX-channel (0 to MAX_EFFECT_CHANNEL)
|
||||
|
||||
typedef Uint32 jo_id_t; // (unique) ID of a journalling object
|
||||
typedef uint32_t jo_id_t; // (unique) ID of a journalling object
|
||||
|
||||
// use for improved branch prediction
|
||||
#define likely(x) __builtin_expect((x),1)
|
||||
|
||||
@@ -124,9 +124,9 @@ const int MidiMinPanning = -128;
|
||||
struct midiEvent
|
||||
{
|
||||
midiEvent( MidiEventTypes _type = MidiActiveSensing,
|
||||
Sint8 _channel = 0,
|
||||
Sint16 _param1 = 0,
|
||||
Sint16 _param2 = 0,
|
||||
int8_t _channel = 0,
|
||||
int16_t _param1 = 0,
|
||||
int16_t _param2 = 0,
|
||||
const void * _sourcePort = NULL ) :
|
||||
m_type( _type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
@@ -172,12 +172,12 @@ struct midiEvent
|
||||
return m_channel;
|
||||
}
|
||||
|
||||
inline Sint16 key() const
|
||||
inline int16_t key() const
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
|
||||
inline Sint16 & key()
|
||||
inline int16_t & key()
|
||||
{
|
||||
return m_data.m_param[0];
|
||||
}
|
||||
@@ -192,17 +192,17 @@ struct midiEvent
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 velocity() const
|
||||
inline int16_t velocity() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 & velocity()
|
||||
inline int16_t & velocity()
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 midiPanning() const
|
||||
inline int16_t midiPanning() const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
@@ -237,12 +237,12 @@ struct midiEvent
|
||||
|
||||
MidiEventTypes m_type; // MIDI event type
|
||||
MidiMetaEvents m_metaEvent; // Meta event (mostly unused)
|
||||
Sint8 m_channel; // MIDI channel
|
||||
int8_t m_channel; // MIDI channel
|
||||
union
|
||||
{
|
||||
Sint16 m_param[2]; // first/second parameter (key/velocity)
|
||||
Uint8 m_bytes[4]; // raw bytes
|
||||
Sint32 m_sysExDataLen; // len of m_sysExData
|
||||
int16_t m_param[2]; // first/second parameter (key/velocity)
|
||||
uint8_t m_bytes[4]; // raw bytes
|
||||
int32_t m_sysExDataLen; // len of m_sysExData
|
||||
} m_data;
|
||||
|
||||
const char * m_sysExData;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* mmp.h - class for reading and writing multimedia-project-files
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2012-2013 Paul Giblock <p/at/pgiblock.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
@@ -104,10 +104,9 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
const Uint8 MMP_MAJOR_VERSION = 1;
|
||||
const Uint8 MMP_MINOR_VERSION = 0;
|
||||
const QString MMP_VERSION_STRING = QString::number( MMP_MAJOR_VERSION ) + "." +
|
||||
QString::number( MMP_MINOR_VERSION );
|
||||
const int MMP_MAJOR_VERSION = 1;
|
||||
const int MMP_MINOR_VERSION = 0;
|
||||
const QString MMP_VERSION_STRING = QString::number( MMP_MAJOR_VERSION ) + "." + QString::number( MMP_MINOR_VERSION );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -284,7 +284,7 @@ private:
|
||||
actions m_action;
|
||||
noteEditMode m_noteEditMode;
|
||||
|
||||
Uint32 m_selectStartTick;
|
||||
int m_selectStartTick;
|
||||
int m_selectedTick;
|
||||
int m_selectStartKey;
|
||||
int m_selectedKeys;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* track.h - declaration of classes concerning tracks -> necessary for all
|
||||
* track-like objects (beat/bassline, sample-track...)
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -64,8 +64,8 @@ const int TRACK_OP_WIDTH_COMPACT = 60;
|
||||
* Tracks can be resized by shift-dragging anywhere inside the track
|
||||
* display. This sets the minimum size in pixels for a track.
|
||||
*/
|
||||
const Uint16 MINIMAL_TRACK_HEIGHT = 8;
|
||||
const Uint16 DEFAULT_TRACK_HEIGHT = 32;
|
||||
const int MINIMAL_TRACK_HEIGHT = 8;
|
||||
const int DEFAULT_TRACK_HEIGHT = 32;
|
||||
|
||||
const int TCO_BORDER_WIDTH = 1;
|
||||
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
trackView * m_trackView;
|
||||
Actions m_action;
|
||||
bool m_autoResize;
|
||||
Sint16 m_initialMouseX;
|
||||
int m_initialMouseX;
|
||||
|
||||
textFloat * m_hint;
|
||||
|
||||
@@ -380,8 +380,7 @@ public:
|
||||
}
|
||||
|
||||
virtual bool play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base,
|
||||
Sint16 _tco_num = -1 ) = 0;
|
||||
const f_cnt_t _frame_base, int _tco_num = -1 ) = 0;
|
||||
|
||||
|
||||
virtual trackView * createView( TrackContainerView * _view ) = 0;
|
||||
|
||||
@@ -186,21 +186,18 @@ void audioFileProcessor::loadFile( const QString & _file )
|
||||
|
||||
QString audioFileProcessor::nodeName( void ) const
|
||||
{
|
||||
return( audiofileprocessor_plugin_descriptor.name );
|
||||
return audiofileprocessor_plugin_descriptor.name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
int audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
{
|
||||
const float freq_factor = BaseFreq / _n->frequency() *
|
||||
engine::mixer()->processingSampleRate() /
|
||||
engine::mixer()->baseSampleRate();
|
||||
engine::mixer()->processingSampleRate() / engine::mixer()->baseSampleRate();
|
||||
|
||||
return( static_cast<Uint32>( floorf( ( m_sampleBuffer.endFrame() -
|
||||
m_sampleBuffer.startFrame() ) *
|
||||
freq_factor ) ) );
|
||||
return static_cast<int>( floorf( ( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) * freq_factor ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +205,7 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const
|
||||
|
||||
PluginView * audioFileProcessor::instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new AudioFileProcessorView( this, _parent ) );
|
||||
return new AudioFileProcessorView( this, _parent );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,11 +56,11 @@ public:
|
||||
|
||||
virtual QString nodeName() const;
|
||||
|
||||
virtual Uint32 getBeatLen( notePlayHandle * _n ) const;
|
||||
virtual int getBeatLen( notePlayHandle * _n ) const;
|
||||
|
||||
virtual f_cnt_t desiredReleaseFrames() const
|
||||
{
|
||||
return( 128 );
|
||||
return 128;
|
||||
}
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
@@ -287,7 +287,7 @@ void bitInvader::playNote( notePlayHandle * _n,
|
||||
for( fpp_t frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
const sample_t cur = ps->nextStringSample();
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
_working_buffer[frame][chnl] = cur;
|
||||
}
|
||||
|
||||
@@ -721,7 +721,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
|
||||
// search for FLdt chunk
|
||||
while( 1 )
|
||||
{
|
||||
Sint32 id = readID();
|
||||
int32_t id = readID();
|
||||
const int len = read32LE();
|
||||
if( file().atEnd() )
|
||||
{
|
||||
@@ -769,7 +769,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
|
||||
while( file().atEnd() == false )
|
||||
{
|
||||
FLP_Events ev = static_cast<FLP_Events>( readByte() );
|
||||
Uint32 data = readByte();
|
||||
uint32_t data = readByte();
|
||||
|
||||
if( ev >= FLP_Word && ev < FLP_Text )
|
||||
{
|
||||
@@ -786,7 +786,7 @@ bool FlpImport::tryImport( TrackContainer* tc )
|
||||
if( ev >= FLP_Text )
|
||||
{
|
||||
text_len = data & 0x7F;
|
||||
Uint8 shift = 0;
|
||||
uint8_t shift = 0;
|
||||
while( data & 0x80 )
|
||||
{
|
||||
data = readByte();
|
||||
@@ -1814,7 +1814,7 @@ void FlpImport::processPluginParams( FL_Channel * _ch )
|
||||
int ws = Oscillator::UserDefinedWave;
|
||||
for( int i = 0; i < 3; ++i )
|
||||
{
|
||||
const Sint32 * d = (const Sint32 *)
|
||||
const int32_t * d = (const int32_t *)
|
||||
( _ch->pluginSettings + i * 28 );
|
||||
QString is = QString::number( i );
|
||||
de.setAttribute( "vol" + is,
|
||||
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
return( value );
|
||||
}
|
||||
|
||||
inline Sint32 read32LE()
|
||||
inline int32_t read32LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
@@ -77,14 +77,14 @@ private:
|
||||
value |= readByte() << 24;
|
||||
return( value );
|
||||
}
|
||||
inline Sint32 read16LE()
|
||||
inline int32_t read16LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
return( value );
|
||||
}
|
||||
|
||||
inline Sint32 readID()
|
||||
inline int32_t readID()
|
||||
{
|
||||
return( read32LE() );
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
|
||||
vlayout->setSpacing( 0 );
|
||||
vlayout->setMargin( 0 );
|
||||
|
||||
Uint16 pc = manager->getPortCount( _key );
|
||||
int pc = manager->getPortCount( _key );
|
||||
|
||||
QTableWidget * settings = new QTableWidget( pc, 7, this );
|
||||
|
||||
@@ -60,31 +60,23 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key )
|
||||
ports.append( tr( "SR Dependent" ) );
|
||||
settings->setHorizontalHeaderLabels( ports );
|
||||
|
||||
for( Uint16 row = 0; row < pc; row++ )
|
||||
for( int row = 0; row < pc; row++ )
|
||||
{
|
||||
for( Uint8 col = 0; col < 7; ++col )
|
||||
for( int col = 0; col < 7; ++col )
|
||||
{
|
||||
QTableWidgetItem * item = new QTableWidgetItem;
|
||||
item->setFlags( 0 );
|
||||
settings->setItem( row, col, item );
|
||||
}
|
||||
|
||||
Uint8 col = 0;
|
||||
settings->item( row, col++ )->setText( manager->getPortName(
|
||||
_key, row ) );
|
||||
int col = 0;
|
||||
settings->item( row, col++ )->setText( manager->getPortName( _key, row ) );
|
||||
|
||||
settings->item( row, col++ )->setText(
|
||||
manager->isPortAudio( _key, row ) ?
|
||||
tr( "Audio" ) : tr( "Control" ) );
|
||||
settings->item( row, col++ )->setText( manager->isPortAudio( _key, row ) ? tr( "Audio" ) : tr( "Control" ) );
|
||||
|
||||
settings->item( row, col++ )->setText(
|
||||
manager->isPortInput( _key, row ) ?
|
||||
tr( "Input" ) : tr( "Output" ) );
|
||||
settings->item( row, col++ )->setText( manager->isPortInput( _key, row ) ? tr( "Input" ) : tr( "Output" ) );
|
||||
|
||||
settings->item( row, col++ )->setText(
|
||||
manager->isPortToggled( _key, row ) ? tr( "Toggled" ) :
|
||||
manager->isInteger( _key, row ) ? tr( "Integer" ) :
|
||||
tr( "Float" ) );
|
||||
settings->item( row, col++ )->setText( manager->isPortToggled( _key, row ) ? tr( "Toggled" ) : manager->isInteger( _key, row ) ? tr( "Integer" ) : tr( "Float" ) );
|
||||
|
||||
float min = manager->getLowerBound( _key, row );
|
||||
float max = manager->getUpperBound( _key, row );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LadspaControls.cpp - model for LADSPA plugin controls
|
||||
*
|
||||
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,26 +46,20 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) :
|
||||
control_list_t p;
|
||||
|
||||
const bool linked_control = ( m_processors > 1 && proc == 0 );
|
||||
buffer_data_t last_port = NONE;
|
||||
|
||||
for( multi_proc_t::Iterator it = controls.begin();
|
||||
it != controls.end(); it++ )
|
||||
for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ )
|
||||
{
|
||||
if( (*it)->proc == proc )
|
||||
{
|
||||
(*it)->control = new LadspaControl( this, *it,
|
||||
linked_control );
|
||||
|
||||
last_port = (*it)->data_type;
|
||||
|
||||
p.append( (*it)->control );
|
||||
|
||||
if( linked_control )
|
||||
{
|
||||
connect( (*it)->control,
|
||||
SIGNAL( linkChanged( Uint16, bool ) ),
|
||||
this,
|
||||
SLOT( linkPort( Uint16, bool ) ) );
|
||||
connect( (*it)->control, SIGNAL( linkChanged( int, bool ) ),
|
||||
this, SLOT( linkPort( int, bool ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,7 +137,7 @@ void LadspaControls::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void LadspaControls::linkPort( Uint16 _port, bool _state )
|
||||
void LadspaControls::linkPort( int _port, bool _state )
|
||||
{
|
||||
LadspaControl * first = m_controls[0][_port];
|
||||
if( _state )
|
||||
@@ -170,18 +164,14 @@ void LadspaControls::updateLinkStatesFromGlobal()
|
||||
{
|
||||
if( m_stereoLinkModel.value() )
|
||||
{
|
||||
for( Uint16 port = 0;
|
||||
port < m_controlCount / m_processors;
|
||||
port++ )
|
||||
for( int port = 0; port < m_controlCount / m_processors; port++ )
|
||||
{
|
||||
m_controls[0][port]->setLink( true );
|
||||
}
|
||||
}
|
||||
else if( !m_noLink )
|
||||
{
|
||||
for( Uint16 port = 0;
|
||||
port < m_controlCount / m_processors;
|
||||
port++ )
|
||||
for( int port = 0; port < m_controlCount / m_processors; port++ )
|
||||
{
|
||||
m_controls[0][port]->setLink( false );
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LadspaControls.h - model for LADSPA plugin controls
|
||||
*
|
||||
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
protected slots:
|
||||
void updateLinkStatesFromGlobal();
|
||||
void linkPort( Uint16 _port, bool _state );
|
||||
void linkPort( int _port, bool _state );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -466,9 +466,8 @@ inline float GET_INC(float freq) {
|
||||
return freq/engine::mixer()->processingSampleRate(); // TODO: Use actual sampling rate.
|
||||
}
|
||||
|
||||
int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
int lb302Synth::process(sampleFrame *outbuf, const int size)
|
||||
{
|
||||
unsigned int i;
|
||||
float w;
|
||||
float samp;
|
||||
|
||||
@@ -500,7 +499,7 @@ int lb302Synth::process(sampleFrame *outbuf, const Uint32 size)
|
||||
// TODO: NORMAL RELEASE
|
||||
// vca_mode = 1;
|
||||
|
||||
for(i=0;i<size;i++) {
|
||||
for(int i=0;i<size;i++) {
|
||||
|
||||
// update vcf
|
||||
if(vcf_envpos >= ENVINC) {
|
||||
|
||||
@@ -231,7 +231,7 @@ private:
|
||||
|
||||
void recalcFilter();
|
||||
|
||||
int process(sampleFrame *outbuf, const Uint32 size);
|
||||
int process(sampleFrame *outbuf, const int size);
|
||||
|
||||
friend class lb302SynthView;
|
||||
|
||||
|
||||
@@ -69,15 +69,15 @@ private:
|
||||
} while( --_bytes );
|
||||
return( value );
|
||||
}
|
||||
inline Sint32 read32LE( void )
|
||||
inline int read32LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
value |= readByte() << 16;
|
||||
value |= readByte() << 24;
|
||||
return( value );
|
||||
return value;
|
||||
}
|
||||
inline int readVar( void )
|
||||
inline int readVar()
|
||||
{
|
||||
int c = readByte();
|
||||
int value = c & 0x7f;
|
||||
@@ -103,9 +103,9 @@ private:
|
||||
return( !file().atEnd() ? value : -1 );
|
||||
}
|
||||
|
||||
inline Sint32 readID( void )
|
||||
inline int readID()
|
||||
{
|
||||
return( read32LE() );
|
||||
return read32LE();
|
||||
}
|
||||
inline void skip( int _bytes )
|
||||
{
|
||||
|
||||
@@ -190,7 +190,7 @@ void organicInstrument::playNote( notePlayHandle * _n,
|
||||
Oscillator * oscs_l[m_numOscillators];
|
||||
Oscillator * oscs_r[m_numOscillators];
|
||||
|
||||
for( Sint8 i = m_numOscillators - 1; i >= 0; --i )
|
||||
for( int i = m_numOscillators - 1; i >= 0; --i )
|
||||
{
|
||||
|
||||
m_osc[i]->m_phaseOffsetLeft = rand()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* patman.cpp - a GUS-compatible patch instrument plugin
|
||||
*
|
||||
* Copyright (c) 2007-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -564,7 +564,7 @@ void PatmanView::openFile( void )
|
||||
void PatmanView::updateFilename( void )
|
||||
{
|
||||
m_displayFilename = "";
|
||||
Uint16 idx = m_pi->m_patchFile.length();
|
||||
int idx = m_pi->m_patchFile.length();
|
||||
|
||||
QFontMetrics fm( pointSize<8>( font() ) );
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_stickModel.value(),
|
||||
m_vibratoFreqModel.value(),
|
||||
p,
|
||||
(Uint8) m_spreadModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
else if( p == 9 )
|
||||
@@ -245,7 +245,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
m_crossfadeModel.value(),
|
||||
m_lfoSpeedModel.value(),
|
||||
m_adsrModel.value(),
|
||||
(Uint8) m_spreadModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
else
|
||||
@@ -258,7 +258,7 @@ void malletsInstrument::playNote( notePlayHandle * _n,
|
||||
p - 10,
|
||||
m_strikeModel.value() * 128.0,
|
||||
m_velocityModel.value(),
|
||||
(Uint8) m_spreadModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
m.unlock();
|
||||
@@ -522,7 +522,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
const StkFloat _control8,
|
||||
const StkFloat _control11,
|
||||
const int _control16,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate )
|
||||
{
|
||||
try
|
||||
@@ -551,7 +551,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
m_delay = new StkFloat[256];
|
||||
m_delayRead = 0;
|
||||
m_delayWrite = _delay;
|
||||
for( Uint16 i = 0; i < 256; i++ )
|
||||
for( int i = 0; i < 256; i++ )
|
||||
{
|
||||
m_delay[i] = 0.0;
|
||||
}
|
||||
@@ -569,7 +569,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
const StkFloat _control4,
|
||||
const StkFloat _control11,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate )
|
||||
{
|
||||
try
|
||||
@@ -596,7 +596,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
m_delay = new StkFloat[256];
|
||||
m_delayRead = 0;
|
||||
m_delayWrite = _delay;
|
||||
for( Uint16 i = 0; i < 256; i++ )
|
||||
for( int i = 0; i < 256; i++ )
|
||||
{
|
||||
m_delay[i] = 0.0;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
const int _control16,
|
||||
const StkFloat _control64,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate )
|
||||
{
|
||||
try
|
||||
@@ -643,7 +643,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
|
||||
m_delay = new StkFloat[256];
|
||||
m_delayRead = 0;
|
||||
m_delayWrite = _delay;
|
||||
for( Uint16 i = 0; i < 256; i++ )
|
||||
for( int i = 0; i < 256; i++ )
|
||||
{
|
||||
m_delay[i] = 0.0;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
const StkFloat _control8,
|
||||
const StkFloat _control11,
|
||||
const int _control16,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
// TubeBell
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
const StkFloat _control4,
|
||||
const StkFloat _control11,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
// BandedWG
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
const int _control16,
|
||||
const StkFloat _control64,
|
||||
const StkFloat _control128,
|
||||
const Uint8 _delay,
|
||||
const uint8_t _delay,
|
||||
const sample_rate_t _sample_rate );
|
||||
|
||||
inline ~malletsSynth()
|
||||
@@ -124,8 +124,8 @@ protected:
|
||||
Instrmnt * m_voice;
|
||||
|
||||
StkFloat * m_delay;
|
||||
Uint8 m_delayRead;
|
||||
Uint8 m_delayWrite;
|
||||
uint8_t m_delayRead;
|
||||
uint8_t m_delayWrite;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ void TripleOscillator::playNote( notePlayHandle * _n,
|
||||
Oscillator * oscs_l[NUM_OF_OSCILLATORS];
|
||||
Oscillator * oscs_r[NUM_OF_OSCILLATORS];
|
||||
|
||||
for( Sint8 i = NUM_OF_OSCILLATORS - 1; i >= 0; --i )
|
||||
for( int i = NUM_OF_OSCILLATORS - 1; i >= 0; --i )
|
||||
{
|
||||
|
||||
// the last oscs needs no sub-oscs...
|
||||
|
||||
@@ -50,8 +50,8 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
|
||||
QPixmap _button7_off,
|
||||
QPixmap _button8_on,
|
||||
QPixmap _button8_off,
|
||||
Uint8 _default,
|
||||
Uint32 _x, Uint32 _y,
|
||||
int _default,
|
||||
int _x, int _y,
|
||||
QWidget * _parent ):
|
||||
QWidget( _parent ),
|
||||
IntModelView( new nineButtonSelectorModel(0, 8, _default, NULL,
|
||||
@@ -148,7 +148,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
|
||||
|
||||
nineButtonSelector::~ nineButtonSelector()
|
||||
{
|
||||
for( Uint8 i = 0; i < 9; i++ )
|
||||
for( int i = 0; i < 9; i++ )
|
||||
{
|
||||
delete m_buttons[i];
|
||||
}
|
||||
@@ -231,13 +231,13 @@ void nineButtonSelector::modelChanged()
|
||||
updateButton( model()->value() );
|
||||
}
|
||||
|
||||
void nineButtonSelector::setSelected( Uint8 _new_button )
|
||||
void nineButtonSelector::setSelected( int _new_button )
|
||||
{
|
||||
model()->setValue(_new_button);
|
||||
updateButton( _new_button );
|
||||
}
|
||||
|
||||
void nineButtonSelector::updateButton( Uint8 _new_button )
|
||||
void nineButtonSelector::updateButton( int _new_button )
|
||||
{
|
||||
m_lastBtn->setChecked( false );
|
||||
m_lastBtn->update();
|
||||
|
||||
@@ -51,17 +51,17 @@ public:
|
||||
QPixmap _button7_off,
|
||||
QPixmap _button8_on,
|
||||
QPixmap _button8_off,
|
||||
Uint8 _default,
|
||||
Uint32 _x, Uint32 _y,
|
||||
int _default,
|
||||
int _x, int _y,
|
||||
QWidget * _parent);
|
||||
virtual ~nineButtonSelector();
|
||||
|
||||
// inline Uint8 getSelected() {
|
||||
// inline int getSelected() {
|
||||
// return( castModel<nineButtonSelectorModel>()->value() );
|
||||
// };
|
||||
|
||||
protected:
|
||||
void setSelected( Uint8 _new_button );
|
||||
void setSelected( int _new_button );
|
||||
|
||||
public slots:
|
||||
void button0Clicked();
|
||||
@@ -77,11 +77,11 @@ public slots:
|
||||
void displayHelp();
|
||||
|
||||
signals:
|
||||
void nineButtonSelection( Uint8 );
|
||||
void nineButtonSelection( int );
|
||||
|
||||
private:
|
||||
virtual void modelChanged();
|
||||
void updateButton( Uint8 );
|
||||
void updateButton( int );
|
||||
|
||||
QList<pixmapButton *> m_buttons;
|
||||
pixmapButton * m_button;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
stringContainer::stringContainer(const float _pitch,
|
||||
const sample_rate_t _sample_rate,
|
||||
const Uint32 _buffer_length,
|
||||
const Uint8 _strings ) :
|
||||
const int _buffer_length,
|
||||
const int _strings ) :
|
||||
m_pitch( _pitch ),
|
||||
m_sampleRate( _sample_rate ),
|
||||
m_bufferLength( _buffer_length )
|
||||
{
|
||||
for( Uint8 i = 0; i < _strings; i++ )
|
||||
for( int i = 0; i < _strings; i++ )
|
||||
{
|
||||
m_exists.append( false );
|
||||
}
|
||||
@@ -42,16 +42,16 @@ stringContainer::stringContainer(const float _pitch,
|
||||
|
||||
|
||||
|
||||
void stringContainer::addString(Uint8 _harm,
|
||||
void stringContainer::addString(int _harm,
|
||||
const float _pick,
|
||||
const float _pickup,
|
||||
const float * _impulse,
|
||||
const float _randomize,
|
||||
const float _string_loss,
|
||||
const float _detune,
|
||||
const Uint8 _oversample,
|
||||
const int _oversample,
|
||||
const bool _state,
|
||||
const Uint8 _id )
|
||||
const int _id )
|
||||
{
|
||||
float harm;
|
||||
switch( _harm )
|
||||
|
||||
@@ -35,44 +35,44 @@ class stringContainer
|
||||
public:
|
||||
stringContainer(const float _pitch,
|
||||
const sample_rate_t _sample_rate,
|
||||
const Uint32 _buffer_length,
|
||||
const Uint8 _strings = 9 );
|
||||
const int _buffer_length,
|
||||
const int _strings = 9 );
|
||||
|
||||
void addString( Uint8 _harm,
|
||||
void addString( int _harm,
|
||||
const float _pick,
|
||||
const float _pickup,
|
||||
const float * _impluse,
|
||||
const float _randomize,
|
||||
const float _string_loss,
|
||||
const float _detune,
|
||||
const Uint8 _oversample,
|
||||
const int _oversample,
|
||||
const bool _state,
|
||||
const Uint8 _id );
|
||||
const int _id );
|
||||
|
||||
inline bool exists( Uint8 _id )
|
||||
bool exists( int _id ) const
|
||||
{
|
||||
return( m_exists[_id] );
|
||||
return m_exists[_id];
|
||||
}
|
||||
|
||||
inline ~stringContainer()
|
||||
~stringContainer()
|
||||
{
|
||||
Uint32 strings = m_strings.count();
|
||||
for( Uint32 i = 0; i < strings; i++ )
|
||||
int strings = m_strings.count();
|
||||
for( int i = 0; i < strings; i++ )
|
||||
{
|
||||
delete m_strings[i];
|
||||
}
|
||||
}
|
||||
|
||||
inline float getStringSample( Uint8 _string )
|
||||
float getStringSample( int _string )
|
||||
{
|
||||
return( m_strings[_string]->nextSample() );
|
||||
return m_strings[_string]->nextSample();
|
||||
}
|
||||
|
||||
private:
|
||||
QVector<vibratingString *> m_strings;
|
||||
const float m_pitch;
|
||||
const sample_rate_t m_sampleRate;
|
||||
const Uint32 m_bufferLength;
|
||||
const int m_bufferLength;
|
||||
QVector<bool> m_exists;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ vibed::vibed( InstrumentTrack * _instrumentTrack ) :
|
||||
nineButtonSelectorModel * harmonic;
|
||||
graphModel * graphTmp;
|
||||
|
||||
for( Uint8 harm = 0; harm < 9; harm++ )
|
||||
for( int harm = 0; harm < 9; harm++ )
|
||||
{
|
||||
knob = new FloatModel( DefaultVolume, MinVolume, MaxVolume,
|
||||
1.0f, this, tr( "String %1 volume" ).arg( harm+1 ) );
|
||||
@@ -142,7 +142,7 @@ void vibed::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
// Save plugin version
|
||||
_this.setAttribute( "version", "0.1" );
|
||||
|
||||
for( Uint8 i = 0; i < 9; i++ )
|
||||
for( int i = 0; i < 9; i++ )
|
||||
{
|
||||
name = "active" + QString::number( i );
|
||||
_this.setAttribute( name, QString::number(
|
||||
@@ -199,7 +199,7 @@ void vibed::loadSettings( const QDomElement & _this )
|
||||
|
||||
QString name;
|
||||
|
||||
for( Uint8 i = 0; i < 9; i++ )
|
||||
for( int i = 0; i < 9; i++ )
|
||||
{
|
||||
name = "active" + QString::number( i );
|
||||
m_powerButtons[i]->setValue( _this.attribute( name ).toInt() );
|
||||
@@ -280,7 +280,7 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
engine::mixer()->processingSampleRate(),
|
||||
__sampleLength );
|
||||
|
||||
for( Uint8 i = 0; i < 9; ++i )
|
||||
for( int i = 0; i < 9; ++i )
|
||||
{
|
||||
if( m_powerButtons[i]->value() )
|
||||
{
|
||||
@@ -309,18 +309,14 @@ void vibed::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
|
||||
{
|
||||
_working_buffer[i][0] = 0.0f;
|
||||
_working_buffer[i][1] = 0.0f;
|
||||
Uint8 s = 0;
|
||||
for( Uint8 string = 0; string < 9; ++string )
|
||||
int s = 0;
|
||||
for( int string = 0; string < 9; ++string )
|
||||
{
|
||||
if( ps->exists( string ) )
|
||||
{
|
||||
// pan: 0 -> left, 1 -> right
|
||||
const float pan = (
|
||||
m_panKnobs[string]->value() + 1 ) /
|
||||
2.0f;
|
||||
const sample_t sample =
|
||||
ps->getStringSample( s ) *
|
||||
m_volumeKnobs[string]->value() / 100.0f;
|
||||
const float pan = ( m_panKnobs[string]->value() + 1 ) / 2.0f;
|
||||
const sample_t sample = ps->getStringSample( s ) * m_volumeKnobs[string]->value() / 100.0f;
|
||||
_working_buffer[i][0] += ( 1.0f - pan ) * sample;
|
||||
_working_buffer[i][1] += pan * sample;
|
||||
s++;
|
||||
@@ -547,8 +543,8 @@ vibedView::vibedView( Instrument * _instrument,
|
||||
"vibrating strings. The LED in the lower right corner of the "
|
||||
"waveform editor indicates whether the selected string is active." ) );
|
||||
|
||||
connect( m_stringSelector, SIGNAL( nineButtonSelection( Uint8 ) ),
|
||||
this, SLOT( showString( Uint8 ) ) );
|
||||
connect( m_stringSelector, SIGNAL( nineButtonSelection( int ) ),
|
||||
this, SLOT( showString( int ) ) );
|
||||
|
||||
showString( 0 );
|
||||
|
||||
@@ -668,7 +664,7 @@ void vibedView::modelChanged()
|
||||
|
||||
|
||||
|
||||
void vibedView::showString( Uint8 _string )
|
||||
void vibedView::showString( int _string )
|
||||
{
|
||||
vibed * v = castModel<vibed>();
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
virtual ~vibedView() {};
|
||||
|
||||
public slots:
|
||||
void showString( Uint8 _string );
|
||||
void showString( int _string );
|
||||
void contextMenuEvent( QContextMenuEvent * );
|
||||
void displayHelp();
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ vibratingString::vibratingString( float _pitch,
|
||||
float _pick,
|
||||
float _pickup,
|
||||
float * _impulse,
|
||||
Uint32 _len,
|
||||
int _len,
|
||||
sample_rate_t _sample_rate,
|
||||
Uint8 _oversample,
|
||||
int _oversample,
|
||||
float _randomize,
|
||||
float _string_loss,
|
||||
float _detune,
|
||||
@@ -64,7 +64,7 @@ vibratingString::vibratingString( float _pitch,
|
||||
else
|
||||
{
|
||||
m_impulse = new float[_len];
|
||||
for( Uint32 i = 0; i < _len; i++ )
|
||||
for( int i = 0; i < _len; i++ )
|
||||
{
|
||||
m_impulse[i] = _impulse[i];
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
float _pick,
|
||||
float _pickup,
|
||||
float * impluse,
|
||||
Uint32 _len,
|
||||
int _len,
|
||||
sample_rate_t _sample_rate,
|
||||
Uint8 _oversample,
|
||||
int _oversample,
|
||||
float _randomize,
|
||||
float _string_loss,
|
||||
float _detune,
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
{
|
||||
sample_t ym0;
|
||||
sample_t ypM;
|
||||
for( Uint8 i = 0; i < m_oversample; i++)
|
||||
for( int i = 0; i < m_oversample; i++)
|
||||
{
|
||||
// Output at pickup position
|
||||
m_outsamp[i] = fromBridgeAccess( m_fromBridge,
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
delayLine * m_fromBridge;
|
||||
delayLine * m_toBridge;
|
||||
int m_pickupLoc;
|
||||
Uint8 m_oversample;
|
||||
int m_oversample;
|
||||
float m_randomize;
|
||||
float m_stringLoss;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* InstrumentFunctions.cpp - models for instrument-function-tab
|
||||
*
|
||||
* Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -153,12 +153,14 @@ ChordCreator::Chord::Chord( const char * n, const ChordSemiTones & semi_tones )
|
||||
|
||||
|
||||
|
||||
bool ChordCreator::Chord::hasSemiTone( Sint8 semi_tone ) const
|
||||
bool ChordCreator::Chord::hasSemiTone( int8_t semi_tone ) const
|
||||
{
|
||||
for( int i = 0; i < size(); ++i )
|
||||
{
|
||||
if( semi_tone == m_semiTones[i] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AudioDevice.cpp - base-class for audio-devices used by LMMS-mixer
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -193,23 +193,20 @@ void AudioDevice::resample( const surroundSampleFrame * _src,
|
||||
|
||||
|
||||
|
||||
Uint32 AudioDevice::convertToS16( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain,
|
||||
int_sample_t * _output_buffer,
|
||||
const bool _convert_endian )
|
||||
int AudioDevice::convertToS16( const surroundSampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
const float _master_gain,
|
||||
int_sample_t * _output_buffer,
|
||||
const bool _convert_endian )
|
||||
{
|
||||
if( _convert_endian )
|
||||
{
|
||||
Uint16 temp;
|
||||
int_sample_t temp;
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl )
|
||||
{
|
||||
temp = static_cast<int_sample_t>(
|
||||
Mixer::clip( _ab[frame][chnl] *
|
||||
_master_gain ) *
|
||||
OUTPUT_SAMPLE_MULTIPLIER );
|
||||
temp = static_cast<int_sample_t>( Mixer::clip( _ab[frame][chnl] * _master_gain ) * OUTPUT_SAMPLE_MULTIPLIER );
|
||||
|
||||
( _output_buffer + frame * channels() )[chnl] =
|
||||
( temp & 0x00ff ) << 8 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* AudioFileDevice.cpp - base-class for audio-device-classes which write
|
||||
* their output into a file
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -75,15 +75,13 @@ AudioFileDevice::~AudioFileDevice()
|
||||
|
||||
|
||||
|
||||
Sint32 AudioFileDevice::writeData( const void * _data, Sint32 _len )
|
||||
int AudioFileDevice::writeData( const void* data, int len )
|
||||
{
|
||||
if( m_outputFile.isOpen() )
|
||||
{
|
||||
return m_outputFile.write( (const char *) _data, _len );
|
||||
return m_outputFile.write( (const char *) data, len );
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* This file is based on encode.c from vorbis-tools-source, for more information
|
||||
* see below.
|
||||
*
|
||||
* Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -63,9 +63,9 @@ AudioFileOgg::~AudioFileOgg()
|
||||
|
||||
|
||||
|
||||
inline Sint32 AudioFileOgg::writePage()
|
||||
inline int AudioFileOgg::writePage()
|
||||
{
|
||||
Sint32 written = writeData( m_og.header, m_og.header_len );
|
||||
int written = writeData( m_og.header, m_og.header_len );
|
||||
written += writeData( m_og.body, m_og.body_len );
|
||||
return written;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ bool AudioFileOgg::startEncoding()
|
||||
vorbis_comment vc;
|
||||
const char * comments = "Cool=This song has been made using Linux "
|
||||
"MultiMedia Studio";
|
||||
Sint32 comment_length = strlen( comments );
|
||||
int comment_length = strlen( comments );
|
||||
char * user_comments = new char[comment_length + 1];
|
||||
strcpy( user_comments, comments );
|
||||
|
||||
@@ -166,7 +166,7 @@ bool AudioFileOgg::startEncoding()
|
||||
{
|
||||
break;
|
||||
}
|
||||
Sint32 ret = writePage();
|
||||
int ret = writePage();
|
||||
if( ret != m_og.header_len + m_og.body_len )
|
||||
{
|
||||
// clean up
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AudioPulseAudio.cpp - device-class which implements PulseAudio-output
|
||||
*
|
||||
* Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -249,7 +249,7 @@ void AudioPulseAudio::streamWriteCallback( pa_stream *s, size_t length )
|
||||
{
|
||||
const fpp_t fpp = mixer()->framesPerPeriod();
|
||||
surroundSampleFrame * temp = new surroundSampleFrame[fpp];
|
||||
Sint16 * pcmbuf = (Sint16*)pa_xmalloc( fpp * channels() * sizeof(Sint16) );
|
||||
int_sample_t* pcmbuf = (int_sample_t *)pa_xmalloc( fpp * channels() * sizeof(int_sample_t) );
|
||||
|
||||
size_t fd = 0;
|
||||
while( fd < length/4 && m_quit == false )
|
||||
|
||||
@@ -55,13 +55,12 @@ bbTrackContainer::~bbTrackContainer()
|
||||
|
||||
|
||||
bool bbTrackContainer::play( midiTime _start, fpp_t _frames,
|
||||
f_cnt_t _offset,
|
||||
Sint16 _tco_num )
|
||||
f_cnt_t _offset, int _tco_num )
|
||||
{
|
||||
bool played_a_note = false;
|
||||
if( lengthOfBB( _tco_num ) <= 0 )
|
||||
{
|
||||
return( false );
|
||||
return false;
|
||||
}
|
||||
|
||||
_start = _start % ( lengthOfBB( _tco_num ) * midiTime::ticksPerTact() );
|
||||
@@ -75,7 +74,7 @@ bool bbTrackContainer::play( midiTime _start, fpp_t _frames,
|
||||
}
|
||||
}
|
||||
|
||||
return( played_a_note );
|
||||
return played_a_note;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +108,7 @@ tact_t bbTrackContainer::lengthOfBB( int _bb )
|
||||
( *it )->getTCO( _bb )->length() );
|
||||
}
|
||||
|
||||
return( max_length.nextFullTact() );
|
||||
return max_length.nextFullTact();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +116,7 @@ tact_t bbTrackContainer::lengthOfBB( int _bb )
|
||||
|
||||
int bbTrackContainer::numOfBBs() const
|
||||
{
|
||||
return( engine::getSong()->countTracks( track::BBTrack ) );
|
||||
return engine::getSong()->countTracks( track::BBTrack );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,8 +111,8 @@ QString ladspa2LMMS::getShortName( const ladspa_key_t & _key )
|
||||
}
|
||||
if( name.length() > 40 )
|
||||
{
|
||||
Uint8 i = 40;
|
||||
while( name[i] != ' ' && i != 0 )
|
||||
int i = 40;
|
||||
while( name[i] != ' ' && i > 0 )
|
||||
{
|
||||
i--;
|
||||
}
|
||||
@@ -123,6 +123,6 @@ QString ladspa2LMMS::getShortName( const ladspa_key_t & _key )
|
||||
name = "LADSPA Plugin";
|
||||
}
|
||||
|
||||
return( name );
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* of ladspa plugins
|
||||
*
|
||||
* Copyright (c) 2005-2008 Danny McRae <khjklujn@netscape.net>
|
||||
* Copyright (c) 2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2011-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -181,12 +181,12 @@ void ladspaManager::addPlugins(
|
||||
|
||||
|
||||
|
||||
Uint16 ladspaManager::getPluginInputs(
|
||||
uint16_t ladspaManager::getPluginInputs(
|
||||
const LADSPA_Descriptor * _descriptor )
|
||||
{
|
||||
Uint16 inputs = 0;
|
||||
uint16_t inputs = 0;
|
||||
|
||||
for( Uint16 port = 0; port < _descriptor->PortCount; port++ )
|
||||
for( uint16_t port = 0; port < _descriptor->PortCount; port++ )
|
||||
{
|
||||
if( LADSPA_IS_PORT_INPUT(
|
||||
_descriptor->PortDescriptors[port] ) &&
|
||||
@@ -207,12 +207,12 @@ Uint16 ladspaManager::getPluginInputs(
|
||||
|
||||
|
||||
|
||||
Uint16 ladspaManager::getPluginOutputs(
|
||||
uint16_t ladspaManager::getPluginOutputs(
|
||||
const LADSPA_Descriptor * _descriptor )
|
||||
{
|
||||
Uint16 outputs = 0;
|
||||
uint16_t outputs = 0;
|
||||
|
||||
for( Uint16 port = 0; port < _descriptor->PortCount; port++ )
|
||||
for( uint16_t port = 0; port < _descriptor->PortCount; port++ )
|
||||
{
|
||||
if( LADSPA_IS_PORT_OUTPUT(
|
||||
_descriptor->PortDescriptors[port] ) &&
|
||||
@@ -383,7 +383,7 @@ QString ladspaManager::getCopyright( const ladspa_key_t & _plugin )
|
||||
|
||||
|
||||
|
||||
Uint32 ladspaManager::getPortCount( const ladspa_key_t & _plugin )
|
||||
uint32_t ladspaManager::getPortCount( const ladspa_key_t & _plugin )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin ) )
|
||||
{
|
||||
@@ -404,7 +404,7 @@ Uint32 ladspaManager::getPortCount( const ladspa_key_t & _plugin )
|
||||
|
||||
|
||||
bool ladspaManager::isPortInput( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -428,7 +428,7 @@ bool ladspaManager::isPortInput( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
bool ladspaManager::isPortOutput( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -452,7 +452,7 @@ bool ladspaManager::isPortOutput( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
bool ladspaManager::isPortAudio( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -476,7 +476,7 @@ bool ladspaManager::isPortAudio( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
bool ladspaManager::isPortControl( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -501,7 +501,7 @@ bool ladspaManager::isPortControl( const ladspa_key_t & _plugin,
|
||||
|
||||
bool ladspaManager::areHintsSampleRateDependent(
|
||||
const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -525,7 +525,7 @@ bool ladspaManager::areHintsSampleRateDependent(
|
||||
|
||||
|
||||
float ladspaManager::getLowerBound( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -555,7 +555,7 @@ float ladspaManager::getLowerBound( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
|
||||
float ladspaManager::getUpperBound( const ladspa_key_t & _plugin, Uint32 _port )
|
||||
float ladspaManager::getUpperBound( const ladspa_key_t & _plugin, uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -586,7 +586,7 @@ float ladspaManager::getUpperBound( const ladspa_key_t & _plugin, Uint32
|
||||
|
||||
|
||||
bool ladspaManager::isPortToggled( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -610,7 +610,7 @@ bool ladspaManager::isPortToggled( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
float ladspaManager::getDefaultSetting( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -697,7 +697,7 @@ float ladspaManager::getDefaultSetting( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
bool ladspaManager::isLogarithmic( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -721,7 +721,7 @@ bool ladspaManager::isLogarithmic( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
bool ladspaManager::isInteger( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
&& _port < getPortCount( _plugin ) )
|
||||
@@ -745,7 +745,7 @@ bool ladspaManager::isInteger( const ladspa_key_t & _plugin,
|
||||
|
||||
|
||||
QString ladspaManager::getPortName( const ladspa_key_t & _plugin,
|
||||
Uint32 _port )
|
||||
uint32_t _port )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin ) &&
|
||||
_port < getPortCount( _plugin ) )
|
||||
@@ -811,7 +811,7 @@ const LADSPA_Descriptor * ladspaManager::getDescriptor(
|
||||
|
||||
LADSPA_Handle ladspaManager::instantiate(
|
||||
const ladspa_key_t & _plugin,
|
||||
Uint32 _sample_rate )
|
||||
uint32_t _sample_rate )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin ) )
|
||||
{
|
||||
@@ -834,7 +834,7 @@ LADSPA_Handle ladspaManager::instantiate(
|
||||
|
||||
bool ladspaManager::connectPort( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _port,
|
||||
uint32_t _port,
|
||||
LADSPA_Data * _data_location )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin )
|
||||
@@ -882,7 +882,7 @@ bool ladspaManager::activate( const ladspa_key_t & _plugin,
|
||||
|
||||
bool ladspaManager::run( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _sample_count )
|
||||
uint32_t _sample_count )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin ) )
|
||||
{
|
||||
@@ -905,7 +905,7 @@ bool ladspaManager::run( const ladspa_key_t & _plugin,
|
||||
|
||||
bool ladspaManager::runAdding( const ladspa_key_t & _plugin,
|
||||
LADSPA_Handle _instance,
|
||||
Uint32 _sample_count )
|
||||
uint32_t _sample_count )
|
||||
{
|
||||
if( m_ladspaManagerMap.contains( _plugin ) )
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiAlsaRaw.cpp - midi-client for RawMIDI via ALSA
|
||||
* MidiAlsaRaw.cpp - MIDI client for RawMIDI via ALSA
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -95,9 +95,9 @@ QString MidiAlsaRaw::probeDevice()
|
||||
|
||||
|
||||
|
||||
void MidiAlsaRaw::sendByte( Uint8 _c )
|
||||
void MidiAlsaRaw::sendByte( unsigned char c )
|
||||
{
|
||||
snd_rawmidi_write( m_output, &_c, sizeof( _c ) );
|
||||
snd_rawmidi_write( m_output, &c, sizeof( c ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ void MidiAlsaRaw::sendByte( Uint8 _c )
|
||||
|
||||
void MidiAlsaRaw::run()
|
||||
{
|
||||
Uint8 buf[128];
|
||||
unsigned char buf[128];
|
||||
//int cnt = 0;
|
||||
while( m_quit == false )
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiAlsaSeq.cpp - ALSA sequencer client
|
||||
*
|
||||
* Copyright (c) 2005-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -174,8 +174,7 @@ void MidiAlsaSeq::processOutEvent( const midiEvent & _me,
|
||||
snd_seq_ev_set_source( &ev, ( m_portIDs[p][1] != -1 ) ?
|
||||
m_portIDs[p][1] : m_portIDs[p][0] );
|
||||
snd_seq_ev_set_subs( &ev );
|
||||
snd_seq_ev_schedule_tick( &ev, m_queueID, 1,
|
||||
static_cast<Sint32>( _time ) );
|
||||
snd_seq_ev_schedule_tick( &ev, m_queueID, 1, static_cast<int>( _time ) );
|
||||
ev.queue = m_queueID;
|
||||
switch( _me.m_type )
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* MidiClient.cpp - base-class for MIDI-clients like ALSA-sequencer-client
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* This file partly contains code from Fluidsynth, Peter Hanappe
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
@@ -110,7 +110,7 @@ MidiClientRaw::~MidiClientRaw()
|
||||
|
||||
|
||||
|
||||
void MidiClientRaw::parseData( const Uint8 _c )
|
||||
void MidiClientRaw::parseData( const unsigned char c )
|
||||
{
|
||||
/*********************************************************************/
|
||||
/* 'Process' system real-time messages */
|
||||
@@ -120,9 +120,9 @@ void MidiClientRaw::parseData( const Uint8 _c )
|
||||
* Real-time range: 0xF8 .. 0xFF
|
||||
* Note: Real-time does not affect (running) status.
|
||||
*/
|
||||
if( _c >= 0xF8 )
|
||||
if( c >= 0xF8 )
|
||||
{
|
||||
if( _c == MidiSystemReset )
|
||||
if( c == MidiSystemReset )
|
||||
{
|
||||
m_midiParseData.m_midiEvent.m_type = MidiSystemReset;
|
||||
m_midiParseData.m_status = 0;
|
||||
@@ -137,7 +137,7 @@ void MidiClientRaw::parseData( const Uint8 _c )
|
||||
/* There are no system common messages that are of interest here.
|
||||
* System common range: 0xF0 .. 0xF7
|
||||
*/
|
||||
if( _c > 0xF0 )
|
||||
if( c > 0xF0 )
|
||||
{
|
||||
/* MIDI spec say: To ignore a non-real-time message, just discard all
|
||||
* data up to the next status byte. And our parser will ignore data
|
||||
@@ -157,14 +157,13 @@ void MidiClientRaw::parseData( const Uint8 _c )
|
||||
* as soon as a byte >= 0x80 comes in, we are dealing with a status byte
|
||||
* and start a new event.
|
||||
*/
|
||||
if( _c & 0x80 )
|
||||
if( c & 0x80 )
|
||||
{
|
||||
m_midiParseData.m_channel = _c & 0x0F;
|
||||
m_midiParseData.m_status = _c & 0xF0;
|
||||
m_midiParseData.m_channel = c & 0x0F;
|
||||
m_midiParseData.m_status = c & 0xF0;
|
||||
/* The event consumes x bytes of data...
|
||||
(subtract 1 for the status byte) */
|
||||
m_midiParseData.m_bytesTotal = eventLength(
|
||||
m_midiParseData.m_status ) - 1;
|
||||
m_midiParseData.m_bytesTotal = eventLength( m_midiParseData.m_status ) - 1;
|
||||
/* of which we have read 0 at this time. */
|
||||
m_midiParseData.m_bytes = 0;
|
||||
return;
|
||||
@@ -185,7 +184,7 @@ void MidiClientRaw::parseData( const Uint8 _c )
|
||||
/* Store the first couple of bytes */
|
||||
if( m_midiParseData.m_bytes < RAW_MIDI_PARSE_BUF_SIZE )
|
||||
{
|
||||
m_midiParseData.m_buffer[m_midiParseData.m_bytes] = _c;
|
||||
m_midiParseData.m_buffer[m_midiParseData.m_bytes] = c;
|
||||
}
|
||||
++m_midiParseData.m_bytes;
|
||||
|
||||
@@ -207,8 +206,7 @@ void MidiClientRaw::parseData( const Uint8 _c )
|
||||
* We simply keep the status as it is, just reset the parameter counter.
|
||||
* If another status byte comes in, it will overwrite the status.
|
||||
*/
|
||||
m_midiParseData.m_midiEvent.m_type = static_cast<MidiEventTypes>(
|
||||
m_midiParseData.m_status );
|
||||
m_midiParseData.m_midiEvent.m_type = static_cast<MidiEventTypes>( m_midiParseData.m_status );
|
||||
m_midiParseData.m_midiEvent.m_channel = m_midiParseData.m_channel;
|
||||
m_midiParseData.m_bytes = 0; /* Related to running status! */
|
||||
switch( m_midiParseData.m_midiEvent.m_type )
|
||||
@@ -290,7 +288,7 @@ void MidiClientRaw::processOutEvent( const midiEvent & _me,
|
||||
|
||||
|
||||
// Taken from Nagano Daisuke's USB-MIDI driver
|
||||
static const Uint8 REMAINS_F0F6[] =
|
||||
static const unsigned char REMAINS_F0F6[] =
|
||||
{
|
||||
0, /* 0xF0 */
|
||||
2, /* 0XF1 */
|
||||
@@ -301,7 +299,7 @@ static const Uint8 REMAINS_F0F6[] =
|
||||
1 /* 0XF6 */
|
||||
} ;
|
||||
|
||||
static const Uint8 REMAINS_80E0[] =
|
||||
static const unsigned char REMAINS_80E0[] =
|
||||
{
|
||||
3, /* 0x8X Note Off */
|
||||
3, /* 0x9X Note On */
|
||||
@@ -316,15 +314,15 @@ static const Uint8 REMAINS_80E0[] =
|
||||
|
||||
// Returns the length of the MIDI message starting with _event.
|
||||
// Taken from Nagano Daisuke's USB-MIDI driver
|
||||
Uint8 MidiClientRaw::eventLength( const Uint8 _event )
|
||||
int MidiClientRaw::eventLength( const unsigned char event )
|
||||
{
|
||||
if ( _event < 0xF0 )
|
||||
if ( event < 0xF0 )
|
||||
{
|
||||
return REMAINS_80E0[( ( _event - 0x80 ) >> 4 ) & 0x0F];
|
||||
return REMAINS_80E0[( ( event - 0x80 ) >> 4 ) & 0x0F];
|
||||
}
|
||||
else if ( _event < 0xF7 )
|
||||
else if ( event < 0xF7 )
|
||||
{
|
||||
return REMAINS_F0F6[_event - 0xF0];
|
||||
return REMAINS_F0F6[event - 0xF0];
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ void MidiController::updateName()
|
||||
void MidiController::processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
Uint8 controllerNum;
|
||||
unsigned char controllerNum;
|
||||
switch( _me.m_type )
|
||||
{
|
||||
case MidiControlChange:
|
||||
@@ -86,7 +86,7 @@ void MidiController::processInEvent( const midiEvent & _me,
|
||||
( m_midiPort.inputChannel() == _me.m_channel + 1 ||
|
||||
m_midiPort.inputChannel() == 0 ) )
|
||||
{
|
||||
Uint8 val = _me.m_data.m_bytes[2] & 0x7F;
|
||||
unsigned char val = _me.m_data.m_bytes[2] & 0x7F;
|
||||
m_lastValue = (float)( val ) / 127.0f;
|
||||
emit valueChanged();
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ QString MidiOss::probeDevice()
|
||||
|
||||
|
||||
|
||||
void MidiOss::sendByte( const Uint8 _c )
|
||||
void MidiOss::sendByte( const unsigned char c )
|
||||
{
|
||||
m_midiDev.putChar( _c );
|
||||
m_midiDev.putChar( c );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -238,9 +238,7 @@ void timeLine::paintEvent( QPaintEvent * )
|
||||
|
||||
tact_t tact_num = m_begin.getTact();
|
||||
int x = m_xOffset + s_posMarkerPixmap->width() / 2 -
|
||||
( ( static_cast<Sint32>( m_begin * m_ppt ) /
|
||||
midiTime::ticksPerTact() ) %
|
||||
static_cast<int>( m_ppt ) );
|
||||
( ( static_cast<int>( m_begin * m_ppt ) / midiTime::ticksPerTact() ) % static_cast<int>( m_ppt ) );
|
||||
|
||||
p.setPen( QColor( 192, 192, 192 ) );
|
||||
for( int i = 0; x + i * m_ppt < width(); ++i )
|
||||
@@ -287,9 +285,7 @@ void timeLine::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
const midiTime t = m_begin +
|
||||
static_cast<Sint32>( _me->x() *
|
||||
midiTime::ticksPerTact() / m_ppt );
|
||||
const midiTime t = m_begin + static_cast<int>( _me->x() * midiTime::ticksPerTact() / m_ppt );
|
||||
m_action = MoveLoopBegin;
|
||||
if( m_loopPos[0] > m_loopPos[1] )
|
||||
{
|
||||
@@ -317,9 +313,8 @@ void timeLine::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void timeLine::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
const midiTime t = m_begin + static_cast<Sint32>( qMax( _me->x() -
|
||||
m_xOffset - m_moveXOff, 0 ) *
|
||||
midiTime::ticksPerTact() / m_ppt );
|
||||
const midiTime t = m_begin + static_cast<int>( qMax( _me->x() - m_xOffset - m_moveXOff, 0 ) * midiTime::ticksPerTact() / m_ppt );
|
||||
|
||||
switch( m_action )
|
||||
{
|
||||
case MovePositionMarker:
|
||||
@@ -332,7 +327,7 @@ void timeLine::mouseMoveEvent( QMouseEvent * _me )
|
||||
case MoveLoopBegin:
|
||||
case MoveLoopEnd:
|
||||
{
|
||||
const Uint8 i = m_action - MoveLoopBegin;
|
||||
const int i = m_action - MoveLoopBegin;
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
// no ctrl-press-hint when having ctrl pressed
|
||||
|
||||
@@ -73,12 +73,12 @@
|
||||
|
||||
/*! The width of the resize grip in pixels
|
||||
*/
|
||||
const Sint16 RESIZE_GRIP_WIDTH = 4;
|
||||
const int RESIZE_GRIP_WIDTH = 4;
|
||||
|
||||
/*! The size of the track buttons in pixels
|
||||
*/
|
||||
const Uint16 TRACK_OP_BTN_WIDTH = 20;
|
||||
const Uint16 TRACK_OP_BTN_HEIGHT = 14;
|
||||
const int TRACK_OP_BTN_WIDTH = 20;
|
||||
const int TRACK_OP_BTN_HEIGHT = 14;
|
||||
|
||||
|
||||
/*! A pointer for that text bubble used when moving segments, etc.
|
||||
|
||||
@@ -1529,7 +1529,7 @@ void AutomationEditor::paintEvent( QPaintEvent * _pe )
|
||||
|
||||
if( validPattern() )
|
||||
{
|
||||
Sint32 len_ticks = 4;
|
||||
int len_ticks = 4;
|
||||
timeMap & time_map = m_pattern->getTimeMap();
|
||||
timeMap::iterator it = time_map.begin();
|
||||
p.setPen( QColor( 0xFF, 0xDF, 0x20 ) );
|
||||
|
||||
@@ -444,7 +444,7 @@ void PianoView::mousePressEvent( QMouseEvent * _me )
|
||||
if( _me->button() == Qt::LeftButton && m_piano != NULL )
|
||||
{
|
||||
// get pressed key
|
||||
Uint32 key_num = getKeyFromMouse( _me->pos() );
|
||||
int key_num = getKeyFromMouse( _me->pos() );
|
||||
if( _me->pos().y() > PIANO_BASE )
|
||||
{
|
||||
int y_diff = _me->pos().y() - PIANO_BASE;
|
||||
|
||||
@@ -923,7 +923,7 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x,
|
||||
timeMap & map = _n->detuning()->automationPattern()->getTimeMap();
|
||||
for( timeMap::ConstIterator it = map.begin(); it != map.end(); ++it )
|
||||
{
|
||||
Sint32 pos_ticks = it.key();
|
||||
int pos_ticks = it.key();
|
||||
if( pos_ticks > _n->length() )
|
||||
{
|
||||
break;
|
||||
@@ -1969,7 +1969,7 @@ void pianoRoll::computeSelectedNotes(bool shift)
|
||||
( *it )->setSelected( false );
|
||||
}
|
||||
|
||||
Sint32 len_ticks = ( *it )->length();
|
||||
int len_ticks = ( *it )->length();
|
||||
|
||||
if( len_ticks == 0 )
|
||||
{
|
||||
@@ -1982,7 +1982,7 @@ void pianoRoll::computeSelectedNotes(bool shift)
|
||||
|
||||
const int key = ( *it )->key() - m_startKey + 1;
|
||||
|
||||
Sint32 pos_ticks = ( *it )->pos();
|
||||
int pos_ticks = ( *it )->pos();
|
||||
|
||||
// if the selection even barely overlaps the note
|
||||
if( key > sel_key_start &&
|
||||
@@ -3032,7 +3032,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
for( NoteVector::ConstIterator it = notes.begin();
|
||||
it != notes.end(); ++it )
|
||||
{
|
||||
Sint32 len_ticks = ( *it )->length();
|
||||
int len_ticks = ( *it )->length();
|
||||
|
||||
if( len_ticks == 0 )
|
||||
{
|
||||
@@ -3045,7 +3045,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
|
||||
const int key = ( *it )->key() - m_startKey + 1;
|
||||
|
||||
Sint32 pos_ticks = ( *it )->pos();
|
||||
int pos_ticks = ( *it )->pos();
|
||||
|
||||
int note_width = len_ticks * m_ppt /
|
||||
midiTime::ticksPerTact();
|
||||
@@ -3523,16 +3523,15 @@ void pianoRoll::selectAll()
|
||||
// if first_time = true, we HAVE to set the vars for select
|
||||
bool first_time = true;
|
||||
|
||||
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
|
||||
++it )
|
||||
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it )
|
||||
{
|
||||
Uint32 len_ticks = ( *it )->length();
|
||||
int len_ticks = ( *it )->length();
|
||||
|
||||
if( len_ticks > 0 )
|
||||
{
|
||||
const int key = ( *it )->key();
|
||||
|
||||
Uint32 pos_ticks = ( *it )->pos();
|
||||
int pos_ticks = ( *it )->pos();
|
||||
if( key <= m_selectStartKey || first_time )
|
||||
{
|
||||
// if we move start-key down, we have to add
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* cpuload_widget.cpp - widget for displaying CPU-load (partly based on
|
||||
* Hydrogen's CPU-load-widget)
|
||||
*
|
||||
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -90,7 +90,7 @@ void cpuloadWidget::paintEvent( QPaintEvent * )
|
||||
void cpuloadWidget::updateCpuLoad()
|
||||
{
|
||||
// smooth load-values a bit
|
||||
Uint8 new_load = ( m_currentLoad + engine::mixer()->cpuLoad() ) / 2;
|
||||
int new_load = ( m_currentLoad + engine::mixer()->cpuLoad() ) / 2;
|
||||
if( new_load != m_currentLoad )
|
||||
{
|
||||
m_currentLoad = new_load;
|
||||
|
||||
@@ -51,7 +51,7 @@ AutomationTrack::~AutomationTrack()
|
||||
|
||||
|
||||
bool AutomationTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _frame_base, Sint16 _tco_num )
|
||||
const f_cnt_t _frame_base, int _tco_num )
|
||||
{
|
||||
if( isMuted() )
|
||||
{
|
||||
|
||||
@@ -603,10 +603,8 @@ void InstrumentTrack::removeMidiPortNode( multimediaProject & _mmp )
|
||||
|
||||
|
||||
|
||||
bool InstrumentTrack::play( const midiTime & _start,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _offset,
|
||||
Sint16 _tco_num )
|
||||
bool InstrumentTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _offset, int _tco_num )
|
||||
{
|
||||
const float frames_per_tick = engine::framesPerTick();
|
||||
|
||||
|
||||
@@ -76,8 +76,7 @@ SampleTCO::~SampleTCO()
|
||||
|
||||
void SampleTCO::changeLength( const midiTime & _length )
|
||||
{
|
||||
trackContentObject::changeLength( qMax( static_cast<Sint32>( _length ),
|
||||
DefaultTicksPerTact ) );
|
||||
trackContentObject::changeLength( qMax( static_cast<int>( _length ), DefaultTicksPerTact ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -406,8 +405,7 @@ SampleTrack::~SampleTrack()
|
||||
|
||||
|
||||
bool SampleTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _offset,
|
||||
Sint16 /*_tco_num*/ )
|
||||
const f_cnt_t _offset, int /*_tco_num*/ )
|
||||
{
|
||||
m_audioPort.effects()->startRunning();
|
||||
bool played_a_note = false; // will be return variable
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* bb_track.cpp - implementation of class bbTrack and bbTCO
|
||||
*
|
||||
* Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -113,7 +113,7 @@ void bbTCO::loadSettings( const QDomElement & _this )
|
||||
|
||||
trackContentObjectView * bbTCO::createView( trackView * _tv )
|
||||
{
|
||||
return( new bbTCOView( this, _tv ) );
|
||||
return new bbTCOView( this, _tv );
|
||||
}
|
||||
|
||||
|
||||
@@ -342,27 +342,24 @@ bbTrack::~bbTrack()
|
||||
|
||||
// play _frames frames of given TCO within starting with _start
|
||||
bool bbTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
const f_cnt_t _offset, Sint16 _tco_num )
|
||||
const f_cnt_t _offset, int _tco_num )
|
||||
{
|
||||
if( isMuted() )
|
||||
{
|
||||
return( false );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( _tco_num >= 0 )
|
||||
{
|
||||
return( engine::getBBTrackContainer()->play( _start, _frames,
|
||||
_offset,
|
||||
s_infoMap[this] ) );
|
||||
return engine::getBBTrackContainer()->play( _start, _frames, _offset, s_infoMap[this] );
|
||||
}
|
||||
|
||||
tcoVector tcos;
|
||||
getTCOsInRange( tcos, _start, _start + static_cast<int>( _frames /
|
||||
engine::framesPerTick() ) );
|
||||
getTCOsInRange( tcos, _start, _start + static_cast<int>( _frames / engine::framesPerTick() ) );
|
||||
|
||||
if( tcos.size() == 0 )
|
||||
{
|
||||
return( false );
|
||||
return false;
|
||||
}
|
||||
|
||||
midiTime lastPosition;
|
||||
@@ -379,13 +376,9 @@ bool bbTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
|
||||
if( _start - lastPosition < lastLen )
|
||||
{
|
||||
return( engine::getBBTrackContainer()->play( _start -
|
||||
lastPosition,
|
||||
_frames,
|
||||
_offset,
|
||||
s_infoMap[this] ) );
|
||||
return engine::getBBTrackContainer()->play( _start - lastPosition, _frames, _offset, s_infoMap[this] );
|
||||
}
|
||||
return( false );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -408,11 +401,10 @@ trackContentObject * bbTrack::createTCO( const midiTime & _pos )
|
||||
getTCOsInRange( tcos, 0, _pos );
|
||||
if( tcos.size() > 0 && dynamic_cast<bbTCO *>( tcos.back() ) != NULL )
|
||||
{
|
||||
return( new bbTCO( this,
|
||||
dynamic_cast<bbTCO *>( tcos.back() )->color() ) );
|
||||
return new bbTCO( this, dynamic_cast<bbTCO *>( tcos.back() )->color() );
|
||||
|
||||
}
|
||||
return( new bbTCO( this ) );
|
||||
return new bbTCO( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -497,10 +489,10 @@ bbTrack * bbTrack::findBBTrack( int _bb_num )
|
||||
{
|
||||
if( it.value() == _bb_num )
|
||||
{
|
||||
return( it.key() );
|
||||
return it.key();
|
||||
}
|
||||
}
|
||||
return( NULL );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -510,9 +502,9 @@ int bbTrack::numOfBBTrack( track * _track )
|
||||
{
|
||||
if( dynamic_cast<bbTrack *>( _track ) != NULL )
|
||||
{
|
||||
return( s_infoMap[dynamic_cast<bbTrack *>( _track )] );
|
||||
return s_infoMap[dynamic_cast<bbTrack *>( _track )];
|
||||
}
|
||||
return( 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +563,7 @@ bbTrackView::~bbTrackView()
|
||||
bool bbTrackView::close()
|
||||
{
|
||||
engine::getBBEditor()->removeBBView( bbTrack::s_infoMap[m_bbTrack] );
|
||||
return( trackView::close() );
|
||||
return trackView::close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user