///////////////////////////////////////////////////////////
//
//	MOSAIC SDK - manifest.h
//	***********************
//	This document provides the core components that must
//	be used by any application plugins.
//
//	Leo Beddow 2010.
//
///////////////////////////////////////////////////////////

#ifndef _PLUGINMANIFEST_H
#define _PLUGINMANIFEST_H

// The size of the audio spectrum returned from the audio engine.
// Warning: DO NOT MODIFY!
#define SPECTRUMSIZE        8192

// Color data structure that defines RGB and alpha color values.
typedef struct 
{
	float R; // Red.
	float G; // Green.
	float B; // Blue.
	float A; // Alpha.

} ColorData;

// Vector3 data structure that defines XYZ values.
typedef struct 
{
	float X; // X.  
	float Y; // Y.
	float Z; // Z.

} Vector3Data;

// The audio data structure returned from the audio engine.
typedef struct 
{
	float Spectrum[SPECTRUMSIZE]; // The main spectrum waveform. 
	float Amplitude; // The peak amplitude of the waveform.
	float Average; // The average value of the amplitudes.

} AudioData;

// Structure that defines the resolution values of a plugin.
typedef enum _RESOLUTION 
{
	RES_SIMPLE = 0, // Low resolution.
	RES_MEDIUM = 1, // Medium resolution.
	RES_DETAILED = 2 // High resolution.

} RESOLUTION;

// The plugin properties that determine a plugin's appearance.
typedef struct 
{
	ColorData Color; // The plugin's color.
	float Cycle; // If the color is to cycle.
	Vector3Data Position; // The plugin position in 3D space.
	Vector3Data Rotation; // The plugin rotation in 3D space.
	Vector3Data Spin; // The plugin spin velocity.
	RESOLUTION Resolution; // The plugin display resolution.

} PluginAttributes;

// The main data structure that is passed to a plugin on render.
typedef struct 
{
	AudioData Audio; // The audio data.
	D3DXMATRIX World; // The current world matrix of the device.

} PluginData;

// The core plugin manifest that must be implemented by all valid
// plugins. This structure defines the properties and links between
// the core application and the plugin component.
typedef struct 
{
	int Version; // The plugin version.
	char *Name; // The plugin name.
	char *Description; // The plugin description.
	void (*Init)(IDirect3DDevice9*); // Initialisation function pointer.
	void (*Quit)(); // Quit function pointer.          
	void (*Render)(PluginData* Data);  // Render function pointer.  
	PluginAttributes* Properties; // The plugin properties.

} Manifest;

// Pointer to the plugin manifest.
typedef Manifest* (*GetManifest)();

#endif