AW: is there a generic handler for the player status?
Tiemo Hollmann TB
toolbook at kestner.de
Tue Jun 3 11:44:38 EDT 2008
Bonsoir Eric,
thank you for your approach, nice to know ;)
Tiemo
> -----Ursprüngliche Nachricht-----
> Von: use-revolution-bounces at lists.runrev.com [mailto:use-revolution-
> bounces at lists.runrev.com] Im Auftrag von Eric Chatonet
> Gesendet: Dienstag, 3. Juni 2008 15:39
> An: How to use Revolution
> Betreff: Re: is there a generic handler for the player status?
>
> Bonjour Tiemo,
>
> AFAIK no.
>
> But for fun (and it will sure lean up your code :-):
>
> In each player, put:
>
> local lPlayerStatus
> ----------------------------------------
> on playStarted
> put char 5 to -1 of the params into lPlayerStatus
> end playStarted
> ----------------------------------------
> on playPaused
> put char 5 to -1 of the params into lPlayerStatus
> end playPaused
> ----------------------------------------
> on playStopped
> put char 5 to -1 of the params into lPlayerStatus
> end playStopped
> ----------------------------------------
> on PlayerCurStatus
> return lPlayerStatus
> end PlayerCurStatus
>
> And in the card or the stack script:
>
> function PlayerStatus pPlayer
> call "PlayerCurStatus" of pPlayer
> return the result
> end PlayerStatus
>
> Now you can use the PlayerStatus function with a param that is the
> long name of any player to know its status:
> empty: the user did not pay attention yet to the player
> Started: the player is running
> Paused: the player is paused
> Stopped: the player has reached its end
>
> Example:
>
> switch PlayerStatus(the long name of player "Player1")
> case "Started"
> <statements>
> break
> case "Paused"
> <statements>
> break
> case "Stopped"
> <statements>
> break
> default -- empty
> <statements>
> end switch
>
> In this code, one another interesting thing is that it uses the call
> command to bypass the message hierarchy and, in addition, uses a
> handler that fakes a function by returning a value.
> As I said, just for fun and knowledge ;-)
>
> Le 3 juin 08 à 14:42, Tiemo Hollmann TB a écrit :
>
> > to ask for the player status there are the handlers playStarted,
> > playStopped
> > and playPaused.
> >
> > Is the also a generic handler with the status as a param to ask for
> > the
> > status? (just to lean up my code a bit?)
> >
> > Thanks
> >
> > Tiemo
>
>
>
> Best regards from Paris,
> Eric Chatonet.
> ----------------------------------------------------------------
> Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
> Email: eric.chatonet at sosmartsoftware.com/
> ----------------------------------------------------------------
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list