notas:programacion:the_linux_cdrom_interface
Diferencias
Muestra las diferencias entre dos versiones de la página.
notas:programacion:the_linux_cdrom_interface [2011/06/10 12:41] – creado cayu | notas:programacion:the_linux_cdrom_interface [2011/06/10 12:41] (actual) – cayu | ||
---|---|---|---|
Línea 19: | Línea 19: | ||
Almost all commands involved with controlling a CDROM device are used in conjunction with ioctl. The commands and definitions for accessing the CD drive can be found in /// | Almost all commands involved with controlling a CDROM device are used in conjunction with ioctl. The commands and definitions for accessing the CD drive can be found in /// | ||
- | > < | + | > < |
- | + | ||
/* eject.c | /* eject.c | ||
** Copyright Paul Dwerryhouse, | ** Copyright Paul Dwerryhouse, | ||
Línea 59: | Línea 58: | ||
The volume control commands revolve around the struct cdrom_volctrl structure, listed below. This structure is used when setting the output volume, when playing audio CDs and also when reading what the values are currently set to. For a stereo CD player, only channels 0 and 1 are used. The values range from zero (no sound) to 255 (loudest possible setting) and the relevent ioctl commands are CDROMVOLCTRL and CDROMVOLREAD for setting and reading the volume, respectively. | The volume control commands revolve around the struct cdrom_volctrl structure, listed below. This structure is used when setting the output volume, when playing audio CDs and also when reading what the values are currently set to. For a stereo CD player, only channels 0 and 1 are used. The values range from zero (no sound) to 255 (loudest possible setting) and the relevent ioctl commands are CDROMVOLCTRL and CDROMVOLREAD for setting and reading the volume, respectively. | ||
- | > < | + | > < |
- | + | ||
struct cdrom_volctrl | struct cdrom_volctrl | ||
{ | { | ||
Línea 72: | Línea 70: | ||
For example, in order to read the values that are currently set: | For example, in order to read the values that are currently set: | ||
- | > < | + | > < |
- | + | ||
#define CDDEVICE "/ | #define CDDEVICE "/ | ||
Línea 91: | Línea 88: | ||
Conversely, if you wish to set the volume of each channel of the CD player: | Conversely, if you wish to set the volume of each channel of the CD player: | ||
- | > < | + | > < |
- | + | ||
#define CDDEVICE "/ | #define CDDEVICE "/ | ||
Línea 113: | Línea 109: | ||
There are three structures directly associated with CD track positioning: | There are three structures directly associated with CD track positioning: | ||
- | > < | + | > < |
- | + | ||
struct cdrom_tochdr | struct cdrom_tochdr | ||
{ | { | ||
Línea 142: | Línea 137: | ||
For example, should you wish to play any CD from start to finish, you could use the following: | For example, should you wish to play any CD from start to finish, you could use the following: | ||
- | > < | + | > < |
- | + | ||
#define CDDEVICE "/ | #define CDDEVICE "/ | ||
Línea 168: | Línea 162: | ||
Pausing, resuming, stopping and ejecting are done with ioctl calls using CDROMPAUSE, CDROMRESUME, | Pausing, resuming, stopping and ejecting are done with ioctl calls using CDROMPAUSE, CDROMRESUME, | ||
- | > < | + | > < |
- | + | ||
ioctl(cdrom, | ioctl(cdrom, | ||
ioctl(cdrom, | ioctl(cdrom, |
notas/programacion/the_linux_cdrom_interface.1307709665.txt.gz · Última modificación: 2011/06/10 12:41 por cayu