Ich habe eine frage, würde da gerne eine Playlist einbauen habt ihr da eine Idee ,könnt ihr mir da helfen ?
Danke & Liebe Grüße Roberto.
C
#include <Date.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>
#include <GuiEdit.au3>
#include 'LibZPlay.au3'
#include "VistaGlass.au3"
Opt("MustDeclareVars", 1)
#Region ### START Koda GUI section ### Form=C:\Users\Dark\Desktop\zLibAu3\libZPlayform.kxf
Global $GUI = GUICreate("SETI Sachsen Player Ver. 1.5",1600 , 900, 164, 100)
GUISetState(@SW_SHOW,$GUI)
WinSetTrans($GUI, "" ,170)
Global $Graphic = GUICtrlCreateGraphic(24, 272, 473, 185)
GUISetState()
GUISetBkColor(0x778899)
DllCall('uxtheme.dll','none', 'SetThemeAppProperties', 'int', 0)
Global $ProgressLeft = GUICtrlCreateProgress(512, 260, 41, 200, $PBS_VERTICAL)
GUICtrlSetColor(-1,0x1E90FF)
Global $ProgressRight = GUICtrlCreateProgress(560, 260, 41, 200, $PBS_VERTICAL)
GUICtrlSetColor(-1,0x1E90FF)
GUISetState(@SW_SHOW)
Global $GroupGV = GUICtrlCreateGroup("Graph-VU Meter", 16, 600, 593, 249)
Global $CheckLinear = GUICtrlCreateCheckbox("Linear", 24, 850, 49, 25)
Global $CheckGrid = GUICtrlCreateCheckbox("Grid", 80, 850, 40, 25)
Global $CheckSubGrid = GUICtrlCreateCheckbox("SubGrid", 120, 850, 57, 25)
Global $CheckScale = GUICtrlCreateCheckbox("Scale", 180, 850, 49, 25)
Global $ComboLines = GUICtrlCreateCombo("", 232, 850, 121, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
Global $ComboWindow = GUICtrlCreateCombo("", 360, 850, 121, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
Global $ComboFFT = GUICtrlCreateCombo("", 534, 850, 50, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
Global $GroupVolume = GUICtrlCreateGroup("Volume", 360, 176, 257, 73)
Global $SliderLeft = GUICtrlCreateSlider(408, 192, 161, 25)
GUICtrlSetLimit(-1, 100, 0)
Global $lbLeft = GUICtrlCreateLabel("Left:", 380, 195, 30, 17)
Global $SliderRight = GUICtrlCreateSlider(408, 216, 161, 25)
GUICtrlSetLimit(-1, 100, 0)
Global $lbRight = GUICtrlCreateLabel("Right:", 380, 220, 30, 17)
Global $GroupInfo = GUICtrlCreateGroup("Info.", 360, 8, 257, 161)
Global $EditInfo = GUICtrlCreateEdit('', 365, 20, 252, 150)
Global $GroupPrincipal = GUICtrlCreateGroup("Director", 16, 8, 337, 241)
Global $ProgressPlay = GUICtrlCreateProgress(24, 224, 313, 17)
Global $bOpenFile = GUICtrlCreateButton("Open File", 24, 32, 81, 33)
Global $bPlay = GUICtrlCreateButton("Play", 24, 88, 81, 33)
Global $bPause = GUICtrlCreateButton("Pause", 104, 88, 81, 33)
Global $bResume = GUICtrlCreateButton("Resume", 184, 88, 81, 33)
Global $bStop = GUICtrlCreateButton("Stop", 264, 88, 81, 33)
Global $bJumpRev = GUICtrlCreateButton("JumpRev", 24, 136, 81, 33)
Global $bJumpFwd = GUICtrlCreateButton("JumpFwd", 104, 136, 81, 33)
Global $GroupPos = GUICtrlCreateGroup("Position", 24, 176, 161, 41)
Global $lbPosition = GUICtrlCreateLabel("Time", 32, 192, 124, 17)
Global $GroupEffect = GUICtrlCreateGroup("Effects", 192, 128, 153, 89)
Global $CheckEcho = GUICtrlCreateCheckbox("Enable Echo", 200, 144, 129, 25)
Global $CheckReverse = GUICtrlCreateCheckbox("Enable Reverse Play", 200, 176, 137, 25)
Global $lbCurrentFile = GUICtrlCreateLabel("Current File:", 32, 72, 300, 17)
Global $InputDefaultDevice = GUICtrlCreateInput("", 120, 48, 217, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
Global $lbDefaultOutput = GUICtrlCreateLabel("Default Output Device:", 168, 24, 113, 17)
Global $fft = GUICtrlCreateLabel("FFT:", 496, 855, 57, 25)
Global $lbAbout = GUICtrlCreateLabel("About...", 600-15, 498, 50, 17)
GUICtrlSetBkColor ( -1, 0xC0C0C0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
;~ Inicialize ZPlay
CreateZPlay()
;~ Get default output device
Local $tWaveOutInfoW = DllStructCreate($sTagTWaveOutInfoW)
if not EnumerateWaveOut() Then
MsgBox(0,'Error','Error Bye Bye')
Close()
DestroyZPlay()
Exit
EndIf
GetWaveOutInfoW(EnumerateWaveOut(), $tWaveOutInfoW)
GUICtrlSetData($InputDefaultDevice, $tWaveOutInfoW.ProductName)
;~ Get Internal Volume
Local $nLeftVolume, $nRightVolume = 0
GetPlayerVolume($nLeftVolume, $nRightVolume)
GUICtrlSetData($SliderLeft, $nLeftVolume)
GUICtrlSetData($SliderRight, $nRightVolume)
;~ Fill comboboxs
GUICtrlSetState($CheckGrid, $GUI_CHECKED)
GUICtrlSetState($CheckScale, $GUI_CHECKED)
GUICtrlSetData($ComboLines, 'Lines (Left on top)|Lines (Right on top)|Area (Left on top)|Area (Right on top)|Bars (Left on top)|' & _
'Bars (Right on top)|Spectrum')
_GUICtrlComboBox_SetCurSel($ComboLines, 0)
GUICtrlSetData($ComboWindow, 'Rectangular|' & _
'Hamming|' & _
'Hann|' & _
'Cosine|' & _
'Lanczos|' & _
'Bartlett|' & _
'Triangular|' & _
'Gauss|' & _
'Bartlett-Hann|' & _
'Blackman|' & _
'Nuttell|' & _
'Blackman-Harris|' & _
'Blackman-Nuttal|' & _
'FlatTop')
_GUICtrlComboBox_SetCurSel($ComboWindow, 11)
SetFFTGraphParam($gpWindow, _GUICtrlComboBox_GetCurSel($ComboWindow) + 1);
GUICtrlSetData($ComboFFT, '16|' & _
'32|' & _
'64|' & _
'128|' & _
'256|' & _
'512|' & _
'1024|' & _
'2048|' & _
'4096')
_GUICtrlComboBox_SetCurSel($ComboFFT, 5)
SetFFTGraphParam($gpFFTPoints, Number(GUICtrlRead($ComboFFT)))
;~ Create Some Structures
Local $tPosition = DllStructCreate($sTagTStreamTime)
Local $tStatus = DllStructCreate($sTagTStreamStatus)
Local $tInfo = DllStructCreate($sTagTStreamInfo)
Local $Time = DllStructCreate($sTagTStreamTime)
Local $Time = DllStructCreate($sTagTStreamTime)
Local $sCurrentFile = ""
Local $SongLength = 0
Local $Step = 0
Local $temp = 0
Local $Pos = 0
Local $effect = 0
Local $nLeftChannel, $nRightChannel = 0
Local $nMsg = 0
Local $tID3W = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Close()
DestroyZPlay()
Exit
Case $bOpenFile
$sCurrentFile = FileOpenDialog('Select your File', @ScriptDir, 'Supported Files(*.mp3;*.mp2;*.mp1;*.ogg;*.flac;*.oga;*.wav;*.ac3;*.aac)')
GUICtrlSetData($lbCurrentFile, FileGetShortName($sCurrentFile))
Case $bPlay
If $sCurrentFile <> '' Then
OpenFile($sCurrentFile, $sfAutodetect)
Play()
If GetStreamInfo($tInfo) Then
$SongLength = $tInfo.sec
$Step = ((100) / $SongLength)
$tID3W = DllStructCreate($sTagTID3InfoW)
LoadID3W($id3Version1, $tID3W)
GUICtrlSetData($EditInfo, '')
_GUICtrlEdit_AppendText($EditInfo, 'Format: ' & GetFileFormatStr(GetFileFormatW($sCurrentFile)) & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Description : ' & $tInfo.Description & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'SamplingRate : ' & $tInfo.SamplingRate & ' Hz' & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'ChannelNumber : ' & $tInfo.ChannelNumber & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Duration: ' & StringFormat('%02u', $tInfo.hour) & ':' & StringFormat('%02u', $tInfo.minute) & ':' & StringFormat('%02u', $tInfo.second) & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Title: ' & $tID3W.Title & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Artist: ' & $tID3W.Artist & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Album: ' & $tID3W.Album & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Year: ' & $tID3W.Year & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Comment: ' & $tID3W.Comment & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'TrackNum : ' & $tID3W.TrackNum & @CRLF)
_GUICtrlEdit_AppendText($EditInfo, 'Genre : ' & $tID3W.Genre & @CRLF)
$tID3W = 0
EndIf
Else
MsgBox(0, '', 'Sound Wählen - Select Sound')
EndIf
Case $bPause
Pause()
Case $bResume
Resume()
Case $bStop
Stop()
Case $bJumpRev
$Time.sec = 5
Seek($tfSecond, $Time, $smFromCurrentBackward)
Case $bJumpFwd
$Time.sec = 5
Seek($tfSecond, $Time, $smFromCurrentForward)
Case $SliderLeft
SetPlayerVolume(GUICtrlRead($SliderLeft), GUICtrlRead($SliderRight))
Case $SliderRight
SetPlayerVolume(GUICtrlRead($SliderLeft), GUICtrlRead($SliderRight))
Case $CheckEcho
$effect = DllStructCreate($sTagTEchoEffect)
$effect.nLeftDelay = 500; // 2000 ms delay
$effect.nLeftEchoVolume = 20; // use 20 % volume of delayed samples
$effect.nLeftSrcVolume = 90; // use 90 % volume of original samples
$effect.nRightDelay = 500; // 2000 ms delay
$effect.nRightEchoVolume = 20;
$effect.nRightSrcVolume = 90;
SetEchoParam(DllStructGetPtr($effect, 1), 1)
EnableEcho(BitAND(GUICtrlRead($CheckEcho), $GUI_CHECKED) = $GUI_CHECKED)
GUICtrlSetData($CheckEcho, (BitAND(GUICtrlRead($CheckEcho), $GUI_CHECKED) = $GUI_CHECKED) ? "Disable Echo" : "Enable Echo")
$effect = 0
Case $CheckReverse
ReverseMode(BitAND(GUICtrlRead($CheckReverse), $GUI_CHECKED) = $GUI_CHECKED)
GUICtrlSetData($CheckReverse, (BitAND(GUICtrlRead($CheckReverse), $GUI_CHECKED) = $GUI_CHECKED) ? "Disable Reverse Play" : "Enable Reverse Play")
Case $CheckLinear
If GUICtrlRead($CheckLinear) = $GUI_CHECKED Then
SetFFTGraphParam($gpHorizontalScale, $gsLinear)
Else
SetFFTGraphParam($gpHorizontalScale, $gsLogarithmic);
EndIf
Case $CheckGrid
SetFFTGraphParam($gpFrequencyGridVisible, BitAND(GUICtrlRead($CheckGrid), $GUI_CHECKED) = $GUI_CHECKED);
SetFFTGraphParam($gpDecibelGridVisible, BitAND(GUICtrlRead($CheckGrid), $GUI_CHECKED) = $GUI_CHECKED);
Case $CheckSubGrid
SetFFTGraphParam($gpSubgrid, BitAND(GUICtrlRead($CheckSubGrid), $GUI_CHECKED) = $GUI_CHECKED);
Case $CheckScale
SetFFTGraphParam($gpFrequencyScaleVisible, BitAND(GUICtrlRead($CheckScale), $GUI_CHECKED) = $GUI_CHECKED);
SetFFTGraphParam($gpDecibelScaleVisible, BitAND(GUICtrlRead($CheckScale), $GUI_CHECKED) = $GUI_CHECKED);
Case $ComboLines
SetFFTGraphParam($gpGraphType, _GUICtrlComboBox_GetCurSel($ComboLines))
Case $ComboWindow
SetFFTGraphParam($gpWindow, _GUICtrlComboBox_GetCurSel($ComboWindow) + 1);
Case $ComboFFT
SetFFTGraphParam($gpFFTPoints, Number(GUICtrlRead($ComboFFT)))
Case $lbAbout
MsgBox(0,'SETI Player','SETI Player Version. 1.5' & @CRLF & _
'Written by SETI Sachsen Roberto Klapper' & @CRLF & _
'All Credits for SETI Sachsen' & @CRLF & _
'http://www.seti-sachsen.de',64)
EndSwitch
GetStatus($tStatus)
If $tStatus.fPlay Then
Position($tPosition)
GUICtrlSetData($lbPosition, StringFormat('%02u', $tPosition.hour) & ' : ' & StringFormat('%02u', $tPosition.minute) & ' : ' & StringFormat('%02u', $tPosition.second))
DrawFFTGraphOnHWND(GUICtrlGetHandle($Graphic), 0, 0, 473, 185)
GetVUData($nLeftChannel, $nRightChannel)
GUICtrlSetData($ProgressLeft, $nLeftChannel)
GUICtrlSetData($ProgressRight, $nRightChannel)
If $temp <> $tPosition.second Then
$Pos = Round($Step * (_TimeToTicks($tPosition.hour, $tPosition.minute, $tPosition.second) / 1000))
GUICtrlSetData($ProgressPlay, $Pos)
$temp = $tPosition.second
EndIf
EndIf
WEnd
Func GetFileFormatStr($iFormat)
Select
Case $iFormat = $sfUnknown
Return 'Unknown'
Case $iFormat = $sfMp3
Return 'Mp3'
Case $iFormat = $sfOgg
Return 'Ogg'
Case $iFormat = $sfWav
Return 'Wav'
Case $iFormat = $sfPCM
Return 'PCM'
Case $iFormat = $sfFLAC
Return 'FLAC'
Case $iFormat = $sfFLACOgg
Return 'FLACOgg'
Case $iFormat = $sfAC3
Return 'AC3'
Case $iFormat = $sfAacADTS
Return 'AacADTS'
Case $iFormat = $sfWaveIn
Return 'WaveIn'
Case $iFormat = $sfAutodetect
Return 'Autodetect'
EndSelect
EndFunc ;==>GetFileFormatStr
Alles anzeigen