Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Auto eject of CDs? (Read 1366 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Auto eject of CDs?

Using Foobar 2000 1.6.7
Is there an option to automatically eject a CD when playing has finished?
I haven't been able to find one, and use a program in the background ( Door Control 4.9.0.0 ) to eject CDs.
Thank you, Chris

Re: Auto eject of CDs?

Reply #1
I'm a bit disappointed that there has been no response to my question?  :(
A simple question that needs only a yes or no answer?
Maybe the developers of Foobar2000 might consider implementing such an option?
Thanks, I think?

Re: Auto eject of CDs?

Reply #2
Need library AutoItX3.dll. http://www.script-coding.com/AutiItX.html
and code for WSH, JSP or SMP:
Code: [Select]
if (event) {
     var oAutoIt = new ActiveXObject("AutoItX3.Control");
     oAutoIt.CDTray("H:", "open");
     //oAutoIt.CDTray("H:", "close");
}
where "H" my CD-ROM
UR5EQF. Ukraine

Re: Auto eject of CDs?

Reply #3
Thanks for the response kgena_ua, much appreciated.
Sadly I wouldn't have the faintest idea of where to put this code.
And I get an immediate Trojan warning accessing your link!
I'll continue to use Door Control I think.
Thanks again!

Re: Auto eject of CDs?

Reply #4
https://www.autoitscript.com/site/autoit/
Sadly I wouldn't have the faintest idea of where to put this code.
In a SMP panel (ideally it would be added to a button or an SMP main menu entry). It's a code to control Autoit within foobar (since Autoit allows to open/close the CD door).
The code he shared has a line commented, that's because you have the 2 possibilities (open/close).

In Playlist-Tools-SMP you can find an easy way to import scripts like that and add them to the main menu if you want to apply them on demand. You can also apply it on a specific event (see below). Let me know if you want more details.

https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/module-callbacks.html#~on_playback_stop
3 is On shutdown
Code: [Select]
const oAutoIt = new ActiveXObject("AutoItX3.Control");
function onPlaybackStop(reason) {
    if (reason === 3) {oAutoIt.CDTray("H:", "open");} // On shutdown
}
if (typeof on_playback_stop !== 'undefined') {
const oldFunc = on_playback_stop;
on_playback_stop = function(reason) {
oldFunc(reason);
onPlaybackStop(reason);
}
} else {var on_playback_stop = onPlaybackStop;}

This script may be added as is to any panel or imported into playlist tools. You only need the dll from autoit:

Re: Auto eject of CDs?

Reply #5
Thank you regor,
I have downloaded and installed AutoIt, what is an SMP panel?
I have no coding experience or knowledge, I leave that to my grand children!
Chris

Re: Auto eject of CDs?

Reply #6
Spider Monkey Panel. It's a component for Foobar which allows to add javascript code to a custom foobar panel. As noted it requires coding... I think you should be able to do it without much effort just by copying/pasting the example I put since it's ready to be used as is.

Note you will be adding a new panel to your foobar UI which will do nothing but storing that piece of code which will be executed on playback stop. In other words, you can safely "hide" it.

 

Re: Auto eject of CDs?

Reply #7
Thank you regor,
This is beyond me. I'm 80 years old and have no idea what you are talking about.
The Foobar2000 that I have installed does not offer any 'components' for adding code that I can see.
All this hassle just to auto eject a CD is just not worth it.
I'll stick to what I have been doing, hit Ctrl +O and the CD is ejected! Simple.
Thanks anyway, all the best.
Chris