text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK Core Interfaces
// Filename    : pluginterfaces/base/ucolorspec.h
// Created by  : Steinberg, 02/2006	(Host: S4.1)
// Description : GUI data types
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/ftypes.h"

namespace Steinberg {

//------------------------------------------------------------------------
// Colors
typedef uint32			ColorSpec;
typedef uint8			ColorComponent;

typedef ColorSpec		UColorSpec;			// legacy support
typedef ColorComponent	UColorComponent;	// legacy support

/** Create color specifier with RGB values (alpha is opaque) */
inline ColorSpec MakeColorSpec (ColorComponent r, ColorComponent g, ColorComponent b)
{
	return 0xFF000000 | ((ColorSpec)r) << 16 | ((ColorSpec)g) << 8 | (ColorSpec)b;
}
/** Create color specifier with RGBA values  */
inline ColorSpec MakeColorSpec (ColorComponent r, ColorComponent g, ColorComponent b, ColorComponent a)
{
	return ((ColorSpec)a) << 24 | ((ColorSpec)r) << 16 | ((ColorSpec)g) << 8 | (uint32)b;
}

inline ColorComponent GetBlue (ColorSpec cs)		         { return (ColorComponent)(cs & 0x000000FF); }
inline ColorComponent GetGreen (ColorSpec cs)		         { return (ColorComponent)((cs >> 8) & 0x000000FF); }
inline ColorComponent GetRed (ColorSpec cs)		         { return (ColorComponent)((cs >> 16) & 0x000000FF); }
inline ColorComponent GetAlpha (ColorSpec cs)		         { return (ColorComponent)((cs >> 24) & 0x000000FF); }

inline void SetBlue (ColorSpec& argb, ColorComponent b)	 { argb = (argb & 0xFFFFFF00) | (ColorSpec)(b); }
inline void SetGreen (ColorSpec& argb, ColorComponent g)	 { argb = (argb & 0xFFFF00FF) | (((ColorSpec)g) << 8); }
inline void SetRed (ColorSpec& argb, ColorComponent r)	 { argb = (argb & 0xFF00FFFF) | (((ColorSpec)r) << 16); }
inline void SetAlpha (ColorSpec& argb, ColorComponent a)	 { argb = (argb & 0x00FFFFFF) | (((ColorSpec)a) << 24); }

/** Normalized color components*/
/** { */
inline double NormalizeColorComponent (ColorComponent c)    { return c / 255.0; }
inline ColorComponent DenormalizeColorComponent (double c)  { return static_cast<ColorComponent> (c * 255.0); }

inline void SetAlphaNorm (ColorSpec& argb, double a)        { SetAlpha (argb, DenormalizeColorComponent (a)); }
inline double GetAlphaNorm (ColorSpec cs)	                 { return (NormalizeColorComponent (GetAlpha (cs))); }
inline double NormalizeAlpha (uint8 alpha)                   {return NormalizeColorComponent (alpha);}
inline ColorComponent DenormalizeAlpha (double alphaNorm)   { return DenormalizeColorComponent (alphaNorm); }
/** } */
inline ColorSpec StripAlpha (ColorSpec argb)               { return (argb & 0x00FFFFFF); }

}


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : Helpers
// Filename    : pluginterfaces/base/ustring.h
// Created by  : Steinberg, 12/2005
// Description : UTF-16 String class
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "ftypes.h"

//------------------------------------------------------------------------
namespace Steinberg {

//------------------------------------------------------------------------
/** UTF-16 string class without buffer management. */
//------------------------------------------------------------------------
class UString
{
public:
//------------------------------------------------------------------------
	UString (char16* buffer, int32 size)
	: thisBuffer (buffer),
	  thisSize (size)
	{}

	int32 getSize () const			{ return thisSize; }	///< returns buffer size
	operator const char16* () const	{ return thisBuffer; }	///< cast to char16*

	/** Returns length of string (in code units). */
	int32 getLength () const;

	/** Copy from UTF-16 buffer. */
	UString& assign (const char16* src, int32 srcSize = -1);

	/** Append UTF-16 buffer. */
	UString& append (const char16* src, int32 srcSize = -1);

	/** Copy to UTF-16 buffer. */
	const UString& copyTo (char16* dst, int32 dstSize) const;

	/** Copy from ASCII string. */
	UString& fromAscii (const char* src, int32 srcSize = -1);
	UString& assign (const char* src, int32 srcSize = -1) { return fromAscii (src, srcSize); }

	/** Copy to ASCII string. */
	const UString& toAscii (char* dst, int32 dstSize) const;

	/** Scan integer from string. */
	bool scanInt (int64& value) const;

	/** Print integer to string. */
	bool printInt (int64 value);

	/** Scan float from string. */
	bool scanFloat (double& value) const;

	/** Print float to string. */
	bool printFloat (double value, int32 precision = 4);
//------------------------------------------------------------------------
protected:
	char16* thisBuffer;
	int32 thisSize;
};

//------------------------------------------------------------------------
/** UTF-16 string with fixed buffer size. */
//------------------------------------------------------------------------
template<int32 maxSize>
class UStringBuffer: public UString
{
public:
//------------------------------------------------------------------------
	UStringBuffer ()
	: UString (data, maxSize)
	{ data[0] = 0; }

	/** Construct from UTF-16 string. */
	UStringBuffer (const char16* src, int32 srcSize = -1)
	: UString (data, maxSize)
	{ data[0] = 0; if (src) assign (src, srcSize); }

	/** Construct from ASCII string. */
	UStringBuffer (const char* src, int32 srcSize = -1)
	: UString (data, maxSize)
	{ data[0] = 0; if (src) fromAscii (src, srcSize); }
//------------------------------------------------------------------------
protected:
	char16 data[maxSize];
};

//------------------------------------------------------------------------
typedef UStringBuffer<128> UString128;	///< 128 character UTF-16 string
typedef UStringBuffer<256> UString256;	///< 256 character UTF-16 string
} // namespace Steinberg

//------------------------------------------------------------------------
#define USTRING(asciiString)	Steinberg::UString256 (asciiString)
#define USTRINGSIZE(var)		(sizeof (var) / sizeof (Steinberg::char16))

//------------------------------------------------------------------------

repo_name: fedden/RenderMan

mime_type: text/x-c++


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK Core Interfaces
// Filename    : pluginterfaces/base/ipersistent.h
// Created by  : Steinberg, 09/2004
// Description : Plug-In Storage Interfaces
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/funknown.h"

namespace Steinberg {

class FVariant;
class IAttributes;
//------------------------------------------------------------------------
/**  Persistent Object Interface.
[plug imp] \n
This interface is used to store/restore attributes of an object.
An IPlugController can implement this interface to handle presets.
The gui-xml for a preset control looks like this:
\code
	....
	<view name="PresetView" data="Preset"/>
	....
<template name="PresetView">
	<view name="preset control" size="0, 0, 100, 20"/>
	<switch name="store preset" size="125,0,80,20" style="push|immediate" title="Store"  />
	<switch name="remove preset" size="220,0,80,20" style="push|immediate" title="Delete"  />
</template>
\endcode
The tag data="Preset" tells the host to create a preset controller that handles the
3 values named "preset control",  "store preset", and "remove preset".
*/
//------------------------------------------------------------------------
class IPersistent: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** The class ID must be a 16 bytes unique id that is used to create the object.
	This ID is also used to identify the preset list when used with presets. */
	virtual tresult PLUGIN_API getClassID (char8* uid) = 0;
	/** Store all members/data in the passed IAttributes. */
	virtual tresult PLUGIN_API saveAttributes (IAttributes* ) = 0;
	/** Restore all members/data from the passed IAttributes. */
	virtual tresult PLUGIN_API loadAttributes (IAttributes* ) = 0;
//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IPersistent, 0xBA1A4637, 0x3C9F46D0, 0xA65DBA0E, 0xB85DA829)

typedef FIDString IAttrID;
//------------------------------------------------------------------------
/**  Object Data Archive Interface.
[host imp] \n
- store data/objects/binary/subattributes in the archive
- read stored data from the archive

All data stored to the archive are identified by a string (IAttrID), which must be unique on each
IAttribute level.

The basic set/get methods make use of the FVariant class defined in 'funknown.h'.
For a more convenient usage of this interface, you should use the functions defined
in namespace PAttributes (public.sdk/source/common/pattributes.h+cpp) !!

\ingroup frameworkHostClasses
*/
//------------------------------------------------------------------------
class IAttributes: public FUnknown
{
public:
//------------------------------------------------------------------------
	/*! \name Methods to write attributes
	******************************************************************************************************** */
	//@{
	/** Store any data in the archive. It is even possible to store sub-attributes by creating
	    a new IAttributes instance via the IHostClasses interface and pass it to the parent in the
		FVariant. In this case the archive must take the ownership of the newly created object, which
		is true for all objects that have been created only for storing. You tell the archive to take
		ownership by adding the FVariant::kOwner flag to the FVariant::type member (data.type |= FVariant::kOwner).
		When using the PAttributes functions, this is done through a function parameter.*/
	virtual tresult PLUGIN_API set (IAttrID attrID, const FVariant& data) = 0;

	/** Store a list of data in the archive. Please note that the type of data is not mixable! So
	    you can only store a list of integers or a list of doubles/strings/etc. You can also store a list
		of subattributes or other objects that implement the IPersistent interface.*/
	virtual tresult PLUGIN_API queue (IAttrID listID, const FVariant& data) = 0;

	/** Store binary data in the archive. Parameter 'copyBytes' specifies if the passed data should be copied.
	    The archive cannot take the ownership of binary data. Either it just references a buffer in order
		to write it to a file (copyBytes = false) or it copies the data to its own buffers (copyBytes = true).
		When binary data should be stored in the default pool for example, you must always copy it!*/
	virtual tresult PLUGIN_API setBinaryData (IAttrID attrID, void* data, uint32 bytes, bool copyBytes) = 0;
	//@}

	/*! \name Methods to read attributes
	******************************************************************************************************** */
	//@{
	/** Get data previously stored to the archive. */
	virtual tresult PLUGIN_API get (IAttrID attrID, FVariant& data) = 0;

	/** Get list of data previously stored to the archive. As long as there are queue members the method
	    will return kResultTrue. When the queue is empty, the methods returns kResultFalse. All lists except from
		object lists can be reset which means that the items can be read once again. \see IAttributes::resetQueue */
	virtual tresult PLUGIN_API unqueue (IAttrID listID, FVariant& data) = 0;

	/** Get the amount of items in a queue. */
	virtual int32 PLUGIN_API getQueueItemCount (IAttrID) = 0;

