This project is read-only.

AsfMojo 1.2 Interface changes

AsfMojo 1.2 adds support for extracting images and wave streams in a more stream-lined way, users do not have to be aware anymore of the underlying streams.

Creating images

The "traditional" approach is the static FromFile() method on the AsfImage class:


Bitmap bitmap = AsfImage.FromFile(videoFileName, 1.0);

The fluent approach uses multiple chainable methods to get the image:

Bitmap bitmap = AsfImage.FromFile(videoFileName)
                        .AtOffset(1.0);

 

Creating wave streams

The same principle detailed above applies to wave streams - the "traditional" approach is the static FromFile() method on the WaveMemory class:

WaveMemoryStream waveMemoryStream = WaveMemoryStream.FromFile(videoFileName, 1.0, 4.0);

The fluent approach again uses multiple chainable methods:

WaveMemoryStream waveMemoryStream = WaveMemoryStream.FromFile(videoFileName)
                                                    .From(1.0)
                                                    .To(4.0);

Updating content properties

Even though a traditional interface exists, updating content properties should be done through the fluent interface only, all update methods are chainable and optional.

AsfFile.From(videoFileName)
       .WithFileCreationTime(DateTime.Parse("2/27/2011"))
       .WithAuthor("Fred Fish")
       .WithDescription("Some lengthy description of the content")
       .WithCopyright("Copyright (c) 2011")
       .WithTitle("Some title")
       .WithRating("5.0")
       .Update();

 

 

 

 

 

 

 

Last edited May 30, 2011 at 10:05 PM by michael_knapp, version 1

Comments

No comments yet.