text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstinterappaudio.h
// Created by  : Steinberg, 08/2013
// Description : VST InterAppAudio 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 {
struct ViewRect;
namespace Vst {
struct Event;
class IInterAppAudioPresetManager;

//------------------------------------------------------------------------
/** Inter-App Audio host Interface.
\ingroup vstIHost vst360
- [host imp]
- [passed as 'context' to IPluginBase::initialize () ]
- [released: 3.6.0]

Implemented by the InterAppAudio Wrapper. */
//------------------------------------------------------------------------
class IInterAppAudioHost: public FUnknown
{
public:
	/** get the size of the screen
	 *	@param size size of the screen
	 *	@param scale scale of the screen
	 *	@return kResultTrue on success
	 */
	virtual tresult PLUGIN_API getScreenSize (ViewRect* size, float* scale) = 0;

	/** get status of connection
	 *	@return kResultTrue if an Inter-App Audio connection is established
	 */
	virtual tresult PLUGIN_API connectedToHost () = 0;

	/** switch to the host.
	 *	@return kResultTrue on success
	 */
	virtual tresult PLUGIN_API switchToHost () = 0;

	/** send a remote control event to the host
	 *	@param event event type, see AudioUnitRemoteControlEvent in the iOS SDK documentation for possible types
	 *	@return kResultTrue on success
	 */
	virtual tresult PLUGIN_API sendRemoteControlEvent (uint32 event) = 0;

	/** ask for the host icon.
	 *	@param icon pointer to a CGImageRef
	 *	@return kResultTrue on success
	 */
	virtual tresult PLUGIN_API getHostIcon (void** icon) = 0;

	/** schedule an event from the user interface thread
	 *	@param event the event to schedule
	 *	@return kResultTrue on success
	 */
	virtual tresult PLUGIN_API scheduleEventFromUI (Event& event) = 0;

	/** get the preset manager
	 *	@param cid class ID to use by the preset manager
	 *	@return the preset manager. Needs to be released by called.
	 */
	virtual IInterAppAudioPresetManager* PLUGIN_API createPresetManager (const TUID& cid) = 0;

	/** show the settings view
	 *	currently includes MIDI settings and Tempo setting
	 *	@return kResultTrue on success
	 */
	virtual tresult PLUGIN_API showSettingsView () = 0;

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

DECLARE_CLASS_IID (IInterAppAudioHost, 0x0CE5743D, 0x68DF415E, 0xAE285BD4, 0xE2CDC8FD)

//------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for Inter-App Audio connection state change notifications
\ingroup vstIPlug vst360
- [plug imp]
- [extends IEditController]
- [released: 3.6.0]
*/
//------------------------------------------------------------------------
class IInterAppAudioConnectionNotification : public FUnknown
{
public:
	/** called when the Inter-App Audio connection state changes
	 *	@param newState true if an Inter-App Audio connection is established, otherwise false
	*/
	virtual void PLUGIN_API onInterAppAudioConnectionStateChange (TBool newState) = 0;

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

DECLARE_CLASS_IID (IInterAppAudioConnectionNotification, 0x6020C72D, 0x5FC24AA1, 0xB0950DB5, 0xD7D6D5CF)

//------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for Inter-App Audio Preset Management
\ingroup vstIPlug vst360
- [plug imp]
- [extends IEditController]
- [released: 3.6.0]
*/
//------------------------------------------------------------------------
class IInterAppAudioPresetManager : public FUnknown
{
public:
	/** TODO */
	virtual tresult PLUGIN_API runLoadPresetBrowser () = 0;
	/** TODO */
	virtual tresult PLUGIN_API runSavePresetBrowser () = 0;
	/** TODO */
	virtual tresult PLUGIN_API loadNextPreset () = 0;
	/** TODO */
	virtual tresult PLUGIN_API loadPreviousPreset () = 0;

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

DECLARE_CLASS_IID (IInterAppAudioPresetManager, 0xADE6FCC4, 0x46C94E1D, 0xB3B49A80, 0xC93FEFDD)

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstattributes.h
// Created by  : Steinberg, 05/2006
// Description : VST Attribute 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"
#include "pluginterfaces/vst/vsttypes.h"

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

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Attribute list used in IMessage and IStreamAttributes.
\ingroup vstIHost vst300
- [host imp]
- [released: 3.0.0]

An attribute list associates values with a key (id: some predefined keys could be found in \ref presetAttributes). */
//------------------------------------------------------------------------
class IAttributeList: public FUnknown
{
public:
//------------------------------------------------------------------------
	typedef const char* AttrID;

	/** Sets integer value. */
	virtual tresult PLUGIN_API setInt (AttrID id, int64 value) = 0;

	/** Gets integer value. */
	virtual tresult PLUGIN_API getInt (AttrID id, int64& value) = 0;

	/** Sets float value. */
	virtual tresult PLUGIN_API setFloat (AttrID id, double value) = 0;

	/** Gets float value. */
	virtual tresult PLUGIN_API getFloat (AttrID id, double& value) = 0;

	/** Sets string value (UTF16). */
	virtual tresult PLUGIN_API setString (AttrID id, const TChar* string) = 0;

	/** Gets string value (UTF16). Note that Size is in Byte, not the string Length! (Do not forget to multiply the length by sizeof (TChar)!) */
	virtual tresult PLUGIN_API getString (AttrID id, TChar* string, uint32 size) = 0;

	/** Sets binary data. */
	virtual tresult PLUGIN_API setBinary (AttrID id, const void* data, uint32 size) = 0;

	/** Gets binary data. */
	virtual tresult PLUGIN_API getBinary (AttrID id, const void*& data, uint32& size) = 0;
//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IAttributeList, 0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4)

//------------------------------------------------------------------------
/**  Meta attributes of a stream.
\ingroup vstIHost  vst360
- [host imp]
- [extends IBStream]
- [released: 3.6.0]

\code
...
#include "pluginterfaces/base/ustring.h"
#include "pluginterfaces/vst/vstpresetkeys.h"
...

tresult PLUGIN_API MyPlugin::setState (IBStream* state)
{
	FUnknownPtr<IStreamAttributes> stream (state);
	if (stream)
	{
		IAttributeList* list = stream->getAttributes ();
		if (list)
		{
			// get the current type (project/Default..) of this state
			String128 string;
			if (list->getString (PresetAttributes::kStateType, string, 128 * sizeof (TChar)) == kResultTrue)
			{
				UString128 tmp (string);
				char ascii[128];
				tmp.toAscii (ascii, 128);
				if (!strncmp (ascii, StateType::kProject, strlen (StateType::kProject)))
				{
					// we are in project loading context...
				}
			}

			// get the full file path of this state
			TChar fullPath[1024];
			if (list->getString (PresetAttributes::kFilePathStringType, fullPath, 1024 * sizeof (TChar)) == kResultTrue)
			{
				// here we have the full path ...
			}
		}
	}

	//...read the state here.....
	return kResultTrue;
}
\endcode
Interface to access preset meta information from stream, used for example in setState in order to inform the plug-in about
the current context in which this preset loading occurs (Project context or Preset load (see \ref StateType))
or used to get the full file path of the loaded preset (if available). */
//------------------------------------------------------------------------
class IStreamAttributes: public FUnknown
{
public:
	//------------------------------------------------------------------------
	/** Gets filename (without file extension) of the stream. */
	virtual tresult PLUGIN_API getFileName (String128 name) = 0;

	/** Gets meta information list. */
	virtual IAttributeList* PLUGIN_API getAttributes () = 0;
	//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IStreamAttributes, 0xD6CE2FFC, 0xEFAF4B8C, 0x9E74F1BB, 0x12DA44B4)

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

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

repo_name: fedden/RenderMan

mime_type: text/x-c++


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstevents.h
// Created by  : Steinberg, 11/2005
// Description : VST Events (MIDI) 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/vst/ivstprocesscontext.h"
#include "pluginterfaces/vst/ivstnoteexpression.h"

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

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Note-on event specific data. Used in \ref Event (union)*/
struct NoteOnEvent
{
	int16 channel;			///< channel index in event bus
	int16 pitch;			///< range [0, 127] = [C-2, G8] with A3=440Hz
	float tuning;			///< 1.f = +1 cent, -1.f = -1 cent
	float velocity;			///< range [0.0, 1.0]
	int32 length;           ///< in sample frames (optional, Note Off has to follow in any case!)
	int32 noteId;			///< note identifier (if not available then -1)
};

//------------------------------------------------------------------------
/** Note-off event specific data. Used in \ref Event (union)*/
struct NoteOffEvent
{
	int16 channel;			///< channel index in event bus
	int16 pitch;			///< range [0, 127] = [C-2, G8] with A3=440Hz
	float velocity;			///< range [0.0, 1.0]
	int32 noteId;			///< associated noteOn identifier (if not available then -1)
	float tuning;			///< 1.f = +1 cent, -1.f = -1 cent
};

//------------------------------------------------------------------------
/** Data event specific data. Used in \ref Event (union)*/
struct DataEvent
{
	uint32 size;			///< size in bytes of the data block bytes
	uint32 type;			///< type of this data block (see \ref DataTypes)
	const uint8* bytes;		///< pointer to the data block

