Sign in to follow this  
Followers 0
wakillon

TinyChartsJukebox 1.0.6.2 Update of 28 June 2014 (no more Ads)

62 posts in this topic

#1 ·  Posted (edited)

Would you Listen Last 100 Uk Top Charts singles like a JukeBox or Radio in random order and without advertising ? :blink:

It's possible by getting charts List on charts website http://creativedisc.com/category/top-charts/uk-top-100-singles/ updated weekly
and searching songs list on youtube.


20140323152611.jpg

Changelog 1.0.6.1

Script completly rewrited.

All externals fils are includes.

New youtube search engine improved for listen the good song !

Blacklist Management improved.

Video can be visible.

Now flashplayer sound is muted while Ads. -_-

User clicks on flashplayer progress bar are now detected for the detection of the end of the song.

New Buttons.

Changelog 1.0.6.2

Adapted to new AutoIt Version and Youtube changes.

Hope you like it !  :guitar:

Previous downloads : 500

sourceTinyChartsJukebox v1.0.6.2.au3.html

executable :  TinyChartsJukebox.exe.html

(Once the html file is downloaded, double click on it for start the download)

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



Very nice and useful

Might be nice if it had a tooltip saying "please wait, just retrieving song....." as I thought it wasn't working on my slow connection.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Very nice and useful

Might be nice if it had a tooltip saying "please wait, just retrieving song....." as I thought it wasn't working on my slow connection.

Thanks happy2help Posted Image

There is already "Waiting for Next Song..." in the Tooltip,

and

you're right, streaming depends of connection quality !

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

Very nice and useful

Might be nice if it had a tooltip saying "please wait, just retrieving song....." as I thought it wasn't working on my slow connection.

Strange - What OS have you tested this on? My Win7 didn't display the upper tooltip - hence my suggestion - but when I tried it on my XP machine it works fine? :blink:

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Strange - What OS have you tested this on? My Win7 didn't display the upper tooltip - hence my suggestion - but when I tried it on my XP machine it works fine? :blink:

Sorry I did not say which os I have run it ! Posted Image

and not tested on win7... ( I prefer xp for his simplicity ) Posted Image

Perhaps Tooltips doesn't works well on Win7 ? i can't try it, i have suppress my win 7 partition.

I'll try to add a little gui... ok ? 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

Just a little cosmetic thing - it would be nice to have the tooltip display the song title and artist separately, even just with a " - " between would make it easier to read.

Share this post


Link to post
Share on other sites

Very cool job.

Thanks for this share !

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Just a little cosmetic thing - it would be nice to have the tooltip display the song title and artist separately, even just with a " - " between would make it easier to read.

ok i'm working on Posted Image

Very cool job.

Thanks for this share !

Thank's pierrotm777 ! Posted Image

I want specify that the waiting time is more due to the IE opening than the search ! Posted Image

Soon a gui interface with manual selection...

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

I have added a sort by order !

Add to the beginning of the script:

If Not FileExists("Settings.ini") Then

IniWrite("Settings.ini", "WebRadio", "WindowsName", "WebRadio")

IniWrite("Settings.ini", "WebRadio", "SortBy", "order")

EndIf

$SortBy = IniRead("Settings.ini", "WebRadio", "SortBy", "")

replace the line 53 by:

If $SortBy = "randomize" Then $_R = _Randomize ( $_LastUkTopChartsListArray[0] );choix au hazard

If $SortBy = "order" Then $_R = _ByOrder ( $_LastUkTopChartsListArray[0] );choix par ordre de 1 à 100

Func _ByOrder ( $_Max=100 );choice by order

Do

If $_Order < 100 Then

$_Order = $_Order+1

EndIf

If $_Order =100 Then

$_Order = 0

$_Order = $_Order+1

EndIf

Until Not _AlreadyInArray ( $_OrderArray, $_Order )

_ArrayAdd ( $_OrderArray, $_Order )

Return $_Order

EndFunc ;==> _ByOrder ( )

If some one has an idea for to add a choice by number

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

So, with a Tiny graphical interface this JukeBox is nicer... Posted Image

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Radio.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs -----------------------------------------------------------------------------------------------------------

 AutoIt Version  : 3.3.6.1
 Author          : Wakillon
 Title          : TinyUKChartsStreamPlayer
 Script Fonction : Listen Last 100 Uk Top Charts singles like a radio in random order and without advertising
                by getting charts List on charts website and search song's list on youtube.
                _ Right Arrow for Next random song
                _ ESC for Quit
                _ WebSite http://www.theofficialcharts.com/singles-chart/ is updated weekly

#ce -----------------------------------------------------------------------------------------------------------
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIStatusBar.au3>
#Include <GuiListView.au3>
#include <String.au3>
#include <File.au3>
#include <Misc.au3>
#include <Date.au3>
#include <IE.au3>

HotKeySet ( "{ESC}", "_Terminate" )
If Not _Singleton ( @ScriptName, 1 ) Then Exit 

Dim $_RandomArray[1], $_TimerInit = TimerInit ( ), $Sec, $Min, $Hour, $Time, $_Spaces='        '
Dim $_Text=$_Spaces & '_ Right Arrow for Next random song' & @Crlf & $_Spaces & '_ ESC for Quit'
Dim $_DurationDiff, $_DurationMs, $_GetItem, $_Auto=1, $oIE, $_SelectOld, $_PicShow=0
Global $_Duration, $_UpDateDate, $_ImagesUrlArray[1]
Global $_Invert=True
Global $_InvertTimerInit=TimerInit ( )
Global $_StatusParts[1] = [500]
Global $_TempStatus[1] = [""]
Global $__SLIDE_aGUI[1][5] = [["Winhandle", "sSide", "sState", "locked", "OnHover"]]
Global $__SLIDE_hDLL = DllOpen ( "user32.dll" ) 

AdlibRegister ( "__Slide_CheckHover", 100 )
OnAutoItExitRegister ( "__Slide_UnloadDLL" )
Opt ( "TrayMenuMode", 1 )
TraySetIcon ( "Shell32.dll", -129 ) 
TraySetToolTip ( "   TinyUKChartsStreamPlayer" & @Crlf & StringStripWS ( $_Text, 7 ) ) 
TraySetState ( 4 ) 

_ProcessClose ( 'iexplore.exe' )
OnAutoItExitRegister ( "_OnAutoItExit" )    
If Not FileExists ( @TempDir & '\Pics' ) Then DirCreate ( @TempDir & '\Pics' )

Do    
    Sleep ( 1000 )
    ToolTip ( $_Spaces & 'Waiting for Internet connection', @DesktopWidth/2-100, 0, 'Tiny UK Charts Stream Player', 1, 4 )
Until _IsConnected ( )

ToolTip ( $_Spaces & 'Searching Last 100 Uk Top Charts List...' & @Crlf & @Crlf & $_Text, @DesktopWidth/2-100, 0, 'Tiny UK Charts Stream Player', 1, 4 )
$_LastUkTopChartsListArray = _GetLastUkTopChartsListArray2 ( 'http://www.theofficialcharts.com/singles-chart/' )
If _IsArrayEmpty ( $_LastUkTopChartsListArray ) Then Exit MsgBox ( 0, 'Error', 'Sorry Uk Top Charts List Not Found !', 5 )
Dim $ListViewItem[UBound ( $_LastUkTopChartsListArray )]
Dim $_SelectButtonWidth = 120, $_X=368

$_Gui                      = GUICreate ( 'Tiny UK Charts Stream Player ' & $_UpDateDate, 500, 330, @DesktopWidth-507, @DesktopHeight - 360, -1, BitOR ( $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ) )
                        GUISetBkColor ( 0xFFD900 ) 
                            GUISetIcon ( "Shell32.dll", -129 )
$_ListView  = GUICtrlCreateListView ( "Top Nb|Title - Artist", 15, 20, 340, 260 )
    _GUICtrlListView_SetColumnWidth ( $_ListView, 1, $LVSCW_AUTOSIZE_USEHEADER )
For $_G = 1 To UBound ( $_LastUkTopChartsListArray ) - 1
    $ListViewItem[$_G] = GUICtrlCreateListViewItem ( StringFormat ( "%02i", $_G ) & "|" & $_LastUkTopChartsListArray[$_G], $_ListView )
Next
$_SelectButton   = GUICtrlCreateButton ( "Listen Selected Song", $_X, 221, $_SelectButtonWidth, 24 ) 
                       GUICtrlSetState ( $_SelectButton, $GUI_DISABLE ) 
$_ExitButton    = GUICtrlCreateButton ( "Exit", $_X, 257, $_SelectButtonWidth, 24 ) 
$_RandomButton   = GUICtrlCreateButton ( "Disable Random Mode", $_X, 149, $_SelectButtonWidth, 24 )                 
                    GUICtrlSetBkColor ( $_RandomButton, 0xFF0000 )  
                    GUICtrlSetColor ( $_RandomButton, 0xFFFF00 ) 
$_NextButton    = GUICtrlCreateButton ( "Next Random Song", $_X, 185, $_SelectButtonWidth, 24 )                 
            $_Pic = GUICtrlCreatePic ( @ProgramFilesDir & "\AutoIt3\Examples\GUI\merlin.gif", $_X, 20, 118, 118, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) ) 
$_StatusBar = _GUICtrlStatusBar_Create ( $_Gui, $_StatusParts, $_TempStatus, $SBARS_SIZEGRIP )
        _GUICtrlStatusBar_SetMinHeight ( $_StatusBar, 40 )
    $_Icons = _WinAPI_LoadShell32Icon ( 128 )
            _GUICtrlStatusBar_SetIcon ( $_StatusBar, 0, $_Icons )
                    _Slide_WinSetSlide ( $_Gui, "top" ) 
                _Slide_SlideSetOnHover ( $_Gui ) 
                        GUISetState ( @SW_SHOW )
                               ToolTip ( '' )


