Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem] z listą


Amfetaminek

Rekomendowane odpowiedzi

Opublikowano

Więc tak.
Nie mogę zrobić scrola liście :D
łapcie kod

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <ProgressConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <array.au3>
#include <File.au3>
#include <sound.au3>

Dim $tab[1000][2]
Local $sFile = @ScriptDir & "\Test.txt"
global $Ilosc, $Ilosclog,$sound,$so1,$List1
Global $Folder, $prog , $sect,$Form
Global $btdel,$bdadd,$bturl
global $q7
$ini1=IniRead(@ScriptDir &"\Player.ini","Il","","")
$tab[0][0]=$ini1
for $ini =1 to $ini1
	$tab[$ini][0]=IniRead(@ScriptDir &"\Player.ini","Folder", $ini,"")
	$tab[$ini][1]=IniRead(@ScriptDir &"\Player.ini","Song", $ini,"")
next
if not $tab[0][0] =""  Then $IL4=$tab[0][0]
$ini=true
if $tab[0][0] ="" then
$IL4=0
$ini = false
endif

$nextload=true
$fol1=True
$listactive = True
AdlibRegister("vol")
$start=false
$normalmode = True
$formdwa= true
$next=True
$Back = true

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;playlist
func pl()
	if $formdwa = true then
	$Form = GUICreate("AmfiPlaylist", 277, 367, 460, 240, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME), BitOR($WS_EX_APPWINDOW,$WS_EX_WINDOWEDGE))
	$bdadd = GUICtrlCreateButton("ADD" ,16, 10, 33, 25)
GUICtrlSetFont(-1, 11, 400, 0, "Impact")
$bturl = GUICtrlCreateButton("URL", 56, 10, 33, 25)
GUICtrlSetFont(-1, 11, 400, 0, "Impact")
$btdel = GUICtrlCreateButton("DEL", 100, 10, 33, 25)
GUICtrlSetFont(-1, 11, 400, 0, "Impact")
$List1 = GUICtrlCreateList("", 0, 44, 277, 3240,BitOR($GUI_DOCKAUTO,$LBS_NOTIFY = 0x1))
GUISetState()

EndIf
	EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Player
$Form1 = GUICreate("AmfiPlayer", 277, 150, 460, 50)
$btback = GUICtrlCreateButton("<<", 16, 88, 25, 25)
GUICtrlSetFont(-1, 11, 800, 0, "Impact")
$btplay = GUICtrlCreateButton(">", 40, 88, 25, 25)
GUICtrlSetFont(-1, 11, 800, 2, "Impact")
$btpause = GUICtrlCreateButton("\\", 64, 88, 25, 25)
GUICtrlSetFont(-1, 11, 800, 2, "Impact")
$btstop = GUICtrlCreateButton("t", 88, 88, 25, 25)
GUICtrlSetFont(-1, 48, 800, 0, "Impact")
$btnext = GUICtrlCreateButton(">>", 112, 88, 25, 25)
GUICtrlSetFont(-1, 11, 800, 2, "Impact")
$random = GUICtrlCreateCheckbox("Random", 150, 120, 55, 15)
$Label1 = GUICtrlCreateLabel("########################", 16, 16, 250, 26)
$Progress1 = GUICtrlCreateProgress(16, 48, 241, 25)
$Slider1 = GUICtrlCreateSlider(144, 88, 113, 17,BitOR($GUI_SS_DEFAULT_SLIDER,$TBS_TOP))
$playlistbtt = GUICtrlCreateButton("PL", 16, 120, 25, 25)
GUICtrlSetData($Slider1, 100)
GUISetState(@SW_SHOW)

pl()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KONIEC GUI