	/** Value for DataEvent::type */
	enum DataTypes
	{
		kMidiSysEx = 0		///< for MIDI system exclusive message
	};
};

//------------------------------------------------------------------------
/** PolyPressure event specific data. Used in \ref Event (union)*/
struct PolyPressureEvent
{
	int16 channel;			///< channel index in event bus
	int16 pitch;			///< range [0, 127] = [C-2, G8] with A3=440Hz
	float pressure;			///< range [0.0, 1.0]
	int32 noteId;			///< event should be applied to the noteId (if not -1)
};

//------------------------------------------------------------------------
/** Chord event specific data. Used in \ref Event (union)*/
struct ChordEvent
{
	int16 root;				///< range [0, 127] = [C-2, G8] with A3=440Hz
	int16 bassNote;			///< range [0, 127] = [C-2, G8] with A3=440Hz
	int16 mask;				///< root is bit 0
	uint16 textLen;			///< the number of characters (TChar) between the beginning of text and the terminating
							///< null character (without including the terminating null character itself)
	const TChar* text;		///< UTF-16, null terminated Hosts Chord Name
};

//------------------------------------------------------------------------
/** Scale event specific data. Used in \ref Event (union)*/
struct ScaleEvent
{
	int16 root;				///< range [0, 127] = root Note/Transpose Factor
	int16 mask;				///< Bit 0 =  C,  Bit 1 = C#, ... (0x5ab5 = Major Scale)
	uint16 textLen;			///< the number of characters (TChar) between the beginning of text and the terminating
							///< null character (without including the terminating null character itself)
	const TChar* text;		///< UTF-16, null terminated, Hosts Scale Name
};

//------------------------------------------------------------------------
/** Event */
//------------------------------------------------------------------------
struct Event
{
	int32 busIndex;				///< event bus index
	int32 sampleOffset;			///< sample frames related to the current block start sample position
	TQuarterNotes ppqPosition;	///< position in project
	uint16 flags;				///< combination of \ref EventFlags

	/** Event Flags - used for Event::flags */
	enum EventFlags
	{
		kIsLive = 1 << 0,			///< indicates that the event is played live (directly from keyboard)

		kUserReserved1 = 1 << 14,	///< reserved for user (for internal use)
		kUserReserved2 = 1 << 15	///< reserved for user (for internal use)
	};

	/**  Event Types - used for Event::type */
	enum EventTypes
	{
		kNoteOnEvent = 0,			///< is \ref NoteOnEvent
		kNoteOffEvent,				///< is \ref NoteOffEvent
		kDataEvent,					///< is \ref DataEvent
		kPolyPressureEvent,			///< is \ref PolyPressureEvent
		kNoteExpressionValueEvent,	///< is \ref NoteExpressionValueEvent
		kNoteExpressionTextEvent,	///< is \ref NoteExpressionTextEvent
		kChordEvent,				///< is \ref ChordEvent
		kScaleEvent					///< is \ref ScaleEvent
	};

	uint16 type;				///< a value from \ref EventTypes
	union
	{
		NoteOnEvent noteOn;								///< type == kNoteOnEvent
		NoteOffEvent noteOff;							///< type == kNoteOffEvent
		DataEvent data;									///< type == kDataEvent
		PolyPressureEvent polyPressure;					///< type == kPolyPressureEvent
		NoteExpressionValueEvent noteExpressionValue;	///< type == kNoteExpressionValueEvent
		NoteExpressionTextEvent noteExpressionText;		///< type == kNoteExpressionTextEvent
		ChordEvent chord;								///< type == kChordEvent
		ScaleEvent scale;								///< type == kScaleEvent
	};
};

//------------------------------------------------------------------------
/** List of events to process.
\ingroup vstIHost vst300
- [host imp]
- [released: 3.0.0]

\see ProcessData, Event */
//------------------------------------------------------------------------
class IEventList: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns the count of events. */
	virtual int32 PLUGIN_API getEventCount () = 0;

	/** Gets parameter by index. */
	virtual tresult PLUGIN_API getEvent (int32 index, Event& e /*out*/) = 0;

	/** Adds a new event. */
	virtual tresult PLUGIN_API addEvent (Event& e /*in*/) = 0;

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

DECLARE_CLASS_IID (IEventList, 0x3A2C4214, 0x346349FE, 0xB2C4F397, 0xB9695A44)

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

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstcontextmenu.h
// Created by  : Steinberg, 10/2010
// Description : VST Context Menu 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"
#include "vsttypes.h"

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

namespace Steinberg {
class IPlugView;

namespace Vst {
class IContextMenu;

//------------------------------------------------------------------------
/** Extended Host callback interface IComponentHandler3 for an edit controller.
\ingroup vstIHost vst350
- [host imp]
- [extends IComponentHandler]
- [released: 3.5.0]

A Plug-in can ask the host to create a context menu for a given exported Parameter ID or a generic context menu.\n

The host may pre-fill this context menu with specific items regarding the parameter ID like "Show automation for parameter",
"MIDI learn" etc...\n

The Plug-in can use the context menu in two ways :
- add its own items to the menu via the IContextMenu interface and call IContextMenu::popup(..) to pop-up it. See the \ref IContextMenuExample.
- extract the host menu items and add them to its own created context menu

\b Note: You can and should use this even if you don't add your own items to the menu as this is considered to be a big user value.

\sa IContextMenu
\sa IContextMenuTarget

\section IContextMenuExample Example
Adding Plug-in specific items to the context menu
\code
class PluginContextMenuTarget : public IContextMenuTarget, public FObject
{
public:
	PluginContextMenuTarget () {}

	virtual tresult PLUGIN_API executeMenuItem (int32 tag)
	{
		// this will be called if the user has executed one of the menu items of the Plug-in.
		// It won't be called for items of the host.
		switch (tag)
		{
			case 1: break;
			case 2: break;
		}
		return kResultTrue;
	}

	OBJ_METHODS(PluginContextMenuTarget, FObject)
	DEFINE_INTERFACES
		DEF_INTERFACE (IContextMenuTarget)
	END_DEFINE_INTERFACES (FObject)
	REFCOUNT_METHODS(FObject)
};

// The following is the code to create the context menu
void popupContextMenu (IComponentHandler* componentHandler, IPlugView* view, const ParamID* paramID, UCoord x, UCoord y)
{
	if (componentHandler == 0 || view == 0)
		return;
	FUnknownPtr<IComponentHandler3> handler (componentHandler);
	if (handler == 0)
		return;
	IContextMenu* menu = handler->createContextMenu (view, paramID);
	if (menu)
	{
		// here you can add your entries (optional)
		PluginContextMenuTarget* target = new PluginContextMenuTarget ();

		IContextMenu::Item item = {0};
		UString128 ("My Item 1").copyTo (item.name, 128);
		item.tag = 1;
		menu->addItem (item, target);

		UString128 ("My Item 2").copyTo (item.name, 128);
		item.tag = 2;
		menu->addItem (item, target);
		target->release ();
		//--end of adding new entries

		// here the the context menu will be pop-up (and it waits a user interaction)
		menu->popup (x, y);
		menu->release ();
	}
}
\endcode
*/
//------------------------------------------------------------------------
class IComponentHandler3 : public FUnknown
{
public:
	/** Creates a host context menu for a Plug-in:
		- If paramID is zero, the host may create a generic context menu.
		- The IPlugView object must be valid.
		- The return IContextMenu object needs to be released afterwards by the Plug-in.
	*/
	virtual IContextMenu* PLUGIN_API createContextMenu (IPlugView* plugView, const ParamID* paramID) = 0;
	//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6EBBAB)

//------------------------------------------------------------------------
/** Context Menu Item Target Interface.
\ingroup vstIHost vstIPlug vst350
- [host imp]
- [plug imp]
- [released: 3.5.0]

A receiver of a menu item should implement this interface, which will be called after the user has selected
this menu item.

See IComponentHandler3 for more.
*/
//------------------------------------------------------------------------
class IContextMenuTarget : public FUnknown
{
public:
	/** Called when an menu item was executed. */
	virtual tresult PLUGIN_API executeMenuItem (int32 tag) = 0;
	//------------------------------------------------------------------------
	static const FUID iid;
};

DECLARE_CLASS_IID (IContextMenuTarget, 0x3CDF2E75, 0x85D34144, 0xBF86D36B, 0xD7C4894D)

//------------------------------------------------------------------------
/** Context Menu Interface.
\ingroup vstIHost vst350
- [host imp]
- [create with IComponentHandler3::createContextMenu(..)]
- [released: 3.5.0]

A context menu is composed of Item (entry). A Item is defined by a name, a tag, a flag
and a associated target (called when this item will be selected/executed).
With IContextMenu the Plug-in can retrieve a Item, add a Item, remove a Item and pop-up the menu.

See IComponentHandler3 for more.
*/
//------------------------------------------------------------------------
class IContextMenu : public FUnknown
{
public:
	/** Item is a entry element of the context menu. */
	struct Item
	{
		String128 name;									///< Name of the item
		int32 tag;										///< Identifier tag of the item
		int32 flags;									///< Flags of the item

