Visual Basic-based Sample Applications


This article describes the Microsoft® Visual Basic® version 5.0 samples in the Microsoft DirectShow™ Software Development Kit (SDK).

Contents of this article:

Visual Basic-based ActiveX Player

This ActiveX sample, Ocxvb01, demonstrates an application that uses the ActiveMovie Control. It has a form that contains menus and controls to demonstrate the access of various properties of the video control. See Using the ActiveMovie Control in Visual Basic for a detailed description of this sample.

The sample has a menu command that enables you to create the control by opening a video file, and to use Run, Pause, and Stop commands to programmatically control the ActiveMovie Control. All of the ActiveMovie Control Panel features, such as selection controls, position controls, and the trackbar control, can be made visible selectively, and enabled or disabled from menu commands in the sample application. Other properties, such as the rate and current position, can also be changed from the application, and you can set the image in the video control to various sizes such as half, default, double, and full-screen.

Visual Basic-based Filter Graph Builder

The filter graph builder sample, Builder, demonstrates how a Visual Basic-based application uses the collection interfaces that the filter graph manager exposes to build and connect a custom filter graph. The collection interfaces are composed of the following interfaces.

These interfaces appear as objects in the ActiveMovie Control type library in the Visual Basic development environment and allow the registry to be searched, filters to be added, and pins to be connected, among other things. See Constructing Filter Graphs Using Visual Basic for a detailed description of this sample.

The Builder sample presents a form that enables the user to see a list of filters in the registry and add filters to the filter graph. It also enables the user to examine the names and properties of pins on the filter, the media types on the pins, and to connect the pins. The sample has an additional sample routine, accessed by a menu, that automatically builds a filter graph. The filter graph is built using the collection interface objects to better demonstrate the more typical use of these objects in a Visual Basic-based application. The sample also enables you run the constructed filter graph.

Visual Basic-based Filter Graph Player

The filter graph player, VBDemo, demonstrates how to use the DirectShow Visual Basic objects that control the playback of video and that adjust properties of various components. This sample is described in detail in the article Controlling Filter Graphs Using Visual Basic.

The VBDemo sample enables you to open a video file. You can use the play, pause, and stop buttons to control the video. It positions the video window as a child window of the main form and displays the movie's length and elapsed time. It also enables the user to set the start position and rate. You use two sliders to adjust the audio renderer's volume and balance.

Visual Basic-based Player

The sample player, Player, is a short Visual Basic-based program that demonstrates the absolute minimum requirements for playing back a DirectShow media file without using the ActiveX Control. It uses the same DirectShow object library as the VBDemo sample, but provides only three buttons (Open, Play, and Stop) and a slider for indicating position.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.