///////////////////////////////////////////////////////////////////////////////////////////
// DirectMusic.h
//
//  Definition of the DirectMusic class, which wraps a DirectMusic performance and
// loader object.

#pragma once

using namespace System;
using namespace System::ComponentModel;

namespace Sunlight
{
    namespace DirectX
    {
        namespace SoundMusic
        {
            // Wraps a DirectMusic performance and loader object.
            __gc public class DirectMusic
            {
            protected:
                IDirectMusicPerformance8 __nogc *m_pPerformance;
                IDirectMusicLoader8 __nogc      *m_pLoader;

                bool m_bCreated;

            public:
                DirectMusic();
                ~DirectMusic();

                // Create the DirectMusic object and initialise the audio path.
                void Create();
                // Stops all DirectMusic objects currently playing.
                void StopAll();

                // Sets/returns the window which is associated with this object.
                System::Windows::Forms::Form *ParentWindow;
                // Sets/returns the number of concurrent audio channels.
                int Channels;

                __value enum AudioPathType
                {
                    Dynamic3D = DMUS_APATH_DYNAMIC_3D,
                    DynamicMono = DMUS_APATH_DYNAMIC_MONO,
                    StereoPlusReverb = DMUS_APATH_SHARED_STEREOPLUSREVERB,
                    DynamicStereo = DMUS_APATH_DYNAMIC_STEREO
                };
                // Sets/returns the type of audio output.
                AudioPathType   AudioPath;

                // Returns the DirectMusic performance object.
                IDirectMusicPerformance8 __nogc *GetPerformance()
                {
                    return m_pPerformance;
                }
                // Returns the DirectMusic loader object.
                IDirectMusicLoader8 __nogc *GetLoader()
                {
                    return m_pLoader;
                }
            };
        }
    }
}