From 6c1cc640d8f70126936e817b0b7ddcb471fa0672 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 3 Apr 2008 20:18:32 +0000 Subject: [PATCH] added stereoVolumeVector and surroundVolumeVector-declarations git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@870 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/volume.h | 20 ++++++++++++++++++++ src/core/sample_play_handle.cpp | 9 ++------- src/core/surround_area.cpp | 4 ++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/include/volume.h b/include/volume.h index 3c174f220..68a00b6fd 100644 --- a/include/volume.h +++ b/include/volume.h @@ -26,10 +26,30 @@ #ifndef _VOLUME_H #define _VOLUME_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include "types.h" const volume MinVolume = 0; const volume MaxVolume = 200; const volume DefaultVolume = 100; +typedef struct +{ + float vol[2]; +} stereoVolumeVector; + + +typedef struct +{ +#ifndef DISABLE_SURROUND + float vol[4]; +#else + float vol[2]; +#endif +} surroundVolumeVector; + + #endif diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index fbb7a5c9f..4af9e3a13 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -129,13 +129,8 @@ void samplePlayHandle::play( bool /* _try_parallelizing */ ) && !( m_bbTrack && m_bbTrack->muted() ) ) { sampleFrame * buf = new sampleFrame[frames]; - volumeVector v = { { m_volumeModel->value(), - m_volumeModel->value() -#ifndef DISABLE_SURROUND - , m_volumeModel->value(), - m_volumeModel->value() -#endif - } } ; + stereoVolumeVector v = { { m_volumeModel->value(), + m_volumeModel->value() } }; m_sampleBuffer->play( buf, &m_state, frames ); engine::getMixer()->bufferToPort( buf, frames, offset(), v, m_audioPort ); diff --git a/src/core/surround_area.cpp b/src/core/surround_area.cpp index cb98ba06f..e2a22fe6f 100644 --- a/src/core/surround_area.cpp +++ b/src/core/surround_area.cpp @@ -202,9 +202,9 @@ surroundAreaModel::surroundAreaModel( ::model * _parent, track * _track, -volumeVector surroundAreaModel::getVolumeVector( float _v_scale ) const +surroundVolumeVector surroundAreaModel::getVolumeVector( float _v_scale ) const { - volumeVector v = { { _v_scale, _v_scale + surroundVolumeVector v = { { _v_scale, _v_scale #ifndef DISABLE_SURROUND , _v_scale, _v_scale #endif