While 1
    If $_Auto Then
        $_R = _Randomize ( $_LastUkTopChartsListArray[0] ) 
        _GUICtrlStatusBar_SetText ( $_StatusBar, ' Waiting for Next Song...', 0 )   
        $_YoutubeSearch = _YoutubeSearch ( $_LastUkTopChartsListArray[$_R]& ' official' )
        If StringInStr ( $_YoutubeSearch, 'http://www.youtube.com/watch?v' ) <> 0 Then 
            $oIE = _IECreate ( $_YoutubeSearch, 0, 0, 1 )
            $_DurationInit = TimerInit ( )
            $_DurationDiff=0
            For $_P = 1 To $_ImagesUrlArray[0]
                $_PicPath = @TempDir & '\Pics\' & $_LastUkTopChartsListArray[$_P] & '.jpg'
                If Not FileExists ( $_PicPath ) Then InetGet ( $_ImagesUrlArray[$_P], $_PicPath, 0, 1 )
            Next
            $_PicPath = @TempDir & '\Pics\' & $_LastUkTopChartsListArray[$_R] & '.jpg'
            If FileExists ( $_PicPath ) Then
                GUICtrlSetState ( $_Pic, $GUI_HIDE )
                $_Pic = GUICtrlCreatePic ( $_PicPath, $_X, 20, 118, 118, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) )    
            EndIf   
        Else    
            _GUICtrlStatusBar_SetText ( $_StatusBar, $_Spaces & 'Top N°' & $_R & ' - ' & $_LastUkTopChartsListArray[$_R] & @Crlf & 'Music Not Found !', 0 )    
            Sleep ( 2000 )
        EndIf
    EndIf   
    While 1
        If $_DurationDiff > $_DurationMs Or ( $_Auto And _IsPressed ( "27" ) ) Then
            _IEQuit ( $oIE ) 
            $_GetItem=''
            $_Duration=0
            $_DurationInit=0
            $_DurationDiff=0
            $_PicShow=0
            ExitLoop 
        EndIf       
        Sleep ( 20 )
        $_Msg = GUIGetMsg ( )
        Switch $_Msg
            Case $_SelectButton 
                _IEQuit ( $oIE ) 
                $_PicShow=0
                $_GetItem = _GetItem ( )
                If $_GetItem Then
                    _GUICtrlStatusBar_SetText ( $_StatusBar, $_Spaces & 'Waiting for Next Song...', 0 )
                    $_YoutubeSearch = _YoutubeSearch ( $_GetItem & ' official' )
                    $oIE = _IECreate ( $_YoutubeSearch, 0, 0, 1 )
                    $_DurationInit = TimerInit ( )
                    $_DurationDiff=0
                    $_PicPath = @TempDir & '\Pics\' & $_GetItem & '.jpg'
                    If FileExists ( $_PicPath ) Then
                        GUICtrlSetState ( $_Pic, $GUI_HIDE )
                        $_Pic = GUICtrlCreatePic ( $_PicPath, $_X, 20, 118, 118, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) )    
                    EndIf
                EndIf
            Case $_NextButton
                _IEQuit ( $oIE ) 
                $_GetItem=''
                $_Duration=0
                $_DurationInit=0
                $_DurationDiff=0
                $_PicShow=0
                ExitLoop                    
            Case $_RandomButton 
                _IEQuit ( $oIE ) 
                $_PicShow=0
                If $_Auto = 1 Then 
                    $_Auto=0
                    GUICtrlSetState ( $_SelectButton, $GUI_ENABLE ) 
                    GUICtrlSetState ( $_NextButton, $GUI_DISABLE )
                    GUICtrlSetState ( $_RandomButton, $GUI_HIDE )
                    $_RandomButton = GUICtrlCreateButton ( "Enable Random Mode", $_X, 146, $_SelectButtonWidth, 24 ) 
                    GUICtrlSetBkColor ( $_RandomButton, 0xFF0000 )  
                    GUICtrlSetColor ( $_RandomButton, 0xFFFF00 ) 
                Else    
                    $_Auto = 1
                    GUICtrlSetState ( $_SelectButton, $GUI_DISABLE )
                    GUICtrlSetState ( $_RandomButton, $GUI_HIDE )
                    GUICtrlSetState ( $_NextButton, $GUI_ENABLE )
                    $_RandomButton = GUICtrlCreateButton ( "Disable Random Mode", $_X, 146, $_SelectButtonWidth, 24 ) 
                    GUICtrlSetBkColor ( $_RandomButton, 0xFF0000 )  
                    GUICtrlSetColor ( $_RandomButton, 0xFFFF00 ) 
                    ExitLoop 
                EndIf   
            Case $GUI_EVENT_CLOSE
                GUIDelete ( )   
                _Terminate ( )
            Case $_ExitButton
                GUIDelete ( )    
                _Terminate ( )              
            Case $_Msg <> 0
                $_Select = _GetItem ( )
                If $_Select <> $_SelectOld Then
                    $_PicPath = @TempDir & '\Pics\' & $_Select & '.jpg'
                    If FileExists ( $_PicPath ) Then
                        GUICtrlSetState ( $_Pic, $GUI_HIDE )
                        $_Pic = GUICtrlCreatePic ( $_PicPath, $_X, 20, 118, 118, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) )    
                    EndIf
                    $_SelectOld = $_Select
                    $_Select=''
                EndIf               
        EndSwitch
        If _EachXseconds ( 1.5 ) Then _InvertColorButton ( $_RandomButton ) 
        $_DurationMs = $_Duration * 1000    
        If $_Duration Then $_DurationDiff = Round ( TimerDiff ( $_DurationInit ) )
        _TicksToTime ( $_DurationMs - $_DurationDiff, $Hour, $Min, $Sec )
        If $_Auto Then  
            $_Text2 = $_LastUkTopChartsListArray[$_R]
        Else
            $_Text2 = $_GetItem
        EndIf
        If $_Text2 Then 
            _GUICtrlStatusBar_SetText ( $_StatusBar, $_Spaces & 'Top N°' & $_R & ' - ' & $_Text2 & ' - ' & StringFormat ( "%02i:%02i", $Min, $Sec ), 0 )
            If Not $_PicShow Then
                $_PicPath = @TempDir & '\Pics\' & $_Text2 & '.jpg'
                If FileExists ( $_PicPath ) Then
                    GUICtrlSetState ( $_Pic, $GUI_HIDE )
                    $_Pic = GUICtrlCreatePic ( $_PicPath, $_X, 20, 118, 118, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) ) 
                    $_PicShow = 1               
                EndIf
            EndIf   
        EndIf
    WEnd
WEnd

Func _InvertColorButton ( $_GuiCtrl )
    If $_Invert Then
        GUICtrlSetBkColor ( $_GuiCtrl, 0xFF0000 )  
        GUICtrlSetColor ( $_GuiCtrl, 0xFFFF00 ) 
        $_Invert=False
    Else
        GUICtrlSetBkColor ( $_GuiCtrl, 0xFFFF00 )  
        GUICtrlSetColor ( $_GuiCtrl, 0xFF0000 )     
        $_Invert=True
    EndIf
EndFunc ;==> _InvertColorButton ( )

Func _EachXseconds ( $_Interval )
    $_TimerDiff = Round ( TimerDiff ( $_InvertTimerInit )/ 1000 )
    If $_TimerDiff >= $_Interval Then
        $_InvertTimerInit = TimerInit ( )
        Return 1
    Else
        Return 0
    EndIf
EndFunc ;==> _EachXseconds ( )

Func _GetItem ( )
    $_Select = GUICtrlRead ( GUICtrlRead ( $_ListView ) ) 
    $_Stringlen = Stringlen ( $_Select )
    $_Select = StringReplace ( StringRight ( $_Select, $_Stringlen - 3 ), '|', '' )
    If $_Select Then Return $_Select 
EndFunc ;==> _GetItem ( )

Func _GetLastUkTopChartsListArray2 ( $_LastChartsUrl )
    Local $_NamesArray[1], $_Add
    $_LastChartPageSourceCode = _GetSourceCode ( $_LastChartsUrl )  
    $_UpDateDate = _StringBetween ( $_LastChartPageSourceCode, '"date"> -', "<" )               
    If Not @error Then $_UpDateDate = '( Week of ' & StringStripWS ( $_UpDateDate[0], 7 ) & ' )'
    $_LastChartsArray = StringSplit ( $_LastChartPageSourceCode, @CRLF ) 
    Local $_ChartsArray[1] 
    For $_I = 1 To UBound ( $_LastChartsArray ) -1
        If StringInStr ( $_LastChartsArray[$_I], '</h4>' ) <> 0 Then
            $_Title = _StringBetween ( $_LastChartsArray[$_I], '<h4>', '</h4>' )
            If Not @error Then
                $_Artist = StringReplace ( $_LastChartsArray[$_I+2], '<br />', '' )
                $_Name = _CleanVideoName ( $_Title[0] & ' - ' & $_Artist )
                If Not _AlreadyInArray ( $_NamesArray, $_Name ) Then 
                    _ArrayAdd ( $_NamesArray, $_Name )
                    $_Add = $_Add + 1
                    If $_I+43 < UBound ( $_LastChartsArray ) -1 Then
                        For $_J = $_I-3 To $_I+3
                            $_ImagesUrl = _StringBetween ( $_LastChartsArray[$_J], 'coverimage" src="', '"' )               
                            If Not @error Then 
                                $_ImagesUrl = $_ImagesUrl[0]
                                If StringLeft ( $_ImagesUrl, 4 ) <> 'http' Then $_ImagesUrl = 'http://www.theofficialcharts.com' & $_ImagesUrl
                                If Not _IsValidUrl ( $_ImagesUrl ) Then $_ImagesUrl=''
                            _ArrayAdd ( $_ImagesUrlArray, $_ImagesUrl )
                            EndIf 
                        Next
                    EndIf 
                EndIf 
            EndIf 
        EndIf 
    Next 
    $_ImagesUrlArray[0] = UBound ( $_ImagesUrlArray ) -1
    $_NamesArray[0] = UBound ( $_NamesArray ) -1
    Return $_NamesArray
EndFunc ;==> _GetLastUkTopChartsListArray2 ( )

Func _YoutubeSearch ( $_Query )
    Dim $_WordOfQuery[1]
    $_QuerySplit = StringSplit ( StringStripWS ( StringRegExpReplace ( StringReplace ( StringReplace ( $_Query, 'è', 'e' ), 'é', 'e' ), "\W", " " ) , 7 ), ' ' )
    For $_I = 1 To UBound ( $_QuerySplit ) - 1
    If StringLen ( $_QuerySplit[$_I] ) > 1 Then _ArrayAdd ( $_WordOfQuery, StringReplace ( $_QuerySplit[$_I], ',', ' ' ) )
    Next
    $_WordOfQuery[0] = UBound ( $_WordOfQuery ) - 1 
    $_Query = StringReplace ( $_Query, " ", "+" )
    $_Query = StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace _
    ( StringReplace ( StringStripWS ( $_Query, 7 ), ',', '%2C' ), '&', '%26' ), '(', '%28' ), ')', '%29' ), "'", '%27' ), 'è', 'e' ), 'é', 'e' ), '«', ' ' ), '»', ' ' )
    $_SourceCode = _GetSourceCode ( "http://www.youtube.com/results?search_query=" & $_Query ) 
    $_SourceCodeSplit = StringSplit ( $_SourceCode, @CRLF )     
    Dim $_Watch[1] 
    For $_I = 1 To UBound ( $_SourceCodeSplit )-1
        If StringInStr ( $_SourceCodeSplit[$_I], '/watch?v=' ) <> 0 And StringInStr ( $_SourceCodeSplit[$_I], 'video-long-title' ) <> 0 Then
            _ArrayAdd ( $_Watch, $_SourceCodeSplit[$_I] )
        EndIf 
    Next    
    For $_I = 1 To UBound ( $_Watch )-1
        $Titles = _StringBetween ( $_Watch[$_I], 'title="', '" rel=' )
        If Not @error Then 
            If Not _OneOfThisStringInStr ( $Titles[0], 'Karaok|lyrics|Singing|parod' ) Then
                $_Duration = _StringBetween ( $_SourceCode, 'time">', '<' ) 
                If Not @error Then 
                    $_Duration = StringSplit ( $_Duration[0], ':' )
                    $_Duration = $_Duration[1]*60 + $_Duration[2]
                    $Link = _StringBetween ( $_Watch[$_I], 'href="', '"' )  
                    If Not @error Then 
                        If StringInStr ( $Link[0], 'http://www.youtube.com' ) = 0 Then 
                            $_UrlToExtract = "http://www.youtube.com" & $Link[0]
                        Else
                            $_UrlToExtract = $Link[0]
                        EndIf
                        Return $_UrlToExtract
                    EndIf
                EndIf
            EndIf   
        EndIf
    Next 
Endfunc ;==> _YoutubeSearch ( )

Func _OneOfThisStringInStr ( $_InStr, $_String )
    $_StringArray = StringSplit ( $_String, '|' ) 
    If @error Then Return 0
    For $_I = 1 To UBound ( $_StringArray ) -1
        $_StringInStr = StringInStr ( $_InStr, $_StringArray[$_I] ) 
        If $_StringInStr <> 0 Then Return 1 
    Next
    Return 0
EndFunc ;==> _OneOfThisStringInStr ( )