	/** Reset a queue. If you need to restart reading a queue, you have to reset it. You can reset a queue at any time.*/
	virtual tresult PLUGIN_API resetQueue (IAttrID attrID) = 0;

	/** Reset all queues in the archive.*/
	virtual tresult PLUGIN_API resetAllQueues () = 0;

	/** Read binary data from the archive. The data is copied into the passed buffer. The size of that buffer
	    must fit the size of data stored in the archive which can be queried via IAttributes::getBinaryDataSize  */
	virtual tresult PLUGIN_API getBinaryData (IAttrID attrID, void* data, uint32 bytes) = 0;
	/** Get the size in bytes of binary data in the archive. */
	virtual uint32 PLUGIN_API getBinaryDataSize (IAttrID attrID) = 0;
	//@}

//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IAttributes, 0xFA1E32F9, 0xCA6D46F5, 0xA982F956, 0xB1191B58)

//------------------------------------------------------------------------
/**  Extended access to Attributes; supports Attribute retrieval via iteration.
[host imp] \n
[released] C7/N6 \n
\ingroup frameworkHostClasses
*/
//------------------------------------------------------------------------
class IAttributes2 : public IAttributes
{
public:
	/** Returns the number of existing attributes. */
	virtual int32 PLUGIN_API countAttributes () const = 0;
	/** Returns the attribute's ID for the given index. */
	virtual IAttrID PLUGIN_API getAttributeID (int32 index) const = 0;
//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IAttributes2, 0x1382126A, 0xFECA4871, 0x97D52A45, 0xB042AE99)

//------------------------------------------------------------------------
} // namespace Steinberg


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK Core Interfaces
// Filename    : pluginterfaces/base/keycodes.h
// Created by  : Steinberg, 01/2004
// Description : Key Code Definitions
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/ftypes.h"

namespace Steinberg {
//------------------------------------------------------------------------------
/** Virtual Key Codes.
OS-independent enumeration of virtual keycodes.
*/
//------------------------------------------------------------------------------
enum VirtualKeyCodes
{
	KEY_BACK = 1,
	KEY_TAB,
	KEY_CLEAR,
	KEY_RETURN,
	KEY_PAUSE,
	KEY_ESCAPE,
	KEY_SPACE,
	KEY_NEXT,
	KEY_END,
	KEY_HOME,

	KEY_LEFT,
	KEY_UP,
	KEY_RIGHT,
	KEY_DOWN,
	KEY_PAGEUP,
	KEY_PAGEDOWN,

	KEY_SELECT,
	KEY_PRINT,
	KEY_ENTER,
	KEY_SNAPSHOT,
	KEY_INSERT,
	KEY_DELETE,
	KEY_HELP,
	KEY_NUMPAD0,
	KEY_NUMPAD1,
	KEY_NUMPAD2,
	KEY_NUMPAD3,
	KEY_NUMPAD4,
	KEY_NUMPAD5,
	KEY_NUMPAD6,
	KEY_NUMPAD7,
	KEY_NUMPAD8,
	KEY_NUMPAD9,
	KEY_MULTIPLY,
	KEY_ADD,
	KEY_SEPARATOR,
	KEY_SUBTRACT,
	KEY_DECIMAL,
	KEY_DIVIDE,
	KEY_F1,
	KEY_F2,
	KEY_F3,
	KEY_F4,
	KEY_F5,
	KEY_F6,
	KEY_F7,
	KEY_F8,
	KEY_F9,
	KEY_F10,
	KEY_F11,
	KEY_F12,
	KEY_NUMLOCK,
	KEY_SCROLL,

	KEY_SHIFT,
	KEY_CONTROL,
	KEY_ALT,

	KEY_EQUALS,				// only occurs on a Mac
	KEY_CONTEXTMENU,		// Windows only

	// multimedia keys
	KEY_MEDIA_PLAY,
	KEY_MEDIA_STOP,
	KEY_MEDIA_PREV,
	KEY_MEDIA_NEXT,
	KEY_VOLUME_UP,
	KEY_VOLUME_DOWN,

	KEY_F13,
	KEY_F14,
	KEY_F15,
	KEY_F16,
	KEY_F17,
	KEY_F18,
	KEY_F19,

	VKEY_FIRST_CODE = KEY_BACK,
	VKEY_LAST_CODE = KEY_F19,

	VKEY_FIRST_ASCII = 128
	/*
	 KEY_0 - KEY_9 are the same as ASCII '0' - '9' (0x30 - 0x39) + FIRST_ASCII
	 KEY_A - KEY_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) + FIRST_ASCII
	*/
};

//------------------------------------------------------------------------------
inline tchar VirtualKeyCodeToChar (uint8 vKey)
{
	if (vKey >= VKEY_FIRST_ASCII)
		return (tchar)(vKey - VKEY_FIRST_ASCII + 0x30);
	else if (vKey == KEY_SPACE)
		return ' ';
	return 0;
}

//------------------------------------------------------------------------------
inline uint8 CharToVirtualKeyCode (tchar character)
{
	if ((character >= 0x30 && character <= 0x39) || (character >= 0x41 && character <= 0x5A))
		return (uint8)(character - 0x30 + VKEY_FIRST_ASCII);
	if (character == ' ')
		return (uint8)KEY_SPACE;
	return 0;
}

//------------------------------------------------------------------------------
enum KeyModifier
{
	kShiftKey     = 1 << 0, ///< same on both PC and Mac
	kAlternateKey = 1 << 1, ///< same on both PC and Mac
	kCommandKey   = 1 << 2, ///< windows ctrl key; mac cmd key (apple button)
	kControlKey   = 1 << 3  ///< windows: not assigned, mac: ctrl key
};

//------------------------------------------------------------------------
struct KeyCode
{
	tchar character;
	uint8 virt;
	uint8 modifier;

	explicit KeyCode (tchar character = 0, uint8 virt = 0, uint8 modifier = 0)
	: character (character), virt (virt), modifier (modifier)
	{
	}
};

//------------------------------------------------------------------------
} // namespace Steinberg


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK Core Interfaces
// Filename    : pluginterfaces/base/conststringtable.cpp
// Created by  : Steinberg, 09/2007
// Description : constant unicode string table
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#include "conststringtable.h"
#include <cstring>
#include <map>

namespace Steinberg {

static std::map<const char8*, char16*>* stringMap;
static std::map<const char8, char16>* charMap;

static char16* generateUTF16 (const char8* str);

//----------------------------------------------------------------------------
ConstStringTable* ConstStringTable::instance ()
{
	static ConstStringTable stringTable;
	return &stringTable;
}

//----------------------------------------------------------------------------
const char16* ConstStringTable::getString (const char8* str) const
{
	std::map<const char8*, char16*>::iterator iter = stringMap->find (str);
	if (iter != stringMap->end ())
		return iter->second;
	char16* uStr = generateUTF16 (str);
	stringMap->insert (std::make_pair (str, uStr));
	return uStr;
}

//----------------------------------------------------------------------------
const char16 ConstStringTable::getString (const char8 str) const
{
	std::map<const char8, char16>::iterator iter = charMap->find (str);
	if (iter != charMap->end ())
		return iter->second;
	char16 uStr = 0;
#if BYTEORDER == kBigEndian
	char8* puStr = (char8*)&uStr;
	puStr[1] = str;
#else
	uStr = str;
#endif
	charMap->insert (std::make_pair (str, uStr));
	return uStr;
}

//----------------------------------------------------------------------------
ConstStringTable::ConstStringTable ()
{
	stringMap = new std::map<const char8*, char16*>;
	charMap = new std::map<const char8, char16>;
}

//----------------------------------------------------------------------------
ConstStringTable::~ConstStringTable ()
{
	// free out allocated strings
	{
		std::map<const char8*, char16*>::iterator iter = stringMap->begin ();
		while (iter != stringMap->end ())
		{
			delete[] iter->second;
			iter++;
		}
	} // delete iterator on map before deleting the map

	delete stringMap;
	delete charMap;
}

//----------------------------------------------------------------------------
char16* generateUTF16 (const char8* str)
{
	int32 len = (int32)strlen (str);
	char16* result = new char16[len + 1];
	for (int32 i = 0; i < len; i++)
	{
#if BYTEORDER == kBigEndian
		char8* pChr = (char8*)&result[i];
		pChr[0] = 0;
		pChr[1] = str[i];
#else
		result[i] = str[i];
#endif
	}
	result[len] = 0;
	return result;
}
//------------------------------------------------------------------------
} // namespace Steinberg


text:
//------------------------------------------------------------------------
// Project     : Steinberg Module Architecture SDK
//
// Category    : Basic Host Service Interfaces
// Filename    : pluginterfaces/base/iupdatehandler.h
// Created by  : Steinberg, 01/2004
// Description : Update handling
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/funknown.h"

namespace Steinberg {

class IDependent;

//------------------------------------------------------------------------
/** Host implements dependency handling for plugins.
[host imp] \n
[get this interface from IHostClasses] \n
[released N3.1] \n

- Install/Remove change notifications
- Trigger updates when an object has changed

Can be used between host-objects and the Plug-In or
inside the Plug-In to handle internal updates!

\see IDependent
\ingroup frameworkHostClasses
*/
//------------------------------------------------------------------------
class IUpdateHandler: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Install update notification for given object. It is essential to
	    remove all dependencies again using 'removeDependent'! Dependencies
		are not removed automatically when the 'object' is released!
	\param object : interface to object that sends change notifications
	\param dependent : interface through which the update is passed */
	virtual tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) = 0;

	/** Remove a previously installed dependency.*/
	virtual tresult PLUGIN_API removeDependent (FUnknown* object, IDependent* dependent) = 0;

	/** Inform all dependents, that object has changed.
	\param object is the object that has changed
	\param message is a value of enum IDependent::ChangeMessage, usually  IDependent::kChanged - can be
	                 a private message as well (only known to sender and dependent)*/
	virtual	tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) = 0;

	/** Same as triggerUpdates, but delivered in idle (usefull to collect updates).*/
	virtual	tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) = 0;
	static const FUID iid;
};

DECLARE_CLASS_IID (IUpdateHandler, 0xF5246D56, 0x86544d60, 0xB026AFB5, 0x7B697B37)

//------------------------------------------------------------------------
/**  A dependent will get notified about changes of a model.
[plug imp]
- notify changes of a model

\see IUpdateHandler
\ingroup frameworkHostClasses
*/
//------------------------------------------------------------------------
class IDependent: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Inform the dependent, that the passed FUnknown has changed. */
	virtual void PLUGIN_API update (FUnknown* changedUnknown, int32 message) = 0;

	enum ChangeMessage
	{
		kWillChange,
		kChanged,
		kDestroyed,
		kWillDestroy,

		kStdChangeMessageLast = kWillDestroy
	};
	//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IDependent, 0xF52B7AAE, 0xDE72416d, 0x8AF18ACE, 0x9DD7BD5E)