		enum Flags {
			kIsSeparator	= 1 << 0,					///< Item is a separator
			kIsDisabled		= 1 << 1,					///< Item is disabled
			kIsChecked		= 1 << 2,					///< Item is checked
			kIsGroupStart	= 1 << 3 | kIsDisabled,		///< Item is a group start (like sub folder)
			kIsGroupEnd		= 1 << 4 | kIsSeparator,	///< Item is a group end
		};
	};

	/** Gets the number of menu items. */
	virtual int32 PLUGIN_API getItemCount () = 0;

	/** Gets a menu item and its target (target could be not assigned). */
	virtual tresult PLUGIN_API getItem (int32 index, Item& item /*out*/, IContextMenuTarget** target /*out*/) = 0;

	/** Adds a menu item and its target. */
	virtual tresult PLUGIN_API addItem (const Item& item, IContextMenuTarget* target) = 0;

	/** Removes a menu item. */
	virtual tresult PLUGIN_API removeItem (const Item& item, IContextMenuTarget* target) = 0;

	/** Pop-ups the menu. Coordinates are relative to the top-left position of the Plug-ins view. */
	virtual tresult PLUGIN_API popup (UCoord x, UCoord y) = 0;

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

DECLARE_CLASS_IID (IContextMenu, 0x2E93C863, 0x0C9C4588, 0x97DBECF5, 0xAD17817D)

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

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstunits.h
// Created by  : Steinberg, 2005
// Description : VST Units 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"
#include "vsttypes.h"

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

namespace Steinberg {
class IBStream;

//------------------------------------------------------------------------
namespace Vst {
//------------------------------------------------------------------------
/** Special UnitIDs for UnitInfo */
static const UnitID kRootUnitId	= 0;        ///< identifier for the top level unit (root)
static const UnitID kNoParentUnitId = -1;	///< used for the root unit which doesn't have a parent.

//------------------------------------------------------------------------
/** Special ProgramListIDs for UnitInfo */
static const ProgramListID kNoProgramListId = -1;	///< no programs are used in the unit.

//------------------------------------------------------------------------
/** Basic Unit Description.
\see IUnitInfo */
//------------------------------------------------------------------------
struct UnitInfo
{
	UnitID id;						///< unit identifier
	UnitID parentUnitId;			///< identifier of parent unit (kNoParentUnitId: does not apply, this unit is the root)
	String128 name;					///< name, optional for the root component, required otherwise
	ProgramListID programListId;	///< id of program list used in unit (kNoProgramListId = no programs used in this unit)
};

//------------------------------------------------------------------------
/** Basic Program List Description.
\see IUnitInfo */
//------------------------------------------------------------------------
struct ProgramListInfo
{
	ProgramListID id;				///< program list identifier
	String128 name;					///< name of program list
	int32 programCount;				///< number of programs in this list
};

//------------------------------------------------------------------------
/** Special programIndex value for IUnitHandler::notifyProgramListChange */
static const int32 kAllProgramInvalid =	-1;		///< all program information is invalid

//------------------------------------------------------------------------
/** Host callback for unit support.
\ingroup vstIHost vst300
- [host imp]
- [extends IComponentHandler]
- [released: 3.0.0]

Host callback interface, used with IUnitInfo.
Retrieve via queryInterface from IComponentHandler.

\see \ref vst3Units, IUnitInfo */
//------------------------------------------------------------------------
class IUnitHandler: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Notify host when a module is selected in Plug-in GUI. */
	virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId) = 0;

	/** Tell host that the Plug-in controller changed a program list (rename, load, PitchName changes).
	    \param listId is the specified program list ID to inform.
		\param programIndex : when kAllProgramInvalid, all program information is invalid, otherwise only the program of given index. */
	virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex) = 0;

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

DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56)

//------------------------------------------------------------------------
/** Host callback for extended unit support.
\ingroup vstIHost vst365
- [host imp]
- [extends IUnitHandler]
- [released: 3.6.5]

Host callback interface, used with IUnitInfo.
Retrieve via queryInterface from IComponentHandler.

\see \ref vst3Units, IUnitHandler */
//------------------------------------------------------------------------
class IUnitHandler2 : public FUnknown
{
public:
	//------------------------------------------------------------------------
	/** Tell host that assignment Unit-Bus defined by IUnitInfo::getUnitByBus has changed. */
	virtual tresult PLUGIN_API notifyUnitByBusChange () = 0;

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

DECLARE_CLASS_IID (IUnitHandler2, 0xF89F8CDF, 0x699E4BA5, 0x96AAC9A4, 0x81452B01)

//------------------------------------------------------------------------
/** Edit controller extension to describe the Plug-in structure.
\ingroup vstIPlug vst300
- [plug imp]
- [extends IEditController]
- [released: 3.0.0]

IUnitInfo describes the internal structure of the Plug-in.
- The root unit is the component itself, so getUnitCount must return 1 at least.
- The root unit id has to be 0 (kRootUnitId).
- Each unit can reference one program list - this reference must not change.
- Each unit using a program list, references one program of the list.

\see \ref vst3Units, IUnitHandler */
//------------------------------------------------------------------------
class IUnitInfo: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns the flat count of units. */
	virtual int32 PLUGIN_API getUnitCount () = 0;

	/** Gets UnitInfo for a given index in the flat list of unit. */
	virtual tresult PLUGIN_API getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/) = 0;

	/** Component intern program structure. */
	/** Gets the count of Program List. */
	virtual int32 PLUGIN_API getProgramListCount () = 0;

	/** Gets for a given index the Program List Info. */
	virtual tresult PLUGIN_API getProgramListInfo (int32 listIndex, ProgramListInfo& info /*out*/) = 0;

	/** Gets for a given program list ID and program index its program name. */
	virtual tresult PLUGIN_API getProgramName (ProgramListID listId, int32 programIndex, String128 name /*out*/) = 0;

	/** Gets for a given program list ID, program index and attributeId the associated attribute value. */
	virtual tresult PLUGIN_API getProgramInfo (ProgramListID listId, int32 programIndex,
		CString attributeId /*in*/, String128 attributeValue /*out*/) = 0;

	/** Returns kResultTrue if the given program index of a given program list ID supports PitchNames. */
	virtual tresult PLUGIN_API hasProgramPitchNames (ProgramListID listId, int32 programIndex) = 0;

	/** Gets the PitchName for a given program list ID, program index and pitch.
		If PitchNames are changed the Plug-in should inform the host with IUnitHandler::notifyProgramListChange. */
	virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex,
		int16 midiPitch, String128 name /*out*/) = 0;

	// units selection --------------------
	/** Gets the current selected unit. */
	virtual UnitID PLUGIN_API getSelectedUnit () = 0;

	/** Sets a new selected unit. */
	virtual tresult PLUGIN_API selectUnit (UnitID unitId) = 0;

	/** Gets the according unit if there is an unambiguous relation between a channel or a bus and a unit.
	    This method mainly is intended to find out which unit is related to a given MIDI input channel. */
	virtual tresult PLUGIN_API getUnitByBus (MediaType type, BusDirection dir, int32 busIndex,
		int32 channel, UnitID& unitId /*out*/) = 0;

	/** Receives a preset data stream.
	    - If the component supports program list data (IProgramListData), the destination of the data
		  stream is the program specified by list-Id and program index (first and second parameter)
		- If the component supports unit data (IUnitData), the destination is the unit specified by the first
		  parameter - in this case parameter programIndex is < 0). */
	virtual tresult PLUGIN_API setUnitProgramData (int32 listOrUnitId, int32 programIndex, IBStream* data) = 0;

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

DECLARE_CLASS_IID (IUnitInfo, 0x3D4BD6B5, 0x913A4FD2, 0xA886E768, 0xA5EB92C1)

//------------------------------------------------------------------------
/** Component extension to access program list data.
\ingroup vstIPlug vst300
- [plug imp]
- [extends IComponent]
- [released: 3.0.0]

A component can either support program list data via this interface or
unit preset data (IUnitData), but not both!

\see \ref vst3UnitPrograms */
//------------------------------------------------------------------------
class IProgramListData: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns kResultTrue if the given Program List ID supports Program Data. */
	virtual tresult PLUGIN_API programDataSupported (ProgramListID listId) = 0;

	/** Gets for a given program list ID and program index the program Data. */
	virtual tresult PLUGIN_API getProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0;

	/** Sets for a given program list ID and program index a program Data. */
	virtual tresult PLUGIN_API setProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0;

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

DECLARE_CLASS_IID (IProgramListData, 0x8683B01F, 0x7B354F70, 0xA2651DEC, 0x353AF4FF)

//------------------------------------------------------------------------
/** Component extension to access unit data.
\ingroup vstIPlug vst300
- [plug imp]
- [extends IComponent]
- [released: 3.0.0]

A component can either support unit preset data via this interface or
program list data (IProgramListData), but not both!

\see \ref vst3UnitPrograms */
//------------------------------------------------------------------------
class IUnitData: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns kResultTrue if the specified unit supports export and import of preset data. */
	virtual tresult PLUGIN_API unitDataSupported (UnitID unitID) = 0;

