* Added Flanger and AudioAdapter audio addons from Cortex to the build

* Actually I could only try if they build and work inside the vm, I do not have sound available somewhere, so could please someone test whether the results are reasonable? They cannot be added to the image until someone approves that they are working fine...
* got rid of most compiler warnings



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24636 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Maurice Kalinowski 2008-03-29 00:58:21 +00:00
parent f9fd198ee3
commit 083b91d4ba
25 changed files with 103 additions and 38 deletions

View File

@ -16,3 +16,5 @@ SubInclude HAIKU_TOP src apps cortex TipManager ;
SubInclude HAIKU_TOP src apps cortex TransportView ;
SubInclude HAIKU_TOP src apps cortex ValControl ;
SubInclude HAIKU_TOP src apps cortex support ;
SubInclude HAIKU_TOP src apps cortex addons ;

View File

@ -6,7 +6,7 @@
#include <ParameterWeb.h>
status_t
_AudioAdapterParams::store(parameterID, const void* data, size_t size)
_AudioAdapterParams::store(int32 parameterID, const void* data, size_t size)
{
if (size < sizeof(int32))
return B_NO_MEMORY;

View File

@ -0,0 +1,25 @@
SubDir HAIKU_TOP src apps cortex addons AudioAdapter ;
SubDirHdrs [ FDirName $(HAIKU_TOP) src apps cortex addons common ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) src apps cortex addons audioOps ] ;
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src apps cortex addons common ] ;
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src apps cortex addons audioOps ] ;
Addon cortex_audioadapter.media_addon :
AudioAdapterAddOn.cpp
AudioAdapterNode.cpp
AudioAdapterParams.cpp
# audioOps/
AudioAdapterOp.cpp
# common/
AudioBuffer.cpp
AudioFilterNode.cpp
IParameterSet.cpp
RawBuffer.cpp
SoundUtils.cpp
: be media
;

View File

@ -1449,7 +1449,7 @@ void FlangerNode::filterBuffer(
if(readFrameLo != (int32)fReadFrame) {
// interpolate (A)
int32 readFrameHi = (int32)ceil(fReadFrame);
uint32 readFrameHi = (int32)ceil(fReadFrame);
delayedFrame.channel[0] *= ((float)readFrameHi - fReadFrame);
if(stereo)
delayedFrame.channel[1] *= ((float)readFrameHi - fReadFrame);

View File

@ -0,0 +1,15 @@
SubDir HAIKU_TOP src apps cortex addons Flanger ;
SubDirHdrs [ FDirName $(HAIKU_TOP) src apps cortex addons common ] ;
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src apps cortex addons common ] ;
Addon cortex_flanger.media_addon :
FlangerApp.cpp
FlangerAddOn.cpp
FlangerNode.cpp
AudioBuffer.cpp
MediaNodeControlApp.cpp
RawBuffer.cpp
SoundUtils.cpp
: be media
: Resource.rsrc
;

View File

@ -0,0 +1,7 @@
SubDir HAIKU_TOP src apps cortex addons ;
SetSubDirSupportedPlatformsBeOSCompatible ;
SubInclude HAIKU_TOP src apps cortex addons AudioAdapter ;
SubInclude HAIKU_TOP src apps cortex addons Flanger ;

View File

@ -279,7 +279,7 @@ uint32 AudioBuffer::findMin(uint32 fromFrame, uint32 frameCount,
n = 0;
}
float fCur;
float fCur = 0;
convert_sample(pCur, fCur, m_format.format);
if(fCur < pMin[n % channels]) {
@ -332,7 +332,7 @@ uint32 AudioBuffer::findMax(uint32 fromFrame, uint32 frameCount,
n = 0;
}
float fCur;
float fCur = 0;
convert_sample(pCur, fCur, m_format.format);
if(fCur > pMax[n % channels]) {
@ -384,7 +384,7 @@ uint32 AudioBuffer::findPeaks(uint32 fromFrame, uint32 frameCount,
n = 0;
}
float fCur;
float fCur = 0;
convert_sample(pCur, fCur, m_format.format);
if(fabs(fCur) > pPeaks[n % channels]) {
@ -437,7 +437,7 @@ uint32 AudioBuffer::average(uint32 fromFrame, uint32 frameCount,
n = 0;
}
float fCur;
float fCur = 0;
convert_sample(pCur, fCur, m_format.format);
pAverage[n%channels] += fCur;

View File

@ -595,7 +595,10 @@ void AudioFilterNode::Disconnected(
// mark disconnected
m_input.source = media_source::null;
status_t err = getRequiredInputFormat(m_input.format);
#ifdef DEBUG
status_t err =
#endif
getRequiredInputFormat(m_input.format);
ASSERT(err == B_OK);
// remove operation
@ -823,7 +826,10 @@ void AudioFilterNode::Disconnect(
// clean up
m_output.destination = media_destination::null;
status_t err = getRequiredOutputFormat(m_output.format);
#ifdef DEBUG
status_t err =
#endif
getRequiredOutputFormat(m_output.format);
ASSERT(err == B_OK);
updateBufferGroup();

View File

@ -105,7 +105,10 @@ public: // *** HOOKS
media_format preferred;
preferred.type = B_MEDIA_RAW_AUDIO;
status_t err = getPreferredInputFormat(preferred);
#ifdef DEBUG
status_t err =
#endif
getPreferredInputFormat(preferred);
ASSERT(err == B_OK);
_specialize_raw_audio_format(preferred, ioFormat);
}
@ -121,7 +124,10 @@ public: // *** HOOKS
media_format preferred;
preferred.type = B_MEDIA_RAW_AUDIO;
status_t err = getPreferredOutputFormat(preferred);
#ifdef DEBUG
status_t err =
#endif
getPreferredOutputFormat(preferred);
ASSERT(err == B_OK);
string_for_format(preferred, fmt_buffer, 255);

View File

@ -11,6 +11,7 @@ class IParameterSet;
class IAudioOpHost {
public: // *** REQUIRED INTERFACE
virtual ~IAudioOpHost() { }
virtual IParameterSet* parameterSet() const =0;
};

View File

@ -10,6 +10,7 @@
#ifndef __IParameterSet_H__
#define __IParameterSet_H__
#include <ParameterWeb.h>
#include <SupportDefs.h>
class IParameterSet {

View File

@ -19,12 +19,13 @@ RawBuffer::RawBuffer(
rtm_pool* pFromPool) :
m_pData(0),
m_allocatedSize(0),
m_pPool(pFromPool),
m_frameSize(frameSize),
m_frames(frames),
m_allocatedSize(0),
m_bCircular(bCircular),
m_bOwnData(true),
m_pPool(pFromPool) {
m_bOwnData(true)
{
if(m_frames)
resize(m_frames);
@ -40,12 +41,13 @@ RawBuffer::RawBuffer(
rtm_pool* pFromPool) :
m_pData(pData),
m_allocatedSize(0),
m_pPool(pFromPool),
m_frameSize(frameSize),
m_frames(frames),
m_bOwnData(false),
m_allocatedSize(0),
m_bCircular(bCircular),
m_pPool(pFromPool) {}
m_bOwnData(false)
{}
RawBuffer::RawBuffer(const RawBuffer& clone) {
operator=(clone);

View File

@ -136,7 +136,7 @@ inline void convert_sample(void* pIn, void* pOut,
else {
// two-step cases
float fTemp;
float fTemp = 0;
convert_sample(pIn, fTemp, in_audio_format);
convert_sample(fTemp, pOut, out_audio_format);
}