Fixed various types to be suffixed with "_t".

This commit ensures that all defined data types in include/lmms_basics.h are
suffxed with "_t" to keep consistency as well as to fix issues on systems
with older STL/libstdc++.
(cherry picked from commit 7449c4f731)
This commit is contained in:
Tobias Doerffel
2009-03-15 16:28:13 +01:00
parent 49ffdcd5bc
commit ec07aef5ac
28 changed files with 145 additions and 142 deletions

View File

@@ -204,17 +204,17 @@ private:
actions m_action;
tick m_selectStartTick;
tick m_selectedTick;
tick_t m_selectStartTick;
tick_t m_selectedTick;
float m_selectStartLevel;
float m_selectedLevels;
float m_moveStartLevel;
tick m_moveStartTick;
tick_t m_moveStartTick;
int m_moveXOffset;
float m_drawLastLevel;
tick m_drawLastTick;
tick_t m_drawLastTick;
int m_ppt;
int m_y_delta;

View File

@@ -1,7 +1,7 @@
/*
* bb_track_container.h - model-component of BB-Editor
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -46,11 +46,11 @@ public:
inline virtual QString nodeName( void ) const
{
return( "bbtrackcontainer" );
return "bbtrackcontainer";
}
tact lengthOfBB( int _bb );
inline tact lengthOfCurrentBB( void )
tact_t lengthOfBB( int _bb );
inline tact_t lengthOfCurrentBB( void )
{
return lengthOfBB( currentBB() );
}

View File

@@ -1,7 +1,7 @@
/*
* types.h - typedefs for common types that are used in the whole app
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -42,12 +42,12 @@ typedef unsigned int Uint32;
typedef signed int Sint32;
typedef Uint32 minute;
typedef Sint8 second;
typedef Sint32 tact;
typedef Sint32 tick;
typedef Uint8 volume;
typedef Sint8 panning;
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 float sample_t; // standard sample-type

View File

@@ -1,7 +1,7 @@
/*
* midi.h - constants, structs etc. concerning MIDI
*
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -154,14 +154,14 @@ struct midiEvent
return m_data.m_param[1];
}
inline volume getVolume( void ) const
inline volume_t getVolume( void ) const
{
return (volume)( velocity() * 100 / MidiMaxVelocity );
return (volume_t)( velocity() * 100 / MidiMaxVelocity );
}
inline panning getPanning( void ) const
inline panning_t getPanning( void ) const
{
return (panning) ( PanningLeft +
return (panning_t) ( PanningLeft +
( (float)( midiPanning() - MidiMinPanning ) ) /
( (float)( MidiMaxPanning - MidiMinPanning ) ) *
( (float)( PanningRight - PanningLeft ) ) );

View File

@@ -2,7 +2,7 @@
* midi_time.h - declaration of class midiTime which provides data-type for
* position- and length-variables
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -38,12 +38,12 @@ const int DefaultBeatsPerTact = DefaultTicksPerTact / DefaultStepsPerTact;
class EXPORT midiTime
{
public:
inline midiTime( const tact _tact, const tick _ticks ) :
inline midiTime( const tact_t _tact, const tick_t _ticks ) :
m_ticks( _tact * s_ticksPerTact + _ticks )
{
}
inline midiTime( const tick _ticks = 0 ) :
inline midiTime( const tick_t _ticks = 0 ) :
m_ticks( _ticks )
{
}
@@ -57,15 +57,15 @@ public:
{
if( m_ticks % s_ticksPerTact >= s_ticksPerTact/2 )
{
return( ( getTact() + 1 ) * s_ticksPerTact );
return ( getTact() + 1 ) * s_ticksPerTact;
}
return( getTact() * s_ticksPerTact );
return getTact() * s_ticksPerTact;
}
inline midiTime & operator=( const midiTime & _t )
{
m_ticks = _t.m_ticks;
return( *this );
return *this;
}
inline midiTime & operator+=( const midiTime & _t )
@@ -80,33 +80,33 @@ public:
return *this;
}
inline tact getTact( void ) const
inline tact_t getTact( void ) const
{
return( m_ticks / s_ticksPerTact );
return m_ticks / s_ticksPerTact;
}
inline tact nextFullTact( void ) const
inline tact_t nextFullTact( void ) const
{
if( m_ticks % s_ticksPerTact == 0 )
{
return( m_ticks / s_ticksPerTact );
return m_ticks / s_ticksPerTact;
}
return( m_ticks / s_ticksPerTact + 1 );
return m_ticks / s_ticksPerTact + 1;
}
inline void setTicks( tick _t )
inline void setTicks( tick_t _t )
{
m_ticks = _t;
}
inline tick getTicks( void ) const
inline tick_t getTicks( void ) const
{
return( m_ticks );
return m_ticks;
}
inline operator int( void ) const
{
return( m_ticks );
return m_ticks;
}
// calculate number of frame that are needed this time
@@ -114,39 +114,39 @@ public:
{
if( m_ticks >= 0 )
{
return( static_cast<f_cnt_t>( m_ticks *
_frames_per_tick ) );
return static_cast<f_cnt_t>( m_ticks *
_frames_per_tick );
}
return( 0 );
return 0;
}
static inline midiTime fromFrames( const f_cnt_t _frames,
const float _frames_per_tick )
{
return( midiTime( static_cast<int>( _frames /
_frames_per_tick ) ) );
return midiTime( static_cast<int>( _frames /
_frames_per_tick ) );
}
static tick ticksPerTact( void )
static tick_t ticksPerTact( void )
{
return( s_ticksPerTact );
return s_ticksPerTact;
}
static int stepsPerTact( void )
{
return( ticksPerTact() / DefaultBeatsPerTact );
return ticksPerTact() / DefaultBeatsPerTact;
}
static void setTicksPerTact( tick _tpt )
static void setTicksPerTact( tick_t _tpt )
{
s_ticksPerTact = _tpt;
}
private:
tick m_ticks;
tick_t m_ticks;
static tick s_ticksPerTact;
static tick_t s_ticksPerTact;
} ;

View File

@@ -85,8 +85,8 @@ public:
note( const midiTime & _length = midiTime( 0 ),
const midiTime & _pos = midiTime( 0 ),
int key = DefaultKey,
volume _volume = DefaultVolume,
panning _panning = DefaultPanning,
volume_t _volume = DefaultVolume,
panning_t _panning = DefaultPanning,
detuningHelper * _detuning = NULL );
note( const note & _note );
virtual ~note();
@@ -108,12 +108,12 @@ public:
void setLength( const midiTime & _length );
void setPos( const midiTime & _pos );
void setKey( const int _key );
virtual void setVolume( const volume _volume = DefaultVolume );
void setPanning( const panning _panning = DefaultPanning );
virtual void setVolume( const volume_t _volume = DefaultVolume );
void setPanning( const panning_t _panning = DefaultPanning );
void quantizeLength( const int _q_grid );
void quantizePos( const int _q_grid );
static inline bool lessThan(note * &lhs, note * &rhs)
static inline bool lessThan( note * &lhs, note * &rhs )
{
// function to compare two notes - must be called explictly when
// using qSort
@@ -172,12 +172,12 @@ public:
return m_key;
}
inline volume getVolume( void ) const
inline volume_t getVolume( void ) const
{
return m_volume;
}
inline panning getPanning( void ) const
inline panning_t getPanning( void ) const
{
return m_panning;
}
@@ -232,8 +232,8 @@ private:
bool m_isPlaying;
int m_key;
volume m_volume;
panning m_panning;
volume_t m_volume;
panning_t m_panning;
midiTime m_length;
midiTime m_pos;
detuningHelper * m_detuning;

View File

@@ -55,7 +55,7 @@ public:
const bool _part_of_arp = false );
virtual ~notePlayHandle();
virtual void setVolume( const volume _volume = DefaultVolume );
virtual void setVolume( const volume_t _volume = DefaultVolume );
int getMidiVelocity( void ) const;

View File

@@ -2,7 +2,7 @@
* panning.h - declaration of some types, concerning the
* panning of a note
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -32,7 +32,7 @@
#include "panning_constants.h"
#include "midi.h"
inline stereoVolumeVector panningToVolumeVector( panning _p,
inline stereoVolumeVector panningToVolumeVector( panning_t _p,
float _scale = 1.0f )
{
stereoVolumeVector v = { { _scale, _scale } };
@@ -41,7 +41,7 @@ inline stereoVolumeVector panningToVolumeVector( panning _p,
return v;
}
inline Sint16 panningToMidi( panning _p )
inline Sint16 panningToMidi( panning_t _p )
{
return MidiMinPanning +
( (float)( _p - PanningLeft ) ) /

View File

@@ -2,7 +2,7 @@
* panning_constants.h - declaration of some constants, concerning the
* panning of a note
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -26,9 +26,9 @@
#ifndef _PANNING_CONSTANTS_H
#define _PANNING_CONSTANTS_H
const panning PanningRight = ( 0 + 100 );
const panning PanningLeft = - PanningRight;
const panning PanningCenter = 0;
const panning DefaultPanning = PanningCenter;
const panning_t PanningRight = ( 0 + 100 );
const panning_t PanningLeft = - PanningRight;
const panning_t PanningCenter = 0;
const panning_t DefaultPanning = PanningCenter;
#endif

View File

@@ -291,8 +291,8 @@ private:
// remember these values to use them
// for the next note that is set
midiTime m_lenOfNewNotes;
volume m_lastNoteVolume;
panning m_lastNotePanning;
volume_t m_lastNoteVolume;
panning_t m_lastNotePanning;
int m_startKey; // first key when drawing
int m_lastKey;

View File

@@ -1,7 +1,7 @@
/*
* song.h - class song - the root of the model-tree
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -42,7 +42,7 @@ class timeLine;
const bpm_t MinTempo = 10;
const bpm_t DefaultTempo = 140;
const bpm_t MaxTempo = 999;
const tick MaxSongLength = 9999 * DefaultTicksPerTact;
const tick_t MaxSongLength = 9999 * DefaultTicksPerTact;
class EXPORT song : public trackContainer
@@ -70,7 +70,7 @@ public:
playPos( const int _abs = 0 ) :
midiTime( _abs ),
m_timeLine( NULL ),
m_timeLineUpdate( TRUE ),
m_timeLineUpdate( true ),
m_currentFrame( 0.0f )
{
}
@@ -80,7 +80,7 @@ public:
}
inline float currentFrame( void ) const
{
return( m_currentFrame );
return m_currentFrame;
}
timeLine * m_timeLine;
bool m_timeLineUpdate;
@@ -97,46 +97,46 @@ public:
inline bool isPaused( void ) const
{
return( m_paused );
return m_paused;
}
inline bool isPlaying( void ) const
{
return( m_playing && m_exporting == FALSE );
return m_playing && m_exporting == false;
}
inline bool isExporting( void ) const
{
return( m_exporting );
return m_exporting;
}
inline bool isRecording( void ) const
{
return( m_recording );
return m_recording;
}
bool realTimeTask( void ) const;
inline bool isExportDone( void ) const
{
return( m_exporting == TRUE &&
m_playPos[Mode_PlaySong].getTact() >= length() + 1 );
return m_exporting == true &&
m_playPos[Mode_PlaySong].getTact() >= length() + 1;
}
inline PlayModes playMode( void ) const
{
return( m_playMode );
return m_playMode;
}
inline playPos & getPlayPos( PlayModes _pm )
{
return( m_playPos[_pm] );
return m_playPos[_pm];
}
void updateLength( void );
tact length( void ) const
tact_t length( void ) const
{
return( m_length );
return m_length;
}
@@ -145,7 +145,7 @@ public:
automationTrack * globalAutomationTrack( void )
{
return( m_globalAutomationTrack );
return m_globalAutomationTrack;
}
// file management
@@ -156,25 +156,25 @@ public:
bool saveProjectAs( const QString & _file_name );
inline const QString & projectFileName( void ) const
{
return( m_fileName );
return m_fileName;
}
inline bool isLoadingProject( void ) const
{
return( m_loadingProject );
return m_loadingProject;
}
inline bool isModified( void ) const
{
return( m_modified );
return m_modified;
}
inline virtual QString nodeName( void ) const
{
return( "song" );
return "song";
}
virtual inline bool fixedTCOs( void ) const
{
return( FALSE );
return false;
}
void addController( controller * _c );
@@ -189,7 +189,7 @@ public:
meterModel & getTimeSigModel( void )
{
return( m_timeSigModel );
return m_timeSigModel;
}
@@ -200,7 +200,7 @@ public slots:
void stop( void );
void playTrack( track * _trackToPlay );
void playBB( void );
void playPattern( pattern * _patternToPlay, bool _loop = TRUE );
void playPattern( pattern * _patternToPlay, bool _loop = true );
void pause( void );
void resumeFromPause( void );
@@ -242,21 +242,21 @@ private:
inline int ticksPerTact( void ) const
{
return( DefaultTicksPerTact *
return DefaultTicksPerTact *
m_timeSigModel.getNumerator() /
m_timeSigModel.getDenominator() );
m_timeSigModel.getDenominator();
}
inline tact currentTact( void ) const
inline tact_t currentTact( void ) const
{
return( m_playPos[m_playMode].getTact() );
return m_playPos[m_playMode].getTact();
}
inline tick currentTick( void ) const
inline tick_t currentTick( void ) const
{
return( m_playPos[m_playMode].getTicks() );
return m_playPos[m_playMode].getTicks();
}
void setPlayPos( tick _ticks, PlayModes _play_mode );
void setPlayPos( tick_t _ticks, PlayModes _play_mode );
void saveControllerStates( QDomDocument & _doc, QDomElement & _this );
void restoreControllerStates( const QDomElement & _this );
@@ -286,7 +286,7 @@ private:
PlayModes m_playMode;
playPos m_playPos[Mode_Count];
tact m_length;
tact_t m_length;
track * m_trackToPlay;
pattern * m_patternToPlay;

View File

@@ -2,7 +2,7 @@
* track.h - declaration of classes concerning tracks -> neccessary for all
* track-like objects (beat/bassline, sample-track...)
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -409,7 +409,7 @@ public:
void insertTact( const midiTime & _pos );
void removeTact( const midiTime & _pos );
tact length( void ) const;
tact_t length( void ) const;
inline trackContainer * getTrackContainer( void ) const

View File

@@ -2,7 +2,7 @@
* volume.h - declaration of some constants and types, concerning the volume
* of a note
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -30,9 +30,9 @@
#include "lmms_basics.h"
const volume MinVolume = 0;
const volume MaxVolume = 200;
const volume DefaultVolume = 100;
const volume_t MinVolume = 0;
const volume_t MaxVolume = 200;
const volume_t DefaultVolume = 100;
typedef struct
{