Disclaimer:
This post comes from my old blog back in 2004. I’m reposting it here so that I don’t lose the content. The source was hand-written HTML so the formatting probably appears a bit off.
MCI CD Control
This is the MCI control code that I wrote for my UglyCD
player. It is fairly full featured, but if you need more, feel free to modify it to your needs. I
have neglected the error checking code, and every call to mciSendCommand should really be checked for
its return value. As usual, this code is usable at your own risk. If you have any questions, you are
always free to ask.
-BossHogg
#ifndef MCI_CONTROL
#define MCI_CONTROL 1
class MCIControl
{
public:
MCIControl();
~MCIControl();
int GetNumberOfTracks();
void Resume();
void Pause();
void Play();
void Stop();
void OpenDoor();
void CloseDoor();
void Goto(int track,int minute, int second);
int GetCurrentTrack();
int GetCurrentMinute();
int GetCurrentSecond();
protected:
void Init();
void SetTimeFormat();
void GetPosition(BYTE* track,BYTE* min,BYTE* sec);
private:
MCIDEVICEID itsMCIDevice;
};
#endif