Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 08-30-2011, 10:48 PM
Cyan Cyan is offline
Junior Member
 
Join Date: Jun 2010
Posts: 17
Downloads: 2
Uploads: 0
Question Pan & Tilt at start

Hi,

I am hoping to set up a 2 part pan & tilt at the start of a FPP load... something like:

Pan and tilt to a point
wait for 5 seconds
Pan and tilt to a second point

May I ask how I would code this in the XML?

Thanks for any advice.
Reply With Quote
  #2  
Old 08-31-2011, 11:10 AM
Cyan Cyan is offline
Junior Member
 
Join Date: Jun 2010
Posts: 17
Downloads: 2
Uploads: 0
Default

Hi, making a bit of progress here.... I have the start position working but the second position is not responding.... any clues?

Code:
<pano pan="230" tilt="-10" zoom="0.9" timer="3000"/>
	
	<spot id="player" url="soundspot.swf" file="good.mp3" repeat="0" pan="18" tilt="0" enableSoundPanning="0" soundRadius="360" soundVolume="0.4"
				onComplete="global.soundComplete()"
			/>

		
</global>
	
	<pano pan="0" tilt="-10" zoom="0.9" timer="3000"/>
	
</hotspots>
Reply With Quote
  #3  
Old 08-31-2011, 07:20 PM
Cyan Cyan is offline
Junior Member
 
Join Date: Jun 2010
Posts: 17
Downloads: 2
Uploads: 0
Default

Hmmm, still stuck on this one - I bet it is simple when I find out how?

I understand a bit more how to do it now but could do with a hand on syntax. As I understand it I need to define a function first - where in the XML should I do this and how? I think I then need to call this function with variables to set the pan, tilt, zoom and timer values...? Again, where in the XML and how to define it?

Sorry for the noob questions - hope someone can help :-)
Reply With Quote
  #4  
Old 08-31-2011, 07:46 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Cyan,

where is your global.soundComplete function?

And what is this second <pano> tag?:
Code:
<pano pan="0" tilt="-10" zoom="0.9" timer="3000"/>
Tommy
Reply With Quote
  #5  
Old 08-31-2011, 07:58 PM
Cyan Cyan is offline
Junior Member
 
Join Date: Jun 2010
Posts: 17
Downloads: 2
Uploads: 0
Default

Hi Tommy,

Firstly, thanks for soundspot, works lovely :-)

The whole of my XML is below - as I don't completely understand the API I suspect it could be better... thanks for any pointers.

Code:
<?xml version='1.0'?>
<panorama>
	
	<parameters>	

	disableLoading=1
	zoomHome=0.7
	loaderText=%3Ctextformat%20tabstops%3D%27300%27%3E%3Cfont%20face%3D%27Arial%27%20size%3D%2740%27%20color%3D%27%23%240%27%3E%0D%0DLoading%20%3A%20%247%0D%3C%2Ffont%3E%3C%2Ftextformat%3E

	loaderTextColor=#DADAE0
	loaderBackColor=#556173
	

	qualityStatic=high
	qualityMotion=low
	segments=20
	panHome=-20
	tiltHome=0

	

	layer_1=hotspots.swf
	layer_2=autorotator.swf
	layer_3=soundspot.swf


	</parameters>


<hotspots>

<global 

	onStart = "loadPreview();"
    play1="player.file=good.mp3;text3.text=%22Rubber Bullets%22 by 10cc;soundStart()"	
	loadPreview = "
		loadPano(?panoName=pano_cube_small,300);
		onTransitionEnd=loadMain();
		pano.qualityStatic=low
	" 
	loadMain = "
		loadPano(?panoName=pano_cube,900);
		onTransitionEnd=
	"
	>
    
	<pano pan="230" tilt="-10" zoom="0.9" timer="3000"/>
	
	<spot id="player" url="soundspot.swf" file="good.mp3" repeat="0" pan="18" tilt="0" enableSoundPanning="0" soundRadius="360" soundVolume="0.4"
				onComplete="global.soundComplete()"
			/>
	


		
