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

#include "splayPlayObject.h"

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

SplayPlayObject_base *SplayPlayObject_base::_fromString(const std::string& objectref)
{
	Arts::ObjectReference r;

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

SplayPlayObject_base *SplayPlayObject_base::_fromDynamicCast(const Arts::Object& object)
{
	if(object.isNull()) return 0;

	SplayPlayObject_base *castedObject = (SplayPlayObject_base *)object._base()->_cast(SplayPlayObject_base::_IID);
	if(castedObject) return castedObject->_copy();

	return _fromString(object._toString());
}

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

std::vector<std::string> SplayPlayObject_base::_defaultPortsIn() const {
	std::vector<std::string> ret;
	ret.push_back("indata");
	return ret;
}
std::vector<std::string> SplayPlayObject_base::_defaultPortsOut() const {
	std::vector<std::string> ret;
	return ret;
}

void *SplayPlayObject_base::_cast(unsigned long iid)
{
	if(iid == SplayPlayObject_base::_IID) return (SplayPlayObject_base *)this;
	if(iid == Arts::StreamPlayObject_base::_IID) return (Arts::StreamPlayObject_base *)this;
	if(iid == Arts::PlayObject_base::_IID) return (Arts::PlayObject_base *)this;
	if(iid == Arts::PlayObject_private_base::_IID) return (Arts::PlayObject_private_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;
}

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

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

std::string SplayPlayObject_skel::_interfaceName()
{
	return "SplayPlayObject";
}

bool SplayPlayObject_skel::_isCompatibleWith(const std::string& interfacename)
{
	if (interfacename == "SplayPlayObject") return true;
	if (interfacename == "Arts::StreamPlayObject") return true;
	if (interfacename == "Arts::PlayObject") return true;
	if (interfacename == "Arts::PlayObject_private") return true;
	if (interfacename == "Arts::SynthModule") return true;
	if (interfacename == "Arts::Object") return true;
	return false;
}

std::string SplayPlayObject_skel::_interfaceNameSkel()
{
	return "SplayPlayObject";
}

void SplayPlayObject_skel::_buildMethodTable()
{
	Arts::Buffer m;
	m.fromString(
        "MethodTable:",
		"MethodTable"
	);
	Arts::StreamPlayObject_skel::_buildMethodTable();
	Arts::SynthModule_skel::_buildMethodTable();
}

SplayPlayObject_skel::SplayPlayObject_skel()
{
	_initStream("indata",&indata,41);
	_initStream("left",&left,10);
	_initStream("right",&right,10);
}

void SplayPlayObject_skel::notify(const Arts::Notification &notification)
{
	if(indata.notifyID() == notification.ID)
		process_indata((Arts::DataPacket<Arts::mcopbyte> *)notification.data);
}

Arts::Object_base* SplayPlayObject::_Creator() {
	return SplayPlayObject_base::_create();
}

unsigned long SplayPlayObject_base::_IID = Arts::MCOPUtils::makeIID("SplayPlayObject");

static Arts::IDLFileReg IDLFileReg_splayPlayObject("splayPlayObject",
    "IDLFile:00000001000000000000000000000000010000001053706c6179506c61794f"
    "626a656374000000000200000017417274733a3a53747265616d506c61794f626a6563"
    "740000000012417274733a3a53796e74684d6f64756c65000000000000000003000000"
    "07696e64617461000000000562797465000000002900000000000000056c6566740000"
    "000006666c6f6174000000000a000000000000000672696768740000000006666c6f61"
    "74000000000a00000000000000000000000000000000"
);
