Here is a patch for the ChoreoSequencer, that outputs the actual frame in
the first output, and adds an input to seek a specific frame. (to be
commited after some tests...)


Regards,
Natanael.
Index: CLAM/plugins/spacialization/src/ChoreoSequencer.hxx
===================================================================
--- CLAM/plugins/spacialization/src/ChoreoSequencer.hxx	(revision 12371)
+++ CLAM/plugins/spacialization/src/ChoreoSequencer.hxx	(working copy)
@@ -51,6 +51,8 @@
 	};
 
 	Config _config;
+	FloatInControl _frameSeek;
+	FloatOutControl _frame;
 	FloatOutControl _targetX;
 	FloatOutControl _targetY;
 	FloatOutControl _targetZ;
@@ -62,6 +64,7 @@
 	FloatOutControl _sourceAzimuth;
 	FloatOutControl _sourceElevation;
 	AudioInPort _syncIn;
+	unsigned _lastFrameSeek;
 
 	unsigned _samplesPerControl;
 	unsigned _sampleCount;
@@ -76,7 +79,9 @@
 
 public:
 	ChoreoSequencer(const Config& config = Config()) 
-		: _targetX("target X", this)
+		: _frameSeek("frame seek", this)
+		, _frame("frame number", this)
+		, _targetX("target X", this)
 		, _targetY("target Y", this)
 		, _targetZ("target Z", this)
 		, _targetAzimuth("target azimuth", this)
@@ -87,6 +92,7 @@
 		, _sourceAzimuth("source azimuth", this)
 		, _sourceElevation("source elevation", this)
 		, _syncIn("sync", this)
+		, _lastFrameSeek(0)
 	{
 		Configure( config );
 	}
@@ -97,6 +103,13 @@
 	bool Do()
 	{
 		CLAM_DEBUG_ASSERT(_sampleCount<2*_samplesPerControl,"_sampleCount too large" );
+		unsigned frameSeek = _frameSeek.GetLastValue();
+		if (frameSeek != _lastFrameSeek)
+		{
+			unsigned firstFrame = _controlSequence[0][FrameColumn];
+			_sequenceIndex = frameSeek - firstFrame;
+			_lastFrameSeek = frameSeek;
+		}
 		_sampleCount += _frameSize;
 		int sourceIndex = _config.GetSourceIndex();
 		if (_sampleCount>=_samplesPerControl)
@@ -104,6 +117,7 @@
 			//std::cout << "("<<_sequenceIndex << "/" <<_controlSequence.size() << ")" << std::flush;
 			const Row & row = _controlSequence[_sequenceIndex];
 			//TODO check that _indexTargetX,Y,Z < row.size()
+			_frame.SendControl( row[FrameColumn]);
 			_targetX.SendControl( row[TargetXColumn] );
 			_targetY.SendControl( row[TargetYColumn] );
 			_targetZ.SendControl( row[TargetZColumn] );
@@ -166,7 +180,7 @@
 	}
 	enum FileColumns {
 		FrameColumn=0,
-		// TODO: What does the column 1 means?
+		FieldOfView=1,
 		TargetAzimutColumn=2,
 		TargetZenitColumn=3,
 		TargetXColumn=4,
_______________________________________________
Clam-devel mailing list
[email protected]
https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel

Reply via email to