MediaServer Component Objects
In addition to the methods, properties, and events used for configuring and managing Theater servers, the MediaServer control also manages collections of component objects that encapsulate the status and behavior of clients, servers, disk drives, and titles. Some objects represent a collection of other objects. These component objects are:
-
A Client object encapsulates the state of a client. It contains the ID of the client, its IP address, the title, if any, being streamed to the client, and the name of its host computer.
-
A Clients object is a collection of Client objects. As with all the collections, you can retrieve a Client member object by using its Item property and query the total number of Client objects by using the Count property. You can also remove a Client object by calling its Remove method.
-
A ContentServer object encapsulates the state of a content server. It holds information about its identifier, the content disk drives it manages, the host computer it is running on, and its working status. A content server is accessible through its associated ContentServer object.
-
A ContentServers object represents a collection of ContentServer objects. It can contain from one to fourteen such objects.
-
A content server Disk object provides access to a content server disk drive dedicated for multimedia content storage. You can query the ID, its drive letter, the disk size, and the status, with the appropriate properties. You can take the disk online or offline by invoking its Online method and repair the content on the disk by calling its Rebuild method.
-
A content server Disks object represents a collection of Disk objects. You can retrieve a member Disk object with the Item property and query the total number of member Disk objects with the Count property. Each ContentServer object manages a Disks collection.
-
A Title object encapsulates the information about a multimedia title, including its description, author, copyright, size, version, format, play duration, and creation time.
-
A Titles collection object contains a number of Title objects. You can call its Add or Remove method to add a title to or remove one from the title server and the Titles collection.
-
A Walker object encapsulates the information about file walker utilities used in the conversion of title format.
-
A Walkers collection object contains a number of Walker objects. In addition to exposing the Item and Count properties, it offers the Find functionality for searching a Walker object by matching its format type.
-
A Logging object exposes methods and properties for managing event log monitoring applications.
The following chart illustrates the hierarchy of objects managed by the MediaServer control:
Using MediaServer Component Objects
As with any object model, you access the methods and properties with the “dot” operator, as illustrated in the following syntax:
<MediaServer Object>.<Component Object>.<Property Name>
For example, you could use
Mediaserver1.Logging.Directory
to access the Directory property of a Logging object.
Using MediaServer Collections
A collection helps to centralize the management of its member objects. All NetShow Theater collection objects are zero-based arrays of like types of objects. All collection objects expose the Count property, which specifies the number of objects contained in the collection, and the Item property for retrieving individual objects in the collection.
To access properties and methods of objects in a collection, the name of the collection object is referenced, with a numeric argument specifying the position of the object in the array. For example, you can use the following syntax to access the Name property of a Client object.
<MediaServer Object>.<Collection Name>[.Item](Index).<Property Name>
The Item property is the default property of each collection object. Explicit use of it to reference a member object is optional. For example, you could write the following code to display the IPAddress property of each Client object in a Clients collection object:
Dim clients as IMSrvClients
Set clients = MediaServer1.Clients
For i=0 to clients.Count-1
MsgBox clients(i).IPAddress
Next
However, with Visual Basic, you could make the implementation more efficient by using the For Each … In … loop statement:
Dim client As IMSrvClient
For Each client In MediaServer1.Clients
MsgBox client.ipaddress
Next
© 1996-1998 Microsoft Corporation. All rights reserved.