MAV писал(а):
Схема которую я прицепил постом выше у меня в момент переключения на следующий трэк впадает в ступор, и при закрытии формы остаётся висеть в процессах.У меня тоже самое.
Если добавить второй таймер,ползунок позиции проигрывания, и т. д.то все работает!!!!
Make(delphi)
ver(4.03 build 181)
Add(ODialog,15104708,245,139)
{
Title="Open File"
FileName=""
Select=1
link(onExecute,14738624:doAdd,[(350,145)(350,166)])
}
Add(ListBox,14738624,399,160)
{
Left=40
Top=150
Width=645
Height=125
Color=0
Font=[MS Sans Serif,8,0,16711680,1]
Point(doSelect)
link(onClick,11293159:doEvent1,[])
}
Add(Hub,11293159,469,167)
{
link(onEvent1,2028006:doValue,[(504,173)(504,269)(277,269)(277,306)])
link(onEvent2,11998023:doWork1,[(495,180)(495,235)(389,235)])
}
Add(BASS_StreamCreateFile,1147551,504,370)
{
Name="MainSound"
link(onCreate,3651364:doPlay,[(580,376)(580,334)])
link(onEndPlay,9324229:doTimer,[(548,383)(548,411)])
link(FileName,8243139:Text,[(510,337)(559,337)])
}
Add(Timer,9324229,560,405)
{
Interval=1
Enable=1
AutoStop=1
link(onTimer,12127398:doEvent2,[(597,411)(597,352)(247,352)(247,292)])
}
Add(BASS_ChannelPlay,3651364,616,328)
{
Channel="MainSound"
link(onPlay,6034887:doData,[(650,334)(650,185)])
}
Add(Edit,8243139,553,272)
{
Left=75
Top=20
Width=640
Height=21
Color=0
Font=[MS Sans Serif,8,1,16711680,1]
Text=""
}
Add(Hub,1372390,462,286)
{
link(onEvent1,8243139:doText,[(515,292)(515,278)])
link(onEvent2,1484642:doWork1,[(490,299)])
}
Add(ArrayRW,7455926,406,286)
{
link(onRead,1372390:doEvent1,[])
link(Array,14738624:Array,[(412,249)(419,249)])
}
Add(Hub,13600621,350,279)
{
link(onEvent1,14738624:doSelect,[(385,285)(385,208)])
link(onEvent2,11998023:doWork2,[(375,292)(375,293)])
}
Add(Counter,2028006,301,279)
{
Min=-1
Max=1000
Default=-1
Point(doValue)
link(onNext,13600621:doEvent1,[])
}
Add(Hub,12127398,252,279)
{
InCount=2
OutCount=1
link(onEvent1,2028006:doNext,[])
}
Add(BitBtn,13458823,133,258)
{
Left=270
Top=90
Width=48
Height=28
Color=8421504
Caption=""
Bitmap=[ZIPF60F000078DA73F2FDC6CF00066640AC01C406402C03C48C0C1260F103507964D0300A4601CDC07F06065C68B0B967401C468C7BE8E93092DC430787A159A422F376605D85E91E381A1087E1710FA9AEA28AC308BA87CEC145BC7B48721B9DDD43D04923337C064FFA193CF96B90943F035544935D5F0C92FA74F0D4EFA3EDB1C1D05E1D05A3003F0000133526CA]
link(onClick,16324067:doEvent1,[])
}
Add(HubEx,11998023,385,287)
{
link(onEvent,7455926:doRead,[(399,293)(399,292)])
}
Add(MainForm,6826875,93,443)
{
Width=751
Height=425
Color=-16777203
Caption="плейлист"
Point(Handle)
link(onCreate,4252681:doInit,[(144,463)(144,464)])
}
Add(BASS_Init,4252681,163,458)
{
link(Handle,6826875:Handle,[(183,446)(141,446)(141,487)(99,487)])
}
Add(BitBtn,11865194,169,132)
{
Left=65
Top=90
Width=60
Color=65280
Caption="Open file"
link(onClick,15104708:doExecute,[(222,138)(222,145)])
}
Add(Hub,16324067,196,258)
{
OutCount=3
link(onEvent1,12127398:doEvent1,[(238,264)(238,285)])
link(onEvent2,1484642:doWork2,[(225,271)(225,363)])
}
Add(HubEx,1484642,486,357)
{
Angle=1
link(onEvent,1147551:doCreate,[(490,376)])
}
Add(DoData,6034887,707,179)
{
link(onEventData,10441699:doMax,[(747,185)(747,194)(827,194)(827,186)])
link(Data,6457552:Length,[(713,163)(718,163)(718,324)(699,324)])
}
Add(ScrollBarEx,10441699,835,173)
{
Left=100
Top=320
Width=480
Height=10
Color=8388736
LightColor=16777215
DarkColor=16777215
FaceColor=0
ArrowColor=16711935
Max=999999999
ScrollMode=1
Point(doMax)
link(onPosition,6457552:doPosition,[(879,179)(879,232)(664,232)(664,262)])
}
Add(BASS_ChannelPosition,6457552,686,256)
{
Channel="MainSound"
Mode=2
}
Add(Timer,15591768,735,362)
{
link(onTimer,11518414:doData,[(772,368)(772,318)])
}
Add(DoData,11518414,784,312)
{
link(onEventData,10441699:doPosition,[(820,318)(820,179)])
link(Data,6457552:CurPosition,[(790,306)(692,306)])
}
Add(BitBtn,13458823,135,257)
{
Left=270
Top=90
Width=48
Height=28
Color=8421504
Caption=""
Bitmap=[ZIPF60F000078DA73F2FDC6CF00066640AC01C406402C03C48C0C1260F103507964D0300A4601CDC07F06065C68B0B967401C468C7BE8E93092DC430787A159A422F376605D85E91E381A1087E1710FA9AEA28AC308BA87CEC145BC7B48721B9DDD43D04923337C064FFA193CF96B90943F035544935D5F0C92FA74F0D4EFA3EDB1C1D05E1D05A3003F0000133526CA]
link(onClick,16324067:doEvent1,[(182,263)(182,264)])
}
Add(BitBtn,11865194,171,131)
{
Left=65
Top=90
Width=60
Color=65280
Caption="Open file"
link(onClick,15104708:doExecute,[(224,137)(224,144)])
}
Add(MainForm,6826875,95,442)
{
Width=751
Height=425
Color=-16777203
Caption="плейлист"
Point(Handle)
link(onCreate,4252681:doInit,[(146,462)(146,463)])
}
Add(BASS_Init,4252681,165,457)
{
link(Handle,6826875:Handle,[(185,445)(143,445)(143,486)(101,486)])
}
Add(ODialog,15104708,247,138)
{
Title="Open File"
FileName=""
Select=1
link(onExecute,14738624:doAdd,[(350,144)(350,166)])
}
Add(Hub,16324067,197,258)
{
OutCount=3
link(onEvent1,12127398:doEvent1,[(238,264)(238,285)])
}
Add(Hub,12127398,252,279)
{
InCount=2
OutCount=1
link(onEvent1,2028006:doNext,[])
}
Add(Counter,2028006,301,279)
{
Min=-1
Max=1000
Default=-1
Point(doValue)
link(onNext,13600621:doEvent1,[])
}
Add(Hub,13600621,350,279)
{
link(onEvent1,14738624:doSelect,[(385,285)(385,208)])
}
Add(ListBox,14738624,399,160)
{
Left=40
Top=150
Width=645
Height=125
Color=0
Font=[MS Sans Serif,8,0,16711680,1]
Point(doSelect)
link(onClick,11293159:doEvent1,[])
}
Add(Hub,11293159,469,167)
{
link(onEvent1,2028006:doValue,[(504,173)(504,269)(277,269)(277,306)])
}
Add(ArrayRW,7455926,406,286)
{
link(onRead,1372390:doEvent1,[])
link(Array,14738624:Array,[(412,249)(419,249)])
}
Add(Hub,1372390,462,286)
{
link(onEvent1,8243139:doText,[(515,292)(515,278)])
}
Add(Edit,8243139,553,272)
{
Left=75
Top=20
Width=640
Height=21
Color=0
Font=[MS Sans Serif,8,1,16711680,1]
Text=""
}
Add(BASS_StreamCreateFile,1147551,504,370)
{
Name="MainSound"
link(onCreate,3651364:doPlay,[(580,376)(580,334)])
link(onEndPlay,9324229:doTimer,[(548,383)(548,411)])
link(FileName,8243139:Text,[(510,337)(559,337)])
}
Add(Timer,9324229,560,405)
{
Interval=1
Enable=1
AutoStop=1
link(onTimer,12127398:doEvent2,[(597,411)(597,352)(247,352)(247,292)])
}
Add(BASS_ChannelPlay,3651364,616,328)
{
Channel="MainSound"
}
значит, в таймерах дело!
Вот только почему так происходит?
------------ Дoбавленo в 23.41:
Сейчас потестил схему MAV - перебор списка в паралельном потоке.
Убрал ползунок , второй таймер и еще несколько элементов
Make(delphi)
ver(4.03 build 181)
Add(ListBox,14738624,385,105)
{
Left=5
Top=35
Width=545
Height=125
Point(doSelect)
link(onClick,6437386:doGet,[])
}
Add(Counter,2028006,315,182)
{
Min=-1
Default=-1
Point(doValue)
link(onNext,13600621:doEvent1,[])
}
Add(ArrayRW,7455926,399,189)
{
link(onRead,1372390:doEvent1,[])
link(Array,14738624:Array,[])
}
Add(Button,854059,217,105)
{
Left=5
Top=5
Width=75
Caption="Open"
link(onClick,5203079:doExecute,[])
}
Add(Button,590727,217,182)
{
Left=10
Top=170
Width=175
Caption="?????? ???????? ???????"
link(onClick,12127398:doEvent1,[])
}
Add(Hub,12127398,280,182)
{
InCount=2
OutCount=1
link(onEvent1,2028006:doNext,[])
}
Add(BASS_StreamCreateFile,2073512,518,252)
{
Name="MainSound"
link(onCreate,10701583:doPlay,[])
link(onEndPlay,10006279:doStart,[])
}
Add(BASS_ChannelPlay,10701583,609,252)
{
Channel="MainSound"
}
Add(Edit,8243139,518,189)
{
Left=195
Top=170
Width=355
Height=21
Text=""
}
Add(MainForm,6488361,217,252)
{
Width=564
Height=278
Color=-16777206
Caption="Consecutive viewing of files"
Point(Handle)
link(onCreate,7762274:doInit,[])
}
Add(BASS_Init,7762274,287,266)
{
link(Handle,6488361:Handle,[(307,254)(265,254)(265,296)(223,296)])
}
Add(Hub,1372390,462,189)
{
link(onEvent1,8243139:doText,[])
link(onEvent2,2073512:doCreate,[(497,202)(497,258)])
}
Add(Hub,13600621,357,182)
{
link(onEvent1,14738624:doSelect,[(378,188)(378,153)])
link(onEvent2,3516535:doWork2,[])
}
Add(MT_Get,6437386,434,112)
{
link(onGet,11293159:doEvent1,[])
}
Add(Hub,11293159,490,119)
{
link(onEvent1,2028006:doValue,[(521,125)(521,172)(303,172)(303,209)])
link(onEvent2,3516535:doWork1,[(516,132)(516,166)(389,166)])
}
Add(HubEx,3516535,385,189)
{
link(onEvent,7455926:doRead,[])
}
Add(Thread,10006279,560,259)
{
Delay=0
FastStop=0
link(onSyncExec,12127398:doEvent2,[(599,272)(599,232)(268,232)(268,195)])
}
Add(ODialog,5203079,273,105)
{
Filter="MP3|*.mp3"
Title="??????? mp3 ????"
Select=1
link(onExecute,14738624:doAdd,[])
}