Jump to content

Pandora/Autoit Mashup 2.1


ConsultingJoe
 Share

Recommended Posts

I made this because I needed the hotkeys to be global and this way I can run pandora without running firefox/IE.

Script Access is also off to disallow popups (I liked that this worked, but you can't get to outside links from it)

Enjoy

Hotkeys

  • {Media_Next} - Next Song
  • {Media_Play_Pause} - Play/Pause
  • {F2} - Like It
  • {F3} - Hate It
#include <GUIConstants.au3>
#Include <Constants.au3>
#NoTrayIcon
Opt("TrayMenuMode",1)
Opt("TrayOnEventMode",1)
Opt("GUIEventOptions",1)
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Pandora/Autoit Mashup", 640, 270)
$menu = GUICtrlCreateMenuItem( "Open Pandora In Browser", -1 )
GUICtrlSetOnEvent( -1, "openpandora" )
$pandora = ObjCreate ("ShockwaveFlash.ShockwaveFlash.1")
$pandorawin = GUICtrlCreateObj($pandora, 0, 0, 640, 250)
With $pandora
    .bgcolor = "#FFFFFF"
    .Movie = 'https://www.pandora.com:443/radio/tuner_8_2_0_0_pandora_mini.swf'
    .ScaleMode = 2
    .Loop = True
    .wmode = "Window"
    .allowScriptAccess = "Never";NO POPUPS
    .FlashVars = "_tunervar_shost=www.pandora.com&_tunervar_skin=pandora&_tunervar_zone=prod&_tunervar_width=640&_tunervar_amazonurl=http%3A%2F%2Fwww.amazon.com%2Fexec%2Fobidos%2Fredirect%3Ftag%3Dsavagebeast-20&_tunervar_height=522&_tunervar_host=www.pandora.com&_tunervar_ar=0&_tunervar_port=80&_tunervar_sport=443&_tunervar_itunesurl=http%3A%2F%2Fclick.linksynergy.com%2Ffs-bin%2Fstat%3Fid%3DFLenzF8lvbI%26offerid%3D78941%26type%3D3%26subid%3D0%26tmpid%3D1826"
EndWith
_GuiRoundCorners($Form1, 0, 0, 20, 20)
WinSetTrans( $Form1, "", 0 )
GUISetState(@SW_SHOW)
For $i = 0 To 255 Step 10
    WinSetTrans( $Form1, "", $i )
    Sleep(20)
Next
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "min")
TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN,"trayminmax")
TraySetClick ( 8 )
$settingsitem   = TrayCreateItem("Goto Pandora")
TrayItemSetOnEvent(-1, "openpandora")
$exititem       = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "quit")
TraySetState()
HotKeySet( "{MEDIA_NEXT}", "nextsong" )
HotKeySet( "{MEDIA_PLAY_PAUSE}", "play" )
HotKeySet( "{F2}", "like" )
HotKeySet( "{F3}", "hate" )
AdlibEnable( "active", 500 )
While 1
    Sleep(10)
WEnd

Func like()
    If WinActive( $Form1 ) Then Return
    ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "=")
EndFunc

Func hate()
    If WinActive( $Form1 ) Then Return
    ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "-")
EndFunc

Func nextsong()
    If WinActive( $Form1 ) Then Return
    Sleep(500)
    ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "{right}")
EndFunc

Func play()
    If WinActive( $Form1 ) Then Return
    Sleep(500)
    ControlSend($Form1, "", "MacromediaFlashPlayerActiveX1", "{space}")
EndFunc

Func openpandora()
    Run(@ComSpec & " /c " & 'start http://www.pandora.com/', "", @SW_HIDE)
EndFunc

Func quit()
    If WinGetState( $Form1 ) <> @SW_HIDE Then
        For $i = 255 To 0 Step -15
            WinSetTrans( $Form1, "", $i )
        Next
    EndIf
    Exit
EndFunc

Func min()
    For $i = 255 To 25 Step -20
        WinSetTrans( $Form1, "", $i )
        Sleep(15)
    Next
    WinSetState( $Form1, "", @SW_HIDE )
    AdlibDisable()
EndFunc

