FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Spotify

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Thu Dec 04, 2008 11:01 pm    Post subject: Spotify Reply with quote

Basic control for Spotify (version 0.3.x):

http://www.spotify.com/en/

[CHANGELOG v.0.3]

- Playlist switcher
- Go back/forward (browse) and play
- Logging option
- Send to tray
+ Minor improvements

[CHANGELOG v.0.2]

- Bugfix: Not focusing window on every keystroke
- Launch option

[INSTALL]

Move folder to My Clicker Scripts
Add Spotify to Clicker Items
open Spotify.js with e.g. notepad and point 'var exe = ..' to your
spotify executable.

[FEATURES]

- PLAY/PAUSE
- NEXT/PREVIOUS Track
- VOLUME UP/DOWN
- UN-/MUTE
- Now Playing (Artist - Title)
- CLOSE (Terminate Process)
- Background logo (if supported)

[b]See the included readme-file for detailed information / setup instructions.[/b]
Enjoy!



Spotify_v0.3.zip
 Description:
v.0.3_apr.09

Download
 Filename:  Spotify_v0.3.zip
 Filesize:  10.87 KB
 Downloaded:  5545 Time(s)



Last edited by joeker on Thu Apr 30, 2009 5:23 am; edited 2 times in total
Back to top
View user's profile Send private message
Zawaq
Newbie


Joined: 12 Jan 2009
Posts: 3

PostPosted: Sat Jan 17, 2009 6:40 pm    Post subject: Reply with quote

Thanks for the script. Change track buttons and the volume (and mute) buttons doesn't work very well though.

I don't know how to do/build salling-scripts (or AHK-script) but I'm using [url=http://www.autohotkey.com]AHK[/url] so i can use global hotkeys to spotify. Maybe you could look at the script code and see if there is something in comment so this script can be better.

[URL=http://www.autohotkey.com/forum/topic38617.html]Spotify Global Hotkeys (script)[/URL]
[URL=http://www.autohotkey.com/forum/topic39506.html]Spotify and AHK (ask for help)[/URL]

I hope you can read what I write :P

Keep up the good work :D
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Tue Jan 20, 2009 10:41 am    Post subject: Reply with quote

Thanks for the feedback and appreciation!
I think I've found the source for the partially malfunctioning keys (please dl new version).
Also note: UnMute will always maximize volume (I can't get clicker to send 'Ctrl-Shift-Down', so I'm simply applying a 'Ctrl-Up' - loop).

@AHK: In general, it should work without global hotkeys because the script is focusing the spotify window when sending keystrokes.

Sidenote: Atm, this script is very premature. I'm hoping to see the api arrive in the near future -- it wouldn't make much sense in my opinion to invest too much time working around every glitch right now.
Back to top
View user's profile Send private message
t3chnofre4k
Newbie


Joined: 17 Apr 2006
Posts: 3

PostPosted: Mon Feb 23, 2009 5:26 pm    Post subject: Reply with quote

[quote="joeker"]Thanks for the feedback and appreciation!
I think I've found the source for the partially malfunctioning keys (please dl new version).
Also note: UnMute will always maximize volume (I can't get clicker to send 'Ctrl-Shift-Down', so I'm simply applying a 'Ctrl-Up' - loop).
[/quote]

Have you tried SendVirtualKeystroke (0x41, false, true, false, false)
It's called boolean code, so where the words (false, true, false, false) stand is actually the corresponding buttonstate of shift, control, alt and the win-key.

--To make it simple--
This is the line: SendVirtualKeystroke (0x41, false, true, false, false).
This is what each word represents in quotes: SendVirtualKeystroke (0x41"A", false"shift", true"ctrl", false"alt", false"win").

So here we can see that the "ctrl" state is true which means the button is pushed together with the button "A" (0x41).
So if all say false only the button A is pushed, or if it says "false, true, true, false" it results in ctrl+alt+A and so on. =)

And here's a link for the virtual keycodes for microsoft:
[url]http://msdn.microsoft.com/en-us/library/ms645540.aspx[/url]


For mac users there seems to be a little bit harder to figure out the codes, but I'm not a mac user so I'll let it be unsaid.

I hope this shed some light over it all, and if someone notices anything wrong in my description please do tell =)

Best regards from Robin
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Wed Feb 25, 2009 2:21 am    Post subject: Reply with quote

[quote="t3chnofre4k"](..)[/quote]

Nice tutorial, but why post it here? =)

@topic
Please try it (you'd saved yourself a lot of typing =).
"SendVirtualKeystroke( 0x28, true, true, false, false )" does [u]not[/u] work.
(CTRL_SHIFT_DOWN)
If you or anyone else can come up with a solution, I'd be happy to implement it.

Best regards =)
Joeker

Sidenote: Script tested/working with Spotify version 0.3.11.
Back to top
View user's profile Send private message
ooskan
Newbie


Joined: 12 Apr 2009
Posts: 2

PostPosted: Sun Apr 12, 2009 1:49 pm    Post subject: Just play/pause works Reply with quote

For me its just the play/pause function that works. I've tried to change some lines in the code but unfortunately with no success.

I'm running Spotify Version 0.3.13 and Salling Clicker version 3.5.0.860.

Can anyone please look over the code joeker has done and make it work correctly? I would be so damn happy! :D

and, thanks for a really good start with the script!
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Tue Apr 14, 2009 8:25 pm    Post subject: Reply with quote

Hey,
I'm having no trouble with version 0.3.13 (rev 45126) -- I suspect a conflict with your specific setup.
Some starting points for bug tracking:

Verify the spotify-keys are working (see readme.txt); e.g. focus the window and press Ctrl-Right for next track.
Any global-hotkey-software installed or other apps using same key-combinations?
The script isn't working perfectly. Sometimes you have to press a key twice on your phone.
Try manually focusing spotify before you press a key.
Back to top
View user's profile Send private message
ooskan
Newbie


Joined: 12 Apr 2009
Posts: 2

PostPosted: Sun Apr 19, 2009 2:59 am    Post subject: Reply with quote

Okey, I have tried this tips now and it still doesn't work.

Anyway, I've just downloaded "Toastify" and directly after installing it I think that I at least should try to control spotify from my phone now - guess what, it works! Perfectly!

Thanks a lot, love this script! :D
Back to top
View user's profile Send private message
glenhenry
Newbie


Joined: 20 Apr 2009
Posts: 2

PostPosted: Mon Apr 20, 2009 11:11 am    Post subject: Love the script but.. Reply with quote

I have a htc touch hd phone and im not able to use d-pad key for play/pause, next track ect.
In the media player/itunes script there is some small buttons for play and previous/next track.
Would it be possible for you to implement these buttons in your script so touchphones without dialpad buttons can use it?
Tanks
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Mon Apr 20, 2009 11:10 pm    Post subject: Reply with quote

[quote="ooskan"]Okey, I have tried this tips now and it still doesn't work.

Anyway, I've just downloaded "Toastify" and directly after installing it I think that I at least should try to control spotify from my phone now - guess what, it works! Perfectly!

Thanks a lot, love this script! :D[/quote]

Glad to hear it :) More info on toastify:
[quote="Toastify"][url=http://toastify.codeplex.com/]Toastify[/url] adds some missing functionallity to the Spotify client(Windows only). It shows a popup, toast style, dialog on track change and it allows you to use global hot keys for Play/Pause, Next, Previous etc. [/quote]

[quote="ooskan"](..) d-pad (..)[/quote]
//Edit: There might be an easy solution:

Open spotify.js in your editor and change:

MonitorScreen = CreateKeypadScreen( "monitorScreen_");

to

MonitorScreen = CreateMediaplayerScreen( "monitorScreen_");

---------

Optionally add following lines:

theScreen.mediaLength = -1;
theScreen.mediaPosition = -1;

below

function monitorScreen_Update( theScreen ) {

---------
Hope it works!
Back to top
View user's profile Send private message
glenhenry
Newbie


Joined: 20 Apr 2009
Posts: 2

PostPosted: Tue Apr 21, 2009 9:54 am    Post subject: Thanks! Reply with quote

:D
Sweet, thanks!
Back to top
View user's profile Send private message
splix
Newbie


Joined: 28 Apr 2009
Posts: 1

PostPosted: Tue Apr 28, 2009 9:45 pm    Post subject: Reply with quote

Thanks for the script but it don't work very well for me.

I can only change one or two songs, then it seems like it won't work anymore. I can play/pause all the time but not change tracks (and that's the thing I would like to do the most).

Really nice to make a script like this, don't misunderstand me, I'm very very gratful!


Hope you have the time and energy to make this perfect! :wink:
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Wed Apr 29, 2009 12:49 am    Post subject: Reply with quote

Hi splix,
sounds like a similar problem ooskan was writing about. Did you try installing toastify? Let me know if it works!

Thanks for all the feedback :) Unfortunately, there are few chances to improve the functionality atm. Spotify released an api but not exactly what I was looking for.

