PDA

View Full Version : Controlling Audio Player Using Hard Buttons?


Brav0
02-09-2005, 12:32 AM
Hi guys,

I have been wandering these few days.. Is there a way to use UX50's hard buttons to control Clie Audio Player or Media Launcher?

What I meant with hard buttons are not the keyboard buttons but the Back, Browser, Email, and Agenda buttons at the bottom of the device. I want to be able to play music by closing my UX but still have easy access to control play, stop, next, and previous song. I know we can use jog dial, but it is still very limited and not working very well if you want to use the shuffle function.

From searching the forum, the best way I find is using KeyQuick, but it's still need to use keyboard buttons so I have to open my UX to control it.

Any idea will be really appreciated, thanks..

.PoNeH
02-09-2005, 12:39 AM
That would be pretty neat. Hopefully someone will discover a way around that. My jogdial cause my UX to crash when pressed. It makes a repeating noise also, like it's constantly clicking something...

knotnututhis
02-10-2005, 01:04 AM
That would be pretty neat. Hopefully someone will discover a way around that. My jogdial cause my UX to crash when pressed. It makes a repeating noise also, like it's constantly clicking something...

Thats weird!! :confused:

Brav0
02-12-2005, 03:13 AM
Is it just me and .PoNeH who want this with UX?

doovydoo
02-12-2005, 07:51 AM
i would love that!!! but who knows how to do it?

i dont. lol.

RMCF
02-12-2005, 10:41 AM
Yeah, would love that on my TH55 as well (normal audio player), but nothing is available so far.

JAmerican
02-12-2005, 02:22 PM
Would love it to but don't know how to do it.

JAmerican

Cyker
02-12-2005, 02:49 PM
Well I still want an update AudioPlayer DA so I can control the MP3 playback outside of Clie AP, but no one has reverse engineered the new AudioPlayer API, and until the happens I don't think any stuff like my DA or alt. control via hard buttons is gonna happen...

Sharkk717
02-12-2005, 03:01 PM
Hey cyker!

i was just browsing through the CLIE SDK this morning... i would imagine that by sending relevant key codes corresponding to the audio remote control you could in fact simulate that remote even if it wasn't plugged in to your CLIE. very exciting, no? this would allow not only for hard key control but for DA control or even swipe control lol :D

regards, sharky

Cyker
02-12-2005, 03:08 PM
Man, I hadn't thought of that! Genius!! :D

Does it list the codes in the SDK??
I hope Sony were lazy and recycled the AP code from the Remote-enabled Clies... ;)

Sharkk717
02-12-2005, 03:11 PM
hey cyker!

there are key code lists, but they're a bit confusing (suprise, suprise lol). Sony does however define a nice macro in the rmc header that lets you pass the keycode and returns the button constant (Very useful!). if you have the sdk, it's in Incs->Libraries->SonyRmcLib.h

regards, sharky

Sharkk717
02-12-2005, 10:01 PM
Just wrote the app: SharkRMC allows you to control AudioPlayer (MediaLauncher not supported...yet) with your hard keys and back button (you can map them to do different things). i'll publish the source for anyone interested :D works with both TH and UX (for UX don't bother mapping the fourth hard key... it's a waste since there isn't one lol. instead, prefer mapping the back button).

link: http://www.ludustech.com/files/SharkRMC.prc

regards and tell me how it works, sharky

jjesusfreak01
02-12-2005, 10:15 PM
Just wrote the app: SharkRMC allows you to control AudioPlayer (MediaLauncher not supported...yet) with your hard keys and back button (you can map them to do different things). i'll publish the source for anyone interested :D works with both TH and UX (for UX don't bother mapping the fourth hard key... it's a waste since there isn't one lol. instead, prefer mapping the back button).

link: http://www.ludustech.com/files/SharkRMC.prc

regards and tell me how it works, sharky
It seems to work, but the rewind sticks, and there should be a sixth button, as there are six assignments. On a TH, you could use one of the backside buttons.

Sharkk717
02-12-2005, 10:20 PM
hey jjf!

thanks for the suggestion on the buttons! re: rewind: i can't do much about this... i just send what the clie remote sends (FWIW: tapping the rewind icon in AP works the exact same as pushing a button mapped to RW on my TH). glad it works!

regards, sharky

doovydoo
02-13-2005, 04:05 AM
well done!! works perfect.


i notice it does not work when the screen is closed, even if hold is not on.
just an observation. but good work!!thank u!

