* 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

@ -102,4 +102,4 @@ status_t AudioAdapterAddOn::GetConfigurationFor(
}
// END -- AudioAdapterAddOn.cpp --
// END -- AudioAdapterAddOn.cpp --

View File

@ -500,4 +500,4 @@ _AudioAdapterNode::_broadcastOutputFormatParams()
// END -- AudioAdapterNode.cpp --
// END -- AudioAdapterNode.cpp --

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

@ -88,4 +88,4 @@ status_t FlangerAddOn::GetConfigurationFor(
return B_OK;
}
// END -- FlangerAddOn.h --
// END -- FlangerAddOn.h --

View File

@ -42,4 +42,4 @@ virtual status_t AutoStart(
bool * out_has_more) { return B_OK; }
};
#endif /*__FlangerAddOn_H__*/
#endif /*__FlangerAddOn_H__*/

View File

@ -22,4 +22,4 @@ int main(int argc, char** argv) {
return 0;
}
// END -- FlangerApp.cpp --
// END -- FlangerApp.cpp --

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

@ -666,4 +666,4 @@ IParameterSet* AudioAdapterOpFactory::createParameterSet() {
}
// END -- AudioAdapterOp.cpp --
// END -- AudioAdapterOp.cpp --

View File

@ -25,4 +25,4 @@ public: // *** INTERFACE
IParameterSet* createParameterSet(); //nyi
};
#endif /*__AudioAdapterOp_H__*/
#endif /*__AudioAdapterOp_H__*/

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;
@ -453,4 +453,4 @@ uint32 AudioBuffer::average(uint32 fromFrame, uint32 frameCount,
// -------------------------------------------------------- //
// END -- AudioBuffer.h --
// END -- AudioBuffer.h --

View File

@ -142,4 +142,4 @@ protected: // members
media_raw_audio_format m_format;
};
#endif /* __AudioBuffer_H__ */
#endif /* __AudioBuffer_H__ */

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
@ -819,13 +822,16 @@ void AudioFilterNode::Disconnect(
PRINT(("\tbad destination\n"));
return;
}
// 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();
if(m_op) {
@ -1512,4 +1518,4 @@ void AudioFilterNode::processBuffer(
// PRINT(("### output size: %ld\n", outputBuffer->Header()->size_used));
}
// END -- AudioFilterNode.cpp --
// END -- AudioFilterNode.cpp --

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);
@ -469,4 +475,4 @@ private: // *** add-on stuff
BMediaAddOn* m_addOn;
};
#endif /*__AudioFilterNode_H__*/
#endif /*__AudioFilterNode_H__*/

View File

@ -45,4 +45,4 @@ public: // *** HOOKS
};
#endif /*__IAudioFilterOpFactory_H__*/
#endif /*__IAudioFilterOpFactory_H__*/

View File

@ -87,4 +87,4 @@ public: // *** OPTIONAL INTERFACE
};
#endif /*__IAudioOp_H__*/
#endif /*__IAudioOp_H__*/

View File

@ -50,4 +50,4 @@ public: // *** HOOKS
virtual ~IAudioOpFactory() {}
};
#endif /*__IAudioOpFactory_H__*/
#endif /*__IAudioOpFactory_H__*/

View File

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

View File

@ -10,6 +10,7 @@
#ifndef __IParameterSet_H__
#define __IParameterSet_H__
#include <ParameterWeb.h>
#include <SupportDefs.h>
class IParameterSet {
@ -63,4 +64,4 @@ private: // *** IMPLEMENTATION
// map of parameter ID -> change time +++++
};
#endif /*__IParameterSet_H__*/
#endif /*__IParameterSet_H__*/

View File

@ -29,4 +29,4 @@ private: // members
media_node m_node;
};
#endif /*__MediaNodeControlApp_H__*/
#endif /*__MediaNodeControlApp_H__*/

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);
@ -289,4 +291,4 @@ void RawBuffer::free() {
}
// END -- RawBuffer.cpp --
// END -- RawBuffer.cpp --

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);
}