Sign in to follow this  
Followers 0
wakillon

TinyShoutCastTuner v1.0.3.5 Update of 05 Nov 2012

29 posts in this topic

#1 ·  Posted (edited)

TinyShoutCastTuner v1.0.3.5

Based on the >LiveStreaming source code of trancexx.
Listen Shoutcast Radios Stations with a station search engine by filters and an easy Favorites stations management.

Thanks to monoceres, trancexx, Kip and Prog@ndy for AutoItObject.

>AutoItObject 1.2.2.0 and >WinAPIEx are needed.

XRTSr.jpg


As usual externals skin files are downloaded at first execution.
See Tray Menu for more options.
Search is a bit slow but successfull... ;)

Previous Downloads : 436

Update of 2012-11-05 

source and executable are available in the Download Section

 

Some Radios : FavoritesRadioStations.reg


Hope you like it !

Edited by wakillon
1 person likes this

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites



wow!


 

.

eMyvnE

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

wow!

Thanks to you trancexx

you gave me the inspiration ! Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

This looks really cool!


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

Looks really nice!

On Win7 x64 it plays only the music when it is compiled!

The glass effect looks really nice on my xp vm but can you disable it on Vista+ os? Because original effect looks still better. :x

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

This looks really cool!

Thanks !

I hope you find the graphical interface to your liking !

Looks really nice!

On Win7 x64 it plays only the music when it is compiled!

The glass effect looks really nice on my xp vm but can you disable it on Vista+ os? Because original effect looks still better. :x

Br,

UEZ

Thanks UEZ !

Have you an error message ?

For registry part change for this a the start of the script, and say me if it works, not compiled !

Global $_Key = "HKLM\SOFTWARE\TinyShoutCastTuner"
If @CPUArch ='X64' Then $_Key = "HKLM64\SOFTWARE\TinyShoutCastTuner"

You can modify the _GuiSkin function like this :

Func _GuiSkin ( $_SheFilePath )
    If Not StringInStr ( @OSVersion, "WIN_XP" ) Then Return 
    $Dll = DllOpen ( @TempDir & '\TST\skin\SkinH_EL.dll' )
    DllCall ( $Dll, "int", "SkinH_AttachEx", "str", $_SheFilePath, "str", "mhgd" ) 
    DllCall ( $Dll, "int", "SkinH_SetAero", "int", 1 )
EndFunc ;==> _GuiSkin ( )

I tried to get a _UnSkin function, but i'm a complete newbie with dll functions !

http://img341.imageshack.us/img341/3317/20101230141336.png

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

W O W!!!

This is what I expect of a commercial product!


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

W O W!!!

This is what I expect of a commercial product!

Thanks a lot ! Posted Image

When can we see your final version ? Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#10 ·  Posted

Thanks a lot ! Posted Image

When can we see your final version ? Posted Image

My final version? Haha I was just going to say to all that requested it, to go and check out TinyShoutCastTuner!

Haha I guess I could finish what I was doing.

Just a question, how do you manage to create skins? I looked at your skin in notepad (the default one of course), and it looked like total gibberish like compiled exe's and stuff?

How do you create the skins for this?

shanet


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

#11 ·  Posted

My final version? Haha I was just going to say to all that requested it, to go and check out TinyShoutCastTuner!

Haha I guess I could finish what I was doing.

Just a question, how do you manage to create skins? I looked at your skin in notepad (the default one of course), and it looked like total gibberish like compiled exe's and stuff?

How do you create the skins for this?

shanet

Sorry for the delay i have some cookies problem !

See this Posted Image

If you speak chinese and if you are interested I have got a skin editor for .she file...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Looks really nice!

On Win7 x64 it plays only the music when it is compiled!

The glass effect looks really nice on my xp vm but can you disable it on Vista+ os? Because original effect looks still better. :graduated:

Br,

UEZ

Very simple, just comment out this like in the _GuiCreate function.

_GuiSkin ( @TempDir & '\TST\skin\whitefire.she' )

However this does something diabolical to the GUI...

Posted Image

Sorry for the delay i have some cookies problem !

See this ;)

If you speak chinese and if you are interested I have got a skin editor for .she file...

No, I can not speak Chinese - but Google can :D

Simple done :D

I am having a hack around with this code ;)

Oh, and by the way your downloads for FileInstall function are no longer valid. I am working on a small script to create these files :D

EDIT: Here is the finished code for TinyShoutCastTuner...

Posted Image

As you can see, really the only visible difference is the favourites button.The space made will be used for a settings button.

The real difference is in the operation.

  • If you single click on a result it will give you the station data and double click loads it. You can still use the old method of stop then play however this has simply been automated.
  • If you did not select an element on the favorites list it would automatically delete the first item. A simple work-around for this was to check if an element was actually selected.
  • Pausing would actually disconnect from the server. This would mean you would have to re-connect to the server every time you un-pause. In other words pause was another word for stop. Pause now literally mutes the playback so as soon as you click play it is restored to its previous state. Stop functions normally.
  • Registry settings did not work for normal users - you needed to run this as administrator. This has all been re-done to fix these problems. There is also a skin registry key if you wish to use another skin (see below for example).
  • On load it should now load the station data of the station that loads on startup.
Posted Image

As the forum will not let me post raw code, please see the attached file.

If you do not have the files required, you can download them here:

http://www.mediafire.com/?rf9fhj51fvflp2a

http://www.mediafire.com/?1irzpwc92ghp6u9

http://www.mediafire.com/?e08nb789twvu35u

You should be presented with instructions on run.

Enjoy :)

TinyShoutCastViewer.au3

Edited by shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

@Shanet

I am a bit disappointed...

Since all that time, I thought you would have created your own version !

And why change the name ?

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#14 ·  Posted

Quick Question regarding this. I used a part of this system to develop a little utility to pull play lists and store them in a specific format. This has been working really well but then today (after not using the utility for a couple of months) I discovered the DEV KEY is now dead. I have looked High & Low all over the winamp wiki and related materials there and nowhere could I "gleen" how to apply for a dev key or how to get a new one.

What is the magic spell to get a Dev Key from shoutcast ? Any help would be appreciated.

Thanks in Advance for the help

WS


~ WhiteStar Magic

Always tuned to http://www.superbluesradio.com/  Tune in at http://87.117.217.41:8036/

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Hi WhiteStar

The API stopped working because they have now completed their migration to the new SHOUTcast 2.0 API.

Information about this impending migration was given to all developers

and as far back as September 2010: http://www.shoutcastblog.com/2010/09/30/shoutcast-api-update/

Since there was no record of your app or DEV ID being a licensed SHOUTcast Partner

your DEV ID was blocked by their system once the migration was complete and their legacy systems were shut off in December 2011.

Normally you should have received an email from faisal@shoutcast.com for continue to use the SHOUTcast API and become a licensed partner,

because now they must approve your app.(they have certain requirements)

Try to Contact : faisal@shoutcast.com

I am still waiting their answer, that's why my script doesn't work correctly... :)

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#16 ·  Posted

Thanks for the speedy response. That really sucks, I must say... I was pulling the playlists and writting them into a text listing format by genre... I won't hold my breath on AOL, so hopefully something will be figured out. I suppose it's time to explore Icecast and see how they do it... possibly that might be an alternate solution to getting music stream lists.

Thanks Again

WhiteStar


~ WhiteStar Magic