cykalan
02-13-2005, 06:53 AM
WoW! Finally someone outhere have the talent to do it!!

I've been thinking of something creative but I've been never able to get it realized. Sharkboy can you do me a favor? Can you get a version of the program you released that can use the characters written on the graffiti or using F1-F12 keys on a keyboard? If that is possible I could possibly come up with a Bluetooth Remote control for CLIEs (not a keyboard!) !!

Looking forward to your reply!

Brav0
02-13-2005, 07:21 AM
Wow! Thank you so much to sharkboy.. you really answer my prayer :)

I just check the forum again and haven't tried SharkRMC but I'm sure it will work just fine. Thank you also to other members who have give their responses..

DaVinci's Palm
02-13-2005, 08:49 AM
Not to take away from Sharkboy's app, but QuickKey has a component that lets you control Audioplayer/ ML using the "sidebar". You can add any controls you want, as well as apps. I have mine setup to display:

1. Play
2. Stop
3. FF
4. FR
5. Vol up
6. Vol down
7. ML
8. Albumswap

To call the sidebar, I have it setup so that a long push of the back button calls up the remote. You can do this from any app, so if you are in eReader for instance, you can call the remote and use the jog to go up and down. Jog press selects.

For the UX, when the screen is closed, the hardware buttons do not work except for the jog. Haven't seen anything that gets around this.

Just wanted to let people know about this option for remote control.

As always Sharkboy, great work.

Sharkk717
02-13-2005, 09:34 AM
hey!

<Can you get a version of the program you released that can use the characters written on the graffiti or using F1-F12 keys on a keyboard? If that is possible I could possibly come up with a Bluetooth Remote control for CLIEs (not a keyboard!) !!>

Not sure what you mean by this... could you elaborate on what you want?

DaVinci's Palm:

You're absolutely right! I personally think KeyQuick is an extraordinarily written app! I quickly wrote this as a simple utility for those here who don't have KQ, or don't want to spend the money :D. Otherwise, by all means use KQ (there's no distinct advantage or disadvantage between the two. it's just if you prefer the hardkeys or the popup bar.)

DaVinci is also right about the hardkeys not working when the screen is closed... unfortunately that was the way Sony implemented it :(

regards, sharky

Cyker
02-13-2005, 09:44 AM
Just wrote the app: SharkRMC allows you to control AudioPlayer (MediaLauncher not supported...yet) with your hard keys and back button (you can map them to do different things). i'll publish the source for anyone interested :D works with both TH and UX (for UX don't bother mapping the fourth hard key... it's a waste since there isn't one lol. instead, prefer mapping the back button).

link: http://www.ludustech.com/files/SharkRMC.prc

regards and tell me how it works, sharky

I wouldn't mind having a peek ;)
If it's not too tricky, maybe I could combine it with the DA code you gave me to make a sortof AudioPlayerDA5 :)

Might give me some insight too, since my FindReplaceDA5 isn't working still (But that's another story ;))

Sharkk717
02-13-2005, 09:51 AM
hey cyker! right, well, the basic idea would be to use EvtEnqueueKey and enqueue the correct key presses to make AudioPlayer THINK that there's a remote attached to the device. The keys to enqueue (in chr, keycode, modifier form) are 5898 x 8 and 5899 x 8, where x varies according to which button press you want to do (you MUST enqueue both 98 and 99 to get it to work). Here's the list of "x" values:

Play: 3303
Stop: 1993
RW: 3098
FF: 2498
Vol Up: 1713
Vol Down: 1856

so to send a play command, you'd type:
evtenqueuekey 5898,3303,8
evtenqueuekey 5899,3303,8

hope this helps!

regards, sharky

Cyker
02-13-2005, 03:33 PM
Oooh! Okay, that seems fairly simple... I thought it would be a lot more complex than that!!!

I will knock up a test when I have more free time (RL is a bigger timesink than any computer! :p), although I really wish I could get my hands on the source-code for the original AudioPlayer DA - It had a stereo VU meter and could set shuffle/repeat as well as a bunch of other stuff...!

