Sign in to follow this  
Followers 0
Dampe

XM music

2 posts in this topic

I've dug up an old topic, and I'm trying to accomplish what was done.

http://www.autoitscript.com/forum/lofivers...php?t23109.html

Everytime I run this:

#include <GUIConstants.au3>

Dim $music_handle = -1
$bassdll = DllOpen("bass.dll")
$ret = DllCall($bassdll, "int", "BASS_Init", "int", -1, _
                                             "int", 44100, _
                                             "int", 0, _
                                             "hwnd", 0, _
                                             "ptr", 0)
If not $ret[0] then
    MsgBox(0, "Error", 'Error initializing audio!');
    Exit
Endif   

$GUI = GUICreate("Simplest BASS player :)", 310, 77, 192, 125)
$Input1 = GUICtrlCreateInput("", 8, 8, 265, 21)
$Button1 = GUICtrlCreateButton("...", 272, 8, 27, 22, 0)
$Button2 = GUICtrlCreateButton("|>", 8, 40, 27, 25, 0)
$Button3 = GUICtrlCreateButton("||", 40, 40, 27, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button1
        $sPath = FileOpenDialog ( "asd", @ScriptDir, "Tracker music (*.xm;*.mod;*.s3m;*.it;*.mtm;*.mo3)|All files (*.*)")
        If not ($sPath = "") Then
            GUICtrlSetData($Input1, $sPath)
            $fName = DllStructCreate("char[255]")
            DllStructSetData($fName, 1, $sPath)
            $ret = DllCall($bassdll, "int", "BASS_MusicLoad", "int", false, _
                                                    "ptr", DllStructGetPtr($fName), _
                                                    "int", 0, _
                                                    "int", 0, _
                                                    "int", 0x200, _
                                                    "int", 0)
            $music_handle = $ret[0]
            $fName = 0
        Endif
    Case $msg = $Button2        
        DllCall($bassdll, "int", "BASS_ChannelPlay", "int", $music_handle, "int", 0)
    Case $msg = $Button3
        DllCall($bassdll, "int", "BASS_ChannelStop", "int", $music_handle)
    EndSelect
WEnd

Func OnAutoItExit ( )
    DllCall($bassdll, "int", "BASS_MusicFree", "int", $music_handle)
    DllClose($bassdll)
EndFunc

AutoIt3.exe crashes..

Anyone got an idea?


Share this post


Link to post
Share on other sites



;           $ret = DllCall($bassdll, "int", "BASS_MusicLoad", "int", false, _
;                                                   "ptr", DllStructGetPtr($fName), _
;                                                   "int", 0, _
;                                                   "int", 0, _
;                                                   "int", 0x200, _
;                                                   "int", 0)
$ret = DllCall($bassdll, "int", "BASS_MusicLoad", "int", False, "ptr", DllStructGetPtr($fName), "uint64", 0, "dword", 0, "dword", 0x200, "dword", 0)

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