Putting robotics at your service™

Free shipping on orders over $200

Juk dcop signal in KDE 3.5

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 11 posts ]

User avatar
Expert ( offline )
Posts: 750
Posted: 2007-04-12 15:56 
Hey, I know there are a lot of Linux users here, so... Can anyone help me? Please, assume I know nothing about this stuff. =D

I've read that the new version of Juk (KDE 3.5) sends out a dcop signal when the song that's playing switches to a new one. However, I have no idea how to use this signal. I have a small program written in Perl that outputs the current song to my LED display. Now, remember, I am not a programmer, nor do I really know much about Linux. So my program basically is a continuous loop that compares the song value (from a "juk player playingString()" call) to the stored song value, and either updates the stored (if it's different), or does nothing and goes through the loop again.

I know, I know... You can laugh all you want. It gets the job done, okay? :lol:

Then I came across this:

Quote:
From http://wiki.kde.org/tiki-index.php?page=JuK, toward the bottom.

* Signals JuK will emit
o void Player::trackChanged() - Emitted when the user selects a different track (or stops playback). Since KDE 3.5

Wow. If I could only harness the power of this Juk-emitted signal, I could eliminate all my continuous endless loopness from the program!

However, that's where I hit a dead end. Google searches are, for the most part, fruitless. The only other mention I've seen is this script written in Ruby, and understand it even less than my own Perl script! :lol:

So... Any takers? :wink:

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


User avatar
Guru ( offline )
Posts: 2956
Posted: 2007-04-12 16:48 
Snailkeeper (Admin) wrote:
I've read that the new version of Juk (KDE 3.5) sends out a dcop signal when the song that's playing switches to a new one. However, I have no idea how to use this signal. I have a small program written in Perl that outputs the current song to my LED display.

I use Juk for playing tunes. :D

I found this PDF which might be a good start on helping you. It has a lot about scripting with DCOP.

Snailkeeper (Admin) wrote:
Wow. If I could only harness the power of this Juk-emitted signal, I could eliminate all my continuous endless loopness from the program!

We can't have you being loopy now.. :D

I googled for "Juk DCOP perl" and found that PDF. :) I will see what else I can dig up that would help you.

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Expert ( offline )
Posts: 750
Posted: 2007-04-12 16:57 
Yeah, I found that PDF a long time ago, but it pre-dates the "trackChanged" dcop signal. It was actually pretty useful when I first created the script, but not so much now that I'm trying to utilize the "trackChanged" signal.

Oh, I also checked in Kdcop, but it didn't have anything about "trackChanged" listed. Probably because it's not a call you can make, but something that Juk itself sends out.

Like I said, I'm way over my head here, and google simply isn't helping me at all this time. :cry:

(And I'm not sure that there's anything you can do about the loopyness--I'm fairly loopy naturally. ;D Hehe.)

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


User avatar
Guru ( offline )
Posts: 2956
Posted: 2007-04-12 17:42 
Snailkeeper (Admin) wrote:
Yeah, I found that PDF a long time ago, but it pre-dates the "trackChanged" dcop signal. It was actually pretty useful when I first created the script, but not so much now that I'm trying to utilize the "trackChanged" signal.

Ah, OK. So far I have not even found the trackChanged signal. However, I have figured out how to control juk from the command line! So, I am making some progress. :) I have not even seen the trackChanged propery/signal listed anywhere by the dcop command. I have tried using

Code:
 dcop --user dalew juk Player

which lists the items you can access for the player part of juk. No listing I have tried shows the trackChanged signal though. :(

I have been able to get the various track properties, such as track number, track title, etc. into variables from the command line. So far, I am not finding a way to access that trackChanged property though, but I will continue looking. :)

I am starting to wonder if the trackChanged signal just has not been incorporated into the dcop program yet.

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Expert ( offline )
Posts: 750
Posted: 2007-04-13 10:08 
linuxguy wrote:
Ah, OK. So far I have not even found the trackChanged signal. However, I have figured out how to control juk from the command line! So, I am making some progress. :) I have not even seen the trackChanged propery/signal listed anywhere by the dcop command. I have tried using

Code:
 dcop --user dalew juk Player

which lists the items you can access for the player part of juk. No listing I have tried shows the trackChanged signal though. :(

Eh, that's really odd, since both the Wiki and the Ruby script I linked to mention or use it. (Did you check out the Ruby script? I can't make heads or tails of it.)

linuxguy wrote:
I have been able to get the various track properties, such as track number, track title, etc. into variables from the command line. So far, I am not finding a way to access that trackChanged property though, but I will continue looking. :)

Yeah, I can get that, too. I use the "QString playingString()" property something like

Code:
variable = `juk Player playingString()`

to get the current information, formatted like this: "Artist - Song Title". But I don't know how to use any of the dcop information that starts with "void", like "void play()" or, the one I really care about, "void Player::trackChanged()".

linuxguy wrote:
I am starting to wonder if the trackChanged signal just has not been incorporated into the dcop program yet.

Ok, stupid question. Two stupid questions, actually. :lol: What do you mean by the dcop program? And just making sure, but you have KDE 3.5, right? Because the "void Player::trackChanged()" thing was implemented in 3.5, according to the documentation in the wiki I linked earlier.

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


User avatar
Guru ( offline )
Posts: 2956
Posted: 2007-04-13 15:29 
Snailkeeper (Admin) wrote:
Eh, that's really odd, since both the Wiki and the Ruby script I linked to mention or use it. (Did you check out the Ruby script? I can't make heads or tails of it.)

