500 ms

0 mins 00

	/ITL/scene watch PLAY (
		/ITL/scene/javascript run "playAt()",
		/ITL/scene/javascript run "storedDate(speed)"
	);

	/ITL/scene watch STOP (
		/ITL/scene/pos tempo 0,
		/ITL/scene/pos date 0,
		/ITL/scene/javascript run "stopSched()",
		/ITL/scene/javascript run "stopMedia()",
		/ITL/scene/javascript run "pauseVid()",
		/ITL/scene/javascript run "lastStop()"
	);
	
	/ITL/scene watch PAUSE (
		/ITL/scene/javascript run "stopSched()",
		/ITL/scene/javascript run "pauseVid()",
		/ITL/scene/javascript run "pauseMedia()",
		/ITL/scene/pos tempo 0,
		/ITL/scene/javascript run "ws.send ('play '+0)"
	);

	/ITL/scene watch REWIND (
		/ITL/scene/pos tempo 0,
		/ITL/scene/javascript run "stopSched()",
		/ITL/scene/javascript run "pauseVid()",
		/ITL/scene/javascript run "pauseMedia()",
		/ITL/scene/javascript run "lastTime()"
	);


		
	/ITL/scene watch END ( /ITL/scene/playPanel/stop event mouseDown 0 0 );
	
	###############################
	# play control
	###############################
	origin = 3.2;
	alpha = 120;
	rsrc  = 'rsrc/';
	play  = $rsrc + 'play.png';
	pause = $rsrc + 'pause.png';
	rewind = $rsrc + 'rewind.png';
	stop  = $rsrc + 'stop.png';
	
	/ITL/scene/playPanel set rect 0.3 0.2;
	/ITL/scene/playPanel scale 2;	
	/ITL/scene/playPanel color white;
	
	/ITL/scene/playPanel/play set img $play;
	/ITL/scene/playPanel/stop set img $stop;
	/ITL/scene/playPanel/pause set img $rewind;
	/ITL/scene/playPanel/play xorigin $origin;
	/ITL/scene/playPanel/stop xorigin -$origin;
	/ITL/scene/playPanel/pause xorigin 0;
	/ITL/scene/playPanel/* yorigin -5;
	/ITL/scene/playPanel/* width 1;
	/ITL/scene/playPanel/pause width 0.3;
	/ITL/scene/playPanel/pause yorigin -16;
	/ITL/scene/playPanel/* alpha $alpha;
	
	/ITL/scene/playPanel watch STOP (
		/ITL/scene event STOP,
		/ITL/scene/javascript run "stopSched()",
		/ITL/scene/playPanel/play set img $play,
		/ITL/scene/playPanel/play pop
	);

	/ITL/scene/playPanel watch PAUSE (
		/ITL/scene event PAUSE,
		/ITL/scene/playPanel/pause pop
	);

	
	/ITL/scene/playPanel/* watch mouseEnter (/ITL/scene/playPanel/$self alpha 256);
	/ITL/scene/playPanel/* watch mouseLeave (/ITL/scene/playPanel/$self alpha $alpha);
	/ITL/scene/playPanel/stop watch mouseDown ( /ITL/scene/playPanel event STOP );
	/ITL/scene/playPanel/pause watch mouseDown ( /ITL/scene/playPanel event PAUSE );
	
	/ITL/scene/playPanel/play watch mouseDown (
		/ITL/scene/playPanel/play push,
		/ITL/scene/playPanel/play set img $rewind,
		/ITL/scene event PLAY,
		/ITL/scene/playPanel/play watch mouseDown (
			/ITL/scene/playPanel/play set img $play,
			/ITL/scene event REWIND,
			/ITL/scene/playPanel/play pop
		)
	);

	/ITL/scene/playPanel/pause watch mouseDown (
		/ITL/scene/playPanel/pause push,
		/ITL/scene/playPanel/pause set img $play,
		/ITL/scene event PAUSE,
		/ITL/scene/playPanel/pause watch mouseDown (
			/ITL/scene/playPanel/pause set img $play,
			/ITL/scene event PLAY,
			/ITL/scene/playPanel/pause pop
		)
	);
	
	/ITL/scene/playPanel watch keyDown " " (/ITL/scene/playPanel/play event mouseDown 0 0);
	
	###############################
	# keyboard control
	###############################
	/ITL/scene watch keyDown " " ( 
		/ITL/scene push,
		/ITL/scene event PLAY,
		/ITL/scene watch keyDown " " ( 
			/ITL/scene event PAUSE,
			/ITL/scene pop
		)
	);

	
	###############################
	# time line - that was in move /ITL/scene/javascript run "send('vdate $date%f')",
	###############################
	/ITL/scene/tl set img 'images/score/mitchel/0.png' ;
	/ITL/scene/tl scale 0.5;
	/ITL/scene/tl penWidth 1;
	/ITL/scene/tl color white;
	/ITL/scene/tl y -0.3;
	/ITL/scene/tl duration 186 4;
	
	/ITL/scene/pos set rect 0.02 0.1;
	/ITL/scene/pos color red;
	/ITL/scene/sync pos tl v;

	move = ( 
		/ITL/scene/pos date '$date%f',
		/ITL/scene/javascript run "store('$date%f')"
	);

	/ITL/scene/tl watch mouseDown $move;
	/ITL/scene/tl watch mouseMove $move;


	
500 ms