Thursday, August 29, 2013

Telemetry Power Tips #2: Show paused state with timeline section names

Telemetry's API allows you to pause and resume capture dynamically, allowing you to pick and choose when data is acquired*.  This is particularly helpful if you're running sessions for a long period of time and don't want to capture data continuously. 

When reviewing your data you'll want to spot paused areas of the capture.  With Telemetry 1.x this was handled automatically since pauses were latched to the end of frame boundaries, so 'empty' frames were drawn differently.  However since Telemetry 2 supports multiple frame sets this can get complex, so instead of rendering frames as paused or not, it makes more sense to mark a region of time as paused.

A simple mechanism for this is to use the tmSetTimelineSectionName API.  The name 'paused' is recognized by Telemetry and it will use a bright red background for those timeline sections.

tmSetTimelineSectionName( cx, "paused" );
tmPause( cx, 1 );
...
tmPause( cx, 0 );
tmSetTimelineSectionName( cx, current_state_name );

This gives you capture somewhat like this:




* Note that a more flexible method of managing event capture in real time is available, but requires a bit more application setup.

No comments:

Post a Comment