Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sat May 25, 2013 10:51 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Apr 12, 2007 2:56 pm 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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:

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

THANKS I COULD HELP BRO


Top
 Profile  
 
PostPosted: Thu Apr 12, 2007 3:48 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
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 simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 3:57 pm 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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.)

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

THANKS I COULD HELP BRO


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 4:42 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
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 simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 9:08 am 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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.

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

THANKS I COULD HELP BRO


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 2:29 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
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 simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 2:08 pm 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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.

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

THANKS I COULD HELP BRO


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 9:53 am 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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.

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

THANKS I COULD HELP BRO


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 12:41 pm 
Offline
Robot Guru
User avatar

Joined: Sun Aug 27, 2006 11:26 pm
Posts: 2757
Location: Directly above the center of the Earth
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 simple things that always confound me..
Open your mind, Read, Learn, Think, Apply..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 1:21 pm 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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:

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

THANKS I COULD HELP BRO


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 2:43 pm 
Offline
Snails in tiny top hats
User avatar

Joined: Mon Oct 31, 2005 10:43 am
Posts: 831
Location: Illinois
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:

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

THANKS I COULD HELP BRO


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group