</global>
	

	
	
</hotspots>

</panorama>
Reply With Quote
  #6  
Old 08-31-2011, 08:30 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Well,

the soundComplete function that you want to execute at the player.onComplete event is a global function, and should be defined inside the <global> tag (like the onStart and play1 function for example). And in that function you can pan away to another point:
Code:
<global 
   onStart = "loadPreview();"
   play1="player.file=good.mp3;text3.text=%22Rubber Bullets%22 by 10cc;soundStart()"
   ...
   soundComplete="pano.pan=100,5000;pano.tilt=20,5000"
>
 ...
Tommy
Reply With Quote
  #7  
Old 08-31-2011, 08:54 PM
Cyan Cyan is offline
Junior Member
 
Join Date: Jun 2010
Posts: 17
Downloads: 2
Uploads: 0
Default

Thanks Tommy,

I think this is starting to make sense. May I ask how I would do a pan,tilt,zoom operation after a set amount of time from the start of the pano rather than on an event like click or soundComplete?... and how would I then follow this with a second pan,tilt,zoom operation after another delay?
Reply With Quote
  #8  
Old 08-31-2011, 09:31 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Sure,

I guess there are a number of ways to it, but this is a way that I know works:
Code:
   <hotspots> 
      <global
         ...
         loadMain = "
            onTransitionEnd=waitBeforePan1()
            loadPano(?panoName=pano_cube,900);
         "

         waitBeforePan1="
            timer=1,4000,,gotoPan1;
         "
         gotoPan1="
            pano.pan=100,5000,smooth,,motionEnd;
            pano.tilt=-10,5000,smooth;
            timer=1,6000,,gotoPan2;
         "
         gotoPan2="
            pano.pan=150,5000,smooth,,motionEnd;
            pano.tilt=15,5000,smooth;
            pano.zoom=1.5,5000,smooth;
            timer=1,6000,,gotoPan3;
         "      
         gotoPan3="
            ...
         "

         motionEnd = "
            timer=0;
         "
      >
And you can of course add as many panning steps as you like.

Tommy
Reply With Quote
  #9  
Old 08-31-2011, 10:12 PM
Cyan Cyan is offline
Junior Member
 
Join Date: Jun 2010
Posts: 17
Downloads: 2
Uploads: 0
Default

Your a Star Tommy - I can see how this works and it will help me with further coding. A couple of final questions on soundspot... if thats OK?

What do the parts beyond the .mp3 definition do?

play1="player.file=good.mp3;text3.text=%22Rubber Bullets%22 by 10cc;soundStart()"

&

the pan & tilt here are just for the sound? What is sound.Complete?

spot id="player" url="soundspot.swf" file="good.mp3" repeat="0" pan="18" tilt="0" enableSoundPanning="0" soundRadius="360" soundVolume="0.4"
onComplete="global.soundComplete()"
Reply With Quote
  #10  
Old 08-31-2011, 11:01 PM
allSaints's Avatar
allSaints allSaints is offline
Senior Member
 
Join Date: Aug 2008
Location: Stockholm, Sweden
Posts: 945
Downloads: 0
Uploads: 0
Default

Cyan,

first of all - a basic thing to learn about FPP commands, is that they are separated by a semicolon (";"). So, the play1 function executes 3 commands:
  1. player.file=/panos/images/mp3/rubber.mp3 tells the soundspot plugin to load a sound file.
  2. text3.text=%22Rubber Bullets%22 by 10cc shows the title of the track in the textbox hotspot.
  3. soundStart() is a small housekeeping function containing a few other FPP commands.

The pan and tilt attributes in the <spot> sets the position of the hotspot in the pano - in this case, on the billboard. This, in connection with the soundRadius attribute makes the sound fade out when you pan away from the hotspot.

soundComplete is another housekeeping function that the soundspot plugin will tell FPP to execute after playing the sound file.

I would strongly recommend you to read the FPP tutorial. Although lacking a lot, it is important as a reference, and you can't do much without it.

Tommy
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 01:19 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.