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

#include "StereoEffectStack_Noatun.h"

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

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

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

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

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

void *Arts::StereoEffectStack_Noatun_base::_cast(unsigned long iid)
{
	if(iid == Arts::StereoEffectStack_Noatun_base::_IID) return (Arts::StereoEffectStack_Noatun_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::StereoEffectStack_Noatun_stub::StereoEffectStack_Noatun_stub()
{
	// constructor for subclasses (don't use directly)
}

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

long Arts::StereoEffectStack_Noatun_stub::insertAfter(long after, Arts::StereoEffect effect, const std::string& name)
{
	long methodID = _lookupMethodFast("method:0000000c696e73657274416674657200000000056c6f6e67000000000200000003000000056c6f6e6700000000066166746572000000000000000013417274733a3a53746572656f4566666563740000000007656666656374000000000000000007737472696e6700000000056e616d65000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeLong(after);
	Arts::writeObject(*request,effect._base());
	request->writeString(name);
	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::StereoEffectStack_Noatun_stub::move(long after, long item)
{
	long methodID = _lookupMethodFast("method:000000056d6f76650000000005766f6964000000000200000002000000056c6f6e67000000000661667465720000000000000000056c6f6e6700000000056974656d000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeLong(after);
	request->writeLong(item);
	request->patchLength();
	_connection->qSendBuffer(request);

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

std::vector<long> * Arts::StereoEffectStack_Noatun_stub::effectList()
{
	long methodID = _lookupMethodFast("method:0000000b6566666563744c69737400000000062a6c6f6e6700000000020000000000000000");
	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<long> *_returnCode = new std::vector<long>;
	if(!result) return _returnCode; // error occured
	result->readLongSeq(*_returnCode);
	delete result;
	return _returnCode;
}

long Arts::StereoEffectStack_Noatun_stub::insertTop(Arts::StereoEffect effect, const std::string& name)
{
	long methodID = _lookupMethodFast("method:0000000a696e73657274546f7000000000056c6f6e6700000000020000000200000013417274733a3a53746572656f4566666563740000000007656666656374000000000000000007737472696e6700000000056e616d65000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	Arts::writeObject(*request,effect._base());
	request->writeString(name);
	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;
}

long Arts::StereoEffectStack_Noatun_stub::insertBottom(Arts::StereoEffect effect, const std::string& name)
{
	long methodID = _lookupMethodFast("method:0000000d696e73657274426f74746f6d00000000056c6f6e6700000000020000000200000013417274733a3a53746572656f4566666563740000000007656666656374000000000000000007737472696e6700000000056e616d65000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	Arts::writeObject(*request,effect._base());
	request->writeString(name);
	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::StereoEffectStack_Noatun_stub::remove(long ID)
{
	long methodID = _lookupMethodFast("method:0000000772656d6f76650000000005766f6964000000000200000001000000056c6f6e6700000000034944000000000000000000");
	long requestID;
	Arts::Buffer *request, *result;
	request = Arts::Dispatcher::the()->createRequest(requestID,_objectID,methodID);
	request->writeLong(ID);
	request->patchLength();
	_connection->qSendBuffer(request);

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

std::string Arts::StereoEffectStack_Noatun_skel::_interfaceName()
{
	return "Arts::StereoEffectStack_Noatun";
}

bool Arts::StereoEffectStack_Noatun_skel::_isCompatibleWith(const std::string& interfacename)
{
	if (interfacename == "Arts::StereoEffectStack_Noatun") 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::StereoEffectStack_Noatun_skel::_interfaceNameSkel()
{
	return "Arts::StereoEffectStack_Noatun";
}

// insertAfter
static void _dispatch_Arts_StereoEffectStack_Noatun_00(void *object, Arts::Buffer *request, Arts::Buffer *result)
{
	long after = request->readLong();
	Arts::StereoEffect_base* _temp_effect;
	Arts::readObject(*request,_temp_effect);
	Arts::StereoEffect effect = Arts::StereoEffect::_from_base(_temp_effect);
	std::string name;
	request->readString(name);
	result->writeLong(((Arts::StereoEffectStack_Noatun_skel *)object)->insertAfter(after,effect,name));
}

// move
static void _dispatch_Arts_StereoEffectStack_Noatun_01(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	long after = request->readLong();
	long item = request->readLong();
	((Arts::StereoEffectStack_Noatun_skel *)object)->move(after,item);
}

// effectList
static void _dispatch_Arts_StereoEffectStack_Noatun_02(void *object, Arts::Buffer *, Arts::Buffer *result)
{
	std::vector<long> *_returnCode = ((Arts::StereoEffectStack_Noatun_skel *)object)->effectList();
	result->writeLongSeq(*_returnCode);
	delete _returnCode;
}

// insertTop
static void _dispatch_Arts_StereoEffectStack_Noatun_03(void *object, Arts::Buffer *request, Arts::Buffer *result)
{
	Arts::StereoEffect_base* _temp_effect;
	Arts::readObject(*request,_temp_effect);
	Arts::StereoEffect effect = Arts::StereoEffect::_from_base(_temp_effect);
	std::string name;
	request->readString(name);
	result->writeLong(((Arts::StereoEffectStack_Noatun_skel *)object)->insertTop(effect,name));
}

// insertBottom
static void _dispatch_Arts_StereoEffectStack_Noatun_04(void *object, Arts::Buffer *request, Arts::Buffer *result)
{
	Arts::StereoEffect_base* _temp_effect;
	Arts::readObject(*request,_temp_effect);
	Arts::StereoEffect effect = Arts::StereoEffect::_from_base(_temp_effect);
	std::string name;
	request->readString(name);
	result->writeLong(((Arts::StereoEffectStack_Noatun_skel *)object)->insertBottom(effect,name));
}

// remove
static void _dispatch_Arts_StereoEffectStack_Noatun_05(void *object, Arts::Buffer *request, Arts::Buffer *)
{
	long ID = request->readLong();
	((Arts::StereoEffectStack_Noatun_skel *)object)->remove(ID);
}

void Arts::StereoEffectStack_Noatun_skel::_buildMethodTable()
{
	Arts::Buffer m;
	m.fromString(
        "MethodTable:0000000c696e73657274416674657200000000056c6f6e67000000"
        "000200000003000000056c6f6e6700000000066166746572000000000000000013"
        "417274733a3a53746572656f456666656374000000000765666665637400000000"
        "0000000007737472696e6700000000056e616d6500000000000000000000000005"
        "6d6f76650000000005766f6964000000000200000002000000056c6f6e67000000"
        "000661667465720000000000000000056c6f6e6700000000056974656d00000000"
        "00000000000000000b6566666563744c69737400000000062a6c6f6e6700000000"
        "0200000000000000000000000a696e73657274546f7000000000056c6f6e670000"
        "0000020000000200000013417274733a3a53746572656f45666665637400000000"
        "07656666656374000000000000000007737472696e6700000000056e616d650000"
        "000000000000000000000d696e73657274426f74746f6d00000000056c6f6e6700"
        "000000020000000200000013417274733a3a53746572656f456666656374000000"
        "0007656666656374000000000000000007737472696e6700000000056e616d6500"
        "00000000000000000000000772656d6f76650000000005766f6964000000000200"
        "000001000000056c6f6e6700000000034944000000000000000000",
		"MethodTable"
	);
	_addMethod(_dispatch_Arts_StereoEffectStack_Noatun_00,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_StereoEffectStack_Noatun_01,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_StereoEffectStack_Noatun_02,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_StereoEffectStack_Noatun_03,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_StereoEffectStack_Noatun_04,this,Arts::MethodDef(m));
	_addMethod(_dispatch_Arts_StereoEffectStack_Noatun_05,this,Arts::MethodDef(m));
	Arts::StereoEffect_skel::_buildMethodTable();
}

Arts::StereoEffectStack_Noatun_skel::StereoEffectStack_Noatun_skel()
{
}

Arts::Object_base* Arts::StereoEffectStack_Noatun::_Creator() {
	return Arts::StereoEffectStack_Noatun_base::_create();
}

unsigned long Arts::StereoEffectStack_Noatun_base::_IID = Arts::MCOPUtils::makeIID("Arts::StereoEffectStack_Noatun");

static Arts::IDLFileReg IDLFileReg_StereoEffectStack_Noatun("StereoEffectStack_Noatun",
    "IDLFile:00000001000000000000000000000000010000001f417274733a3a53746572"
    "656f456666656374537461636b5f4e6f6174756e000000000100000013417274733a3a"
    "53746572656f45666665637400000000060000000c696e736572744166746572000000"
    "00056c6f6e67000000000200000003000000056c6f6e67000000000661667465720000"
    "00000000000013417274733a3a53746572656f45666665637400000000076566666563"
    "74000000000000000007737472696e6700000000056e616d6500000000000000000000"
    "0000056d6f76650000000005766f6964000000000200000002000000056c6f6e670000"
    "00000661667465720000000000000000056c6f6e6700000000056974656d0000000000"
    "000000000000000b6566666563744c69737400000000062a6c6f6e6700000000020000"
    "0000000000000000000a696e73657274546f7000000000056c6f6e6700000000020000"
    "000200000013417274733a3a53746572656f4566666563740000000007656666656374"
    "000000000000000007737472696e6700000000056e616d650000000000000000000000"
    "000d696e73657274426f74746f6d00000000056c6f6e67000000000200000002000000"
    "13417274733a3a53746572656f45666665637400000000076566666563740000000000"
    "00000007737472696e6700000000056e616d650000000000000000000000000772656d"
    "6f76650000000005766f6964000000000200000001000000056c6f6e67000000000349"
    "4400000000000000000000000000000000000000000000000000"
);
