What are the commands for cdrom control? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What are the commands for cdrom control?

I need Commands on c++. I don't mean just open and close cd tray. for example read cd, stop, change track. and many others

26th Feb 2020, 1:02 AM
Edwin Bg
Edwin Bg - avatar
2 Answers
+ 1
You can use windows or system commands to eject the tray to get the drive from the user. Once the drive is inserted then you can access it's file just like any other file on your system(using fstream). Simply analyzing data on a cd would be hard though, as you wouldn't be able to tell the computer what to look for.
26th Feb 2020, 2:58 AM
Arsenic
Arsenic - avatar
+ 1
It depends on which platform it is used and what is the type of that CD. If the CD has Compact Disc Digital Audio format, then it doesn't have a file system on it and you must use device control APIs to read tracks. If it has File System (for example, it contains mp3 files) then you should use standard read file routines to get tracks. There are many open-source audioplayers (CD-players) in the Internet. You can view their source codes for your task.
26th Feb 2020, 6:24 AM
andriy kan
andriy kan - avatar