Always tuned to http://www.superbluesradio.com/  Tune in at http://87.117.217.41:8036/

Share this post


Link to post
Share on other sites

#17 ·  Posted

Hey, since this thread has been bumped recently, do you still have the editor for .she files?

If you speak chinese and if you are interested I have got a skin editor for .she file...

I dont care about it being in Chinese, the resource editor I use doesn't work for .she files.

Thanks.

Share this post


Link to post
Share on other sites

#18 ·  Posted

Hey, since this thread has been bumped recently, do you still have the editor for .she files?

I dont care about it being in Chinese, the resource editor I use doesn't work for .she files.

Thanks.

Download Link : SHEditorv0.2beta5

Good luck ! :)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#19 ·  Posted

Thanks!

Share this post


Link to post
Share on other sites

#20 ·  Posted

Thanks!

If you find a way to get it in english, PM me ! :)


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • DrAhmed
      [Solved] Get stream size
      By DrAhmed
      Hey
      I was looking for methode to get the stream size of a picture from memory , wihtout need to write stream data to disk the then use filegetsize 
      Thats what I am trying to do
      #include <gdiplus.au3> #include <memory.au3> #include <staticconstants.au3> _GDIPlus_Startup() Global $ghGDIPDLL = $__g_hGDIPDll While 1 $data = Desk_Stream(50) $data2 = StringSplit($data, "|") $My_Stream_Size = $data2[0] $My_Stream = $data2[1] ;. ;.. ;... Sleep(1000) WEnd _GDIPlus_Shutdown() Func Desk_Stream($Q) Local $hHBmp = _ScreenCapture_Capture("") ;create a GDI bitmap by capturing my desktop Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap Local $hBitmap_Scaled = _GDIPlus_ImageResize($hBitmap, @DesktopWidth / 2, @DesktopHeight / 2) ;resize image $sStream_Data = _GDIPlus_StreamImage2BinaryString($hBitmap_Scaled, $sQ, False, '') ;coded by UEZ 2013 build 2014-01-25; based on the code ;release resources otherwise memory leak _WinAPI_DeleteObject($hHBmp) _GDIPlus_ImageDispose($hBitmap) _GDIPlus_ImageDispose($hBitmap_Scaled) Local $data_size = GetStreamSize($sStream_Data) Return $data_size & "|" & $sStream_Data EndFunc ;==>Desk_Stream Func _GDIPlus_StreamImage2BinaryString($hBitmap, $iQuality, $bSave, $sFilename) ;coded by UEZ 2013 build 2014-01-25; based on the code by Andreik Local $sImgCLSID, $tGUID, $tParams, $tData $sFormat = "JPG" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) $tParams = _GDIPlus_ParamInit(1) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(2, 0, 0) _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams)) If @error Then Return SetError(3, 0, 0) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(4, 0, 0) Local $iMemSize = _MemGlobalSize($hMemory) If Not $iMemSize Then Return SetError(5, 0, 0) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) Return $bData EndFunc ;==>_GDIPlus_StreamImage2BinaryString Func GetStreamSize($data) ; ?? EndFunc  
    • Synapsee
      AutoIt Radio Player v0.0.0.8 Update of 30 apr 2016
      By Synapsee
      AutoIt Radio Player
      Last : v0.0.0.8
      Tested only on W7X64

      Changelog :
      Spoiler v0.0.0.8 - last version
      v0.0.0.7 - first public version
      ==========>  AutoIt Radio Player v0.0.0.8.zip <==========
      Personal Message :
           This is my first script posted. Any comment are welcome. Give me your best web radio i will try add them !
      Install/Use :
      Spoiler -Unzip
      -Run "AutoIt Radio Player.au3"
      -Use MouseWheel for change volume
                Note : On first start : volume = 4%
      -Use MouseLeft for drag gui
      -Use RightClick for change station
      Add a station :
      Spoiler How add a station :
      -Go to config.ini
      -Add : [Station Name]
      -Possible optional label start key :
      CurrentArtist
      CurrentAlbum
      CurrentTitle
      NextArtist
      NextAlbum
      NextTitle
      ListenersCount
      -Possible optional label end key :
      Link=URL
      Start=StringBefore
      End=StringAfter
      BetweenNum=TargetOccurence (def=0)
      Split=StringForSplit
      NumSplit=TargetSplitNumber
      -Necessary
      SoundLink=URL
      -Optional
      CoverLink=URL
      CoverLinkStart=StringBefore
      CoverLinkEnd=StringAfter
      CoverLinkBetweenNum=TargetOccurence (def=0)
      CoverLinkBefore=PathBefore
      Unsolved problem :
            When the coverGUI go outside the monitor and comeback inside, a part of current cover disapear : I have no idea how fix that
          
      TODO :
           Make coverGUI mouse resizable (while script running) : any idea are welcome
           Crop some pixel of cover : any idea are welcome
      Related Posts/Bin :
      ArrayMultiColSort MouseWheelDelta Sample1 MouseWheelDelta Sample2 ContextMenu Fix ReduceMemory MemGlobalAllocFromBinary Curl.au3 (AutoIt binary code) Main Code :
      ;#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7;All Warning ;-w 5 = local var declared but not used : Removed for Curl.au3 ;-d = as Opt("MustDeclareVars", 1) : Removed for Bass.au3 #AutoIt3Wrapper_Au3Check_Parameters=-w 1 -w 2 -w 3 -w- 4 -w 6 -w- 7 #Region ;==> #include #include <Array.au3>;_ArrayAdd #include <GuiButton.au3>;_GUICtrlButton_SetImage() #include <GuiMenu.au3>;$MNS_MODELESS #include <GUIConstants.au3>;$WS_POPUP #include <GDIplus.au3>;_GDIPlus_BitmapCreateFromStream() #include <Memory.au3>;$GMEM_MOVEABLE #include <String.au3>;_StringBetween() #include <AutoIt Radio Player\include\Bass.au3>;_BASS_ChannelPlay() #include <AutoIt Radio Player\include\BassConstants.au3>;$BASS_CONFIG_NET_PLAYLIST #include <AutoIt Radio Player\include\Curl.au3>;Curl_Data_Get() #EndRegion ;==> #include #Region ;==> Func for Bass.au3 Local $MusicHandle Func _Audio_play($MusicHandle) _BASS_ChannelPlay($MusicHandle, 1) EndFunc Func _Audio_stop($MusicHandle) _BASS_ChannelStop($MusicHandle) EndFunc Func _Audio_init_stop($MusicHandle) _BASS_StreamFree($MusicHandle) _BASS_Free() EndFunc Func _Audio_init_start() If _BASS_STARTUP(@ScriptDir & "\AutoIt Radio Player\include\bass.dll") Then If _BASS_Init(0, -1, 44100, 0) Then If _BASS_SetConfig($BASS_CONFIG_NET_PLAYLIST, 1) = 0 Then SetError(3) EndIf Else SetError(2) EndIf Else SetError(@error) EndIf EndFunc Func _Set_volume($volume) _BASS_SetConfig($BASS_CONFIG_GVOL_STREAM, $volume * 100) EndFunc Func _Set_url($file) If FileExists($file) Then $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0) Else $MusicHandle = _BASS_StreamCreateURL($file, 0, 1) EndIf If @error Then Return SetError(1) EndIf Return $MusicHandle EndFunc #EndRegion ;==> Func for Bass.au3 Global Const $SC_DRAGMOVE = 0xF012;Global #Region ;==> Func from AutoIt Forum ; #FUNCTION# ==================================================================================================================== ; Name...........: _ArrayMultiColSort ; Description ...: Sort 2D arrays on several columns ; Syntax.........: _ArrayMultiColSort(ByRef $aArray, $aSortData[, $iStart = 0[, $iEnd = 0]]) ; Parameters ....: $aArray - The 2D array to be sorted ; $aSortData - 2D array holding details of the sort format ; Format: [Column to be sorted, Sort order] ; Sort order can be either numeric (0/1 = ascending/descending) or a ordered string of items ; Any elements not matched in string are left unsorted after all sorted elements ; $iStart - Element of array at which sort starts (default = 0) ; $iEnd - Element of array at which sort endd (default = 0 - converted to end of array) ; Requirement(s).: v3.3.8.1 or higher ; Return values .: Success: No error ; Failure: @error set as follows ; @error = 1 with @extended set as follows (all refer to $sIn_Date): ; 1 = Array to be sorted not 2D ; 2 = Sort data array not 2D ; 3 = More data rows in $aSortData than columns in $aArray ; 4 = Start beyond end of array ; 5 = Start beyond End ; @error = 2 with @extended set as follows: ; 1 = Invalid string parameter in $aSortData ; 2 = Invalid sort direction parameter in $aSortData ; Author ........: Melba23 ; Remarks .......: Columns can be sorted in any order ; Example .......; Yes ; =============================================================================================================================== Func _ArrayMultiColSort(ByRef $aArray, $aSortData, $iStart = 0, $iEnd = 0) ; Errorchecking ; 2D array to be sorted If UBound($aArray, 2) = 0 Then Return SetError(1, 1, "") EndIf ; 2D sort data If UBound($aSortData, 2) <> 2 Then Return SetError(1, 2, "") EndIf If UBound($aSortData) > UBound($aArray) Then Return SetError(1, 3) EndIf ; Start element If $iStart < 0 Then $iStart = 0 EndIf If $iStart >= UBound($aArray) - 1 Then Return SetError(1, 4, "") EndIf ; End element If $iEnd <= 0 Or $iEnd >= UBound($aArray) - 1 Then $iEnd = UBound($aArray) - 1 EndIf ; Sanity check If $iEnd <= $iStart Then Return SetError(1, 5, "") EndIf Local $iCurrCol, $iChunk_Start, $iMatchCol ; Sort first column __AMCS_SortChunk($aArray, $aSortData, 0, $aSortData[0][0], $iStart, $iEnd) If @error Then Return SetError(2, @extended, "") EndIf ; Now sort within other columns For $iSortData_Row = 1 To UBound($aSortData) - 1 ; Determine column to sort $iCurrCol = $aSortData[$iSortData_Row][0] ; Create arrays to hold data from previous columns Local $aBaseValue[$iSortData_Row] ; Set base values For $i = 0 To $iSortData_Row - 1 $aBaseValue[$i] = $aArray[$iStart][$aSortData[$i][0]] Next ; Set start of this chunk $iChunk_Start = $iStart ; Now work down through array For $iRow = $iStart + 1 To $iEnd ; Match each column For $k = 0 To $iSortData_Row - 1 $iMatchCol = $aSortData[$k][0] ; See if value in each has changed If $aArray[$iRow][$iMatchCol] <> $aBaseValue[$k] Then ; If so and row has advanced If $iChunk_Start < $iRow - 1 Then ; Sort this chunk __AMCS_SortChunk($aArray, $aSortData, $iSortData_Row, $iCurrCol, $iChunk_Start, $iRow - 1) If @error Then Return SetError(2, @extended, "") EndIf EndIf ; Set new base value $aBaseValue[$k] = $aArray[$iRow][$iMatchCol] ; Set new chunk start $iChunk_Start = $iRow EndIf Next Next ; Sort final section If $iChunk_Start < $iRow - 1 Then __AMCS_SortChunk($aArray, $aSortData, $iSortData_Row, $iCurrCol, $iChunk_Start, $iRow - 1) If @error Then Return SetError(2, @extended, "") EndIf EndIf Next EndFunc ;==>_ArrayMultiColSort ; #FUNCTION# ==================================================================================================================== ; Name...........: __AMCS_SortChunk ; Description ...: Sorts array section ; Author ........: Melba23 ; Remarks .......: ; =============================================================================================================================== Func __AMCS_SortChunk(ByRef $aArray, $aSortData, $iRow, $iColumn, $iChunkStart, $iChunkEnd) Local $aSortOrder ; Set default sort direction Local $iSortDirn = 1 ; Need to prefix elements? If IsString($aSortData[$iRow][1]) Then ; Split elements $aSortOrder = StringSplit($aSortData[$iRow][1], ",") If @error Then Return SetError(1, 1, "") EndIf ; Add prefix to each element For $i = $iChunkStart To $iChunkEnd For $j = 1 To $aSortOrder[0] If $aArray[$i][$iColumn] = $aSortOrder[$j] Then $aArray[$i][$iColumn] = StringFormat("%02i-", $j) & $aArray[$i][$iColumn] ExitLoop EndIf Next ; Deal with anything that does not match If $j > $aSortOrder[0] Then $aArray[$i][$iColumn] = StringFormat("%02i-", $j) & $aArray[$i][$iColumn] EndIf Next Else Switch $aSortData[$iRow][1] Case 0, 1 ; Set required sort direction if no list If $aSortData[$iRow][1] Then $iSortDirn = -1 Else $iSortDirn = 1 EndIf Case Else Return SetError(1, 2, "") EndSwitch EndIf ; Sort the chunk Local $iSubMax = UBound($aArray, 2) - 1 __ArrayQuickSort2D($aArray, $iSortDirn, $iChunkStart, $iChunkEnd, $iColumn, $iSubMax) ; Remove any prefixes If IsString($aSortData[$iRow][1]) Then For $i = $iChunkStart To $iChunkEnd $aArray[$i][$iColumn] = StringTrimLeft($aArray[$i][$iColumn], 3) Next EndIf EndFunc ;==>__AMCS_SortChunk Func _ReduceMemory() Local $aReturn = DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) If @error = 1 Then Return SetError(1, 0, 0) EndIf Return $aReturn[0] EndFunc ;==>_ReduceMemory ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_ImageLoadFromHGlobal ; Description ...: Creates an Image object based on movable HGlobal memory block ; Syntax.........: _GDIPlus_ImageLoadFromHGlobal($hGlobal) ; Parameters ....: $hGlobal - Handle of a movable HGlobal memory block ; Return values .: Success - Pointer to a new Image object ; Failure - 0 and either: ; |@error and @extended are set if DllCall failed: ; | -@error = 1 if could not create IStream ; | -@error = 2 if DLLCall to create image failed ; |$GDIP_STATUS contains a non zero value specifying the error code ; Author ........: ProgAndy ; Modified.......: ; Remarks .......: After you are done with the object, call _GDIPlus_ImageDispose to release the object resources. ; The HGLOBAL will be owned by the image and freed automatically when the image is disposed. ; Related .......: _GDIPlus_ImageLoadFromStream, _GDIPlus_ImageDispose ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _GDIPlus_ImageLoadFromHGlobal($hGlobal) Local $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $hGlobal, "bool", True, "ptr*", 0) If @error Or $aResult[0] <> 0 Or $aResult[3] = 0 Then Return SetError(1, @error, 0) Local $hImage = DllCall($__g_hGDIPDll, "uint", "GdipLoadImageFromStream", "ptr", $aResult[3], "int*", 0) Local $error = @error Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr") Local $aCall = DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $aResult[3], "dword", 8 + 8 * @AutoItX64, "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) If $error Then Return SetError(2, $error, 0) If $hImage[2] = 0 Then Return SetError(3, 0, $hImage[2]) Return $hImage[2] EndFunc ;==>_GDIPlus_ImageLoadFromHGlobal ; #FUNCTION# ==================================================================================================================== ; Name...........: _MemGlobalAllocFromBinary ; Description ...: Greates a movable HGLOBAL memory block from binary data ; Syntax.........: _MemGlobalAllocFromBinary($bBinary) ; Parameters ....: $bBinary - Binary data ; Return values .: Success - Handle of a new movable HGLOBAL ; Failure - 0 and set @error: ; |1 - no data ; |2 - could not allocate memory ; |3 - could not set data to memory ; Author ........: ProgAndy ; Modified.......: ; Remarks .......: ; Related .......: _MemGlobalAlloc, _MemGlobalFree, _MemGlobalLock ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _MemGlobalAllocFromBinary(Const $bBinary) Local $iLen = BinaryLen($bBinary) If $iLen = 0 Then Return SetError(1, 0, 0) Local $hMem = _MemGlobalAlloc($iLen, $GMEM_MOVEABLE) If @error Or Not $hMem Then Return SetError(2, 0, 0) DllStructSetData(DllStructCreate("byte[" & $iLen & "]", _MemGlobalLock($hMem)), 1, $bBinary) If @error Then _MemGlobalUnlock($hMem) _MemGlobalFree($hMem) Return SetError(3, 0, 0) EndIf _MemGlobalUnlock($hMem) Return $hMem EndFunc ;==>_MemGlobalAllocFromBinary #EndRegion ;==> Func from AutoIt Forum ;INI Location Local $Config_INI = "AutoIt Radio Player\Config.ini" Local $Save_INI = "AutoIt Radio Player\Save.ini" ;Get $aRadio and $aLabel <===========================================That part need improve Local $aINISections = IniReadSectionNames($Config_INI) Local $aRadio[0][8] Local $aLabel[0][11] For $i = 1 To UBound($aINISections) - 1 If $aINISections[$i] <> "GUI" Then ;For $aRadio Local $SoundLink = "", $CoverLink = "", $CoverLinkStart = "", $CoverLinkEnd = "", $CoverLinkBetweenNum = "", $CoverLinkBefore = "", $Default = 0 ;For $aLabel Local $CurrentArtistLink = "", $CurrentArtistStart = "", $CurrentArtistEnd = "", $CurrentArtistBetweenNum = 0, $CurrentArtistSplit = "", $CurrentArtistNumSplit = "" Local $CurrentAlbumLink = "", $CurrentAlbumStart = "", $CurrentAlbumEnd = "", $CurrentAlbumBetweenNum = 0, $CurrentAlbumSplit = "", $CurrentAlbumNumSplit = "" Local $CurrentTitleLink = "", $CurrentTitleStart = "", $CurrentTitleEnd = "", $CurrentTitleBetweenNum = 0, $CurrentTitleSplit = "", $CurrentTitleNumSplit = "" Local $NextArtistLink = "", $NextArtistStart = "", $NextArtistEnd = "", $NextArtistBetweenNum = 0, $NextArtistSplit = "", $NextArtistNumSplit = "" Local $NextAlbumLink = "", $NextAlbumStart = "", $NextAlbumEnd = "", $NextAlbumBetweenNum = 0, $NextAlbumSplit = "", $NextAlbumNumSplit = "" Local $NextTitleLink = "", $NextTitleStart = "", $NextTitleEnd = "", $NextTitleBetweenNum = 0, $NextTitleSplit = "", $NextTitleNumSplit = "" Local $ListenersCountLink = "", $ListenersCountStart = "", $ListenersCountEnd = "", $ListenersCountBetweenNum = 0, $ListenersCountSplit = "", $ListenersCountNumSplit = "" Local $controlID1 = "", $controlID2 = "" Local $Sec = IniReadSection($Config_INI, $aINISections[$i]) For $y = 1 To UBound($Sec) - 1 Assign($Sec[$y][0], $Sec[$y][1]) Next ;$aRadio _ArrayAdd($aRadio, $aINISections[$i] & "|" & $SoundLink & "|" & $CoverLink & "|" & $CoverLinkStart & "|" & $CoverLinkEnd & "|" & $CoverLinkBetweenNum & "|" & $CoverLinkBefore & "|" & $Default) ;$aLabel _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Current" & "|" & "Artist" & "|" & $CurrentArtistLink & "|" & $CurrentArtistStart & "|" & $CurrentArtistEnd & "|" & $CurrentArtistBetweenNum & "|" & $CurrentArtistSplit & "|" & $CurrentArtistNumSplit & "|" & $controlID1 & "|" & $controlID2) _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Current" & "|" & "Album" & "|" & $CurrentAlbumLink & "|" & $CurrentAlbumStart & "|" & $CurrentAlbumEnd & "|" & $CurrentAlbumBetweenNum & "|" & $CurrentAlbumSplit & "|" & $CurrentAlbumNumSplit & "|" & $controlID1 & "|" & $controlID2) _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Current" & "|" & "Title" & "|" & $CurrentTitleLink & "|" & $CurrentTitleStart & "|" & $CurrentTitleEnd & "|" & $CurrentTitleBetweenNum & "|" & $CurrentTitleSplit & "|" & $CurrentTitleNumSplit & "|" & $controlID1 & "|" & $controlID2) _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Next" & "|" & "Artist" & "|" & $NextArtistLink & "|" & $NextArtistStart & "|" & $NextArtistEnd & "|" & $NextArtistBetweenNum & "|" & $NextArtistSplit & "|" & $NextArtistNumSplit & "|" & $controlID1 & "|" & $controlID2) _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Next" & "|" & "Album" & "|" & $NextAlbumLink & "|" & $NextAlbumStart & "|" & $NextAlbumEnd & "|" & $NextAlbumBetweenNum & "|" & $NextAlbumSplit & "|" & $NextAlbumNumSplit & "|" & $controlID1 & "|" & $controlID2) _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Next" & "|" & "Title" & "|" & $NextTitleLink & "|" & $NextTitleStart & "|" & $NextTitleEnd & "|" & $NextTitleBetweenNum & "|" & $NextTitleSplit & "|" & $NextTitleNumSplit & "|" & $controlID1 & "|" & $controlID2) _ArrayAdd($aLabel, $aINISections[$i] & "|" & "Listeners" & "|" & "Count" & "|" & $ListenersCountLink & "|" & $ListenersCountStart & "|" & $ListenersCountEnd & "|" & $ListenersCountBetweenNum & "|" & $ListenersCountSplit & "|" & $ListenersCountNumSplit & "|" & $controlID1 & "|" & $controlID2) EndIf Next Global $aRadio_Sort[][] = [[0, 0], [1, 0]] _ArrayMultiColSort($aRadio, $aRadio_Sort) Local $aLabel2[0][11] For $i = 0 To UBound($aLabel) - 1 If $aLabel[$i][3] <> "" Then Local $fill = $aLabel[$i][0] For $y = 1 To UBound($aLabel, 2) - 1 $fill = $fill & "|" & $aLabel[$i][$y] Next _ArrayAdd($aLabel2, $fill) EndIf Next $aLabel = $aLabel2 ;_ArrayDisplay($aRadio) ;_ArrayDisplay($aLabel) ;Init/Opt Opt("GUIOnEventMode", 1) _Audio_init_start() _GDIPlus_Startup() ;Icon Local $IcoFile = @ScriptDir & "\AutoIt Radio Player\img\icon.ico" Local $IcoNumber = -1 TraySetIcon($IcoFile, $IcoNumber) ;Get Default Station Local $def_selected = 0 For $r = 0 To UBound($aRadio) - 1 If $aRadio[$r][0] = IniRead($Save_INI, @ComputerName, "Default_Radio", "default") Then $def_selected = 1 $aRadio[$r][7] = 1 EndIf Next If $def_selected = 0 Then $aRadio[0][7] = 1 EndIf ;ConsoleWrite("Start" & @CRLF) ;Get $Radio_Name, $Radio_SoundLink, $Radio_CoverLink, $Radio_CoverLink_Start, $Radio_CoverLink_End, $Radio_CoverLink_BetweenNum, $Radio_CoverLink_Before Local $Radio_Name, $Radio_SoundLink, $Radio_CoverLink Local $Radio_CoverLink_Start, $Radio_CoverLink_End, $Radio_CoverLink_BetweenNum, $Radio_CoverLink_Before For $r = 0 To UBound($aRadio) - 1 If $aRadio[$r][7] = 1 Then $Radio_Name = $aRadio[$r][0] $Radio_SoundLink = $aRadio[$r][1] $Radio_CoverLink = $aRadio[$r][2] $Radio_CoverLink_Start = $aRadio[$r][3] $Radio_CoverLink_End = $aRadio[$r][4] $Radio_CoverLink_BetweenNum = $aRadio[$r][5] $Radio_CoverLink_Before = $aRadio[$r][6] EndIf Next ;Declare Local $PlayerGUI, $CoverGUI;GUI Local $PlayPause, $Close;Button Local $Play = 1;PlayStatus ($Play = 1 = Autoplay) Local $Volume_Label, $VolumePercent, $Previous_VolumePercent;Volume Local $Previous_Cover_Read;PreviousRead Local $BASS_ErrorGetCode ;$Config_INI\GUI Local $CoverSize = IniRead($Config_INI, "GUI", "CoverSize", 150) Local $PlayerBorder = IniRead($Config_INI, "GUI", "PlayerBorder", 10) ;ConsoleWrite("Build GUI" & @CRLF) ;Build GUI _Build_PlayerGUI() _Build_CoverGUI() ;ConsoleWrite("Show GUI" & @CRLF) GUISetState(@SW_SHOW, $PlayerGUI) If $Radio_CoverLink <> "" Then GUISetState(@SW_SHOW, $CoverGUI) EndIf _Set_volume(0) ;GetPlayerDATA() - GetCoverDATA() - Start Sound GetPlayerDATA();Start Sound too with resume on disconnect AdlibRegister("GetPlayerDATA", 8000) If $Radio_CoverLink <> "" Then GetCoverDATA() AdlibRegister("GetCoverDATA", 8000) EndIf ;ConsoleWrite("GUIRegisterMsg" & @CRLF) GUIRegisterMsg($WM_MOUSEWHEEL, "_WM_MOUSEWHEEL");for set volume GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN");for drag gui #Region ;==> Internal Func Func _Build_CoverGUI() ;ConsoleWrite("Build CoverGUI" & @CRLF) If $Radio_CoverLink <> "" Then $CoverGUI = GUICreate("AutoIt Radio Cover", _;Title $CoverSize, _ ;X $CoverSize, _ ;Y IniRead($Save_INI, @ComputerName, "Cover_X", -1), _;Left IniRead($Save_INI, @ComputerName, "Cover_Y", -1), _;Top $WS_POPUP, $WS_EX_TOPMOST);Style GUISetBkColor(0x000000, $CoverGUI);Black BkColor GUISetIcon($IcoFile, $IcoNumber, $CoverGUI) Else $CoverGUI = "" EndIf EndFunc ;==>_Build_CoverGUI Func _Build_PlayerGUI() ;ConsoleWrite("Build PlayerGUI" & @CRLF) ;Clean previous stored ControlID For $r = 0 To UBound($aLabel) - 1 $aLabel[$r][9] = "" $aLabel[$r][10] = "" Next ;$LabelCount Local $LabelCount = 0 For $r = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$r][0] Then $LabelCount = $LabelCount + 1 EndIf Next ;$LabelY If $LabelCount * 13 + $PlayerBorder * 2 < 50 Then Local $LabelY = 10 * 3 Else $LabelY = $LabelCount * 13 EndIf ;$PlayerGUI $PlayerGUI = GUICreate("AutoIt Radio Player", _ $PlayerBorder + 260 + 50 + 10 + $PlayerBorder * 2, _;X $PlayerBorder + $LabelY + $PlayerBorder, _;Y IniRead($Save_INI, @ComputerName, "Title_X", -1), _;Left IniRead($Save_INI, @ComputerName, "Title_Y", -1), _;Top $WS_POPUP, $WS_EX_TOPMOST);Style GUISetBkColor(0x000000, $PlayerGUI);Black BkColor GUISetIcon($IcoFile, $IcoNumber, $PlayerGUI) ;$Contextmenu Local $ContextMenu = GUICtrlCreateContextMenu(-1) Local $hCM = GUICtrlGetHandle($ContextMenu) _GUICtrlMenu_SetMenuStyle($hCM, BitXOR(_GUICtrlMenu_GetMenuStyle($hCM), $MNS_MODELESS)) Local $ContextMenu_Item1 = GUICtrlCreateMenuItem($Radio_Name, $ContextMenu) GUICtrlSetOnEvent($ContextMenu_Item1, "ContextMenu_ChangeRadio") GUICtrlCreateMenuItem("", $ContextMenu);Add separator For $r = 0 To UBound($aRadio) - 1 If $aRadio[$r][7] = 0 Then GUICtrlCreateMenuItem($aRadio[$r][0], $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") EndIf Next ;GUICtrlCreateLabel $LabelCount = 0 Local $Previous_Type = "" For $r = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$r][0] Then If $Previous_Type <> $aLabel[$r][1] Then $Previous_Type = $aLabel[$r][1] $aLabel[$r][10] = GUICtrlCreateLabel($aLabel[$r][1], $PlayerBorder, 13 * $LabelCount + $PlayerBorder, 50, 13, $SS_CENTERIMAGE) GUICtrlSetColor($aLabel[$r][10], 0xFFFFFF);White TextColor GUICtrlSetOnEvent($aLabel[$r][10], "_WM_LBUTTONDOWN") $ContextMenu = GUICtrlCreateContextMenu($aLabel[$r][10]) $hCM = GUICtrlGetHandle($ContextMenu) _GUICtrlMenu_SetMenuStyle($hCM, BitXOR(_GUICtrlMenu_GetMenuStyle($hCM), $MNS_MODELESS)) $ContextMenu_Item1 = GUICtrlCreateMenuItem($Radio_Name, $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") GUICtrlCreateMenuItem("", $ContextMenu);Add separator For $r2 = 0 To UBound($aRadio) - 1 If $aRadio[$r2][7] = 0 Then GUICtrlCreateMenuItem($aRadio[$r2][0], $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") EndIf Next EndIf $aLabel[$r][9] = GUICtrlCreateLabel("", $PlayerBorder + 50, 13 * $LabelCount + $PlayerBorder, 260, 13, $SS_CENTERIMAGE) $LabelCount = $LabelCount + 1 GUICtrlSetColor($aLabel[$r][9], 0xFFFFFF);White TextColor GUICtrlSetOnEvent($aLabel[$r][9], "_WM_LBUTTONDOWN") $ContextMenu = GUICtrlCreateContextMenu($aLabel[$r][9]) $hCM = GUICtrlGetHandle($ContextMenu) _GUICtrlMenu_SetMenuStyle($hCM, BitXOR(_GUICtrlMenu_GetMenuStyle($hCM), $MNS_MODELESS)) $ContextMenu_Item1 = GUICtrlCreateMenuItem($Radio_Name, $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") GUICtrlCreateMenuItem("", $ContextMenu);Add separator For $r2 = 0 To UBound($aRadio) - 1 If $aRadio[$r2][7] = 0 Then GUICtrlCreateMenuItem($aRadio[$r2][0], $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") EndIf Next EndIf Next ;GUICtrlCreateLabel Volume $Volume_Label = GUICtrlCreateLabel("0", $PlayerBorder, $PlayerBorder, 260 + 50, $LabelY, "") GUICtrlSetColor($Volume_Label, 0xFFFFFF);White TextColor GUICtrlSetOnEvent($Volume_Label, "_WM_LBUTTONDOWN") GUICtrlSetState($Volume_Label, $GUI_HIDE) ;$Volume_Label Contextmenu $ContextMenu = GUICtrlCreateContextMenu($Volume_Label) $hCM = GUICtrlGetHandle($ContextMenu) _GUICtrlMenu_SetMenuStyle($hCM, BitXOR(_GUICtrlMenu_GetMenuStyle($hCM), $MNS_MODELESS)) $ContextMenu_Item1 = GUICtrlCreateMenuItem($Radio_Name, $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") GUICtrlCreateMenuItem("", $ContextMenu);Add separator For $r = 0 To UBound($aRadio) - 1 If $aRadio[$r][7] = 0 Then Local $Item = GUICtrlCreateMenuItem($aRadio[$r][0], $ContextMenu) GUICtrlSetOnEvent(-1, "ContextMenu_ChangeRadio") EndIf Next ;$Close $Close = GUICtrlCreateButton("Close", _ $PlayerBorder * 2 + 260 + 50, _;Left $PlayerBorder, _;Top 10, _;X 10, _;Y $BS_BITMAP);Style _GUICtrlButton_SetImage($Close, @ScriptDir & "\AutoIt Radio Player\Img\Close.bmp") GUICtrlSetOnEvent($Close, "_Close") GUICtrlSetOnEvent($GUI_EVENT_CLOSE, "_Close") ;$PlayPause $PlayPause = GUICtrlCreateButton("Play/Pause", _ $PlayerBorder * 2 + 260 + 50, _;Left $PlayerBorder + 10 + 10, _;Top 10, _;X 10, _;Y $BS_BITMAP);Style _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\Stop.bmp") GUICtrlSetOnEvent($PlayPause, "_PlayPause") EndFunc ;==>_Build_PlayerGUI Func _Close() _Audio_init_stop($MusicHandle) _GDIPlus_Shutdown() Exit EndFunc ;==>_Close Func _PlayPause() ;Change $Play If $Play = 1 Then $Play = 0 Else $Play = 1 EndIf Local $Msg = GUIGetCursorInfo($PlayerGUI) ;Change Button Image If $Play = 1 Then If $Msg[4] = $PlayPause Then If $Msg[2] = 1 Then _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\stopp.bmp");Mouse Pressed Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\stopo.bmp");Mouse Over EndIf Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\stop.bmp");Nothing EndIf Else If $Msg[4] = $PlayPause Then If $Msg[2] = 1 Then _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\playp.bmp");Mouse Pressed Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\playo.bmp");Mouse Over EndIf Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\play.bmp");Nothing EndIf EndIf ;Play Sound If $Play = 0 Then _Audio_stop($MusicHandle) Else $MusicHandle = _Set_url($Radio_SoundLink) _Audio_play($MusicHandle) EndIf EndFunc ;==>_PlayPause Func _RemoveVolumeLabel() AdlibUnRegister("_RemoveVolumeLabel") ;Show Others Label For $i = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$i][0] Then GUICtrlSetState($aLabel[$i][9], $GUI_SHOW) EndIf Next Local $Previous_Type = "" For $i = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$i][0] Then If $Previous_Type <> $aLabel[$i][1] Then $Previous_Type = $aLabel[$i][1] GUICtrlSetState($aLabel[$i][10], $GUI_SHOW) EndIf GUICtrlSetState($aLabel[$i][9], $GUI_SHOW) EndIf Next ;Hide Volume Label GUICtrlSetState($Volume_Label, $GUI_HIDE) EndFunc ;==>_RemoveVolumeLabel Func _Save_Change_Volume() AdlibUnRegister("_Save_Change_Volume") _Set_volume($VolumePercent);Set IniWrite($Save_INI, @ComputerName, "Volume", $VolumePercent);Save EndFunc ;==>_Save_Change_Volume Func _WM_LBUTTONDOWN() ;Move GUI If WinActive("AutoIt Radio Cover") Then _SendMessage($CoverGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) Else _SendMessage($PlayerGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndIf ;Save GUI pos Local $Player_pos = WinGetPos("AutoIt Radio Player") Local $Cover_pos = WinGetPos("AutoIt Radio Cover") IniWrite($Save_INI, @ComputerName, "Title_X", $Player_pos[0]) IniWrite($Save_INI, @ComputerName, "Title_Y", $Player_pos[1]) If $Radio_CoverLink <> "" Then IniWrite($Save_INI, @ComputerName, "Cover_X", $Cover_pos[0]) IniWrite($Save_INI, @ComputerName, "Cover_Y", $Cover_pos[1]) EndIf EndFunc ;==>_WM_LBUTTONDOWN Func _WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) AdlibUnRegister("_RemoveVolumeLabel") If GUICtrlGetState($Volume_Label) <> 80 Then ;Show $Volume_Label GUICtrlSetState($Volume_Label, $GUI_SHOW) ;Hide Others Label Local $Previous_Type = "" For $i = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$r][0] Then If $Previous_Type <> $aLabel[$i][1] Then $Previous_Type = $aLabel[$i][1] GUICtrlSetState($aLabel[$i][10], $GUI_HIDE) EndIf GUICtrlSetState($aLabel[$i][9], $GUI_HIDE) EndIf Next EndIf ;Change $VolumePercent Local $WheelDelta = BitShift($wParam, 16) / 120 $VolumePercent = $VolumePercent + 4 * $WheelDelta If $WheelDelta > 0 Then If $VolumePercent > 100 Then $VolumePercent = 100 Else If $VolumePercent < 0 Then $VolumePercent = 0 EndIf If $Previous_VolumePercent <> $VolumePercent Then $Previous_VolumePercent = $VolumePercent GUICtrlSetData($Volume_Label, $VolumePercent) EndIf ;Change\Save Sound AdlibRegister("_Save_Change_Volume", 50) ;Hide $Volume_Label in 3s AdlibRegister("_RemoveVolumeLabel", 3000) Return $GUI_RUNDEFMSG EndFunc ;==>_WM_MOUSEWHEEL Func ContextMenu_ChangeRadio() $Previous_Cover_Read = "" Local $NewRadioName = GUICtrlRead(@GUI_CtrlId, 1) ;Maybe the next radio have no cover so delete it If $Radio_CoverLink <> "" Then GUIDelete($CoverGUI) AdlibUnRegister("GetCoverDATA") EndIf ;Maybe the $PlayerGUI need resize so delete it GUIDelete($PlayerGUI) AdlibUnRegister("GetPlayerDATA") _Audio_stop($MusicHandle) ;Remove Default Radio Tag For $r = 0 To UBound($aRadio) - 1 $aRadio[$r][7] = 0 Next ;Set $NewRadioName to Default For $r = 0 To UBound($aRadio) - 1 If $aRadio[$r][0] = $NewRadioName Then $aRadio[$r][7] = 1 IniWrite($Save_INI, @ComputerName, "Default_Radio", $aRadio[$r][0]) EndIf Next ;Get $Radio_Name, $Radio_SoundLink, $Radio_CoverLink, $Radio_CoverLink_Start, $Radio_CoverLink_End, $Radio_CoverLink_BetweenNum, $Radio_CoverLink_Before For $r = 0 To UBound($aRadio) - 1 If $aRadio[$r][7] = 1 Then $Radio_Name = $aRadio[$r][0] $Radio_SoundLink = $aRadio[$r][1] $Radio_CoverLink = $aRadio[$r][2] $Radio_CoverLink_Start = $aRadio[$r][3] $Radio_CoverLink_End = $aRadio[$r][4] $Radio_CoverLink_BetweenNum = $aRadio[$r][5] $Radio_CoverLink_Before = $aRadio[$r][6] EndIf Next ;ConsoleWrite("Build GUI" & @CRLF) ;Build GUI _Build_PlayerGUI() _Build_CoverGUI() ;ConsoleWrite("Show GUI" & @CRLF) GUISetState(@SW_SHOW, $PlayerGUI) If $Radio_CoverLink <> "" Then GUISetState(@SW_SHOW, $CoverGUI) EndIf ;GetPlayerDATA() - GetCoverDATA() GetPlayerDATA() AdlibRegister("GetPlayerDATA", 8000) If $Radio_CoverLink <> "" Then GetCoverDATA() AdlibRegister("GetCoverDATA", 8000) EndIf EndFunc ;==>ContextMenu_ChangeRadio Func UseCurl($Link, $Timeout, $binary = 0, $write = 0, $file = "") Local $Error = "" Local $Data = "" Local $Curl = Curl_Easy_Init() If Not $Curl Then Return If $write = 0 Then ;Read Mode ; How to get html or header data? ; 1. Set $CURLOPT_WRITEFUNCTION and $CURLOPT_HEADERFUNCTION to Curl_DataWriteCallback() ; 2. Set $CURLOPT_WRITEDATA or $CURLOPT_HEADERDATA to any number as identify ; 3. Use Curl_Data_Get() to read the returned data in binary format ; 4. Use Curl_Data_Cleanup() to remove the data Local $Html = $Curl ; any number as identify Local $Header = $Curl + 1 ; any number as identify Curl_Easy_Setopt($Curl, $CURLOPT_URL, $Link) Curl_Easy_Setopt($Curl, $CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A') Curl_Easy_Setopt($Curl, $CURLOPT_FOLLOWLOCATION, 1) Curl_Easy_Setopt($Curl, $CURLOPT_ACCEPT_ENCODING, "") Curl_Easy_Setopt($Curl, $CURLOPT_WRITEFUNCTION, Curl_DataWriteCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_WRITEDATA, $Html) Curl_Easy_Setopt($Curl, $CURLOPT_HEADERFUNCTION, Curl_DataWriteCallback()) Curl_Easy_Setopt($Curl, $CURLOPT_HEADERDATA, $Header) Curl_Easy_Setopt($Curl, $CURLOPT_COOKIE, "tool=curl; script=autoit; fun=yes;") Curl_Easy_Setopt($Curl, $CURLOPT_TIMEOUT, $Timeout) Curl_Easy_Setopt($Curl, $CURLOPT_SSL_VERIFYPEER, 0) Local $Code = Curl_Easy_Perform($Curl) If $Code = $CURLE_OK Then ;ConsoleWrite("Content Type: " & Curl_Easy_GetInfo($Curl, $CURLINFO_CONTENT_TYPE) & @LF) ;ConsoleWrite("Download Size: " & Curl_Easy_GetInfo($Curl, $CURLINFO_SIZE_DOWNLOAD) & @LF) $Data = BinaryToString(Curl_Data_Get($Html)) $Error = "" ;MsgBox(0, 'Header', BinaryToString(Curl_Data_Get($Header))) ;MsgBox(0, 'Html', BinaryToString(Curl_Data_Get($Html))) Else ;ConsoleWrite(Curl_Easy_StrError($Code) & @LF) $Data = "" $Error = Curl_Easy_StrError($Code) EndIf Curl_Easy_Cleanup($Curl) Curl_Data_Cleanup($Header) Curl_Data_Cleanup($Html) Else ;Write Mode EndIf Local $aray[2] = [$Data,$Error] return $aray EndFunc Func GetCoverDATA() ;ConsoleWrite("GetCoverDATA (Start)" & @CRLF) ;Get $RealCoverLink If $Radio_CoverLink_Start = "" Then ;ConsoleWrite("$RealCoverLink = $Radio_CoverLink" & @CRLF) Local $RealCoverLink = $Radio_CoverLink Else ;ConsoleWrite("$RealCoverLink <> $Radio_CoverLink" & @CRLF) ;UseCurl($Link, $Timeout, $binary = 0, $write = 0, $file = "") Local $aray = UseCurl($Radio_CoverLink, 5) Local $Data = $aray[0] Local $Error = $aray[1] If $Error <> "" then ;ConsoleWrite("$Error = " & $Error & @CRLF) EndIf Local $Between = _StringBetween($Data, $Radio_CoverLink_Start, $Radio_CoverLink_End) If @error <> 0 Then $Between = "" Else $Between = $Between[$Radio_CoverLink_BetweenNum] EndIf $RealCoverLink = $Radio_CoverLink_Before & $Between $RealCoverLink = StringReplace($RealCoverLink, " ","%20") EndIf ;ConsoleWrite("$RealCoverLink = " & $RealCoverLink & @CRLF) ;UseCurl($Link, $Timeout, $binary = 0, $write = 0, $file = "") Local $Cover_Read = UseCurl($RealCoverLink, 5, 1) $Cover_Read = $Cover_Read[0] If $Cover_Read <> $Previous_Cover_Read and $Cover_Read <> "" Then $Previous_Cover_Read = $Cover_Read Local $hMem = _MemGlobalAllocFromBinary($Cover_Read) Local $hImage = _GDIPlus_ImageLoadFromHGlobal($hMem) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($CoverGUI) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $CoverSize, $CoverSize) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hImage) EndIf ;ConsoleWrite("GetCoverDATA (End)" & @CRLF) EndFunc ;==>GetCoverDATA() Func GetPlayerDATA() _ReduceMemory() ;ConsoleWrite("GetPlayerDATA (Start)" & @CRLF) ;Assign Local $Previous_Data, $Previous_DataLink For $i = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$i][0] Then If $Previous_DataLink <> $aLabel[$i][3] Then Local $aray = UseCurl($aLabel[$i][3], 5) Local $Data = $aray[0] Local $Error = $aray[1] $Previous_Data = $Data $Previous_DataLink = $aLabel[$i][3] Else $Data = $Previous_Data $Previous_DataLink = $aLabel[$i][3] EndIf Local $Between = _StringBetween($Data, $aLabel[$i][4], $aLabel[$i][5]) If @error <> 0 Then $Between = "" Else If Not ($aLabel[$i][6] > Ubound($Between)-1) Then $Between = $Between[$aLabel[$i][6]] Else $Between = "" EndIf EndIf If $aLabel[$i][7] <> "" Then Local $Split = StringSplit($Between, $aLabel[$i][7], 1) If $Split[0] < $aLabel[$i][8] Then Local $Info = "" Else $Info = $Split[$aLabel[$i][8]] EndIf Else $Info = $Between EndIf If $Data = "" Then $Info = $Error EndIf $Info = StringReplace($Info, "â·", "·") $Info = StringReplace($Info, "apos;", "'") Assign($aLabel[$i][1] & $aLabel[$i][2], $Info) EndIf Next If _BASS_ChannelIsActive($MusicHandle) <> 1 and $Play = 1 Then _Audio_stop($MusicHandle) ;ConsoleWrite("Start playing sound" & @CRLF) $Play = 1 $MusicHandle = _Set_url($Radio_SoundLink) _Audio_play($MusicHandle) ;ConsoleWrite("Set Volume" & @CRLF) $VolumePercent = IniRead($Save_INI, @ComputerName, "Volume", 4) $Previous_VolumePercent = $VolumePercent _Set_volume($VolumePercent) EndIf ;Update Ctrl For $i = 0 To UBound($aLabel) - 1 If $Radio_Name = $aLabel[$i][0] Then If Eval($aLabel[$i][1] & $aLabel[$i][2]) <> GUICtrlRead($aLabel[$i][9]) Then GUICtrlSetData($aLabel[$i][9], Eval($aLabel[$i][1] & $aLabel[$i][2])) EndIf EndIf Next ;ConsoleWrite("GetPlayerDATA (End)" & @CRLF) EndFunc ;==>GetPlayerDATA() #EndRegion ;==> Internal Func While 1 Local $Msg = GUIGetCursorInfo($PlayerGUI) If $Msg[4] = $Close Then If $Msg[2] = 1 Then _GUICtrlButton_SetImage($Close, @ScriptDir & "\AutoIt Radio Player\Img\Closep.bmp");MousePressed Else _GUICtrlButton_SetImage($Close, @ScriptDir & "\AutoIt Radio Player\Img\Closeo.bmp");MouseOver EndIf Else _GUICtrlButton_SetImage($Close, @ScriptDir & "\AutoIt Radio Player\Img\Close.bmp");Nothing EndIf If $Play = 1 Then If $Msg[4] = $PlayPause Then If $Msg[2] = 1 Then _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\stopp.bmp");MousePressed Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\stopo.bmp");MouseOver EndIf Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\stop.bmp");Nothing EndIf Else If $Msg[4] = $PlayPause Then If $Msg[2] = 1 Then _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\playp.bmp");MousePressed Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\playo.bmp");MouseOver EndIf Else _GUICtrlButton_SetImage($PlayPause, @ScriptDir & "\AutoIt Radio Player\Img\play.bmp");Nothing EndIf EndIf Sleep(100) WEnd ;1075 v0.0.0.8 30/04/2016 01:55  
    • wakillon
      TinyShoutCastTuner
      By wakillon
      Listen Shoutcast Radios Stations with a station search engine by filters and an easy Favorites stations management.
    • Andreik
      Image streaming
      By Andreik
      I am working on a desktop remote application so I made a simple server and client to send binary screen captures from client to server. All it's good if I test both scripts on my computer but when the client is in other network many screen shots are corrupted and some of them looks good. Have any idea why?
       
      Client:
      #include <ScreenCapture.au3> #include <Memory.au3> #include <WinAPI.au3> #include <GDIPlus.au3> TCPStartup() $Client = TCPConnect(@IPAddress1,12100) _GDIPlus_Startup() While True Local $hHBitmap = _ScreenCapture_Capture('') Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) $bData = _GDIPlus_StreamImage2BinaryString($hBitmap) _GDIPlus_BitmapDispose($hBitmap) _WinAPI_DeleteObject($hHBitmap) TCPSend($Client,'~stream:' & BinaryLen($bData)) While BinaryLen($bData) $a = TCPSend($Client, $bData) $bData = BinaryMid($bData, $a+1, BinaryLen($bData)-$a) WEnd Sleep(10) WEnd TCPCloseSocket($Client) TCPShutdown() _GDIPlus_Shutdown() Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 100) ;UEZ Local $sImgCLSID, $tGUID, $tParams, $tData Switch $sFormat Case "JPG" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) $tParams = _GDIPlus_ParamInit(1) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Case "PNG", "BMP", "GIF", "TIF" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Case Else Return SetError(1, 0, 0) EndSwitch Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(2, 0, 0) _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams)) If @error Then Return SetError(3, 0, 0) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(4, 0, 0) Local $iMemSize = _MemGlobalSize($hMemory) If Not $iMemSize Then Return SetError(5, 0, 0) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) Return $bData EndFunc ;==>_GDIPlus_StreamImage2BinaryString  
      Server
      Global $Buffer, $BufferSize Global $Count = 0 TCPStartup() $Server = TCPListen(@IPAddress1,12100) If @error Then MsgBox(0,'',@error) Do $Socket = TCPAccept($Server) Sleep(10) Until $Socket <> -1 While True $Recv = TCPRecv($Socket,10240) If $Recv = -1 Then ExitLoop ElseIf $Recv Then If StringLeft($Recv,7) = '~stream' Then $BufferSize = StringSplit($Recv,':')[2] $Buffer = '0x' Do $Recv = TCPRecv($Socket,10240) If BinaryLen($Recv) <> 0 Then $BufferSize -= BinaryLen($Recv) $Buffer &= StringTrimLeft($Recv,2) EndIf Until $BufferSize = 0 $hFile = FileOpen(@ScriptDir & '\Screen' & $Count & '.jpeg',18) FileWrite($hFile,$Buffer) FileClose($hFile) $Buffer = Null $Count += 1 EndIf If $Count = 100 Then ExitLoop EndIf Sleep(10) WEnd TCPCloseSocket($Socket) TCPCloseSocket($Server) TCPShutdown() Exit  
    • UEZ
      GDI+ Snowfall build 2016-01-17 (romantic edition)
      By UEZ
      Simple snowfall using GDI+ & ASM.
      Thanks to Eukalyptus for the ASM codes.
       
      If the script runs too slow reduce the amount of flakes in line 115.
       
      You can switch now between local MP3 stream and internet stream. Further you can also set the scrolling text.
      Command line options:
      -local "<path to local MP3 file>"
      -url "<URL to a MP3 file>"
      -text "<your individual text>"
      Max. text length are 500 chars.
      Don't forget the double quotes after the parameters!
       
      Download: click me
       

       
      Happy snowing and romantic moments...