Skip to main content
Topic: foo_lock 0.1 (Read 18131 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_lock 0.1

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

foo_lock 0.1

Reply #1
cool idea

foo_lock 0.1

Reply #2
I think i love you.

foo_lock 0.1

Reply #3
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.

foo_lock 0.1

Reply #4
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! 

foo_lock 0.1

Reply #5
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.

foo_lock 0.1

Reply #6
Very cool plugin, thank you!

But, as it was already spoken, music starts to play, when the screensaver is started.

foo_lock 0.1

Reply #7
I didn't fix the screen saver problem, but I (hopefully) fixed the multiple user problem.

v0.2 ...

foo_lock 0.1

Reply #8
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?

foo_lock 0.1

Reply #9
Multi-user problem fixed, more Microsoft stupidity.


v0.3 ...

foo_lock 0.1

Reply #10
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.

foo_lock 0.1

Reply #11
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?

foo_lock 0.1

Reply #12
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 0.1

Reply #13
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:
Code: [Select]
#define NOTIFY_FOR_THIS_SESSION 0


needed from winuser.h: *
Code: [Select]
#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]

* 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.

foo_lock 0.1

Reply #14
ah, thanks dude. My winuser.h was not that new. wtsapi32.h was.

foo_lock 0.1

Reply #15
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..

foo_lock 0.1

Reply #16
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.

foo_lock 0.1

Reply #17
v0.4 [binary] [source]

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...)

foo_lock 0.1

Reply #18
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?

foo_lock 0.1

Reply #19
I did not start all of the components listed on my page.

foo_lock 0.1

Reply #20
It doens't work on Windows 2003 

Any chance you can fix it?  It's a great idea!

foo_lock 0.1

Reply #21
Quote
It doens't work on Windows 2003 

Any chance you can fix it?  It's a great idea!

works here

foo_lock 0.1

Reply #22
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 

foo_lock 0.1

Reply #23
Administrator group accounts?

foo_lock 0.1

Reply #24
A silly question to Andrea: have you enabled it?

Components - pause on lock.

 
SimplePortal 1.0.0 RC1 © 2008-2019