#ifndef _VISUALISATION_H
#define _VISUALISATION_H

#include		<windows.h>
#include		<d3dx9.h>
#include		<vector>
#include		"plugin.h"
#include		"sprite.h"


class Visualisation
{
	public: 

		Visualisation();
		Visualisation(std::string name); // Create a visualisation with a supplied name.
		~Visualisation();

		std::string						Name; // The visualisation name.
		std::string						Path; // The path to the manifest document.
		D3DXCOLOR						Color; // The background color of the visualisation.

		IDirect3DDevice9*				Device; // Interface to the Direct3D Device.
		IDirect3DTexture9*				Texture; // The texture of the visualisation render surface.
		IDirect3DSurface9*				Surface; // The surface to render the visualisation on.

		VOID							Init(IDirect3DDevice9* device); // Initialise the visualisation.

		std::vector<Plugin*>			Plugins; // The list of unique plugins in the visualisation.
		std::vector<PluginAttributes>	Properties; // This list of plugin properties in the visualisation.

		VOID							SetProperties(Plugin* plugin, PluginAttributes properties, PluginData* Data); // Sets the plugin properties from the attribute structure.

		Sprite							Overlay; // The visualisation overlay sprite.
		BOOL							HasOverlay; // If the visualisation has an overlay.
		BOOL							IsSilent; // Whether or not to report when the visualisation is set as active in the HUD.

		VOID							Render(PluginData* Data); // Render the visualisation.

		VOID							Release(); // Release all objects.

	private:

		VOID							CycleColor(ColorData* color, float speed); // Calculates the color cycle value.
		int								Clock; // The update clock.
};

#endif