//------------------------------------------------------------------------
} // namespace Steinberg


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK Core Interfaces
// Filename    : pluginterfaces/base/ftypes.h
// Created by  : Steinberg, 01/2004
// Description : Basic data types
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "fplatform.h"

//#define UNICODE_OFF 	// disable / enable unicode

#ifdef UNICODE_OFF
	#ifdef UNICODE
	#undef UNICODE
	#endif
#else
	#define UNICODE 1
#endif

#ifdef UNICODE
#define _UNICODE 1
#endif

namespace Steinberg
{
//-----------------------------------------------------------------
// Integral Types
	typedef char int8;
	typedef unsigned char uint8;
	typedef unsigned char uchar;

	typedef short int16;
	typedef unsigned short uint16;

#if WINDOWS && !defined(__GNUC__)
	typedef long int32;
	typedef unsigned long uint32;
#else
	typedef int int32;
	typedef unsigned int uint32;
#endif

	static const int32 kMaxLong = 0x7fffffff;
	static const int32 kMinLong = (-0x7fffffff - 1);
	static const int32 kMaxInt32 = kMaxLong;
	static const int32 kMinInt32 = kMinLong;
	static const uint32 kMaxInt32u = 0xffffffff;

#if WINDOWS && !defined(__GNUC__)
	typedef __int64 int64;
	typedef unsigned __int64 uint64;
	static const int64 kMaxInt64 = 9223372036854775807i64;
	static const int64 kMinInt64 = (-9223372036854775807i64 - 1);
#else
	typedef long long int64;
	typedef unsigned long long uint64;
	static const int64 kMaxInt64 = 0x7fffffffffffffffLL;
	static const int64 kMinInt64 = (-0x7fffffffffffffffLL-1);
#endif
	static const uint64 kMaxInt64u = uint64 (0xffffffff) | (uint64 (0xffffffff) << 32);

//-----------------------------------------------------------------
// other Semantic Types
	typedef int64 TSize;   // byte (or other) sizes
	typedef int32 tresult; // result code
//-----------------------------------------------------------------
	static const float kMaxFloat = 3.40282346638528860E38;
	static const double kMaxDouble = 1.7976931348623158E308;

#if PLATFORM_64
	typedef uint64 TPtrInt;
#else
	typedef uint32 TPtrInt;
#endif

//------------------------------------------------------------------
// Boolean
	typedef uint8 TBool;

//------------------------------------------------------------------
// Char / Strings
	typedef char char8;
#ifdef _NATIVE_WCHAR_T_DEFINED
	typedef __wchar_t char16;
#elif SMTG_CPP11
	typedef char16_t char16;
#else
	typedef int16 char16;
#endif

#ifdef UNICODE
	typedef char16 tchar;
#else
	typedef char8 tchar;
#endif

	typedef const char8* CStringA;
	typedef const char16* CStringW;
	typedef const tchar* CString;
	inline bool strEmpty (const tchar* str) { return (!str || *str == 0); }
	inline bool str8Empty (const char8* str) { return (!str || *str == 0); }
	inline bool str16Empty (const char16* str) { return (!str || *str == 0); }

	typedef const char8* FIDString; // identifier as string (used for attributes, messages)

	const FIDString kPlatformStringWin = "WIN";
	const FIDString kPlatformStringMac = "MAC";
	const FIDString kPlatformStringIOS = "IOS";
	const FIDString kPlatformStringLinux = "Linux";
#if WINDOWS
	const FIDString kPlatformString = kPlatformStringWin;
#elif TARGET_OS_IPHONE
	const FIDString kPlatformString = kPlatformStringIOS;
#elif MAC
	const FIDString kPlatformString = kPlatformStringMac;
#elif LINUX
	const FIDString kPlatformString = kPlatformStringLinux;
#endif

//------------------------------------------------------------------------
/** Coordinates	*/
	typedef int32 UCoord;
	static const UCoord kMaxCoord = ((UCoord)0x7FFFFFFF);
	static const UCoord kMinCoord = ((UCoord)-0x7FFFFFFF);
}	// namespace Steinberg

//----------------------------------------------------------------------------
/** Byte-order Conversion Macros */
//----------------------------------------------------------------------------
#define SWAP_32(l) { \
	unsigned char* p = (unsigned char*)& (l); \
	unsigned char t; \
	t = p[0]; p[0] = p[3]; p[3] = t; t = p[1]; p[1] = p[2]; p[2] = t; }

#define SWAP_16(w) { \
	unsigned char* p = (unsigned char*)& (w); \
	unsigned char t; \
	t = p[0]; p[0] = p[1]; p[1] = t; }

#define SWAP_64(i) { \
	unsigned char* p = (unsigned char*)& (i); \
	unsigned char t; \
	t = p[0]; p[0] = p[7]; p[7] = t; t = p[1]; p[1] = p[6]; p[6] = t; \
	t = p[2]; p[2] = p[5]; p[5] = t; t = p[3]; p[3] = p[4]; p[4] = t;}

namespace Steinberg
{
	static inline void FSwap (int8&) {}
	static inline void FSwap (uint8&) {}
	static inline void FSwap (int16& i16) { SWAP_16 (i16) }
	static inline void FSwap (uint16& i16) { SWAP_16 (i16) }
	static inline void FSwap (int32& i32) { SWAP_32 (i32) }
	static inline void FSwap (uint32& i32) { SWAP_32 (i32) }
	static inline void FSwap (int64& i64) { SWAP_64 (i64) }
	static inline void FSwap (uint64& i64) { SWAP_64 (i64) }
}

// always inline macros (only when RELEASE is 1)
//----------------------------------------------------------------------------
#if RELEASE
	#if MAC || LINUX
		#define SMTG_ALWAYS_INLINE	__inline__ __attribute__((__always_inline__))
		#define SMTG_NEVER_INLINE __attribute__((noinline))
	#elif WINDOWS
		#define SMTG_ALWAYS_INLINE	__forceinline
		#define SMTG_NEVER_INLINE __declspec(noinline)
	#endif
#endif

#ifndef SMTG_ALWAYS_INLINE
	#define SMTG_ALWAYS_INLINE	inline
#endif
#ifndef SMTG_NEVER_INLINE
	#define SMTG_NEVER_INLINE
#endif

#ifndef SMTG_CPP11_STDLIBSUPPORT
// Enable this for old compilers
// #define nullptr NULL
#endif


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
// Version     : 1.0
//
// Category    : SDK Core Interfaces
// Filename    : pluginterfaces/test/itest.h
// Created by  : Steinberg, 01/2005
// Description : Test Interface - Availability Depends on HOST
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/funknown.h"

#ifndef kTestClass
#define kTestClass "Test Class" ///< A class for automated tests
#endif

namespace Steinberg {

class ITestResult;

//------------------------------------------------------------------------
// ITest interface declaration
//------------------------------------------------------------------------
class ITest : public FUnknown
{
public:
	//--- ---------------------------------------------------------------------
	/** called immediately before the test is actually run.
		Usually this will be used to setup the test environment.
		\return true upon success	*/
	virtual bool PLUGIN_API setup () = 0;

	/** execute the test.
		\param testResult : points to a test result where the test can
							(optionally) add an error message.
		\return true upon success
		\sa ITestResult */
	virtual bool PLUGIN_API run (ITestResult* testResult) = 0;

	/** called after the test has run. This method shall be used to
		deconstruct a test environment that has been setup with ITest::setup ().
	\return true upon success		*/
	virtual bool PLUGIN_API teardown () = 0;

	/** This function is used to provide information about the performed
		testcase. What is done, what is validated and what has to be prepared
		before executing the test (in case of half-automated tests).
	\return null terminated string upon success, zero otherwise		*/
	virtual const tchar* PLUGIN_API getDescription () {return 0;}
	//--- ---------------------------------------------------------------------
	static const FUID iid;
};

#ifdef UNICODE
DECLARE_CLASS_IID (ITest, 0xFE64FC19, 0x95684F53, 0xAAA78DC8, 0x7228338E)
#else
DECLARE_CLASS_IID (ITest, 0x9E2E608B, 0x64C64CF8, 0x839059BD, 0xA194032D)
#endif

//------------------------------------------------------------------------
// ITestResult interface declaration
//------------------------------------------------------------------------
/** Test Result message logger
[host imp]
when a test is called, a pointer to an ITestResult is passed in, so the
test class can output error messages
*/
//------------------------------------------------------------------------
class ITestResult : public FUnknown
{
public:
	//--- ---------------------------------------------------------------------
	/** add an error message */
	virtual void PLUGIN_API addErrorMessage (const tchar* msg) = 0;
	virtual void PLUGIN_API addMessage (const tchar* msg) = 0;
	//--- ---------------------------------------------------------------------
	static const FUID iid;
};

#ifdef UNICODE
DECLARE_CLASS_IID (ITestResult, 0x69796279, 0xF651418B, 0xB24D79B7, 0xD7C527F4)
#else
DECLARE_CLASS_IID (ITestResult, 0xCE13B461, 0x5334451D, 0xB3943E99, 0x7446885B)
#endif

//------------------------------------------------------------------------
// ITestSuite interface declaration
//------------------------------------------------------------------------
/** A collection of tests supporting a hierarchical ordering
[host imp]
[create via hostclasses]*/
//------------------------------------------------------------------------
class ITestSuite : public FUnknown
{
public:
	//--- ---------------------------------------------------------------------
	/** append a new test */
	virtual tresult PLUGIN_API addTest (FIDString name, ITest* test) = 0;

	/** append an entire test suite as a child suite */
	virtual tresult PLUGIN_API addTestSuite (FIDString name, ITestSuite* testSuite) = 0;

	virtual tresult PLUGIN_API setEnvironment (ITest* environment) = 0;

