From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- arts/runtime/artsbuilder.idl | 228 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 arts/runtime/artsbuilder.idl (limited to 'arts/runtime/artsbuilder.idl') diff --git a/arts/runtime/artsbuilder.idl b/arts/runtime/artsbuilder.idl new file mode 100644 index 00000000..42ff393a --- /dev/null +++ b/arts/runtime/artsbuilder.idl @@ -0,0 +1,228 @@ +/* + * DISCLAIMER: The interfaces in artsbuilder.idl (and the derived .cc/.h files) + * DO NOT GUARANTEE BINARY COMPATIBILITY YET. + * + * They are intended for developers. You shouldn't expect that applications in + * binary form will be fully compatibile with further releases of these + * interfaces. + */ + +#include +#include +module Arts { + /* + * incoming or outgoing port? + */ + enum PortDirection {input, output}; + + /** + * ConnType (maybe obsolete) + * + * ConnType: (connection type) this is wether this value is used + * + * - once (such as a filename of a waveplugin) -> property + * this implies that the allowed connection is only value + * + * - event based (such as midi events) -> event + * when events arrive, they are processed, when no events arrive, + * don't care + * + * - stream based (such as audio streams) -> stream + * every calculation of the module consumes/creates a sample + * that means: no data = no calculation possible + * + * WARNING: This is part of the artsbuilder dynamic programming interface + * as the MCOP port isn't there yet, this stuff may change + */ + enum PortConnType { conn_stream, conn_event, conn_property}; + + /** + * PortType (maybe obsolete) + * + * isMultiPort specifies if the port can take multiple incoming + * connections or not. This is only relevant/allowed for input ports, + * the output of all output ports may be connected to any amount of + * receivers. + * + * Ports which can take multiple connections are handled differently + * internally. (Also, artsbuilder needs to know whether to allow multi- + * connections or not). + * + * WARNING: This is part of the artsbuilder dynamic programming interface + * as the MCOP port isn't there yet, this stuff may change + */ + struct PortType { + PortDirection direction; + string dataType; + PortConnType connType; + boolean isMultiPort; + }; + + struct ModuleInfo { + string name; + + //--- internal information: + // ports, first the input ports, then the output ports + sequence ports; + sequence portnames; + boolean isInterface; + boolean isStructure; + }; + + interface PortDesc; + interface ModuleDesc; + interface StructureDesc; + interface StructurePortDesc; + + interface PortDesc { + // internal: + void constructor(ModuleDesc parent, string name, PortType type); + + // ID is guaranteed to be unique in the structure the port belongs to + readonly attribute long ID; + readonly attribute ModuleDesc parent; + + // Name is guaranteed to be unique for each module (no two in/out- + // ports with the same name allowed) + readonly attribute string name; + readonly attribute PortType type; + + /* + * - for input channels, one of those must be true (only event + * channels may remain unconnected), + * - for output channels, only isConnected may be set + * + * only one of them may be set, not both + */ + readonly attribute boolean isConnected; + attribute boolean hasValue; // set to false is only allowed writing + + // connections, used when isConnected is true + readonly attribute sequence connections; + + // to be used as const value when hasValue is true + attribute float floatValue; + attribute string stringValue; + + // the value as "any" + attribute Any value; + + boolean connectTo(PortDesc port); + void disconnectFrom(PortDesc port); + void disconnectAll(); + + sequence saveToList(); + void loadFromList(sequence list); + + // never call this by hand, it will only be used by the module: + void internalConnectInput(PortDesc port); + void internalReConnect(sequence allports); + + readonly attribute long internalOldID; + }; + + interface ModuleDesc { + // internal + void constructor(StructureDesc parent, ModuleInfo info); + + // ID is guaranteed to be unique in the structure the module belongs to + readonly attribute long ID; + readonly attribute StructureDesc parent; + + readonly attribute string name; + readonly attribute sequence ports; + readonly attribute long x, y, width, height; + readonly attribute boolean isInterface, isStructure; + + boolean moveTo(long x, long y); // returns true when successful + + PortDesc findPort(string name); + sequence saveToList(); + void loadFromList(sequence list); + }; + + interface StructureDesc { + // internal: + long obtainID(); // only to be used as module or port + + // public: + readonly attribute boolean valid; + attribute string name; + readonly attribute sequence modules; + readonly attribute sequence ports; + readonly attribute sequence inheritedInterfaces; + + sequence saveToList(); + void loadFromList(sequence list); + + /** + * deletes all components in the structure + */ + void clear(); + + ModuleDesc createModuleDesc(ModuleInfo info); + void freeModuleDesc(ModuleDesc moduledesc); + + /** + * publishing (HMM) + */ + readonly attribute ModuleInfo externalInterface; + + // External Interface Ports: + StructurePortDesc createStructurePortDesc(PortType type, + string name); + void freeStructurePortDesc(StructurePortDesc portdesc); + void moveStructurePortDesc(StructurePortDesc portdesc, + long newposition); + + // you will need to add the structure ports yourself + void addInheritedInterface(string iface); + + // this will remove the associated structure ports + void removeInheritedInterface(string iface); + }; + + interface StructurePortDesc : PortDesc { + // internal + void constructor(StructureDesc parent, string name, PortType type); + + // Position: how the port is positioned when the structure is used + // as module - 0 is leftmost, higher numbers are more right + readonly attribute long x, y, position; + readonly attribute StructureDesc parentStructure; + + // if the port is associated with an inherited interface of the + // parent structure, then it should be setup here + attribute string inheritedInterface; + + boolean moveTo(long x, long y); // returns true when successful + + void lowerPosition(); // will move the port more left + void raisePosition(); // will move the port more right + void rename(string newname); + + // only used by the structure to reorder the ports + void internalSetPosition(long position); + }; + + interface ObjectFactory { + object createObject(string name); + }; + + interface LocalFactory : ObjectFactory { + }; + + interface StructureBuilder { + void addFactory(ObjectFactory factory); + object createObject(StructureDesc structure); + ModuleDef createTypeInfo(StructureDesc structure); + }; + + interface ArtsBuilderLoader : Loader { + }; + + interface Structure : SynthModule { + void run(); + void halt(); + }; +}; -- cgit v1.2.1