I did look at the Ruby script, and even downloaded and tried to run it. However, I have to install the korundum module, or whatever it's called, which I apparently need to build from sources. Debian doesn't have a package for that module. I can't learn a new language right now. :(

Snailkeeper (Admin) wrote:
Yeah, I can get that, too. I use the "QString playingString()" property something like

Code:
variable = `juk Player playingString()`

to get the current information, formatted like this: "Artist - Song Title". But I don't know how to use any of the dcop information that starts with "void", like "void play()" or, the one I really care about, "void player::trackChanged()".

In most cases where you see something like "void play()", you can just use the function name for the operation to perform. This: "dcop juk Player play" would work. :) I'll work on this some more when my head isn't hurting.

Snailkeeper (Admin) wrote:
Ok, stupid question. Two stupid questions, actually. :lol: What do you mean by the dcop program? And just making sure, but you have KDE 3.5, right? Because the "void Player::trackChanged()" thing was implemented in 3.5, according to the documentation in the wiki I linked earlier.

Yes, I am running the latest KDE 3.5.5 or whatever the latest actually is.

The dcop program is a command line interface to the whole DCOP mechanism. :D If you do just the "dcop" command alone, it will show you the things you can access using the DCOP mechanism. Then you can use "dcop juk" to see what parts of juk you can control via DCOP, and just drill down from there until you get "dcop juk Player" and finally "dcop juk Player play" to start juk playing. It's really quite nice program to know how to use from the command line. :D

I can do:

Code:
dalew@intrepid:~$ tracktitle=`dcop juk Player trackProperty Title`
dalew@intrepid:~$ echo $tracktitle
Take a Chance on Me

which gets me the track title of the song currently playing into the shell variable tracktitle. :D I can then process the nformation anyway I might need to. The tildes are significant in the above commands.

BTW, the only stupid question is the one you DO NOT ask.. :D

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Expert ( offline )
Posts: 750
Posted: 2007-04-17 15:08 
I did a bit more google searching and link-hopping, and found this page:
http://cia.vc/stats/project/kde/kdemultimedia/.message/a7ad

Unfortunately, it is again a mere mention of this supposed dcop signal, with no further information available.

I've decided to go about trying to find information on generic dcop signals, in the hope that perhaps I can glean enough knowledge to apply toward Juk's signal.

I found this page:
http://api.kde.org/3.5-api/kdelibs-apidocs/dcop/html/index.html

Looks like there might be some useful information there toward the bottom, but I'm not well-versed enough with either Linux or programming in general to really know for sure. =D


I also dug around in Kdcop, but I couldn't find anything there, either.

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


User avatar
Expert ( offline )
Posts: 750
Posted: 2007-04-23 10:53 
Do you know if Juk has a forum? That might be a good place to pester people about this mysterious dcop signal. :wink:

I'll do some googling for it, and post what I come up with.

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


User avatar
Guru ( offline )
Posts: 2956
Posted: 2007-04-23 13:41 
Snailkeeper (Admin) wrote:
Do you know if Juk has a forum? That might be a good place to pester people about this mysterious dcop signal. :wink:

There is KDE Forum, but I have not found anything real useful about DCOP there yet. I really think this is so new to JuK that it just hasn't been documented yet, or at least not anywhere but in code. When I get back into Linux next, I will see if I can find something useful in the JuK code.

8-Dale

_________________
I can usually handle complexity. It's the [b][i]simple[/i][/b] things that always confound me..
Check out my [url=http://www.hybotics.me]blog[/url] now!
Open your mind, Read, Learn, Think, Apply..


User avatar
Expert ( offline )
Posts: 750
Posted: 2007-04-23 14:21 
linuxguy wrote:
Snailkeeper (Admin) wrote:
Do you know if Juk has a forum? That might be a good place to pester people about this mysterious dcop signal. :wink:

There is KDE Forum, but I have not found anything real useful about DCOP there yet. I really think this is so new to JuK that it just hasn't been documented yet, or at least not anywhere but in code. When I get back into Linux next, I will see if I can find something useful in the JuK code.

8-Dale

Oh, thanks! That'll be extremely helpful. I think I'm going to take a slight breather from this project, as I can't find any information on my own. :cry: I'm getting frustrated with the lack of information on the web. So please let me know what you find when you have a chance to get your codin' hands dirty, eh?

Of course, although I say I'm taking a break, I'll still be searching for the Holy Grail of dcop information. If I can just figure out this whole signal thing, it should be easy... Maybe I'm just going to have to break down and learn Ruby so that I can utilize that script I linked to earlier. :(

C'mon, I've taken C++ classes. It can't be that different... Can it? :lol:

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


User avatar
Expert ( offline )
Posts: 750
Posted: 2007-05-29 15:43 
Well, I think I'm about to call the Juk-DCOP-signal-thing quits. I just can't actually find any useful information, and from what I've read about DCOP signals in general, your program still has to loop and check for the signal anyway, which isn't really what I wanted.

Ideally, I could tell Juk to run a script every time a song is played, or somehow hook a script into Juk itself which would do the same thing. Unfortunately, I've no idea how I'd go about doing this, so I suppose I'll have to make do with my loopy script.

That'll do, Scripty, that'll do. :lol:

_________________
Beth
Lynxmotion, Inc
http://www.lynxmotion.com

THANKS I COULD HELP BRO


 

All times are UTC - 5 hours [ DST ]. It is currently 2014-09-16 03:25
Feedback Form
Feedback Form