Hilfe bei Lautstärke slider

  • Hi das hier ist mein script für den ich eine lautstärke regulierung per slider brauche. Wieseo funktionert es noch nicht?

    Spoiler anzeigen
    [autoit]

    #include <StructureConstants.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <SliderConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ProgressConstants.au3>
    #include <Security.au3>
    #include <Memory.au3>
    #include <UDFGlobalID.au3>
    #include <GuiStatusBar.au3>
    #include <GUIEdit.au3>
    #include-once
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <Constants.au3>
    #include <GUIEdit.au3>
    #include <GuiToolbar.au3>
    #include <inet.au3>
    #include <array.au3>
    #include <ie.au3>

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("CheckMouse")

    [/autoit] [autoit][/autoit] [autoit]

    $oWMP = ObjCreate("WMPLayer.ocx")
    $GUI = GUICreate("BlackEyes Stream Player", 498, 357, 238, 172)
    $Pic1 = GUICtrlCreatePic("C:\Users\Tobias\Desktop\Schwarzer-hintergrund.jpg", 0, 0, 497, 353, BitOR($WS_GROUP,$WS_CLIPSIBLINGS))
    $Combo1 = GUICtrlCreateCombo("Bitte auswählen", 144, 112, 209, 25)
    GUICtrlSetData(-1,"TechnoBase.FM|Top100Station|Planet Radio|YouFM|BigFM|89.0 RTL","Bitte auswählen")
    $Label1 = GUICtrlCreateLabel("Radio Streams", 144, 88, 94, 20)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $Button1 = GUICtrlCreateButton("Play", 24, 304, 193, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("Stop", 280, 304, 193, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState($Button2, $GUI_DISABLE)
    $Progress1 = GUICtrlCreateProgress(8, 8, 33, 265, $PBS_VERTICAL)
    $Volume = GUICtrlCreateSlider(448, 8, 33, 265, BitOR($TBS_AUTOTICKS,$TBS_VERT))
    GUICtrlSetData(-1, $oWMP.settings.volume())
    GUICtrlSetState($Volume, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $readcombo1 = GUICtrlRead($Combo1)
    $oWMP.controls.play()
    GUICtrlSetData($Progress1, 100)
    $oWMP.settings.volume = 50
    GUICtrlSetState($Volume, $GUI_ENABLE)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetState($Button2, $GUI_ENABLE)
    GUICtrlSetState($Combo1, $GUI_DISABLE)
    Case $Button2
    $oWMP.controls.stop()
    GUICtrlSetState($Volume, $GUI_DISABLE)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    GUICtrlSetState($Button2, $GUI_DISABLE)
    GUICtrlSetState($Combo1, $GUI_ENABLE)
    $oWMP.settings.volume = 100 - GUICtrlRead($Volume)
    Select
    Case $readcombo1 = "TechnoBase.FM"
    $oWMP.URL = 'http://listen.technobase.fm/tunein-dsl-asx'
    Case $readcombo1 = "Top100Station"
    $oWMP.URL = 'http://www.top100station.de/switch/r3472.asx'
    Case $readcombo1 = "Planet Radio"
    $oWMP.URL = 'http://lsd.newmedia.nacamar.net/bb/redirect.lsc?stream=planetradio$livestream.mp3&content=live&media=mp3'
    Case $readcombo1 = "YouFM"
    $oWMP.URL = 'http://metafiles.gl-systemhaus.de/hr/youfm_1.asx'
    Case $readcombo1 = "BigFM"
    $oWMP.URL = 'http://217.151.152.245/bigfm-mp3-96'
    Case $readcombo1 = "89.0 RTL"
    $oWMP.URL = 'http://www.89.0rtl.de/webradio/rtl-high.m3u'
    EndSelect
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func CheckMouse()
    Local Static $mouseout=0
    $aMpos = MouseGetPos()
    $aWpos = WinGetPos("BlackEyes Stream Player")
    If $aMpos[0] > $aWpos[0] And $aMpos[0] < $aWpos[0] + $aWpos[2] And $aMpos[1] > $aWpos[1] And $aMpos[1] < $aWpos[1] + $aWpos[3] Then
    If $mouseout = 1 Then
    For $i=30 to 255 Step 30
    WinSetTrans("BlackEyes Stream Player", "", $i)
    sleep(50)
    Next
    WinSetTrans("BlackEyes Stream Player", "", 255)
    $mouseout=0
    EndIf
    Else
    If $mouseout=0 Then
    For $i=255 to 30 Step -30
    WinSetTrans("BlackEyes Stream Player", "", $i)
    sleep(50)
    Next
    $mouseout=1
    EndIf
    EndIf
    EndFunc

    [/autoit]

    Habt ihr vielleicht noch andere vorschläge zur verbesserung??? ?(

    Einmal editiert, zuletzt von Molaynox (3. Oktober 2010 um 10:49)

  • damit die lautstärke sich auch ändert musst du das ganze in die while machen
    so wird der befehl

    [autoit]

    $oWMP.settings.volume = 100 - GUICtrlRead($Volume)

    [/autoit]


    nur ausgeführt wenn $Button2 gedrückt wird
    setzt die zeile einfach nach dem switch rein
    auserdem kannste das

    [autoit]

    Select
    Case $readcombo1 = "TechnoBase.FM"
    $oWMP.URL = 'http://listen.technobase.fm/tunein-dsl-asx'
    Case $readcombo1 = "Top100Station"
    $oWMP.URL = 'http://www.top100station.de/switch/r3472.asx'
    Case $readcombo1 = "Planet Radio"
    $oWMP.URL = 'http://lsd.newmedia.nacamar.net/bb/redirect.lsc?stream=planetradio$livestream.mp3&content=live&media=mp3'
    Case $readcombo1 = "YouFM"
    $oWMP.URL = 'http://metafiles.gl-systemhaus.de/hr/youfm_1.asx'
    Case $readcombo1 = "BigFM"
    $oWMP.URL = 'http://217.151.152.245/bigfm-mp3-96'
    Case $readcombo1 = "89.0 RTL"
    $oWMP.URL = 'http://www.89.0rtl.de/webradio/rtl-high.m3u'
    EndSelect

    [/autoit]


    auch mit nem switch machen
    und was mir noch so auffällt das der select-code oben im case vom stop button is
    also darum musst du erst play dan stop und dan nochma play drücken damit du musik hörst

  • Hi!

    So!

    Spoiler anzeigen
    [autoit]

    #include <StructureConstants.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <SliderConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ProgressConstants.au3>
    #include <Security.au3>
    #include <Memory.au3>
    #include <UDFGlobalID.au3>
    #include <GuiStatusBar.au3>
    #include <GUIEdit.au3>
    #include-once
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <Constants.au3>
    #include <GUIEdit.au3>
    #include <GuiToolbar.au3>
    #include <inet.au3>
    #include <array.au3>
    #include <ie.au3>

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("CheckMouse")

    [/autoit] [autoit][/autoit] [autoit]

    $oWMP = ObjCreate("WMPLayer.ocx")
    $GUI = GUICreate("BlackEyes Stream Player", 498, 357, 238, 172)
    $Pic1 = GUICtrlCreatePic("C:\Users\Tobias\Desktop\Schwarzer-hintergrund.jpg", 0, 0, 497, 353, BitOR($WS_GROUP, $WS_CLIPSIBLINGS))
    $Combo1 = GUICtrlCreateCombo("Bitte auswählen", 144, 112, 209, 25)
    GUICtrlSetData(-1, "TechnoBase.FM|Top100Station|Planet Radio|YouFM|BigFM|89.0 RTL", "Bitte auswählen")
    $Label1 = GUICtrlCreateLabel("Radio Streams", 144, 88, 94, 20)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    $Button1 = GUICtrlCreateButton("Play", 24, 304, 193, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    $Button2 = GUICtrlCreateButton("Stop", 280, 304, 193, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUICtrlSetState($Button2, $GUI_DISABLE)
    $Progress1 = GUICtrlCreateProgress(8, 8, 33, 265, $PBS_VERTICAL)
    $Volume = GUICtrlCreateSlider(448, 8, 33, 265, BitOR($TBS_AUTOTICKS, $TBS_VERT))
    GUICtrlSetData(-1, $oWMP.settings.volume())
    GUICtrlSetState($Volume, $GUI_DISABLE)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $readcombo1 = GUICtrlRead($Combo1)
    Select
    Case $readcombo1 = "TechnoBase.FM"
    $oWMP.URL = 'http://listen.technobase.fm/tunein-dsl-asx'
    Case $readcombo1 = "Top100Station"
    $oWMP.URL = 'http://www.top100station.de/switch/r3472.asx'
    Case $readcombo1 = "Planet Radio"
    $oWMP.URL = 'http://lsd.newmedia.nacamar.net/bb/redirect.lsc?stream=planetradio$livestream.mp3&content=live&media=mp3'
    Case $readcombo1 = "YouFM"
    $oWMP.URL = 'http://metafiles.gl-systemhaus.de/hr/youfm_1.asx'
    Case $readcombo1 = "BigFM"
    $oWMP.URL = 'http://217.151.152.245/bigfm-mp3-96'
    Case $readcombo1 = "89.0 RTL"
    $oWMP.URL = 'http://www.89.0rtl.de/webradio/rtl-high.m3u'
    EndSelect
    $oWMP.controls.play()
    GUICtrlSetData($Progress1, 100)
    $oWMP.settings.volume = 50
    GUICtrlSetState($Volume, $GUI_ENABLE)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetState($Button2, $GUI_ENABLE)
    GUICtrlSetState($Combo1, $GUI_DISABLE)
    Case $Button2
    $oWMP.controls.stop()
    GUICtrlSetState($Volume, $GUI_DISABLE)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    GUICtrlSetState($Button2, $GUI_DISABLE)
    GUICtrlSetState($Combo1, $GUI_ENABLE)
    Case $Volume
    $oWMP.settings.volume = 100 - GUICtrlRead($Volume)
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func CheckMouse()
    Local Static $mouseout = 0
    $aMpos = MouseGetPos()
    $aWpos = WinGetPos("BlackEyes Stream Player")
    If $aMpos[0] > $aWpos[0] And $aMpos[0] < $aWpos[0] + $aWpos[2] And $aMpos[1] > $aWpos[1] And $aMpos[1] < $aWpos[1] + $aWpos[3] Then
    If $mouseout = 1 Then
    For $i = 30 To 255 Step 30
    WinSetTrans("BlackEyes Stream Player", "", $i)
    Sleep(50)
    Next
    WinSetTrans("BlackEyes Stream Player", "", 255)
    $mouseout = 0
    EndIf
    Else
    If $mouseout = 0 Then
    For $i = 255 To 30 Step -30
    WinSetTrans("BlackEyes Stream Player", "", $i)
    Sleep(50)
    Next
    $mouseout = 1
    EndIf
    EndIf
    EndFunc ;==>CheckMouse

    [/autoit]

    LG Kleiner

  • und was mir noch so auffällt das der select-code oben im case vom stop button is
    also darum musst du erst play dan stop und dan nochma play drücken damit du musik hörst

    Vielen Dank das du mich darauf hingewiesen hast hab ich nämlich nicht bemerkt. jetzt funktioniert alles Vielen Dank. :rock:

  • Du hast ja fast mehr Includes als Code an sich ?

    Oder ist das nur ein Teil deines Codes?

    Meine Projekte :

    Taschenrechner [X]
    JamLegend Auto-Player [Canceld]
    Launcher [X]
    Multi-Game-Quest-Viewer [Canceld]


    [autoit]

    If $goffy or not $brain Then $DeleteInetCable

    [/autoit]