	/** Gets the preset data for the specified unit. */
	virtual tresult PLUGIN_API getUnitData (UnitID unitId, IBStream* data) = 0;

	/** Sets the preset data for the specified unit. */
	virtual tresult PLUGIN_API setUnitData (UnitID unitId, IBStream* data) = 0;

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

DECLARE_CLASS_IID (IUnitData, 0x6C389611, 0xD391455D, 0xB870B833, 0x94A0EFDD)

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

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstchannelcontextinfo.h
// Created by  : Steinberg, 02/2014
// Description : VST Channel Context Info 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/vsttypes.h"
#include "pluginterfaces/vst/ivstattributes.h"

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

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
/** For Channel Context Info Interface */
namespace ChannelContext {

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

//------------------------------------------------------------------------
//------------------------------------------------------------------------
/** Channel Context Interface.
\ingroup vstIHost vst365
- [plug imp]
- [extends IEditController]
- [released: 3.6.5]
- [optional]

Allows the host to inform the Plug-in about the context in which the Plug-in is instantiated,
mainly channel based info (color, name, index,...). Index could be defined inside a namespace
(for example index start from 1 to N for Type Input/Output Channel (Index namespace) and index
start from 1 to M for Type Audio Channel).\n
As soon as the Plug-in provides this IInfoListener interface, the host will call setChannelContextInfos
for each change occurring to this channel (new name, new color, new indexation,...)

\section IChannelContextExample Example
\code
tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list)
{
	if (list)
	{
		// optional we can ask for the Channel Name Length
		int64 length;
		if (list->getInt (ChannelContext::kChannelNameLengthKey, length) == kResultTrue)
		{
			...
		}

		// get the Channel Name where we, as Plug-in, are instantiated
		String128 name;
		if (list->getString (ChannelContext::kChannelNameKey, name, sizeof (name)) == kResultTrue)
		{
			...
		}

		// get the Channel UID
		if (list->getString (ChannelContext::kChannelUIDKey, name, sizeof (name)) == kResultTrue)
		{
			...
		}

		// get Channel Index
		int64 index;
		if (list->getInt (ChannelContext::kChannelIndexKey, index) == kResultTrue)
		{
			...
		}

		// get the Channel Color
		int64 color;
		if (list->getInt (ChannelContext::kChannelColorKey, color) == kResultTrue)
		{
			uint32 channelColor = (uint32)color;
			String str;
			str.printf ("%x%x%x%x", ChannelContext::GetAlpha (channelColor),
			ChannelContext::GetRed (channelColor),
			ChannelContext::GetGreen (channelColor),
			ChannelContext::GetBlue (channelColor));
			String128 string128;
			Steinberg::UString (string128, 128).fromAscii (str);
			...
		}

		// get Channel Index Namespace Order of the current used index namespace
		if (list->getInt (ChannelContext::kChannelIndexNamespaceOrderKey, index) == kResultTrue)
		{
			...
		}

		// get the channel Index Namespace Length
		if (list->getInt (ChannelContext::kChannelIndexNamespaceLengthKey, length) == kResultTrue)
		{
			...
		}

		// get the channel Index Namespace
		String128 namespaceName;
		if (list->getString (ChannelContext::kChannelIndexNamespaceKey, namespaceName, sizeof (namespaceName)) == kResultTrue)
		{
			...
		}

		// get Plug-in Channel Location
		int64 location;
		if (list->getInt (ChannelContext::kChannelPluginLocationKey, location) == kResultTrue)
		{
			String128 string128;
			switch (location)
			{
				case ChannelContext::kPreVolumeFader:
					Steinberg::UString (string128, 128).fromAscii ("PreVolFader");
				break;
				case ChannelContext::kPostVolumeFader:
					Steinberg::UString (string128, 128).fromAscii ("PostVolFader");
				break;
				case ChannelContext::kUsedAsPanner:
					Steinberg::UString (string128, 128).fromAscii ("UsedAsPanner");
				break;
				default: Steinberg::UString (string128, 128).fromAscii ("unknown!");
				break;
			}
		}

		// do not forget to call addRef () if you want to keep this list
	}
}
\endcode */
//------------------------------------------------------------------------
class IInfoListener: public FUnknown
{
public:
	/** Receive the channel context infos from host. */
	virtual tresult PLUGIN_API setChannelContextInfos (IAttributeList* list) = 0;

	static const FUID iid;
};

DECLARE_CLASS_IID (IInfoListener, 0x0F194781, 0x8D984ADA, 0xBBA0C1EF, 0xC011D8D0)

//------------------------------------------------------------------------
/** Values used for kChannelPluginLocationKey */
//------------------------------------------------------------------------
enum ChannelPluginLocation
{
	kPreVolumeFader = 0,
	kPostVolumeFader,
	kUsedAsPanner
};

//------------------------------------------------------------------------
//------------------------------------------------------------------------
// Colors
typedef uint32 ColorSpec;	///< ARGB (Alpha-Red-Green-Blue)
typedef uint8 ColorComponent;

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); }

//------------------------------------------------------------------------
/** Keys used as AttrID (Attribute ID) in the return IAttributeList of
 * IInfoListener::setChannelContextInfos  */
//------------------------------------------------------------------------
/** string (TChar) [optional]: unique id string used to identify a channel */
const CString kChannelUIDKey = "channel uid";

/** integer (int64) [optional]: number of characters in kChannelUIDKey */
const CString kChannelUIDLengthKey = "channel uid length";

/** string (TChar) [optional]: name of the channel like displayed in the mixer */
const CString kChannelNameKey = "channel name";

/** integer (int64) [optional]: number of characters in kChannelNameKey */
const CString kChannelNameLengthKey = "channel name length";

/** color (ColorSpec) [optional]: used color for the channel in mixer or track */
const CString kChannelColorKey = "channel color";

/** integer (int64) [optional]: index of the channel in a channel index namespace, start with 1 not * 0! */
const CString kChannelIndexKey = "channel index";

/** integer (int64) [optional]: define the order of the current used index namespace, start with 1 not 0!
	For example:
	index namespace is "Input"   -> order 1,
	index namespace is "Channel" -> order 2,
	index namespace is "Output"  -> order 3 */
const CString kChannelIndexNamespaceOrderKey = "channel index namespace order";

/** string (TChar) [optional]: name of the channel index namespace for example "Input", "Output", "Channel", ... */
const CString kChannelIndexNamespaceKey = "channel index namespace";

/** integer (int64) [optional]: number of characters in kChannelIndexNamespaceKey */
const CString kChannelIndexNamespaceLengthKey =	"channel index namespace length";

/** PNG image representation as binary [optional] */
const CString kChannelImageKey = "channel image";

/** integer (int64) [optional]: routing position of the Plug-in in the channel (see ChannelPluginLocation) */
const CString kChannelPluginLocationKey = "channel plugin location";
//------------------------------------------------------------------------

} // namespace ChannelContext
} // namespace Vst
} // namespace Steinberg

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstprefetchablesupport.h
// Created by  : Steinberg, 02/2015
// Description : VST Prefetchable Support 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/vsttypes.h"
#include "pluginterfaces/vst/ivstattributes.h"

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

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

typedef uint32 PrefetchableSupport;
enum ePrefetchableSupport
{
	kIsNeverPrefetchable = 0,	///< every instance of the plug does not support prefetch processing
	kIsYetPrefetchable,			///< in the current state the plug support prefetch processing
	kIsNotYetPrefetchable,		///< in the current state the plug does not support prefetch processing
	kNumPrefetchableSupport
};

//------------------------------------------------------------------------
// IPrefetchableSupport Interface
//------------------------------------------------------------------------
/** Indicates that the Plug-in could or not support Prefetch (dynamically).
\ingroup vstIPlug vst365
- [plug imp]
- [extends IComponent]
- [released: 3.6.5]
- [optional]

The Plug-in should implement this interface if it needs to dynamically change between Prefetchable or not.
By default (without implementing this interface) the host will decide in which mode the Plug-in will be process.
For more info about Prefetch processing mode check ProcessModes::kPrefetch documentation.

\section IPrefetchableSupportExample Example
\code
tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetchable)
{
	prefetchable = kIsNeverPrefetchable;

	switch (myPrefetchableMode)
	{
		case 0: prefetchable = kIsNeverPrefetchable; break;
		case 1: prefetchable = kIsYetPrefetchable; break;
		case 2: prefetchable = kIsNotYetPrefetchable; break;
	}
	return kResultOk;
}
\endcode */
class IPrefetchableSupport : public FUnknown
{
public:
	//------------------------------------------------------------------------
	/** retrieve the current prefetch support. Use IComponentHandler::restartComponent (kPrefetchableSupportChanged)
		to inform the host that this support has changed. */
	virtual tresult PLUGIN_API getPrefetchableSupport (PrefetchableSupport& prefetchable /*out*/) = 0;

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

DECLARE_CLASS_IID (IPrefetchableSupport, 0x8AE54FDA, 0xE93046B9, 0xA28555BC, 0xDC98E21E)

} // namespace Vst
} // namespace Steinberg

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstmessage.h
// Created by  : Steinberg, 04/2005
// Description : VST Message 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/vst/ivstattributes.h"

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

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Private Plug-in message.
\ingroup vstIHost vst300
- [host imp]
- [create via IHostApplication::createInstance]
- [released: 3.0.0]

Messages are sent from a VST-controller component to a VST-editor component and vice versa.
\see IAttributeList, IConnectionPoint, \ref vst3Communication */
//------------------------------------------------------------------------
class IMessage: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns the message ID (for example "TextMessage"). */
	virtual FIDString PLUGIN_API getMessageID () = 0;

