public sealed class PlaylistEditor
Public NotInheritable Class PlaylistEditor
Dim instance As PlaylistEditor
public ref class PlaylistEditor sealed
[<SealedAttribute>]
type PlaylistEditor = class end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Private Sub Test
' *********************************
' Instance the PlaylistEditor Class
' *********************************
Dim playlist As New PlaylistEditor(playlistFile:="C:\Playlist.pls",
playlistType:=PlaylistType.Pls,
append:=False,
fileEncoding:=Encoding.Default)
' ******************************************
' Retrieve the instanced PlaylistEditor info
' ******************************************
MessageBox.Show(playlist.FilePath)
MessageBox.Show(playlist.Type.ToString())
MessageBox.Show(CStr(playlist.Append))
MessageBox.Show(String.Format("Encoding: {0}, CodePage: {1}",
playlist.FileEncoding.BodyName,
playlist.FileEncoding.CodePage))
' **************************
' Instance a TrackInfo Class
' **************************
Dim tInfo As New PlaylistTrackInfo
With tInfo
.Path = "C:\Track1.ext"
.Title = "Track1 Title"
.Length = TimeSpan.Parse("00:05:30")
End With
' ***************
' Add a new track
' ***************
playlist.Add(TrackInfo:=tInfo)
playlist.Add(filepath:="C:\Track2.ext", allowDuplicate:=False)
playlist.Add(filepath:="C:\Track3.ext", title:="Track3 Title", length:=TimeSpan.Parse("01:35:20"))
' *************************************************
' Sets the extended track info of an existing track
' *************************************************
Dim oldTrackPath As String = "C:\Track2.ext"
Dim tInfoSet As New PlaylistTrackInfo
With tInfoSet
.Path = "C:\Modified Track2.ext"
.Title = "My modified Track2 title"
.Length = playlist.GetTrack(oldTrackPath).Length
End With
playlist.Set(filepath:=oldTrackPath, trackInfo:=tInfoSet)
' ************************
' Remove an existing track
' ************************
playlist.Remove(filepath:="C:\Track3.ext")
playlist.Remove(trackIndex:=2)
' ********************************
' Determine whether a track exists
' ********************************
MessageBox.Show(CStr(playlist.Exist(filepath:="C:\Track3.ext")))
MessageBox.Show(CStr(playlist.Exist(trackIndex:=3)))
' ************************************************
' Count the total amount of tracks in the playlist
' ************************************************
MessageBox.Show(CStr(playlist.Count))
' ************************************
' Get extended track info from a track
' ************************************
Dim trackInfo1 As PlaylistTrackInfo = playlist.GetTrack(filepath:="C:\Track1.ext")
Dim trackInfo2 As PlaylistTrackInfo = playlist.GetTrack(trackIndex:=2)
' ******************************************
' Get all tracks and its extended track info
' ******************************************
Dim tracks As ReadOnlyCollection(Of PlaylistTrackInfo) = playlist.Tracks()
For Each track As PlaylistTrackInfo In tracks
Dim sb As New Global.System.Text.StringBuilder
With sb
.AppendLine(String.Format("Track Index : {0}", CStr(track.Index)))
.AppendLine(String.Format("Track Path : {0}", track.Path))
.AppendLine(String.Format("Track Title : {0}", track.Title))
.AppendLine(String.Format("Track Length: {0}", Convert.ToString(track.Length)))
End With
MessageBox.Show(sb.ToString())
Next track
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
PlaylistEditor | Initializes a new instance of the PlaylistEditor class. |
Append | Gets a value indicating whether the append mode is activated. |
Count | Gets the amount of track entries in the playlist. |
FileEncoding | Gets the playlist file encoding. |
FilePath | Gets the playlist filepath. |
Tracks | Gets all the tracks and their extended track information (if any) in the playlist. |
Type | Gets the playlist type. |
Add(PlaylistTrackInfo, Boolean) | Adds a new track entry in the playlist, with extended track information. |
Add(String, Boolean) | Adds a new track entry in the playlist. |
Add(String, String, TimeSpan, Boolean) | Adds a new track entry in the playlist, with extended track information. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Exist(Int32) | Determines whether the specified track exists in the playlist. |
Exist(String) | Determines whether the specified track exists in the playlist. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetTrack(Int32) | Gets the track path and its extended track information (if any) of the specified track index in the playlist. |
GetTrack(String) | Gets the extended track information (if any) of the specified track in the playlist. |
GetType | Gets the Type of the current instance. (Inherited from Object) |
Remove(Int32) | Removes the specified track entry from the playlist. |
Remove(String) | Removes the specified track entry from the playlist. |
Set(Int32, PlaylistTrackInfo) | Sets the extended track info of the specified track. |
Set(String, PlaylistTrackInfo) | Sets the extended track info of the specified track. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |