FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

foobar2000 Remote - A COM approach
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
OddbOd
Newbie


Joined: 26 May 2007
Posts: 9

PostPosted: Sat May 26, 2007 3:04 pm    Post subject: foobar2000 Remote - A COM approach Reply with quote

Hello all, a contact on another forum suggested trying Clicker and I was immediately impressed by it especially the included media player control scripts. After looking at the scripts for foobar2000 here on the forum I noticed many people reported that the AMIP-based script doesn't work (besides I don't want to use AMIP) and that the hotkey based script makes too many assumptions about the way fb2k is setup. Rather than just complaining I decided to have a go at writing my own using a control method more like the one used in the included WMP and iTunes scripts.

First a few notes/warnings:
[list][*]This script is alpha quality and was hacked together using the examples by Foosion and Salling AB i.e. any bugs are my fault and due to the fact that this is my first attempt at using JScript.
[*]The script requires [url=http://foosion.foobar2000.org/0.9/]Foosion's COM Automation server[/url] to be installed but no other configuration changes are required.
[*]It has only been tested under Windows Mobile 2003 SE as I don't have access to any other devices (BTW how do other devs test their scripts? is there a Windows client available?).[/list:u]
Any comments/criticisms/feature requests/bug reports would be greatly appreciated as I would eventually like to get this script up to the same standard as those included with Clicker.



foobar2000 Remote 20070531.zip
 Description:
New:
- Basic album art support (folder.jpg in same folder)
- Hold play/pause to stop playback
- Volume control fixed
- Stopping playback clears display

Download
 Filename:  foobar2000 Remote 20070531.zip
 Filesize:  2.29 KB
 Downloaded:  2474 Time(s)



Last edited by OddbOd on Sun Jun 03, 2007 2:41 pm; edited 5 times in total
Back to top
View user's profile Send private message
bazzybazz
Newbie


Joined: 24 Oct 2006
Posts: 6

PostPosted: Sun May 27, 2007 2:42 pm    Post subject: Reply with quote

thanks oddbod, the main functions work really nice.
i remember an older script (doesnt work anymore) that also displayed the album cover on the phone. is that possible?
btw, i am running vista, and the volume keys dont work on my phone. you know how to change this? furthermore can you add an exit foobar button?
thanks!
Back to top
View user's profile Send private message
OddbOd
Newbie


Joined: 26 May 2007
Posts: 9

PostPosted: Mon May 28, 2007 2:19 pm    Post subject: Reply with quote

Hi bazzybazz, thanks for the feedback.

My reasoning for why the script changes the system-wide volume is partly out of personal preference (I have 4 different volume controls, foo's, 2 in the Windows mixer and 1 on my amplifier) and partly because by default foobar2000's volume control is buried in the preferences. Changing the volume control won't be a problem, at the moment it's changed using a library supplied by Salling (that's my excuse and I'm sticking to it) Could you please try the system volume script that comes with Clicker under Vista and let me know if that works for you?

There is actually no support for artwork in foobar2000's core it is an additional feature that uses 3rd party components which do not expose a scripting interface. That said I do intend to hack folder.jpg support (as used by Windows and WMP) into the script to enable the use of cover images, this will not suit everyone but it is more practical than trying to support the plethora of different methods that can be used for covers.

An exit feature is already on my to-do list, the reason I didn't consider it essential is because the script can take control of an existing instance of foobar. Would you prefer foobar to quit when the script is exited or have it as a menu item? It wouldn't be sensible to tie it to a phone button because this wouldn't work on devices that lack keypads.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Mon May 28, 2007 2:22 pm    Post subject: Reply with quote

OddbOd:

As you're dragging my system volume scripting API into this ;-) Let me ask bazzybazz a question:

You said the volume keys on your phone don't seem to work. It may be that they cannot work. What phone do you have?

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shadesbass
Newbie


Joined: 28 May 2007
Posts: 8

PostPosted: Mon May 28, 2007 6:28 pm    Post subject: Reply with quote

Thanks OddbOd!

Took all of 30 seconds to install and the basics work great on my SE P910i and Win XP.
However, I'm getting very limited functionality. I can play, pause and skip tracks, however I am unable to change volume, navigate to any part of the track (i.e. fast forward/rewind) or access the menu.
The volume worked the very first time I used it, but hasn't since.
Also, the play/pause button doesn't switch icons to indicate paused/playing.


Update: I've just tried WMP and the volume control in that isn't working either so I suspect that it's a wider issue.

Update2: My jog dial (normally used for volume, play/pause etc. in iTunes/WMP) doesn't seem to be able to control anything in SC now. I've just upgraded to SC 3.5 but it used to work in SC 3.0. Hmm...
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Mon May 28, 2007 6:33 pm    Post subject: Reply with quote

shadesbass:

Haven't had any other reports about jogdial on P910i not working in 3.5. Could you please do some more tests?

- Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shadesbass
Newbie


Joined: 28 May 2007
Posts: 8

PostPosted: Mon May 28, 2007 6:45 pm    Post subject: Reply with quote

Hmm...I closed the flip and reopened it (with SC running), and the jog dial decided to work again, including the volume control.

Maybe it's just my phone being a bit weird. I'll have a play around with it when I have time and let you know if I have any more problems.

Apologies to OddbOd for hijacking his thread!
Back to top
View user's profile Send private message
OddbOd
Newbie


Joined: 26 May 2007
Posts: 9

PostPosted: Tue May 29, 2007 4:35 pm    Post subject: Reply with quote

Hi shadesbass, I've made a quick update to the script to enable play/pause status display and to get track seeking working, please note that I don't expect seeking will work on phones yet (only PDAs) because I don't fully understand key repeat handling which is necessary to enable seeking by holding a button down.
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue May 29, 2007 4:43 pm    Post subject: Reply with quote

Hint for OddbOd:

There are 3 keypad-related script callbacks for these events, respectively: keydown, keyrepeat, and keyup. Right?

Add a state variable to keep track of whether we're currently repeating keys.

if keydown : clear repeatState variable
if !repeatState && keyrepeat : set repeatState and start seeking ("hold" action)
if !repeatState && keyup : perform "click" action
if repeatState && keyup : end seeking ("hold" action)

You can see this strategy in action in the iTunes controller.

Best.
--
Jonas

[quote="OddbOd"]Hi shadesbass, I've made a quick update to the script to enable play/pause status display and to get track seeking working, please note that I don't expect seeking will work on phones yet (only PDAs) because I don't fully understand key repeat handling which is necessary to enable seeking by holding a button down.[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
OddbOd
Newbie


Joined: 26 May 2007
Posts: 9

PostPosted: Tue May 29, 2007 8:43 pm    Post subject: Reply with quote

Nice one Jonas that is just what I needed.

Updated the script again with key repeat support for track seeking and volume adjustment, unfortunately the volume problem is now affecting me as well. The strange thing is that the Master Volume slider in Windows Volume Control still goes up and down as normal but the audio volume does not change, this continues to happen after Clicker and foobar2000 have been exited.

Update: No longer using system volume hopefully this will avoid the problem altogether.


Last edited by OddbOd on Wed May 30, 2007 8:58 am; edited 1 time in total
Back to top
View user's profile Send private message
shadesbass
Newbie


Joined: 28 May 2007
Posts: 8

PostPosted: Wed May 30, 2007 12:53 am    Post subject: Reply with quote

Thanks for the update. I'll check it out in the next couple of days. I'll let you know if I find any bugs etc.
Back to top
View user's profile Send private message
Inproof
Newbie


Joined: 01 Jun 2007
Posts: 4

PostPosted: Fri Jun 01, 2007 4:37 pm    Post subject: Reply with quote

Hey i can't connect this plug-in whit my foobar. I get this error


Sat Jun 02 17:12:05 2007
foobar2000 Remote - Microsoft JScript runtime error
[Line: 4 (1)] Automation server can't create object

Can you help me ?
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Fri Jun 01, 2007 5:17 pm    Post subject: Reply with quote

I had a quick look at this script. Could you please tell us what version of foobar you got installed? Also, it's possible that your foobar installation is damaged. I'd try repairing it.

Best.
--
Jonas

[quote="Inproof"]Hey i can't connect this plug-in whit my foobar. I get this error


Sat Jun 02 17:12:05 2007
foobar2000 Remote - Microsoft JScript runtime error
[Line: 4 (1)] Automation server can't create object

Can you help me ?[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inproof
Newbie


Joined: 01 Jun 2007
Posts: 4

PostPosted: Fri Jun 01, 2007 5:33 pm    Post subject: Reply with quote

[quote="salling"]I had a quick look at this script. Could you please tell us what version of foobar you got installed? Also, it's possible that your foobar installation is damaged. I'd try repairing it.

Best.
--
Jonas

[quote="Inproof"]Hey i can't connect this plug-in whit my foobar. I get this error


Sat Jun 02 17:12:05 2007
foobar2000 Remote - Microsoft JScript runtime error
[Line: 4 (1)] Automation server can't create object

Can you help me ?[/quote][/quote]


oh m8 thnx i rewrited my foobar and ewerything works fine.

mmm not fine. menu doesn't work. What can i do ?

P.S. sorry for my language.I'm from Lithuania.
Back to top
View user's profile Send private message
OddbOd
Newbie


Joined: 26 May 2007
Posts: 9

PostPosted: Sat Jun 02, 2007 9:41 am    Post subject: Reply with quote

[quote="Inproof"]mmm not fine. menu doesn't work. What can i do ?

P.S. sorry for my language.I'm from Lithuania.[/quote]
The menu button does nothing because the script is not finished, I have not decided what functions will be available on the menu yet, all suggestions are welcome.

Your english makes perfect sense there is nothing to apologise for.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group