Brav0
02-13-2005, 09:39 PM
Just tried SharkRMC last night.. simple but great app! It's too bad that it can't work when the screen is closed :(

Cyker
02-14-2005, 04:54 PM
Hey Sharky, I'm having a bit of trouble with this with my DA...

Here's a snippet from the main code segment:

switch( eventP->data.ctlSelect.controlID ){
case btnStop: //Stop (Code=1993)
EvtEnqueueKey(5898,1993,8);
EvtEnqueueKey(5899,1993,8);
break;
case btnPlay: //Play (Code=3303)
EvtEnqueueKey(5898,3303,8);
EvtEnqueueKey(5899,3303,8);
break;
But nothing happens when they get run :(
I get two rapid blips, so apparently the EvtEnqueueKeys are going through, but they ain't triggering whatever they're meant to be triggering... is there something else I'm forgetting to do...?

Do I need to include the Sony libraries or something (I didn't think so since I'm not calling any of their functions, but...?)

Sharkk717
02-14-2005, 05:00 PM
hey cyker :D

strange... check to make sure that your DA isn't handling the presses (let them go through).

regards, sharky

Cyker
02-14-2005, 05:08 PM
Well, the event loop is just the stock one from the DA code you gave me before...

do{
EvtGetEvent(&event, 0);

if ( !SysHandleEvent(&event) && !FrmHandleEvent(FrmGetActiveForm(),&event)){
handled = HandleEvent(&event);
}
} while (handled == false);

I checked and apparently the calls are SysHandleEvents so they shouldn't get passed to HandleEvent()...

Sharkk717
02-14-2005, 05:14 PM
weird. as a matter of interest... if you compile as a normal Palm app does it work?

regards, sharky

Cyker
02-14-2005, 05:28 PM
Well, when I ran it on the OS5 Simulator it loaded okay and the buttons clicked, but when I tried to sync it onto my TH55 it crashed and I had to warm-reset and delete it before it would start up again properly...

This might be because I haven't included most of the functions you normally have in a Palm program 'tho ;)

Shall I send you the code so you can have a look? I suspect it's something really simple and silly, but something I don't have enough PalmOS coding experience to realise... ;)

Sharkk717
02-14-2005, 05:31 PM
hey cyker!

ok, that would be fine. i'll play around with it some after i finish my other work lol and hopefully be able to send it back to you soon (like, later tonight) :D

regards, sharky

Cyker
02-14-2005, 05:42 PM
Thanks man, I really appreciate it! :)

I have a feeling it's something trivial 'tho, I tend to run into lots of little annoying things like that when I start coding on new platforms (Like going from DOS to Windows - Boy, considering it was still C, that was some fun culture shock ;))

I'm probably gonna goto sleep now (It's now tomorrow ;)), so I'll have to grab it tomorrow (Assuming it *is* something silly that you can spot&fix in 2 seconds ;)).

Thanks again! :)

JAmerican
05-02-2005, 12:22 AM
Any luck with a AudioPlayer V3 DA or AudioPlayerOS 5 DA?

JAmerican

cktlcmd
05-02-2005, 07:42 AM
Thanks very much Sharky! Another great application. :)

Cyker
05-02-2005, 08:10 AM
JA well, it kinda stalled. The problem seems to be that the DA form is intercepting all the AP key events that Sharky gave me. I haven't had enough time to dig through the docs to find a workaround, so it'll probably stay stalled for a while :(

I have the source still, but it's really just a basic form with a mutated version of Sharky's DA template :D

JAmerican
05-03-2005, 12:35 AM
JA well, it kinda stalled. The problem seems to be that the DA form is intercepting all the AP key events that Sharky gave me. I haven't had enough time to dig through the docs to find a workaround, so it'll probably stay stalled for a while :(

I have the source still, but it's really just a basic form with a mutated version of Sharky's DA template :D

No rush. I'm a programmer as well. I understand. ;)

JAmerican

tom2
05-04-2005, 04:48 AM
Just wrote the app: SharkRMC allows you to control AudioPlayer (MediaLauncher not supported...yet) with your hard keys and back button (you can map them to do different things). i'll publish the source for anyone interested :D
http://www.ludustech.com/files/SharkRMC.prc
regards and tell me how it works, sharky
Sharky - you're the best :) I just stumbled over this thread by accident (I'm a TH-Owner...), but was looking for exactly such an app to easier control Audioplayer when being outdoors (so I won't have to fumble for the pen and search the UI controls in the glaring sun :cool:

Could you add the jogdial as possible input keys (up/down for volume...)
Can you change the code in such a way that Volume adjustement ist faster? (e.g. sending the event 10times or whatever - it takes way TOO long to adjust the volume the way it is currently)

Or you could just send me the source - as I'm interested enough in this to finally get up and running with some very-smallscale Palm programming :D
Thank you again! (Sharkscan rulez)