ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > N.A.N.Y. 2012

NANY 2012 Release: MPH (Media Player Hotkeys)

<< < (9/13) > >>

uniuse:
Hi, uniuse, and welcome to the DonationCoder site.  Apologies for the delay in replying.

Can I ask if you can update Trout to not only remember when you close the app but across files so I can use it with MPH ?-uniuse (April 27, 2015, 06:42 AM)
--- End quote ---

I'm not sure what you're asking for here as MPH already supports Trout.  Regarding the new Spotify, I've tried to make it work but, due to how MPH is written, it's proving to be a right pain in the arse.
-skwire (May 16, 2015, 06:31 PM)
--- End quote ---

No need to add that functionality to Trout, I will use MPC instead.

No problem for the delay I am Happy that is updated.

uniuse:
I think I got the new Spotify partially working (play/pause/stop/next/prev).  Volume controls and like/dislike are not supported for the new Spotify.

Website | Download
v1.1.2 - 2015-05-16
    + Added partial support for the new Spotify client.  Tested against version
      1.0.4.90.  (Thanks, uniuse)
-skwire (May 16, 2015, 07:55 PM)
--- End quote ---

Will test it out, thanks for updating it for the new version.
Also as I will use it on Spotify too I will take up on me to keep you inform when Volume controls and like/dislike will work.

uniuse:
I think I got the new Spotify partially working (play/pause/stop/next/prev).  Volume controls and like/dislike are not supported for the new Spotify.

Website | Download
v1.1.2 - 2015-05-16
    + Added partial support for the new Spotify client.  Tested against version
      1.0.4.90.  (Thanks, uniuse)
-skwire (May 16, 2015, 07:55 PM)
--- End quote ---

Will test it out, thanks for updating it for the new version.
Also as I will use it on Spotify too I will take up on me to keep you inform when Volume controls and like/dislike will work.
-uniuse (May 17, 2015, 07:31 AM)
--- End quote ---

It works, volume down and up works partially because it lowers and increases the main volume instead of the application. For now it is great.

skwire:
Right on.  Thanks for the report.

uniuse:
Update this works with the latest version of Spotify 1.0.6.80.


--- ---#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;|---------------|
;|--[ SOURCES ]--|
;|---------------|
;Base Spotify Script from: http://www.autohotkey.com/board/topic/36239-spotify-global-hotkeys/
;Base Starring Script from: http://superuser.com/questions/324416/any-spotify-tweaks-with-keyboard-shortcut-to-star-tracks

;|------------------|
;|--[ SETTING UP ]--|
;|------------------|
DetectHiddenWindows, On ;Detect Spotify even if it's minimized
#IfWinExist ahk_class SpotifyMainWindow ;Only do the following if Spotify is running
spotify = ahk_class SpotifyMainWindow ;Set variable for Spotify Window Name

;|---------------|
;|--[ HOTKEYS ]--|
;|---------------|
; "F5" for previous
F5::Media_Prev

; "F6" for next
F6::Media_Next

; "F4" for pause
F4::Media_Play_Pause

; "F10" for track-name
F10::
{
WinGetTitle, spotify_playing, %spotify% ;Get the title of Spotify which contains the track-name

StringTrimLeft, trimmed_playing, spotify_playing, 0 ;Get rid of extra text and place into 'trimmed_playing'
StringReplace, replaced_playing, trimmed_playing, –, -, All ;Replace en dash with normal dash and place into 'replaced_playing'

clipboard = %replaced_playing% ;Copy the fixed text to clipboard
return
}

; "F3" for volume up
F3::
{
ControlSend, ahk_parent, ^{Up}, %spotify%
return
}

; "F2 for volume down
F2::
{
ControlSend, ahk_parent, ^{Down}, %spotify%
return
}

; "F8" for vote up in Radio
F8::
{

;Store active window
        MouseGetPos, , , winID

;Left click near the song title in the "Now Playing" box.
        WinGetPos,  ,  ,  , spotifyHeight, %spotify%
        clickX := 631
        clickY := 556
        ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA 


;Restore original window and mouse position.
        WinActivate ahk_id %winID%

        return
}

; "F7" for vote down in Radio
F7::
{

;Store active window
        MouseGetPos, , , winID

;Left click near the song title in the "Now Playing" box.
        WinGetPos,  ,  ,  , spotifyHeight, %spotify%
        clickX := 578
        clickY := 577
        ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA 


;Restore original window and mouse position.
        WinActivate ahk_id %winID%

        return
}

; Add track to Your Music
F9::
{

;Store active window
        MouseGetPos, , , winID

;Left click near the song title in the "Now Playing" box.
        WinGetPos,  ,  ,  , spotifyHeight, %spotify%
        clickX := 161
        clickY := 924
        ControlClick, x%clickX% y%clickY% , %spotify%, , Left, , NA 


;Restore original window and mouse position.
        WinActivate ahk_id %winID%

        return
}

;|-----------------|
;|--[ FUNCTIONS ]--|
;|-----------------|

;Context menu helper function.
GetContextMenuItemText(hMenu, nPos)
{
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "UInt", 0 ; NULL
, "Int", 0  ; Get length
, "UInt", 0x0400)   ; MF_BYPOSITION
VarSetCapacity(lpString, length + 1)
length := DllCall("GetMenuString"
, "UInt", hMenu
, "UInt", nPos
, "Str", lpString
, "Int", length + 1
, "UInt", 0x0400)
return lpString
}
Volume down/up now directly controls spotify.

I hope you can in corporate the f10 function in your app.

Dislike/like are f9 for songs and f7/f8 for radio both need adjusted to your position of spotify windows and mouse. But it works if set correctly, the user needs to be able to set those in your app tho.
If you do add those, make sure to add a note telling them that next track does not work in radio any more it is different now, you can but than you need to click it to make it work in your app it would be a pain and the script needs to be different. For me it is not needed in Radio.
I hope to see Like/dislike for songs to be supported otherwise I need to run a separate akh script.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version