Tutorial 4 – AVI Export Status

Requirements:
Tutorial 3 – Simple AVI Export


In the previous tutorial, we showed how to create a simple AVI export.

In this tutorial, we’ll extend the previous AVI export program to handle export events, including how to determine when the export is complete. AxAuga provides this event mechanism. Let’s check it out:

Before starting the AVI export, we set a callback with AxAuga’s TriggerSelected event handler. This event handler is called with frequent updates about the progress of the export.
The second argument to the callback is a _IAugaEvents_TriggerSelectedEvent, which includes the triggerURL property. The triggerURL property contains the event information, which looks like:

This is the piece of information we need to determine the progress of the export. It starts with the ‘exportprogress’ header and lists out these properties and their values:
guid: The ID of the Export.
start: The start time of the Export in number of 100-nanosecond intervals since January 1, 1601 (UTC) or Windows FileTime.
end: The start time of the Export in number of 100-nanosecond intervals since January 1, 1601 (UTC) or Windows FileTime.
label: The Export label which is in the form?
type: The Export type which will be ‘avi’ for AVI Exports.
state: An integer representing the state of the export, possible values include:
0 – The Export has not been initialized.
1 – The Export is in progress.
2 – The Export has finished.
3 – The Export has finished with errors, check the log.
4 – The Export has failed, check the log.
5 – The Export has been canceled.
progress: The Export completion percentage.
filelist: When the Export has finished, this is the list of places the Export was written to.

Given the format and properties above, let’s parse out the values:

The above code is just to show how to parse out the ‘exportprogress’ message. In our case, we print out for each message with the ‘state’ property, and if the export finishes, then we close the Windows Form.

Screenshots of the final program:
Series-4-Tutorial-4-1
Series-4-Tutorial-4-2

That’s about it. Now you can run an AVI export until completion.


Next:
Tutorial 5 – Export AVI with Audio