Pauses Foobar2000 on workstation lock.
Resumes Foobar2000 on workstation unlock.
- Only when foobar is playing. Stopped and paused will be ignored
- Only support for OSs Win2k+
- Adds a Menuitem under Components for enabling / disabling
Download: foo_lock Plugin (http://pelit.koillismaa.fi/plugins/general.php#51)
cool idea
I think i love you.
hmm could/should this work when going to the winxp welcome screen? all my systems are multi-user. i tested it and doesn't seem to work. nice idea for plugin
edit: guess what? it works after you find the menu entry and turn it on! lol *sorry*, posting while tired again. thanks for this simple but essential plugin. /me goes to turn it on for everyone.
Many thanks for everyone who even realized its existens.
I must that plugin when moving from winamp to the next generation.
I think this plugin is most powerful for notebook users, because when I switch to standby or hybernate and come back on in my lesson of my uni I don't have to hope I didn't forgot to turn music off. Teacher will throw me outside with a big bang kick!
hehe, for me it's something quite different. when someone leaves music playing, and someone else comes to use the computer, there's no way for person b to turn off person a's music (without turning the speakers off!) lol. this drives certain people crazy as you might expect. there is one quirk that's a result of the way winxp works - if you walk away and allow the screen saver to kick in, the music doesn't stop until you come back and nudge the mouse. this appears to be because xp doesn't actually lock the workstation until the screensaver stops & you see the welcome screen (it doesn't lock when the screensaver starts, as you might expect). i was thinking you could add an option to pause when screensaver starts, but that would be hacky and probably not a good idea to complicate it.
edit: ok wait, it doesn't work for this purpose, at least not yet :/. it has no way of knowing which user locks/unlocks the workstation.. so it resumes the wrong instance(s) when a new user logs on. shame. can anything be done about this dear plugin author? could this plugin be expanded to do what i was hoping it would do? perhaps you can't even test it if you don't have xp.
Very cool plugin, thank you!
But, as it was already spoken, music starts to play, when the screensaver is started.
I didn't fix the screen saver problem, but I (hopefully) fixed the multiple user problem.
v0.2 ...
kode54, thanks a lot for taking a look but it still unpauses on another user (v0.2). anyone else trying this with multi-user xp setup?
Multi-user problem fixed, more Microsoft stupidity.
v0.3 ...
kode, you're a good man. i haven't tested extensively yet but it seems to work i'll let you know in a day or two if anything odd has shown up. thanks a lot.
Many thanks kode54, for taking my (your) plugin further on. *g*
I got a problem with the new wtsapi32.h. I got it on my PC because I have intalled VS.Net2003 but it can't compile it with VS6, even if I copy the wtsapi32.h and the wtsapi32.lib. Do you got an answer for that problem?
yes thanks to both of you. the world needs more plugins like this - genuinely useful to normal people (cough well, i'm not normal) and only 11k
foo_lock only needs wtsapi32.h (and maybe a newer PSDK WinUser.h) for the WTS macros. It does not need the library, because it imports the functions itself. The reason for this is because that dll is only supposed to exist in NT 5.1 or newer, so it falls back on the timer-based polling if it fails to import those functions. (or register the class, or create the window...)
needed from wtsapi32.h:
#define NOTIFY_FOR_THIS_SESSION 0
needed from winuser.h: *
#define WM_WTSSESSION_CHANGE 0x02B1
#define WTS_CONSOLE_CONNECT 0x1
#define WTS_CONSOLE_DISCONNECT 0x2
#define WTS_SESSION_LOCK 0x7
#define WTS_SESSION_UNLOCK 0x8
Or, the updated PSDK headers that I use with VC6: [download (http://www.cqasys.com/projects/kode54/wtsapi32.zip)]
* Blocked out by #if _WIN32_WINNT >= 0x0501, but the dynamic loading in CSessionWnd Initialize function should prevent the code which uses these from ever executing on pre-NT5.1 systems anyway. Polling for 2000, Windows Terminal Services API for XP, 2003 Server, and newer.
ah, thanks dude. My winuser.h was not that new. wtsapi32.h was.
i've been thinking about the 'screensaver problem' - don't change anything!
- if you walk away from your computer, you might well want the music to play on as you listen and do other things (i often do)
- when someone interrupts the screensaver, that could be you coming back (slight pause, too bad) or someone else wanting to use the computer. there's no reasonable way to be sure, so it's better to pause in case it's someone else imho.
ok perhaps that's really stupid but that's what i thought..
just to repeat (because i don't think this plugin has got enough attention) this plugin is great. just for the convenience of only having to lock the computer each time and letting it handle the pausing/unpausing is worth it. can i go so far as to suggest this is included in the standard foobar package, because this (pause when switching users) is something that every audio player should do i think. you might even want to default it to on! yes it's that good! ok point made, i think this is something more people would use if they knew about it. and having it in the installer would save me having to unzip it for every computer heh
edit: make sure you are downloading the latest that kode54 posted, not the one at the top of the thread.
edit2: it would be cool to get feedback from other people using this (?) to make sure there's no weird quirks. obviously plugins included with foobar must be well tested first, i'd think.
v0.4 [binary (http://www.cqasys.com/projects/kode54/foo_lock.zip)] [source (http://www.cqasys.com/projects/kode54/foo_lock_src.zip)]
Oi, see what happens when you don't clean up properly. Disable function is now saner, so we shouldn't be seeing any crashes on shutdown if user enabled and then disabled first. (XP/2003 only... I don't think KillTimer crashes if fed an illegal timer handle...)
ok, well done, see i never turn it off
kode i was going to msg you but i might aswell add it here: could you maybe add a "plugins i worked on" section to your page, i.e. not just the plugins you started?
I did not start all of the components listed on my page.
It doens't work on Windows 2003
Any chance you can fix it? It's a great idea!
It doens't work on Windows 2003
Any chance you can fix it? It's a great idea!
works here
Did you do anything special to make it work?
The only "strange" component I have is winamp_spam, and I'm using Kernel Streaming...
edit: oh yes, I'm also not running a different shell (not explorer). It's Geoshell. Do you think that might be the problem ?
edit2: Im my the other machine, with Windows XP and Explorer as the shell, doens't work either
Administrator group accounts?
A silly question to Andrea: have you enabled it?
Components - pause on lock.
I feel so silly
Sorry about that! I misses that option, I was looking for it in the preferences window
Thanks!
Maybe it needs documentation.
Maybe it needs documentation.
lol
Suggestions for future development (if any):
* Make an option to disable playback during the screensaver (if possible), i use this at work and when the screensaver turns on (i cannot disable it due to profile restrictions) the playback resumes.
* Make the "pause on lock" option enabled from the start when you install the plugin, one might assume that when you download and install the plugin it is that functionality you want?
Uploaded new binary and source in the same place, without incrementing the version number.
Silly me, registering main thread windows with modeless_dialog_manager is only necessary if they need to receive user input messages. Definitely not needed for message windows.
Silly you indeed.
If anyone is interested you can use this function to see if the screensaver is running (not on windows 95/98 though):
bool isScreensaverRunning;
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &isScreensaverRunning, 0);
http://msdn.microsoft.com/library/default....ametersinfo.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp)
If I can find someplace where I can use Visual Studio I'll give it a try and see if I can add the option to pause during the screensaver too.
anyone got a working download link for this plugin ? I checked the 3rd Party Plugons page, which lists the version as 0.4 but when you install it Fooby reports 0.1 ...
I love you for this plugin -- my sister always goes on my computer (on her useraccount) and I always forget to turn off my music.
I have a question though, sometimes when pause my music, then manually "switch user" on XP so my workspace is locked (I require a password to login), after 10 minutes, when my screensaver is activated, the music starts playing again. Is there any remedy?
(I remedied this myself by simply stopping my music, but sometimes it's nice to be able to pause it then log out manually.)
Kreisquadratur & Kode, keep up the good work.
Well, there seems to be something buggy with the http://pelit.koillismaa.fi/ (http://pelit.koillismaa.fi/) upload feature. I weren't able to upload the new versioned files, and Kode54 also seems to be not reachable.
But here is my link: http://www.kreisquadratur.de/Download/foo_lock.zip (http://www.kreisquadratur.de/Download/foo_lock.zip)
Maybe this fixes Bustacap2k3's problem as well as he could maybe have just version 0.1.
Ah hah, you're right, I did have 0.1 of foo_lock. I will let you know tomorrow if this fixes my problem as I do not have the 10 minutes to test it right now. Thanks for the update
Truly indispensable plugin. Thanks a bunch.
YaY! I hope it stays paused when the SS activates
Yep, with 0.4, it stays paused when the screensaver activates.
CONGRATULATIONS!
(Not for the plugin, as I do not need it; but COOL USERNAME indeed!)
It even works with foo_scheduler. I was afraid Foobar will be paused after waking up pc from sleep by scheduler. But it plays like charm.
But why am I writing this.. some of you are probably dead by now.
Thus sorry for interrupting
Cheers anyway
It even works with foo_scheduler. I was afraid Foobar will be paused after waking up pc from sleep by scheduler. But it plays like charm.
But why am I writing this.. some of you are probably dead by now.
Thus sorry for interrupting
Cheers anyway
Hm! Tested it just because you awoke the thread.
Crashes my fb2k, probably incompatible with something.