	//--- ---------------------------------------------------------------------
	static const FUID iid;
};

#ifdef UNICODE
DECLARE_CLASS_IID (ITestSuite, 0x5CA7106F, 0x98784AA5, 0xB4D30D71, 0x2F5F1498)
#else
DECLARE_CLASS_IID (ITestSuite, 0x81724C94, 0xE9F64F65, 0xACB104E9, 0xCC702253)
#endif

//------------------------------------------------------------------------
//  ITestFactory interface declaration
//------------------------------------------------------------------------
/**	Class factory that any testable module defines for creating tests
that will be executed from the host
[plug imp] \n
*/
//------------------------------------------------------------------------
class ITestFactory : public FUnknown
{
public:
	//--- ---------------------------------------------------------------------
	/** create the tests that this module provides.
		\param parentSuite : the test suite that the newly created tests
							shall register with. */
	virtual tresult PLUGIN_API createTests (FUnknown* context, ITestSuite* parentSuite) = 0;
	//--- ---------------------------------------------------------------------
	static const FUID iid;
};

#ifdef UNICODE
DECLARE_CLASS_IID (ITestFactory, 0xAB483D3A, 0x15264650, 0xBF86EEF6, 0x9A327A93)
#else
DECLARE_CLASS_IID (ITestFactory, 0xE77EA913, 0x58AA4838, 0x986A4620, 0x53579080)
#endif

//------------------------------------------------------------------------
} // namespace Steinberg


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK GUI Interfaces
// Filename    : pluginterfaces/gui/iplugview.h
// Created by  : Steinberg, 12/2007
// Description : Plug-in User Interface
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "../base/funknown.h"

namespace Steinberg {

class IPlugFrame;

//------------------------------------------------------------------------
/*! \defgroup pluginGUI Graphical User Interface
*/

//------------------------------------------------------------------------
/**  Graphical rectangle structure. Used with IPlugView.
\ingroup pluginGUI
*/
//------------------------------------------------------------------------
struct ViewRect
{
	ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0)
	: left (l), top (t), right (r), bottom (b)
	{
	}

	int32 left;
	int32 top;
	int32 right;
	int32 bottom;

	//--- ---------------------------------------------------------------------
	int32 getWidth () const { return right - left; }
	int32 getHeight () const { return bottom - top; }
};

//------------------------------------------------------------------------
/**  \defgroup platformUIType Platform UI Types
\ingroup pluginGUI
List of Platform UI types for IPlugView. This list is used to match the GUI-System between
the host and a Plug-in in case that an OS provides multiple GUI-APIs.
*/
/*@{*/
/** The parent parameter in IPlugView::attached() is a HWND handle. You should attach a child window
 * to it. */
const FIDString kPlatformTypeHWND = "HWND"; ///< HWND handle. (Microsoft Windows)

/** The parent parameter in IPlugView::attached() is a WindowRef. You should attach a HIViewRef to
 * the content view of the window. */
const FIDString kPlatformTypeHIView = "HIView"; ///< HIViewRef. (Mac OS X)

/** The parent parameter in IPlugView::attached() is a NSView pointer. You should attach a NSView to it. */
const FIDString kPlatformTypeNSView = "NSView"; ///< NSView pointer. (Mac OS X)

/** The parent parameter in IPlugView::attached() is a UIView pointer. You should attach an UIView to it. */
const FIDString kPlatformTypeUIView = "UIView";		///< UIView pointer. (iOS)

/** The parent parameter in IPlugView::attached() is a X11 Window supporting XEmbed. You should attach
 * a Window to it. */
const FIDString kPlatformTypeX11EmbedWindowID = "X11EmbedWindowID"; ///< X11 Window ID. (X11)

/*@}*/
//------------------------------------------------------------------------

//------------------------------------------------------------------------
/**  Plug-in definition of a view.
\ingroup pluginGUI
- [plug imp]

\par Sizing of a view
Usually the size of a Plug-in view is fixed. But both the host and the Plug-in can cause
a view to be resized:
\n
- <b> Host </b> : If IPlugView::canResize () returns kResultTrue the host will setup the window
  so that the user can resize it. While the user resizes the window IPlugView::checkSizeConstraint
()
  is called, allowing the Plug-in to change the size to a valid rect. The host then resizes the
window to this rect and has to call IPlugView::onSize ().
\n
\n
- <b> Plug-in </b> : The Plug-in can call IPlugFrame::resizeView () and cause the host to resize the
window.
  Afterwards the host has to call IPlugView::onSize () if a resize is needed (size was changed).
  Note that if the host calls IPlugView::getSize () before calling IPlugView::onSize () (if needed),
  it will get the current (old) size not the wanted one!!
  Here the calling sequence:
    * plug-in->host: IPlugFrame::resizeView (newSize)
    * host->plug-in (optional): IPlugView::getSize () returns the currentSize (not the wanted
newSize)!
    * host->plug-in: if newSize is different than its actual current size: IPlugView::onSize
(newSize)
    * host->plug-in (optional): IPlugView::getSize () returns the newSize
\n
Please only resize the platform representation of the view when IPlugView::onSize () is called.

\par Keyboard handling
The Plug-in view receives keyboard events from the host. A view implementation must not handle
keyboard events by the means of platform callbacks, but let the host pass them to the view. The host
depends on a proper return value when IPlugView::onKeyDown is called, otherwise the Plug-in view may
cause a malfunction of the host's key command handling!

\see IPlugFrame, \ref platformUIType
*/
//------------------------------------------------------------------------
class IPlugView: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Is Platform UI Type supported
	    \param type : IDString of \ref platformUIType */
	virtual tresult PLUGIN_API isPlatformTypeSupported (FIDString type) = 0;

	/** The parent window of the view has been created, the (platform) representation of the view
	   should now be created as well.
	    Note that the parent is owned by the caller and you are not allowed to alter it in any way
	   other than adding your own views.
	    Note that in this call the Plug-in could call a IPlugFrame::resizeView ()!
	    \param parent : platform handle of the parent window or view
	    \param type : \ref platformUIType which should be created */
	virtual tresult PLUGIN_API attached (void* parent, FIDString type) = 0;

	/** The parent window of the view is about to be destroyed.
	    You have to remove all your own views from the parent window or view. */
	virtual tresult PLUGIN_API removed () = 0;

	/** Handling of mouse wheel. */
	virtual tresult PLUGIN_API onWheel (float distance) = 0;

	/** Handling of keyboard events : Key Down.
	    \param key : unicode code of key
	    \param keyCode : virtual keycode for non ascii keys - see \ref VirtualKeyCodes in keycodes.h
	    \param modifiers : any combination of modifiers - see \ref KeyModifier in keycodes.h
	    \return kResultTrue if the key is handled, otherwise kResultFalse. \n
	            <b> Please note that kResultTrue must only be returned if the key has really been
	   handled. </b> Otherwise key command handling of the host might be blocked! */
	virtual tresult PLUGIN_API onKeyDown (char16 key, int16 keyCode, int16 modifiers) = 0;

	/** Handling of keyboard events : Key Up.
	    \param key : unicode code of key
	    \param keyCode : virtual keycode for non ascii keys - see \ref VirtualKeyCodes in keycodes.h
	    \param modifiers : any combination of KeyModifier - see \ref KeyModifier in keycodes.h
	    \return kResultTrue if the key is handled, otherwise return kResultFalse. */
	virtual tresult PLUGIN_API onKeyUp (char16 key, int16 keyCode, int16 modifiers) = 0;

	/** Returns the size of the platform representation of the view. */
	virtual tresult PLUGIN_API getSize (ViewRect* size) = 0;

	/** Resizes the platform representation of the view to the given rect. Note that if the Plug-in
	 * requests a resize (IPlugFrame::resizeView ()) onSize has to be called afterward. */
	virtual tresult PLUGIN_API onSize (ViewRect* newSize) = 0;

	/** Focus changed message. */
	virtual tresult PLUGIN_API onFocus (TBool state) = 0;

	/** Sets IPlugFrame object to allow the Plug-in to inform the host about resizing. */
	virtual tresult PLUGIN_API setFrame (IPlugFrame* frame) = 0;

	/** Is view sizable by user. */
	virtual tresult PLUGIN_API canResize () = 0;

	/** On live resize this is called to check if the view can be resized to the given rect, if not
	 * adjust the rect to the allowed size. */
	virtual tresult PLUGIN_API checkSizeConstraint (ViewRect* rect) = 0;
//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IPlugView, 0x5BC32507, 0xD06049EA, 0xA6151B52, 0x2B755B29)

//------------------------------------------------------------------------
/** Callback interface passed to IPlugView.
\ingroup pluginGUI
- [host imp]

Enables a Plug-in to resize the view and cause the host to resize the window.
*/
//------------------------------------------------------------------------
class IPlugFrame : public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Called to inform the host about the resize of a given view.
	    Afterwards the host has to call IPlugView::onSize (). */
	virtual tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* newSize) = 0;
//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IPlugFrame, 0x367FAF01, 0xAFA94693, 0x8D4DA2A0, 0xED0882A3)

//------------------------------------------------------------------------
class IPlugViewIdleHandler : public FUnknown
{
public:
	virtual void PLUGIN_API onPlugViewIdle () = 0;

//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IPlugViewIdleHandler, 0x35BD6C3A, 0x9C1F4073, 0x89C7DA88, 0xBF6595D3)

//------------------------------------------------------------------------
/** Extension to IPlugFrame
\ingroup pluginGUI
- [host impl]

Enables a Plug-in to add an idle handler to the main event loop (Linux only)
*/
//------------------------------------------------------------------------
class IPlugFrameIdle : public FUnknown
{
public:
	virtual tresult PLUGIN_API addIdleHandler (IPlugViewIdleHandler* handler) = 0;
	virtual tresult PLUGIN_API removeIdleHandler (IPlugViewIdleHandler* handler) = 0;

//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IPlugFrameIdle, 0x31DE26C9, 0x36654639, 0x9F858E64, 0xE211817A)

//------------------------------------------------------------------------
} // namespace Steinberg


text:
//-----------------------------------------------------------------------------
// Project     : SDK Core
//
// Category    : SDK GUI Interfaces
// Filename    : pluginterfaces/gui/iplugviewcontentscalesupport.h
// Created by  : Steinberg, 06/2016
// Description : Plug-in User Interface Scaling
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/funknown.h"

//------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h"
//------------------------------------------------------------------------

//------------------------------------------------------------------------
namespace Steinberg {

//------------------------------------------------------------------------
/** Plug-in view content scale support
\ingroup pluginGUI
- [plug impl]
- [extends IPlugView]
- [optional]

This interface communicates the content scale factor from the host to the plug-in view on
systems where plug-ins cannot get this information directly like Microsoft Windows.

The host calls setContentScaleFactor directly after the plug view was attached and when the scale
factor changes (system change or window moved to another screen with different scaling settings)
When a plug-in handles this, it needs to scale the width and height of its view by the scale factor
and inform the host via a IPlugView::resizeView().
 */
class IPlugViewContentScaleSupport : public FUnknown
{
public:
//------------------------------------------------------------------------
	typedef float ScaleFactor;

