SampleBuffer, SamplePlayHandle, SampleRecordHandle, SampleTrack: new coding style

Renamed file and class names.
This commit is contained in:
Tobias Doerffel
2014-01-14 18:01:14 +01:00
parent 4e5507a30a
commit 9a7ad0264f
28 changed files with 249 additions and 255 deletions

View File

@@ -2,7 +2,7 @@
* AudioSampleRecorder.h - device-class that implements recording
* audio-buffers into RAM
*
* 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
*
@@ -31,7 +31,7 @@
#include "AudioDevice.h"
class sampleBuffer;
class SampleBuffer;
class AudioSampleRecorder : public AudioDevice
@@ -42,7 +42,7 @@ public:
virtual ~AudioSampleRecorder();
f_cnt_t framesRecorded() const;
void createSampleBuffer( sampleBuffer * * _sample_buf );
void createSampleBuffer( SampleBuffer** sampleBuffer );
private:

View File

@@ -1,7 +1,7 @@
/*
* EnvelopeAndLfoParameters.h - class EnvelopeAndLfoParameters
*
* Copyright (c) 2004-2010 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
*
@@ -29,7 +29,7 @@
#include "JournallingObject.h"
#include "AutomatableModel.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "TempoSyncKnobModel.h"
#include "lmms_basics.h"
@@ -158,7 +158,7 @@ private:
bool m_lfoAmountIsZero;
sample_t * m_lfoShapeData;
bool m_bad_lfoShapeData;
sampleBuffer m_userWave;
SampleBuffer m_userWave;
enum LfoShapes
{

View File

@@ -1,7 +1,7 @@
/*
* Oscillator.h - declaration of class Oscillator
*
* 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
*
@@ -33,11 +33,11 @@
#include <stdlib.h>
#endif
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "lmms_constants.h"
class sampleBuffer;
class SampleBuffer;
class IntModel;
@@ -81,7 +81,7 @@ public:
}
inline void setUserWave( const sampleBuffer * _wave )
inline void setUserWave( const SampleBuffer * _wave )
{
m_userWave = _wave;
}
@@ -165,7 +165,7 @@ private:
Oscillator * m_subOsc;
float m_phaseOffset;
float m_phase;
const sampleBuffer * m_userWave;
const SampleBuffer * m_userWave;
void updateNoSub( sampleFrame * _ab, const fpp_t _frames,

View File

@@ -1,7 +1,7 @@
/*
* sample_buffer.h - container-class sampleBuffer
* SampleBuffer.h - container-class SampleBuffer
*
* 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
*
@@ -42,7 +42,7 @@
class QPainter;
class EXPORT sampleBuffer : public QObject, public sharedObject
class EXPORT SampleBuffer : public QObject, public sharedObject
{
Q_OBJECT
public:
@@ -58,19 +58,19 @@ public:
const bool m_varyingPitch;
SRC_STATE * m_resamplingData;
friend class sampleBuffer;
friend class SampleBuffer;
} ;
// constructor which either loads sample _audio_file or decodes
// base64-data out of string
sampleBuffer( const QString & _audio_file = QString(),
SampleBuffer( const QString & _audio_file = QString(),
bool _is_base64_data = false );
sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames );
sampleBuffer( const f_cnt_t _frames );
SampleBuffer( const sampleFrame * _data, const f_cnt_t _frames );
SampleBuffer( const f_cnt_t _frames );
virtual ~sampleBuffer();
virtual ~SampleBuffer();
bool play( sampleFrame * _ab, handleState * _state,
const fpp_t _frames,
@@ -166,12 +166,12 @@ public:
QString & toBase64( QString & _dst ) const;
static sampleBuffer * resample( sampleFrame * _data,
static SampleBuffer * resample( sampleFrame * _data,
const f_cnt_t _frames,
const sample_rate_t _src_sr,
const sample_rate_t _dst_sr );
static inline sampleBuffer * resample( sampleBuffer * _buf,
static inline SampleBuffer * resample( SampleBuffer * _buf,
const sample_rate_t _src_sr,
const sample_rate_t _dst_sr )
{

View File

@@ -1,7 +1,7 @@
/*
* sample_play_handle.h - play-handle for playing a sample
* SamplePlayHandle.h - play-handle for playing a sample
*
* 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
*
@@ -22,29 +22,28 @@
*
*/
#ifndef _SAMPLE_PLAY_HANDLE_H
#define _SAMPLE_PLAY_HANDLE_H
#include "Mixer.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "AutomatableModel.h"
class bbTrack;
class pattern;
class sampleTCO;
class SampleTCO;
class track;
class AudioPort;
class samplePlayHandle : public playHandle
class SamplePlayHandle : public playHandle
{
public:
samplePlayHandle( const QString & _sample_file );
samplePlayHandle( sampleBuffer * _sample_buffer );
samplePlayHandle( sampleTCO * _tco );
samplePlayHandle( pattern * _pattern );
virtual ~samplePlayHandle();
SamplePlayHandle( const QString& sampleFile );
SamplePlayHandle( SampleBuffer* sampleBuffer );
SamplePlayHandle( SampleTCO* tco );
SamplePlayHandle( pattern * _pattern );
virtual ~SamplePlayHandle();
virtual inline bool affinityMatters() const
{
@@ -79,11 +78,11 @@ public:
private:
sampleBuffer * m_sampleBuffer;
SampleBuffer * m_sampleBuffer;
bool m_doneMayReturnTrue;
f_cnt_t m_frame;
sampleBuffer::handleState m_state;
SampleBuffer::handleState m_state;
AudioPort * m_audioPort;
const bool m_ownAudioPort;

View File

@@ -1,5 +1,5 @@
/*
* sample_record_handle.h - play-handle for recording a sample
* SampleRecordHandle.h - play-handle for recording a sample
*
* Copyright (c) 2008 Csaba Hruska <csaba.hruska/at/gmail.com>
*
@@ -31,19 +31,19 @@
#include <qobject.h>
#include "Mixer.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
class bbTrack;
class pattern;
class sampleTCO;
class SampleTCO;
class track;
class sampleRecordHandle : public playHandle
class SampleRecordHandle : public playHandle
{
public:
sampleRecordHandle( sampleTCO * _tco );
virtual ~sampleRecordHandle();
SampleRecordHandle( SampleTCO* tco );
virtual ~SampleRecordHandle();
virtual void play( sampleFrame * _working_buffer );
virtual bool done() const;
@@ -51,7 +51,7 @@ public:
virtual bool isFromTrack( const track * _track ) const;
f_cnt_t framesRecorded() const;
void createSampleBuffer( sampleBuffer * * _sample_buf );
void createSampleBuffer( SampleBuffer * * _sample_buf );
private:
@@ -65,7 +65,7 @@ private:
track * m_track;
bbTrack * m_bbTrack;
sampleTCO * m_tco;
SampleTCO * m_tco;
} ;

View File

@@ -1,6 +1,5 @@
/*
* sample_track.h - class sampleTrack, a track which provides arrangement of
* samples
* SampleTrack.h - class SampleTrack, a track which provides arrangement of samples
*
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -33,16 +32,16 @@
class EffectRackView;
class knob;
class sampleBuffer;
class SampleBuffer;
class sampleTCO : public trackContentObject
class SampleTCO : public trackContentObject
{
Q_OBJECT
mapPropertyFromModel(bool,isRecord,setRecord,m_recordModel);
public:
sampleTCO( track * _track );
virtual ~sampleTCO();
SampleTCO( track * _track );
virtual ~SampleTCO();
virtual void changeLength( const midiTime & _length );
const QString & sampleFile() const;
@@ -54,7 +53,7 @@ public:
return "sampletco";
}
sampleBuffer * getSampleBuffer()
SampleBuffer* sampleBuffer()
{
return m_sampleBuffer;
}
@@ -65,18 +64,18 @@ public:
public slots:
void setSampleBuffer( sampleBuffer * _sb );
void setSampleBuffer( SampleBuffer* sb );
void setSampleFile( const QString & _sf );
void updateLength( bpm_t = 0 );
void toggleRecord();
private:
sampleBuffer * m_sampleBuffer;
SampleBuffer* m_sampleBuffer;
BoolModel m_recordModel;
friend class sampleTCOView;
friend class SampleTCOView;
signals:
@@ -86,12 +85,12 @@ signals:
class sampleTCOView : public trackContentObjectView
class SampleTCOView : public trackContentObjectView
{
Q_OBJECT
public:
sampleTCOView( sampleTCO * _tco, trackView * _tv );
virtual ~sampleTCOView();
SampleTCOView( SampleTCO * _tco, trackView * _tv );
virtual ~SampleTCOView();
public slots:
@@ -108,19 +107,19 @@ protected:
private:
sampleTCO * m_tco;
SampleTCO * m_tco;
} ;
class sampleTrack : public track
class SampleTrack : public track
{
Q_OBJECT
public:
sampleTrack( TrackContainer* tc );
virtual ~sampleTrack();
SampleTrack( TrackContainer* tc );
virtual ~SampleTrack();
virtual bool play( const midiTime & _start, const fpp_t _frames,
const f_cnt_t _frame_base,
@@ -149,18 +148,18 @@ private:
FloatModel m_volumeModel;
friend class sampleTrackView;
friend class SampleTrackView;
} ;
class sampleTrackView : public trackView
class SampleTrackView : public trackView
{
Q_OBJECT
public:
sampleTrackView( sampleTrack * _track, TrackContainerView* tcv );
virtual ~sampleTrackView();
SampleTrackView( SampleTrack* track, TrackContainerView* tcv );
virtual ~SampleTrackView();
public slots:

View File

@@ -2,7 +2,7 @@
* pattern.h - declaration of class pattern, which contains all informations
* about a pattern
*
* Copyright (c) 2004-2011 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
*
@@ -43,7 +43,7 @@ class QPushButton;
class InstrumentTrack;
class patternFreezeThread;
class sampleBuffer;
class SampleBuffer;
@@ -104,7 +104,7 @@ public:
return m_frozenPattern != NULL;
}
sampleBuffer *frozenPattern()
SampleBuffer *frozenPattern()
{
return m_frozenPattern;
}
@@ -157,7 +157,7 @@ private:
int m_steps;
// pattern freezing
sampleBuffer * m_frozenPattern;
SampleBuffer* m_frozenPattern;
bool m_freezing;
volatile bool m_freezeAborted;

View File

@@ -1,7 +1,7 @@
/*
* audio_file_processor.cpp - instrument for using audio-files
*
* 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
*
@@ -510,9 +510,9 @@ void AudioFileProcessorView::modelChanged( void )
AudioFileProcessorWaveView::AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, sampleBuffer & _buf ) :
AudioFileProcessorWaveView::AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, SampleBuffer& buf ) :
QWidget( _parent ),
m_sampleBuffer( _buf ),
m_sampleBuffer( buf ),
m_graph( QPixmap( _w - 2 * s_padding, _h - 2 * s_padding ) ),
m_from( 0 ),
m_to( m_sampleBuffer.frames() ),

View File

@@ -2,7 +2,7 @@
* audio_file_processor.h - declaration of class audioFileProcessor
* (instrument-plugin for using audio-files)
*
* Copyright (c) 2004-2008 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
*
@@ -31,7 +31,7 @@
#include "Instrument.h"
#include "InstrumentView.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "knob.h"
#include "pixmap_button.h"
@@ -81,9 +81,9 @@ signals:
private:
typedef sampleBuffer::handleState handleState;
typedef SampleBuffer::handleState handleState;
sampleBuffer m_sampleBuffer;
SampleBuffer m_sampleBuffer;
FloatModel m_ampModel;
FloatModel m_startPointModel;
@@ -219,7 +219,7 @@ private:
sample_end,
} ;
sampleBuffer & m_sampleBuffer;
SampleBuffer& m_sampleBuffer;
QPixmap m_graph;
f_cnt_t m_from;
f_cnt_t m_to;
@@ -237,7 +237,7 @@ private:
bool m_animation;
public:
AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, sampleBuffer & _buf );
AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, SampleBuffer& buf );
void setKnobs( knob * _start, knob * _end );

View File

@@ -192,9 +192,8 @@ void patmanInstrument::setFile( const QString & _patch_file, bool _rename )
// else we don't touch the instrument-track-name, because the user
// named it self
m_patchFile = sampleBuffer::tryToMakeRelative( _patch_file );
LoadErrors error = loadPatch( sampleBuffer::tryToMakeAbsolute(
_patch_file ) );
m_patchFile = SampleBuffer::tryToMakeRelative( _patch_file );
LoadErrors error = loadPatch( SampleBuffer::tryToMakeAbsolute( _patch_file ) );
if( error )
{
printf("Load error\n");
@@ -351,7 +350,7 @@ patmanInstrument::LoadErrors patmanInstrument::loadPatch(
}
}
sampleBuffer * psample = new sampleBuffer( data, frames );
SampleBuffer* psample = new SampleBuffer( data, frames );
psample->setFrequency( root_freq / 1000.0f );
psample->setSampleRate( sample_rate );
@@ -390,10 +389,9 @@ void patmanInstrument::selectSample( notePlayHandle * _n )
const float freq = _n->frequency();
float min_dist = HUGE_VALF;
sampleBuffer * sample = NULL;
SampleBuffer* sample = NULL;
for( QVector<sampleBuffer *>::iterator it = m_patchSamples.begin();
it != m_patchSamples.end(); ++it )
for( QVector<SampleBuffer *>::iterator it = m_patchSamples.begin(); it != m_patchSamples.end(); ++it )
{
float patch_freq = ( *it )->frequency();
float dist = freq >= patch_freq ? freq / patch_freq :
@@ -414,9 +412,9 @@ void patmanInstrument::selectSample( notePlayHandle * _n )
}
else
{
hdata->sample = new sampleBuffer( NULL, 0 );
hdata->sample = new SampleBuffer( NULL, 0 );
}
hdata->state = new sampleBuffer::handleState( _n->hasDetuningInfo() );
hdata->state = new SampleBuffer::handleState( _n->hasDetuningInfo() );
_n->m_pluginData = hdata;
}

View File

@@ -28,7 +28,7 @@
#include "Instrument.h"
#include "InstrumentView.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "AutomatableModel.h"
@@ -79,13 +79,13 @@ public slots:
private:
typedef struct
{
sampleBuffer::handleState * state;
SampleBuffer::handleState* state;
bool tuned;
sampleBuffer * sample;
SampleBuffer* sample;
} handle_data;
QString m_patchFile;
QVector<sampleBuffer *> m_patchSamples;
QVector<SampleBuffer *> m_patchSamples;
BoolModel m_loopedModel;
BoolModel m_tunedModel;

View File

@@ -2,7 +2,7 @@
* sf2_player.cpp - a soundfont2 player using fluidSynth
*
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
* 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
*
@@ -334,9 +334,8 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName )
emit fileLoading();
// Used for loading file
char * sf2Ascii = qstrdup( qPrintable(
sampleBuffer::tryToMakeAbsolute( _sf2File ) ) );
QString relativePath = sampleBuffer::tryToMakeRelative( _sf2File );
char * sf2Ascii = qstrdup( qPrintable( SampleBuffer::tryToMakeAbsolute( _sf2File ) ) );
QString relativePath = SampleBuffer::tryToMakeRelative( _sf2File );
// free reference to soundfont if one is selected
freeFont();

View File

@@ -36,7 +36,7 @@
#include "lcd_spinbox.h"
#include "led_checkbox.h"
#include "fluidsynth.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
class sf2InstrumentView;
class sf2Font;

View File

@@ -1,7 +1,7 @@
/*
* TripleOscillator.cpp - powerful instrument with three oscillators
*
* 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
*
@@ -35,7 +35,7 @@
#include "knob.h"
#include "note_play_handle.h"
#include "pixmap_button.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "song_editor.h"
#include "tooltip.h"
@@ -88,7 +88,7 @@ OscillatorObject::OscillatorObject( Model * _parent, int _idx ) :
Oscillator::NumModulationAlgos-1, this,
tr( "Modulation type %1" ).arg( _idx+1 ) ),
m_sampleBuffer( new sampleBuffer ),
m_sampleBuffer( new SampleBuffer ),
m_volumeLeft( 0.0f ),
m_volumeRight( 0.0f ),
m_detuningLeft( 0.0f ),

View File

@@ -2,7 +2,7 @@
* TripleOscillator.h - declaration of class TripleOscillator a powerful
* instrument-plugin with 3 oscillators
*
* 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
*
@@ -36,7 +36,7 @@ class automatableButtonGroup;
class knob;
class notePlayHandle;
class pixmapButton;
class sampleBuffer;
class SampleBuffer;
const int NUM_OF_OSCILLATORS = 3;
@@ -59,7 +59,7 @@ private:
FloatModel m_stereoPhaseDetuningModel;
IntModel m_waveShapeModel;
IntModel m_modulationAlgoModel;
sampleBuffer * m_sampleBuffer;
SampleBuffer* m_sampleBuffer;
float m_volumeLeft;
float m_volumeRight;

View File

@@ -26,7 +26,6 @@
#include "Instrument.h"
#include "InstrumentView.h"
#include "sample_buffer.h"
#include "graph.h"
#include "knob.h"
#include "pixmap_button.h"

View File

@@ -36,7 +36,7 @@
#include "debug.h"
#include "engine.h"
#include "config_mgr.h"
#include "sample_play_handle.h"
#include "SamplePlayHandle.h"
#include "piano_roll.h"
#include "MicroTimer.h"
#include "atomic_int.h"
@@ -565,7 +565,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
p != last_metro_pos && p.getTicks() %
(DefaultTicksPerTact / 4 ) == 0 )
{
addPlayHandle( new samplePlayHandle( "misc/metronome01.ogg" ) );
addPlayHandle( new SamplePlayHandle( "misc/metronome01.ogg" ) );
last_metro_pos = p;
}

View File

@@ -1,7 +1,7 @@
/*
* sample_buffer.cpp - container-class sampleBuffer
* SampleBuffer.cpp - container-class SampleBuffer
*
* 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
*
@@ -23,7 +23,7 @@
*/
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "Mixer.h"
@@ -62,7 +62,7 @@
#include "templates.h"
sampleBuffer::sampleBuffer( const QString & _audio_file,
SampleBuffer::SampleBuffer( const QString & _audio_file,
bool _is_base64_data ) :
m_audioFile( ( _is_base64_data == true ) ? "" : _audio_file ),
m_origData( NULL ),
@@ -88,7 +88,7 @@ sampleBuffer::sampleBuffer( const QString & _audio_file,
sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) :
SampleBuffer::SampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) :
m_audioFile( "" ),
m_origData( NULL ),
m_origFrames( 0 ),
@@ -115,7 +115,7 @@ sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) :
sampleBuffer::sampleBuffer( const f_cnt_t _frames ) :
SampleBuffer::SampleBuffer( const f_cnt_t _frames ) :
m_audioFile( "" ),
m_origData( NULL ),
m_origFrames( 0 ),
@@ -142,7 +142,7 @@ sampleBuffer::sampleBuffer( const f_cnt_t _frames ) :
sampleBuffer::~sampleBuffer()
SampleBuffer::~SampleBuffer()
{
delete[] m_origData;
delete[] m_data;
@@ -153,7 +153,7 @@ sampleBuffer::~sampleBuffer()
void sampleBuffer::update( bool _keep_settings )
void SampleBuffer::update( bool _keep_settings )
{
const bool lock = ( m_data != NULL );
if( lock )
@@ -266,7 +266,7 @@ void sampleBuffer::update( bool _keep_settings )
}
void sampleBuffer::convertIntToFloat ( int_sample_t * & _ibuf, f_cnt_t _frames, int _channels)
void SampleBuffer::convertIntToFloat ( int_sample_t * & _ibuf, f_cnt_t _frames, int _channels)
{
// following code transforms int-samples into
// float-samples and does amplifying & reversing
@@ -308,7 +308,7 @@ void sampleBuffer::convertIntToFloat ( int_sample_t * & _ibuf, f_cnt_t _frames,
}
void sampleBuffer::directFloatWrite ( sample_t * & _fbuf, f_cnt_t _frames, int _channels)
void SampleBuffer::directFloatWrite ( sample_t * & _fbuf, f_cnt_t _frames, int _channels)
{
@@ -347,13 +347,13 @@ void sampleBuffer::directFloatWrite ( sample_t * & _fbuf, f_cnt_t _frames, int _
}
void sampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr,
void SampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr,
bool _keep_settings )
{
// do samplerate-conversion to our default-samplerate
if( _src_sr != engine::mixer()->baseSampleRate() )
{
sampleBuffer * resampled = resample( this, _src_sr,
SampleBuffer * resampled = resample( this, _src_sr,
engine::mixer()->baseSampleRate() );
delete[] m_data;
m_frames = resampled->frames();
@@ -374,7 +374,7 @@ void sampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr,
f_cnt_t sampleBuffer::decodeSampleSF( const char * _f,
f_cnt_t SampleBuffer::decodeSampleSF( const char * _f,
int_sample_t * & _buf,
ch_cnt_t & _channels,
sample_rate_t & _samplerate )
@@ -404,7 +404,7 @@ f_cnt_t sampleBuffer::decodeSampleSF( const char * _f,
if( sf_rr < sf_info.channels * frames )
{
#ifdef DEBUG_LMMS
printf( "sampleBuffer::decodeSampleSF(): could not read"
printf( "SampleBuffer::decodeSampleSF(): could not read"
" sample %s: %s\n", _f, sf_strerror( NULL ) );
#endif
}
@@ -416,7 +416,7 @@ f_cnt_t sampleBuffer::decodeSampleSF( const char * _f,
else
{
#ifdef DEBUG_LMMS
printf( "sampleBuffer::decodeSampleSF(): could not load "
printf( "SampleBuffer::decodeSampleSF(): could not load "
"sample %s: %s\n", _f, sf_strerror( NULL ) );
#endif
}
@@ -489,7 +489,7 @@ long qfileTellCallback( void * _udata )
f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f,
f_cnt_t SampleBuffer::decodeSampleOGGVorbis( const char * _f,
int_sample_t * & _buf,
ch_cnt_t & _channels,
sample_rate_t & _samplerate )
@@ -520,23 +520,23 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f,
switch( err )
{
case OV_EREAD:
printf( "sampleBuffer::decodeSampleOGGVorbis():"
printf( "SampleBuffer::decodeSampleOGGVorbis():"
" media read error\n" );
break;
case OV_ENOTVORBIS:
/* printf( "sampleBuffer::decodeSampleOGGVorbis():"
/* printf( "SampleBuffer::decodeSampleOGGVorbis():"
" not an Ogg Vorbis file\n" );*/
break;
case OV_EVERSION:
printf( "sampleBuffer::decodeSampleOGGVorbis():"
printf( "SampleBuffer::decodeSampleOGGVorbis():"
" vorbis version mismatch\n" );
break;
case OV_EBADHEADER:
printf( "sampleBuffer::decodeSampleOGGVorbis():"
printf( "SampleBuffer::decodeSampleOGGVorbis():"
" invalid Vorbis bitstream header\n" );
break;
case OV_EFAULT:
printf( "sampleBuffer::decodeSampleOgg(): "
printf( "SampleBuffer::decodeSampleOgg(): "
"internal logic fault\n" );
break;
}
@@ -585,7 +585,7 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f,
f_cnt_t sampleBuffer::decodeSampleDS( const char * _f,
f_cnt_t SampleBuffer::decodeSampleDS( const char * _f,
int_sample_t * & _buf,
ch_cnt_t & _channels,
sample_rate_t & _samplerate )
@@ -605,7 +605,7 @@ f_cnt_t sampleBuffer::decodeSampleDS( const char * _f,
bool sampleBuffer::play( sampleFrame * _ab, handleState * _state,
bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
const fpp_t _frames,
const float _freq,
const bool _looped )
@@ -683,12 +683,12 @@ bool sampleBuffer::play( sampleFrame * _ab, handleState * _state,
&src_data );
if( error )
{
printf( "sampleBuffer: error while resampling: %s\n",
printf( "SampleBuffer: error while resampling: %s\n",
src_strerror( error ) );
}
if( src_data.output_frames_gen > _frames )
{
printf( "sampleBuffer: not enough frames: %ld / %d\n",
printf( "SampleBuffer: not enough frames: %ld / %d\n",
src_data.output_frames_gen, _frames );
}
// Advance
@@ -726,7 +726,7 @@ bool sampleBuffer::play( sampleFrame * _ab, handleState * _state,
sampleFrame * sampleBuffer::getSampleFragment( f_cnt_t _start,
sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _start,
f_cnt_t _frames, bool _looped, sampleFrame * * _tmp ) const
{
if( _looped )
@@ -773,7 +773,7 @@ sampleFrame * sampleBuffer::getSampleFragment( f_cnt_t _start,
f_cnt_t sampleBuffer::getLoopedIndex( f_cnt_t _index ) const
f_cnt_t SampleBuffer::getLoopedIndex( f_cnt_t _index ) const
{
if( _index < m_loopEndFrame )
{
@@ -786,7 +786,7 @@ f_cnt_t sampleBuffer::getLoopedIndex( f_cnt_t _index ) const
void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
void SampleBuffer::visualize( QPainter & _p, const QRect & _dr,
const QRect & _clip, f_cnt_t _from_frame, f_cnt_t _to_frame )
{
const bool focus_on_range = _to_frame <= m_frames
@@ -827,7 +827,7 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr,
QString sampleBuffer::openAudioFile() const
QString SampleBuffer::openAudioFile() const
{
QFileDialog ofd( NULL, tr( "Open audio file" ) );
#if QT_VERSION >= 0x040806
@@ -932,7 +932,7 @@ void flacStreamEncoderMetadataCallback( const FLAC__StreamEncoder *,
QString & sampleBuffer::toBase64( QString & _dst ) const
QString & SampleBuffer::toBase64( QString & _dst ) const
{
#ifdef LMMS_HAVE_FLAC_STREAM_ENCODER_H
const f_cnt_t FRAMES_PER_BUF = 1152;
@@ -997,14 +997,14 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
sampleBuffer * sampleBuffer::resample( sampleFrame * _data,
SampleBuffer * SampleBuffer::resample( sampleFrame * _data,
const f_cnt_t _frames,
const sample_rate_t _src_sr,
const sample_rate_t _dst_sr )
{
const f_cnt_t dst_frames = static_cast<f_cnt_t>( _frames /
(float) _src_sr * (float) _dst_sr );
sampleBuffer * dst_sb = new sampleBuffer( dst_frames );
SampleBuffer * dst_sb = new SampleBuffer( dst_frames );
sampleFrame * dst_buf = dst_sb->m_origData;
// yeah, libsamplerate, let's rock with sinc-interpolation!
@@ -1022,7 +1022,7 @@ sampleBuffer * sampleBuffer::resample( sampleFrame * _data,
src_data.src_ratio = (double) _dst_sr / _src_sr;
if( ( error = src_process( state, &src_data ) ) )
{
printf( "sampleBuffer: error while resampling: %s\n",
printf( "SampleBuffer: error while resampling: %s\n",
src_strerror( error ) );
}
src_delete( state );
@@ -1038,7 +1038,7 @@ sampleBuffer * sampleBuffer::resample( sampleFrame * _data,
void sampleBuffer::setAudioFile( const QString & _audio_file )
void SampleBuffer::setAudioFile( const QString & _audio_file )
{
m_audioFile = tryToMakeRelative( _audio_file );
update();
@@ -1139,7 +1139,7 @@ void flacStreamDecoderErrorCallback( const FLAC__StreamDecoder *,
#endif
void sampleBuffer::loadFromBase64( const QString & _data )
void SampleBuffer::loadFromBase64( const QString & _data )
{
char * dst = NULL;
int dsize = 0;
@@ -1203,7 +1203,7 @@ void sampleBuffer::loadFromBase64( const QString & _data )
void sampleBuffer::setStartFrame( const f_cnt_t _s )
void SampleBuffer::setStartFrame( const f_cnt_t _s )
{
m_varLock.lock();
m_loopStartFrame = m_startFrame = _s;
@@ -1213,7 +1213,7 @@ void sampleBuffer::setStartFrame( const f_cnt_t _s )
void sampleBuffer::setEndFrame( const f_cnt_t _e )
void SampleBuffer::setEndFrame( const f_cnt_t _e )
{
m_varLock.lock();
m_loopEndFrame = m_endFrame = _e;
@@ -1223,7 +1223,7 @@ void sampleBuffer::setEndFrame( const f_cnt_t _e )
void sampleBuffer::setAmplification( float _a )
void SampleBuffer::setAmplification( float _a )
{
m_amplification = _a;
update( true );
@@ -1232,7 +1232,7 @@ void sampleBuffer::setAmplification( float _a )
void sampleBuffer::setReversed( bool _on )
void SampleBuffer::setReversed( bool _on )
{
m_reversed = _on;
update( true );
@@ -1241,7 +1241,7 @@ void sampleBuffer::setReversed( bool _on )
QString sampleBuffer::tryToMakeRelative( const QString & _file )
QString SampleBuffer::tryToMakeRelative( const QString & _file )
{
if( QFileInfo( _file ).isRelative() == false )
{
@@ -1265,7 +1265,7 @@ QString sampleBuffer::tryToMakeRelative( const QString & _file )
QString sampleBuffer::tryToMakeAbsolute( const QString & _file )
QString SampleBuffer::tryToMakeAbsolute( const QString & _file )
{
if( QFileInfo( _file ).isAbsolute() )
{
@@ -1288,7 +1288,7 @@ QString sampleBuffer::tryToMakeAbsolute( const QString & _file )
sampleBuffer::handleState::handleState( bool _varying_pitch ) :
SampleBuffer::handleState::handleState( bool _varying_pitch ) :
m_frameIndex( 0 ),
m_varyingPitch( _varying_pitch )
{
@@ -1306,7 +1306,7 @@ sampleBuffer::handleState::handleState( bool _varying_pitch ) :
sampleBuffer::handleState::~handleState()
SampleBuffer::handleState::~handleState()
{
src_delete( m_resamplingData );
}
@@ -1314,7 +1314,7 @@ sampleBuffer::handleState::~handleState()
#include "moc_sample_buffer.cxx"
#include "moc_SampleBuffer.cxx"
/* vim: set tw=0 noexpandtab: */

View File

@@ -1,7 +1,7 @@
/*
* sample_play_handle.cpp - implementation of class samplePlayHandle
* SamplePlayHandle.cpp - implementation of class SamplePlayHandle
*
* 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
*
@@ -22,23 +22,23 @@
*
*/
#include "sample_play_handle.h"
#include "SamplePlayHandle.h"
#include "AudioPort.h"
#include "bb_track.h"
#include "engine.h"
#include "InstrumentTrack.h"
#include "pattern.h"
#include "sample_buffer.h"
#include "sample_track.h"
#include "SampleBuffer.h"
#include "SampleTrack.h"
samplePlayHandle::samplePlayHandle( const QString & _sample_file ) :
playHandle( SamplePlayHandle ),
m_sampleBuffer( new sampleBuffer( _sample_file ) ),
SamplePlayHandle::SamplePlayHandle( const QString& sampleFile ) :
playHandle( playHandle::SamplePlayHandle ),
m_sampleBuffer( new SampleBuffer( sampleFile ) ),
m_doneMayReturnTrue( true ),
m_frame( 0 ),
m_audioPort( new AudioPort( "samplePlayHandle", false ) ),
m_audioPort( new AudioPort( "SamplePlayHandle", false ) ),
m_ownAudioPort( true ),
m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ),
m_volumeModel( &m_defaultVolumeModel ),
@@ -50,12 +50,12 @@ samplePlayHandle::samplePlayHandle( const QString & _sample_file ) :
samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) :
playHandle( SamplePlayHandle ),
m_sampleBuffer( sharedObject::ref( _sample_buffer ) ),
SamplePlayHandle::SamplePlayHandle( SampleBuffer* sampleBuffer ) :
playHandle( playHandle::SamplePlayHandle ),
m_sampleBuffer( sharedObject::ref( sampleBuffer ) ),
m_doneMayReturnTrue( true ),
m_frame( 0 ),
m_audioPort( new AudioPort( "samplePlayHandle", false ) ),
m_audioPort( new AudioPort( "SamplePlayHandle", false ) ),
m_ownAudioPort( true ),
m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ),
m_volumeModel( &m_defaultVolumeModel ),
@@ -67,16 +67,16 @@ samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) :
samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) :
playHandle( SamplePlayHandle ),
m_sampleBuffer( sharedObject::ref( _tco->getSampleBuffer() ) ),
SamplePlayHandle::SamplePlayHandle( SampleTCO* tco ) :
playHandle( playHandle::SamplePlayHandle ),
m_sampleBuffer( sharedObject::ref( tco->sampleBuffer() ) ),
m_doneMayReturnTrue( true ),
m_frame( 0 ),
m_audioPort( ( (sampleTrack *)_tco->getTrack() )->audioPort() ),
m_audioPort( ( (SampleTrack *)tco->getTrack() )->audioPort() ),
m_ownAudioPort( false ),
m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ),
m_volumeModel( &m_defaultVolumeModel ),
m_track( _tco->getTrack() ),
m_track( tco->getTrack() ),
m_bbTrack( NULL )
{
}
@@ -84,8 +84,8 @@ samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) :
samplePlayHandle::samplePlayHandle( pattern * _pattern ) :
playHandle( SamplePlayHandle ),
SamplePlayHandle::SamplePlayHandle( pattern * _pattern ) :
playHandle( playHandle::SamplePlayHandle ),
m_sampleBuffer( sharedObject::ref( _pattern->frozenPattern() ) ),
m_doneMayReturnTrue( true ),
m_frame( 0 ),
@@ -101,7 +101,7 @@ samplePlayHandle::samplePlayHandle( pattern * _pattern ) :
samplePlayHandle::~samplePlayHandle()
SamplePlayHandle::~SamplePlayHandle()
{
sharedObject::unref( m_sampleBuffer );
if( m_ownAudioPort )
@@ -113,7 +113,7 @@ samplePlayHandle::~samplePlayHandle()
void samplePlayHandle::play( sampleFrame * _working_buffer )
void SamplePlayHandle::play( sampleFrame * _working_buffer )
{
//play( 0, _try_parallelizing );
if( framesDone() >= totalFrames() )
@@ -140,7 +140,7 @@ void samplePlayHandle::play( sampleFrame * _working_buffer )
bool samplePlayHandle::done() const
bool SamplePlayHandle::done() const
{
return( framesDone() >= totalFrames() && m_doneMayReturnTrue == true );
}
@@ -148,7 +148,7 @@ bool samplePlayHandle::done() const
bool samplePlayHandle::isFromTrack( const track * _track ) const
bool SamplePlayHandle::isFromTrack( const track * _track ) const
{
return( m_track == _track || m_bbTrack == _track );
}
@@ -156,7 +156,7 @@ bool samplePlayHandle::isFromTrack( const track * _track ) const
f_cnt_t samplePlayHandle::totalFrames() const
f_cnt_t SamplePlayHandle::totalFrames() const
{
return( ( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ) *
( engine::mixer()->processingSampleRate() /

View File

@@ -1,5 +1,5 @@
/*
* sample_record_handle.cpp - implementation of class sampleRecordHandle
* SampleRecordHandle.cpp - implementation of class SampleRecordHandle
*
* Copyright (c) 2008 Csaba Hruska <csaba.hruska/at/gmail.com>
*
@@ -23,34 +23,34 @@
*/
#include "sample_record_handle.h"
#include "SampleRecordHandle.h"
#include "bb_track.h"
#include "engine.h"
#include "InstrumentTrack.h"
#include "pattern.h"
#include "sample_buffer.h"
#include "sample_track.h"
#include "SampleBuffer.h"
#include "SampleTrack.h"
sampleRecordHandle::sampleRecordHandle( sampleTCO * _tco ) :
SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) :
playHandle( SamplePlayHandle ),
m_framesRecorded( 0 ),
m_minLength( _tco->length() ),
m_track( _tco->getTrack() ),
m_minLength( tco->length() ),
m_track( tco->getTrack() ),
m_bbTrack( NULL ),
m_tco( _tco )
m_tco( tco )
{
}
sampleRecordHandle::~sampleRecordHandle()
SampleRecordHandle::~SampleRecordHandle()
{
if( !m_buffers.empty() )
{
sampleBuffer * sb;
SampleBuffer* sb;
createSampleBuffer( &sb );
m_tco->setSampleBuffer( sb );
}
@@ -66,7 +66,7 @@ sampleRecordHandle::~sampleRecordHandle()
void sampleRecordHandle::play( sampleFrame * /*_working_buffer*/ )
void SampleRecordHandle::play( sampleFrame * /*_working_buffer*/ )
{
const sampleFrame * recbuf = engine::mixer()->inputBuffer();
const f_cnt_t frames = engine::mixer()->inputBufferFrames();
@@ -84,7 +84,7 @@ void sampleRecordHandle::play( sampleFrame * /*_working_buffer*/ )
bool sampleRecordHandle::done() const
bool SampleRecordHandle::done() const
{
return false;
}
@@ -92,7 +92,7 @@ bool sampleRecordHandle::done() const
bool sampleRecordHandle::isFromTrack( const track * _track ) const
bool SampleRecordHandle::isFromTrack( const track * _track ) const
{
return( m_track == _track || m_bbTrack == _track );
}
@@ -100,7 +100,7 @@ bool sampleRecordHandle::isFromTrack( const track * _track ) const
f_cnt_t sampleRecordHandle::framesRecorded() const
f_cnt_t SampleRecordHandle::framesRecorded() const
{
return( m_framesRecorded );
}
@@ -108,7 +108,7 @@ f_cnt_t sampleRecordHandle::framesRecorded() const
void sampleRecordHandle::createSampleBuffer( sampleBuffer * * _sample_buf )
void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf )
{
const f_cnt_t frames = framesRecorded();
// create buffer to store all recorded buffers in
@@ -128,15 +128,15 @@ void sampleRecordHandle::createSampleBuffer( sampleBuffer * * _sample_buf )
data_ptr += ( *it ).second;
}
// create according sample-buffer out of big buffer
*_sample_buf = new sampleBuffer( data, frames );
( *_sample_buf )->setSampleRate( engine::mixer()->inputSampleRate() );
*sampleBuf = new SampleBuffer( data, frames );
( *sampleBuf)->setSampleRate( engine::mixer()->inputSampleRate() );
delete[] data;
}
void sampleRecordHandle::writeBuffer( const sampleFrame * _ab,
void SampleRecordHandle::writeBuffer( const sampleFrame * _ab,
const f_cnt_t _frames )
{
sampleFrame * buf = new sampleFrame[_frames];

View File

@@ -2,7 +2,7 @@
* AudioSampleRecorder.cpp - device-class that implements recording
* audio-buffers into RAM
*
* 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
*
@@ -25,7 +25,7 @@
#include "AudioSampleRecorder.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "debug.h"
@@ -68,7 +68,7 @@ f_cnt_t AudioSampleRecorder::framesRecorded() const
void AudioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf )
{
const f_cnt_t frames = framesRecorded();
// create buffer to store all recorded buffers in
@@ -88,8 +88,8 @@ void AudioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf )
data_ptr += ( *it ).second;
}
// create according sample-buffer out of big buffer
*_sample_buf = new sampleBuffer( data, frames );
( *_sample_buf )->setSampleRate( sampleRate() );
*sampleBuf = new SampleBuffer( data, frames );
( *sampleBuf )->setSampleRate( sampleRate() );
delete[] data;
}

View File

@@ -62,7 +62,7 @@
#include "mmp.h"
#include "pixmap_button.h"
#include "ProjectJournal.h"
#include "sample_track.h"
#include "SampleTrack.h"
#include "song.h"
#include "string_pair_drag.h"
#include "templates.h"
@@ -1602,7 +1602,7 @@ track * track::create( TrackTypes _tt, TrackContainer * _tc )
{
case InstrumentTrack: t = new ::InstrumentTrack( _tc ); break;
case BBTrack: t = new bbTrack( _tc ); break;
case SampleTrack: t = new sampleTrack( _tc ); break;
case SampleTrack: t = new ::SampleTrack( _tc ); break;
// case EVENT_TRACK:
// case VIDEO_TRACK:
case AutomationTrack: t = new ::AutomationTrack( _tc ); break;

View File

@@ -2,7 +2,7 @@
* file_browser.cpp - implementation of the project-, preset- and
* sample-file-browser
*
* 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 @@
#include "MainWindow.h"
#include "mmp.h"
#include "preset_preview_play_handle.h"
#include "sample_play_handle.h"
#include "SamplePlayHandle.h"
#include "song.h"
#include "string_pair_drag.h"
#include "text_float.h"
@@ -418,7 +418,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me )
}
// in special case of sample-files we do not care about
// handling() rather than directly creating a samplePlayHandle
// handling() rather than directly creating a SamplePlayHandle
if( f->type() == fileItem::SampleFile )
{
textFloat * tf = textFloat::displayMessage(
@@ -429,7 +429,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me )
24, 24 ), 0 );
qApp->processEvents(
QEventLoop::ExcludeUserInputEvents );
samplePlayHandle * s = new samplePlayHandle(
SamplePlayHandle * s = new SamplePlayHandle(
f->fullName() );
s->setDoneMayReturnTrue( false );
m_previewPlayHandle = s;
@@ -520,7 +520,7 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me )
if( m_previewPlayHandle->type() ==
playHandle::SamplePlayHandle )
{
samplePlayHandle * s = dynamic_cast<samplePlayHandle *>(
SamplePlayHandle * s = dynamic_cast<SamplePlayHandle *>(
m_previewPlayHandle );
if( s && s->totalFrames() - s->framesDone() <=
static_cast<f_cnt_t>( engine::mixer()->

View File

@@ -29,7 +29,7 @@
#include "graph.h"
#include "string_pair_drag.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "Oscillator.h"
#include "engine.h"

View File

@@ -69,7 +69,7 @@
#include "note_play_handle.h"
#include "pattern.h"
#include "PluginView.h"
#include "sample_play_handle.h"
#include "SamplePlayHandle.h"
#include "song.h"
#include "string_pair_drag.h"
#include "surround_area.h"
@@ -658,7 +658,7 @@ bool InstrumentTrack::play( const midiTime & _start,
continue;
}
samplePlayHandle * handle = new samplePlayHandle( p );
SamplePlayHandle* handle = new SamplePlayHandle( p );
handle->setBBTrack( bb_track );
handle->setOffset( _offset );
// send it to the mixer

View File

@@ -1,6 +1,6 @@
/*
* sample_track.cpp - implementation of class sampleTrack, a track which
* provides arrangement of samples
* SampleTrack.cpp - implementation of class SampleTrack, a track which
* provides arrangement of samples
*
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -33,14 +33,14 @@
#include <QtGui/QPushButton>
#include "gui_templates.h"
#include "sample_track.h"
#include "SampleTrack.h"
#include "song.h"
#include "embed.h"
#include "engine.h"
#include "tooltip.h"
#include "AudioPort.h"
#include "sample_play_handle.h"
#include "sample_record_handle.h"
#include "SamplePlayHandle.h"
#include "SampleRecordHandle.h"
#include "string_pair_drag.h"
#include "knob.h"
#include "MainWindow.h"
@@ -49,9 +49,9 @@
#include "config_mgr.h"
sampleTCO::sampleTCO( track * _track ) :
SampleTCO::SampleTCO( track * _track ) :
trackContentObject( _track ),
m_sampleBuffer( new sampleBuffer )
m_sampleBuffer( new SampleBuffer )
{
saveJournallingState( false );
setSampleFile( "" );
@@ -66,7 +66,7 @@ sampleTCO::sampleTCO( track * _track ) :
sampleTCO::~sampleTCO()
SampleTCO::~SampleTCO()
{
sharedObject::unref( m_sampleBuffer );
}
@@ -74,7 +74,7 @@ sampleTCO::~sampleTCO()
void sampleTCO::changeLength( const midiTime & _length )
void SampleTCO::changeLength( const midiTime & _length )
{
trackContentObject::changeLength( qMax( static_cast<Sint32>( _length ),
DefaultTicksPerTact ) );
@@ -83,17 +83,17 @@ void sampleTCO::changeLength( const midiTime & _length )
const QString & sampleTCO::sampleFile() const
const QString & SampleTCO::sampleFile() const
{
return m_sampleBuffer->audioFile();
}
void sampleTCO::setSampleBuffer( sampleBuffer * _sb )
void SampleTCO::setSampleBuffer( SampleBuffer* sb )
{
sharedObject::unref( m_sampleBuffer );
m_sampleBuffer = _sb;
m_sampleBuffer = sb;
updateLength();
emit sampleChanged();
@@ -101,7 +101,7 @@ void sampleTCO::setSampleBuffer( sampleBuffer * _sb )
void sampleTCO::setSampleFile( const QString & _sf )
void SampleTCO::setSampleFile( const QString & _sf )
{
m_sampleBuffer->setAudioFile( _sf );
updateLength();
@@ -112,7 +112,7 @@ void sampleTCO::setSampleFile( const QString & _sf )
void sampleTCO::toggleRecord()
void SampleTCO::toggleRecord()
{
m_recordModel.setValue( !m_recordModel.value() );
emit dataChanged();
@@ -121,7 +121,7 @@ void sampleTCO::toggleRecord()
void sampleTCO::updateLength( bpm_t )
void SampleTCO::updateLength( bpm_t )
{
changeLength( sampleLength() );
}
@@ -129,7 +129,7 @@ void sampleTCO::updateLength( bpm_t )
midiTime sampleTCO::sampleLength() const
midiTime SampleTCO::sampleLength() const
{
return (int)( m_sampleBuffer->frames() / engine::framesPerTick() );
}
@@ -137,7 +137,7 @@ midiTime sampleTCO::sampleLength() const
void sampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this )
void SampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
if( _this.parentNode().nodeName() == "clipboard" )
{
@@ -161,7 +161,7 @@ void sampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this )
void sampleTCO::loadSettings( const QDomElement & _this )
void SampleTCO::loadSettings( const QDomElement & _this )
{
if( _this.attribute( "pos" ).toInt() >= 0 )
{
@@ -179,9 +179,9 @@ void sampleTCO::loadSettings( const QDomElement & _this )
trackContentObjectView * sampleTCO::createView( trackView * _tv )
trackContentObjectView * SampleTCO::createView( trackView * _tv )
{
return new sampleTCOView( this, _tv );
return new SampleTCOView( this, _tv );
}
@@ -193,14 +193,14 @@ trackContentObjectView * sampleTCO::createView( trackView * _tv )
sampleTCOView::sampleTCOView( sampleTCO * _tco, trackView * _tv ) :
SampleTCOView::SampleTCOView( SampleTCO * _tco, trackView * _tv ) :
trackContentObjectView( _tco, _tv ),
m_tco( _tco )
{
// update UI and tooltip
updateSample();
// track future changes of sampleTCO
// track future changes of SampleTCO
connect( m_tco, SIGNAL( sampleChanged() ),
this, SLOT( updateSample() ) );
}
@@ -208,14 +208,14 @@ sampleTCOView::sampleTCOView( sampleTCO * _tco, trackView * _tv ) :
sampleTCOView::~sampleTCOView()
SampleTCOView::~SampleTCOView()
{
}
void sampleTCOView::updateSample()
void SampleTCOView::updateSample()
{
update();
// set tooltip to filename so that user can see what sample this
@@ -228,7 +228,7 @@ void sampleTCOView::updateSample()
void sampleTCOView::contextMenuEvent( QContextMenuEvent * _cme )
void SampleTCOView::contextMenuEvent( QContextMenuEvent * _cme )
{
QMenu contextMenu( this );
if( fixedTCOs() == false )
@@ -259,7 +259,7 @@ void sampleTCOView::contextMenuEvent( QContextMenuEvent * _cme )
void sampleTCOView::dragEnterEvent( QDragEnterEvent * _dee )
void SampleTCOView::dragEnterEvent( QDragEnterEvent * _dee )
{
if( stringPairDrag::processDragEnterEvent( _dee,
"samplefile,sampledata" ) == false )
@@ -271,7 +271,7 @@ void sampleTCOView::dragEnterEvent( QDragEnterEvent * _dee )
void sampleTCOView::dropEvent( QDropEvent * _de )
void SampleTCOView::dropEvent( QDropEvent * _de )
{
if( stringPairDrag::decodeKey( _de ) == "samplefile" )
{
@@ -296,7 +296,7 @@ void sampleTCOView::dropEvent( QDropEvent * _de )
void sampleTCOView::mousePressEvent( QMouseEvent * _me )
void SampleTCOView::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::LeftButton &&
_me->modifiers() & Qt::ControlModifier &&
@@ -313,7 +313,7 @@ void sampleTCOView::mousePressEvent( QMouseEvent * _me )
void sampleTCOView::mouseDoubleClickEvent( QMouseEvent * )
void SampleTCOView::mouseDoubleClickEvent( QMouseEvent * )
{
QString af = m_tco->m_sampleBuffer->openAudioFile();
if( af != "" && af != m_tco->m_sampleBuffer->audioFile() )
@@ -326,7 +326,7 @@ void sampleTCOView::mouseDoubleClickEvent( QMouseEvent * )
void sampleTCOView::paintEvent( QPaintEvent * _pe )
void SampleTCOView::paintEvent( QPaintEvent * _pe )
{
QPainter p( this );
@@ -385,8 +385,8 @@ void sampleTCOView::paintEvent( QPaintEvent * _pe )
sampleTrack::sampleTrack( TrackContainer* tc ) :
track( SampleTrack, tc ),
SampleTrack::SampleTrack( TrackContainer* tc ) :
track( track::SampleTrack, tc ),
m_audioPort( tr( "Sample track" ) ),
m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 1.0, this,
tr( "Volume" ) )
@@ -397,7 +397,7 @@ sampleTrack::sampleTrack( TrackContainer* tc ) :
sampleTrack::~sampleTrack()
SampleTrack::~SampleTrack()
{
engine::mixer()->removePlayHandles( this );
}
@@ -405,7 +405,7 @@ sampleTrack::~sampleTrack()
bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
bool SampleTrack::play( const midiTime & _start, const fpp_t _frames,
const f_cnt_t _offset,
Sint16 /*_tco_num*/ )
{
@@ -419,7 +419,7 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
{
continue;
}
sampleTCO * st = dynamic_cast<sampleTCO *>( tco );
SampleTCO * st = dynamic_cast<SampleTCO *>( tco );
if( !st->isMuted() )
{
playHandle * handle;
@@ -429,12 +429,12 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
{
return played_a_note;
}
sampleRecordHandle * smpHandle = new sampleRecordHandle( st );
SampleRecordHandle* smpHandle = new SampleRecordHandle( st );
handle = smpHandle;
}
else
{
samplePlayHandle * smpHandle = new samplePlayHandle( st );
SamplePlayHandle* smpHandle = new SamplePlayHandle( st );
smpHandle->setVolumeModel( &m_volumeModel );
handle = smpHandle;
}
@@ -453,23 +453,23 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
trackView * sampleTrack::createView( TrackContainerView* tcv )
trackView * SampleTrack::createView( TrackContainerView* tcv )
{
return new sampleTrackView( this, tcv );
return new SampleTrackView( this, tcv );
}
trackContentObject * sampleTrack::createTCO( const midiTime & )
trackContentObject * SampleTrack::createTCO( const midiTime & )
{
return new sampleTCO( this );
return new SampleTCO( this );
}
void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
void SampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
QDomElement & _this )
{
m_audioPort.effects()->saveState( _doc, _this );
@@ -482,7 +482,7 @@ void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
void SampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
{
QDomNode node = _this.firstChild();
m_audioPort.effects()->clear();
@@ -505,7 +505,7 @@ void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
sampleTrackView::sampleTrackView( sampleTrack * _t, TrackContainerView* tcv ) :
SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) :
trackView( _t, tcv )
{
setFixedHeight( 32 );
@@ -550,7 +550,7 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, TrackContainerView* tcv ) :
sampleTrackView::~sampleTrackView()
SampleTrackView::~SampleTrackView()
{
m_effWindow->deleteLater();
}
@@ -558,7 +558,7 @@ sampleTrackView::~sampleTrackView()
void sampleTrackView::showEffects()
void SampleTrackView::showEffects()
{
if( m_effWindow->isHidden() )
{
@@ -574,9 +574,9 @@ void sampleTrackView::showEffects()
void sampleTrackView::modelChanged()
void SampleTrackView::modelChanged()
{
sampleTrack * st = castModel<sampleTrack>();
SampleTrack * st = castModel<SampleTrack>();
m_volumeKnob->setModel( &st->m_volumeModel );
trackView::modelChanged();
@@ -584,5 +584,5 @@ void sampleTrackView::modelChanged()
#include "moc_sample_track.cxx"
#include "moc_SampleTrack.cxx"

View File

@@ -42,7 +42,7 @@
#include "piano_roll.h"
#include "TrackContainer.h"
#include "rename_dialog.h"
#include "sample_buffer.h"
#include "SampleBuffer.h"
#include "AudioSampleRecorder.h"
#include "song.h"
#include "tooltip.h"