Tach Leute
Nach unendlichen Versuchen und langer Suche im Netz sehe ich mich wiedermal gezwungen, eure Hilfe in Anspruch zu nehmen.
Ich schreibe gerade an einem Programm, dass es mir ermöglichen soll, doppelte Musikdateien in einem Ordner zu finden und direkt zu bearbeiten. Also ich will die Dateien aus dem Programm heraus löschen, umbenennen oder verschieben. Das Umbenennen und Löschen funktioniert einwandfrei.
Beim Verschieben jedoch bekommt er ein Problem mit einem geöffneten Dateihandle. Ich kann mir nicht erklären, warum das Handle zu dieser Datei nicht geschlossen wird (entdeckt hab ich's mit der procmon.exe von Sysinternals). Die zweite Datei bleibt immer vom Programm geöffnet, obwohl FileClose bzw. SoundClose angegeben ist. Dadurch schlägt entweder das Löschen oder das Verschieben fehl.
Das Problem betrifft den Code von Zeile 921 bis Zeile 988.
Der in diesem Bereich auskommentierte Code stellt die eigentliche Funktion dar. Die Variante mit dem Objekt hab ich versucht, als ich gemerkt hab, dass die andere nicht funktioniert..
Um das zu Testen braucht man ein Lied in einem Ordner, mit einer Kopie davon in einem weiteren Unterordner.
Ich hoffe, Ihr könnt mir Helfen, bin kurz vorm Verzweifeln..
Script:
Spoiler anzeigen
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]------------------------ DoubleKill v0.1 ----------------- by TheAlien ---------
[/autoit] [autoit][/autoit] [autoit]TODO:
- "suche abbrechen" funktioniert nicht richtig
;~ ---------------------------------------------------------------------------------------------------
C:\Program Files (x86)\AutoIt3\Include\Sound.au3 (346) : ==> Subscript used with non-Array variable.:
__SoundMciSendString("set " & $aSndID[0] & " time format miliseconds")
__SoundMciSendString("set " & $aSndID^ ERROR
->23:33:13 AutoIt3.exe ended.rc:1
-------------------------------------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.8.1
Author: TheSystemAlien ([email='brother-of-blood@hotmail.com'][/email])
Script Function:
Programm, um doppelte Musik-Dateien in einem Ordner zu finden und gleichzeitig zu bearbeiten (umbenennen, löschen, verschieben usw...).
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]#NoTrayIcon
#RequireAdmin
#Region
#AutoIt3Wrapper_icon=tab_duplicate.ico
#AutoIt3Wrapper_outfile=DoubleKill v0.1.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Description=DoubleKill
#AutoIt3Wrapper_Res_Fileversion=0.1
#AutoIt3Wrapper_Res_LegalCopyright=by TheAlien
#AutoIt3Wrapper_Res_Language=1031
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, DefSettings.ini, rcdata, DEFSETTINGS, 0
#Obfuscator_Parameters=/striponly
#EndRegion
#include <GuiListBox.au3>
#include <GuiListView.au3>
#include <EditConstants.au3>
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <Date.au3>
#include <UpdownConstants.au3>
#include <Misc.au3>
#include <GuiButton.au3>
#include <GuiSlider.au3>
#include "_Sound.au3"
#include "_GuiRichEdit.au3"
#include "resources.au3"
#Include <ColorChooser.au3>
#include <WinAPIEx.au3>
Opt("GuiOnEventMode", 1)
Opt("MustDeclareVars", 1)
#region Global Vars
Global $sTitle = "DoubleKill v0.1 by TheAlien"
;~ Global $a_Titles[100000] ;==> wird in der Funktion _Scan deklariert
;==> Array, in welchen die gefundenen Titel geladen werden
Global $iStop = False
;==> Für den Abbruch des Scans
Global $hSettings = "settings.ini"
;==> Pfad zur Einstellungsdatei
Global $hIgnoreList = "ignorelist.txt", $sIgnoreList
;==> Pfad zur Liste, die die zu ignorierenden Einträge enthält
Global $iVolume, $iPlay = -1, $iPause, $iPlayer
;==> $iVolume -> Lautstärke
;==> $iPlay -> Abspielstatus: -1 = keine Sounds geladen, 0 = Stop, 1 = Play
;==> $iPause -> Pause: 1 = pause, 0 != pause
;==> $iPlayer -> welcher Player gerade aktiv ist: 0 = player links, 1 = player rechts
Global $hSound
;==> Handle zum Sound
Global $i_PairCount
;==> Anzahl gefundener Paare
Global $__ASKSCAN, $__ASKDELSINGLE, $__ASKDELDOUBLE, $__ASKCLOSE, $__AUTOPLAY, $__SKIPTIME, $__IGNORENEXTTIME
;==> Nachfragen und Einstellungen, selbsterklärend
Global $aFunctions[24], $aShortCuts[24], $AccelKeys[24][2]
;==> Für die zuweisung mit GuiSetAccelerators(): $aFunctions = Handle zu den Controls, $aShortCuts = Tastenkürzel im Send-Format
Global $aDupes[1][2]
;==> $aDupes[0][0] = Erstes Paar, erster track... $aDupes[0][1] = Erstes Paar, zweiter Track (mit Dateipfaden)
Global $Color, $aControls[8][2]
;==> $Color = aktuelle Farbe im Auswahlfenster, $aControls = Array um Buttons und Farblabel zu verwalten
Global $iSettingsActive = False
#endregion Global Vars
If Not FileExists($hSettings) Then
_ResourceSaveToFile("settings.ini", "DEFSETTINGS")
EndIf
_ReadIgnoreList()
[/autoit] [autoit][/autoit] [autoit]#region Colors
[/autoit] [autoit][/autoit] [autoit];~ Global Const $COLOR1 = 0xBDBDBD ;==> default colors
;~ Global Const $COLOR2 = 0xDCDCDC
;~ Global Const $COLOR3 = 0x000000
;~ Global Const $COLOR4 = 0x228B22
;~ Global Const $COLOR5 = 0xFF8C00
;~ Global Const $COLOR6 = 0x0080FF
;~ Global Const $COLOR7 = 0x009900
;~ Global Const $COLOR8 = 0xEE2C2C
Global $COLOR1 = IniRead($hSettings, "Settings", "Color1", 0xBDBDBD)
Global $COLOR2 = IniRead($hSettings, "Settings", "Color2", 0xDCDCDC)
Global $COLOR3 = IniRead($hSettings, "Settings", "Color3", 0x000000)
Global $COLOR4 = IniRead($hSettings, "Settings", "Color4", 0x228B22)
Global $COLOR5 = IniRead($hSettings, "Settings", "Color5", 0xFF8C00)
Global $COLOR6 = IniRead($hSettings, "Settings", "Color6", 0x0080FF)
Global $COLOR7 = IniRead($hSettings, "Settings", "Color7", 0x009900)
Global $COLOR8 = IniRead($hSettings, "Settings", "Color8", 0xEE2C2C)
#endregion Colors
#Region GUI Main
Global $hGUI = GUICreate($sTitle, 617, 665)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUISetBkColor($COLOR1)
GUICtrlSetDefColor($COLOR3, $hGUI)
Global $hFileMenu = GUICtrlCreateMenu("&Datei")
Global $hFileMenu_open = GUICtrlCreateMenuItem("Pfad öffnen"&@TAB&"F4", $hFileMenu)
GUICtrlSetOnEvent(-1, "_OpenPath")
Global $hFileMenu_scan = GUICtrlCreateMenuItem("Scannen"&@TAB&"F5", $hFileMenu)
GUICtrlSetOnEvent(-1, "_Scan")
;~ $ = GUICtrlCreateMenuItem(""&@TAB&"F17", $hFileMenu)
Global $hFileMenu_new = GUICtrlCreateMenuItem("Neue Instanz"&@TAB&"F2", $hFileMenu)
GUICtrlSetOnEvent(-1, "_NewInstance")
Global $hFileMenu_close = GUICtrlCreateMenuItem("DoubleKill beenden"&@TAB&"ESC", $hFileMenu)
GUICtrlSetOnEvent(-1, "_Exit")
Global $hOptionsMenu = GUICtrlCreateMenu("&Optionen")
Global $hOptionsMenu_Settings = GUICtrlCreateMenuItem("Einstellungen"&@TAB&"F9", $hOptionsMenu)
GUICtrlSetOnEvent(-1, "_ToggleSettings")
Global $hOptionsMenu_Color = GUICtrlCreateMenuItem("Farb-Einstellungen"&@TAB&"F10", $hOptionsMenu)
GUICtrlSetOnEvent(-1, "_ToggleColor")
Global $hHelpMenu = GUICtrlCreateMenu("&Hilfe")
Global $hHelpMenu_About = GUICtrlCreateMenuItem("Über DoubleKill"&@TAB&"F1", $hHelpMenu)
GUICtrlSetOnEvent(-1, "_ToggleAbout")
Global $Group1 = GUICtrlCreateGroup("Titel 1", 8, 8, 257, 197)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group1), "wstr", 0, "wstr", 0)
Global $e_infos_left = _GUICtrlRichEdit_Create($hGUI,"", 16, 24, 185, 130, BitOR($ES_MULTILINE, $ES_READONLY))
_GUICtrlRichEdit_SetBkColor($e_infos_left, $COLOR2)
Global $timeslide_left = GUICtrlCreateSlider(16, 163, 240, 21)
GUICtrlSetBkColor(-1, $COLOR1)
GUICtrlSetLimit(-1, 500)
GUICtrlSetOnEvent(-1, "_SeekPosition")
Global $l_SoundPosleft = GUICtrlCreateLabel("00:00", 24, 187, 40, 15)
Global $l_SoundLenleft = GUICtrlCreateLabel("00:00", 218, 187, 30, 15)
[/autoit] [autoit][/autoit] [autoit]Global $b_playleft = GUICtrlCreateButton("Play", 208, 20, 51, 25)
[/autoit] [autoit][/autoit] [autoit]GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "_TogglePlay")
Global $b_stopleft = GUICtrlCreateButton("Stop", 208, 48, 51, 25)
GUICtrlSetOnEvent(-1, "_StopMusic")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b_rename_left = GUICtrlCreateButton("Rename", 208, 76, 51, 25)
GUICtrlSetOnEvent(-1, "_RenameFile")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b_delete_left = GUICtrlCreateButton("Löschen", 208, 132, 51, 25)
GUICtrlSetOnEvent(-1, "_DeleteFile")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b_move_left = GUICtrlCreateButton("Versch.", 208, 104, 51, 25)
GUICtrlSetOnEvent(-1, "_MoveFile")
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
[/autoit] [autoit][/autoit] [autoit]Global $Group2 = GUICtrlCreateGroup("Titel 2", 272, 8, 257, 197)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group2), "wstr", 0, "wstr", 0)
Global $e_infos_right = _GUICtrlRichEdit_Create($hGUI,"", 280, 24, 185, 130, BitOR($ES_MULTILINE, $ES_READONLY))
_GUICtrlRichEdit_SetBkColor($e_infos_right, $COLOR2)
Global $timeslide_right = GUICtrlCreateSlider(280, 163, 240, 21)
GUICtrlSetBkColor(-1, $COLOR1)
GUICtrlSetLimit(-1, 500)
GUICtrlSetOnEvent(-1, "_SeekPosition")
Global $l_SoundPosright = GUICtrlCreateLabel("00:00", 288, 187, 40, 15)
Global $l_SoundLenright = GUICtrlCreateLabel("00:00", 482, 187, 30, 15)
Global $b_delete_right = GUICtrlCreateButton("Löschen", 472, 132, 51, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "_DeleteFile")
Global $b_rename_right = GUICtrlCreateButton("Rename", 472, 76, 51, 25)
GUICtrlSetOnEvent(-1, "_RenameFile")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b_playright = GUICtrlCreateButton("Play", 472, 20, 51, 25)
GUICtrlSetOnEvent(-1, "_TogglePlay")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b_stopright = GUICtrlCreateButton("Stop", 472, 48, 51, 25)
GUICtrlSetOnEvent(-1, "_StopMusic")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b_move_right = GUICtrlCreateButton("Versch.", 472, 104, 51, 25)
GUICtrlSetOnEvent(-1, "_MoveFile")
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group3 = GUICtrlCreateGroup("Gefundene Tracks", 8, 353, 600, 200)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group3), "wstr", 0, "wstr", 0)
Global $hListBox = GUICtrlCreateList("", 16, 376, 580, 162, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL))
GUICtrlSetBkColor($hListBox, $COLOR2)
GUICtrlSetData(-1, "")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group4 = GUICtrlCreateGroup("Dateipfade", 8, 212, 600, 133)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group4), "wstr", 0, "wstr", 0)
Global $i_path_left = _GUICtrlRichEdit_Create($hGUI, "", 16, 257, 582, 21, $ES_READONLY)
_GUICtrlRichEdit_SetBkColor($i_path_left, $COLOR2)
Global $b_open_left = GUICtrlCreateButton("Dateispeicherort öffnen", 469, 226, 131, 25)
GUICtrlSetOnEvent(-1, "_OpenInExplorer")
GUICtrlSetState(-1, $GUI_DISABLE)
Global $i_path_right = _GUICtrlRichEdit_Create($hGUI, "", 16, 285, 582, 21, $ES_READONLY)
_GUICtrlRichEdit_SetBkColor($i_path_right, $COLOR2)
Global $b_open_right = GUICtrlCreateButton("Dateispeicherort öffnen", 469, 313, 131, 25)
GUICtrlSetOnEvent(-1, "_OpenInExplorer")
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateLabel("Titel 1", 16, 236, 33, 17)
GUICtrlCreateLabel("Titel 2", 16, 312, 33, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group5 = GUICtrlCreateGroup("Pfad zur Musiksammlung", 8, 556, 600, 80)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group5), "wstr", 0, "wstr", 0)
Global $i_Path = GUICtrlCreateInput("", 16, 573, 500, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
GUICtrlSetBkColor(-1, $COLOR2)
Global $b_openpath = GUICtrlCreateButton("Pfad öffnen", 521, 573, 80, 25)
GUICtrlSetOnEvent(-1, "_OpenPath")
Global $b_scan = GUICtrlCreateButton("Scannen", 521, 603, 80, 25)
GUICtrlSetOnEvent(-1, "_Scan")
GUICtrlCreateLabel("Aktueller Ordner:", 16, 603, 60, 25)
Global $l_ActualDir = GUICtrlCreateLabel("", 76, 603, 430, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateLabel("Anzahl Tracks:", 536, 17, 75, 13)
[/autoit] [autoit][/autoit] [autoit]Global $l_CountTracks = GUICtrlCreateLabel("0", 536, 32, 75, 13)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateLabel("Anzahl Paare:", 536, 47, 75, 17)
[/autoit] [autoit][/autoit] [autoit]Global $l_CountPairs = GUICtrlCreateLabel("0", 536, 62, 75, 13)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateLabel("Volume:", 536, 78, 75, 17)
Global $i_volume = GUICtrlCreateInput("0", 538, 93, 70, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
GUICtrlSetBkColor(-1, $COLOR2)
Global $ud_volume = GUICtrlCreateUpdown($i_volume, BitOR($UDS_ARROWKEYS, $UDS_ALIGNRIGHT))
GUICtrlSetLimit(-1, 100, 0)
Global $b_deleteboth = GUICtrlCreateButton("Beide löschen", 536, 119, 75, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "_DeleteBoth")
Global $b_holdboth = GUICtrlCreateButton("Eintrag weiter", 536, 145, 75, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "_NextEntry")
Global $cb_ignorenexttime = GUICtrlCreateCheckbox("Nächstes", 536, 175, 75, 18)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cb_ignorenexttime), "wstr", 0, "wstr", 0)
GUICtrlCreateLabel("Mal ignorieren", 538, 192, 71, 18)
Global $d_skipback = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_SkipBackward")
Global $d_skipforward = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_SkipForward")
Global $d_stopsearch = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_AbortScan")
Global $d_ignorenexttime = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_ToggleIgnore")
Global $d_volumeup = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_VolumeUp")
Global $d_volumedown = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_VolumeDown")
Global $d_settings = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_ToggleSettings")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
#region Settings GUI
Global $hGui_Settings = GUICreate($sTitle & " - Einstellungen", 393, 448, Default, Default, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), $hGui)
GUISetBkColor($COLOR1)
GUICtrlSetDefColor($COLOR3, $hGui_Settings)
GUISetOnEvent($GUI_EVENT_CLOSE, "_ToggleSettings")
Global $Group_ask = GUICtrlCreateGroup("Nachragen beim..", 8, 8, 177, 129)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group_ask), "wstr", 0, "wstr", 0)
Global $cb_ask_scan = GUICtrlCreateCheckbox("Scannen", 16, 32, 97, 17)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cb_ask_scan), "wstr", 0, "wstr", 0)
Global $cb_ask_delsingle = GUICtrlCreateCheckbox("Löschen einzelner Tracks", 16, 56, 145, 17)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cb_ask_delsingle), "wstr", 0, "wstr", 0)
Global $cb_ask_deldouble = GUICtrlCreateCheckbox("Löschen beider Tracks", 16, 80, 129, 17)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cb_ask_deldouble), "wstr", 0, "wstr", 0)
Global $cb_ask_close = GUICtrlCreateCheckbox("Schliessen", 16, 104, 97, 17)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cb_ask_close), "wstr", 0, "wstr", 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group_player = GUICtrlCreateGroup("Player Einstellungen", 200, 8, 185, 129)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group_player), "wstr", 0, "wstr", 0)
Global $cb_player_autoplay = GUICtrlCreateCheckbox("Automatisch abspielen", 208, 32, 129, 17)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cb_player_autoplay), "wstr", 0, "wstr", 0)
GUICtrlCreateLabel("Schrittgrösse beim Spulen (Sek.)", 208, 56, 157, 17)
Global $i_skiptime = GUICtrlCreateInput("", 208, 75, 157, 22, $ES_NUMBER)
GUICtrlSetBkColor(-1, $COLOR2)
Global $ud_skiptime = GUICtrlCreateUpdown($i_skiptime, BitOR($UDS_ARROWKEYS, $UDS_ALIGNRIGHT))
GUICtrlSetLimit(-1, 100, 3)
Global $b_colors = GUICtrlCreateButton("Farben auswählen", 208, 103, 157, 25)
GUICtrlSetOnEvent(-1, "_ToggleColor")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Group_shortcuts = GUICtrlCreateGroup("Tastaturbefehle", 8, 144, 377, 265)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group_shortcuts), "wstr", 0, "wstr", 0)
Global $h_ListViewSettings = _GUICtrlListView_Create($hGui_Settings, "Aktion|Tastaturbefehl", 16, 168, 361, 227)
_GUICtrlListView_SetColumnWidth($h_ListViewSettings, 0, 200)
_GUICtrlListView_SetColumnWidth($h_ListViewSettings, 1, 90)
_GUICtrlListView_SetExtendedListViewStyle($h_ListViewSettings, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetBkColor($h_ListViewSettings, $COLOR2)
_GUICtrlListView_SetTextBkColor($h_ListViewSettings, $COLOR2)
_GUICtrlListView_SetTextColor($h_ListViewSettings, $COLOR3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
[/autoit] [autoit][/autoit] [autoit]Global $b_setstandard = GUICtrlCreateButton("Standard wiederherstellen", 8, 415, 150, 25)
GUICtrlSetOnEvent(-1, "_ResetSettings")
Global $b_abort = GUICtrlCreateButton("Abbrechen", 163, 415, 67, 25)
GUICtrlSetOnEvent(-1, "_ToggleSettings")
Global $b_savesettings = GUICtrlCreateButton("Speichern und schliessen", 235, 415, 150, 25)
GUICtrlSetOnEvent(-1, "_SaveSettings")
GUISetState(@SW_HIDE, $hGui_Settings)
#endregion Settings GUI
#region GUI Shortcut Countdown
Global $hGUI_Shorcut = GUICreate("Form1", 165, 106, Default, Default, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST)
GUISetBkColor($COLOR1)
GUICtrlSetDefColor($COLOR3, $hGUI_Shorcut)
GUICtrlCreateLabel("Taste drücken...", 33, 27, 99, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
Global $l_time = GUICtrlCreateLabel("0", 77, 59, 50, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_HIDE, $hGUI_Shorcut)
#endregion GUI Shortcut Countdown
#region GUI About
Global $hGui_About = GUICreate("", 200, 500, Default, Default, BitOR($WS_POPUP, $WS_BORDER))
GUISetOnEvent($GUI_EVENT_CLOSE, "_ToggleAbout")
GUISetBkColor($COLOR1, $hGui_About)
GUICtrlSetDefColor($COLOR3, $hGui_About)
Global $b_CloseAbout = GUICtrlCreateButton("Schliessen", 5, 470, 190, 25)
Global $e_about = GUICtrlCreateEdit("", 5, 5, 190, 460, BitOR($ES_READONLY, $ES_CENTER))
GUICtrlSetOnEvent($b_CloseAbout, "_ToggleAbout")
#endregion GUI About
#region GUI Colors
Global $hGui_Color = GUICreate($sTitle & " - Farben", 340, 240, Default, Default, BitOR($WS_POPUP, $WS_BORDER))
GUISetBkColor($COLOR1, $hGui_Color)
GUICtrlSetDefColor($COLOR3, $hGui_Color)
GUISetOnEvent($GUI_EVENT_CLOSE, "_ToggleColor")
Global $Group1 = GUICtrlCreateGroup("Farben auswählen für...", 12, 8, 317, 190)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Group1), "wstr", 0, "wstr", 0)
Global $Label1 = GUICtrlCreateLabel("GUI Hintergrundfarbe", 24, 28, 105, 17)
Global $Label2 = GUICtrlCreateLabel("GUI Sekundärfarbe", 24, 48, 96, 17)
Global $Label3 = GUICtrlCreateLabel("GUI Schriftfarbe", 24, 68, 96, 17)
GUICtrlSetTip(-1, "Benötigt Neustart von DoubleKill")
Global $Label4 = GUICtrlCreateLabel("Beginn des Pfades", 24, 88, 93, 17)
Global $Label5 = GUICtrlCreateLabel("Mitte des Pfades", 24, 108, 83, 17)
Global $Label6 = GUICtrlCreateLabel("Ende des Pfades", 24, 128, 85, 17)
Global $Label7 = GUICtrlCreateLabel("Kleiner als", 24, 148, 51, 17)
Global $Label8 = GUICtrlCreateLabel("Grösser als", 24, 168, 57, 17)
Global $b_pick1 = GUICtrlCreateButton("Pick", 280, 28, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $b_pick2 = GUICtrlCreateButton("Pick", 280, 48, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $b_pick3 = GUICtrlCreateButton("Pick", 280, 68, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
GUICtrlSetTip(-1, "Benötigt Neustart von DoubleKill")
Global $b_pick4 = GUICtrlCreateButton("Pick", 280, 88, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $b_pick5 = GUICtrlCreateButton("Pick", 280, 108, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $b_pick6 = GUICtrlCreateButton("Pick", 280, 128, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $b_pick7 = GUICtrlCreateButton("Pick", 280, 148, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $b_pick8 = GUICtrlCreateButton("Pick", 280, 168, 43, 17)
GUICtrlSetOnEvent(-1, "_GetColor")
Global $l_Color1 = GUICtrlCreateLabel("", 136, 28, 140, 17, $SS_SUNKEN)
Global $l_Color2 = GUICtrlCreateLabel("", 136, 48, 140, 17, $SS_SUNKEN)
Global $l_Color3 = GUICtrlCreateLabel("", 136, 68, 140, 17, $SS_SUNKEN)
GUICtrlSetTip(-1, "Benötigt Neustart von DoubleKill")
Global $l_Color4 = GUICtrlCreateLabel("", 136, 88, 140, 17, $SS_SUNKEN)
Global $l_Color5 = GUICtrlCreateLabel("", 136, 108, 140, 17, $SS_SUNKEN)
Global $l_Color6 = GUICtrlCreateLabel("", 136, 128, 140, 17, $SS_SUNKEN)
Global $l_Color7 = GUICtrlCreateLabel("", 136, 148, 140, 17, $SS_SUNKEN)
Global $l_Color8 = GUICtrlCreateLabel("", 136, 168, 140, 17, $SS_SUNKEN)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $b_colors_abort = GUICtrlCreateButton("Abbrechen", 10, 205, 105, 25)
GUICtrlSetOnEvent(-1, "_ToggleColor")
Global $b_colors_apply = GUICtrlCreateButton("Übernehmen", 118, 205, 105, 25)
GUICtrlSetOnEvent(-1, "_ApplyColors")
Global $b_colors_ok = GUICtrlCreateButton("Ok", 225, 205, 105, 25)
GUICtrlSetOnEvent(-1, "_ApplyColors")
#endregion GUI Colors
[/autoit] [autoit][/autoit] [autoit]GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ;==> für doppelklick in der listbox
GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") ;==> für tastendruck in den einstellungen
GUICtrlSetData($i_Path, IniRead($hSettings, "Settings", "LastPath", ""))
GUICtrlSetData($i_volume, IniRead($hSettings, "Settings", "Volume", "50"))
;~ [["1", $b_deleteboth],["2", $b_playleft],["3", $b_playright], _
;~ ["4", $b_holdboth],["q", $b_rename_left],["w", $d_skipback],["e", $d_skipforward], _
;~ ["r", $b_rename_right],["a", $b_open_left],["s", $b_delete_left],["d", $b_delete_right], _
;~ ["f", $b_open_right],["x", $b_stopleft],["c", $b_stopright],["{ESC}", $d_stopsearch]]
;~ _ArrayDisplay($AccelKeys)
GUISetAccelerators($AccelKeys, $hGUI)
_LoadSettings()
_ApplySettings()
_ReadColors()
AdlibRegister("_UpdateControls", 200)
[/autoit] [autoit][/autoit] [autoit]While 1
$iVolume = GUICtrlRead($i_volume)
$__SKIPTIME = GUICtrlRead($i_skiptime)
Sleep(400)
If $iVolume <> GUICtrlRead($i_volume) Then
SoundSetWaveVolume(GUICtrlRead($i_volume))
IniWrite($hSettings, "Settings", "Volume", GUICtrlRead($i_volume))
EndIf
If GuiCtrlRead($timeslide_left) = 500 Or GuiCtrlRead($timeslide_right) = 500 Then _StopMusic()
If $iVolume > 100 Then GUICtrlSetData($i_volume, StringLeft($iVolume, 2))
If $__SKIPTIME > 100 Then GUICtrlSetData($i_skiptime, StringLeft($__SKIPTIME, 2))
If $__SKIPTIME < 3 Then GUICtrlSetData($i_skiptime, 3)
WEnd
#region Easter Eggs
Func _ToggleTeaTime()
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]#endregion Easter Eggs
[/autoit] [autoit][/autoit] [autoit]#region GUI-Funktionen
Func _NewInstance()
Run(@ScriptName)
EndFunc
Func _ToggleIgnore()
If GUICtrlRead($cb_ignorenexttime) = 4 Then
GUICtrlSetState($cb_ignorenexttime, $GUI_CHECKED)
Else
GUICtrlSetState($cb_ignorenexttime, $GUI_UNCHECKED)
EndIf
EndFunc
Func _ToggleSettings()
Local $aGUISettingsState = WinGetState($hGui_Settings)
If BitAND($aGUISettingsState, And BitAND($aGUISettingsState, 2) Then
GUISetState(@SW_ENABLE, $hGUI)
GUISetState(@SW_HIDE, $hGui_Settings)
GUISetState(@SW_DISABLE, $hGui_Settings)
_ApplySettings()
Sleep(200)
_LoadSettings()
$iSettingsActive = False
Else
_LoadSettings()
_CenterWindow($hGui, $hGui_Settings)
GUISetState(@SW_ENABLE, $hGui_Settings)
GUISetState(@SW_SHOWNORMAL, $hGui_Settings)
GUISetState(@SW_DISABLE, $hGUI)
$iSettingsActive = True
EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _ToggleAbout()
Local $aGUIAboutState = WinGetState($hGui_About)
If BitAND($aGUIAboutState, And BitAND($aGUIAboutState, 2) Then
GUISetState(@SW_ENABLE, $hGUI)
GUISetState(@SW_HIDE, $hGui_About)
GUISetState(@SW_DISABLE, $hGui_About)
Else
GUICtrlSetData($e_about, FileRead("About.txt"))
_CenterWindow($hGui, $hGui_About)
GUISetState(@SW_ENABLE, $hGui_About)
GUISetState(@SW_SHOWNORMAL, $hGui_About)
GUISetState(@SW_DISABLE, $hGUI)
EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _ToggleColor()
Local $aGuiColorState = WinGetState($hGui_Color)
Local $aGUISettingsState = WinGetState($hGui_Settings)
Local $aGUIState = WinGetState($hGui)
If BitAND($aGUISettingsState, And BitAND($aGUISettingsState, 2) Then ;==> wenn Settings-Fenster aktiv und sichtbar ist
If Not (BitAND($aGuiColorState, And BitAND($aGuiColorState, 2)) Then ;==> wenn Farben-Fenster nicht aktiv und sichtbar ist > öffnet farbfenster
_CenterWindow($hGui, $hGui_Settings)
GUISetState(@SW_SHOW, $hGui_Color)
GUISetState(@SW_ENABLE, $hGui_Color)
GUISetState(@SW_DISABLE, $hGui_Settings)
EndIf
Else ;==> wenn settings-Fenster nicht aktiv und sichtbar ist
If BitAND($aGuiColorState, And BitAND($aGuiColorState, 2) And $iSettingsActive = False Then ;==> farbfenster geöffnet und einstellungen nicht > schliesst farbfenster
GUISetState(@SW_ENABLE, $hGui)
GUISetState(@SW_HIDE, $hGui_Color)
GUISetState(@SW_DISABLE, $hGui_Color)
ElseIf BitAND($aGuiColorState, And BitAND($aGuiColorState, 2) And $iSettingsActive = True Then ;==> farbfenster geöffnet und einstellungen auch > schliesst farbfenster
GUISetState(@SW_ENABLE, $hGui_Settings)
GUISetState(@SW_HIDE, $hGui_Color)
GUISetState(@SW_DISABLE, $hGui_Color)
Else ;==> zeigt farbfenster wenn einstellungen NICHT geöffnet sind > öffnet farbfenster
_CenterWindow($hGui, $hGui_Color)
GUISetState(@SW_DISABLE, $hGui)
GUISetState(@SW_ENABLE, $hGui_Color)
GUISetState(@SW_SHOW, $hGui_Color)
EndIf
EndIf
EndFunc
Func _UpdateControls()
If $iPlay <> -1 And $iPlayer = 0 Then
GuiCtrlSetData($timeslide_left, 500 * (1 / (_SoundLength($hSound, 2) / _SoundPos($hSound, 2))))
GUICtrlSetData($l_SoundPosleft, StringTrimLeft(_SoundPos($hSound), 3))
ElseIf $iPlay <> -1 and $iPlayer = 1 Then
GuiCtrlSetData($timeslide_right, 500 * (1 / (_SoundLength($hSound, 2) / _SoundPos($hSound, 2))))
GUICtrlSetData($l_SoundPosright, StringTrimLeft(_SoundPos($hSound), 3))
EndIf
EndFunc
Func _MasterReset()
GUICtrlSetState($b_deleteboth, $GUI_DISABLE)
GUICtrlSetState($b_holdboth, $GUI_DISABLE)
GUICtrlSetState($b_delete_left, $GUI_DISABLE)
GUICtrlSetState($b_delete_right, $GUI_DISABLE)
GUICtrlSetState($b_playleft, $GUI_DISABLE)
GUICtrlSetState($b_playright, $GUI_DISABLE)
GUICtrlSetState($b_stopleft, $GUI_DISABLE)
GUICtrlSetState($b_stopright, $GUI_DISABLE)
GUICtrlSetState($b_rename_left, $GUI_DISABLE)
GUICtrlSetState($b_rename_right, $GUI_DISABLE)
GUICtrlSetState($b_open_left, $GUI_DISABLE)
GUICtrlSetState($b_open_right, $GUI_DISABLE)
GUICtrlSetState($b_move_left, $GUI_DISABLE)
GUICtrlSetState($b_move_right, $GUI_DISABLE)
_GUICtrlRichEdit_SetText($i_path_left, "")
_GUICtrlRichEdit_SetText($i_path_right, "")
_GUICtrlRichEdit_SetText($e_infos_left, "")
_GUICtrlRichEdit_SetText($e_infos_right, "")
EndFunc
Func _ClearListBox()
_GUICtrlListBox_BeginUpdate($hListBox)
_GUICtrlListBox_ResetContent($hListBox)
_GUICtrlListBox_EndUpdate($hListBox)
EndFunc
Func _Compare_Path($hControl1, $sPath1, $hControl2, $sPath2)
Local $sUnequalPath1wFile, $sUnequalPath2wFile, $aEqualFromRight1, $aEqualFromRight2
Local $sEnding1, $sEnding2, $sEqualFromRight1, $sEqualFromRight2
Local $sUnequalFromRight1, $sUnequalFromRight2
Local $aPath1 = StringSplit($sPath1, "")
If @error Then Return
Local $aPath2 = StringSplit($sPath2, "")
If @error Then Return
For $i = 1 To _SmallerNumber($aPath1[0], $aPath2[0]) - 1
If $aPath1[$i] = $aPath2[$i] Then
_GUICtrlRichEdit_WriteLine($hControl1, $aPath1[$i] & "", 0, "", $COLOR4, 0)
_GUICtrlRichEdit_WriteLine($hControl2, $aPath2[$i] & "", 0, "", $COLOR4, 0)
EndIf
Next
$sUnequalPath1wFile = StringReplace($sPath1, _GUICtrlRichEdit_GetText($hControl1), "")
$sUnequalPath2wFile = StringReplace($sPath2, _GUICtrlRichEdit_GetText($hControl2), "")
$sEnding1 = StringRight($sUnequalPath1wFile, 4)
$sUnequalPath1wFile = StringTrimRight($sUnequalPath1wFile, 4)
$sEnding2 = StringRight($sUnequalPath2wFile, 4)
$sUnequalPath2wFile = StringTrimRight($sUnequalPath2wFile, 4)
$aEqualFromRight1 = StringSplit($sUnequalPath1wFile, "")
If @error Then
$sUnequalFromRight1 = ""
EndIf
$aEqualFromRight2 = StringSplit($sUnequalPath2wFile, "")
If @error Then
$sUnequalFromRight2 = ""
EndIf
If IsArray($aEqualFromRight1) And IsArray($aEqualFromRight2) Then
Local $iCount = _SmallerNumber($aEqualFromRight1[0], $aEqualFromRight2[0])
_ArrayReverse($aEqualFromRight1)
_ArrayReverse($aEqualFromRight2)
For $i = 0 To $iCount - 1
If $aEqualFromRight1[$i] = $aEqualFromRight2[$i] Then
$sEqualFromRight1 = $aEqualFromRight1[$i] & $sEqualFromRight1
$sEqualFromRight2 = $aEqualFromRight2[$i] & $sEqualFromRight2
EndIf
Next
$sUnequalFromRight1 = StringReplace($sUnequalPath1wFile, $sEqualFromRight1, "")
$sUnequalFromRight2 = StringReplace($sUnequalPath2wFile, $sEqualFromRight2, "")
Else
If $sUnequalFromRight1 = "" Then
$sEqualFromRight1 = $aEqualFromRight1[0] & $sEqualFromRight1
$sEqualFromRight1 = $sUnequalPath2wFile
ElseIf $sUnequalFromRight2 = "" Then
$sEqualFromRight2 = $aEqualFromRight2[0] & $sEqualFromRight2
$sEqualFromRight2 = $sUnequalPath2wFile
EndIf
EndIf
;~
_GUICtrlRichEdit_WriteLine($hControl1, $sUnequalFromRight1, 0, "", $COLOR5, 0)
_GUICtrlRichEdit_WriteLine($hControl2, $sUnequalFromRight2, 0, "", $COLOR5, 0)
_GUICtrlRichEdit_WriteLine($hControl1, $sEqualFromRight1, 0, "", $COLOR6, 0)
_GUICtrlRichEdit_WriteLine($hControl2, $sEqualFromRight2, 0, "", $COLOR6, 0)
If $sEnding1 = $sEnding2 Then
_GUICtrlRichEdit_WriteLine($i_path_left, $sEnding1, 0, "", $COLOR6, 0)
_GUICtrlRichEdit_WriteLine($i_path_right, $sEnding2, 0, "", $COLOR6, 0)
Else
_GUICtrlRichEdit_WriteLine($i_path_left, $sEnding1, 0, "", $COLOR5, 0)
_GUICtrlRichEdit_WriteLine($i_path_right, $sEnding2, 0, "", $COLOR5, 0)
EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _CenterWindow($hWindow1, $hWindow2)
Local $aGUIPos1 = WinGetPos($hWindow1)
If @error Then Return
Local $aGUIPos2 = WinGetPos($hWindow2)
If @error Then Return
Local $DesktopWidth = @DesktopWidth
Local $DesktopHeight = @DesktopHeight
Local $NewPosX = ($aGUIPos1[0] + $aGUIPos1[2] / 2) - ($aGUIPos2[2] / 2)
Local $NewPosY = ($aGUIPos1[1] + $aGUIPos1[3] / 2) - ($aGUIPos2[3] / 2)
WinMove($hWindow2, "", $NewPosX, $NewPosY)
EndFunc
Func _Exit()
; Wirklich Beenden?
If $__ASKCLOSE = 1 Then
If MsgBox(292, "Dupes", "Wirklich beenden?") = 6 Then
_GUICtrlRichEdit_Destroy($e_infos_left)
_GUICtrlRichEdit_Destroy($e_infos_right)
_GUICtrlRichEdit_Destroy($i_path_left)
_GUICtrlRichEdit_Destroy($i_path_right)
_SoundStop($hSound)
_SoundClose($hSound)
Exit
EndIf
Else
_GUICtrlRichEdit_Destroy($e_infos_left)
_GUICtrlRichEdit_Destroy($e_infos_right)
_GUICtrlRichEdit_Destroy($i_path_left)
_GUICtrlRichEdit_Destroy($i_path_right)
_SoundStop($hSound)
_SoundClose($hSound)
Exit
EndIf
EndFunc
Func _GUICtrlRichEdit_WriteLine($hWnd, $sText, $iIncrement = 0, $sAttrib = "", $iColor = -1, $iNewLine = 1)
[/autoit] [autoit][/autoit] [autoit]; Count the @CRLFs
StringReplace(_GUICtrlRichEdit_GetText($hWnd, True), @CRLF, "")
Local $iLines = @extended
; Adjust the text char count to account for the @CRLFs
Local $iEndPoint = _GUICtrlRichEdit_GetTextLength($hWnd, True, True) - $iLines
; Add new text
If $iNewLine = 1 Then
_GUICtrlRichEdit_AppendText($hWnd, $sText & @CRLF)
Else
_GUICtrlRichEdit_AppendText($hWnd, $sText)
EndIf
; Select text between old and new end points
_GuiCtrlRichEdit_SetSel($hWnd, $iEndPoint, -1)
; Convert colour from RGB to BGR
$iColor = Hex($iColor, 6)
$iColor = '0x' & StringMid($iColor, 5, 2) & StringMid($iColor, 3, 2) & StringMid($iColor, 1, 2)
; Set colour
If $iColor <> -1 Then _GuiCtrlRichEdit_SetCharColor($hWnd, $iColor)
; Set size
If $iIncrement <> 0 Then _GUICtrlRichEdit_ChangeFontSize($hWnd, $iIncrement)
; Set weight
If $sAttrib <> "" Then _GUICtrlRichEdit_SetCharAttributes($hWnd, $sAttrib)
; Clear selection
_GUICtrlRichEdit_Deselect($hWnd)
EndFunc
[/autoit] [autoit][/autoit] [autoit]; #FUNCTION# ====================================================================================================================
; Name ..........: GUICtrlGetBkColor
; Description ...: Retrieves the RGB value of the control background.
; Syntax ........: GUICtrlGetBkColor($hWnd)
; Parameters ....: $hWnd - Control ID/Handle to the control
; Return values .: Success - RGB value
; Failure - 0
; Author ........: guinness
; Remarks .......: WinAPIEx is required.
; Example .......: Yes
; ===============================================================================================================================
Func GUICtrlGetBkColor($hWnd)
If IsHWnd($hWnd) = 0 Then
$hWnd = GUICtrlGetHandle($hWnd)
EndIf
Local $hDC = _WinAPI_GetDC($hWnd)
Local $iColor = _WinAPI_GetPixel($hDC, 0, 0)
_WinAPI_ReleaseDC($hWnd, $hDC)
Return $iColor
EndFunc
#endregion GUI-funktionen
#region Player-Funktionen
Func _TogglePlay()
Local $iBClicked = @GUI_CtrlHandle
GUICtrlSetState($b_stopleft, $GUI_ENABLE)
GUICtrlSetState($b_stopright, $GUI_ENABLE)
If $iPlay = -1 Then
If $iBClicked = GUICtrlGetHandle($b_playleft) Then
$iPlay = 1
ElseIf $iBClicked = GUICtrlGetHandle($b_playright) Then
$iPlay = 0
EndIf
$iPause = 0
EndIf
If $iBClicked = GUICtrlGetHandle($b_playleft) Then
If $iPlay = 0 Then
If $iPause = 0 Then
_SoundPause($hSound)
GUICtrlSetData($b_playleft, "Play")
$iPause = 1
ElseIf $iPause = 1 Then
_SoundResume($hSound)
GUICtrlSetData($b_playleft, "Pause")
$iPause = 0
EndIf
ElseIf $iPlay = 1 Then
_SoundStop($hSound)
If GUICtrlRead($timeslide_left) = 0 Then
$hSound = _SoundOpen(_GUICtrlRichEdit_GetText($i_path_left))
_SoundPlay($hSound)
Else
Local $iPos = GUICtrlRead($timeslide_left)
Local $iTime = _SoundLength($hSound, 2) * 1 / (500 / $iPos)
Local $sTime = _MStoTimeformat($iTime)
Local $aTime = StringSplit($sTime, ":")
_SoundSeek($hSound, $aTime[1], $aTime[2], $aTime[3])
_SoundPlay($hSound)
EndIf
GUICtrlSetData($b_playleft, "Pause")
GUICtrlSetData($b_playright, "Play")
EndIf
$iPlay = 0
$iPlayer = 0
ElseIf $iBClicked = GUICtrlGetHandle($b_playright) Then
If $iPlay = 0 Then
_SoundStop($hSound)
If GUICtrlRead($timeslide_right) = 0 Then
$hSound = _SoundOpen(_GUICtrlRichEdit_GetText($i_path_right))
_SoundPlay($hSound)
Else
Local $iPos = GUICtrlRead($timeslide_right)
Local $iTime = _SoundLength($hSound, 2) * 1 / (500 / $iPos)
Local $sTime = _MStoTimeformat($iTime)
Local $aTime = StringSplit($sTime, ":")
_SoundSeek($hSound, $aTime[1], $aTime[2], $aTime[3])
_SoundPlay($hSound)
EndIf
GUICtrlSetData($b_playright, "Pause")
GUICtrlSetData($b_playleft, "Play")
ElseIf $iPlay = 1 Then
If $iPause = 0 Then
_SoundPause($hSound)
GUICtrlSetData($b_playright, "Play")
$iPause = 1
ElseIf $iPause = 1 Then
_SoundResume($hSound)
GUICtrlSetData($b_playright, "Pause")
$iPause = 0
EndIf
EndIf
$iPlay = 1
$iPlayer = 1
EndIf
EndFunc
Func _SkipBackward()
Local $iPosTime = _SoundPos($hSound)
Local $sDatetime = "1980/01/01 " & $iPosTime
Local $sDiff = _DateAdd("s", $__SKIPTIME * -1, $sDatetime)
Local $sNewPos = StringSplit(StringRight($sDiff, 8), ":")
If $iPause = 0 Then
_SoundSeek($hSound, $sNewPos[1], $sNewPos[2], $sNewPos[3])
_SoundPlay($hSound)
EndIf
EndFunc
Func _SkipForward()
Local $iPosTime = _SoundPos($hSound)
Local $sDatetime = "1980/01/01 " & $iPosTime
Local $sDiff = _DateAdd("s", $__SKIPTIME, $sDatetime)
Local $sNewPos = StringSplit(StringRight($sDiff, 8), ":")
If $iPause = 0 Then
_SoundSeek($hSound, $sNewPos[1], $sNewPos[2], $sNewPos[3])
_SoundPlay($hSound)
EndIf
EndFunc
Func _StopMusic()
_SoundStop($hSound)
_SoundClose($hSound)
FileClose(_GUICtrlRichEdit_GetText($i_path_left))
FileClose(_GUICtrlRichEdit_GetText($i_path_right))
$iPlay = -1
$iPause = 0
GUICtrlSetState($b_stopleft, $GUI_DISABLE)
GUICtrlSetState($b_stopright, $GUI_DISABLE)
GUICtrlSetData($b_playleft, "Play")
GUICtrlSetData($b_playright, "Play")
GUICtrlSetData($l_SoundPosleft, "00:00")
GUICtrlSetData($l_SoundPosright, "00:00")
GuiCtrlSetData($timeslide_left, 0)
GuiCtrlSetData($timeslide_right, 0)
EndFunc
Func _SeekPosition()
Local $iBClicked = @GUI_CtrlHandle, $sTime, $iTime, $aTime
If $iPlay <> -1 Then
If $iPause = 0 Then
If $iBClicked = GUICtrlGetHandle($timeslide_left) And $iPlayer = 0 Then
Local $iPos = GuiCtrlRead($timeslide_left)
$iTime = _SoundLength($hSound, 2) * 1 / (500 / $iPos)
$sTime = _MStoTimeformat($iTime)
$aTime = StringSplit($sTime, ":")
_SoundSeek($hSound, $aTime[1], $aTime[2], $aTime[3])
_SoundPlay($hSound)
;~ _MStoTime(GUICtrlRead($timeslide_left))
;~ MsgBox(0, "", GUICtrlRead($timeslide_left))
ElseIf $iBClicked = GUICtrlGetHandle($timeslide_right) And $iPlayer = 1 Then
Local $iPos = GuiCtrlRead($timeslide_right)
$iTime = _SoundLength($hSound, 2) * 1 / (500 / $iPos)
$sTime = _MStoTimeformat($iTime)
$aTime = StringSplit($sTime, ":")
_SoundSeek($hSound, $aTime[1], $aTime[2], $aTime[3])
_SoundPlay($hSound)
EndIf
EndIf
EndIf
EndFunc
Func _VolumeUp()
GUICtrlSetData($i_volume, GUICtrlRead($i_volume) + 1)
EndFunc
Func _VolumeDown()
GUICtrlSetData($i_volume, GUICtrlRead($i_volume) - 1)
EndFunc
#endregion Player-Funktionen
[/autoit] [autoit][/autoit] [autoit]#region POOL-funktionen (verwaltung der beiden titel)
Func _NextEntry()
Local $iIndex, $sEntry
$__IGNORENEXTTIME = GUICtrlRead($cb_ignorenexttime)
$iIndex = _GUICtrlListBox_GetCurSel($hListBox)
$sEntry = _GUICtrlListBox_GetText($hListBox, $iIndex)
If $__IGNORENEXTTIME = 1 Then FileWriteLine($hIgnoreList, $aDupes[$iIndex][0] & " " & $aDupes[$iIndex][1])
If $iIndex = 0 Then
If _GUICtrlListBox_GetCount($hListBox) = 1 Then
_GUICtrlListBox_DeleteString($hListBox, $iIndex)
_ArrayDelete($aDupes, $iIndex)
_MasterReset()
EndIf
_GUICtrlListBox_SetCurSel($hListBox, 1)
_GUICtrlListBox_DeleteString($hListBox, $iIndex)
_ArrayDelete($aDupes, $iIndex)
_LoadTracks()
ElseIf $iIndex = _GUICtrlListBox_GetCount($hListBox) - 1 Then
_GUICtrlListBox_SetCurSel($hListBox, $iIndex - 1)
_GUICtrlListBox_DeleteString($hListBox, $iIndex)
_ArrayDelete($aDupes, $iIndex)
_LoadTracks()
Else
_GUICtrlListBox_SetCurSel($hListBox, $iIndex + 1)
_GUICtrlListBox_DeleteString($hListBox, $iIndex)
_ArrayDelete($aDupes, $iIndex)
_LoadTracks()
EndIf
GUICtrlSetState($cb_ignorenexttime, $GUI_UNCHECKED)
GUICtrlSetData($l_CountPairs, GUICtrlRead($l_CountPairs) -1 )
EndFunc
Func _OpenInExplorer()
Local $iBClicked = @GUI_CtrlHandle
If $iBClicked = GUICtrlGetHandle($b_open_left) Then
;~ Run ("explorer.exe " & GUICtrlRead($i_path_left) ,"")
Run("explorer.exe /n,/e,/select," & _GUICtrlRichEdit_GetText($i_path_left))
ElseIf $iBClicked = GUICtrlGetHandle($b_open_right) Then
;~ Run ("explorer.exe " & GUICtrlRead($i_path_right) ,"")
Run("explorer.exe /n,/e,/select," & _GUICtrlRichEdit_GetText($i_path_right))
EndIf
EndFunc
Func _MoveFile()
Local $iBClicked = @GUI_CtrlHandle, $sFirstPath = "", $sSecondPath = "", $iQuest, $newPath = ""
Local $sFile
Local $oFSO
_StopMusic()
If $iBClicked = GUICtrlGetHandle($b_move_left) Then ;-> verschieben links gedrückt
$sFirstPath = _GUICtrlRichEdit_GetText($i_path_left) ;-> erster pfad: links
$sSecondPath = _GUICtrlRichEdit_GetText($i_path_right) ;-> zweiter pfad: rechts
ElseIf $iBClicked = GUICtrlGetHandle($b_move_right) Then ;-> verschieben rechts gedrückt
$sFirstPath = _GUICtrlRichEdit_GetText($i_path_right)
$sSecondPath = _GUICtrlRichEdit_GetText($i_path_left)
EndIf
Dim $oFSO = ObjCreate("Scripting.FileSystemObject")
$oFSO.DeleteFile($sSecondPath, True)
$oFSO.MoveFile($sFirstPath, _GetFilePath($sSecondPath), True)
;~ $oFSO.DeleteFile($sFirstPath, True)
;~ $iQuest = MsgBox(35, $sTitle, "Titel 1 zu " & $sSecondPath & " verschieben und Titel 2 löschen?")
;~ If $iQuest = 2 Then Return ;-> abbrechen
;~ If $iQuest = 6 Then ;-> ja
;~ Local $idel = FileDelete($sSecondPath)
;~ If $idel = 0 Then
;~ MsgBox(48, $sTitle, "Fehler beim Löschen von Titel 2:" & @CRLF & @CRLF & $sSecondPath)
;~ Return
;~ EndIf
;~ Local $imove = FileMove($sFirstPath, $sSecondPath, 1)
;~ If $imove = 0 Then
;~ MsgBox(48, $sTitle, "Fehler beim Verschieben von Titel 1:" & @CRLF & @CRLF & $sFirstPath)
;~ Return
;~ Else
;~ If $iBClicked = GUICtrlGetHandle($b_move_left) Then
;~ _GUICtrlRichEdit_WriteLine($e_infos_left,@CRLF & "Verschoben...", 0, "+bo", 0x000000)
;~ _GUICtrlRichEdit_SetText($i_path_left, "")
;~ GUICtrlSetState($b_move_left, $GUI_DISABLE)
;~ ElseIf $iBClicked = GUICtrlGetHandle($b_move_right) Then
;~ _GUICtrlRichEdit_WriteLine($e_infos_right,@CRLF & "Verschoben...", 0, "+bo", 0x000000)
;~ _GUICtrlRichEdit_SetText($i_path_right, "")
;~ GUICtrlSetState($b_move_right, $GUI_DISABLE)
;~ EndIf
;~ EndIf
;~ ElseIf $iQuest = 7 Then ;-> nein
;~ $newPath = FileSelectFolder("Zielordner auswählen", "::{00021400-0000-0000-C000-000000000046}", 4, $sFirstPath, $hGUI)
;~ If @error Then Return ;-> abbrechen
;~ If FileMove($sFirstPath, $newPath) = 0 Then
;~ MsgBox(48, $sTitle, "Fehler beim Verschieben von Titel 1" & @CRLF & @CRLF & $sFirstPath)
;~ Return
;~ Else
;~ If $iBClicked = GUICtrlGetHandle($b_move_left) Then
;~ _GUICtrlRichEdit_WriteLine($e_infos_left,@CRLF & "Verschoben...", 0, "+bo", 0x000000)
;~ _GUICtrlRichEdit_SetText($i_path_left, StringReplace($sFirstPath, _GetFilePath($sFirstPath), $newPath & ""))
;~ GUICtrlSetState($b_move_left, $GUI_DISABLE)
;~ ElseIf $iBClicked = GUICtrlGetHandle($b_move_right) Then
;~ _GUICtrlRichEdit_WriteLine($e_infos_right,@CRLF & "Verschoben...", 0, "+bo", 0x000000)
;~ _GUICtrlRichEdit_SetText($i_path_right, StringReplace($sFirstPath, _GetFilePath($sFirstPath), $newPath & ""))
;~ GUICtrlSetState($b_move_right, $GUI_DISABLE)
;~ EndIf
;~ EndIf
;~ EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _LoadTracks()
Local $iCurSel, $sTrack[2], $sInfo = ""
Local $iBitrate[2], $sLength[2], $hInfo[2], $sSize[2], $sFilename
GUICtrlSetState($b_playleft, $GUI_ENABLE)
GUICtrlSetState($b_playright, $GUI_ENABLE)
;~ GUICtrlSetState($b_stopleft, $GUI_ENABLE)
;~ GUICtrlSetState($b_stopright, $GUI_ENABLE)
GUICtrlSetState($b_rename_left, $GUI_ENABLE)
GUICtrlSetState($b_rename_right, $GUI_ENABLE)
GUICtrlSetState($b_delete_left, $GUI_ENABLE)
GUICtrlSetState($b_delete_right, $GUI_ENABLE)
GUICtrlSetState($b_deleteboth, $GUI_ENABLE)
GUICtrlSetState($b_holdboth, $GUI_ENABLE)
GUICtrlSetState($b_open_left, $GUI_ENABLE)
GUICtrlSetState($b_open_right, $GUI_ENABLE)
GUICtrlSetState($b_move_left, $GUI_ENABLE)
GUICtrlSetState($b_move_right, $GUI_ENABLE)
GUICtrlSetData($timeslide_left, 0)
GUICtrlSetData($timeslide_right, 0)
_StopMusic()
[/autoit] [autoit][/autoit] [autoit]$iCurSel = _GUICtrlListBox_GetCurSel($hListBox)
$hInfo[0] = $e_infos_left
$hInfo[1] = $e_infos_right
_GUICtrlRichEdit_SetText($hInfo[0], "")
_GUICtrlRichEdit_SetText($hInfo[1], "")
_GUICtrlRichEdit_SetText($i_path_left, "")
_GUICtrlRichEdit_SetText($i_path_right, "")
If $iCurSel >= 0 Then
$sTrack[0] = $aDupes[$iCurSel][0]
$sTrack[1] = $aDupes[$iCurSel][1]
$sFilename = _GetFileName($sTrack[0], 1)
For $i = 0 To 1
$sLength[$i] = _SoundFile_GetLength($sTrack[$i])
$iBitrate[$i] = _SoundFile_GetBitrate($sTrack[$i])
$sSize[$i] = Round((FileGetSize($sTrack[$i]) / 1048576), 3)
Next
Local $iLength = _Compare_Length($sLength)
_GUICtrlRichEdit_WriteLine($hInfo[0], $sFilename, 0, "+bo", $COLOR3)
_GUICtrlRichEdit_WriteLine($hInfo[1], $sFilename, 0, "+bo", $COLOR3)
If $iLength = 0 Then ;==> beide gleich lang
_GUICtrlRichEdit_WriteLine($hInfo[0], "Länge: " & $sLength[0] & " Min", 0, "-bo", $COLOR3)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Länge: " & $sLength[1] & " Min", 0, "-bo", $COLOR3)
ElseIf $iLength = 1 Then ;==> erster track ist länger, somit grün, der andere rot..
_GUICtrlRichEdit_WriteLine($hInfo[0], "Länge: " & $sLength[0] & " Min", 0, "-bo", $COLOR4)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Länge: " & $sLength[1] & " Min", 0, "-bo", $COLOR8)
ElseIf $iLength = -1 Then ;==> zweiter track ist länger, somit grün
_GUICtrlRichEdit_WriteLine($hInfo[0], "Länge: " & $sLength[0] & " Min", 0, "-bo", $COLOR8)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Länge: " & $sLength[1] & " Min", 0, "-bo", $COLOR4)
EndIf
If $iBitrate[0] = $iBitrate[1] Then
_GUICtrlRichEdit_WriteLine($hInfo[0], "Bitrate: " & $iBitrate[0] & " kBit/s", 0, "", $COLOR3)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Bitrate: " & $iBitrate[1] & " kBit/s", 0, "", $COLOR3)
ElseIf $iBitrate[0] < $iBitrate[1] Then
_GUICtrlRichEdit_WriteLine($hInfo[0], "Bitrate: " & $iBitrate[0] & " kBit/s", 0, "", $COLOR8)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Bitrate: " & $iBitrate[1] & " kBit/s", 0, "", $COLOR4)
ElseIf $iBitrate[0] > $iBitrate[1] Then
_GUICtrlRichEdit_WriteLine($hInfo[0], "Bitrate: " & $iBitrate[0] & " kBit/s", 0, "", $COLOR4)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Bitrate: " & $iBitrate[1] & " kBit/s", 0, "", $COLOR8)
EndIf
If $sSize[0] = $sSize[1] Then
_GUICtrlRichEdit_WriteLine($hInfo[0], "Grösse: " & $sSize[0] & " MByte", 0, "", $COLOR3)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Grösse: " & $sSize[1] & " MByte", 0, "", $COLOR3)
ElseIf $sSize[0] < $sSize[1] Then
_GUICtrlRichEdit_WriteLine($hInfo[0], "Grösse: " & $sSize[0] & " MByte", 0, "", $COLOR8)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Grösse: " & $sSize[1] & " MByte", 0, "", $COLOR4)
ElseIf $sSize[0] > $sSize[1] Then
_GUICtrlRichEdit_WriteLine($hInfo[0], "Grösse: " & $sSize[0] & " MByte", 0, "", $COLOR4)
_GUICtrlRichEdit_WriteLine($hInfo[1], "Grösse: " & $sSize[1] & " MByte", 0, "", $COLOR8)
EndIf
;~ _GUICtrlRichEdit_WriteLine($hInfo[0], @CRLF & $sTrack[0], 0, "", 0x000000)
;~ _GUICtrlRichEdit_WriteLine($hInfo[1], @CRLF & $sTrack[1], 0, "", 0x000000)
_Compare_Path($i_path_left, $sTrack[0], $i_path_right, $sTrack[1])
;~ GUICtrlSetData($i_path_left, $sTrack[0])
;~ GUICtrlSetData($i_path_right, $sTrack[1])
GUICtrlSetData($l_SoundLenleft, $sLength[0])
GUICtrlSetData($l_SoundLenright, $sLength[1])
EndIf
GUICtrlSetState($hListBox, $GUI_FOCUS)
If $__AUTOPLAY = 1 Then
_GUICtrlButton_Click($b_playleft)
EndIf
GUICtrlSetState($hListBox, $GUI_FOCUS)
EndFunc
Func _RenameFile()
Local $iBClicked = @GUI_CtrlHandle
Local $sNewName, $sOldName, $sSuffix
Local $oFSO = ObjCreate("Scripting.FileSystemObject")
Local $sFile
If $iBClicked = GUICtrlGetHandle($b_rename_left) Then
If FileExists(_GUICtrlRichEdit_GetText($i_path_left)) Then
$sOldName = _GUICtrlRichEdit_GetText($i_path_left)
$sNewName = InputBox($sTitle, "Neuen Dateinamen für Titel 1 eingeben...", _GetFileName($sOldName))
If $sNewName <> "" Then
If $iPlay <> -1 And $iPlayer = 0 Then _StopMusic()
$sSuffix = StringRight($sOldName, 4)
$sFile = $oFSO.GetFile($sOldName)
$sNewName &= $sSuffix
$sFile.Name = $sNewName
_GUICtrlRichEdit_SetText($i_path_left, StringReplace($sOldName, _GetFileName($sOldName, True), $sNewName))
_GUICtrlRichEdit_WriteLine($e_infos_left, "Datei umbenannt:", 0, "+bo", $COLOR4)
_GUICtrlRichEdit_WriteLine($e_infos_left, $sNewName, 0, "", $COLOR3)
EndIf
EndIf
ElseIf $iBClicked = GUICtrlGetHandle($b_rename_right) Then
If FileExists(_GUICtrlRichEdit_GetText($i_path_right)) Then
$sOldName = _GUICtrlRichEdit_GetText($i_path_right)
$sNewName = InputBox($sTitle, "Neuen Dateinamen für Titel 2 eingeben...", _GetFileName($sOldName))
If $sNewName <> "" Then
If $iPlay <> -1 And $iPlayer = 1 Then _StopMusic()
$sSuffix = StringRight($sOldName, 4)
$sFile = $oFSO.GetFile($sOldName)
$sNewName &= $sSuffix
$sFile.Name = $sNewName
_GUICtrlRichEdit_SetText($i_path_right, StringReplace($sOldName, _GetFileName($sOldName, True), $sNewName))
_GUICtrlRichEdit_WriteLine($e_infos_right, "Datei umbenannt:", 0, "+bo", $COLOR4)
_GUICtrlRichEdit_WriteLine($e_infos_right, $sNewName, 0, "", $COLOR3)
EndIf
EndIf
EndIf
EndFunc
Func _DeleteFile()
Local $iBClicked = @GUI_CtrlHandle
Local $iQuest, $sFile
If $iBClicked = GUICtrlGetHandle($b_delete_left) Then
$sFile = _GUICtrlRichEdit_GetText($i_path_left)
If $__ASKDELSINGLE = 1 Then
$iQuest = MsgBox(292, $sTitle, 'Datei "' & $sFile & '" wirklich löschen?')
If $iQuest = 7 Then Return
EndIf
If $iPlayer = 0 Then _SoundStop($hSound)
If FileDelete($sFile) Then
_GUICtrlRichEdit_WriteLine($e_infos_left, "Gelöscht!", 0, "+bo", $COLOR8)
Else
_GUICtrlRichEdit_WriteLine($e_infos_left, "Löschen fehlgeschlagen!", 0, "+bo", $COLOR8)
EndIf
GUICtrlSetState($b_open_left, $GUI_DISABLE)
GUICtrlSetState($b_deleteboth, $GUI_DISABLE)
GUICtrlSetState($b_playleft, $GUI_DISABLE)
GUICtrlSetState($b_stopleft, $GUI_DISABLE)
GUICtrlSetState($b_rename_left, $GUI_DISABLE)
GUICtrlSetState($b_delete_left, $GUI_DISABLE)
ElseIf $iBClicked = GUICtrlGetHandle($b_delete_right) Then
$sFile = _GUICtrlRichEdit_GetText($i_path_right)
If $__ASKDELSINGLE = 1 Then
$iQuest = MsgBox(292, $sTitle, 'Datei "' & $sFile & '" wirklich löschen?')
If $iQuest = 7 Then Return
EndIf
If $iPlayer = 1 Then _SoundStop($hSound)
If FileDelete($sFile) Then
_GUICtrlRichEdit_WriteLine($e_infos_right, "Gelöscht!", 0, "+bo", $COLOR8)
Else
_GUICtrlRichEdit_WriteLine($e_infos_right, "Löschen fehlgeschlagen!", 0, "+bo", $COLOR8)
EndIf
GUICtrlSetState($b_open_right, $GUI_DISABLE)
GUICtrlSetState($b_deleteboth, $GUI_DISABLE)
GUICtrlSetState($b_playright, $GUI_DISABLE)
GUICtrlSetState($b_stopright, $GUI_DISABLE)
GUICtrlSetState($b_rename_right, $GUI_DISABLE)
GUICtrlSetState($b_delete_right, $GUI_DISABLE)
EndIf
EndFunc
Func _DeleteBoth()
If $__ASKDELDOUBLE = 1 Then
Local $iQuest = MsgBox(292, $sTitle, "Wirklich beide Files löschen?")
If $iQuest = 7 Then Return
EndIf
_StopMusic()
FileDelete(_GUICtrlRichEdit_GetText($i_path_left))
FileDelete(_GUICtrlRichEdit_GetText($i_path_right))
_NextEntry()
EndFunc
Func _OpenPath()
Local $path = IniRead($hSettings, "Settings", "LastPath", "")
If FileExists($path) Then
$path = FileSelectFolder("Pfad zur Musiksammlung öffnen...", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 4, StringLeft($path, 3), $hGUI) ;==> Dialog, um Ordner auszuwählen
Else
$path = FileSelectFolder("Pfad zur Musiksammlung öffnen...", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 4, "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", $hGUI) ;==> Dialog, um Ordner auszuwählen
EndIf
If @error Then Return
If FileExists($path) Then
;~ _ClearListBox()
GUICtrlSetData($i_Path, $path) ;==> Wenn nicht abgebrochen wird, wird der Pfad in das Input-Feld geschrieben
IniWrite($hSettings, "Settings", "LastPath", $path)
EndIf
EndFunc
#endregion POOL-Funktionen
[/autoit] [autoit][/autoit] [autoit]#region Such- und Analysefunktionen
[/autoit] [autoit][/autoit] [autoit]Func _Scan() ;===> Abgeänderte Version einer Funktion aus dem MP3-DoubleFinder von Oscar (http://www.autoit.de)
Global $a_Titles[100000]
;==> Array, in welchen die gefundenen Titel geladen werden
Local $s_Path = "", $tmp_path, $aPos = WinGetPos($hGUI)
;~ _ArrayDisplay($a_Titles)
Dim $a_Files
$s_Path = GUICtrlRead($i_Path) ;==> Pfad aus Input auslesen
If Not ($s_Path And FileExists($s_Path)) Then Return ;==> Wenn der Pfad nicht vorhanden ist, geschieht nichts
If $iPlay = 0 And $iPause = 0 Then _StopMusic()
_MasterReset()
If $__ASKSCAN = 1 Then
Local $closequest = MsgBox(292, $sTitle, "Ordner wirklich neu Scannen?")
If $closequest = 7 Then Return
EndIf
_ReadIgnoreList()
GUICtrlSetState($b_scan, $GUI_DISABLE) ;==> "Scannen"-Button deaktivieren
GUICtrlSetState($b_openpath, $GUI_DISABLE)
GUICtrlSetData($l_CountPairs, "0") ; Zähl-Labels zurücksetzen
GUICtrlSetData($l_CountTracks, "0")
_ClearListBox() ;==> Listbox leeren
$iStop = False
$i_PairCount = 0
;~ ToolTip($sMsg, $aPos[0] + 309, $aPos[1] + 400, $sTitle, 1, 3)
;~ _FileListToArrayRecursive($s_Path, $a_Files) ;==> Dateipfad nach audiodateien durchsuchen
$a_Files = _RecursiveFileListToArray($s_Path, '(.+(\.mp3|\.wav|\.ogg|\.wma))', 1, 1)
For $i = 1 To $a_Files[0] ;==> Dateinamen aus $a_Files auslesen -> wird in $a_Titles gespeichert
$tmp_path = StringSplit($a_Files[$i], "")
$a_Titles[$i] = $tmp_path[$tmp_path[0]]
Next
$a_Titles[0] = $i - 1
ReDim $a_Titles[$i]
ReDim $a_Files[$i]
If $a_Files[0] = 0 Then ;==> wenn keine Musikdateien gefunden wurden
_PlayDefaultSystemSound('SystemAsterisk') ; Danke, funkey!
GUICtrlSetState($b_scan, $GUI_ENABLE)
GUICtrlSetState($b_openpath, $GUI_ENABLE)
;~ ToolTip("")
_GUICtrlListBox_AddString($hListBox, "Keine Musikdateien gefunden...")
Return
Else
GUICtrlSetData($l_CountTracks, $a_Titles[0])
;~ ToolTip($sMsg, $aPos[0] + 420, $aPos[1] + 175, $sTitle, 1, 3)
EndIf
GUICtrlSetData($l_ActualDir, "")
Local $oDictionary = ObjCreate('Scripting.Dictionary')
Local $oID3 = ObjCreate('Scripting.Dictionary')
Local $sFilename, $iFuzzyPar, $iFuzzySum
Local $iFileSize, $aID3Tags, $tmp_filename
ReDim $aDupes[$a_Files[0]][2]
Local $iTimer = TimerInit(), $sRuntime
For $i = 1 To $a_Files[0]
If $iStop Then ;==> wenn {ESC} gedrückt wurde, scan abbrechen
_AbortScan()
Return
EndIf
$sFilename = StringTrimRight(StringTrimLeft($a_Files[$i], StringInStr($a_Files[$i], '\', 1, -1)), 4)
If $oDictionary.Exists($sFilename) Then
$aDupes[$i_PairCount][0] = $oDictionary.Item($sFilename)
$aDupes[$i_PairCount][1] = $a_Files[$i]
$tmp_filename = StringSplit($a_Files[$i], "")
If Not (_IsIgnored($aDupes[$i_PairCount][0]) And _IsIgnored($aDupes[$i_PairCount][1])) Then
_GUICtrlListBox_AddString($hListBox, StringTrimRight($tmp_filename[$tmp_filename[0]], 4))
$i_PairCount += 1
GUICtrlSetData($l_CountPairs, $i_PairCount)
EndIf
ContinueLoop
Else
$oDictionary.Add($sFilename, $a_Files[$i])
EndIf
Next
If $iStop = True Then Return
$sRuntime = _NewTicksToTime(TimerDiff($iTimer))
_PlayDefaultSystemSound('SystemExclamation') ; Danke, funkey!
GUICtrlSetState($b_scan, $GUI_ENABLE)
GUICtrlSetState($b_openpath, $GUI_ENABLE)
If $i_PairCount = 0 Then
_GUICtrlListBox_AddString($hListBox, "Keine doppelten Tracks gefunden...")
ReDim $aDupes[1][2]
Else
ReDim $aDupes[$i_PairCount][2]
EndIf
;~ _ArrayDisplay($aDupes)
_GUICtrlListBox_SetCurSel($hListBox, 0)
_LoadTracks()
EndFunc
;===============================================================================
; Function Name: _RecursiveFileListToArray($sPath[, $sPattern][, $iFlag][, $iFormat][, $iRecursion][, $sDelim])
; Description:: gibt Verzeichnisse (rekursiv) und/oder Dateien zurück, die einem RegExp-Pattern entsprechen
; Parameter(s): $sPath = Startverzeichnis
; $sPattern = ein beliebiges RexExp-Pattern für die Auswahl
; $iFlag = Auswahl
; 0 = Dateien & Verzeichnisse
; 1 = nur Dateien
; 2 = nur Verzeichnisse
; $iFormat = Rückgabeformat
; 0 = String
; 1 = Array mit [0] = Anzahl
; 2 = Nullbasiertes Array
; $iRecursion = Verzeichnisse rekursiv durchsuchen
; 0 = Nein
; 1 = Ja
; $sDelim = Trennzeichen für die String-Rückgabe
; Requirement(s): AutoIt 3.3.6.0
; Return Value(s): Array/String mit den gefundenen Dateien/Verzeichnissen
; Author(s): Oscar (http://www.autoit.de)
; Anregungen von: bernd670 (http://www.autoit.de)
;===============================================================================
Func _RecursiveFileListToArray($sPath, $sPattern = '', $iFlag = 0, $iFormat = 1, $iRecursion = 1, $sDelim = @CRLF)
Local $hSearch, $sFile, $sReturn = ''
If StringRight($sPath, 1) <> '\' Then $sPath &= '\'
$hSearch = FileFindFirstFile($sPath & '*.*')
If @error Or $hSearch = -1 Then Return SetError(1, 0, $sReturn)
While True
$sFile = FileFindNextFile($hSearch)
If @error Then ExitLoop
If @extended Then
If StringRegExp($sPath & $sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 2) Then $sReturn &= $sPath & $sFile & '\' & $sDelim
If $iRecursion Then $sReturn &= _RecursiveFileListToArray($sPath & $sFile & '\', $sPattern, $iFlag, 0)
ContinueLoop
EndIf
If StringRegExp($sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 1) Then $sReturn &= $sPath & $sFile & $sDelim
GUICtrlSetData($l_ActualDir, $sPath)
WEnd
FileClose($hSearch)
If $iFormat And $sReturn = '' Then Return StringSplit($sReturn, '', $iFormat)
If $iFormat Then Return StringSplit(StringTrimRight($sReturn, StringLen($sDelim)), $sDelim, $iFormat)
Return $sReturn
EndFunc
Func _IsIgnored($sPath)
If StringInStr($sIgnoreList, $sPath) = 0 Then
Return 0
Else
Return 1
EndIf
EndFunc
Func _AbortScan()
$iStop = True
EndFunc
Func _SoundFile_GetBitrate($sPath)
Local $answer
EndFunc
[/autoit] [autoit][/autoit] [autoit]; #FUNCTION#
;===============================================================================
;
; Name...........: _MStoTimeformat
; Description ...: Wandelt Millisekunden in das Format HH:MM:SS um
; Syntax.........: _MStoTimeformat($MStTf_MS)
; Parameters ....: $MStTf_MS - Zeit in Millisekunden (z.B vom TimerDiff() zurückgegeben
; Return values .: Success - Gibt die Millisekunden im Format HH:MM:SS zurück
; Failure - Returns 0 and Sets @Error:
; |1 - $MStTf_MS ist keine Zahl
; Author ........: TheLuBu ([email='LuBu@veytal.com'][/email])
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
;
;==========================================================================================
Func _MStoTimeformat($MStTf_MS)
;~ If not IsNumber($MStTf_MS) Then Return SetError(1,0,0)
Local $MStTf_vorzeichen = "", $MStTf_Endzeit, $MStTf_Stunden, $MStTf_Minuten, $MStTf_Sekunden, $MStTf_sret
If $MStTf_MS < 0 Then
$MStTf_MS = Abs($MStTf_MS)
$MStTf_vorzeichen = "-"
EndIf
$MStTf_Endzeit = $MStTf_MS / 1000
$MStTf_Stunden = $MStTf_Endzeit / 3600
$MStTf_Stunden = Int($MStTf_Stunden)
$MStTf_Minuten = (($MStTf_Endzeit / 60) - ($MStTf_Stunden * 60))
$MStTf_Minuten = Int($MStTf_Minuten)
$MStTf_Sekunden = ($MStTf_Endzeit - ($MStTf_Minuten * 60) - ($MStTf_Stunden * 3600))
$MStTf_Sekunden = Int($MStTf_Sekunden)
If $MStTf_Stunden < 10 Then $MStTf_Stunden = "0" & $MStTf_Stunden
If $MStTf_Minuten < 10 Then $MStTf_Minuten = "0" & $MStTf_Minuten
If $MStTf_Sekunden < 10 Then $MStTf_Sekunden = "0" & $MStTf_Sekunden
$MStTf_sret = $MStTf_vorzeichen & $MStTf_Stunden & ":" & $MStTf_Minuten & ":" & $MStTf_Sekunden
Return $MStTf_sret
EndFunc ;==>MStoTimeformat
Func _Compare_Length(ByRef $aLength)
If Not IsArray($aLength) Then Return
Local $Seconds[2]
For $i = 0 To 1
$Seconds[$i] = (StringLeft($aLength[$i], 2) * 60) + StringRight($aLength[$i], 2)
Next
If $Seconds[0] = $Seconds[1] Then
Return 0
ElseIf $Seconds[0] < $Seconds[1] Then
Return -1
ElseIf $Seconds[0] > $Seconds[1] Then
Return 1
EndIf
EndFunc
Func _GetFileName($sPath, $iSuffix = False)
Local $aSplit = StringSplit($sPath, "")
If Not @error Then
If $iSuffix = False Then
Return StringTrimRight($aSplit[$aSplit[0]], 4)
Else
Return $aSplit[$aSplit[0]]
EndIf
EndIf
EndFunc
Func _GetFilePath($sPath)
Local $aSplit = StringSplit($sPath, "")
If Not @error Then Return StringReplace($sPath, $aSplit[$aSplit[0]], "")
EndFunc
Func _NewTicksToTime($iTicks)
Local $iHours, $iMins, $iSecs = Int($iTicks / 1000), $iMSecs = $iTicks - $iSecs * 1000
$iHours = Int($iSecs / 3600)
$iSecs = Mod($iSecs, 3600)
$iMins = Int($iSecs / 60)
$iSecs = Mod($iSecs, 60)
Return StringFormat('%02i:%02i:%02i.%03i', $iHours, $iMins, $iSecs, $iMSecs)
EndFunc ;==>_NewTicksToTime
Func _SoundFile_GetLength($sPath)
Local $sLen
If FileExists($sPath) Then
_SoundOpen($sPath)
If @error Then SetError(1)
$sLen = _SoundLength($sPath)
_SoundClose($sPath)
EndIf
Return StringTrimLeft($sLen, 3) ; $Mins & ":" & $Secs
EndFunc
;~ Func mciSendString($string)
;~ Local $ret
;~ $ret = DllCall("winmm.dll","int","mciSendString","str",$string,"str","","int",65534,"hwnd",0)
;~ If Not @error Then Return $ret[2]
;~ EndFunc
; #FUNCTION# ====================================================================================================================
; Name...........: _PlayDefaultSystemSound()
; Description ...: Spielt einen Systemklang, welcher in der Registry definiert ist.
; Syntax.........: _PlayDefaultSystemSound($sSoundName, $iWait = 0)
; Parameters ....: $sSoundName - Name des SystemSound's
; | Default - Standardton Warnsignal / Default Beep
; | CriticalBatteryAlarm - Alarm bei kritischem Batteriestand / when battery is critical
; | DeviceConnect - Geräteanschluß / when a device is connect
; | DeviceDisconnect - Gerätetrennung / when a device is disconnect
; | DeviceFail - Geräteanschluß fehlgeschlagen / when a deviceconnect is fail
; | LowBatteryAlarm - Alarm bei niedrigem Batteriestand / when battery is low
; | MailBeep - Posteingangsbenachrichtigung / when email is received
; | SystemAsterisk - Stern / Asterisk
; | SystemExclamation - Hinweis / when windows shows a warning
; | SystemExit - Windows beenden / when Windows shuts down
; | SystemHand - Kritischer Abbruch / when a critical stop occurs
; | SystemNotification - Sprechblase / when a critical stop occurs
; | SystemStart - Windows starten / when Windows starts up
; | WindowsLogoff - beim Windows abmelden / when logging off Windows
; | WindowsLogon - beim Windows anmelden / when logging on Windows
; | EmptyRecycleBin - Löschen des Papierkorbs / when recycle bin is emptied
; | Navigating - Browser Klick / navigating in browser
; $iWait - Warten bis SoundPlay beendet? (0 = nein / 1 = ja)
; Return values .: -----
; Author ........: funkey (AutoIt.de)
; ===============================================================================================================================
Func _PlayDefaultSystemSound($sSoundName, $iWait = 0) ; funkey
Local $sKey = 'HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default'
If $sSoundName = 'EmptyRecycleBin' Or $sSoundName = 'Navigating' Then $sKey = 'HKEY_CURRENT_USER\AppEvents\Schemes\Apps\Explorer'
Local $sFile = StringReplace(RegRead($sKey & '\' & $sSoundName & '\.Default', ''), '%SystemRoot%', @WindowsDir)
If $sFile = "" Then
SoundPlay(StringReplace(RegRead($sKey & '\.Default\.Default', ''), '%SystemRoot%', @WindowsDir), $iWait)
Else
SoundPlay($sFile, $iWait)
EndIf
EndFunc ;==>_PlayDefaultSystemSound
#endregion Suchfunktionen
[/autoit] [autoit][/autoit] [autoit]#region Settings-Funktionen
[/autoit] [autoit][/autoit] [autoit]Func _ApplyColors()
Local $iBClicked = @GUI_CtrlId
Local $aColors[8]
For $i = 0 To 7
$aColors[$i] = GUICtrlGetBkColor($aControls[$i][1])
Next
$COLOR1 = "0x" & StringTrimLeft(Hex($aColors[0]), 2)
$COLOR2 = "0x" & StringTrimLeft(Hex($aColors[1]), 2)
$COLOR3 = "0x" & StringTrimLeft(Hex($aColors[2]), 2)
$COLOR4 = "0x" & StringTrimLeft(Hex($aColors[3]), 2)
$COLOR5 = "0x" & StringTrimLeft(Hex($aColors[4]), 2)
$COLOR6 = "0x" & StringTrimLeft(Hex($aColors[5]), 2)
$COLOR7 = "0x" & StringTrimLeft(Hex($aColors[6]), 2)
$COLOR8 = "0x" & StringTrimLeft(Hex($aColors[7]), 2)
GUISetBkColor($COLOR1, $hGUI) ;==> GUI Hintergrundfarbe COLOR1
GUISetBkColor($COLOR1, $hGui_Settings)
GUISetBkColor($COLOR1, $hGui_About)
GUISetBkColor($COLOR1, $hGui_Color)
GUISetBkColor($COLOR1, $hGUI_Shorcut)
GUICtrlSetBkColor($timeslide_left, $COLOR1)
GUICtrlSetBkColor($timeslide_right, $COLOR1) ;==< GUI Hintergrundfarbe COLOR1
GUICtrlSetDefBkColor($COLOR2, $hGUI) ;==> GUI Sekundärfarbe COLOR2 (farbe der Edits und Inputs)
GUICtrlSetDefBkColor($COLOR2, $hGui_Settings)
GUICtrlSetDefBkColor($COLOR2, $hGui_About)
GUICtrlSetDefBkColor($COLOR2, $hGui_Color)
GUICtrlSetDefBkColor($COLOR2, $hGUI_Shorcut) ;==< GUI Sekundärfarbe COLOR2
GUICtrlSetDefColor($COLOR3, $hGui) ;==> GUI Schriftfarbe
GUICtrlSetDefColor($COLOR3, $hGui_Settings)
GUICtrlSetDefColor($COLOR3, $hGui_About)
GUICtrlSetDefColor($COLOR3, $hGui_Color)
GUICtrlSetDefColor($COLOR3, $hGUI_Shorcut) ;==> GUI Schriftfarbe
IniWrite($hSettings, "Settings", "Color1", $COLOR1)
IniWrite($hSettings, "Settings", "Color2", $COLOR2)
IniWrite($hSettings, "Settings", "Color3", $COLOR3)
IniWrite($hSettings, "Settings", "Color4", $COLOR4)
IniWrite($hSettings, "Settings", "Color5", $COLOR5)
IniWrite($hSettings, "Settings", "Color6", $COLOR6)
IniWrite($hSettings, "Settings", "Color7", $COLOR7)
IniWrite($hSettings, "Settings", "Color8", $COLOR8)
If $iBClicked = $b_colors_ok Then _ToggleColor()
EndFunc
Func _ReadColors()
$aControls[0][0] = $b_pick1
$aControls[0][1] = $l_Color1
$aControls[1][0] = $b_pick2
$aControls[1][1] = $l_Color2
$aControls[2][0] = $b_pick3
$aControls[2][1] = $l_Color3
$aControls[3][0] = $b_pick4
$aControls[3][1] = $l_Color4
$aControls[4][0] = $b_pick5
$aControls[4][1] = $l_Color5
$aControls[5][0] = $b_pick6
$aControls[5][1] = $l_Color6
$aControls[6][0] = $b_pick7
$aControls[6][1] = $l_Color7
$aControls[7][0] = $b_pick8
$aControls[7][1] = $l_Color8
$COLOR1 = IniRead($hSettings, "Settings", "Color1", 0xBDBDBD)
$COLOR2 = IniRead($hSettings, "Settings", "Color2", 0xDCDCDC)
$COLOR3 = IniRead($hSettings, "Settings", "Color3", 0x000000)
$COLOR4 = IniRead($hSettings, "Settings", "Color4", 0x228B22)
$COLOR5 = IniRead($hSettings, "Settings", "Color5", 0xFF8C00)
$COLOR6 = IniRead($hSettings, "Settings", "Color6", 0x0080FF)
$COLOR7 = IniRead($hSettings, "Settings", "Color7", 0x009900)
$COLOR8 = IniRead($hSettings, "Settings", "Color8", 0xEE2C2C)
GUICtrlSetBkColor($l_Color1, $COLOR1)
GUICtrlSetBkColor($l_Color2, $COLOR2)
GUICtrlSetBkColor($l_Color3, $COLOR3)
GUICtrlSetBkColor($l_Color4, $COLOR4)
GUICtrlSetBkColor($l_Color5, $COLOR5)
GUICtrlSetBkColor($l_Color6, $COLOR6)
GUICtrlSetBkColor($l_Color7, $COLOR7)
GUICtrlSetBkColor($l_Color8, $COLOR8)
EndFunc
Func _GetColor()
Local $iBClicked = @GUI_CtrlId
Local $Data, $sSearch
$sSearch = _ArraySearch($aControls, $iBClicked)
$Color = GUICtrlGetBkColor($aControls[$sSearch][1])
$Data = _ColorChooserDialog($Color, $hGui_Color)
If $Data > -1 Then
$sSearch = _ArraySearch($aControls, $iBClicked)
;~ If $sSearch = -1 Then Return
GUICtrlSetBkColor($aControls[$sSearch][1], $Data)
$Color = $Data
EndIf
EndFunc
Func _ResetSettings()
Local $iResetQuest = MsgBox(292, $sTitle, "Einstellungen wirklich zurücksetzen?")
If $iResetQuest = 7 Then Return
FileClose($hSettings)
FileDelete($hSettings)
Local $iDelIgnoreList = MsgBox(292, $sTitle, 'Die "Nächstes Mal Ignorieren"-Liste auch löschen"')
If $iDelIgnoreList = 6 Then
FileClose($hIgnoreList)
FileDelete($hIgnoreList)
EndIf
_ResourceSaveToFile("settings.ini", "DEFSETTINGS")
Sleep(300)
_LoadSettings()
_ApplySettings()
$hIgnoreList = "ignorelist.txt"
EndFunc
Func _ApplySettings()
$__ASKCLOSE = IniRead($hSettings, "Settings", "AskClose", 1)
$__ASKSCAN = IniRead($hSettings, "Settings", "AskScan", 1)
$__ASKDELSINGLE = IniRead($hSettings, "Settings", "AskDel", 1)
$__ASKDELDOUBLE = IniRead($hSettings, "Settings", "AskDeld", 1)
$__AUTOPLAY = IniRead($hSettings, "Settings", "AutoPlay", 1)
$__SKIPTIME = IniRead($hSettings, "Settings", "SkipTime", 10)
$aFunctions[0] = $b_playleft
$aFunctions[1] = $b_rename_left
$aFunctions[2] = $b_move_left
$aFunctions[3] = $b_delete_left
$aFunctions[4] = $b_open_left
$aFunctions[5] = $b_playright
$aFunctions[6] = $b_rename_right
$aFunctions[7] = $b_move_right
$aFunctions[8] = $b_delete_right
$aFunctions[9] = $b_open_right
$aFunctions[10] = $d_skipforward
$aFunctions[11] = $d_skipback
$aFunctions[12] = $b_stopleft
$aFunctions[13] = $b_holdboth
$aFunctions[14] = $d_ignorenexttime
$aFunctions[15] = $b_deleteboth
$aFunctions[16] = $b_openpath
$aFunctions[17] = $b_scan
$aFunctions[18] = $d_stopsearch
$aFunctions[19] = $d_volumeup
$aFunctions[20] = $d_volumedown
$aFunctions[21] = $d_settings
$aFunctions[22] = $hOptionsMenu_Color
$aFunctions[23] = $hFileMenu_new
For $i = 0 To 23
Local $sSection = "Shortcut" & $i + 1
$aShortCuts[$i] = String(IniRead($hSettings, $sSection, "Shortcut", "Fehler"))
Next
For $i = 0 To 23
$AccelKeys[$i][0] = $aShortCuts[$i]
$AccelKeys[$i][1] = $aFunctions[$i]
Next
;~ _ArrayDisplay($AccelKeys)
Local $test = GUISetAccelerators($AccelKeys, $hGUI)
EndFunc
Func _LoadSettings()
Local $a_Shortcuts[24][2], $sShortcut
For $i = 1 To 24
$sShortcut = "Shortcut" & $i
$a_Shortcuts[$i - 1][0] = IniRead($hSettings, $sShortcut, "Name", "Fehler")
$a_Shortcuts[$i - 1][1] = IniRead($hSettings, $sShortcut, "Shortcut", "Fehler")
Next
;~ _ArrayDisplay($a_Shortcuts)
_GUICtrlListView_DeleteAllItems($h_ListViewSettings)
_GUICtrlListView_AddArray($h_ListViewSettings, $a_Shortcuts)
GUICtrlSetState($cb_ask_scan, IniRead($hSettings, "Settings", "AskScan", $GUI_CHECKED))
GUICtrlSetState($cb_ask_delsingle, IniRead($hSettings, "Settings", "AskDel", $GUI_CHECKED))
GUICtrlSetState($cb_ask_deldouble, IniRead($hSettings, "Settings", "AskDeld", $GUI_CHECKED))
GUICtrlSetState($cb_ask_close, IniRead($hSettings, "Settings", "AskClose", $GUI_CHECKED))
GUICtrlSetState($cb_player_autoplay, IniRead($hSettings, "Settings", "AutoPlay", $GUI_UNCHECKED))
GUICtrlSetData($i_skiptime, IniRead($hSettings, "Settings", "SkipTime", 10))
EndFunc
Func _GetShortCut($iIndex)
Local $iKeyPressed, $iSearch
GUISetState(@SW_DISABLE, $hGui_Settings)
GUISetState(@SW_SHOW, $hGUI_Shorcut)
Sleep(100) ;==> damit die Controls im GUI angezeigt werden
$iKeyPressed = _GetKeyInput(3000, 2)
If @error Then ;==> keine taste wurde gedrückt
GUISetState(@SW_ENABLE, $hGui_Settings)
GUISetState(@SW_HIDE, $hGUI_Shorcut)
Return
EndIf
$iSearch = _ArraySearch($aShortCuts, $iKeyPressed)
If $iSearch >= 0 Then
GUISetState(@SW_ENABLE, $hGui_Settings)
GUISetState(@SW_HIDE, $hGUI_Shorcut)
Return
Else
_GUICtrlListView_SetItemText($h_ListViewSettings, $iIndex, $iKeyPressed, 1)
$aShortcuts[$iIndex] = $iKeyPressed
GUISetState(@SW_ENABLE, $hGui_Settings)
GUISetState(@SW_HIDE, $hGUI_Shorcut)
;~ _ArrayDisplay($aShortCuts)
Return
EndIf
EndFunc
Func _SaveSettings()
Local $iSkipTime, $sShortCut, $sSection
$iSkipTime = GUICtrlRead($i_skiptime)
IniWrite($hSettings, "Settings", "AskScan", GUICtrlRead($cb_ask_scan))
IniWrite($hSettings, "Settings", "AskDel", GUICtrlRead($cb_ask_delsingle))
IniWrite($hSettings, "Settings", "AskDeld", GUICtrlRead($cb_ask_deldouble))
IniWrite($hSettings, "Settings", "AskClose", GUICtrlRead($cb_ask_close))
IniWrite($hSettings, "Settings", "AutoPlay", GUICtrlRead($cb_player_autoplay))
If $iSkipTime > 2 And $iSkipTime < 121 Then
IniWrite($hSettings, "Settings", "SkipTime", $iSkipTime)
Else
IniWrite($hSettings, "Settings", "SkipTime", 10)
EndIf
For $i = 1 To 24
$sShortCut = _GUICtrlListView_GetItemText($h_ListViewSettings, $i -1, 1)
$sSection = "Shortcut" & $i
IniWrite($hSettings, $sSection, "Shortcut", $sShortCut)
Next
_ToggleSettings()
EndFunc
; Autor: Faweyr
; Function: GetKeyInput($sTime,$sBack)
; Parameter: $sTime = Time to wait and check for pressed Keys
; $sBack = the kind of Result
; 0 = Array[3] = ["_ispressed"-Code , "Send"-Code , Name of Key]
; 1 = "_ispressed"-Code
; 2 = "Send"-Code
; 3 = Name of Key
; Includes: <Misc.au3>
func _GetKeyInput($sTime = 5000,$sBack = 0)
Local $sTimer = TimerInit()
Local $sDll = DllOpen("user32.dll")
Local $sList[111][3] = [ [08,"{BACKSPACE}","Backspace"], [09,"{TAB}","Tab"], [0&"D","{ENTER}","Enter"], ["A"&0,"{LSHIFT}","Left Shift"], ["A"&1,"{RSHIFT}","Right Shift"], _
[13,"{Pause}","Pause"], [14,"{CAPSLOCK}","Caps Lock"], [1&"B","{ESC}","Esc"], [20,"{SPACE}","Spacebar"], [21,"{PGUP}","Page Up"], [22,"{PGDN}","Page Down"], [23,"{End}","End"], _
[24,"{Home}","Home"], [25,"{Left}","Left Arrow"], [26,"{UP}","Up Arrow"], [27,"{Right}","Right Arrow"], [28,"{Down}","Down Arrow"], [12,"{ALT}","Alt"], [5&"C","{RWIN}","Right Windows"], _
[2&"C","{PRINTSCREEN}","Print Screen"], [2&"D","{INS}","Ins"], [2&"E","{DELETE}","Del"], [30,0,"0"], [31,1,"1"], [32,2,"2"], _
[33,3,"3"], [34,4,"4"], [35,5,"5"], [36,6,"6"], [37,7,"7"], [38,8,"8"], [39,9,"9"], _
[41,"a","A"], [42,"b","B"], [43,"c","C"], [44,"d","D"], [45,"e","E"], [46,"f","F"], [47,"g","G"], _
[48,"h","H"], [49,"i","I"], [4&"A","j","J"], [4&"B","k","K"], [4&"C","l","L"], [4&"D","m","M"], [4&"E","n","N"], _
[4&"F","o","O"], [50,"p","P"], [51,"q","Q"], [52,"r","R"], [53,"s","S"], [54,"t","T"], [55,"u","U"], _
[56,"v","V"], [57,"w","W"], [58,"x","X"], [59,"y","Y"], [5&"A","z","Z"], [60,"{NUMPAD0}","Keypad 0"], [61,"{NUMPAD1}","Keypad 1"], _
[62,"{NUMPAD2}","Keypad 2"],[63,"{NUMPAD3}","Keypad 3"], [64,"{NUMPAD4}","Keypad 4"], [65,"{NUMPAD5}","Keypad 5"], [66,"{NUMPAD6}","Keypad 6"], [67,"{NUMPAD7}","Keypad 7"], [68,"{NUMPAD8}","Keypad 8"], _
[69,"{NUMPAD9}","Keypad 9"],[6&"A","{NUMPADMULT}","Multiply"], [6&"B","{NUMPADADD}","Add"], [6&"C","{NUMPADENTER}","Separator"],[6&"D","{NUMPADSUB}","Subtract"], [6&"E","{NUMPADDOT}","Decimal"], [6&"F","{NUMPADDIV}","Divide"], _
[70,"{F1}","F1"], [71,"{F2}","F2"], [72,"{F3}","F3"], [73,"{F4}","F4"], [74,"{F5}","F5"], [75,"{F6}","F6"], [76,"{F8}","F7"], _
[77,"{F8}","F8"], [78,"{F9}","F9"], [79,"{F10}","F10"], [7&"A","{F11}","F11"], [7&"B","{F12}","F12"], [90,"{NUMLOCK}","Num Lock"], [91,"{SCROLLLOCK}","Scroll Lock"], _
["A"&2,"{LCTRL}","Left Control"], ["A"&3,"{RCTRL}","Right Control"], ["A"&4,"{LALT}","Left Menu"], ["A"&5,"{RALT}","Right Menu"], [5&"B","{LWIN}","Left Windows"] ]
do
for $i = 0 to UBound($sList)-1 step 1
If _IsPressed($sList[$i][0], $sDll) then
DllClose($sDll)
If $sBack <> 0 then
Return $sList[$i][$sBack-1]
else
Local $sResult[3] = [$sList[$i][0],$sList[$i][1],$sList[$i][2]]
Return $sResult
endif
endif
Next
GUICtrlSetData($l_time, Ceiling(Int($sTime - TimerDiff($sTimer))/1000))
until $sTime <= TimerDiff($sTimer)
DllClose($sDll)
SetError(1)
EndFunc
Func _ReadIgnoreList()
Local $aIgnoreList
_FileReadToArray($hIgnoreList, $aIgnoreList)
$sIgnoreList = _ArrayToString($aIgnoreList)
EndFunc
#endregion Settings-Funktionen
#region Sonstige Funktionen
[/autoit] [autoit][/autoit] [autoit]Func _SmallerNumber($sA, $sB)
If $sA > $sB Then
Return $sB
Else
Return $sA
EndIf
EndFunc
#endregion Sonstige Funktionen
#region WM-Funktionen
Func _WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iCode, $tNMHDR, $hWndListView
$hWndListView = $h_ListViewSettings
If Not IsHWnd($h_ListViewSettings) Then $hWndListView = GUICtrlGetHandle($h_ListViewSettings)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_DBLCLK; Eine Spalte wurde angeklickt
Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
Local $tIndex = DllStructGetData($tInfo, "Item")
_GetShortCut($tIndex)
EndSwitch
EndSwitch
Return $__LISTVIEWCONSTANT_GUI_RUNDEFMSG
EndFunc ;==>_WM_NOTIFY
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox
If Not IsHWnd($hListBox) Then $hWndListBox = GUICtrlGetHandle($hListBox)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Niederwertiges Wort (WORD)
$iCode = BitShift($iwParam, 16) ; Höherwertiges Wort (WORD)
Switch $hWndFrom
Case $hListBox, $hWndListBox
Switch $iCode
Case $LBN_DBLCLK ; Wird gesendet, wenn der Benutzer einen Doppelklick auf einen String in einer ListBox ausführt
_LoadTracks()
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
#endregion WM-Funktionen
settings.ini
Spoiler anzeigen
[Settings]
LastPath=M:\20_AutoIt\10_Edit\10_DoubleKill\TEST
Volume=9
SkipTime=50
AutoPlay=4
AskScan=4
AskDel=1
AskDeld=1
AskClose=4
Color1=0xBDBDBD
Color2=0xDEDEDE
Color3=0x000000
Color4=0x228B22
Color5=0xFF9900
Color6=0x0080FF
Color7=0x009900
Color8=0xFF0000
[Shortcut1]
Name=Titel 1 abspielen/pausieren
Shortcut=2
[Shortcut2]
Name=Titel 1 umbenennen
Shortcut=q
[Shortcut3]
Name=Titel 1 verschieben
Shortcut=y
[Shortcut4]
Name=Titel 1 löschen
Shortcut=s
[Shortcut5]
Name=Titel 1 im Explorer öffnen
Shortcut=a
[Shortcut6]
Name=Titel 2 abspielen/pausieren
Shortcut=3
[Shortcut7]
Name=Titel 2 umbenennen
Shortcut=r
[Shortcut8]
Name=Titel 2 verschieben
Shortcut=v
[Shortcut9]
Name=Titel 2 löschen
Shortcut=d
[Shortcut10]
Name=Titel 2 im Explorer öffnen
Shortcut=f
[Shortcut11]
Name=Vorwärts spulen
Shortcut=e
[Shortcut12]
Name=Rückwärts spulen
Shortcut=w
[Shortcut13]
Name=Stop
Shortcut=x
[Shortcut14]
Name=Nächster Eintrag
Shortcut=4
[Shortcut15]
Name=Paar nächstes mal Ignorieren
Shortcut=5
[Shortcut16]
Name=Beide löschen
Shortcut=1
[Shortcut17]
Name=Musiksammlung öffnen
Shortcut={F4}
[Shortcut18]
Name=Scannen
Shortcut={F5}
[Shortcut19]
Name=Scan abbrechen
Shortcut={ESC}
[Shortcut20]
Name=Lautstärke erhöhen
Shortcut={UP}
[Shortcut21]
Name=Lautstärke verringern
Shortcut={Down}
[Shortcut22]
Name=Einstellungen öffnen / schliessen
Shortcut={F9}
[Shortcut23]
Name=Farb-Einstellungen öffnen / schliessen
Shortcut={F10}
[Shortcut24]
Name=Neue Instanz
Shortcut={F2}