	virtual tresult PLUGIN_API setContentScaleFactor (ScaleFactor factor) = 0;
//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IPlugViewContentScaleSupport, 0x65ED9690, 0x8AC44525, 0x8AADEF7A, 0x72EA703F)

//------------------------------------------------------------------------
} // namespace Steinberg

//------------------------------------------------------------------------
#include "pluginterfaces/base/falignpop.h"
//------------------------------------------------------------------------


text:
//-----------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstcomponent.h
// Created by  : Steinberg, 04/2005
// Description : Basic VST Interfaces
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/ipluginbase.h"
#include "vsttypes.h"

//------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h"
//------------------------------------------------------------------------

namespace Steinberg {
class IBStream;

//------------------------------------------------------------------------
/** All VST specific interfaces are located in Vst namespace */
//------------------------------------------------------------------------
namespace Vst {
const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode; ///< Standard value for PFactoryInfo::flags

#define BEGIN_FACTORY_DEF(vendor,url,email) using namespace Steinberg; \
	EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory () { \
	if (!gPluginFactory) \
	{	static PFactoryInfo factoryInfo (vendor,url,email,Vst::kDefaultFactoryFlags); \
		gPluginFactory = new CPluginFactory (factoryInfo);

//------------------------------------------------------------------------
/** \defgroup vstBus VST Buses
@{*/

//------------------------------------------------------------------------
/** Bus media types */
//------------------------------------------------------------------------
enum MediaTypes
{
//------------------------------------------------------------------------
	kAudio = 0,		///< audio
	kEvent,			///< events
	kNumMediaTypes
//------------------------------------------------------------------------
};

//------------------------------------------------------------------------
/** Bus directions */
//------------------------------------------------------------------------
enum BusDirections
{
//------------------------------------------------------------------------
	kInput = 0,		///< input bus
	kOutput			///< output bus
//------------------------------------------------------------------------
};

//------------------------------------------------------------------------
/** Bus types */
//------------------------------------------------------------------------
enum BusTypes
{
//------------------------------------------------------------------------
	kMain = 0,		///< main bus
	kAux			///< auxiliary bus (sidechain)
//------------------------------------------------------------------------
};

//------------------------------------------------------------------------
/** Bus Description

    A bus can be understood as a 'collection of data channels' belonging together.
    It describes a data input or a data output of the Plug-in.
    A VST component can define any desired number of buses, but this number must \b never change.
    Dynamic usage of buses is handled in the host by activating and deactivating buses.
	The component has to define the maximum number of supported buses and it has to
	define which of them are active by default. A host that can handle multiple buses,
	allows the user to activate buses that were initially inactive.

See also: IComponent::getBusInfo , IComponent::activateBus
*/
//------------------------------------------------------------------------
struct BusInfo
{
//------------------------------------------------------------------------
	MediaType mediaType;	///< Media type - has to be a value of \ref MediaTypes
	BusDirection direction; ///< input or output \ref BusDirections
	int32 channelCount;		///< number of channels (if used then need to be recheck after \ref
							/// IAudioProcessor::setBusArrangements is called).
							/// For a bus of type MediaTypes::kEvent the channelCount corresponds
							/// to the number of supported MIDI channels by this bus
	String128 name;			///< name of the bus
	BusType busType;		///< main or aux - has to be a value of \ref BusTypes
	uint32 flags;			///< flags - a combination of \ref BusFlags
	enum BusFlags
	{
		kDefaultActive = 1 << 0 ///< bus active per default
	};
//------------------------------------------------------------------------
};

/*@}*/

//------------------------------------------------------------------------
/** I/O modes */
//------------------------------------------------------------------------
enum IoModes
{
	kSimple = 0,		///< 1:1 Input / Output. Only used for Instruments. See \ref vst3IoMode
	kAdvanced,			///< n:m Input / Output. Only used for Instruments.
	kOfflineProcessing	///< Plug-in used in an offline processing context
};

//------------------------------------------------------------------------
/** Routing Information.
    When the Plug-in supports multiple I/O buses, a host may want to know how the
    buses are related. The relation of an event-input-channel to an audio-output-bus
	in particular is of interest to the host (in order to relate MIDI-tracks to audio-channels)
    \n See also: IComponent::getRoutingInfo, \ref vst3Routing */
//------------------------------------------------------------------------
struct RoutingInfo
{
	MediaType mediaType;	///< media type see \ref MediaTypes
	int32 busIndex;			///< bus index
	int32 channel;			///< channel (-1 for all channels)
};

//------------------------------------------------------------------------
// IComponent Interface
//------------------------------------------------------------------------
/** Component Base Interface
\ingroup vstIPlug vst300
- [plug imp]
- [released: 3.0.0]
- [mandatory]

This is the basic interface for a VST component and must always be supported.
It contains the common parts of any kind of processing class. The parts that
are specific to a media type are defined in a separate interface. An implementation
component must provide both the specific interface and IComponent.
*/
class IComponent: public IPluginBase
{
public:
//------------------------------------------------------------------------
	/** Called before initializing the component to get information about the controller class. */
	virtual tresult PLUGIN_API getControllerClassId (TUID classId) = 0;

	/** Called before 'initialize' to set the component usage (optional). See \ref IoModes */
	virtual tresult PLUGIN_API setIoMode (IoMode mode) = 0;

	/** Called after the Plug-in is initialized. See \ref MediaTypes, BusDirections */
	virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) = 0;

	/** Called after the Plug-in is initialized. See \ref MediaTypes, BusDirections */
	virtual tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& bus /*out*/) = 0;

	/** Retrieves routing information (to be implemented when more than one regular input or output bus exists).
	    The inInfo always refers to an input bus while the returned outInfo must refer to an output bus! */
	virtual tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo /*out*/) = 0;

	/** Called upon (de-)activating a bus in the host application. The Plug-in should only processed an activated bus,
	    the host could provide less see \ref AudioBusBuffers in the process call (see \ref IAudioProcessor::process) if last buses are not activated */
	virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state) = 0;

	/** Activates / deactivates the component. */
	virtual tresult PLUGIN_API setActive (TBool state) = 0;

	/** Sets complete state of component. */
	virtual tresult PLUGIN_API setState (IBStream* state) = 0;

