]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cd_linux.c
if a (supposedly) quake sky texture is not 128x256, upload it just as a solid layer
[xonotic/darkplaces.git] / cd_linux.c
index feaa5b3a1104ca8fe95d20c5dd0eed76c690af2b..9aa633f75ecbb76b4c22b8a9f93b26740a5cf246 100644 (file)
@@ -77,6 +77,38 @@ int CDAudio_SysGetAudioDiskInfo (void)
 }
 
 
+float CDAudio_SysGetVolume (void)
+{
+       struct cdrom_volctrl vol;
+
+       if (cdfile == -1)
+               return -1.0f;
+
+       if (ioctl (cdfile, CDROMVOLREAD, &vol) == -1)
+       {
+               Con_DPrint("ioctl CDROMVOLREAD failed\n");
+               return -1.0f;
+       }
+
+       return (vol.channel0 + vol.channel1) / 2.0f / 255.0f;
+}
+
+
+void CDAudio_SysSetVolume (float volume)
+{
+       struct cdrom_volctrl vol;
+
+       if (cdfile == -1)
+               return;
+
+       vol.channel0 = vol.channel1 = volume * 255;
+       vol.channel2 = vol.channel3 = 0;
+
+       if (ioctl (cdfile, CDROMVOLCTRL, &vol) == -1)
+               Con_DPrint("ioctl CDROMVOLCTRL failed\n");
+}
+
+
 int CDAudio_SysPlay (qbyte track)
 {
        struct cdrom_tocentry entry;
@@ -196,6 +228,7 @@ void CDAudio_SysInit (void)
 {
        int i;
 
+// COMMANDLINEOPTION: Linux Sound: -cddev <devicepath> chooses which CD drive to use
        if ((i = COM_CheckParm("-cddev")) != 0 && i < com_argc - 1)
                strlcpy(cd_dev, com_argv[i + 1], sizeof(cd_dev));
 }