Func _CleanVideoName ( $_Name )
    $_Name2 = StringRegExpReplace ( $_Name, '(&quot;)|(&quot;)|(quot;)|(&amp;)|(amp;)|(&lt;)|(lt;)|(&gt;)|(gt;)|(#39;)', '' )   
    $_Name2 = StringReplace ( $_Name2, 'ç', 'c' )    
    $_Name2 = StringReplace ( $_Name2, 'ß', 'ss' )       
    $_Name2 = StringReplace ( $_Name2, '€', '€' )   
    $_Name2 = StringRegExpReplace ( $_Name2, '(à )|(â)|(ä)|(À)|(ã)|(á)|(Ã¥)', 'a' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(Ú)|(ê)|(é)|(è)|(ë)', 'e' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(ï)|(î)|(Ã)', 'i' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(ÃŽ)|(ö)|(ó)|(ô)', 'o' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(û)|(ü)|(ù)|(ÃŒ)|(ú)', 'u' )
    $_Name2 = StringReplace ( $_Name2, 'Ã', 'a' )      
    $_Name2 = StringReplace ( $_Name2, '\', '' )    
    $_Name2 = StringRegExpReplace ( $_Name2, "[|!?_*~´’'`³¹¼¯,]", ' ' )  
    $_Name2 = StringRegExpReplace ( $_Name2, '[âªâ™«»¥¶£¢€¡†Ø§³ÙŠšØ¹±ª#®¤©‰¨¹¬·/;:"]', '' )  
    Return _StringProper ( StringStripWS ( _CleanHtmlName ( $_Name2 ), 7 ) )
EndFunc ;==> _CleanVideoName ( )

Func _CleanHtmlName ( $_Name )
    $_Name2 = StringReplace ( $_Name, '%2C', ',' )
    $_Name2 = StringReplace ( $_Name2, '%82', ',' )
    $_Name2 = StringReplace ( $_Name2, '%27', "'" )
    $_Name2 = StringReplace ( $_Name2, '&039', "'" )    
    Return $_Name2
EndFunc ;==> _CleanHtmlName ( )

Func _Randomize ( $_Max=100 )   
    Do 
        $_Random = Random ( 1, $_Max, 1 )
    Until Not _AlreadyInArray ( $_RandomArray, $_Random )
    _ArrayAdd ( $_RandomArray, $_Random ) 
    If UBound ( $_RandomArray ) -1 >= $_Max Then ReDim $_RandomArray[1]
    Return $_Random
EndFunc ;==> _Randomize ( ) 

Func _AlreadyInArray ( $_SearchArray, $_Item )
    $_Index = _ArraySearch ( $_SearchArray, $_Item ) 
    If @error Then      
        Return False
    Else  
        If  $_Index <> 0 Then
            Return True
        Else 
            Return False
        EndIf   
    EndIf
EndFunc ;==> _AlreadyInArray ( )
 
Func _GetSourceCode ( $_Url )
    $_InetRead = InetRead ( $_Url )
    If Not @Error Then
        $_BinaryToString = BinaryToString ( $_InetRead )
        If Not @Error Then Return $_BinaryToString
    EndIf   
EndFunc ;==> _GetSourceCode ( )

Func _IsArrayEmpty ( $_EmptyArray )
    Local $_V = UBound ( $_EmptyArray ) -1, $_P 
    If $_V = 0 Then Return True
    For $_F = 1 To $_V      
        If $_EmptyArray[$_F] = '' Then $_P = $_P + 1
    Next
    If $_P = $_V Then 
        Return True
    Else
        Return False
    EndIf
EndFunc ;==> _IsArrayEmpty ( )

Func _IsConnected ( )
    $_SrcFilePath = _TempFile ( @TempDir & "\", '~google_', ".src", 7 ) 
    Local $IsConnected = InetGet ( "http://www.google.com", $_SrcFilePath, 1, 1 )
    Local $_Info 
    Do
        $_Info = InetGetInfo ( $IsConnected )
        Sleep ( 50 )
    Until $_Info[2] = True 
    InetClose ( $IsConnected )
    _Delete ( $_SrcFilePath )   
    If $_Info[3] <> True Then   
        Return 0
    Else
        Return 1
    EndIf   
EndFunc ;==> _IsConnected ( )

Func _IsValidUrl ( $_IsValidUrl )
    $_Size = InetGetSize ( $_IsValidUrl ) 
    If $_Size <> 0 Then Return 1    
Endfunc ;==> _IsValidUrl ( )

Func _Delete ( $_FullPath )
    $_DeleteInit = TimerInit ( )
    While FileExists ( $_FullPath ) 
        If StringInStr ( FileGetAttrib ( $_FullPath ), "D" ) Then 
            DirRemove ( $_FullPath, 1 )
        Else
            FileDelete ( $_FullPath )
        EndIf
        If TimerDiff ( $_DeleteInit ) > 5000 Then Return 0
    WEnd
    Return 1    
EndFunc ;==> _Delete ( ) 

Func _ProcessClose ( $_ProcessName )
    While ProcessExists ( $_ProcessName )
        ProcessClose ( $_ProcessName )  
    WEnd
EndFunc ;==> _ProcessClose ( )

Func _Terminate ( )
    _IEQuit ( $oIE ) 
    _ProcessClose ( 'iexplore.exe' )
    Exit 
EndFunc ;==> _Terminate ( )

Func _OnAutoItExit ( )
    Opt ( "TrayIconHide", 0 ) 
    TrayTip ( "TinyUKChartsStreamPlayer", "        by wakillon...", 1, 1 )
    Sleep ( 2000 )
    TrayTip ( '', '', 1, 1 )
EndFunc ;==> _OnAutoItExit ( ) 

Func _Slide_WinSetSlide ( $hWnd, $sSide, $iMode = 1 )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    If $iMode > 1 Or $iMode < 0 Then Return SetError ( 1, 0, 0 )
    If Not StringRegExp ( $sSide, "(?i)(left|right|top|bottom)" ) Then Return SetError ( 1, 0, 0 )
    $iUbound = UBound ( $__SLIDE_aGUI )
    Switch $iMode
        Case 1
            ReDim $__SLIDE_aGUI[$iUbound + 1][5]
            $__SLIDE_aGUI[$iUbound][0] = $hWnd
            $__SLIDE_aGUI[$iUbound][1] = $sSide
            $__SLIDE_aGUI[$iUbound][2] = True
            $__SLIDE_aGUI[$iUbound][3] = False
            $__SLIDE_aGUI[$iUbound][4] = False
            _Slide_SlideOut ( $hWnd )
            GUISetState ( @SW_SHOWNOACTIVATE, $hWnd )
        Case 0
            For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
                If $__SLIDE_aGUI[$i][0] = $hWnd Then
                    For $j = $i To UBound($__SLIDE_aGUI) - 2
                        $__SLIDE_aGUI[$j][0] = $__SLIDE_aGUI[$j + 1][0]
                        $__SLIDE_aGUI[$j][1] = $__SLIDE_aGUI[$j + 1][1]
                        $__SLIDE_aGUI[$j][2] = $__SLIDE_aGUI[$j + 1][2]
                        $__SLIDE_aGUI[$j][3] = $__SLIDE_aGUI[$j + 1][3]
                        $__SLIDE_aGUI[$j][4] = $__SLIDE_aGUI[$j + 1][4]
                        ReDim $__SLIDE_aGUI[UBound ( $__SLIDE_aGUI ) - 1][5]
                        _Slide_SlideIn ( $hWnd )
                        GUISetState ( @SW_HIDE, $hWnd )
                    Next
                EndIf
            Next
    EndSwitch
EndFunc ;==> _Slide_WinSetSlide ( )

Func _Slide_SlideSetOnHover ( $hWnd, $sMode = True )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    $iUbound = UBound ( $__SLIDE_aGUI )
    Switch $sMode
        Case True
            For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
                If $__SLIDE_aGUI[$i][0] = $hWnd Then
                    $__SLIDE_aGUI[$i][4] = True
                EndIf
            Next
        Case False
            For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
                If $__SLIDE_aGUI[$i][0] = $hWnd Then
                    $__SLIDE_aGUI[$i][4] = False
                EndIf
            Next
    EndSwitch
EndFunc ;==> _Slide_SlideSetOnHover ( )

Func _Slide_SlideOut ( $hWnd )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
        If $__SLIDE_aGUI[$i][0] = $hWnd Then
            If $__SLIDE_aGUI[$i][2] Then
                __Slide_WinSlide ( $hWnd, "out", $__SLIDE_aGUI[$i][1] )
                $__SLIDE_aGUI[$i][2] = False
                Return SetError ( 0, 0, 1 )
            Else
                Return SetError ( 3, 0, 0 )
            EndIf
        EndIf
    Next
    Return SetError ( 2, 0, 0 )
EndFunc ;==> _Slide_SlideOut ( )

Func _Slide_SlideIn ( $hWnd )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
        If $__SLIDE_aGUI[$i][0] = $hWnd Then
            If Not $__SLIDE_aGUI[$i][2] Then
                __Slide_WinSlide ( $hWnd, "in", $__SLIDE_aGUI[$i][1] )
                $__SLIDE_aGUI[$i][2] = True
            Else
                Return SetError ( 3, 0, 0 )
            EndIf
        EndIf
    Next
    Return SetError ( 2, 0, 0 )
EndFunc ;==> _Slide_SlideIn ( )

Func __Slide_WinSlide ( $hWnd, $sMode, $sSide )
    Local $aScreen_Res = WinGetPos ( WinGetHandle ( "Program Manager" ) )
    Local $aWPos = WinGetPos ( $hWnd ), $m = 0 - ( $sMode = "in" ) + ( $sMode = "out" )
    Local $h = 0 - ( $sSide = "left" ) + ( $sSide = "right" ), $v = 0 - ( $sSide = "top" ) + ( $sSide = "bottom" )
    WinMove ( $hWnd, "", $aScreen_Res[0] - ( ( $h = -1 ) * ( $m = -1 ) * ( $aWPos[2] - 10 ) ) _
            + ( ( $h = 1 ) * ( ( $h = 1 ) * $aScreen_Res[2] - ( 10 * ( $m = -1 ) ) - ( $m <> -1 ) * $aWPos[2] ) ) _
            + ( ( $h = 0 ) * ( ( $h = 0 ) * ( $aScreen_Res[2] / 2 ) - ( $aWPos[2] / 2 ) ) ) _
            , $aScreen_Res[1] - ( ( $v = -1 ) * ( $m = -1 ) * ( $aWPos[3] - 10 ) ) _
            + ( ( $v = 1 ) * ( ( $v = 1 ) * $aScreen_Res[3] - ( 10 * ( $m = -1 ) ) - ( $m <> -1 ) * $aWPos[3] ) ) _
            + ( ( $v = 0 ) * ( ( $v = 0 ) * ( $aScreen_Res[3] / 2 ) - ($aWPos[3] / 2 ) ) ) )
    $aWPos = WinGetPos ( $hWnd )
    Switch $sSide
        Case "left", "right"
            Local $STEP = ( ( ( ( $h = 1 ) And ( $m = 1 ) ) Or ( ( $h = -1 ) And ( $m = -1 ) ) ) - ( ( ( $h = -1 ) And ( $m = 1 ) ) Or ( ( $h = 1 ) And ( $m = -1 ) ) ) ) * 10
            Local $FROM = $aWPos[0], $TO = $aWPos[0] + ( ( ( ( $h = 1 ) And ( $m = 1 ) ) Or ( ( $h = -1 ) And ( $m = -1 ) ) ) * ( $aWPos[2] ) ) _
                     - ( ( ( ( $h = 1 ) And ( $m = -1 ) ) Or ( ( $h = -1 ) And ( $m = 1 ) ) ) * ( $aWPos[2] ) ) - $STEP
            For $i = $aWPos[0] To $TO Step $STEP
                WinMove ( $hWnd, "", $i, $aWPos[1] )
                Sleep ( 10 )
            Next
        Case "top", "bottom"
            Local $STEP = ( ( ( ( $v = 1 ) And ( $m = 1 ) ) Or ( ( $v = -1 ) And ( $m = -1 ) ) ) - ( ( ( $v = -1 ) And ( $m = 1 ) ) Or ( ( $v = 1 ) And ( $m = -1 ) ) ) ) * 10
            Local $FROM = $aWPos[1], $TO = $aWPos[1] + ( ( ( ( $v = 1 ) And ( $m = 1 ) ) Or ( ( $v = -1 ) And ( $m = -1 ) ) ) * ( $aWPos[3] ) ) _
                     - ( ( ( ( $v = 1 ) And ( $m = -1 ) ) Or ( ( $v = -1 ) And ( $m = 1 ) ) ) * ( $aWPos[3] ) ) - $STEP     ;ConsoleWrite ( "$STEP : " & $STEP & @Crlf )        
            If $STEP > 0 Then $TO = $TO -25
            For $i = $aWPos[1] To $TO + 25 Step $STEP ; 
                WinMove ( $hWnd, "", $aWPos[0], $i )
                Sleep ( 10 )
            Next
    EndSwitch
EndFunc ;==> __Slide_WinSlide ( )

Func __Slide_CheckHover ( )
    For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
        If $__SLIDE_aGUI[$i][4] Then
            If Not $__SLIDE_aGUI[$i][3] Then
                If __Slide_WinIsHovered ( $__SLIDE_aGUI[$i][0] ) Then
                    If Not $__SLIDE_aGUI[$i][2] Then _Slide_SlideIn ( $__SLIDE_aGUI[$i][0] )
                Else
                    If $__SLIDE_aGUI[$i][2] Then _Slide_SlideOut ( $__SLIDE_aGUI[$i][0] )
                EndIf
            EndIf
        EndIf
    Next
EndFunc ;==> __Slide_CheckHover ( )

Func __Slide_UnloadDLL ( )
    DllClose ( $__SLIDE_hDLL )
EndFunc ;==> __Slide_UnloadDLL ( )

Func __Slide_WinIsHovered ( $hWnd, $vDLL = "User32.dll" )
    Local $aResult, $aWPos = WinGetPos ( $hWnd ) 
    If @error Then Return 
    Local $aMPos = MouseGetPos ( )
    If @error Then Return   
    Local $tRect = DllStructCreate ( "int Left;int Top;int Right;int Bottom" )
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData ( $tRect, "Left", $iLeft )
    DllStructSetData ( $tRect, "Top", $iTop )
    DllStructSetData ( $tRect, "Right", $iLeft + $iWidth )
    DllStructSetData ( $tRect, "Bottom", $iTop + $iHeight )
    $aResult = DllCall ( $vDLL, "int", "PtInRect", "ptr", DllStructGetPtr ( $tRect ), "int", $iX, "int", $iY )
    If @error Then Return SetError ( @error, 0, False )
    Return $aResult[0] <> 0
EndFunc ;==> __Slide_WinIsHovered ( )

And Thanks to SEuBo for his _Slide Fonctions ! 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

#11 ·  Posted (edited)

I remove the OnTop gui attrib, who could interfere and to save time at startup

i add a backup registry with a control of website update and

an image of the record cover !

And we can now select music genre otherwise random genre will be select after 10 sec ! Posted Image

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Radio.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs -----------------------------------------------------------------------------------------------------------

 AutoIt Version  : 3.3.6.1
 Author          : Wakillon
 Title          : TinyUKChartsStreamPlayer
 Script Fonction : Listen Last 100 Uk Top Charts singles like a radio in random order and without advertising
                by getting charts List on charts website and search song's list on youtube.
                _ Right Arrow for Next random song
                _ ESC for Quit
                _ WebSite http://www.theofficialcharts.com/singles-chart/ is updated weekly
                
#ce -----------------------------------------------------------------------------------------------------------
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIStatusBar.au3>
#Include <GuiListView.au3>
#include <String.au3>
#include <File.au3>
#include <Misc.au3>
#include <Date.au3>
#include <IE.au3>

HotKeySet ( "{ESC}", "_Terminate" )
If Not _Singleton ( @ScriptName, 1 ) Then Exit 

Dim $Sec, $Min, $Hour, $Time, $_SelectButtonWidth = 120, $_X=368, $_PicSize=100, $_Spaces='        '
Dim $_Text=$_Spaces & '_ Right Arrow for Next random song' & @Crlf & $_Spaces & '_ ESC for Quit'
Dim $_DurationDiff, $_DurationMs, $_GetItem, $_Auto=1, $_IE, $_SelectOld, $_PicShow=0
Dim $_Key = "HKEY_LOCAL_MACHINE\SOFTWARE\TinyUKChartsStreamPlayer"
Global $_LastUkTopChartsListArray[1], $_ImagesUrlArray[1], $_RandomArray[1]
Global $_Duration, $_UpDateDate, $_LastChartPageSourceCode, $_Invert=True, $_InvertTimerInit=TimerInit ( )
Global $_StatusParts[1] = [500], $_TempStatus[1] = [""]
Global $__SLIDE_aGUI[1][5] = [["Winhandle", "sSide", "sState", "locked", "OnHover"]]
Global $__SLIDE_hDLL = DllOpen ( "user32.dll" ) 

Opt ( "TrayMenuMode", 1 )
TraySetIcon ( "Shell32.dll", -129 ) 
TraySetToolTip ( "   TinyUKChartsStreamPlayer" & @Crlf & StringStripWS ( $_Text, 7 ) ) 
TraySetState ( 4 )

AdlibRegister ( "__Slide_CheckHover", 100 )
OnAutoItExitRegister ( "_OnAutoItExit" )    
If Not FileExists ( @TempDir & '\Pics' ) Then DirCreate ( @TempDir & '\Pics' )

Do    
    Sleep ( 1000 )
    ToolTip ( $_Spaces & 'Waiting for Internet connection', @DesktopWidth/2-100, 0, 'Tiny UK Charts Stream Player', 1, 4 )
Until _IsConnected ( )
ToolTip ( '' )

$_Genre = StringSplit ( 'singles-chart|rock-and-metal-singles-chart|catalogue-singles-chart|dance-singles-chart', '|' )
$_SubKey = _SelectGenre ( ) 
$_LastChartsUrl = 'http://www.theofficialcharts.com/' & $_SubKey & '/'
$_UpdateDate = _GetUpdateDate ( $_LastChartsUrl )
$_RegUpdateDate = RegRead ( $_Key & '\' & $_SubKey, 'UpdateDate' )

If $_UpdateDate <> $_RegUpdateDate Then 
    ToolTip ( $_Spaces & 'Searching Last 100 Uk Top Charts List...' & @Crlf & @Crlf & $_Text, @DesktopWidth/2-100, 0, 'Tiny UK Charts Stream Player', 1, 4 )
    RegDelete ( $_Key & '\' & $_SubKey )
    $_LastUkTopChartsListArray = _GetLastUkTopChartsListArray ( $_LastChartPageSourceCode ) 
    ToolTip ( '' )
Else
    For $_J = 1 To 100
        $_Value = RegEnumVal ( $_Key & '\' & $_SubKey, $_J )        
        If @error <> 0 Then ExitLoop 
        If StringInStr ( $_Value, 'UpdateDate' ) = 0 Then 
            $_RegRead = RegRead ( $_Key & '\' & $_SubKey, $_Value )
            _ArrayAdd ( $_LastUkTopChartsListArray, $_RegRead )
        EndIf
    Next 
EndIf

$_LastUkTopChartsListArray[0] = UBound ( $_LastUkTopChartsListArray )-1
If _IsArrayEmpty ( $_LastUkTopChartsListArray ) Then Exit MsgBox ( 0, 'Error', 'Sorry Uk Top Charts List Not Found !', 5 )
Dim $_ListViewItem[$_LastUkTopChartsListArray[0]+1]
Dim $_GuiTitle='Tiny UK ' & $_SubKey & ' Stream Player ' & $_UpDateDate


$_Gui                      = GUICreate ( $_GuiTitle, 500, 330, @DesktopWidth-507, @DesktopHeight - 360, -1, BitOR ( $WS_EX_LAYERED, $WS_EX_TOOLWINDOW ) ) 
                        GUISetBkColor ( 0xFFD900 ) 
                            GUISetIcon ( "Shell32.dll", -129 )
$_ListView  = GUICtrlCreateListView ( "Top Nb|Title - Artist", 15, 20, 340, 260 )
    _GUICtrlListView_SetColumnWidth ( $_ListView, 1, $LVSCW_AUTOSIZE_USEHEADER )
For $_G = 1 To UBound ( $_LastUkTopChartsListArray ) - 1
    $_ListViewItem[$_G] = GUICtrlCreateListViewItem ( StringFormat ( "%02i", $_G ) & "|" & $_LastUkTopChartsListArray[$_G], $_ListView )
Next
$_SelectButton   = GUICtrlCreateButton ( "Listen Selected Song", $_X, 221, $_SelectButtonWidth, 24 ) 
                    GUICtrlSetState ( $_SelectButton, $GUI_DISABLE ) 
$_ExitButton    = GUICtrlCreateButton ( "Exit", $_X, 257, $_SelectButtonWidth, 24 ) 
$_RandomButton   = GUICtrlCreateButton ( "Disable Random Mode", $_X, 149, $_SelectButtonWidth, 24 )                 
                    GUICtrlSetBkColor ( $_RandomButton, 0xFF0000 )  
                    GUICtrlSetColor ( $_RandomButton, 0xFFFF00 ) 
$_NextButton    = GUICtrlCreateButton ( "Next Random Song", $_X, 185, $_SelectButtonWidth, 24 )                 
            $_Pic = GUICtrlCreatePic ( @ProgramFilesDir & "\AutoIt3\Examples\GUI\merlin.gif", $_X+10, 20, $_PicSize, $_PicSize, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) ) 
$_StatusBar = _GUICtrlStatusBar_Create ( $_Gui, $_StatusParts, $_TempStatus, $SBARS_SIZEGRIP )
        _GUICtrlStatusBar_SetMinHeight ( $_StatusBar, 40 )
    $_Icons = _WinAPI_LoadShell32Icon ( 128 )
            _GUICtrlStatusBar_SetIcon ( $_StatusBar, 0, $_Icons )
                    _Slide_WinSetSlide ( $_Gui, "top" ) 
                _Slide_SlideSetOnHover ( $_Gui ) 
                        GUISetState ( @SW_SHOW )
                            


While 1
    If $_Auto Then
        $_R = _Randomize ( $_LastUkTopChartsListArray[0] ) 
        _GUICtrlStatusBar_SetText ( $_StatusBar, ' Waiting for Next Song...', 0 )   
        $_YoutubeSearch = _YoutubeSearch ( $_LastUkTopChartsListArray[$_R] & ' official' )
        If StringInStr ( $_YoutubeSearch, 'http://www.youtube.com/watch?v' ) <> 0 Then 
            $_IE = _IECreate ( $_YoutubeSearch, 0, 0, 1 )
            $_DurationInit = TimerInit ( )
            $_DurationDiff=0
            For $_P = 1 To $_ImagesUrlArray[0]
                $_PicPath = @TempDir & '\Pics\' & $_LastUkTopChartsListArray[$_P] & '.jpg'
                If Not FileExists ( $_PicPath ) Then InetGet ( $_ImagesUrlArray[$_P], $_PicPath, 0, 1 )
            Next
            $_PicPath = @TempDir & '\Pics\' & $_LastUkTopChartsListArray[$_R] & '.jpg'
            If FileExists ( $_PicPath ) Then
                GUICtrlSetState ( $_Pic, $GUI_HIDE )
                $_Pic = GUICtrlCreatePic ( $_PicPath, $_X+10, 20, $_PicSize, $_PicSize, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) )     
            EndIf   
            _WinSetOnTopOneTime ( $_GuiTitle )
        Else    
            _GUICtrlStatusBar_SetText ( $_StatusBar, $_Spaces & 'Top N°' & $_R & ' - ' & $_LastUkTopChartsListArray[$_R] & @Crlf & 'Music Not Found !', 0 )    
            _WinSetOnTopOneTime ( $_GuiTitle )
            Sleep ( 2000 )
        EndIf
    EndIf   
    While 1
        If $_DurationDiff > $_DurationMs Or ( $_Auto And _IsPressed ( "27" ) ) Then
            _IEQuit ( $_IE ) 
            $_GetItem=''
            $_Duration=0
            $_DurationInit=0
            $_DurationDiff=0
            $_PicShow=0
            ExitLoop 
        EndIf       
        Sleep ( 20 )
        $_Msg = GUIGetMsg ( )
        Switch $_Msg
            Case $_SelectButton 
                _IEQuit ( $_IE ) 
                $_PicShow=0
                $_GetItem = _GetItem ( )
                If $_GetItem Then
                    _GUICtrlStatusBar_SetText ( $_StatusBar, $_Spaces & 'Waiting for Next Song...', 0 )
                    $_YoutubeSearch = _YoutubeSearch ( $_GetItem & ' official' )
                    $_IE = _IECreate ( $_YoutubeSearch, 0, 0, 1 )
                    $_DurationInit = TimerInit ( )
                    $_DurationDiff=0
                    $_PicPath = @TempDir & '\Pics\' & $_GetItem & '.jpg'
                    If FileExists ( $_PicPath ) Then
                        GUICtrlSetState ( $_Pic, $GUI_HIDE )
                        $_Pic = GUICtrlCreatePic ( $_PicPath, $_X+10, 20, $_PicSize, $_PicSize, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) )     
                    EndIf
                EndIf
            Case $_NextButton
                _IEQuit ( $_IE ) 
                $_GetItem=''
                $_Duration=0
                $_DurationInit=0
                $_DurationDiff=0
                $_PicShow=0
                ExitLoop                    
            Case $_RandomButton 
                _IEQuit ( $_IE ) 
                $_PicShow=0
                If $_Auto = 1 Then 
                    $_Auto=0
                    GUICtrlSetState ( $_SelectButton, $GUI_ENABLE ) 
                    GUICtrlSetState ( $_NextButton, $GUI_DISABLE )
                    GUICtrlSetState ( $_RandomButton, $GUI_HIDE )
                    $_RandomButton = GUICtrlCreateButton ( "Enable Random Mode", $_X, 146, $_SelectButtonWidth, 24 ) 
                    GUICtrlSetBkColor ( $_RandomButton, 0xFF0000 )  
                    GUICtrlSetColor ( $_RandomButton, 0xFFFF00 ) 
                Else    
                    $_Auto = 1
                    GUICtrlSetState ( $_SelectButton, $GUI_DISABLE )
                    GUICtrlSetState ( $_RandomButton, $GUI_HIDE )
                    GUICtrlSetState ( $_NextButton, $GUI_ENABLE )
                    $_RandomButton = GUICtrlCreateButton ( "Disable Random Mode", $_X, 146, $_SelectButtonWidth, 24 ) 
                    GUICtrlSetBkColor ( $_RandomButton, 0xFF0000 )  
                    GUICtrlSetColor ( $_RandomButton, 0xFFFF00 ) 
                    ExitLoop 
                EndIf   
            Case $GUI_EVENT_CLOSE
                GUIDelete ( )   
                _Terminate ( )
            Case $_ExitButton
                GUIDelete ( )    
                _Terminate ( )              
            Case $_Msg <> 0
                $_Select = _GetItem ( )
                If $_Select <> $_SelectOld Then
                    $_PicPath = @TempDir & '\Pics\' & $_Select & '.jpg'
                    If FileExists ( $_PicPath ) Then
                        GUICtrlSetState ( $_Pic, $GUI_HIDE )
                        $_Pic = GUICtrlCreatePic ( $_PicPath, $_X+10, 20, $_PicSize, $_PicSize, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) )     
                    EndIf
                    $_SelectOld = $_Select
                    $_Select=''
                EndIf               
        EndSwitch
        If _EachXseconds ( 1.5 ) Then _InvertColorButton ( $_RandomButton ) 
        $_DurationMs = $_Duration * 1000    
        If $_Duration Then $_DurationDiff = Round ( TimerDiff ( $_DurationInit ) )
        _TicksToTime ( $_DurationMs - $_DurationDiff, $Hour, $Min, $Sec )
        If $_Auto Then  
            $_Text2 = $_LastUkTopChartsListArray[$_R]
        Else
            $_Text2 = $_GetItem
        EndIf
        If $_Text2 Then 
            _GUICtrlStatusBar_SetText ( $_StatusBar, $_Spaces & 'Top N°' & $_R & ' - ' & $_Text2 & ' - ' & StringFormat ( "%02i:%02i", $Min, $Sec ), 0 )
            If Not $_PicShow Then
                $_PicPath = @TempDir & '\Pics\' & $_Text2 & '.jpg'
                If FileExists ( $_PicPath ) Then
                    GUICtrlSetState ( $_Pic, $GUI_HIDE )
                    $_Pic = GUICtrlCreatePic ( $_PicPath, $_X+10, 20, $_PicSize, $_PicSize, BitOR ( $SS_Notify, $WS_GROUP, $WS_CLIPSIBLINGS ) ) 
                    $_PicShow = 1               
                EndIf
            EndIf   
        EndIf
    WEnd
WEnd

Func _SelectGenre ( )
    $_Gui = GUICreate ( "Tiny UK Charts Stream Player, Select Genre...", 250, 130, -1, -1, -1, BitOR ( $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ) ) 
    GUISetBkColor ( 0xFFD900 ) 
    Dim $_Radio[UBound ( $_Genre )]
    For $_I = 1 To UBound ( $_Genre ) -1
        $_Radio[$_I] = GUICtrlCreateRadio ( _StringProper ( StringReplace ( $_Genre[$_I], '-', ' ' ) ), 10, $_I*20 -10, 160, 20 )
    Next
    GUISetState ( )    
    $_TimerInit =  TimerInit ( )
    $_InvertTimerInit = TimerInit ( )
    While 1
        $msg = GUIGetMsg ( )    
        Select
            Case $msg = $GUI_EVENT_CLOSE
            Exit
            Case $msg <> -11 And $msg <> 0
                For $_I = 1 To UBound ( $_Genre ) -1
                    If $msg = $_Radio[$_I] And BitAND ( GUICtrlRead ( $_Radio[$_I] ), $GUI_CHECKED ) = $GUI_CHECKED Then
                        $_SubKey = $_Genre[$_I]
                        GUIDelete ( $_Gui )
                        Return $_SubKey
                    EndIf
                Next
        EndSelect
        $_ChoiceTimerDiff = Round ( TimerDiff ( $_TimerInit )/1000 )
        If _EachXseconds ( 1 ) Then GUICtrlCreateLabel ( StringFormat ( "%02i", ( 11-$_ChoiceTimerDiff ) ) & ' Secondes to make your Choice...', 10, ( $_I+1 ) * 20 -10 )
        If $_ChoiceTimerDiff > 10 Then
            Dim $_SubKey = $_Genre[Random ( 1, $_Genre[0], 1 )]
            GUIDelete ( $_Gui )
            Return $_SubKey
        EndIf       
        Sleep ( 20 )
    WEnd
EndFunc ;==> _SelectGenre ( )

Func _InvertColorButton ( $_GuiCtrl )
    If $_Invert Then
        GUICtrlSetBkColor ( $_GuiCtrl, 0xFF0000 )  
        GUICtrlSetColor ( $_GuiCtrl, 0xFFFF00 ) 
        $_Invert=False
    Else
        GUICtrlSetBkColor ( $_GuiCtrl, 0xFFFF00 )  
        GUICtrlSetColor ( $_GuiCtrl, 0xFF0000 )     
        $_Invert=True
    EndIf
EndFunc ;==> _InvertColorButton ( )

Func _EachXseconds ( $_Interval )
    $_TimerDiff = Round ( TimerDiff ( $_InvertTimerInit )/ 1000 )
    If $_TimerDiff >= $_Interval Then
        $_InvertTimerInit = TimerInit ( )
        Return 1
    Else
        Return 0
    EndIf
EndFunc ;==> _EachXseconds ( )

Func _GetItem ( )
    $_Select = GUICtrlRead ( GUICtrlRead ( $_ListView ) ) 
    $_Stringlen = Stringlen ( $_Select )
    $_Select = StringReplace ( StringRight ( $_Select, $_Stringlen - 3 ), '|', '' )
    If $_Select Then Return $_Select 
EndFunc ;==> _GetItem ( )

Func _GetUpdateDate ( $_LastChartsUrl )
    Local $_UpDateDate
    $_LastChartPageSourceCode = _GetSourceCode ( $_LastChartsUrl )  
    $_UpDateDate = _StringBetween ( $_LastChartPageSourceCode, '"date"> -', "<" )               
    If Not @error Then $_UpDateDate = '( Week of ' & StringStripWS ( $_UpDateDate[0], 7 ) & ' )'
    Return $_UpDateDate
EndFunc

Func _GetLastUkTopChartsListArray ( $_SourceCode )
    Local $_NamesArray[1], $_Add
    $_LastChartsArray = StringSplit ( $_SourceCode, @CRLF ) 
    Local $_ChartsArray[1] 
    For $_I = 1 To UBound ( $_LastChartsArray ) -1
        If StringInStr ( $_LastChartsArray[$_I], '</h4>' ) <> 0 Then
            $_Title = _StringBetween ( $_LastChartsArray[$_I], '<h4>', '</h4>' )
            If Not @error Then
                $_Artist = StringReplace ( $_LastChartsArray[$_I+2], '<br />', '' )
                $_Name = _CleanVideoName ( $_Title[0] & ' - ' & $_Artist )
                If Not _AlreadyInArray ( $_NamesArray, $_Name ) Then 
                    _ArrayAdd ( $_NamesArray, $_Name )
                    $_Add = $_Add + 1
                    RegWrite ( $_Key & '\' & $_SubKey, StringFormat ( "%03i", $_Add ), "REG_SZ", $_Name )
                    If $_I+43 < UBound ( $_LastChartsArray ) -1 Then
                        For $_J = $_I-3 To $_I+3
                            $_ImagesUrl = _StringBetween ( $_LastChartsArray[$_J], 'coverimage" src="', '"' )               
                            If Not @error Then 
                                $_ImagesUrl = $_ImagesUrl[0]
                                If StringLeft ( $_ImagesUrl, 4 ) <> 'http' Then $_ImagesUrl = 'http://www.theofficialcharts.com' & $_ImagesUrl
                                If Not _IsValidUrl ( $_ImagesUrl ) Then $_ImagesUrl=''
                            _ArrayAdd ( $_ImagesUrlArray, $_ImagesUrl )
                            EndIf 
                        Next
                    EndIf 
                EndIf 
            EndIf 
        EndIf 
    Next 
    $_ImagesUrlArray[0] = UBound ( $_ImagesUrlArray ) -1
    $_NamesArray[0] = UBound ( $_NamesArray ) -1
    RegWrite ( $_Key & '\' & $_SubKey, 'UpdateDate', "REG_SZ", $_UpdateDate )
    Return $_NamesArray
EndFunc ;==> _GetLastUkTopChartsListArray ( )

Func _YoutubeSearch ( $_Query )
    Dim $_WordOfQuery[1]
    $_QuerySplit = StringSplit ( StringStripWS ( StringRegExpReplace ( StringReplace ( StringReplace ( $_Query, 'è', 'e' ), 'é', 'e' ), "\W", " " ) , 7 ), ' ' )
    For $_I = 1 To UBound ( $_QuerySplit ) - 1
    If StringLen ( $_QuerySplit[$_I] ) > 1 Then _ArrayAdd ( $_WordOfQuery, StringReplace ( $_QuerySplit[$_I], ',', ' ' ) )
    Next
    $_WordOfQuery[0] = UBound ( $_WordOfQuery ) - 1 
    $_Query = StringReplace ( $_Query, " ", "+" )
    $_Query = StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace ( StringReplace _
    ( StringReplace ( StringStripWS ( $_Query, 7 ), ',', '%2C' ), '&', '%26' ), '(', '%28' ), ')', '%29' ), "'", '%27' ), 'è', 'e' ), 'é', 'e' ), '«', ' ' ), '»', ' ' )
    $_SourceCode = _GetSourceCode ( "http://www.youtube.com/results?search_query=" & $_Query ) 
    $_SourceCodeSplit = StringSplit ( $_SourceCode, @CRLF )     
    Dim $_Watch[1] 
    For $_I = 1 To UBound ( $_SourceCodeSplit )-1
        If StringInStr ( $_SourceCodeSplit[$_I], '/watch?v=' ) <> 0 And StringInStr ( $_SourceCodeSplit[$_I], 'video-long-title' ) <> 0 Then
            _ArrayAdd ( $_Watch, $_SourceCodeSplit[$_I] )
        EndIf 
    Next    
    For $_I = 1 To UBound ( $_Watch )-1
        $Titles = _StringBetween ( $_Watch[$_I], 'title="', '" rel=' )
        If Not @error Then 
            If Not _OneOfThisStringInStr ( $Titles[0], 'Karaok|Singing|parod' ) Then
                $_Duration = _StringBetween ( $_SourceCode, 'time">', '<' ) 
                If Not @error Then 
                    $_Duration = StringSplit ( $_Duration[0], ':' )
                    $_Duration[0]=UBound ( $_Duration ) -1
                    $_Duration = $_Duration[1]*60 + $_Duration[$_Duration[0]]
                    $Link = _StringBetween ( $_Watch[$_I], 'href="', '"' )  
                    If Not @error Then 
                        If StringInStr ( $Link[0], 'http://www.youtube.com' ) = 0 Then 
                            $_UrlToExtract = "http://www.youtube.com" & $Link[0]
                        Else
                            $_UrlToExtract = $Link[0]
                        EndIf
                        Return $_UrlToExtract
                    EndIf
                EndIf
            EndIf   
        EndIf
    Next 