	/** Retrieves complete state of component. */
	virtual tresult PLUGIN_API getState (IBStream* state) = 0;

//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IComponent, 0xE831FF31, 0xF2D54301, 0x928EBBEE, 0x25697802)

//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg

//------------------------------------------------------------------------
#include "pluginterfaces/base/falignpop.h"
//------------------------------------------------------------------------


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/vsttypes.h
// Created by  : Steinberg, 12/2005
// Description : common defines
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/fstrdefs.h"

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
#ifndef kVstVersionString
#define kVstVersionString	"VST 3.6.7"	///< SDK version for PClassInfo2
#endif

#define kVstVersionMajor	3
#define kVstVersionMinor	6
#define kVstVersionSub		7

// this allows to write things like: #if VST_VERSION >= 0x030500 // note that 3.10.0 is 0x030a00
#define VST_VERSION ((kVstVersionMajor << 16) | (kVstVersionMinor << 8) | kVstVersionSub)

//------------------------------------------------------------------------
// struct alignment definitions
//------------------------------------------------------------------------
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
	#define VST3_STRUCT	struct __attribute__((aligned(4)))
#elif WINDOWS
	#if PLATFORM_64
		#define VST3_PACKED_SIZE	8
	#else
		#define VST3_PACKED_SIZE	4
	#endif
	#define VST3_STRUCT	__declspec(align(VST3_PACKED_SIZE)) struct
#else
	#error "unsupported compiler"
#endif

//------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types
*/
/*@{*/
//------------------------------------------------------------------------
// string types
//------------------------------------------------------------------------
typedef char16 TChar;			///< UTF-16 character
typedef TChar String128[128];	///< 128 character UTF-16 string
typedef const char8* CString;	///< C-String

//------------------------------------------------------------------------
// general
//------------------------------------------------------------------------
typedef int32 MediaType;		///< media type (audio/event)
typedef int32 BusDirection;		///< bus direction (in/out)
typedef int32 BusType;			///< bus type (main/aux)
typedef int32 IoMode;			///< I/O mode
typedef int32 UnitID;			///< unit identifier
typedef double ParamValue;		///< parameter value type
typedef uint32 ParamID;			///< parameter identifier
typedef int32 ProgramListID;	///< program list identifier
typedef int16 CtrlNumber;		///< MIDI controller number (see \ref ControllerNumbers for allowed values)

typedef double TQuarterNotes;	///< time expressed in quarter notes
typedef int64 TSamples;			///< time expressed in audio samples

typedef uint32 ColorSpec;		///< color defining by 4 component ARGB value (Alpha/Red/Green/Blue)

//------------------------------------------------------------------------
// Audio Types
//------------------------------------------------------------------------
typedef float Sample32;				///< 32-bit precision audio sample
typedef double Sample64;			///< 64-bit precision audio sample
typedef double SampleRate;			///< sample rate
/*@}*/

//------------------------------------------------------------------------
/** \defgroup speakerArrangements Speaker Arrangements
\image html "vst3_speaker_types.jpg"
\n
A SpeakerArrangement is a bitset combination of speakers. For example:
\code
const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; // => hex: 0x03 / binary: 0011.
\endcode*/
//------------------------------------------------------------------------
/**@{*/
typedef uint64 SpeakerArrangement;	///< Bitset of speakers
typedef uint64 Speaker;	            ///< Bit for one speaker
/**@}*/

//------------------------------------------------------------------------
/** Speaker Definitions.
\ingroup speakerArrangements */
//------------------------------------------------------------------------
/**@{*/
const Speaker kSpeakerL    = 1 << 0;		///< Left (L)
const Speaker kSpeakerR    = 1 << 1;		///< Right (R)
const Speaker kSpeakerC    = 1 << 2;		///< Center (C)
const Speaker kSpeakerLfe  = 1 << 3;		///< Subbass (Lfe)
const Speaker kSpeakerLs   = 1 << 4;		///< Left Surround (Ls)
const Speaker kSpeakerRs   = 1 << 5;		///< Right Surround (Rs)
const Speaker kSpeakerLc   = 1 << 6;		///< Left of Center (Lc) - Front Left Center
const Speaker kSpeakerRc   = 1 << 7;		///< Right of Center (Rc) - Front Right Center
const Speaker kSpeakerS    = 1 << 8;		///< Surround (S)
const Speaker kSpeakerCs   = kSpeakerS;		///< Center of Surround (Cs) - Back Center - Surround (S)
const Speaker kSpeakerSl   = 1 << 9;		///< Side Left (Sl)
const Speaker kSpeakerSr   = 1 << 10;		///< Side Right (Sr)
const Speaker kSpeakerTc   = 1 << 11;		///< Top Center Over-head, Top Middle (Tc)
const Speaker kSpeakerTfl  = 1 << 12;		///< Top Front Left (Tfl)
const Speaker kSpeakerTfc  = 1 << 13;		///< Top Front Center (Tfc)
const Speaker kSpeakerTfr  = 1 << 14;		///< Top Front Right (Tfr)
const Speaker kSpeakerTrl  = 1 << 15;		///< Top Rear/Back Left (Trl)
const Speaker kSpeakerTrc  = 1 << 16;		///< Top Rear/Back Center (Trc)
const Speaker kSpeakerTrr  = 1 << 17;		///< Top Rear/Back Right (Trr)
const Speaker kSpeakerLfe2 = 1 << 18;		///< Subbass 2 (Lfe2)
const Speaker kSpeakerM    = 1 << 19;		///< Mono (M)

const Speaker kSpeakerW	 = 1 << 20;			///< B-Format W
const Speaker kSpeakerX	 = 1 << 21;			///< B-Format X
const Speaker kSpeakerY	 = 1 << 22;			///< B-Format Y
const Speaker kSpeakerZ	 = 1 << 23;			///< B-Format Z

const Speaker kSpeakerTsl = 1 << 24;		///< Top Side Left (Tsl)
const Speaker kSpeakerTsr = 1 << 25;		///< Top Side Right (Tsr)
const Speaker kSpeakerLcs = 1 << 26;		///< Left of Center Surround (Lcs) - Back Left Center
const Speaker kSpeakerRcs = 1 << 27;		///< Right of Center Surround (Rcs) - Back Right Center

const Speaker kSpeakerBfl = 1 << 28;		///< Bottom Front Left (Bfl)
const Speaker kSpeakerBfc = 1 << 29;		///< Bottom Front Center (Bfc)
const Speaker kSpeakerBfr = 1 << 30;		///< Bottom Front Right (Bfr)

const Speaker kSpeakerPl  = (Speaker)1 << 31;	///< Proximity Left (Pl)
const Speaker kSpeakerPr  = (Speaker)1 << 32;	///< Proximity Right (Pr)
//------------------------------------------------------------------------
/** @}*/

//------------------------------------------------------------------------
/** Speaker Arrangement Definitions (SpeakerArrangement)*/
//------------------------------------------------------------------------
namespace SpeakerArr
{
//------------------------------------------------------------------------
/** Speaker Arrangement Definitions.
\ingroup speakerArrangements */
/*@{*/
const SpeakerArrangement kEmpty			 = 0;          ///< empty arrangement
const SpeakerArrangement kMono			 = kSpeakerM;  ///< M
const SpeakerArrangement kStereo		 = kSpeakerL   | kSpeakerR;    ///< L R
const SpeakerArrangement kStereoSurround = kSpeakerLs  | kSpeakerRs;   ///< Ls Rs
const SpeakerArrangement kStereoCenter	 = kSpeakerLc  | kSpeakerRc;   ///< Lc Rc
const SpeakerArrangement kStereoSide	 = kSpeakerSl  | kSpeakerSr;   ///< Sl Sr
const SpeakerArrangement kStereoCLfe	 = kSpeakerC   | kSpeakerLfe;  ///< C Lfe
const SpeakerArrangement kStereoTF		 = kSpeakerTfl | kSpeakerTfr;  ///< Tfl Tfr
const SpeakerArrangement kStereoTS		 = kSpeakerTsl | kSpeakerTsr;  ///< Tsl Tsr
const SpeakerArrangement kStereoTR		 = kSpeakerTrl | kSpeakerTrr;  ///< Trl Trr
const SpeakerArrangement kStereoBF		 = kSpeakerBfl | kSpeakerBfr;  ///< Bfl Bfr

/** L R C */
const SpeakerArrangement k30Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC;
/** L R S */
const SpeakerArrangement k30Music		 = kSpeakerL  | kSpeakerR | kSpeakerS;
/** L R C   Lfe */
const SpeakerArrangement k31Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe;
/** L R Lfe S */
const SpeakerArrangement k31Music		 = kSpeakerL  | kSpeakerR | kSpeakerLfe | kSpeakerS;
/** L R C   S (LCRS) */
const SpeakerArrangement k40Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerS;
/** L R Ls  Rs (Quadro) */
const SpeakerArrangement k40Music		 = kSpeakerL  | kSpeakerR | kSpeakerLs  | kSpeakerRs;
/** L R C   Lfe S (LCRS+Lfe) */
const SpeakerArrangement k41Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerS;
/** L R Lfe Ls Rs (Quadro+Lfe) */
const SpeakerArrangement k41Music		 = kSpeakerL  | kSpeakerR | kSpeakerLfe | kSpeakerLs  | kSpeakerRs;
/** L R C   Ls Rs */
const SpeakerArrangement k50			 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs;
/** L R C  Lfe Ls Rs */
const SpeakerArrangement k51			 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
/** L R C  Ls  Rs Cs */
const SpeakerArrangement k60Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs | kSpeakerCs;
/** L R Ls Rs  Sl Sr */
const SpeakerArrangement k60Music		 = kSpeakerL  | kSpeakerR | kSpeakerLs  | kSpeakerRs  | kSpeakerSl | kSpeakerSr;
/** L R C  Lfe Ls Rs Cs */
const SpeakerArrangement k61Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs;
/** L R Lfe Ls  Rs Sl Sr */
const SpeakerArrangement k61Music		 = kSpeakerL  | kSpeakerR | kSpeakerLfe | kSpeakerLs  | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C   Ls  Rs Lc Rc */
const SpeakerArrangement k70Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs | kSpeakerLc | kSpeakerRc;
/** L R C   Ls  Rs Sl Sr */
const SpeakerArrangement k70Music		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Lc Rc */
const SpeakerArrangement k71Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc;
const SpeakerArrangement k71CineFullFront= k71Cine;
/** L R C Lfe Ls Rs Lcs Rcs */
const SpeakerArrangement k71CineFullRear = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs;
/** L R C Lfe Ls Rs Sl Sr */
const SpeakerArrangement k71Music		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
const SpeakerArrangement k71CineSideFill = k71Music;
/** L R C Lfe Ls Rs Pl Pr */
const SpeakerArrangement k71Proximity	 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerPl | kSpeakerPr;
/** L R C Ls  Rs Lc Rc Cs */
const SpeakerArrangement k80Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs;
/** L R C Ls  Rs Cs Sl Sr */
const SpeakerArrangement k80Music		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLs  | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Lc Rc Cs */
const SpeakerArrangement k81Cine		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs;
/** L R C Lfe Ls Rs Cs Sl Sr */
const SpeakerArrangement k81Music		 = kSpeakerL  | kSpeakerR | kSpeakerC   | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;

/** W X Y Z (First Order) */
const SpeakerArrangement kBFormat1stOrder = kSpeakerW | kSpeakerX | kSpeakerY   | kSpeakerZ;
const SpeakerArrangement kBFormat		 = kBFormat1stOrder;

/*-----------*/
/* 3D formats */
/*-----------*/
/** L R Ls Rs Tfl Tfr Trl Trr */
const SpeakerArrangement k80Cube		   = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs  | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Cs Tc */
const SpeakerArrangement k71CineTopCenter  = kSpeakerL | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs  | kSpeakerTc;
/** L R C Lfe Ls Rs Cs Tfc */
const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs  | kSpeakerTfc;
/** L R C Lfe Ls Rs Tfl Tfr */
const SpeakerArrangement k71CineFrontHigh  = kSpeakerL | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr;
const SpeakerArrangement k71MPEG3D		   = k71CineFrontHigh;
/** L R C Lfe Ls Rs Tsl Tsr */
const SpeakerArrangement k71CineSideHigh   = kSpeakerL | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr;

/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */
const SpeakerArrangement k81MPEG3D		 = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
										   kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc;

/** L R C Ls Rs Tfl Tfr Trl Trr */
const SpeakerArrangement k90			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLs  | kSpeakerRs |
										   kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */
const SpeakerArrangement k91			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs  |
										   kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;

/** L R C Lfe Ls Rs Sl Sr Tsl Tsr */
const SpeakerArrangement k71_2			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs |
										   kSpeakerRs | kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;
const SpeakerArrangement k91Atmos = k71_2;

/** L R C Ls Rs Tc Tfl Tfr Trl Trr */
const SpeakerArrangement k100			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLs  | kSpeakerRs |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */
const SpeakerArrangement k101			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs  |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
const SpeakerArrangement k101MPEG3D		 = k101;

/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */
const SpeakerArrangement k102			 = kSpeakerL  | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs  |
										   kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;

/** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */
const SpeakerArrangement k110			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLs  | kSpeakerRs |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */
const SpeakerArrangement k111			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */
const SpeakerArrangement k122			 = kSpeakerL  | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs	| kSpeakerLc  | kSpeakerRc |
										   kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
/** L R C Ls Rs Cs Tc Tfl Tfc Tfr Trl Trc Trr */
const SpeakerArrangement k130			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLs  | kSpeakerRs | kSpeakerSl | kSpeakerSr |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Cs Tc Tfl Tfc Tfr Trl Trc Trr */
const SpeakerArrangement k131			 = kSpeakerL  | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;

/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Lfe2 Tsl Tsr Bfl Bfc Bfr */
const SpeakerArrangement k222			 = kSpeakerL  | kSpeakerR | kSpeakerC  | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr |
										   kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr |
										   kSpeakerBfl| kSpeakerBfc | kSpeakerBfr;

//------------------------------------------------------------------------
/** Speaker Arrangement String Representation.
\ingroup speakerArrangements */
/*@{*/
const CString kStringEmpty		= "";
const CString kStringMono		= "Mono";
const CString kStringStereo		= "Stereo";
const CString kStringStereoR	= "Stereo (Ls Rs)";
const CString kStringStereoC	= "Stereo (Lc Rc)";
const CString kStringStereoSide	= "Stereo (Sl Sr)";
const CString kStringStereoCLfe	= "Stereo (C LFE)";
const CString kStringStereoTF	= "Stereo (Tfl Tfr)";
const CString kStringStereoTS	= "Stereo (Tsl Tsr)";
const CString kStringStereoTR	= "Stereo (Trl Trr)";
const CString kStringStereoBF	= "Stereo (Bfl Bfr)";

const CString kString30Cine		= "LRC";
const CString kString30Music	= "LRS";
const CString kString31Cine		= "LRC+LFE";
const CString kString31Music	= "LRS+LFE";
const CString kString40Cine		= "LRCS";
const CString kString40Music	= "Quadro";
const CString kString41Cine		= "LRCS+LFE";
const CString kString41Music	= "Quadro+LFE";
const CString kString50			= "5.0";
const CString kString51			= "5.1";
const CString kString60Cine		= "6.0 Cine";
const CString kString60Music	= "6.0 Music";
const CString kString61Cine		= "6.1 Cine";
const CString kString61Music	= "6.1 Music";
const CString kString70Cine		= "7.0 Cine (SDDS)";
const CString kString70Music	= "7.0 Music (Dolby)";
const CString kString71Cine		= "7.1 Cine (SDDS)";
const CString kString71Music	= "7.1 Music (Dolby)";
const CString kString71CineTopCenter	= "7.1 Cine Top Center";
const CString kString71CineCenterHigh	= "7.1 Cine Center High";
const CString kString71CineFrontHigh	= "7.1 Cine Front High";
const CString kString71CineSideHigh		= "7.1 Cine Side High";
const CString kString71CineFullRear		= "7.1 Cine Full Rear";
const CString kString71Proximity		= "7.1 Proximity";
const CString kString80Cine		= "8.0 Cine";
const CString kString80Music	= "8.0 Music";
const CString kString80Cube		= "8.0 Cube";
const CString kString81Cine		= "8.1 Cine";
const CString kString81Music	= "8.1 Music";
const CString kString102		= "10.2 Experimental";
const CString kString122		= "12.2";
const CString kString90			= "9.0 Auro-3D";
const CString kString91			= "9.1 Auro-3D";
const CString kString91Atmos	= "9.1 Dolby Atmos";
const CString kString100		= "10.0 Auro-3D";
const CString kString101		= "10.1 Auro-3D";
const CString kString110		= "11.0 Auro-3D";
const CString kString111		= "11.1 Auro-3D";
const CString kString130		= "13.0 Auro-3D";
const CString kString131		= "13.1 Auro-3D";
const CString kString81MPEG		= "8.1 MPEG";
const CString kString222		= "22.2";
const CString kStringBFormat1stOrder = "BFormat";
/*@}*/

//------------------------------------------------------------------------
/** Speaker Arrangement String Representation with Speakers Name.
\ingroup speakerArrangements */
/*@{*/
const CString kStringMonoS		= "M";
const CString kStringStereoS	= "L R";
const CString kStringStereoRS	= "Ls Rs";
const CString kStringStereoCS	= "Lc Rc";
const CString kStringStereoSS	= "Sl Sr";
const CString kStringStereoCLfeS= "C LFE";
const CString kStringStereoTFS	= "Tfl Tfr";
const CString kStringStereoTSS	= "Tsl Tsr";
const CString kStringStereoTRS	= "Trl Trr";
const CString kStringStereoBFS	= "Bfl Bfr";
const CString kString30CineS	= "L R C";
const CString kString30MusicS	= "L R S";
const CString kString31CineS	= "L R C LFE";
const CString kString31MusicS	= "L R LFE S";
const CString kString40CineS	= "L R C S";
const CString kString40MusicS	= "L R Ls Rs";
const CString kString41CineS	= "L R C LFE S";
const CString kString41MusicS	= "L R LFE Ls Rs";
const CString kString50S		= "L R C Ls Rs";
const CString kString51S		= "L R C LFE Ls Rs";
const CString kString60CineS	= "L R C Ls Rs Cs";
const CString kString60MusicS	= "L R Ls Rs Sl Sr";
const CString kString61CineS	= "L R C LFE Ls Rs Cs";
const CString kString61MusicS	= "L R LFE Ls Rs Sl Sr";
const CString kString70CineS	= "L R C Ls Rs Lc Rc";
const CString kString70MusicS	= "L R C Ls Rs Sl Sr";
const CString kString71CineS	= "L R C LFE Ls Rs Lc Rc";
const CString kString71MusicS	= "L R C LFE Ls Rs Sl Sr";
const CString kString80CineS	= "L R C Ls Rs Lc Rc Cs";
const CString kString80MusicS	= "L R C Ls Rs Cs Sl Sr";
const CString kString81CineS	= "L R C LFE Ls Rs Lc Rc Cs";
const CString kString81MusicS	= "L R C LFE Ls Rs Cs Sl Sr";
const CString kString80CubeS	= "L R Ls Rs Tfl Tfr Trl Trr";
const CString kStringBFormat1stOrderS	= "W X Y Z";
const CString kString71CineTopCenterS	= "L R C LFE Ls Rs Cs Tc";
const CString kString71CineCenterHighS	= "L R C LFE Ls Rs Cs Tfc";
const CString kString71CineFrontHighS	= "L R C LFE Ls Rs Tfl Tfl";
const CString kString71CineSideHighS	= "L R C LFE Ls Rs Tsl Tsl";
const CString kString71CineFullRearS	= "L R C LFE Ls Rs Lcs Rcs";
const CString kString71ProximityS		= "L R C LFE Ls Rs Pl Pr";
const CString kString90S		= "L R C Ls Rs Tfl Tfr Trl Trr";
const CString kString91S		= "L R C LFE Ls Rs Tfl Tfr Trl Trr";
const CString kString91AtmosS	= "L R C LFE Ls Rs Sl Sr Tsl Tsr";
const CString kString100S		= "L R C Ls Rs Tc Tfl Tfr Trl Trr";
const CString kString101S		= "L R C LFE Ls Rs Tc Tfl Tfr Trl Trr";
const CString kString110S		= "L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr";
const CString kString111S		= "L R C LFE Ls Rs Tc Tfl Tfc Tfr Trl Trr";
const CString kString130S		= "L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr";
const CString kString131S		= "L R C LFE Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr";
const CString kString102S		= "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr LFE2";
const CString kString122S		= "L R C LFE Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr LFE2";
const CString kString81MPEGS	= "L R LFE Ls Rs Tfl Tfc Tfr Bfc";
const CString kString222S		= "L R C LFE Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr LFE2 Tsl Tsr Bfl Bfc Bfr";

/*@}*/

//------------------------------------------------------------------------
/** Returns number of channels used in speaker arrangement.
\ingroup speakerArrangements */
/*@{*/
inline int32 getChannelCount (SpeakerArrangement arr)
{
	int32 count = 0;
	while (arr)
	{
		if (arr & (SpeakerArrangement)1)
			++count;
		arr >>= 1;
	}
	return count;
}

//------------------------------------------------------------------------
/** Returns the index of a given speaker in a speaker arrangement (-1 if speaker is not part of the arrangement). */
inline int32 getSpeakerIndex (Speaker speaker, SpeakerArrangement arrangement)
{
	// check if speaker is present in arrangement
	if ((arrangement & speaker) == 0)
		return -1;

	int32 result = 0;
	Speaker i = 1;
	while (i < speaker)
	{
		if (arrangement & i)
			result++;
		i <<= 1;
	}

	return result;
}

//------------------------------------------------------------------------
/** Returns the speaker for a given index in a speaker arrangement (return 0 when out of range). */
inline Speaker getSpeaker (const SpeakerArrangement& arr, int32 index)
{
	SpeakerArrangement arrTmp = arr;

	int32 index2 = -1;
	int32 pos = -1;
	while (arrTmp)
	{
		if (arrTmp & 0x1)
			index2++;
		pos++;
		if (index2 == index)
			return (Speaker)1 << pos;

		arrTmp = arrTmp >> 1;
	}
	return 0;
}

//------------------------------------------------------------------------
/** Returns true if arrSubSet is a subset speaker of arr (means each speaker of arrSubSet is included in arr). */
inline bool isSubsetOf (const SpeakerArrangement& arrSubSet, const SpeakerArrangement& arr)
{
	return (arrSubSet == (arrSubSet & arr));
}

//------------------------------------------------------------------------
/** Returns the speaker arrangement associated to a string representation.
	Returns kEmpty if no associated arrangement is known.
*/
inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
{
	if (!strcmp8 (arrStr, kStringMono))
		return kMono;
	if (!strcmp8 (arrStr, kStringStereo))
		return kStereo;
	if (!strcmp8 (arrStr, kStringStereoR))
		return kStereoSurround;
	if (!strcmp8 (arrStr, kStringStereoC))
		return kStereoCenter;
	if (!strcmp8 (arrStr, kStringStereoSide))
		return kStereoSide;
	if (!strcmp8 (arrStr, kStringStereoCLfe))
		return kStereoCLfe;
	if (!strcmp8 (arrStr, kStringStereoTF))
		return kStereoTF;
	if (!strcmp8 (arrStr, kStringStereoTS))
		return kStereoTS;
	if (!strcmp8 (arrStr, kStringStereoTR))
		return kStereoTR;
	if (!strcmp8 (arrStr, kStringStereoBF))
		return kStereoBF;
	if (!strcmp8 (arrStr, kString30Cine))
		return k30Cine;
	if (!strcmp8 (arrStr, kString30Music))
		return k30Music;
	if (!strcmp8 (arrStr, kString31Cine))
		return k31Cine;
	if (!strcmp8 (arrStr, kString31Music))
		return k31Music;
	if (!strcmp8 (arrStr, kString40Cine))
		return k40Cine;
	if (!strcmp8 (arrStr, kString40Music))
		return k40Music;
	if (!strcmp8 (arrStr, kString41Cine))
		return k41Cine;
	if (!strcmp8 (arrStr, kString41Music))
		return k41Music;
	if (!strcmp8 (arrStr, kString50))
		return k50;
	if (!strcmp8 (arrStr, kString51))
		return k51;
	if (!strcmp8 (arrStr, kString60Cine))
		return k60Cine;
	if (!strcmp8 (arrStr, kString60Music))
		return k60Music;
	if (!strcmp8 (arrStr, kString61Cine))
		return k61Cine;
	if (!strcmp8 (arrStr, kString61Music))
		return k61Music;
	if (!strcmp8 (arrStr, kString70Cine))
		return k70Cine;
	if (!strcmp8 (arrStr, kString70Music))
		return k70Music;
	if (!strcmp8 (arrStr, kString71Cine))
		return k71Cine;
	if (!strcmp8 (arrStr, kString71Music))
		return k71Music;
	if (!strcmp8 (arrStr, kString71Proximity))
		return k71Proximity;
	if (!strcmp8 (arrStr, kString80Cine))
		return k80Cine;
	if (!strcmp8 (arrStr, kString80Music))
		return k80Music;
	if (!strcmp8 (arrStr, kString81Cine))
		return k81Cine;
	if (!strcmp8 (arrStr, kString81Music))
		return k81Music;
	if (!strcmp8 (arrStr, kString102))
		return k102;
	if (!strcmp8 (arrStr, kString122))
		return k122;
	if (!strcmp8 (arrStr, kString80Cube))
		return k80Cube;
	if (!strcmp8 (arrStr, kStringBFormat1stOrder))
		return kBFormat1stOrder;
	if (!strcmp8 (arrStr, kString71CineTopCenter))
		return k71CineTopCenter;
	if (!strcmp8 (arrStr, kString71CineCenterHigh))
		return k71CineCenterHigh;
	if (!strcmp8 (arrStr, kString71CineFrontHigh))
		return k71CineFrontHigh;
	if (!strcmp8 (arrStr, kString71CineSideHigh))
		return k71CineSideHigh;
	if (!strcmp8 (arrStr, kString71CineFullRear))
		return k71CineFullRear;
	if (!strcmp8 (arrStr, kString90))
		return k90;
	if (!strcmp8 (arrStr, kString81MPEG))
		return k81MPEG3D;
	if (!strcmp8 (arrStr, kString91))
		return k91;
	if (!strcmp8 (arrStr, kString91Atmos))
		return k91Atmos;
	if (!strcmp8 (arrStr, kString100))
		return k100;
	if (!strcmp8 (arrStr, kString101))
		return k101;
	if (!strcmp8 (arrStr, kString110))
		return k110;
	if (!strcmp8 (arrStr, kString111))
		return k111;
	if (!strcmp8 (arrStr, kString130))
		return k130;
	if (!strcmp8 (arrStr, kString131))
		return k131;
	if (!strcmp8 (arrStr, kString222))
		return k222;
	return kEmpty;
}

//------------------------------------------------------------------------
/** Returns the string representation of a given speaker arrangement.
	Returns kStringEmpty if arr is unknown.
*/
inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpeakersName)
{
	switch (arr)
	{
		case kMono:				return withSpeakersName ? kStringMonoS		: kStringMono;
		case kStereo:			return withSpeakersName ? kStringStereoS	: kStringStereo;
		case kStereoSurround:	return withSpeakersName ? kStringStereoRS	: kStringStereoR;
		case kStereoCenter:		return withSpeakersName ? kStringStereoCS	: kStringStereoC;
		case kStereoSide:		return withSpeakersName ? kStringStereoSS	: kStringStereoSide;
		case kStereoCLfe:		return withSpeakersName ? kStringStereoCLfeS: kStringStereoCLfe;
		case kStereoTF:			return withSpeakersName ? kStringStereoTFS	: kStringStereoTF;
		case kStereoTS:			return withSpeakersName ? kStringStereoTSS	: kStringStereoTS;
		case kStereoTR:			return withSpeakersName ? kStringStereoTRS	: kStringStereoTR;
		case kStereoBF:			return withSpeakersName ? kStringStereoBFS	: kStringStereoBF;
		case k30Cine:			return withSpeakersName ? kString30CineS	: kString30Cine;
		case k30Music:			return withSpeakersName ? kString30MusicS	: kString30Music;
		case k31Cine:			return withSpeakersName ? kString31CineS	: kString31Cine;
		case k31Music:			return withSpeakersName ? kString31MusicS	: kString31Music;
		case k40Cine:			return withSpeakersName ? kString40CineS	: kString40Cine;
		case k40Music:			return withSpeakersName ? kString40MusicS	: kString40Music;
		case k41Cine:			return withSpeakersName ? kString41CineS	: kString41Cine;
		case k41Music:			return withSpeakersName ? kString41MusicS	: kString41Music;
		case k50:				return withSpeakersName ? kString50S		: kString50;
		case k51:				return withSpeakersName ? kString51S		: kString51;
		case k60Cine:			return withSpeakersName ? kString60CineS	: kString60Cine;
		case k60Music:			return withSpeakersName ? kString60MusicS	: kString60Music;
		case k61Cine:			return withSpeakersName ? kString61CineS	: kString61Cine;
		case k61Music:			return withSpeakersName ? kString61MusicS	: kString61Music;
		case k70Cine:			return withSpeakersName ? kString70CineS	: kString70Cine;
		case k70Music:			return withSpeakersName ? kString70MusicS	: kString70Music;
		case k71Cine:			return withSpeakersName ? kString71CineS	: kString71Cine;
		case k71Music:			return withSpeakersName ? kString71MusicS	: kString71Music;
		case k71Proximity:		return withSpeakersName ? kString71ProximityS : kString71Proximity;
		case k80Cine:			return withSpeakersName ? kString80CineS	: kString80Cine;
		case k80Music:			return withSpeakersName ? kString80MusicS	: kString80Music;
		case k81Cine:			return withSpeakersName ? kString81CineS	: kString81Cine;
		case k81Music:			return withSpeakersName ? kString81MusicS	: kString81Music;
		case k81MPEG3D:			return withSpeakersName ? kString81MPEGS	: kString81MPEG;
		case k102:				return withSpeakersName ? kString102S		: kString102;
		case k122:				return withSpeakersName ? kString122S		: kString122;
		case k80Cube:			return withSpeakersName ? kString80CubeS	: kString80Cube;
		case kBFormat1stOrder:	return withSpeakersName ? kStringBFormat1stOrderS	: kStringBFormat1stOrder;
		case k71CineTopCenter:	return withSpeakersName ? kString71CineTopCenterS	: kString71CineTopCenter;
		case k71CineCenterHigh:	return withSpeakersName ? kString71CineCenterHighS	: kString71CineCenterHigh;
		case k71CineFrontHigh:	return withSpeakersName ? kString71CineFrontHighS	: kString71CineFrontHigh;
		case k71CineSideHigh:	return withSpeakersName ? kString71CineSideHighS	: kString71CineSideHigh;
		case k71CineFullRear:	return withSpeakersName ? kString71CineFullRearS	: kString71CineFullRear;
		case k90:				return withSpeakersName ? kString90S		: kString90;
		case k91:				return withSpeakersName ? kString91S		: kString91;
		case k91Atmos:			return withSpeakersName ? kString91AtmosS	: kString91Atmos;
		case k100:				return withSpeakersName ? kString100S		: kString100;
		case k101:				return withSpeakersName ? kString101S		: kString101;
		case k110:				return withSpeakersName ? kString110S		: kString110;
		case k111:				return withSpeakersName ? kString111S		: kString111;
		case k130:				return withSpeakersName ? kString130S		: kString130;
		case k131:				return withSpeakersName ? kString131S		: kString131;
		case k222:				return withSpeakersName ? kString222S		: kString222;
			break;
	}
	return kStringEmpty;
}

//------------------------------------------------------------------------
/** Returns a CString representation of a given speaker in a given arrangement
*/
inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index)
{
	SpeakerArrangement arrTmp = arr;

	bool found = false;
	int32 index2 = -1;
	int32 pos = -1;
	while (arrTmp)
	{
		if (arrTmp & 0x1)
			index2++;
		pos++;
		if (index2 == index)
		{
			found = true;
			break;
		}
		arrTmp = arrTmp >> 1;
	}

	if (!found)
		return "";

	switch ((Speaker)1 << pos)
	{
		case kSpeakerL:
			return "L";
		case kSpeakerR:
			return "R";
		case kSpeakerC:
			return "C";
		case kSpeakerLfe:
			return "LFE";
		case kSpeakerLs:
			return "Ls";
		case kSpeakerRs:
			return "Rs";
		case kSpeakerLc:
			return "Lc";
		case kSpeakerRc:
			return "Rc";
		case kSpeakerS:
			return "S";
		case kSpeakerSl:
			return "Sl";
		case kSpeakerSr:
			return "Sr";
		case kSpeakerTc:
			return "Tc";
		case kSpeakerTfl:
			return "Tfl";
		case kSpeakerTfc:
			return "Tfc";
		case kSpeakerTfr:
			return "Tfr";
		case kSpeakerTrl:
			return "Trl";
		case kSpeakerTrc:
			return "Trc";
		case kSpeakerTrr:
			return "Trr";
		case kSpeakerLfe2:
			return "LFE2";
		case kSpeakerM:
			return "M";

		case kSpeakerW:
			return "W";
		case kSpeakerX:
			return "X";
		case kSpeakerY:
			return "Y";
		case kSpeakerZ:
			return "Z";

		case kSpeakerTsl:
			return "Tsl";
		case kSpeakerTsr:
			return "Tsr";
		case kSpeakerLcs:
			return "Lcs";
		case kSpeakerRcs:
			return "Rcs";

		case kSpeakerBfl:
			return "Bfl";
		case kSpeakerBfc:
			return "Bfc";
		case kSpeakerBfr:
			return "Bfr";
		case kSpeakerPl:
			return "Pl";
		case kSpeakerPr:
			return "Pr";
	}
	return "";
}

/*@}*/

//------------------------------------------------------------------------
} // namespace SpeakerArr
} // namespace Vst
} // namespace Steinberg


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivsthostapplication.h
// Created by  : Steinberg, 04/2006
// Description : VST Host Interface
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/vst/ivstmessage.h"

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Basic Host Callback Interface.
\ingroup vstIHost vst300
- [host imp]
- [passed as 'context' in to IPluginBase::initialize () ]

