/* this file was generated by the MCOP idl compiler - DO NOT EDIT */

#include "Equalizer.h"

// Implementation
Arts::Equalizer_base *Arts::Equalizer_base::_create(const std::string& subClass)
{
	Arts::Object_skel *skel = Arts::ObjectManager::the()->create(subClass);
	assert(skel);
	Arts::Equalizer_base *castedObject = (Arts::Equalizer_base *)skel->_cast(Arts::Equalizer_base::_IID);
	assert(castedObject);
	return castedObject;
}

Arts::Equalizer_base *Arts::Equalizer_base::_fromString(std::string objectref)
{
	Arts::ObjectReference r;

	if(Arts::Dispatcher::the()->stringToObjectReference(r,objectref))
		return Arts::Equalizer_base::_fromReference(r,true);
	return 0;
}

Arts::Equalizer_base *Arts::Equalizer_base::_fromReference(Arts::ObjectReference r, bool needcopy)
{
	Arts::Equalizer_base *result;
	result = (Arts::Equalizer_base *)Arts::Dispatcher::the()->connectObjectLocal(r,"Arts::Equalizer");
	if(result)
	{
		if(!needcopy)
			result->_cancelCopyRemote();
	}
	else
	{
		Arts::Connection *conn = Arts::Dispatcher::the()->connectObjectRemote(r);
		if(conn)
		{
			result = new Arts::Equalizer_stub(conn,r.objectID);
			if(needcopy) result->_copyRemote();
			result->_useRemote();
			if (!result->_isCompatibleWith("Arts::Equalizer")) {
				result->_release();
				return 0;
			}
		}
	}
	return result;
}

std::vector<std::string> Arts::Equalizer_base::_defaultPortsIn() const {
	std::vector<std::string> ret;
	ret.push_back("inleft");
	ret.push_back("inright");
	return ret;
}
std::vector<std::string> Arts::Equalizer_base::_defaultPortsOut() const {
	std::vector<std::string> ret;
	ret.push_back("outleft");
	ret.push_back("outright");
	return ret;
}

void *Arts::Equalizer_base::_cast(unsigned long iid)
{
	if(iid == Arts::Equalizer_base::_IID) return (Arts::Equalizer_base *)this;
	if(iid == Arts::StereoEffect_base::_IID) return (Arts::StereoEffect_base *)this;
	if(iid == Arts::SynthModule_base::_IID) return (Arts::SynthModule_base *)this;
	if(iid == Arts::Object_base::_IID) return (Arts::Object_base *)this;
	return 0;
}

Arts::Equalizer_stub::Equalizer_stub()
{
	// constructor for subclasses (don't use directly)
}

Arts::Equalizer_stub::Equalizer_stub(Arts::Connection *connection, long objectID)
	: Arts::Object_stub(connection, objectID)
{
	// constructor to create a stub for an object
}

void Arts::Equalizer_stub::set(const std::vector<float>& levels, const std::vector<float>& centers, const std::vector<float>& widths)
{
	long methodID = _lookupMethodFast("method:000000047365740000000005766f6964000000000200000003000000072a666c6f617400000000076c6576656c730000000000000000072a666c6f6174000000000863656e746572730000000000000000072a666c6f61740000000007776964746873000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeFloatSeq(levels);
	request->writeFloatSeq(centers);
	request->writeFloatSeq(widths);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

std::vector<float> * Arts::Equalizer_stub::levelCenters()
{
	long methodID = _lookupMethodFast("method:000000125f6765745f6c6576656c43656e7465727300000000072a666c6f617400000000020000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	std::vector<float> *_returnCode = new std::vector<float>;
	if(!result) return _returnCode; // error occured
	result->readFloatSeq(*_returnCode);
	delete result;
	return _returnCode;
}

void Arts::Equalizer_stub::levelCenters(const std::vector<float>& newValue)
{
	long methodID = _lookupMethodFast("method:000000125f7365745f6c6576656c43656e746572730000000005766f6964000000000200000001000000072a666c6f617400000000096e657756616c7565000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeFloatSeq(newValue);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

std::vector<float> * Arts::Equalizer_stub::levelWidths()
{
	long methodID = _lookupMethodFast("method:000000115f6765745f6c6576656c57696474687300000000072a666c6f617400000000020000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	std::vector<float> *_returnCode = new std::vector<float>;
	if(!result) return _returnCode; // error occured
	result->readFloatSeq(*_returnCode);
	delete result;
	return _returnCode;
}

void Arts::Equalizer_stub::levelWidths(const std::vector<float>& newValue)
{
	long methodID = _lookupMethodFast("method:000000115f7365745f6c6576656c5769647468730000000005766f6964000000000200000001000000072a666c6f617400000000096e657756616c7565000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeFloatSeq(newValue);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

std::vector<float> * Arts::Equalizer_stub::levels()
{
	long methodID = _lookupMethodFast("method:0000000c5f6765745f6c6576656c7300000000072a666c6f617400000000020000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	std::vector<float> *_returnCode = new std::vector<float>;
	if(!result) return _returnCode; // error occured
	result->readFloatSeq(*_returnCode);
	delete result;
	return _returnCode;
}

void Arts::Equalizer_stub::levels(const std::vector<float>& newValue)
{
	long methodID = _lookupMethodFast("method:0000000c5f7365745f6c6576656c730000000005766f6964000000000200000001000000072a666c6f617400000000096e657756616c7565000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeFloatSeq(newValue);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

long Arts::Equalizer_stub::bands()
{
	long methodID = _lookupMethodFast("method:0000000b5f6765745f62616e647300000000056c6f6e6700000000020000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(!result) return 0; // error occured
	long returnCode = result->readLong();
	delete result;
	return returnCode;
}

void Arts::Equalizer_stub::bands(long newValue)
{
	long methodID = _lookupMethodFast("method:0000000b5f7365745f62616e64730000000005766f6964000000000200000001000000056c6f6e6700000000096e657756616c7565000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeLong(newValue);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

long Arts::Equalizer_stub::enabled()
{
	long methodID = _lookupMethodFast("method:0000000d5f6765745f656e61626c656400000000056c6f6e6700000000020000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(!result) return 0; // error occured
	long returnCode = result->readLong();
	delete result;
	return returnCode;
}

void Arts::Equalizer_stub::enabled(long newValue)
{
	long methodID = _lookupMethodFast("method:0000000d5f7365745f656e61626c65640000000005766f6964000000000200000001000000056c6f6e6700000000096e657756616c7565000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeLong(newValue);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

float Arts::Equalizer_stub::preamp()
{
	long methodID = _lookupMethodFast("method:0000000c5f6765745f707265616d700000000006666c6f617400000000020000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(!result) return 0.0; // error occured
	float returnCode = result->readFloat();
	delete result;
	return returnCode;
}

void Arts::Equalizer_stub::preamp(float newValue)
{
	long methodID = _lookupMethodFast("method:0000000c5f7365745f707265616d700000000005766f696400000000020000000100000006666c6f617400000000096e657756616c7565000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeFloat(newValue);
	request->patchLength();
	_connection->qSendBuffer(request);

	result = Arts::Dispatcher::the()->waitForResult(requestID,_connection);
	if(result) delete result;
}

std::string Arts::Equalizer_skel::_interfaceName()
{
	return "Arts::Equalizer";
}

bool Arts::Equalizer_skel::_isCompatibleWith(const std::string& interfacename)
{
	if (interfacename == "Arts::Equalizer") return true;
	if (interfacename == "Arts::StereoEffect") return true;
	if (interfacename == "Arts::SynthModule") return true;
	if (interfacename == "Arts::Object") return true;
	return false;
}

std::string Arts::Equalizer_skel::_interfaceNameSkel()
{
	return "Arts::Equalizer";
}

// set
static void _dispatch_Arts_Equalizer_00(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	vector<float> levels;
	request->readFloatSeq(levels);
	vector<float> centers;
	request->readFloatSeq(centers);
	vector<float> widths;
	request->readFloatSeq(widths);
	((Arts::Equalizer_skel *)object)->set(levels,centers,widths);
}

// _get_levelCenters
static void _dispatch_Arts_Equalizer_01(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	std::vector<float> *_returnCode = ((Arts::Equalizer_skel *)object)->levelCenters();
	result->writeFloatSeq(*_returnCode);
	delete _returnCode;
}

// _set_levelCenters
static void _dispatch_Arts_Equalizer_02(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	vector<float> newValue;
	request->readFloatSeq(newValue);
	((Arts::Equalizer_skel *)object)->levelCenters(newValue);
}

// _get_levelWidths
static void _dispatch_Arts_Equalizer_03(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	std::vector<float> *_returnCode = ((Arts::Equalizer_skel *)object)->levelWidths();
	result->writeFloatSeq(*_returnCode);
	delete _returnCode;
}

// _set_levelWidths
static void _dispatch_Arts_Equalizer_04(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	vector<float> newValue;
	request->readFloatSeq(newValue);
	((Arts::Equalizer_skel *)object)->levelWidths(newValue);
}

// _get_levels
static void _dispatch_Arts_Equalizer_05(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	std::vector<float> *_returnCode = ((Arts::Equalizer_skel *)object)->levels();
	result->writeFloatSeq(*_returnCode);
	delete _returnCode;
}

// _set_levels
static void _dispatch_Arts_Equalizer_06(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	vector<float> newValue;
	request->readFloatSeq(newValue);
	((Arts::Equalizer_skel *)object)->levels(newValue);
}

// _get_bands
static void _dispatch_Arts_Equalizer_07(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	result->writeLong(((Arts::Equalizer_skel *)object)->bands());
}

// _set_bands
static void _dispatch_Arts_Equalizer_08(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	long newValue = request->readLong();
	((Arts::Equalizer_skel *)object)->bands(newValue);
}

// _get_enabled
static void _dispatch_Arts_Equalizer_09(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	result->writeLong(((Arts::Equalizer_skel *)object)->enabled());
}

// _set_enabled
static void _dispatch_Arts_Equalizer_10(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	long newValue = request->readLong();
	((Arts::Equalizer_skel *)object)->enabled(newValue);
}

// _get_preamp
static void _dispatch_Arts_Equalizer_11(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	result->writeFloat(((Arts::Equalizer_skel *)object)->preamp());
}

// _set_preamp
static void _dispatch_Arts_Equalizer_12(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	float newValue = request->readFloat();
	((Arts::Equalizer_skel *)object)->preamp(newValue);
}

void Arts::Equalizer_skel::_buildMethodTable()
{
	Arts::Buffer m;
	m.fromString(
        "MethodTable:000000047365740000000005766f69640000000002000000030000"
        "00072a666c6f617400000000076c6576656c730000000000000000072a666c6f61"
        "74000000000863656e746572730000000000000000072a666c6f61740000000007"
        "776964746873000000000000000000000000125f6765745f6c6576656c43656e74"
        "65727300000000072a666c6f617400000000020000000000000000000000125f73"
        "65745f6c6576656c43656e746572730000000005766f6964000000000200000001"
        "000000072a666c6f617400000000096e657756616c756500000000000000000000"
        "0000115f6765745f6c6576656c57696474687300000000072a666c6f6174000000"
        "00020000000000000000000000115f7365745f6c6576656c576964746873000000"
        "0005766f6964000000000200000001000000072a666c6f617400000000096e6577"
        "56616c75650000000000000000000000000c5f6765745f6c6576656c7300000000"
        "072a666c6f6174000000000200000000000000000000000c5f7365745f6c657665"
        "6c730000000005766f6964000000000200000001000000072a666c6f6174000000"
        "00096e657756616c75650000000000000000000000000b5f6765745f62616e6473"
        "00000000056c6f6e67000000000200000000000000000000000b5f7365745f6261"
        "6e64730000000005766f6964000000000200000001000000056c6f6e6700000000"
        "096e657756616c75650000000000000000000000000d5f6765745f656e61626c65"
        "6400000000056c6f6e67000000000200000000000000000000000d5f7365745f65"
        "6e61626c65640000000005766f6964000000000200000001000000056c6f6e6700"
        "000000096e657756616c75650000000000000000000000000c5f6765745f707265"
        "616d700000000006666c6f6174000000000200000000000000000000000c5f7365"
        "745f707265616d700000000005766f696400000000020000000100000006666c6f"
        "617400000000096e657756616c7565000000000000000000",
		"MethodTable"
	);
	_addMethod(_dispatch_Arts_Equalizer_00,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_01,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_02,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_03,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_04,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_05,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_06,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_07,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_08,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_09,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_10,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_11,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_Equalizer_12,this,Arts::MethodDef(m));
	Arts::StereoEffect_skel::_buildMethodTable();
}

Arts::Equalizer_skel::Equalizer_skel()
{
}

Arts::Object_base* Arts::Equalizer::_Creator() {
	return Arts::Equalizer_base::_create();
}

unsigned long Arts::Equalizer_base::_IID = Arts::MCOPUtils::makeIID("Arts::Equalizer");

static Arts::IDLFileReg IDLFileReg_Equalizer("Equalizer",
    "IDLFile:000000010000000000000000000000000100000010417274733a3a45717561"
    "6c697a6572000000000100000013417274733a3a53746572656f456666656374000000"
    "0001000000047365740000000005766f6964000000000200000003000000072a666c6f"
    "617400000000076c6576656c730000000000000000072a666c6f617400000000086365"
    "6e746572730000000000000000072a666c6f6174000000000777696474687300000000"
    "0000000000000000060000000d6c6576656c43656e7465727300000000072a666c6f61"
    "740000000013000000000000000c6c6576656c57696474687300000000072a666c6f61"
    "74000000001300000000000000076c6576656c7300000000072a666c6f617400000000"
    "13000000000000000662616e647300000000056c6f6e67000000001300000000000000"
    "08656e61626c656400000000056c6f6e6700000000130000000000000007707265616d"
    "700000000006666c6f6174000000001300000000000000000000000000000000"
);
