<commit_before>/** @file
 *
 * @ingroup dspLibrary
 *
 * @brief #TTAudioObjectBase is the Jamoma DSP Audio Object Base Class
 *
 * @details
 *
 * @authors <NAME>, <NAME>, <NAME>
 *
 * @copyright Copyright © 2008 by <NAME> @n
 * This code is licensed under the terms of the "New BSD License" @n
 * http://creativecommons.org/licenses/BSD/
 */


#ifndef __TT_AUDIO_OBJECT_H__
#define __TT_AUDIO_OBJECT_H__

#include "TTObject.h"
#include "TTAudioObjectBase.h"


/** Wrap TTAudioSignal instances for convenience. */
class TTAudio : public TTObject {
public:
	TTAudio(int aChannelCount):
	TTObject(kTTSym_audiosignal, aChannelCount)
	{}
	
	TTAudioSignalPtr instance()
	{
		return (TTAudioSignalPtr)mObjectInstance;
	}
	
	int getVectorSizeAsInt()
	{
		return instance()->getVectorSizeAsInt();
	}
	
	void setVectorSizeWithInt(int aVectorSize)
	{
		instance()->setVectorSizeWithInt(aVectorSize);
	}
	
	void alloc()
	{
		instance()->alloc();
	}
	
	TTErr allocWithVectorSize(const TTUInt16 aNewVectorSize)
	{
		return instance()->allocWithVectorSize(aNewVectorSize);
	}
	
	void setNumChannels(int aChannelCount)
	{
		instance()->setNumChannels(aChannelCount);
	}
	
	
	TTErr setVector(const TTUInt16 channel, const TTUInt16 vectorSize, const TTSampleValuePtr newVector)
	{
		return instance()->setVector(channel, vectorSize, newVector);
	}
	
	
	TTErr getVectorCopy(const TTUInt16 channel, const TTUInt16 theVectorSize, TTSampleValue* returnedVector)
	{
		return instance()->getVectorCopy(channel, theVectorSize, returnedVector);
	}
	
	
	TTSampleValue** rawSamples()
	{
		return instance()->mSampleVectors;
	}
	
	void clear()
	{
		instance()->clear();
	}
	
};


inline TTErr TTAudioObjectBase::process(TTAudio& inputs, TTAudio& outputs)
{
	return process(inputs.instance(), outputs.instance());
}


/** Wrap audio objects for convenience. */
class TTAudioObject : public TTObject {
	
public:
	TTAudioObject(const TTSymbol aClassName, const TTValue arguments = kTTValNONE):
	TTObject(aClassName, arguments)
	{}
	
	// copy constructor is fully implemented in the super-class
	
	/** like a copy constructor -- but from TTObject to TTAudioObject */
	TTAudioObject(const TTObject& anOtherObject) :
	TTObject(anOtherObject)
	{}
	
	
	/**	Set the object's sample rate. */
	TTErr setSampleRate(const TTUInt32& newSampleRate)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->setSampleRate(newSampleRate);
	}

	
	/** Allocate neccessary memory and make configuration adjustments so the object is able
		to process additional channels of audio. */
	TTErr adaptMaxChannelCount(const TTUInt16 aNewChannelCount)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->adaptMaxNumChannels(aNewChannelCount);
	}

	
	TTErr process(TTAudioSignalArrayPtr in, TTAudioSignalArrayPtr out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(in, out);
	}
	
	TTErr process(TTAudioSignal& in, TTAudioSignal& out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(in, out);
	}
	
	TTErr process(TTAudio* in, TTAudio* out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(in->instance(), out->instance());
	}
	
	<commit_msg>TTAudioObject: adding a method to make it easier to transition old objects to the new api.<commit_after>/** @file
 *
 * @ingroup dspLibrary
 *
 * @brief #TTAudioObjectBase is the Jamoma DSP Audio Object Base Class
 *
 * @details
 *
 * @authors <NAME>, <NAME>, <NAME>
 *
 * @copyright Copyright © 2008 by <NAME> @n
 * This code is licensed under the terms of the "New BSD License" @n
 * http://creativecommons.org/licenses/BSD/
 */


#ifndef __TT_AUDIO_OBJECT_H__
#define __TT_AUDIO_OBJECT_H__

#include "TTObject.h"
#include "TTAudioObjectBase.h"


/** Wrap TTAudioSignal instances for convenience. */
class TTAudio : public TTObject {
public:
	TTAudio(int aChannelCount):
	TTObject(kTTSym_audiosignal, aChannelCount)
	{}
	
	TTAudioSignalPtr instance()
	{
		return (TTAudioSignalPtr)mObjectInstance;
	}
	
	int getVectorSizeAsInt()
	{
		return instance()->getVectorSizeAsInt();
	}
	
	void setVectorSizeWithInt(int aVectorSize)
	{
		instance()->setVectorSizeWithInt(aVectorSize);
	}
	
	void alloc()
	{
		instance()->alloc();
	}
	
	TTErr allocWithVectorSize(const TTUInt16 aNewVectorSize)
	{
		return instance()->allocWithVectorSize(aNewVectorSize);
	}
	
	void setNumChannels(int aChannelCount)
	{
		instance()->setNumChannels(aChannelCount);
	}
	
	
	TTErr setVector(const TTUInt16 channel, const TTUInt16 vectorSize, const TTSampleValuePtr newVector)
	{
		return instance()->setVector(channel, vectorSize, newVector);
	}
	
	
	TTErr getVectorCopy(const TTUInt16 channel, const TTUInt16 theVectorSize, TTSampleValue* returnedVector)
	{
		return instance()->getVectorCopy(channel, theVectorSize, returnedVector);
	}
	
	
	TTSampleValue** rawSamples()
	{
		return instance()->mSampleVectors;
	}
	
	void clear()
	{
		instance()->clear();
	}
	
};


inline TTErr TTAudioObjectBase::process(TTAudio& inputs, TTAudio& outputs)
{
	return process(inputs.instance(), outputs.instance());
}


/** Wrap audio objects for convenience. */
class TTAudioObject : public TTObject {
	
public:
	TTAudioObject(const TTSymbol aClassName, const TTValue arguments = kTTValNONE):
	TTObject(aClassName, arguments)
	{}
	
	// copy constructor is fully implemented in the super-class
	
	/** like a copy constructor -- but from TTObject to TTAudioObject */
	TTAudioObject(const TTObject& anOtherObject) :
	TTObject(anOtherObject)
	{}
	
	
	/**	Set the object's sample rate. */
	TTErr setSampleRate(const TTUInt32& newSampleRate)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->setSampleRate(newSampleRate);
	}

	
	/** Allocate neccessary memory and make configuration adjustments so the object is able
		to process additional channels of audio. */
	TTErr adaptMaxChannelCount(const TTUInt16 aNewChannelCount)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->adaptMaxNumChannels(aNewChannelCount);
	}


	TTErr process(TTAudioSignal& out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(out);
	}
	

	TTErr process(TTAudioSignalArrayPtr in, TTAudioSignalArrayPtr out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(in, out);
	}
	
	TTErr process(TTAudioSignal& in, TTAudioSignal& out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(in, out);
	}
	
	TTErr process(TTAudio* in, TTAudio* out)
	{
		return TTAudioObjectBasePtr(mObjectInstance)->process(in->instance(), out->instance());
	}
	
	
{'fraction_non_alphanumeric': 0.10725453408380238, 'fraction_numerical': 0.005628517823639775, 'mean_word_length': 5.115678776290631, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1867020', 'n_tokens_mistral': 2242, 'n_tokens_neox': 2055, 'n_words': 478}