Replaced [S/U]int[8/16/32] with types from stdint.h or plain integers
This commit is contained in:
@@ -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