	/** Sets a message ID (for example "TextMessage"). */
	virtual void PLUGIN_API setMessageID (FIDString id /*in*/) = 0;

	/** Returns the attribute list associated to the message. */
	virtual IAttributeList* PLUGIN_API getAttributes () = 0;

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

DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613)

//------------------------------------------------------------------------
/** Connect a component with another one.
\ingroup vstIPlug vst300
- [plug imp]
- [host imp]
- [released: 3.0.0]

This interface is used for the communication of separate components.
Note that some hosts will place a proxy object between the components so that they are not directly connected.

\see \ref vst3Communication*/
//------------------------------------------------------------------------
class IConnectionPoint: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Connects this instance with another connection point. */
	virtual tresult PLUGIN_API connect (IConnectionPoint* other) = 0;

	/** Disconnects a given connection point from this. */
	virtual tresult PLUGIN_API disconnect (IConnectionPoint* other) = 0;

	/** Called when a message has been sent from the connection point to this. */
	virtual tresult PLUGIN_API notify (IMessage* message) = 0;

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

DECLARE_CLASS_IID (IConnectionPoint, 0x70A4156F, 0x6E6E4026, 0x989148BF, 0xAA60D8D1)

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

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstparameterchanges.h
// Created by  : Steinberg, 09/2005
// Description : VST Parameter Change 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"
#include "vsttypes.h"

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

//----------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//----------------------------------------------------------------------
/** Queue of changes for a specific parameter.
\ingroup vstIHost vst300
- [host imp]
- [released: 3.0.0]

The change queue can be interpreted as segment of an automation curve. For each
processing block a segment with the size of the block is transmitted to the processor.
The curve is expressed as sampling points of a linear approximation of
the original automation curve. If the original already is a linear curve it can
be transmitted precisely. A non-linear curve has to be converted to a linear
approximation by the host. Every point of the value queue defines a linear
section of the curve as a straight line from the previous point of a block to
the new one. So the Plug-in can calculate the value of the curve for any sample
position in the block.

Implicit Points: \n
In each processing block the section of the curve for each parameter is transmitted.
In order to reduce the amount of points, the point at block position 0 can be omitted.
- If the curve has a slope of 0 over a period of multiple blocks, only one point is
transmitted for the block where the constant curve section starts. The queue for the following
blocks will be empty as long as the curve slope is 0.
- If the curve has a constant slope other than 0 over the period of several blocks, only
the value for the last sample of the block is transmitted. In this case the last valid point
is at block position -1. The processor can calculate the value for each sample in the block
by using a linear interpolation:
\code
double x1 = -1; // position of last point related to current buffer
double y1 = currentParameterValue; // last transmitted value

int32 pointTime = 0;
ParamValue pointValue = 0;
IParamValueQueue::getPoint (0, pointTime, pointValue);

double x2 = pointTime;
double y2 = pointValue;

double slope = (y2 - y1) / (x2 - x1);
double offset = y1 - (slope * x1);

double curveValue = (slope * bufferTime) + offset; // bufferTime is any position in buffer
\endcode

Jumps: \n
A jump in the automation curve has to be transmitted as two points: one with the
old value and one with the new value at the next sample position.

\image html "automation.jpg"
\see IParameterChanges, ProcessData
*/
//----------------------------------------------------------------------
class IParamValueQueue: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns its associated ID. */
	virtual ParamID PLUGIN_API getParameterId () = 0;

	/** Returns count of points in the queue. */
	virtual int32 PLUGIN_API getPointCount () = 0;

	/** Gets the value and offset at a given index. */
	virtual tresult PLUGIN_API getPoint (int32 index, int32& sampleOffset /*out*/, ParamValue& value /*out*/) = 0;

	/** Adds a new value at the end of the queue, its index is returned. */
	virtual tresult PLUGIN_API addPoint (int32 sampleOffset, ParamValue value, int32& index /*out*/) = 0;

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

DECLARE_CLASS_IID (IParamValueQueue, 0x01263A18, 0xED074F6F, 0x98C9D356, 0x4686F9BA)

//----------------------------------------------------------------------
/** All parameter changes of a processing block.
\ingroup vstIHost vst300
- [host imp]
- [released: 3.0.0]

This interface is used to transmit any changes that shall be applied to paramaters
in the current processing block. A change can be caused by GUI interaction as
well as automation. They are transmitted as a list of queues (IParamValueQueue)
containing only queues for paramaters that actually did change.
\see IParamValueQueue, ProcessData */
//----------------------------------------------------------------------
class IParameterChanges: public FUnknown
{
public:
//------------------------------------------------------------------------
	/** Returns count of Parameter changes in the list. */
	virtual int32 PLUGIN_API getParameterCount () = 0;

	/** Returns the queue at a given index. */
	virtual IParamValueQueue* PLUGIN_API getParameterData (int32 index) = 0;

