It is currently February 25th, 2021, 9:55 pm

Optical Drive Status

Skins that monitor system information
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Optical Drive Status

Post by balala »

Image Image Image
Image
This skin, using an appropriate plugin, can determine the status of the optical drive: it'll indicate if the tray of the CD/DVD/BD drive is open or closed, respectively in last case, if it has or not an inserted disk. If there is one, the plugin will extract the icon of the disk (if it has one) to the default temporary folder (%TEMP%).
The installer package contains two skins: the Settings skin (which will be loaded first time when you install the package) is used to make the needed settings: the most important is the letter of the drive you want to control: you can choose this from a menu where are listed the available optical drives. Then you can set an amount of time, after what the drive will close automatically (if this is possible - on most laptops that's not, but on the desktops, usually it is).
The main skin (OpticalDriveTray.ini) will indicate the status of the drive and if a disk is inserted, its icon (see bellow). This skin is using the [MeasureCDStatus] measure, which needs one parameter (option): the Drive, which must set the letter of the controlled optical drive. If you'll use my package, these settings will be done by the Settings skin, saving all variables to the @Resources\Settings.inc file.
The used plugin was written by myself a while ago, in C++ and will be installed by the skin installer.
It returns a numeric and a string value.
The numeric value is according to the status of the drive: 0 if the tray is closed and there's no disk inserted, 1 for open tray and 2 for closed tray, with a disk.
The string value can be one of the followings:
  • If there's an inserted disk and this disk has an icon, the plugin will extract that icon and will return the path of the extracted icon file (this is %TEMP%\Icon.ico, where obviously %TEMP% is the default path of the temporary files).
  • If the disk in the drive has no icon, but has an Autorun.inf file (without the Icon option) the returned string value is NoIcon.
  • If the disk doesn't have an Autorun.inf file, the returned string is NoAutorun.
  • If there's no disk inserted, the returned string value will be NoDisk.
  • Finally if the drive set by the Drive option of the plugin measure isn't an optical drive (a wrong letter is set), the value will be NoOptical.
The skin and a redistributable package of the plugin are available in the Plugins & Addons section. You can download it here: https://forum.rainmeter.net/viewtopic.php?p=131992#p131992
Comments would be welcomed.