The next version is going to be a cool one.
I have just finished CDSAudio, a class that uses Direct Show to play audio files. It supports a great variety of formats.
You can create an instance of the class and load the file at the same time with:
DIM pCDSAudio AS CDSAudio = ExePath & "\prodigy.wav"
pCDSAudio.Run
or you can use the default constructor and then load the file:
DIM pCDSAudio AS CDSAudio
pCDSAudio.Load(ExePath & "\prodigy.wav")
pCDSAudio.Run
With the Load method you can change the audio file on the fly.
To receive event messages, you can define a custom message:
#define WM_GRAPHNOTIFY WM_APP + 1
and pass it to the class the handle of the window that will process the message:
pCDSAudio.SetNotifyWindow(pWindow.hWindow, WM_GRAPHNOTIFY, 0)
And process the messages in the window callback procedure:
CASE WM_GRAPHNOTIFY
DIM AS LONG lEventCode
DIM AS LONG_PTR lParam1, lParam2
WHILE (SUCCEEDED(pCDSAudio.GetEvent(lEventCode, lParam1, lParam2)))
SELECT CASE lEventCode
CASE EC_COMPLETE: ' Handle event
CASE EC_USERABORT: ' Handle event
CASE EC_ERRORABORT: ' Handle event
END SELEct
WEND
There are other methods to get/set the volume and balance, to get the duration and current position, to set the positions, and to pause or stop.
I will see if i can to write a similar one but for video.