	/** Adds a new parameter queue with a given ID at the end of the list,
	returns it and its index in the parameter changes list. */
	virtual IParamValueQueue* PLUGIN_API addParameterData (const Vst::ParamID& id, int32& index /*out*/) = 0;

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

DECLARE_CLASS_IID (IParameterChanges, 0xA4779663, 0x0BB64A56, 0xB44384A8, 0x466FEB9D)

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

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/vstpresetkeys.h
// Created by  : Steinberg, 2006
// Description : VST Preset Keys
//
//-----------------------------------------------------------------------------
// 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 "vsttypes.h"

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Predefined Preset Attributes */
//------------------------------------------------------------------------
namespace PresetAttributes
{
/**
\defgroup presetAttributes Predefined Preset Attributes*/
/*@{*/
const CString kPlugInName	  = "PlugInName";		///< Plug-in name
const CString kPlugInCategory = "PlugInCategory";	///< eg. "Fx|Dynamics", "Instrument", "Instrument|Synth"

const CString kInstrument	  = "MusicalInstrument";///< eg. instrument group (like 'Piano' or 'Piano|A. Piano')
const CString kStyle		  = "MusicalStyle";		///< eg. 'Pop', 'Jazz', 'Classic'
const CString kCharacter	  = "MusicalCharacter";	///< eg. instrument nature (like 'Soft' 'Dry' 'Acoustic')

const CString kStateType	  = "StateType";		///< Type of the given state see \ref StateType : Project / Default Preset or Normal Preset
const CString kFilePathStringType = "FilePathString";	///< Full file path string (if available) where the preset comes from (be sure to use a bigger string when asking for it (with 1024 characters))
/*@}*/
};

//------------------------------------------------------------------------
/** Predefined StateType used for Key kStateType */
//------------------------------------------------------------------------
namespace StateType {
/**
\defgroup stateType Context of State Restoration */
/*@{*/
//------------------------------------------------------------------------
const CString kProject = "Project";		///< the state is restored from a project loading or it is saved in a project
const CString kDefault = "Default";		///< the state is restored from a preset (marked as default) or the host wants to store a default state of the plug-in

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

//------------------------------------------------------------------------
/** Predefined Musical Instrument */
//------------------------------------------------------------------------
namespace MusicalInstrument
{
/**
\defgroup musicalInstrument Predefined Musical Instrument */
/*@{*/
const CString kAccordion			= "Accordion";
const CString kAccordionAccordion	= "Accordion|Accordion";
const CString kAccordionHarmonica	= "Accordion|Harmonica";
const CString kAccordionOther		= "Accordion|Other";

const CString kBass					= "Bass";
const CString kBassABass			= "Bass|A. Bass";
const CString kBassEBass			= "Bass|E. Bass";
const CString kBassSynthBass		= "Bass|Synth Bass";
const CString kBassOther			= "Bass|Other";

const CString kBrass				= "Brass";
const CString kBrassFrenchHorn		= "Brass|French Horn";
const CString kBrassTrumpet			= "Brass|Trumpet";
const CString kBrassTrombone		= "Brass|Trombone";
const CString kBrassTuba			= "Brass|Tuba";
const CString kBrassSection			= "Brass|Section";
const CString kBrassSynth			= "Brass|Synth";
const CString kBrassOther			= "Brass|Other";

const CString kChromaticPerc		= "Chromatic Perc";
const CString kChromaticPercBell	= "Chromatic Perc|Bell";
const CString kChromaticPercMallett	= "Chromatic Perc|Mallett";
const CString kChromaticPercWood	= "Chromatic Perc|Wood";
const CString kChromaticPercPercussion = "Chromatic Perc|Percussion";
const CString kChromaticPercTimpani	= "Chromatic Perc|Timpani";
const CString kChromaticPercOther	= "Chromatic Perc|Other";

const CString kDrumPerc				= "Drum&Perc";
const CString kDrumPercDrumsetGM	= "Drum&Perc|Drumset GM";
const CString kDrumPercDrumset		= "Drum&Perc|Drumset";
const CString kDrumPercDrumMenues	= "Drum&Perc|Drum Menues";
const CString kDrumPercBeats		= "Drum&Perc|Beats";
const CString kDrumPercPercussion	= "Drum&Perc|Percussion";
const CString kDrumPercKickDrum		= "Drum&Perc|Kick Drum";
const CString kDrumPercSnareDrum	= "Drum&Perc|Snare Drum";
const CString kDrumPercToms			= "Drum&Perc|Toms";
const CString kDrumPercHiHats		= "Drum&Perc|HiHats";
const CString kDrumPercCymbals		= "Drum&Perc|Cymbals";
const CString kDrumPercOther		= "Drum&Perc|Other";

const CString kEthnic				= "Ethnic";
const CString kEthnicAsian			= "Ethnic|Asian";
const CString kEthnicAfrican		= "Ethnic|African";
const CString kEthnicEuropean		= "Ethnic|European";
const CString kEthnicLatin			= "Ethnic|Latin";
const CString kEthnicAmerican		= "Ethnic|American";
const CString kEthnicAlien			= "Ethnic|Alien";
const CString kEthnicOther			= "Ethnic|Other";

const CString kGuitar				= "Guitar/Plucked";
const CString kGuitarAGuitar		= "Guitar/Plucked|A. Guitar";
const CString kGuitarEGuitar		= "Guitar/Plucked|E. Guitar";
const CString kGuitarHarp			= "Guitar/Plucked|Harp";
const CString kGuitarEthnic			= "Guitar/Plucked|Ethnic";
const CString kGuitarOther			= "Guitar/Plucked|Other";

const CString kKeyboard				= "Keyboard";
const CString kKeyboardClavi		= "Keyboard|Clavi";
const CString kKeyboardEPiano		= "Keyboard|E. Piano";
const CString kKeyboardHarpsichord	= "Keyboard|Harpsichord";
const CString kKeyboardOther		= "Keyboard|Other";

const CString kMusicalFX			= "Musical FX";
const CString kMusicalFXHitsStabs	= "Musical FX|Hits&Stabs";
const CString kMusicalFXMotion		= "Musical FX|Motion";
const CString kMusicalFXSweeps		= "Musical FX|Sweeps";
const CString kMusicalFXBeepsBlips	= "Musical FX|Beeps&Blips";
const CString kMusicalFXScratches	= "Musical FX|Scratches";
const CString kMusicalFXOther		= "Musical FX|Other";

const CString kOrgan				= "Organ";
const CString kOrganElectric		= "Organ|Electric";
const CString kOrganPipe			= "Organ|Pipe";
const CString kOrganOther			= "Organ|Other";

const CString kPiano				= "Piano";
const CString kPianoAPiano			= "Piano|A. Piano";
const CString kPianoEGrand			= "Piano|E. Grand";
const CString kPianoOther			= "Piano|Other";

const CString kSoundFX				= "Sound FX";
const CString kSoundFXNature		= "Sound FX|Nature";
const CString kSoundFXMechanical	= "Sound FX|Mechanical";
const CString kSoundFXSynthetic		= "Sound FX|Synthetic";
const CString kSoundFXOther			= "Sound FX|Other";

const CString kStrings				= "Strings";
const CString kStringsViolin		= "Strings|Violin";
const CString kStringsViola			= "Strings|Viola";
const CString kStringsCello			= "Strings|Cello";
const CString kStringsBass			= "Strings|Bass";
const CString kStringsSection		= "Strings|Section";
const CString kStringsSynth			= "Strings|Synth";
const CString kStringsOther			= "Strings|Other";

const CString kSynthLead			= "Synth Lead";
const CString kSynthLeadAnalog		= "Synth Lead|Analog";
const CString kSynthLeadDigital		= "Synth Lead|Digital";
const CString kSynthLeadArpeggio	= "Synth Lead|Arpeggio";
const CString kSynthLeadOther		= "Synth Lead|Other";

const CString kSynthPad				= "Synth Pad";
const CString kSynthPadSynthChoir	= "Synth Pad|Synth Choir";
const CString kSynthPadAnalog		= "Synth Pad|Analog";
const CString kSynthPadDigital		= "Synth Pad|Digital";
const CString kSynthPadMotion		= "Synth Pad|Motion";
const CString kSynthPadOther		= "Synth Pad|Other";

const CString kSynthComp			= "Synth Comp";
const CString kSynthCompAnalog		= "Synth Comp|Analog";
const CString kSynthCompDigital		= "Synth Comp|Digital";
const CString kSynthCompOther		= "Synth Comp|Other";

const CString kVocal				= "Vocal";
const CString kVocalLeadVocal		= "Vocal|Lead Vocal";
const CString kVocalAdlibs			= "Vocal|Adlibs";
const CString kVocalChoir			= "Vocal|Choir";
const CString kVocalSolo			= "Vocal|Solo";
const CString kVocalFX				= "Vocal|FX";
const CString kVocalSpoken			= "Vocal|Spoken";
const CString kVocalOther			= "Vocal|Other";

const CString kWoodwinds			= "Woodwinds";
const CString kWoodwindsEthnic		= "Woodwinds|Ethnic";
const CString kWoodwindsFlute		= "Woodwinds|Flute";
const CString kWoodwindsOboe		= "Woodwinds|Oboe";
const CString kWoodwindsEnglHorn	= "Woodwinds|Engl. Horn";
const CString kWoodwindsClarinet	= "Woodwinds|Clarinet";
const CString kWoodwindsSaxophone	= "Woodwinds|Saxophone";
const CString kWoodwindsBassoon		= "Woodwinds|Bassoon";
const CString kWoodwindsOther		= "Woodwinds|Other";
/*@}*/
};

//------------------------------------------------------------------------
/** Predefined Musical Style */
//------------------------------------------------------------------------
namespace MusicalStyle
{
/**
\defgroup musicalStyle Predefined Musical Style */
/*@{*/
const CString kAlternativeIndie					= "Alternative/Indie";
const CString kAlternativeIndieGothRock			= "Alternative/Indie|Goth Rock";
const CString kAlternativeIndieGrunge			= "Alternative/Indie|Grunge";
const CString kAlternativeIndieNewWave			= "Alternative/Indie|New Wave";
const CString kAlternativeIndiePunk				= "Alternative/Indie|Punk";
const CString kAlternativeIndieCollegeRock		= "Alternative/Indie|College Rock";
const CString kAlternativeIndieDarkWave			= "Alternative/Indie|Dark Wave";
const CString kAlternativeIndieHardcore			= "Alternative/Indie|Hardcore";

const CString kAmbientChillOut					= "Ambient/ChillOut";
const CString kAmbientChillOutNewAgeMeditation	= "Ambient/ChillOut|New Age/Meditation";
const CString kAmbientChillOutDarkAmbient		= "Ambient/ChillOut|Dark Ambient";
const CString kAmbientChillOutDowntempo			= "Ambient/ChillOut|Downtempo";
const CString kAmbientChillOutLounge			= "Ambient/ChillOut|Lounge";

const CString kBlues							= "Blues";
const CString kBluesAcousticBlues				= "Blues|Acoustic Blues";
const CString kBluesCountryBlues				= "Blues|Country Blues";
const CString kBluesElectricBlues				= "Blues|Electric Blues";
const CString kBluesChicagoBlues				= "Blues|Chicago Blues";

const CString kClassical						= "Classical";
const CString kClassicalBaroque					= "Classical|Baroque";
const CString kClassicalChamberMusic			= "Classical|Chamber Music";
const CString kClassicalMedieval				= "Classical|Medieval";
const CString kClassicalModernComposition		= "Classical|Modern Composition";
const CString kClassicalOpera					= "Classical|Opera";
const CString kClassicalGregorian				= "Classical|Gregorian";
const CString kClassicalRenaissance				= "Classical|Renaissance";
const CString kClassicalClassic					= "Classical|Classic";
const CString kClassicalRomantic				= "Classical|Romantic";
const CString kClassicalSoundtrack				= "Classical|Soundtrack";

const CString kCountry							= "Country";
const CString kCountryCountryWestern			= "Country|Country/Western";
const CString kCountryHonkyTonk					= "Country|Honky Tonk";
const CString kCountryUrbanCowboy				= "Country|Urban Cowboy";
const CString kCountryBluegrass					= "Country|Bluegrass";
const CString kCountryAmericana					= "Country|Americana";
const CString kCountrySquaredance				= "Country|Squaredance";
const CString kCountryNorthAmericanFolk			= "Country|North American Folk";

const CString kElectronicaDance					= "Electronica/Dance";
const CString kElectronicaDanceMinimal			= "Electronica/Dance|Minimal";
const CString kElectronicaDanceClassicHouse		= "Electronica/Dance|Classic House";
const CString kElectronicaDanceElektroHouse		= "Electronica/Dance|Elektro House";
const CString kElectronicaDanceFunkyHouse		= "Electronica/Dance|Funky House";
const CString kElectronicaDanceIndustrial		= "Electronica/Dance|Industrial";
const CString kElectronicaDanceElectronicBodyMusic	= "Electronica/Dance|Electronic Body Music";
const CString kElectronicaDanceTripHop			= "Electronica/Dance|Trip Hop";
const CString kElectronicaDanceTechno			= "Electronica/Dance|Techno";
const CString kElectronicaDanceDrumNBassJungle	= "Electronica/Dance|Drum'n'Bass/Jungle";
const CString kElectronicaDanceElektro			= "Electronica/Dance|Elektro";
const CString kElectronicaDanceTrance			= "Electronica/Dance|Trance";
const CString kElectronicaDanceDub				= "Electronica/Dance|Dub";
const CString kElectronicaDanceBigBeats			= "Electronica/Dance|Big Beats";

const CString kExperimental						= "Experimental";
const CString kExperimentalNewMusic				= "Experimental|New Music";
const CString kExperimentalFreeImprovisation	= "Experimental|Free Improvisation";
const CString kExperimentalElectronicArtMusic	= "Experimental|Electronic Art Music";
const CString kExperimentalNoise				= "Experimental|Noise";

const CString kJazz								= "Jazz";
const CString kJazzNewOrleansJazz				= "Jazz|New Orleans Jazz";
const CString kJazzTraditionalJazz				= "Jazz|Traditional Jazz";
const CString kJazzOldtimeJazzDixiland			= "Jazz|Oldtime Jazz/Dixiland";
const CString kJazzFusion						= "Jazz|Fusion";
const CString kJazzAvantgarde					= "Jazz|Avantgarde";
const CString kJazzLatinJazz					= "Jazz|Latin Jazz";
const CString kJazzFreeJazz						= "Jazz|Free Jazz";
const CString kJazzRagtime						= "Jazz|Ragtime";

const CString kPop								= "Pop";
const CString kPopBritpop						= "Pop|Britpop";
const CString kPopRock							= "Pop|Pop/Rock";
const CString kPopTeenPop						= "Pop|Teen Pop";
const CString kPopChartDance					= "Pop|Chart Dance";
const CString kPop80sPop						= "Pop|80's Pop";
const CString kPopDancehall						= "Pop|Dancehall";
const CString kPopDisco							= "Pop|Disco";

const CString kRockMetal						= "Rock/Metal";
const CString kRockMetalBluesRock				= "Rock/Metal|Blues Rock";
const CString kRockMetalClassicRock				= "Rock/Metal|Classic Rock";
const CString kRockMetalHardRock				= "Rock/Metal|Hard Rock";
const CString kRockMetalRockRoll				= "Rock/Metal|Rock & Roll";
const CString kRockMetalSingerSongwriter		= "Rock/Metal|Singer/Songwriter";
const CString kRockMetalHeavyMetal				= "Rock/Metal|Heavy Metal";
const CString kRockMetalDeathBlackMetal			= "Rock/Metal|Death/Black Metal";
const CString kRockMetalNuMetal					= "Rock/Metal|NuMetal";
const CString kRockMetalReggae					= "Rock/Metal|Reggae";
const CString kRockMetalBallad					= "Rock/Metal|Ballad";
const CString kRockMetalAlternativeRock			= "Rock/Metal|Alternative Rock";
const CString kRockMetalRockabilly				= "Rock/Metal|Rockabilly";
const CString kRockMetalThrashMetal				= "Rock/Metal|Thrash Metal";
const CString kRockMetalProgressiveRock			= "Rock/Metal|Progressive Rock";

const CString kUrbanHipHopRB					= "Urban (Hip-Hop / R&B)";
const CString kUrbanHipHopRBClassic 			= "Urban (Hip-Hop / R&B)|Classic R&B";
const CString kUrbanHipHopRBModern				= "Urban (Hip-Hop / R&B)|Modern R&B";
const CString kUrbanHipHopRBPop					= "Urban (Hip-Hop / R&B)|R&B Pop";
const CString kUrbanHipHopRBWestCoastHipHop		= "Urban (Hip-Hop / R&B)|WestCoast Hip-Hop";
const CString kUrbanHipHopRBEastCoastHipHop		= "Urban (Hip-Hop / R&B)|EastCoast Hip-Hop";
const CString kUrbanHipHopRBRapHipHop			= "Urban (Hip-Hop / R&B)|Rap/Hip Hop";
const CString kUrbanHipHopRBSoul				= "Urban (Hip-Hop / R&B)|Soul";
const CString kUrbanHipHopRBFunk				= "Urban (Hip-Hop / R&B)|Funk";

const CString kWorldEthnic						= "World/Ethnic";
const CString kWorldEthnicAfrica				= "World/Ethnic|Africa";
const CString kWorldEthnicAsia					= "World/Ethnic|Asia";
const CString kWorldEthnicCeltic				= "World/Ethnic|Celtic";
const CString kWorldEthnicEurope				= "World/Ethnic|Europe";
const CString kWorldEthnicKlezmer				= "World/Ethnic|Klezmer";
const CString kWorldEthnicScandinavia			= "World/Ethnic|Scandinavia";
const CString kWorldEthnicEasternEurope			= "World/Ethnic|Eastern Europe";
const CString kWorldEthnicIndiaOriental			= "World/Ethnic|India/Oriental";
const CString kWorldEthnicNorthAmerica			= "World/Ethnic|North America";
const CString kWorldEthnicSouthAmerica			= "World/Ethnic|South America";
const CString kWorldEthnicAustralia				= "World/Ethnic|Australia";
/*@}*/
};

//------------------------------------------------------------------------
/** Predefined Musical Character */
//------------------------------------------------------------------------
namespace MusicalCharacter
{
/**
\defgroup musicalCharacter Predefined Musical Character */
/*@{*/
//----TYPE------------------------------------
const CString kMono			= "Mono";
const CString kPoly			= "Poly";

const CString kSplit		= "Split";
const CString kLayer		= "Layer";

const CString kGlide		= "Glide";
const CString kGlissando	= "Glissando";

const CString kMajor		= "Major";
const CString kMinor		= "Minor";

const CString kSingle		= "Single";
const CString kEnsemble		= "Ensemble";

const CString kAcoustic		= "Acoustic";
const CString kElectric		= "Electric";

const CString kAnalog		= "Analog";
const CString kDigital		= "Digital";

const CString kVintage		= "Vintage";
const CString kModern		= "Modern";

const CString kOld			= "Old";
const CString kNew			= "New";

//----TONE------------------------------------
const CString kClean		= "Clean";
const CString kDistorted	= "Distorted";

const CString kDry			= "Dry";
const CString kProcessed	= "Processed";

const CString kHarmonic		= "Harmonic";
const CString kDissonant	= "Dissonant";

const CString kClear		= "Clear";
const CString kNoisy		= "Noisy";

const CString kThin			= "Thin";
const CString kRich			= "Rich";

const CString kDark			= "Dark";
const CString kBright		= "Bright";

const CString kCold			= "Cold";
const CString kWarm			= "Warm";

const CString kMetallic		= "Metallic";
const CString kWooden		= "Wooden";

const CString kGlass		= "Glass";
const CString kPlastic		= "Plastic";

//----ENVELOPE------------------------------------
const CString kPercussive	= "Percussive";
const CString kSoft			= "Soft";

const CString kFast			= "Fast";
const CString kSlow			= "Slow";

const CString kShort		= "Short";
const CString kLong			= "Long";

const CString kAttack		= "Attack";
const CString kRelease		= "Release";

const CString kDecay		= "Decay";
const CString kSustain		= "Sustain";

const CString kFastAttack	= "Fast Attack";
const CString kSlowAttack	= "Slow Attack";

const CString kShortRelease	= "Short Release";
const CString kLongRelease	= "Long Release";

const CString kStatic		= "Static";
const CString kMoving		= "Moving";

const CString kLoop			= "Loop";
const CString kOneShot		= "One Shot";
/*@}*/
};

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstprocesscontext.h
// Created by  : Steinberg, 10/2005
// Description : VST Processing Context 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"
#include "vsttypes.h"

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

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Frame Rate */
//------------------------------------------------------------------------
struct FrameRate
{
//------------------------------------------------------------------------
	enum FrameRateFlags
	{
		kPullDownRate = 1 << 0, ///< for ex. HDTV: 23.976 fps with 24 as frame rate
		kDropRate     = 1 << 1	///< for ex. 29.97 fps drop with 30 as frame rate
	};
//------------------------------------------------------------------------
	uint32 framesPerSecond;		///< frame rate
	uint32 flags;				///< flags #FrameRateFlags
//------------------------------------------------------------------------
};

//------------------------------------------------------------------------
/** Description of a chord.
A chord is described with a key note, a root note and the
\copydoc chordMask
\see ProcessContext*/
//------------------------------------------------------------------------
struct Chord
{
//------------------------------------------------------------------------
	uint8 keyNote;		///< key note in chord
	uint8 rootNote;		///< lowest note in chord

	/** Bitmask of a chord.
	    1st bit set: minor second; 2nd bit set: major second, and so on. \n
		There is \b no bit for the keynote (root of the chord) because it is inherently always present. \n
		Examples:
		- XXXX 0000 0100 1000 (= 0x0048) -> major chord\n
		- XXXX 0000 0100 0100 (= 0x0044) -> minor chord\n
		- XXXX 0010 0100 0100 (= 0x0244) -> minor chord with minor seventh  */
	int16 chordMask;

	enum Masks {
		kChordMask = 0x0FFF,	///< mask for chordMask
		kReservedMask = 0xF000	///< reserved for future use
	};
//------------------------------------------------------------------------
};

//------------------------------------------------------------------------
/** Audio processing context.
For each processing block the host provides timing information and
musical parameters that can change over time. For a host that supports jumps
(like cycle) it is possible to split up a processing block into multiple parts in
order to provide a correct project time inside of every block, but this behaviour
is not mandatory. Since the timing will be correct at the beginning of the next block
again, a host that is dependent on a fixed processing block size can choose to neglect
this problem.
\see IAudioProcessor, ProcessData*/
//------------------------------------------------------------------------
struct ProcessContext
{
//------------------------------------------------------------------------
	/** Transport state & other flags */
	enum StatesAndFlags
	{
		kPlaying          = 1 << 1,		///< currently playing
		kCycleActive      = 1 << 2,		///< cycle is active
		kRecording        = 1 << 3,		///< currently recording