While 1
         $aMsg = GUIGetMsg(1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;chwilowy brak petli
local $stat = _SoundStatus($sound)

IF $ini = True then
Listreview()
$ini=False

else
if $tab[0][0]=0 then
	MsgBox(0,"Error","First search files")
	find()
endif
endif
if $start=true Then
	if $normalmode = true Then
		if $stat = "stopped" Then
		$sound=	$tab[$q7][0]
		$stext= $tab[$q7][1]
			if $q7>$tab[0][0] then
			$q7 = 0
			endif
		_SoundPlay($sound,0)
		GUICtrlSetData($Label1,$stext)
		readprog()
		AdlibRegister("prog",$sect)

		$q7+=1

		EndIf
		else
		endif
		EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; player
Switch $aMsg[1]
	Case $Form1
		Switch $aMsg[0]
				Case $GUI_EVENT_CLOSE
                         ExitLoop
				Case $playlistbtt
						 if $formdwa = True then
						 pl()
						 Listreview()
						  $formdwa = false
						else
							GUIDelete($Form)
							$formdwa = True
						endif
					case	$btplay
						if $stat = "paused" Then
								AdlibRegister("prog",$sect)
							_SoundResume($sound)
							EndIf
						$start= true
				case $btstop
							_SoundStop($Sound)
							$start = False
							$q7-=1
							AdlibUnRegister("prog")
							GUICtrlSetData($Progress1,0)
							$prog=0
				case $btpause
							_SoundPause($sound)
								AdlibUnRegister("prog")
				Case $btback
						_SoundStop($sound)
						if $start=true then
							if $normalmode = True  then
							$q7-=2
							if $q7 = 0 then
					$q7=$tab[0][0]
					endif
						else
							$q7=Random(1,$tab[0][0],1)
							Endif
							endif
				case $btnext
						_SoundStop($sound)
							if $normalmode = False and $start=true then
								$q7=Random(1,$tab[0][0],1)
							EndIf
		 EndSwitch
		 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;playlist
             Case $Form
                 Switch $aMsg[0]
                     Case $GUI_EVENT_CLOSE
                         GUIDelete($Form)
						 $formdwa = true
		Case $List1
			$listactive = True
 			$readp1=GUICtrlRead($List1)
 			$fyy2 = _GUICtrlListBox_FindInText($List1, GUICtrlRead($List1))
			$q7=$fyy2+1
			_SoundStop($sound)
		Case $btdel
			Delete()
		case $bturl
			$fol1=true
			Find()
		case $bdadd
			$fol1=false
			Find()

			EndSwitch
         EndSwitch
     WEnd


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;FuncFind
Func Find()
	while 1
		$Folder=""
	If $fol1 = true then
    $Folder = FileSelectFolder("Wybierz folder.", "", 2)
	If @error=1 then
     $lll = MsgBox(4,"Error","Exit?")
	  Switch $lll
		case 6
			Exit
		case 7
			MsgBox(4096, "", "No File(s) chosen")
			EndSwitch
  else
	  $FileList = _FileListToArray($Folder,"*.mp3")
	  if @error=1 Then
		 MsgBox(4096, "", "No File(s) chosen")
	  Else
		$f=$IL4
		$f1 =  $FileList[0]
        for $f5=1 to $f1
		$sound=$Filelist[$f5]
		$Folder2=$Folder&"\"&$sound
		$f+=1
		$tab[$f][0]=$Folder2
		$tab[$f][1]=$sound
	next
	$IL4=$IL4+$f1
	$tab[0][0]=$IL4
		  endif
endif

		else
$var = FileOpenDialog("", @DesktopDir & "", "(*.mp3)",5 )
If @error Then
	MsgBox(4096, "", "No File(s) chosen")
Else
	Local $arr = StringSplit($var, '|', 1)
if $arr[0] = 1 Then
	$t3=$IL4
	$t3+=1
	$Folder=""
	$tekst=$arr[1]
	$arr = StringSplit($var, '\',1 )
	$Folder= $Folder&$arr[1]
	for $t1=2 to $arr[0]
	$Folder=$Folder&"\"&$arr[$t1]
next

$soundone=$arr[$arr[0]]
$tab[$t3][0]=$Folder
$tab[$t3][1]=$soundone
$IL4+=1
$Tab[0][0]=$IL4

$Folder=""
else
$Folder=$arr[1]
$t3=$IL4
$ts=$arr[0]
for $t5=2 to $ts
$sound22=$arr[$t5]
$t3+=1
$tab[$t3][0]=$Folder&"\"&$sound22
$tab[$t3][1]=$sound22
	next
	$IL4=$t3
	$Tab[0][0]=$IL4

endif
EndIf
EndIf
Listreview()
$start=True
ExitLoop
WEnd
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;odswierzania
Func Listreview()
	delini()
	$inir=0
	$Clean=""
	Guictrlsetdata($List1,$Clean)
		IniWrite(@ScriptDir &"\Player.ini","Il","",$tab[0][0])
		For $inir=1 to $tab[0][0]
			$inir3=$inir
			$Resultinir =$tab[$inir][1]
			$Resultinir2 =$tab[$inir][0]
				Guictrlsetdata($List1,$inir3&" - "&$Resultinir)
			IniWrite(@ScriptDir &"\Player.ini","Folder",$inir,$Resultinir2)
			IniWrite(@ScriptDir &"\Player.ini","Song",$inir,$Resultinir)
			next

	endfunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;usuwanie
Func Delete()
	Guictrlsetdata($Label1,"########################")

			GUICtrlSetData($Progress1,0)
	_SoundStop($Sound)
		  If Not GUICtrlRead($List1) = "" Then

			 $fyy = _GUICtrlListBox_FindInText($List1, GUICtrlRead($List1))
			 $fyy+=1
			_ArrayDelete($tab,$fyy)
if $IL4>0 then
	$start=false
			$IL4=$IL4-1
			endif
			$Tab[0][0]=$IL4

			Listreview()
		EndIf

		  endfunc

		func deleteall()
			$start=false
			_SoundStop($Sound)
			$delall=$tab[0][0]
			$delal = 0
			For $delal = 0 to $delall
			_ArrayDelete($tab,$delal)
			next
			delini()
			Listreview()
			$IL4=0
			endfunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kasowanie ini
func delini()
	IniDelete(@ScriptDir &"\Player.ini","Folder")
	IniDelete(@ScriptDir &"\Player.ini","Il")
	IniDelete(@ScriptDir &"\Player.ini","Song")
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;glosnosc
Func vol()
			$slid=GUICtrlRead($Slider1)
			SoundSetWaveVolume( $slid )

		endfunc

			Func exit1()
				Exit
			EndFunc


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Progres
func readprog()
	GUICtrlSetData($Progress1,0)
	$sect=""
	$prog=0
	$so1=_SoundStatus($sound)
	If $so1="playing" then
$sect=_SoundLength($Sound,2)
$sect=$sect/1000
$sect=$sect/100*1000
AdlibRegister("prog",$sect)
EndIf
endfunc
func prog()
			$prog = $prog+ 1
GUICtrlSetData($Progress1, $prog)
			EndFunc
			func gui2()
	$Form1 = GUICreate("AmfiPlayer", 277, 465, 460, 429, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME), BitOR($WS_EX_APPWINDOW,$WS_EX_WINDOWEDGE))
				endfunc

 

 

 

v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
 

Opublikowano

Jakby miała tam być taka lista to by byłe ;)
Już rozwiązane :)
W dziale gotowe skrypty mona zobaczyć jak

v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...