﻿Foo_DMusic. (Foobar2000_input_DirectMusic):
-------------------------------------------
foo_dmusic is an input plugin for the Foobar2000 media player. It allows
Foobar2000 to play files based on DirectMusic. DirectMusic allows a game to play
back interactive audio that reacts dynamically to events sent to it (examples are
ending a level, or a battle commencing).

foo_dmusic was made because Foobar2000 currently lacks the capability of playing
Directmusic files (which form a large part of my music collection). Therefore, I
created this plugin. The list of synths you can choose is the same list as can
be found in DirectX Diagnostics.

Requirements:
-------------
In addition to requiring Foobar2000 0.8x, you'll also need version 7.0 of the
DirectX runtimes. I haven't tested what happens if you run the plugin without
having DirectX installed (mostly because it's so difficult to find such a
computer), but I can imagine the results of such a test. This program makes use
of DirectX 7.0-specific interfaces, so any earlier version just will not do. As
a direct consequence, your soundcard will also need to be compatible with
DirectX (most soundcards released in the past 5 years are compatible with
DirectX). This may require you to update the drivers for your soundcard.

By default, the code selects Microsoft Synthesizer (with output) as the output
DirectMusic port. The Microsoft DirectMusic Synthesizer (with Output) is the
only synth that will properly work with Foobar2000's playback system. All the
other output ports will exhibit strange behaviour (including but not limited to
seek not working, pause not working, DSPs not working, visualisations/file
conversions not working, crashes, playlist behaviour strange, songs playing back
over the current tune, stale code). Due to these problems, do not change the
default output port from Microsoft DirectMusic Synthesizer (with Output). If the
plugin gets upgraded to the Foobar2000 0.9 series, I may remove the option to select
the output port.

Caution: Because of faults in my code, this plugin is known to destabilise
DirectX and Foobar2000. And unless your DirectMusic synthesiser is highly resilient
to faulty programming (the Microsoft Synth is, but most others are not), my plugin
could cause your synthesiser to crash. If those synthesisers are kernel mode, such
a crash will cause a BSOD. By a process of deduction, I have proven that my plugin
can cause BSODs. You may be able to workaround this problem by installing the
latest drivers for your soundcard, but this will not solve the underlying problem.
That problem can only be solved by fixing my code.


TODO:
-----
-MIDI reset messages.
-Add in WinMM support.
-Custom Sysex instruments.

History:
--------
1.04
-Added new synthesiser, Microsoft Synthesizer (With Output). You are highly recommended
 to use this output port and it is by default selected.

1.03
-Now extracts meta data from MIDI Files.
-Visualisation is now available.
-To emphasise its beta status, I've dynamically linked to the C-runtimes. You now
 need to have msvcr80.dll and msvcp80.dll installed in the Foobar2000 directory
 (not even WinXPSP3/Server2003SP1 has it). Don't have it? Get it from Microsoft's
 site.

1.02
-Win9x bugs fixed. No longer crashes under this operating system.
-No longer requires unicows.dll.
-Now warns you if DirectX is outdated.
-Now supports Reverb and Chorus.
-Now supports DLS.

1.01
-foo_dmusic is a DirectMusic plugin. Initial release.

Acknowledgements:
-----------------
Started from Googer's foo_gym example plugin
(http://pelit.koillismaa.fi/plugins/index.php).

Created with Peter Pawlowski's SDK (v0.8) (http://www.foobar2000.org/)
and compiled with Visual C++ 2005.

Uses C. Jiménez de Parga's CMidiMusic class (until 1.04)
(www.codeproject.com/audio/cmidimusic.asp).

This program contains portions of DirectX. Directmusic and DirectX are
trademarks of Microsoft Corporation. All those rights reserved, can't use them
unless you bribe MS blah blah blah...

Third party copyrights are copyright of their respective authors. As for me:

Licence:
--------
Copyright Shexec32 2005. All rights reserved.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

--
Oshah [shexec32]
Jul 2005