		kSystemTimeValid  = 1 << 8,		///< systemTime contains valid information
		kContTimeValid    = 1 << 17,	///< continousTimeSamples contains valid information

		kProjectTimeMusicValid = 1 << 9,///< projectTimeMusic contains valid information
		kBarPositionValid = 1 << 11,	///< barPositionMusic contains valid information
		kCycleValid       = 1 << 12,	///< cycleStartMusic and barPositionMusic contain valid information

		kTempoValid       = 1 << 10,	///< tempo contains valid information
		kTimeSigValid     = 1 << 13,	///< timeSigNumerator and timeSigDenominator contain valid information
		kChordValid       = 1 << 18,	///< chord contains valid information

		kSmpteValid       = 1 << 14,	///< smpteOffset and frameRate contain valid information
		kClockValid       = 1 << 15		///< samplesToNextClock valid
	};

	uint32 state;					///< a combination of the values from \ref StatesAndFlags

	double sampleRate;				///< current sample rate (always valid)
	TSamples projectTimeSamples;	///< project time in samples (always valid)

	int64 systemTime;				///< system time in nanoseconds (optional)
	TSamples continousTimeSamples;	///< project time, without loop (optional)

	TQuarterNotes projectTimeMusic;	///< musical position in quarter notes (1.0 equals 1 quarter note)
	TQuarterNotes barPositionMusic;	///< last bar start position, in quarter notes
	TQuarterNotes cycleStartMusic;	///< cycle start in quarter notes
	TQuarterNotes cycleEndMusic;	///< cycle end in quarter notes

	double tempo;					///< tempo in BPM (Beats Per Minute)
	int32 timeSigNumerator;			///< time signature numerator (e.g. 3 for 3/4)
	int32 timeSigDenominator;		///< time signature denominator (e.g. 4 for 3/4)

	Chord chord;					///< musical info

	int32 smpteOffsetSubframes;		///< SMPTE (sync) offset in subframes (1/80 of frame)
	FrameRate frameRate;			///< frame rate

	int32 samplesToNextClock;		///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest)
//------------------------------------------------------------------------
};

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

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


text:
//------------------------------------------------------------------------
// Project     : VST SDK
// Version     : 3.6.7
//
// Category    : Interfaces
// Filename    : pluginterfaces/vst/ivstmidicontrollers.h
// Created by  : Steinberg, 02/2006
// Description : VST MIDI Controller Enumeration
//
//-----------------------------------------------------------------------------
// 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

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
/** Controller Numbers (MIDI) */
//------------------------------------------------------------------------
enum ControllerNumbers
{
	kCtrlBankSelectMSB	=	0,	///< Bank Select MSB
	kCtrlModWheel		=	1,	///< Modulation Wheel
	kCtrlBreath			=	2,	///< Breath controller

	kCtrlFoot			=	4,	///< Foot Controller
	kCtrlPortaTime		=	5,	///< Portamento Time
	kCtrlDataEntryMSB	=	6,	///< Data Entry MSB
	kCtrlVolume			=	7,	///< Channel Volume (formerly Main Volume)
	kCtrlBalance		=	8,	///< Balance

	kCtrlPan			=	10,	///< Pan
	kCtrlExpression		=	11,	///< Expression
	kCtrlEffect1		=	12,	///< Effect Control 1
	kCtrlEffect2		=	13,	///< Effect Control 2

	//---General Purpose Controllers #1 to #4---
	kCtrlGPC1			=	16,	///< General Purpose Controller #1
	kCtrlGPC2			=	17,	///< General Purpose Controller #2
	kCtrlGPC3			=	18,	///< General Purpose Controller #3
	kCtrlGPC4			=	19,	///< General Purpose Controller #4

	kCtrlBankSelectLSB	=	32,	///< Bank Select LSB

	kCtrlDataEntryLSB	=	38,	///< Data Entry LSB

	kCtrlSustainOnOff	=	64,	///< Damper Pedal On/Off (Sustain)
	kCtrlPortaOnOff		=	65,	///< Portamento On/Off
	kCtrlSustenutoOnOff	=	66,	///< Sustenuto On/Off
	kCtrlSoftPedalOnOff	=	67,	///< Soft Pedal On/Off
	kCtrlLegatoFootSwOnOff=	68,	///< Legato Footswitch On/Off
	kCtrlHold2OnOff		=	69,	///< Hold 2 On/Off

	//---Sound Controllers #1 to #10---
	kCtrlSoundVariation	=	70, ///< Sound Variation
	kCtrlFilterCutoff	=	71,	///< Filter Cutoff (Timbre/Harmonic Intensity)
	kCtrlReleaseTime	=	72,	///< Release Time
	kCtrlAttackTime		=	73,	///< Attack Time
	kCtrlFilterResonance=	74,	///< Filter Resonance (Brightness)
	kCtrlDecayTime		=	75,	///< Decay Time
	kCtrlVibratoRate	=	76,	///< Vibrato Rate
	kCtrlVibratoDepth	=	77,	///< Vibrato Depth
	kCtrlVibratoDelay	=	78,	///< Vibrato Delay
	kCtrlSoundCtrler10	=	79, ///< undefined

	//---General Purpose Controllers #5 to #8---
	kCtrlGPC5			=	80,	///< General Purpose Controller #5
	kCtrlGPC6			=	81,	///< General Purpose Controller #6
	kCtrlGPC7			=	82,	///< General Purpose Controller #7
	kCtrlGPC8			=	83,	///< General Purpose Controller #8

	kCtrlPortaControl	=	84,	///< Portamento Control

	//---Effect Controllers---
	kCtrlEff1Depth		=	91,	///< Effect 1 Depth (Reverb Send Level)
	kCtrlEff2Depth		=	92,	///< Effect 2 Depth
	kCtrlEff3Depth		=	93,	///< Effect 3 Depth (Chorus Send Level)
	kCtrlEff4Depth		=	94,	///< Effect 4 Depth (Delay/Variation Level)
	kCtrlEff5Depth		=	95,	///< Effect 5 Depth

	kCtrlDataIncrement	=	96,	///< Data Increment (+1)
	kCtrlDataDecrement	=	97,	///< Data Decrement (-1)
	kCtrlNRPNSelectLSB 	=	98, ///< NRPN Select LSB
	kCtrlNRPNSelectMSB	=	99, ///< NRPN Select MSB
	kCtrlRPNSelectLSB	=	100, ///< RPN Select LSB
	kCtrlRPNSelectMSB	=	101, ///< RPN Select MSB

	//---Other Channel Mode Messages---
	kCtrlAllSoundsOff	=	120, ///< All Sounds Off
	kCtrlResetAllCtrlers =	121, ///< Reset All Controllers
	kCtrlLocalCtrlOnOff	=	122, ///< Local Control On/Off
	kCtrlAllNotesOff	=	123, ///< All Notes Off
	kCtrlOmniModeOff	=	124, ///< Omni Mode Off + All Notes Off
	kCtrlOmniModeOn		=	125, ///< Omni Mode On  + All Notes Off
	kCtrlPolyModeOnOff	=	126, ///< Poly Mode On/Off + All Sounds Off
	kCtrlPolyModeOn		=	127, ///< Poly Mode On

	//---Extra--------------------------
	kAfterTouch = 128,			///< After Touch
	kPitchBend,					///< Pitch Bend

	kCountCtrlNumber			///< Count of Controller Number
};

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