Hey zusammem.
also ich hab bis jetzt einen eigenen kleinen player gemacht (test-version)
Spoiler anzeigen
include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Sound.au3>
FileInstall('mussik.jpg', @TempDir&"\mussik.jpg")
opt("guioneventmode",1)
$Form1 = GUICreate("doPe's Player", 596, 469, 317, 144)
GUISetBkColor(0x000000)
$Pic1 = GUICtrlCreatePic(@TempDir&"\mussik.jpg", 0, 56, 572, 244, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Button1 = GUICtrlCreateButton("Song beenden",16, 328, 131, 41)
GUICtrlSetOnEvent(-1,"stop")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
$Button2 = GUICtrlCreateButton("Play", 16, 392, 131, 41)
GUICtrlSetOnEvent(-1,"Play")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
$Button3 = GUICtrlCreateButton("Pause", 160, 360, 131, 41)
GUICtrlSetOnEvent(-1,"Pause")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
$Button4 = GUICtrlCreateButton("Weiter", 368, 360, 131, 41)
GUICtrlSetOnEvent(-1,"Resume")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
$Label1 = GUICtrlCreateLabel("Player by dope³", 8, 8, 388, 33)
GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
GUICtrlSetColor(-1, 0xFF0000)
guisetonevent($GUI_EVENT_CLOSE,"_exit")
GUICtrlSetState($Button1, $GUI_DISABLE)
GUICtrlSetState($Button3, $GUI_DISABLE)
GUICtrlSetState($Button4, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
WEnd
func play()
$choosefile=fileopendialog("Choose a sound","C:\Users\" & @username & "\Music","Musik(*.mp3)",1+4)
global $sound=_soundopen($choosefile)
global $play=_SoundPlay($sound)
GUICtrlSetState($Button3, $GUI_Enable)
GUICtrlSetState($Button1, $GUI_Enable)
endfunc
func stop()
_soundstop($sound)
GUICtrlSetState($Button3, $GUI_DISABLE)
GUICtrlSetState($Button4, $GUI_DISABLE)
GUICtrlSetState($Button1, $GUI_DISABLE)
EndFunc
func _exit()
_soundclose($sound)
exit
endfunc
func resume()
_soundresume($sound)
GUICtrlSetState($Button3, $GUI_enable)
GUICtrlSetState($Button4, $GUI_DISABLE)
EndFunc
func pause()
_SoundPause($sound)
GUICtrlSetState($Button4, $GUI_Enable)
GUICtrlSetState($Button3, $GUI_DISABLE)
endfunc
so und darin wollte ich nun so eine visulation dirn haben .
so wie diese visulation
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <GDIplus.au3>
#include <WindowsConstants.au3>
#include "Bass.au3"
$bass_dll = DllOpen(@ScriptDir & "\BASS.dll")
Global Const $width = 200
Global Const $height = 230
Global $title = "doPs's Player"
$file = FileOpenDialog("Open...", "", "MP3 Files (*.mp3)");
_BASS_Init($bass_dll, 0, -1, 44100, 0, "")
$MusicHandle = _BASS_StreamCreateFile($bass_dll, False, $file, 0, 0, 0)
If @error Then
MsgBox(0, "Error", "Could not load audio file" & @CR & "Error = " & @error)
Exit
EndIf
Opt("GUIOnEventMode", 1)
$hwnd = GUICreate($title, $width, $height, -1, -1, Default, $WS_EX_TOOLWINDOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "close")
GUISetState()
_GDIPlus_Startup()
$graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
$bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
$backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
_GDIPlus_GraphicsClear($backbuffer)
$pen1_size = 4
$pen1 = _GDIPlus_PenCreate(0, $pen1_size)
$pen2_size = 4
$pen2 = _GDIPlus_PenCreate(0, $pen2_size)
$song_length = _BASS_ChannelGetLength($bass_dll, $MusicHandle, $BASS_POS_BYTE)
_BASS_ChannelPlay($bass_dll, $MusicHandle, 1)
;~ $current = _BASS_ChannelGetPosition($bass_dll, $MusicHandle, $BASS_POS_BYTE)
;~ $percent = Round(($current / $song_length) * 100, 0)
$c = 1
$equalizer_width = 30
$max_l = 0
$max_r = 0
$fall_speed = 5
$fire_up = 15
Do
$levels = _BASS_ChannelGetLevel($bass_dll, $MusicHandle)
$LeftChLvl = Round(_HiWord($levels) / $height * 1.5, 0)
$RightChLvl = Round(_LoWord($levels) / $height * 1.5, 0)
If $max_l <= $LeftChLvl Then ;fire up higest line
$max_l = $LeftChLvl + $fire_up
$fall_speed_l_threshold = 20
Else
If $fall_speed_l_threshold <= 0 Then ;increase fall speed of highest line faster until threshold is <= 0 (second fall part)
If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed
Else
$fall_speed_l_threshold -= 1 ;increase fall speed of highest line by slower until threshold is <= 0 (first fall part)
If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed / 3
EndIf
EndIf
If $max_r <= $RightChLvl Then
$max_r = $RightChLvl + $fire_up
$fall_speed_r_threshold = 20
Else
If $fall_speed_r_threshold <= 0 Then
If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed
Else
$fall_speed_r_threshold -= 1
If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed / 3
EndIf
EndIf
_GDIPlus_GraphicsClear($backbuffer, 0x9F000000)
_GDIPlus_PenSetColor($pen2, 0xFF7F7F7F)
For $l = -$pen1_size - 2 To $leftChLvl Step $pen1_size * 2
$r = $l / ($height) * 256
$g = 256 - $r
$b = 0
_GDIPlus_PenSetColor($pen1, "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
_GDIPlus_GraphicsDrawLine($backbuffer, $width / 5, $height - $l, $width / 5 + $equalizer_width, $height - $l, $pen1)
Next
For $l = 0 To $RightChLvl
$r = (-(Cos(1.7 * $l / 2^7) + 1) / 2) * 256
$g = ((Cos(4 * $l / 2^8) + 1) / 2) * 256
$b = 0
_GDIPlus_PenSetColor($pen1, "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
_GDIPlus_GraphicsDrawLine($backbuffer, 3 * $width / 5, $height - $l, 3 * $width / 5 + $equalizer_width, $height - $l, $pen1)
Next
_GDIPlus_GraphicsDrawLine($backbuffer, $width / 5, $height - $max_l, $width / 5 + $equalizer_width, $height - $max_l, $pen2)
_GDIPlus_GraphicsDrawLine($backbuffer, 3 * $width / 5, $height - $max_r, 3 * $width / 5 + $equalizer_width, $height - $max_r, $pen2)
_GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
$c += 1
Sleep(15)
Until False
Func close()
_BASS_Free($bass_dll)
DllClose($bass_dll)
_GDIPlus_PenDispose($pen1)
_GDIPlus_PenDispose($pen2)
_GDIPlus_BitmapDispose($bitmap)
_GDIPlus_GraphicsDispose($graphics)
_GDIPlus_GraphicsDispose($backbuffer)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>close
nun wollte ich wissen wie man diese beiden sachen am besten zusammenfügt also das diese visulation in mein player drin ist...
freue mich auf eure antworten danke ...
daas ganze packed zum die visulaizer_analog gib es hier:
https://autoit.de/index.php?page…80495#post80495
MFG doPe