UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Pause While An Operation In A For.. Next Loop Completes, Access 2007    
 
   
RLG
post Nov 28 2017, 11:26 AM
Post#1



Posts: 36
Joined: 9-March 10



In my Music database, I have a Form which brings up a list of the tracks of the Album chosen into a listbox. I have written a routine to play the selected tracks, and in principle it works well.

For x = 0 To Me.lstTracks.ListCount

If Me.lstTracks.Selected(x) = True Then
varSelected(x) = Me.lstTracks.Column(1, x)


' Call fHandleFile("""" & varSelected(x) & """", 1)
' Call PlayMusic(varSelected(x))

End If

Next x

I have 2 options for playing the tracks:

Call fHandleFile("""" & varSelected(x) & """", 1) which calls a ShellExecute module, and which works.
Call PlayMusic(varSelected(x)) which calls a module which directly controls my media player, which is Media Monkey V4, and also works.

I haven't yet decided which to go with, but whichever is not affected by my problem.

The problem is that when I select 1 or 2 tracks, they play correctly. When I select more than 2, or the whole album, the routine loops through all the selections and begins playing at the last one selected.

Clearly I need to suspend the loop each time until the track has played, and then release it to play the next one. But I have no idea if this is feasible, or how to manage it.
I can extract the time duration of each track quite simply and possible suspend operation for that length of time plus a few seconds, but again, how to do it.

The form which holds the tracks listbox is not opened in Dialogue mode, so my screen is not frozen. But I don't want all operations on the database to be suspended for the time the complete selection plays.

Would much appreciate some expert help. Thanks

Richard
Go to the top of the page
 
theDBguy
post Nov 28 2017, 11:30 AM
Post#2


Access Wiki and Forums Moderator
Posts: 71,202
Joined: 19-June 07
From: SunnySandyEggo


Hi Richard,

Just a thought but maybe you could try using ShellAndWait.

Check out Pearson or The Access Web

Hope it helps...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
RLG
post Nov 28 2017, 12:15 PM
Post#3



Posts: 36
Joined: 9-March 10



Great. Thank you so much.

Somehow with these two, I am sure I can manage something.

I've been working on this monster for about 7 years now (my posts have been sparse recently) and I mostly spend my time entering my collection (now up to 7000 albums entered, around 100k tracks). But every now and again I suddenly have a burst of coding, adding more and more facilities. And it's still fast and only about half the 2gb limit used!

I'll keep you posted.

Richard
Go to the top of the page
 
theDBguy
post Nov 28 2017, 12:22 PM
Post#4


Access Wiki and Forums Moderator
Posts: 71,202
Joined: 19-June 07
From: SunnySandyEggo


Hi Richard,

You're welcome. Good luck!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    11th December 2017 - 08:00 PM