Endfunc ;==> _YoutubeSearch ( )

Func _OneOfThisStringInStr ( $_InStr, $_String )
    $_StringArray = StringSplit ( $_String, '|' ) 
    If @error Then Return 0
    For $_I = 1 To UBound ( $_StringArray ) -1
        $_StringInStr = StringInStr ( $_InStr, $_StringArray[$_I] ) 
        If $_StringInStr <> 0 Then Return 1 
    Next
    Return 0
EndFunc ;==> _OneOfThisStringInStr ( )

Func _CleanVideoName ( $_Name )
    $_Name2 = StringRegExpReplace ( $_Name, '(&quot;)|(&quot;)|(quot;)|(&amp;)|(amp;)|(&lt;)|(lt;)|(&gt;)|(gt;)|(#39;)', '' )   
    $_Name2 = StringReplace ( $_Name2, 'ç', 'c' )    
    $_Name2 = StringReplace ( $_Name2, 'ß', 'ss' )       
    $_Name2 = StringReplace ( $_Name2, '€', '€' )   
    $_Name2 = StringRegExpReplace ( $_Name2, '(à )|(â)|(ä)|(À)|(ã)|(á)|(Ã¥)', 'a' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(Ú)|(ê)|(é)|(è)|(ë)', 'e' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(ï)|(î)|(Ã)', 'i' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(ÃŽ)|(ö)|(ó)|(ô)', 'o' )
    $_Name2 = StringRegExpReplace ( $_Name2, '(û)|(ü)|(ù)|(ÃŒ)|(ú)', 'u' )
    $_Name2 = StringReplace ( $_Name2, 'Ã', 'a' )      
    $_Name2 = StringReplace ( $_Name2, '\', '' )    
    $_Name2 = StringRegExpReplace ( $_Name2, "[|!?_*~´’'`³¹¼¯,]", ' ' )  
    $_Name2 = StringRegExpReplace ( $_Name2, '[âªâ™«»¥¶£¢€¡†Ø§³ÙŠšØ¹±ª#®¤©‰¨¹¬·/;:"]', '' )  
    Return _StringProper ( StringStripWS ( _CleanHtmlName ( $_Name2 ), 7 ) )
EndFunc ;==> _CleanVideoName ( )

Func _CleanHtmlName ( $_Name )
    $_Name2 = StringReplace ( $_Name, '%2C', ',' )
    $_Name2 = StringReplace ( $_Name2, '%82', ',' )
    $_Name2 = StringReplace ( $_Name2, '%27', "'" )
    $_Name2 = StringReplace ( $_Name2, '&039', "'" )    
    Return $_Name2
EndFunc ;==> _CleanHtmlName ( )

Func _Randomize ( $_Max=100 )   
    Do 
        $_Random = Random ( 1, $_Max, 1 )
    Until Not _AlreadyInArray ( $_RandomArray, $_Random )
    _ArrayAdd ( $_RandomArray, $_Random ) 
    $_RandomArray[0] = UBound ( $_RandomArray ) -1
    If $_RandomArray[0] >= $_Max Then ReDim $_RandomArray[1]
    Return $_Random
EndFunc ;==> _Randomize ( ) 

Func _AlreadyInArray ( $_SearchArray, $_Item )
    $_Index = _ArraySearch ( $_SearchArray, $_Item ) 
    If @error Then      
        Return False
    Else  
        If  $_Index <> 0 Then
            Return True
        Else 
            Return False
        EndIf   
    EndIf
EndFunc ;==> _AlreadyInArray ( )
 
Func _GetSourceCode ( $_Url )
    $_InetRead = InetRead ( $_Url )
    If Not @Error Then
        $_BinaryToString = BinaryToString ( $_InetRead )
        If Not @Error Then Return $_BinaryToString
    EndIf   
EndFunc ;==> _GetSourceCode ( )

Func _IsArrayEmpty ( $_EmptyArray )
    Local $_V = UBound ( $_EmptyArray ) -1, $_P 
    If $_V = 0 Then Return True
    For $_F = 1 To $_V      
        If $_EmptyArray[$_F] = '' Then $_P = $_P + 1
    Next
    If $_P = $_V Then 
        Return True
    Else
        Return False
    EndIf
EndFunc ;==> _IsArrayEmpty ( )

Func _IsConnected ( )
    $_SrcFilePath = _TempFile ( @TempDir & "\", '~google_', ".src", 7 ) 
    Local $IsConnected = InetGet ( "http://www.google.com", $_SrcFilePath, 1, 1 )
    Local $_Info 
    Do
        $_Info = InetGetInfo ( $IsConnected )
        Sleep ( 50 )
    Until $_Info[2] = True 
    InetClose ( $IsConnected )
    _Delete ( $_SrcFilePath )   
    If $_Info[3] <> True Then   
        Return 0
    Else
        Return 1
    EndIf   
EndFunc ;==> _IsConnected ( )

Func _IsValidUrl ( $_IsValidUrl )
    $_Size = InetGetSize ( $_IsValidUrl ) 
    If $_Size <> 0 Then Return 1    
Endfunc ;==> _IsValidUrl ( )

Func _Delete ( $_FullPath )
    $_DeleteInit = TimerInit ( )
    While FileExists ( $_FullPath ) 
        If StringInStr ( FileGetAttrib ( $_FullPath ), "D" ) Then 
            DirRemove ( $_FullPath, 1 )
        Else
            FileDelete ( $_FullPath )
        EndIf
        If TimerDiff ( $_DeleteInit ) > 5000 Then Return 0
    WEnd
    Return 1    
EndFunc ;==> _Delete ( ) 

Func _ProcessClose ( $_ProcessName )
    While ProcessExists ( $_ProcessName )
        ProcessClose ( $_ProcessName )  
    WEnd
EndFunc ;==> _ProcessClose ( )

Func _Terminate ( )
    _IEQuit ( $_IE ) 
    Exit 
EndFunc ;==> _Terminate ( )

Func _OnAutoItExit ( )
    Opt ( "TrayIconHide", 0 ) 
    TrayTip ( "TinyUKChartsStreamPlayer", "        by wakillon...", 1, 1 )
    __Slide_UnloadDLL ( )
    Sleep ( 2000 )
    TrayTip ( '', '', 1, 1 )
EndFunc ;==> _OnAutoItExit ( ) 

Func _WinSetOnTopOneTime ( $_WinTitle )
    WinWait ( $_WinTitle, "", 6 )
    WinSetOnTop ( $_WinTitle, "", 1 ) 
    Sleep ( 250 )
    WinSetOnTop ( $_WinTitle, "", 0 ) 
EndFunc ;==> _WinSetOnTopOneTime ( )

Func _Slide_WinSetSlide ( $hWnd, $sSide, $iMode = 1 )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    If $iMode > 1 Or $iMode < 0 Then Return SetError ( 1, 0, 0 )
    If Not StringRegExp ( $sSide, "(?i)(left|right|top|bottom)" ) Then Return SetError ( 1, 0, 0 )
    $iUbound = UBound ( $__SLIDE_aGUI )
    Switch $iMode
        Case 1
            ReDim $__SLIDE_aGUI[$iUbound + 1][5]
            $__SLIDE_aGUI[$iUbound][0] = $hWnd
            $__SLIDE_aGUI[$iUbound][1] = $sSide
            $__SLIDE_aGUI[$iUbound][2] = True
            $__SLIDE_aGUI[$iUbound][3] = False
            $__SLIDE_aGUI[$iUbound][4] = False
            _Slide_SlideOut ( $hWnd )
            GUISetState ( @SW_SHOWNOACTIVATE, $hWnd )
        Case 0
            For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
                If $__SLIDE_aGUI[$i][0] = $hWnd Then
                    For $j = $i To UBound($__SLIDE_aGUI) - 2
                        $__SLIDE_aGUI[$j][0] = $__SLIDE_aGUI[$j + 1][0]
                        $__SLIDE_aGUI[$j][1] = $__SLIDE_aGUI[$j + 1][1]
                        $__SLIDE_aGUI[$j][2] = $__SLIDE_aGUI[$j + 1][2]
                        $__SLIDE_aGUI[$j][3] = $__SLIDE_aGUI[$j + 1][3]
                        $__SLIDE_aGUI[$j][4] = $__SLIDE_aGUI[$j + 1][4]
                        ReDim $__SLIDE_aGUI[UBound ( $__SLIDE_aGUI ) - 1][5]
                        _Slide_SlideIn ( $hWnd )
                        GUISetState ( @SW_HIDE, $hWnd )
                    Next
                EndIf
            Next
    EndSwitch
EndFunc ;==> _Slide_WinSetSlide ( )

Func _Slide_SlideSetOnHover ( $hWnd, $sMode = True )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    $iUbound = UBound ( $__SLIDE_aGUI )
    Switch $sMode
        Case True
            For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
                If $__SLIDE_aGUI[$i][0] = $hWnd Then
                    $__SLIDE_aGUI[$i][4] = True
                EndIf
            Next
        Case False
            For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
                If $__SLIDE_aGUI[$i][0] = $hWnd Then
                    $__SLIDE_aGUI[$i][4] = False
                EndIf
            Next
    EndSwitch
EndFunc ;==> _Slide_SlideSetOnHover ( )

Func _Slide_SlideOut ( $hWnd )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
        If $__SLIDE_aGUI[$i][0] = $hWnd Then
            If $__SLIDE_aGUI[$i][2] Then
                __Slide_WinSlide ( $hWnd, "out", $__SLIDE_aGUI[$i][1] )
                $__SLIDE_aGUI[$i][2] = False
                Return SetError ( 0, 0, 1 )
            Else
                Return SetError ( 3, 0, 0 )
            EndIf
        EndIf
    Next
    Return SetError ( 2, 0, 0 )
EndFunc ;==> _Slide_SlideOut ( )

Func _Slide_SlideIn ( $hWnd )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    If @error Then Return SetError ( 1, 0, 0 )
    For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
        If $__SLIDE_aGUI[$i][0] = $hWnd Then
            If Not $__SLIDE_aGUI[$i][2] Then
                __Slide_WinSlide ( $hWnd, "in", $__SLIDE_aGUI[$i][1] )
                $__SLIDE_aGUI[$i][2] = True
            Else
                Return SetError ( 3, 0, 0 )
            EndIf
        EndIf
    Next
    Return SetError ( 2, 0, 0 )
EndFunc ;==> _Slide_SlideIn ( )

Func __Slide_WinSlide ( $hWnd, $sMode, $sSide )
    Local $aScreen_Res = WinGetPos ( WinGetHandle ( "Program Manager" ) )
    Local $aWPos = WinGetPos ( $hWnd ), $m = 0 - ( $sMode = "in" ) + ( $sMode = "out" )
    Local $h = 0 - ( $sSide = "left" ) + ( $sSide = "right" ), $v = 0 - ( $sSide = "top" ) + ( $sSide = "bottom" )
    WinMove ( $hWnd, "", $aScreen_Res[0] - ( ( $h = -1 ) * ( $m = -1 ) * ( $aWPos[2] - 10 ) ) _
            + ( ( $h = 1 ) * ( ( $h = 1 ) * $aScreen_Res[2] - ( 10 * ( $m = -1 ) ) - ( $m <> -1 ) * $aWPos[2] ) ) _
            + ( ( $h = 0 ) * ( ( $h = 0 ) * ( $aScreen_Res[2] / 2 ) - ( $aWPos[2] / 2 ) ) ) _
            , $aScreen_Res[1] - ( ( $v = -1 ) * ( $m = -1 ) * ( $aWPos[3] - 10 ) ) _
            + ( ( $v = 1 ) * ( ( $v = 1 ) * $aScreen_Res[3] - ( 10 * ( $m = -1 ) ) - ( $m <> -1 ) * $aWPos[3] ) ) _
            + ( ( $v = 0 ) * ( ( $v = 0 ) * ( $aScreen_Res[3] / 2 ) - ($aWPos[3] / 2 ) ) ) )
    $aWPos = WinGetPos ( $hWnd )
    Switch $sSide
        Case "left", "right"
            Local $STEP = ( ( ( ( $h = 1 ) And ( $m = 1 ) ) Or ( ( $h = -1 ) And ( $m = -1 ) ) ) - ( ( ( $h = -1 ) And ( $m = 1 ) ) Or ( ( $h = 1 ) And ( $m = -1 ) ) ) ) * 10
            Local $FROM = $aWPos[0], $TO = $aWPos[0] + ( ( ( ( $h = 1 ) And ( $m = 1 ) ) Or ( ( $h = -1 ) And ( $m = -1 ) ) ) * ( $aWPos[2] ) ) _
                    - ( ( ( ( $h = 1 ) And ( $m = -1 ) ) Or ( ( $h = -1 ) And ( $m = 1 ) ) ) * ( $aWPos[2] ) ) - $STEP
            For $i = $aWPos[0] To $TO Step $STEP
                WinMove ( $hWnd, "", $i, $aWPos[1] )
                Sleep ( 10 )
            Next
        Case "top", "bottom"
            Local $STEP = ( ( ( ( $v = 1 ) And ( $m = 1 ) ) Or ( ( $v = -1 ) And ( $m = -1 ) ) ) - ( ( ( $v = -1 ) And ( $m = 1 ) ) Or ( ( $v = 1 ) And ( $m = -1 ) ) ) ) * 10
            Local $FROM = $aWPos[1], $TO = $aWPos[1] + ( ( ( ( $v = 1 ) And ( $m = 1 ) ) Or ( ( $v = -1 ) And ( $m = -1 ) ) ) * ( $aWPos[3] ) ) _
                    - ( ( ( ( $v = 1 ) And ( $m = -1 ) ) Or ( ( $v = -1 ) And ( $m = 1 ) ) ) * ( $aWPos[3] ) ) - $STEP              
            If $STEP > 0 Then $TO = $TO -25
            For $i = $aWPos[1] To $TO + 25 Step $STEP ; 
                WinMove ( $hWnd, "", $aWPos[0], $i )
                Sleep ( 10 )
            Next
    EndSwitch
EndFunc ;==> __Slide_WinSlide ( )

Func __Slide_CheckHover ( )
    For $i = 1 To UBound ( $__SLIDE_aGUI ) - 1
        If $__SLIDE_aGUI[$i][4] Then
            If Not $__SLIDE_aGUI[$i][3] Then
                If __Slide_WinIsHovered ( $__SLIDE_aGUI[$i][0] ) Then
                    If Not $__SLIDE_aGUI[$i][2] Then _Slide_SlideIn ( $__SLIDE_aGUI[$i][0] )
                Else
                    If $__SLIDE_aGUI[$i][2] Then _Slide_SlideOut ( $__SLIDE_aGUI[$i][0] )
                EndIf
            EndIf
        EndIf
    Next
EndFunc ;==> __Slide_CheckHover ( )

Func __Slide_UnloadDLL ( )
    DllClose ( $__SLIDE_hDLL )
EndFunc ;==> __Slide_UnloadDLL ( )

Func __Slide_WinIsHovered ( $hWnd, $vDLL = "User32.dll" )
    Local $aResult, $aWPos = WinGetPos ( $hWnd ) 
    If @error Then Return 
    Local $aMPos = MouseGetPos ( )
    If @error Then Return   
    Local $tRect = DllStructCreate ( "int Left;int Top;int Right;int Bottom" )
    Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
    Local $iX = $aMPos[0], $iY = $aMPos[1]
    DllStructSetData ( $tRect, "Left", $iLeft )
    DllStructSetData ( $tRect, "Top", $iTop )
    DllStructSetData ( $tRect, "Right", $iLeft + $iWidth )
    DllStructSetData ( $tRect, "Bottom", $iTop + $iHeight )
    $aResult = DllCall ( $vDLL, "int", "PtInRect", "ptr", DllStructGetPtr ( $tRect ), "int", $iX, "int", $iY )
    If @error Then Return SetError ( @error, 0, False )
    Return $aResult[0] <> 0
EndFunc ;==> __Slide_WinIsHovered ( )

It's more fun and fast ! 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

Am I doing something wrong?

About 80% of the songs play at such a low volume that I can't hear them. Is there a volume control in IE that I don't know about?

I normally only use Firefox, so IE is not setup for daily use.

Share this post


Link to post
Share on other sites

The version 4 is fantastic !!!

But "Listen selected song" don't run for me.

An idea ?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

The version 4 is fantastic !!!

But "Listen selected song" don't run for me.

An idea ?

Thanks a lot ! or "Merci beaucoup !" Posted Image

Have you disable Random mode before click on Listen Selected Song Button ? Posted Image

otherwise Button is greyed !

If random mode is disable you are in manual mode...

Voila voila !

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

#15 ·  Posted (edited)

Am I doing something wrong?

About 80% of the songs play at such a low volume that I can't hear them. Is there a volume control in IE that I don't know about?

I normally only use Firefox, so IE is not setup for daily use.

No, there is no volume control in IE, just in FlashPlayer embedded.

But yes, certain songs play at low volume, that's annoying ! Posted Image

Which version do you try ?

Otherwise looks your PC sound settings or take an amplifier...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

Thanks a lot ! or "Merci beaucoup !" Posted Image

Have you disable Random mode before click on Listen Selected Song Button ? Posted Image

otherwise Button is greyed !

If random mode is disable you are in manual mode...

Voila voila !

Je sais bien, mais ça ne marche pas pour moi. Il n'est même pas en random et reste souvent sur le même titre

I know, but that don't run well for me. it stay always on the same song's title

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Je sais bien, mais ça ne marche pas pour moi. Il n'est même pas en random et reste souvent sur le même titre

I know, but that don't run well for me. it stay always on the same song's title

While 1
    If $_RandomMode Then
        $_R = _Randomize ( $_LastUkTopChartsListArray[0] ) 
        _GUICtrlStatusBar_SetText ( $_StatusBar, ' Waiting for Next Song...', 0 )   
        $_YoutubeSearch = _YoutubeSearch ( $_LastUkTopChartsListArray[$_R] & ' official' )
        If StringInStr ( $_YoutubeSearch, 'http://www.youtube.com/watch?v' ) <> 0 Then 
            $_IE = _IECreate ( $_YoutubeSearch, 0, 0, 1 ) ; <====== Change 0, 0, 1 ) by 0, 1, 1 ) 
            $_DurationInit = TimerInit ( )
            $_DurationDiff=0

After this change, Run it, IE will be visible...and Look if it give you an error Message or Bug. 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

#18 ·  Posted (edited)

Thanks!

Cracked it. If you don't use IE, then before running this script, run IE, go to Youtube and set the volume to max, then close Youtube and IE.

It should remember your setting till you change them manually again.

Hope this helps anyone else.

p.s. Is it possible to set the hotkey and right arrow as variables at the top of the script as a few friends that use your script cant use ESCAPE or RIGHT ARROW so I had to scan through your script and change it manually.

p.p.s. The slide function, slides BEHIND the last window that was on top. Is it possible to have the slide window On Top, but the anchor window as it is now?

Edited by happy2help

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

While 1
    If $_RandomMode Then
        $_R = _Randomize ( $_LastUkTopChartsListArray[0] ) 
        _GUICtrlStatusBar_SetText ( $_StatusBar, ' Waiting for Next Song...', 0 )   
        $_YoutubeSearch = _YoutubeSearch ( $_LastUkTopChartsListArray[$_R] & ' official' )
        If StringInStr ( $_YoutubeSearch, 'http://www.youtube.com/watch?v' ) <> 0 Then 
            $_IE = _IECreate ( $_YoutubeSearch, 0, 0, 1 ) ; <====== Change 0, 0, 1 ) by 0, 1, 1 ) 
            $_DurationInit = TimerInit ( )
            $_DurationDiff=0

After this change, Run it, IE will be visible...and Look if it give you an error Message or Bug. Posted Image

I obtain that:

--> IE.au3 V2.4-0 Error from function _IEQuit, $_IEStatus_InvalidDataType

I am not certain to have the same version that you have (0.4)

I have that for the line that you speak about:

While 1
    If $_Auto Then
        $_R = _Randomize ( $_LastUkTopChartsListArray[0] )
        _GUICtrlStatusBar_SetText ( $_StatusBar, ' Waiting for Next Song...', 0 )
        $_YoutubeSearch = _YoutubeSearch ( $_LastUkTopChartsListArray[$_R] & ' official' )
        If StringInStr ( $_YoutubeSearch, 'http://www.youtube.com/watch?v' ) <> 0 Then
            $_IE = _IECreate ( $_YoutubeSearch, 0, 1, 1 )
            $_DurationInit = TimerInit ( )
            $_DurationDiff=0

My variable is $_Auto and your is $_RandomMode

Edited by pierrotm777

Share this post


Link to post
Share on other sites

Thanks!

Cracked it. If you don't use IE, then before running this script, run IE, go to Youtube and set the volume to max, then close Youtube and IE.

It should remember your setting till you change them manually again.

Hope this helps anyone else.

p.s. Is it possible to set the hotkey and right arrow as variables at the top of the script as a few friends that use your script cant use ESCAPE or RIGHT ARROW so I had to scan through your script and change it manually.