//Edit: .. having said that: New version uploaded :)
//Update: Tested/working with 0.3.14 rev 45614
Back to top
View user's profile Send private message
Henrik E
Newbie


Joined: 30 Jul 2009
Posts: 1

PostPosted: Thu Jul 30, 2009 7:03 pm    Post subject: Spotify in your S60: DSBridge and Salling Clicker - it works Reply with quote

I've got Spotify in my S60 Nokia Phone!

So I found DSBridge (by Jesper Svennevid who seems to be a clever lowlevel programmer). This is a tiny "program" (DLL) that transcodes all sound from the "direct sound API" to MP3 up to 320 bps and then unicasts the stream over your LAN (or even internet). So I run Spotify as a "server" on a PC in my home and DSBridge streams MP3 in my LAN (and even WAN if I want to).

I pick up the stream perfectly with Internet Radio on my Nokia S60. Of course you can use all other internet radio devices as well. The app is small and hardly uses any resources. It is installed by just dropping the DSound.dll in your spotify folder (to substitute the system DSound.dll) and is up and running just by launching spotify.

Then of course I use Salling Clicker with Joeker's spotify-script to remote control my "spotify server", change playlists and so on. I've started to modify some things in the script to suit a "server model" where you are not in the same room as the computer (muted sound, allways kept minimized in the tray etc).

The next problems to solve are:

Is there a way to display the album art from Spotify (could the image from that window be catched in some way)?

Is it possible to get S Clicker to operate over the internet via TCP/IP, not only in your LAN? That would be nice when you are using other WLAN:s, hotspots or even 3G if not too expensive.

A more difficult step would be to search for songs on spotify... Right now I'm fine with the playlists.

P.S. The DSBridge also streams the metadata, so you get artist and song name in the internet radio application (on my Nokia) and even the coverart should be streamd there if the radio applicatiopn can handle it.

Read about and get DSBridge at

http://forums.slimdevices.com/showthread.php?t=64590


Last edited by Henrik E on Sat Sep 19, 2009 11:14 am; edited 1 time in total
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Fri Aug 28, 2009 4:11 pm    Post subject: Re: Spotify in your S60: DSBridge and Salling Clicker - it w Reply with quote

[quote="Henrik E"]I've got Spotify in my S60 Nokia Phone! (..)
[/quote]
Wow, that's a nice setup!
Feel free to post/attach your custom solution 'server model'. I'm sure many are interested in this kind of application.
[quote]Is there a way to display the album art from Spotify (could the image from that window be catched in some way)? [/quote]
Might be feasible to find some implementation (another ugly hack-around by moi) .. no guarantees, though.
[quote]A more difficult step would be to search for songs on spotify .. [/quote]
Yes, this has top priority. Should be possible to include at least rudimentary search functionality. The [url=http://apps.theilluminatedengineer.com/sss/]syntax[/url] is pretty straight forward.

Cheers

//Edit: Just a quick update.. v.0.4 attached (unofficial release)

- Bugfix: Problem switching to (and playing) selection/pl/query when focus was lost
- Search functions [MoreMenu subItems]
- Display album art (using third-party utility, http://rasm.ods.org/boxcutter/) *
*Experimental/Unstable .. //Edit: Will only work with logging enabled (sorry, will fix that for next version)

[i]Consult included readme for setup information.[/i]



Spotify_v0.4.zip
 Description:
v0.4 unofficial release

Download
 Filename:  Spotify_v0.4.zip
 Filesize:  18.63 KB
 Downloaded:  2192 Time(s)

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
Page 1 of 1

 
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