How to reset the player?

2011-10-30 Thread Mike Doub
I am trying to get several call backs to fire during playback of a looping
mp3.   I am controlling lights from within the call backs.   However, I am
running into several issues that I do not understand.

 

1)  I am not able to reset the player to the beginning 

2)  The callbacks  are only called on the first playing and not of the
repeated playings

 

Does anyone see issues with the following code or could provide some
incites?   

 

   put the timescale of player Spooky into persec

   put empty into callbackList

   put (1 * persec)  comma  c1  return after callbackList

   put (44 * persec)  comma  c2  return after callbackList

   

   set the callbacks of player Spooky to callbackList

   set the looping of player Spooky to true

   set the playSelection  of player Spooky to true

   set the startTime of player Spooky to zero

   set the endTime of player Spooky to the duration of player Spooky

   start player Spooky

 

I would have expected this to start at the beginning each time the code was
executed, yet the player is never reset.

 

 

Thanks

   Mike

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to reset the player?

2011-10-30 Thread stephen barncard
did you try

'set the filename of player 1 to xx'  for each reset?
or

set the filename player 1 to empty
set the filename player 1 to xx'

On 30 October 2011 08:19, Mike Doub m...@doub.com wrote:

 I am trying to get several call backs to fire during playback of a looping
 mp3.   I am controlling lights from within the call backs.   However, I am
 running into several issues that I do not understand.



 1)  I am not able to reset the player to the beginning

 2)  The callbacks  are only called on the first playing and not of the
 repeated playings



 Does anyone see issues with the following code or could provide some
 incites?



   put the timescale of player Spooky into persec

   put empty into callbackList

   put (1 * persec)  comma  c1  return after callbackList

   put (44 * persec)  comma  c2  return after callbackList



   set the callbacks of player Spooky to callbackList

   set the looping of player Spooky to true

   set the playSelection  of player Spooky to true

   set the startTime of player Spooky to zero

   set the endTime of player Spooky to the duration of player Spooky

   start player Spooky



 I would have expected this to start at the beginning each time the code was
 executed, yet the player is never reset.





 Thanks

   Mike

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  http://www.google.com/profiles/sbarncar
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to reset the player?

2011-10-30 Thread mike
I found the currentTime property which does the reset. I also got it to repeat 
as I needed by catching playstopped and re-initializing everything thus faking 
a loop

Got everything working just in time for a night time test before Halloween. :-) 

Got to admit the simulated lightening is pretty cool when synced with a thunder 
clap

  -= Mike
 
Sent from my BlackBerry device on the Rogers Wireless Network

-Original Message-
From: stephen barncard stephenrevoluti...@barncard.com
Sender: use-livecode-boun...@lists.runrev.com
Date: Sun, 30 Oct 2011 11:30:23 
To: How to use LiveCodeuse-livecode@lists.runrev.com
Reply-To: How to use LiveCode use-livecode@lists.runrev.com
Subject: Re: How to reset the player?

did you try

'set the filename of player 1 to xx'  for each reset?
or

set the filename player 1 to empty
set the filename player 1 to xx'

On 30 October 2011 08:19, Mike Doub m...@doub.com wrote:

 I am trying to get several call backs to fire during playback of a looping
 mp3.   I am controlling lights from within the call backs.   However, I am
 running into several issues that I do not understand.



 1)  I am not able to reset the player to the beginning

 2)  The callbacks  are only called on the first playing and not of the
 repeated playings



 Does anyone see issues with the following code or could provide some
 incites?



   put the timescale of player Spooky into persec

   put empty into callbackList

   put (1 * persec)  comma  c1  return after callbackList

   put (44 * persec)  comma  c2  return after callbackList



   set the callbacks of player Spooky to callbackList

   set the looping of player Spooky to true

   set the playSelection  of player Spooky to true

   set the startTime of player Spooky to zero

   set the endTime of player Spooky to the duration of player Spooky

   start player Spooky



 I would have expected this to start at the beginning each time the code was
 executed, yet the player is never reset.





 Thanks

   Mike

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  http://www.google.com/profiles/sbarncar
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to reset the player?

2011-10-30 Thread mike
The field test went fine.  All set for tomorrow night!
 
Sent from my BlackBerry device on the Rogers Wireless Network

-Original Message-
From: m...@doub.com
Sender: use-livecode-boun...@lists.runrev.com
Date: Sun, 30 Oct 2011 21:10:37 
To: How To use LiveCodeuse-livecode@lists.runrev.com
Reply-To: How to use LiveCode use-livecode@lists.runrev.com
Subject: Re: How to reset the player?

I found the currentTime property which does the reset. I also got it to repeat 
as I needed by catching playstopped and re-initializing everything thus faking 
a loop

Got everything working just in time for a night time test before Halloween. :-) 

Got to admit the simulated lightening is pretty cool when synced with a thunder 
clap

  -= Mike
 
Sent from my BlackBerry device on the Rogers Wireless Network

-Original Message-
From: stephen barncard stephenrevoluti...@barncard.com
Sender: use-livecode-boun...@lists.runrev.com
Date: Sun, 30 Oct 2011 11:30:23 
To: How to use LiveCodeuse-livecode@lists.runrev.com
Reply-To: How to use LiveCode use-livecode@lists.runrev.com
Subject: Re: How to reset the player?

did you try

'set the filename of player 1 to xx'  for each reset?
or

set the filename player 1 to empty
set the filename player 1 to xx'

On 30 October 2011 08:19, Mike Doub m...@doub.com wrote:

 I am trying to get several call backs to fire during playback of a looping
 mp3.   I am controlling lights from within the call backs.   However, I am
 running into several issues that I do not understand.



 1)  I am not able to reset the player to the beginning

 2)  The callbacks  are only called on the first playing and not of the
 repeated playings



 Does anyone see issues with the following code or could provide some
 incites?



   put the timescale of player Spooky into persec

   put empty into callbackList

   put (1 * persec)  comma  c1  return after callbackList

   put (44 * persec)  comma  c2  return after callbackList



   set the callbacks of player Spooky to callbackList

   set the looping of player Spooky to true

   set the playSelection  of player Spooky to true

   set the startTime of player Spooky to zero

   set the endTime of player Spooky to the duration of player Spooky

   start player Spooky



 I would have expected this to start at the beginning each time the code was
 executed, yet the player is never reset.





 Thanks

   Mike

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  http://www.google.com/profiles/sbarncar
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode