| Summary: | wishlist: support for user-specified scripts on song-change event | ||
|---|---|---|---|
| Product: | [Applications] juk | Reporter: | Justin Mason <jm-kde> |
| Component: | general | Assignee: | Michael Pyne <mpyne> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian testing | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Justin Mason
2004-02-29 23:58:00 UTC
Since I'm not convinced that something like this belongs in the main GUI I'll probably do something like add a DCOP signal. If there doesn't happen to be something already that lets you link up DCOP signals to apps, well, that would be relatively easy to hack up. I've been debating coming up with kind of a page to collect kind of advanced stuff with JuK and something like this would fit. On the other hand I'm trying to keep most stuff like this out of the GUI since I think 99% of users either don't want it or would find it confusing. I've modified my local JuK code to export the current song to the file for "now playing" use in IRC. I also think that this feature shouldn't be implemented directly to the JuK, but a plugin when it'll be possible.. fwiw, Teemu, you can do that now by running 'dcop juk Player nowPlayingString' (or similar, typing from memory). That command will tell you what's currently playing. But that's polling; a better approach would be for JuK to notify our apps on song-change, as mentioned. Scott, I agree a DCOP signal sounds like it would be useful, if that's how DCOP handles one app being notified on an event in another app. I don't really know enough DCOP to have suggested that myself ;) Well, yes, I know I can get it that way but it doesn't seem to work from shell scripts.. And another issue is that I should find a way to update the file remotely, so that's why just writing it to the file is the easiest thing imho. Thanks for the comment anyways :) actually -- you can get it from scripts. I think the problem you might be seeing is an X authorisation (or KDE auth) one, where the script is running from somewhere it doesn't have your GUI environment (cron?). I worked around this by dumping my environment into ~/.exports, and sourcing that from the script I run from cron. But I agree -- it would be nicer to get Juk to run the script itself, instead of having to start an external script separately. aside: a very useful thing for this script/signal to provide is the *path* of the currently playing song, and/or id3 metadata; see bug 80849. Reporter: I forgot but a few months ago I added the DCOP signal that Scott was referring to. It's called trackChanged(), part of JuK's Player interface. The signal is emitted whenever the song changes (or playback stops). You can retrieve info on the currently playing song after that using DCOP. There is a JuK wiki page over at http://wiki.kde.org/tiki-index.php?page=juk where you can see the DCOP documentation. There is also example code for Ruby's Korundum bindings linked there, which you can view directly from http://grammarian.homelinux.net/~kde-cvs/showPlaying-signals.rb . The sample file will listen for the trackChanged() signal and update a window with the cover art and some metadata for the playing song. You can probably dream up better things to do. :) Is this sufficient to meet your request? Otherwise it will probably need to wait for KDE 4.0. sounds like it'll do the trick, alright. Thanks for adding this! |