Opened 18 years ago

Closed 18 years ago

Last modified 11 months ago

#7935 closed patch (duplicate)

GDI Port: CD Audio playing patch

Reported by: SF/mcleod2032 Owned by: SF/ender
Priority: normal Component: Port: Win32
Keywords: Cc:
Game:

Description

This is the code to playing CD Audio under GDI Port:

void cd_playtrack(int track, int offset, int delay)
{
UINT wDeviceID;
DWORD dwReturn;
MCI_OPEN_PARMS mciOpenParms;
MCI_SET_PARMS mciSetParms;
MCI_PLAY_PARMS mciPlayParms;
int start, end;

start = (offset / 24);
end = (start + delay / 24);

mciOpenParms.lpstrDeviceType = "cdaudio";
if (dwReturn = mciSendCommand(NULL, MCI_OPEN,
MCI_OPEN_TYPE, (DWORD)(LPVOID) &mciOpenParms)) return;

wDeviceID = mciOpenParms.wDeviceID;
mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF;
if (dwReturn = mciSendCommand(wDeviceID, MCI_SET,
MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms))
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return;
}

mciPlayParms.dwFrom = MCI_MAKE_TMSF(track, start /
60, start % 60, 0);
mciPlayParms.dwTo = MCI_MAKE_TMSF(track, end / 60,
end % 60, 0);

if (dwReturn = mciSendCommand(wDeviceID,
MCI_PLAY, MCI_FROM | MCI_TO | MCI_NOTIFY | MCI_TRACK,
(DWORD)(LPVOID) &mciPlayParms))
mciSendCommand(wDeviceID, MCI_CLOSE,
0, NULL);
}

Ticket imported from: #523152. Ticket imported from: patches/40.

Change History (6)

comment:1 by SF/mcleod2032, 18 years ago

Summary: GDI Port: CD Audio playinf patchGDI Port: CD Audio playing patch

comment:2 by SF/mcleod2032, 18 years ago

Owner: set to SF/ender

comment:3 by SF/ender, 18 years ago

Status: newclosed

comment:4 by SF/ender, 18 years ago

Resolution: duplicate

comment:5 by SF/ender, 18 years ago

Supercided by GDI patch.

comment:6 by digitall, 11 months ago

Component: Port: Win32
Note: See TracTickets for help on using tickets.