Re: How to get the number of tracks on a disc?

Michael Davidson <[email protected]> Tue, 10 Jun 2003 22:50:51 +1000
Newsgroups gmane.comp.audio.netmd.devel
Message-ID <[email protected]>
>Hi,
>
>I was wondering if there is a usb call that can give me the number of tracks 
>that's on a MD.
>
>What I can do now is: try a getTrackName in a for loop from 0-256 and if one 
>fails stop,
>but it seems to me this could be done better if I can ask for the number of 
>tracks.
>
>This information is not hidden in the disc name is it? If it is: this would 
>be quite stupid don't
>you think? Maybe the disc name is corrupt e.g.

No, there is a call. Send the following to the device.
	char request[] = {
		0x00, 0x18, 0x06,
		0x02, 0x10, 0x10, 0x01,
		0x30, 0x00,
		0x10, 0x00,
		0xff, 0x00,
		0x00, 0x00, 0x00, 0x00
	};

Then grab the buffer length, ask for the reply and the size is the last byte 
of the array

You might want to look at http://www.marcus-brinkmann.de/files/freemd_4.html 
for more details.