So,
jetzt stell ich auch mal mein erstes Programm vor:
Es ist ein Musikplay,er bei dem man entweder zu Beginn eine neue Playlist erstellt oder eine alte (falls vorhanden) lädt.
Daraufhin kann man den Player über den Button "start player" starten.
Danach kommt einer MsgBox mit den Hotkeys für das Programm.
Drückt Alt+P für play und es geht los.
Spoiler anzeigen
Alt+P = Play, Alt+S = Stop, Alt+N = Next Song , Alt+B = Song Back, Alt+V = Volume und Alt+E = Ende.
Der Vortiel ist: Der Musikplayer kann nur über Hotkeys gesteuert werden, das heißt ihr habt kein lästiges Umschalten, wenn ihr einen Titel anhalten wollt oder
versucht den nächsten Titel zu starten. Es läuft alles per Tastendruck!
Vielen Dank an der Stelle noch an Ideas2Code, der mir hier: [ gelöst ] Ini-Write funktioniert nicht? weitergeholfen hat.
So im Anhang befinden sich die Dateien!
Nach dem Download und Entpacken müsst ihr die Player.exe starten!
Viel Spaß damit!
Script:
1. (Nimmt Playlist auf)
Spoiler anzeigen
#include <GUIConstants.au3>
$count = 1
$file = @WindowsDir
$countr = 1
$i = 0
$f = 0
Dim $read[500]
$form = GUICreate("RemiXXer by stay und raven", 625, 443, 193, 125)
$list = GUICtrlCreateList("", 40, 96, 377, 188)
$load = GUICtrlCreateButton("Neuen Song laden", 440, 112, 129, 41, 0)
$label1 = GUICtrlCreateLabel("RemiXXer", 72, 0, 304, 84)
GUICtrlSetFont(-1, 70, 400, 0, "MS Sans Serif")
$delete = GUICtrlCreateButton("Liste löschen", 440, 168, 129, 41, 0)
$run = GUICtrlCreateButton("Start Player!", 440, 224, 129, 41, 0)
$exit = GUICtrlCreateButton("Exit", 440, 368, 129, 41, 0)
$loadoldlist = GUICtrlCreateButton("Alte Liste laden", 100, 368, 129, 41, 0)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ex()
Case $delete
delete()
Case $load
load()
Case $exit
ex()
Case $run
run("playcatcher.exe")
Exit
Case $loadoldlist
loadold()
EndSwitch
WEnd
Func load()
if FileExists("playlist.ini") Then
FileDelete("playlist.ini")
EndIf
$file = FileOpenDialog("Titel hinzufügen", $file, "Sounddateien (*.mp3;*.wma;*.wav)")
IniWrite(@ScriptDir & "\playlist.ini", "Playlist", $count, $file)
GUIctrlsetdata($list, $file)
$count = $count + 1
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit]Func loadold()
While 1
$i = $i + 1 ; für auslesearray
$f = $f + 1 ;
$read[$i] = IniRead("playlist.ini", "Playlist", $f, "")
if $read[$i] = "" Then
ExitLoop
Else
GUICtrlSetData($list, $read[$i])
EndIf
WEnd
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func delete()
GUICtrlSetData($list, "")
FileDelete("playlist.ini")
EndFunc
Func ex()
MsgBox(0, "Auf Wiedersehen!", "Auf Wiedersehen, bis zum nächsten Mal! By stayawayknight")
Exit
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit]2. (Das wo das abspielt):
Spoiler anzeigen
#include <Sound.au3>
[/autoit] [autoit][/autoit] [autoit]HotkeySet("!{p}", "play")
HotKeySet("!{s}", "stop")
HotKeySet("!{n}", "nexts")
HotKeySet("!{e}", "ende")
HotKeySet("!{b}", "back")
HotKeySet("!{v}", "volume")
HotKeySet("!{z}", "zufall")
$a = 0 ; bewirkt die untilschleife und bricht play1 ab, wenn next kommt
$count = 1 ; zählt songs
$vol = 75
[/autoit] [autoit][/autoit] [autoit]Msgbox(0, "Start", "Folgende Hotkeys sind wichtig: Alt+P = Play, Alt+S = Stop, Alt+N = Next Song , Alt+B = Song Back, Alt+V = Volume und Alt+E = Ende.")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func play()
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$file = IniRead("playlist.ini", "Playlist", $count, "")
$lengh = _SoundLength ($file, 2)
SoundPlay($file)
ToolTip("Play")
Sleep(2000)
ToolTip("")
Sleep($lengh)
$count = $count + 1
Until $a = 1
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func ende()
Tooltip("Ende, wird beendet ...")
Sleep(2000)
Exit
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func volume()
[/autoit] [autoit][/autoit] [autoit]$vol = Inputbox("Lautstärke", "Gib die gewünschte Lautstärke (1-100) ein! Momentan: " & $vol)
SoundSetWaveVolume($vol)
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func stop()
Run("playcatcher.exe")
Exit
EndFunc
Func nexts()
$a = 1
$count = $count + 1
ToolTip("Next")
Sleep(2000)
play()
$a = 0
EndFunc
Func back()
$a = 1
$count = $count - 1
ToolTip("Back")
Sleep(2000)
play()
$a = 0
EndFunc
While 1
WEnd
Kann man auch in ein Script setzen, sollte so aber eig. den Vorteil habe das man den 2.Teil (das Abspielen) auch gleich machen kann, ohne durchs Menü zu müssen.
Script jetzt auch in der Downloaddatei eingefügt