Func trayminmax()
    If WinGetState( $Form1 ) = 5 Then
        WinSetState( $Form1, "", @SW_SHOW )
        WinActivate( $Form1 )
        For $i = 25 To 255 Step 20
            WinSetTrans( $Form1, "", $i )
            Sleep(15)
        Next
        AdlibEnable( "active", 500 )
    Else
        For $i = 255 To 25 Step -20
            WinSetTrans( $Form1, "", $i )
            Sleep(15)
        Next
        WinSetState( $Form1, "", @SW_HIDE )
        AdlibDisable()
    EndIf
    Return
EndFunc

Func active()
    ControlFocus($Form1, "", "MacromediaFlashPlayerActiveX1")
EndFunc

Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
   Dim $pos, $ret, $ret2
   $pos = WinGetPos($h_win)
    $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long",  $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3,  "long", $i_y3)
   If $ret[0] Then
      $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
      If $ret2[0] Then
         Return 1
      Else
         Return 0
      EndIf
   Else
      Return 0
   EndIf
EndFunc ;==>_GuiRoundCorners
Edited by CyberZeroCool

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

I get a couple errors when I start it up, but it does eventually work. Well, same error, but twice.

The Procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL.

It shows me that twice before opening.

I wish that clicking on one of the song title/band name/album title links would open that page in the web browser, but perhaps it's supposed to do that and the error message that I get is breaking that functionality?

Link to comment
Share on other sites

I get a couple errors when I start it up, but it does eventually work. Well, same error, but twice.

The Procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL.

It shows me that twice before opening.

I wish that clicking on one of the song title/band name/album title links would open that page in the web browser, but perhaps it's supposed to do that and the error message that I get is breaking that functionality?

I had that same problem. the error isn't from my script its because of that dll. I think it was from an update (Autoit/Flash).

To Solve: Delete/Rename the the dll (C:\Program Files\AutoIt3\psapi.dll). Its already in the system32 folder.

To allow the popups just change

.allowScriptAccess = "Never";NO POPUPSoÝ÷ Ù3ºÚ"µÍ[ÝÔØÜXØÙÜÈH ][ÝÐ[Ø^É][ÝÎÐSÕÈÔT

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Ah, OK. Renaming the .dll to .bak fixed the original error message, but allowing popups gives more errors.

I get three or four "Internet Explorer can not download . Unspecified Error" messages...

As a Firefox user, I'm not sure what these things that IE is trying to download are, and as you can see the error message isn't helpful. Does IE ordinarily have popup windows on Pandora? All I'd like to have is the ability to click the links and be able to edit the station. Not a real big deal though. I can still open Pandora in my browser if I want to edit the station. I'm running Windows Media Center SP2 and it has IE7 if that makes any difference.

Other than that, nice job! I like this method much better than using a browser.

Link to comment
Share on other sites

Ah, OK. Renaming the .dll to .bak fixed the original error message, but allowing popups gives more errors.

I get three or four "Internet Explorer can not download . Unspecified Error" messages...

As a Firefox user, I'm not sure what these things that IE is trying to download are, and as you can see the error message isn't helpful. Does IE ordinarily have popup windows on Pandora? All I'd like to have is the ability to click the links and be able to edit the station. Not a real big deal though. I can still open Pandora in my browser if I want to edit the station. I'm running Windows Media Center SP2 and it has IE7 if that makes any difference.

Other than that, nice job! I like this method much better than using a browser.

Thanks, Yeah, I don't know why the popups come up with the errors when you change that. But check the 1st post for an update:

  • Repaired hotkey rekey
  • Added menu linking the browser view

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Thanks guys

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

  • 2 weeks later...

Updated to Pandora's new version.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

NP, I'd like to add to this, There is a way to pull the song and artist from this.

Anyone have any ideas of things to add?

Edited by CyberZeroCool

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Love the script, have been looking for a way to do this without always opening firefox and forgetting the pandora tab is open when i close it.

The only addition I would like to see would be a "minimize to a tray icon" button or option, so you can open it and just leave it running in the background without taking up taskbar space, and then on top of that maybe options so that you can click the tray icon and get a menu with the play/pause, next, etc. options

Link to comment
Share on other sites

Love the script, have been looking for a way to do this without always opening firefox and forgetting the pandora tab is open when i close it.

The only addition I would like to see would be a "minimize to a tray icon" button or option, so you can open it and just leave it running in the background without taking up taskbar space, and then on top of that maybe options so that you can click the tray icon and get a menu with the play/pause, next, etc. options

Sure, Great idea, I would love to do that. I will try to do it tonight.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Updated, check first post.

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...