#ifndef _MOSAIC_APP_H
#define _MOSAIC_APP_H

#include		<windows.h>
#include		<stdio.h>
#include		<vector>
#include		<string>

#include		"graphics.h"
#include		"output.h"
#include		"track.h"
#include		"audio.h"
#include		"components.h"
#include		"utils.h"

#define WIN32_LEAN_AND_MEAN

// The application settings structure that contains all of the usable properties.
typedef struct {

		BOOL				StartScreenEnabled; // Whether or not to show the start screen.
		BOOL				HasShownStartScreen; // If the start screen has been shown.
		int					Ticks; // Update tick count.
		int					Width; // Window width.
		int					Height; // Window height.
		bool				Fullscreen; // If the application is running in fullscreen.
		int					StartScreenInterval; // Ticks to show the start screen for.
		int					StartScreenSpeed; // The start screen transition speed.
		int					TransitionInterval; // The main transition tick time.
		int					TransitionSpeed; // The main transition speed.
		std::string			AudioDirectory; // Default audio directory location.
		std::string			VisualisationDirectory; // Default visualisation directory location.
		std::string			PluginsDirectory; // Default plugins directory location.

} ApplicationProperties;

class Application
{
	private: 

		GraphicsManager				Graphics; // Graphics Engine.
		AudioManager				Audio; // Audio Engine.
		ComponentManager			Components; // Component & Plugin Engine.
		OutputManager				Output; // Output Engine.

		VOID						Transition(); // Causes Visualisation to Transition.
		VOID						ParseConfig(std::string path); // Parses the application configuration file.

		BOOL						BlockRendering; // Blocks the application from rendering.

		std::string					Directory; // The current working directory.
		std::vector<std::string>	Arguments; // The list of command line arguments.

	public: 

		Application();
		~Application();

		VOID						Init(LPSTR lpCmdLine); // Initialises the application with config file and arguments.
		BOOL						Start(HWND hWnd, HINSTANCE hInstance); // Starts the main application process.
		VOID						Update(); // Updates the application.
		VOID						Release(); // Releases all objects contained within the application.

		VOID						SetKey(WPARAM key); // Controls the key controls for the application.

		ApplicationProperties		Properties; // The application settings structure.
};

#endif




