<commit_before>/* 
 * Multicore Audio Graph Layer for Jamoma DSP
 * Creates a wrapper for TTAudioObjects that can be used to build an audio processing graph.
 * Copyright © 2010, <NAME>
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */

#include "TTMulticoreObject.h"
#include "TTMulticoreInlet.h"


// C Callback from any Multicore Source objects we are observing
void TTMulticoreSourceObserverCallback(TTMulticoreSourcePtr self, TTValue& arg)
{
	;
}


// Implementation for Multicore Source class

TTMulticoreSource::TTMulticoreSource() :
	mSourceObject(NULL),
	mOutletNumber(0),
	mCallbackHandler(NULL)
{
	TTObjectInstantiate(TT("Callback"), &mCallbackHandler, kTTValNONE);
	mCallbackHandler->setAttributeValue(TT("Function"), TTPtr(&TTMulticoreSourceObserverCallback));
	mCallbackHandler->setAttributeValue(TT("Baton"), TTPtr(this));
}


TTMulticoreSource::~TTMulticoreSource()
{
	if (mSourceObject)
		mSourceObject->unregisterObserverForNotifications(*mCallbackHandler);
	TTObjectRelease(&mCallbackHandler);
	
	mSourceObject = NULL;
	mOutletNumber = 0;
	mCallbackHandler = NULL;	
}


void TTMulticoreSource::connect(TTMulticoreObjectPtr anObject, TTUInt16 fromOutletNumber)
{
	mSourceObject = anObject;
	mOutletNumber = fromOutletNumber;
	
	// tell the source that is passed in that we want to watch it
	mSourceObject->registerObserverForNotifications(*mCallbackHandler);
}	
<commit_msg>TTMulticoreInlet: temporary hack to prevent crashes -- need to rewrite vectors to be vectors of pointers to avoid this kind of ambiguity in the code...<commit_after>/* 
 * Multicore Audio Graph Layer for Jamoma DSP
 * Creates a wrapper for TTAudioObjects that can be used to build an audio processing graph.
 * Copyright © 2010, <NAME>
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */

#include "TTMulticoreObject.h"
#include "TTMulticoreInlet.h"


// C Callback from any Multicore Source objects we are observing
void TTMulticoreSourceObserverCallback(TTMulticoreSourcePtr self, TTValue& arg)
{
	;
}


// Implementation for Multicore Source class

TTMulticoreSource::TTMulticoreSource() :
	mSourceObject(NULL),
	mOutletNumber(0),
	mCallbackHandler(NULL)
{
	TTObjectInstantiate(TT("Callback"), &mCallbackHandler, kTTValNONE);
	mCallbackHandler->setAttributeValue(TT("Function"), TTPtr(&TTMulticoreSourceObserverCallback));
	mCallbackHandler->setAttributeValue(TT("Baton"), TTPtr(this));
}


TTMulticoreSource::~TTMulticoreSource()
{
// FIXME: commenting out temporarily to avoid crashes
//	if (mSourceObject)
//		mSourceObject->unregisterObserverForNotifications(*mCallbackHandler);

	TTObjectRelease(&mCallbackHandler);
	
	mSourceObject = NULL;
	mOutletNumber = 0;
	mCallbackHandler = NULL;	
}


void TTMulticoreSource::connect(TTMulticoreObjectPtr anObject, TTUInt16 fromOutletNumber)
{
	mSourceObject = anObject;
	mOutletNumber = fromOutletNumber;
	
	// tell the source that is passed in that we want to watch it
	mSourceObject->registerObserverForNotifications(*mCallbackHandler);
}	

{'fraction_non_alphanumeric': 0.09412142627690331, 'fraction_numerical': 0.00513973658849984, 'mean_word_length': 5.997752808988764, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5813160', 'n_tokens_mistral': 993, 'n_tokens_neox': 943, 'n_words': 248}