less header-dependencies and moved some type-definitions

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1372 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-25 11:16:45 +00:00
parent fe55d0cdcc
commit 30756e7399
12 changed files with 78 additions and 50 deletions

View File

@@ -83,6 +83,7 @@ SET(LMMS_DATA_DIR ${DATA_DIR}/lmms)
CHECK_INCLUDE_FILES(stdint.h LMMS_HAVE_STDINT_H)
CHECK_INCLUDE_FILES(stdlib.h LMMS_HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(pthread.h LMMS_HAVE_PTHREAD_H)
CHECK_INCLUDE_FILES(unistd.h LMMS_HAVE_UNISTD_H)
CHECK_INCLUDE_FILES(sys/types.h LMMS_HAVE_SYS_TYPES_H)

View File

@@ -1,3 +1,18 @@
2008-07-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/organic/organic.cpp:
* plugins/triple_oscillator/triple_oscillator.cpp:
* include/mixer.h:
* include/sample_buffer.h:
* include/oscillator.h:
* include/types.h:
* src/core/sample_play_handle.cpp:
* src/core/sample_buffer.cpp:
* src/core/oscillator.cpp:
* lmmsconfig.h.in:
* CMakeLists.txt:
less header-dependencies and moved some type-definitions
2008-07-23 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* data/locale/fr.qm:

View File

@@ -57,21 +57,6 @@ class audioPort;
const fpp_t DEFAULT_BUFFER_SIZE = 256;
const ch_cnt_t DEFAULT_CHANNELS = 2;
const ch_cnt_t SURROUND_CHANNELS =
#ifndef LMMS_DISABLE_SURROUND
4;
#else
2;
#endif
typedef sample_t sampleFrame[DEFAULT_CHANNELS];
typedef sample_t surroundSampleFrame[SURROUND_CHANNELS];
const Uint8 BYTES_PER_SAMPLE = sizeof( sample_t );
const Uint8 BYTES_PER_INT_SAMPLE = sizeof( int_sample_t );
const Uint8 BYTES_PER_FRAME = sizeof( sampleFrame );

View File

@@ -28,15 +28,18 @@
#include "lmmsconfig.h"
#include <math.h>
#ifdef LMMS_HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "mixer.h"
#include "sample_buffer.h"
#include "lmms_constants.h"
#include "lmms_math.h"
#include "automatable_model.h"
class sampleBuffer;
class intModel;
class EXPORT oscillator
@@ -66,8 +69,8 @@ public:
} ;
oscillator( const intModel & _wave_shape_model,
const intModel & _mod_algo_model,
oscillator( const intModel * _wave_shape_model,
const intModel * _mod_algo_model,
const float & _freq,
const float & _detuning,
const float & _phase_offset,
@@ -154,8 +157,8 @@ public:
private:
const intModel & m_waveShapeModel;
const intModel & m_modulationAlgoModel;
const intModel * m_waveShapeModel;
const intModel * m_modulationAlgoModel;
const float & m_freq;
const float & m_detuning;
const float & m_volume;

View File

@@ -29,7 +29,9 @@
#include <QtCore/QObject>
#include <QtCore/QRect>
#include "mixer.h"
#include <samplerate.h>
#include "export.h"
#include "interpolation.h"
#include "types.h"
#include "lmms_math.h"
@@ -72,7 +74,7 @@ public:
bool play( sampleFrame * _ab, handleState * _state,
const fpp_t _frames,
const float _freq = BaseFreq,
const float _freq,
const bool _looped = FALSE ) const;
void visualize( QPainter & _p, const QRect & _dr, const QRect & _clip );

View File

@@ -27,6 +27,7 @@
#define _TYPES_H
#include <limits>
#include "lmmsconfig.h"
typedef unsigned char Uint8;
typedef signed char Sint8;
@@ -74,4 +75,19 @@ struct valueRanges
} ;
const ch_cnt_t DEFAULT_CHANNELS = 2;
const ch_cnt_t SURROUND_CHANNELS =
#ifndef LMMS_DISABLE_SURROUND
4;
#else
2;
#endif
typedef sample_t sampleFrame[DEFAULT_CHANNELS];
typedef sample_t surroundSampleFrame[SURROUND_CHANNELS];
#endif

View File

@@ -11,6 +11,7 @@
#cmakedefine LMMS_HAVE_VST
#cmakedefine LMMS_HAVE_STDINT_H
#cmakedefine LMMS_HAVE_STDLIB_H
#cmakedefine LMMS_HAVE_PTHREAD_H
#cmakedefine LMMS_HAVE_UNISTD_H
#cmakedefine LMMS_HAVE_SYS_TYPES_H

View File

@@ -206,16 +206,16 @@ void organicInstrument::playNote( notePlayHandle * _n, bool,
{
// create left oscillator
oscs_l[i] = new oscillator(
m_osc[i]->m_waveShape,
m_modulationAlgo,
&m_osc[i]->m_waveShape,
&m_modulationAlgo,
_n->frequency(),
m_osc[i]->m_detuningLeft,
m_osc[i]->m_phaseOffsetLeft,
m_osc[i]->m_volumeLeft );
// create right oscillator
oscs_r[i] = new oscillator(
m_osc[i]->m_waveShape,
m_modulationAlgo,
&m_osc[i]->m_waveShape,
&m_modulationAlgo,
_n->frequency(),
m_osc[i]->m_detuningRight,
m_osc[i]->m_phaseOffsetRight,
@@ -225,8 +225,8 @@ void organicInstrument::playNote( notePlayHandle * _n, bool,
{
// create left oscillator
oscs_l[i] = new oscillator(
m_osc[i]->m_waveShape,
m_modulationAlgo,
&m_osc[i]->m_waveShape,
&m_modulationAlgo,
_n->frequency(),
m_osc[i]->m_detuningLeft,
m_osc[i]->m_phaseOffsetLeft,
@@ -234,8 +234,8 @@ void organicInstrument::playNote( notePlayHandle * _n, bool,
oscs_l[i + 1] );
// create right oscillator
oscs_r[i] = new oscillator(
m_osc[i]->m_waveShape,
m_modulationAlgo,
&m_osc[i]->m_waveShape,
&m_modulationAlgo,
_n->frequency(),
m_osc[i]->m_detuningRight,
m_osc[i]->m_phaseOffsetRight,

View File

@@ -326,15 +326,15 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool,
if( i == NUM_OF_OSCILLATORS - 1 )
{
oscs_l[i] = new oscillator(
m_osc[i]->m_waveShapeModel,
m_osc[i]->m_modulationAlgoModel,
&m_osc[i]->m_waveShapeModel,
&m_osc[i]->m_modulationAlgoModel,
_n->frequency(),
m_osc[i]->m_detuningLeft,
m_osc[i]->m_phaseOffsetLeft,
m_osc[i]->m_volumeLeft );
oscs_r[i] = new oscillator(
m_osc[i]->m_waveShapeModel,
m_osc[i]->m_modulationAlgoModel,
&m_osc[i]->m_waveShapeModel,
&m_osc[i]->m_modulationAlgoModel,
_n->frequency(),
m_osc[i]->m_detuningRight,
m_osc[i]->m_phaseOffsetRight,
@@ -343,16 +343,16 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool,
else
{
oscs_l[i] = new oscillator(
m_osc[i]->m_waveShapeModel,
m_osc[i]->m_modulationAlgoModel,
&m_osc[i]->m_waveShapeModel,
&m_osc[i]->m_modulationAlgoModel,
_n->frequency(),
m_osc[i]->m_detuningLeft,
m_osc[i]->m_phaseOffsetLeft,
m_osc[i]->m_volumeLeft,
oscs_l[i + 1] );
oscs_r[i] = new oscillator(
m_osc[i]->m_waveShapeModel,
m_osc[i]->m_modulationAlgoModel,
&m_osc[i]->m_waveShapeModel,
&m_osc[i]->m_modulationAlgoModel,
_n->frequency(),
m_osc[i]->m_detuningRight,
m_osc[i]->m_phaseOffsetRight,

View File

@@ -26,11 +26,14 @@
#include "oscillator.h"
#include "engine.h"
#include "mixer.h"
#include "automatable_model.h"
oscillator::oscillator( const intModel & _wave_shape_model,
const intModel & _mod_algo_model,
oscillator::oscillator( const intModel * _wave_shape_model,
const intModel * _mod_algo_model,
const float & _freq,
const float & _detuning,
const float & _phase_offset,
@@ -62,7 +65,7 @@ void oscillator::update( sampleFrame * _ab, const fpp_t _frames,
}
if( m_subOsc != NULL )
{
switch( m_modulationAlgoModel.value() )
switch( m_modulationAlgoModel->value() )
{
case PhaseModulation:
updatePM( _ab, _frames, _chnl );
@@ -92,7 +95,7 @@ void oscillator::update( sampleFrame * _ab, const fpp_t _frames,
void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShapeModel.value() )
switch( m_waveShapeModel->value() )
{
case SineWave:
default:
@@ -128,7 +131,7 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShapeModel.value() )
switch( m_waveShapeModel->value() )
{
case SineWave:
default:
@@ -164,7 +167,7 @@ void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShapeModel.value() )
switch( m_waveShapeModel->value() )
{
case SineWave:
default:
@@ -200,7 +203,7 @@ void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShapeModel.value() )
switch( m_waveShapeModel->value() )
{
case SineWave:
default:
@@ -236,7 +239,7 @@ void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShapeModel.value() )
switch( m_waveShapeModel->value() )
{
case SineWave:
default:
@@ -272,7 +275,7 @@ void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
const ch_cnt_t _chnl )
{
switch( m_waveShapeModel.value() )
switch( m_waveShapeModel->value() )
{
case SineWave:
default:

View File

@@ -26,6 +26,7 @@
#include "sample_buffer.h"
#include "mixer.h"
#include <QtCore/QBuffer>

View File

@@ -132,7 +132,8 @@ void samplePlayHandle::play( bool /* _try_parallelizing */,
stereoVolumeVector v =
{ { m_volumeModel->value() / DefaultVolume,
m_volumeModel->value() / DefaultVolume } };
m_sampleBuffer->play( _working_buffer, &m_state, frames );
m_sampleBuffer->play( _working_buffer, &m_state, frames,
BaseFreq );
engine::getMixer()->bufferToPort( _working_buffer, frames,
offset(), v, m_audioPort );
}