Windows Media Player 11 SDK IWMPMedia.getMarkerName (VB and C#)
Previous | Next |
IWMPMedia.getMarkerName (VB and C#)
The getMarkerName method returns the name of the marker at the specified index.
[Visual Basic] Function getMarkerName( MarkerNum As Integer ) As String [C#] string getMarkerName ( int MarkerNum );
Parameters
MarkerNum
A System.Int32 that is the marker index.
Return Value
A System.String that is the marker name.
Remarks
This method returns NULL if the specified marker does not exist.
Some media items do not contain markers. Use markerCount to find out how many markers are in the current media item.
Marker index numbers start at 1.
Before calling this method, you must have read access to the library. For more information, see Library Access.
Example Code
The following code example uses getMarkerName to fill a multi-line text box with the names of the markers in the current media item. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
[Visual Basic]
' Get the number of markers in the current media item. Dim mCount As Integer = player.currentMedia.markerCount ' Create an array to store the list of marker names Dim markers(mCount) As String ' Verify that at least one marker exists in the current media. If (mCount > 0) Then ' Loop through the marker list. For i As Integer = 1 To mCount ' Store the marker name in the array. markers(i) = player.currentMedia.getMarkerName(i) Next i End If ' Display the marker names in the text box. markerNames.Lines = markers
FakePre-8365f2afae25490ca1a41b0b07d36669-9d759caeb55e40748e406893cc6ba74d
// Get the number of markers in the current media item. int mcount = player.currentMedia.markerCount; // Create an array to store the list of marker names string[] markers = new string[mcount]; // Verify that at least one marker exists in the current media. if (mcount > 0) { // Loop through the marker list. for (int i = 1; i < mcount + 1; i++) { // Store the marker name in the array. markers[i] = player.currentMedia.getMarkerName(i); } // Display the marker names in the text box. markerNames.Lines = markers; }
Requirements
Version: Windows Media Player 9 Series or later
Namespace: WMPLib
Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)
See Also
Previous | Next |