p.p.s. The slide function, slides BEHIND the last window that was on top. Is it possible to have the slide window On Top, but the anchor window as it is now?

Yes you can modify hotkey like you want ! Posted Image

But i don't understand your slide question, if you want the window always on top, replace

GUICreate ( $_GuiTitle, ..... BitOR ( $WS_EX_LAYERED, $WS_EX_TOOLWINDOW ) by

GUICreate ( $_GuiTitle, ..... BitOR ( $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW )

I had removed this OnTop attribute because it was annoying for tabbed browsing

So now gui is set one time ( one sec ) on top after a new song but doesn't keep this attribute.

I don't know if it help you ? 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

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

    • FengHuangWuShen
      By FengHuangWuShen
      So I was playing with INet and downloading files and made a simple video downloader, or it can even be used for any file really.
      Just follow the reference section in INet_Settings.ini , and then run the script.
       
      Main Script #include <INet.au3> #include <InetConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <String.au3> OnAutoItExitRegister('INET_CLOSE') $GET_URL = _INetGetSource(IniRead(@ScriptDir & '\Inet_Settings.ini', 'Request', 'Url', Default)) $STRING_START = IniRead(@ScriptDir & '\Inet_Settings.ini', 'Data', 'Start', Default) $STRING_END = IniRead(@ScriptDir & '\Inet_Settings.ini', 'Data', 'End', Default) $GET_STRING = _StringBetween ($GET_URL, $STRING_START, $STRING_END) $VIDEO_URL = _ArrayToString($GET_STRING) $VIDEO = _URIDecode($VIDEO_URL) If StringLen($VIDEO) > 0 Then Local $VIDEO_DIR = (@ScriptDir & '\' & Random(1, 65535) & '.mp4') Local $DOWNLOAD_VIDEO = InetGet($VIDEO, $VIDEO_DIR, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Do Sleep(IniRead(@ScriptDir & '\Inet_Settings.ini', 'Settings', 'Delay', Default)) Until InetGetInfo($DOWNLOAD_VIDEO, $INET_DOWNLOADCOMPLETE) InetClose($DOWNLOAD_VIDEO) Else MsgBox(0, 'DEBUG', "Video doesn't exist") EndIf Func INET_CLOSE() InetClose($DOWNLOAD_VIDEO) EndFunc Func _URIEncode($sData) ; Prog@ndy Local $aData = StringSplit(BinaryToString(StringToBinary($sData,4),1),"") Local $nChar $sData="" For $i = 1 To $aData[0] ; ConsoleWrite($aData[$i] & @CRLF) $nChar = Asc($aData[$i]) Switch $nChar Case 45, 46, 48 To 57, 65 To 90, 95, 97 To 122, 126 $sData &= $aData[$i] Case 32 $sData &= "+" Case Else $sData &= "%" & Hex($nChar,2) EndSwitch Next Return $sData EndFunc Func _URIDecode($sData) ; Prog@ndy Local $aData = StringSplit(StringReplace($sData,"+"," ",0,1),"%") $sData = "" For $i = 2 To $aData[0] $aData[1] &= Chr(Dec(StringLeft($aData[$i],2))) & StringTrimLeft($aData[$i],2) Next Return BinaryToString(StringToBinary($aData[1],1),4) EndFunc  
      INet_Settings.ini  URL - The target URL of the video you're trying to grab Data - This is the starting string, and ending string reference to look for the download URL itself. Settings - Only setting here currently, is the delay in which to wait for the file to download ### Reference for Start and End points for various websites [Request] Url = https://www.facebook.com/lindseystirlingmusic/videos/1527732263925622/ [Data] Start = hd_src_no_ratelimit:" End = " [Settings] Delay = 250 ################################################################################################### Instagram : https://www.instagram.com/p/Video ID Or : https://www.instagram.com/p/Video ID/?taken-by=User ID Start = video:secure_url" content=" End = " Facebook : https://www.facebook.com/User ID/videos/Video ID/ Or : Right click on the video and copy URL Start = hd_src_no_ratelimit:" End = " Start = sd_src_no_ratelimit:" End = " ###################################################################################################  
      Credits to : https://www.autoitscript.com/forum/profile/31965-progandy/  for the URL Encode and Decode.
    • wakillon
      By wakillon
      I love chiptune music, but BASS only support XM, IT, S3M, MOD, MTM, UMX and MO3 file format for MOD music.
       
      1 | Nintendo NES and SNES Sound File Players
      May be you already have some files with extension nsf, nsfe, spc or rsn (unzip rsn files for get spc collection files inside) but you can't play them in a AutoIt script ?
      So I searched around a bit, and found 2 DLL ( nsf_player.dll and spc_player.dll ) for play Nintendo NES and SNES Sound Files.
      Interest of those DLL is that they can play from file path or binary data, avoiding temp files.
      Dll and audio files are embedded in scripts for permit you to test them right away.
      Some info/download links are in front of each script.
       
      2 | ModPlug Player
      Another dll found : npmod32.dll who support mod, s3m, xm, med, it, s3z, mdz, itz, xmz and wav files.
      Interest : it can play some rares chiptune formats, you can also pause, set volume and set position.
      Inconvenient : do not load from binary datas.
      Dll and audio files are embedded in script and i have added a gui for permit you to try right away !
      Warning : Do not work on Win8.
       
      3 | ZXTune Player 2 (basszxtune.dll v2.4.5) UPDATE of 23 DEC 2016
      Using BASSZXTUNE chiptune support for BASS ( Support  as0, asc, ay, ftc, gtr, psc, psg, psm, pt1, pt2, pt3, sqt, st1, s, st3, stc, stp, ts, txt, vtx, ym, chi, dmm, dst, m, sqd, str, sid, cop, tf0, tfc, tfd, tfe, $b, $m, ahx, ayc, bin, cc3, d, dsq, esv, fdi, gam, gamplus, gbs, gym, hes, hrm, hrp, lzs, msp, mtc, nsf, nsfe, p, pcd, sap, scl, spc, szx, td0, tlz, tlzp, trd, trs, vgm )
      Interest : it can play lot of rares chiptune formats, while benefiting from all bass functions.
      Inconvenient : dll size.(5860ko)
      Dll and audio files are embedded in script.
       
      4 | TitchySID Player 
      Files and dll are loaded in memory.
      Interest : dll size (8ko), you can Play/Stop/Pause/Resume and choose which subsong to play.
      Inconvenient : only SID audio files supported ( PSID & RSID)
      Dll and audio files are embedded in script.
      Tested under Win7 and Win8.
      Edit : added a Sid header viewer : SidHeaderViewer.au3
       
      5 | MiniFmod Player
      Interest : dll size (20ko)
      Inconvenient : only xm audio files supported.
       
      6 | Npnez Player 
      Using npnez.dll (88ko) for play Gameboy Sound System audio files and some others ( kss, hes, nsf, ay, gbr, gbs, gb, nsd, sgc )
      Interest : Can be loaded in memory, subsong can be set and volume can be adjusted ( perfect for create a fade when exiting ) 
      Inconvenient : for an unknow reason, only 20% of my hes collection is playable...
       
      7 | µFMOD Player 
      Interest : dll size (10ko), can be loaded in memory, support Play/Stop/Pause/Resume actions and volume can be adjusted ( perfect for create a fade when exiting ) 
      Inconvenient : only xm audio files supported.
       
      8 | MagicV2m Player 
      Interest : dll size (20ko), Play/Stop/IsPlay/SetAutoRepeat/Progress
      Inconvenient : only v2m audio files supported, V2mPlayStream is not reliable, so prefer V2mPlayFile instead.
       
      9 | OSMEngine Player 
      OSMEngine.dll (80 ko)(Oldskool Musics Engine) permit to play snd, sndh, fc, fc4, fc14 and some rare jam audio files from Amiga/Atari ST(E)
      Interest : audio can be loaded in memory, and Pause/Resume/SetVolume/GetInfos are available
      Inconvenient : none at the moment. 
       
      10 | Ayfly Player
      Ayfly.dll (268 ko) is a AY-891x emulator and player who support
      the following tracker formats : aqt, asc, ay, fxm, gtr, psc, psg, pt1, pt2, pt3, sqt, stc, stp, vtx, ym and zxs (ZX Spectrum Emulator Snapshot) files.
      Interest : SetVolume/GetInfos are available
      Inconvenient : a function named "ay_initsongindirect" for load module in memory exists, but due to the poor documentation provided i do not succeed to get it to work...
       
      11 | GMGME Player
      GMGME.dll is a emulated music DLL that allows you to play ay, gbs, gym, hes, kss, nsf/nsfe, sap, spc and vgm files.
      Interest : Can play ATARI SAP files (only type B and C) , Set Volume and Set Tempo are available
      Inconvenient : Dll Size (and his imports) , and audio files can not be loaded in memory.
       
      12 | SC68 Player
      sc68replay.dll (166 ko) is a Freebasic DLL compiled from "sc68replay" src that allows you to play SC68  (Atari ST and Amiga audio formats)  files.
      Interest : Can play from file and memory
      Inconvenient : Unfortunatelly for an unknown reason not all sc68 files are supported.
       
      13 | Extended Module Player
      LibXmp.dll  (272 ko)  can "read" xm, mod, it, s3m, med, 669 but also some rares formats
      abk, amd, amf, dbm, digi, dtm, emod, far, flx, fnk, gdm, hsc, imf, j2b, liq, m15, mdl, mfp, mgt, mtm, mtn, okt, psm, ptm, rad, rtm, sfx, smp, stim, stm, stx, ult, umx, wow, ym3812
      Despite its name, it's not a "player" but a library that renders module files to RAW PCM data.
      So the interest in this script was to find a way to convert those raw datas into a "playable" sound.
      With Waveform Audio Interface i create a pseudo Wav header who permit to play datas as a Wav file.
      Interest : Can play from file and memory
      Inconvenient : Time to render datas (depends of file size)
       
      14 | LibModPlug Player
      LibModPlug.dll (102 ko)  can "read" xm, it, mod, s3m, med, 669 and also amf, ams, dbm, dmf, dsm, far, j2b, mdl, mt2, mtm, okt, psm, ptm, stm, ult, umx.
      As LibXmp.dll, it's a library that renders module files to RAW PCM data.
      For this one, i create a real binary wave header for be able to play it easily from memory with winmm.dll PlaySoundW function.
      Interests : Can play from file and memory, and have some nice sound effects : Surround, MegaBass and Reverb  (used in script example)
      It can also replace modplug player(2) for Win 8+ users
      Inconvenient : Time to render datas (depends of file size)
       
      15 | AdPlug Player
      AdPlug.dll ( 69ko ) is an AdLib sound player library who is able to play the following files type :  A2M, ADL, AMD, BAM, CFF, CMF, D00, DFM, DMO, DRO, DTM, HSC, HSP, IMF, KSM, LAA, LDS, M, MAD, MID, MKJ, MSC, MTK, RAD, RAW, RIX, ROL, S3M, SA2, SAT, SCI, SNG, XAD, XMS, XSM
      For this one, time to render datas is to long, so i needed to find an other way for play modules.
      Using Bass.dll and particulary the "BASS_StreamPutData" function i succeeded to play module in loop while rendering it.
      Both DLL are loaded in memory, and 16 different module types are available in the script. No includes/files needed. Just run it.
      Warning : for a unique file extension (example .sng), it's sometimes possible to have several filetypes from different trackers !
      AdPlug.dll Imports : msvcp71.dll, msvcr71.dll in C:\Windows\SysWOW64  ( VC Redist Installer )
      Interests : Can read some obscure rare formats.
      Inconvenient : Can not read from memory
       
      16 | LibMikmod Player
      LibMikmod.dll (85ko) will currently play the following common and not so common  formats : 669, AMF, DSM, FAR, GDM, IMF, IT, MED, MOD, MTM, S3M, STM, STX, ULT, UNI, XM  
      Interests : Can load from memory
      Inconvenient : only for full-screen applications, because if the application has not the focus sound is muted
       
       
      Downloads are available in the download section
      Dedicated to chiptune Lovers ! 
      Music Links : 
      asma.atari.org  woolyss.com  chipmusic.org  demozoo.org  modarchive.org  modules.pl  keygenmusic.net  zxtunes.com  mazemod.org  amigaremix.com  pouet.net  plopbox.eu  Modland
    • UEZ
      By UEZ
      A FMOD UDF to play music whereas the DLL calls are done from memory.
      Supported formats:
      - .MOD (protracker/fasttracker modules) - .S3M (screamtracker 3 modules) - .XM (fasttracker 2 modules) - .IT (impulse tracker modules) - .MID (MIDI files) - .RMI (MIDI files) - .SGT (DirectMusic segment files) - .FSB (FMOD Sample Bank files) - .MP3 - .OGG - .WAV - .MP2 - .RAW  
      Click the forum URL to the right for more information.
    • UEZ
      By UEZ
      Hi,
      I created a FMOD UDF whereas the DLL calls are done from memory.
      Credits to trancexx for the Subrogation functions!
       
      Supported formats:
      - .MOD (protracker/fasttracker modules) - .S3M (screamtracker 3 modules) - .XM (fasttracker 2 modules) - .IT (impulse tracker modules) - .MID (MIDI files) - .RMI (MIDI files) - .SGT (DirectMusic segment files) - .FSB (FMOD Sample Bank files) - .MP3 - .OGG - .WAV - .MP2 - .RAW  
      Current added function list (sum = 70):
      FMUSICMEM_FreeSong FMUSICMEM_GetBPM FMUSICMEM_GetGlobalVolume FMUSICMEM_GetMasterVolume FMUSICMEM_GetName FMUSICMEM_GetNumChannels FMUSICMEM_GetNumInstruments FMUSICMEM_GetNumOrders FMUSICMEM_GetNumPatterns FMUSICMEM_GetNumSamples FMUSICMEM_GetOrder FMUSICMEM_GetPaused FMUSICMEM_GetRow FMUSICMEM_GetSpeed FMUSICMEM_GetTime FMUSICMEM_GetType FMUSICMEM_IsFinished FMUSICMEM_LoadSong FMUSICMEM_LoadSongEx FMUSICMEM_OptimizeChannels FMUSICMEM_PlaySong FMUSICMEM_SetMasterVolume FMUSICMEM_SetOrder FMUSICMEM_SetPaused FMUSICMEM_StopAllSongs FMUSICMEM_StopSong FSOUNDMEM_Close FSOUNDMEM_DSP_Create FSOUNDMEM_DSP_Free FSOUNDMEM_DSP_GetActive FSOUNDMEM_DSP_GetFFTUnit FSOUNDMEM_DSP_GetSpectrum FSOUNDMEM_DSP_SetActive FSOUNDMEM_DSP_SetPriority FSOUNDMEM_GetAmplitude FSOUNDMEM_GetChannelsPlaying FSOUNDMEM_GetCPUUsage FSOUNDMEM_GetCurrentLevels FSOUNDMEM_GetError FSOUNDMEM_GetFrequency FSOUNDMEM_GetGetSurround FSOUNDMEM_GetMaxChannels FSOUNDMEM_GetPan FSOUNDMEM_GetPaused FSOUNDMEM_GetVolume FSOUNDMEM_Init FSOUNDMEM_SetPaused FSOUNDMEM_SetSpeakerMode FSOUNDMEM_SetSurround FSOUNDMEM_SetVolume FSOUNDMEM_SetVolumeAbsolute FSOUNDMEM_Stream_Close FSOUNDMEM_Stream_FindTagField FSOUNDMEM_Stream_GetLength FSOUNDMEM_Stream_GetLengthMs FSOUNDMEM_Stream_GetNumTagFields FSOUNDMEM_Stream_GetOpenState FSOUNDMEM_Stream_GetPosition FSOUNDMEM_Stream_GetTagField FSOUNDMEM_Stream_GetTime FSOUNDMEM_Stream_Net_GetStatus FSOUNDMEM_Stream_Net_SetMetadataCallback FSOUNDMEM_Stream_Net_SetProxy FSOUNDMEM_Stream_Open FSOUNDMEM_Stream_Play FSOUNDMEM_Stream_PlayEx FSOUNDMEM_Stream_SetLoopCount FSOUNDMEM_Stream_SetPosition FSOUNDMEM_Stream_SetTime FSOUNDMEM_Stream_Stop  
      In the zip archive you can find 6 examples.
       
      Download at download section: 
       
      If you have created additional examples, feel free to post it here.
    • pinkfoyd
      By pinkfoyd
      Hi all,
       
      For my work, i need to produce automatically chart that i will include in my morning email.
       
      First I tried the graph function of powershell with Microsoft Chart Controls , very nice looking, with help of this script : https://gallery.technet.microsoft.com/Drawing-charts-with-6ab5de4e#content
      BUT is useless as i can't sort data in graph ( object array is ***** in powershell, order is random )
       
      So trying back with autoit.
      After lot of forum research :
       
      RMChart : not working Another script not working, or working but only in autoit GUI ( or can't find the good topic ) Chart.udf : nice but not in GDI so can't produce image ImageMagick : possible but very hard to code the entire line can't use excel, because can't install it on the production server.
       
       
      In a perfect world i would produce this :

       
      But simplest will be fine too :

       
       
      Do you know an another solution, any help would be greatly appreciated.