Basic VST host application interface. */
//------------------------------------------------------------------------
class IHostApplication: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Gets host application name. */
	virtual tresult PLUGIN_API getName (String128 name) = 0;

	/** Creates host object (e.g. Vst::IMessage). */
	virtual tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) = 0;

//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IHostApplication, 0x58E595CC, 0xDB2D4969, 0x8B6AAF8C, 0x36A664E5)

//------------------------------------------------------------------------
inline IMessage* allocateMessage (IHostApplication* host)
{
	TUID iid;
	IMessage::iid.toTUID (iid);
	IMessage* m = 0;
	if (host->createInstance (iid, iid, (void**)&m) == kResultOk)
		return m;
	return 0;
}

//------------------------------------------------------------------------
/** VST 3 to VST 2 Wrapper Interface.
\ingroup vstIHost vst310
- [host imp]
- [passed as 'context' to IPluginBase::initialize () ]

Informs the Plug-in that a VST 3 to VST 2 wrapper is used between the Plug-in and the real host.
Implemented by the VST 2 Wrapper. */
//------------------------------------------------------------------------
class IVst3ToVst2Wrapper: public FUnknown
{
public:
	//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IVst3ToVst2Wrapper, 0x29633AEC, 0x1D1C47E2, 0xBB85B97B, 0xD36EAC61)

//------------------------------------------------------------------------
/** VST 3 to AU Wrapper Interface.
\ingroup vstIHost vst310
- [host imp]
- [passed as 'context' to IPluginBase::initialize () ]

Informs the Plug-in that a VST 3 to AU wrapper is used between the Plug-in and the real host.
Implemented by the AU Wrapper. */
//------------------------------------------------------------------------
class IVst3ToAUWrapper: public FUnknown
{
public:
	//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IVst3ToAUWrapper, 0xA3B8C6C5, 0xC0954688, 0xB0916F0B, 0xB697AA44)

//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg