home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Programmer'…arterly (Limited Edition)
/
Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso
/
code
/
ch17code
/
title.cls
< prev
next >
Wrap
Text File
|
1995-08-13
|
2KB
|
88 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Title"
Attribute VB_Creatable = False
Attribute VB_Exposed = True
' Title class -- TITLE.CLS
' Represents a single CD Title.
' Contains collection of Track objects
' (individual songs on the CD).
'
' Properties:
'
' Methods:
'
Option Explicit
Private colTracks As New Collection
Private mParent As Object
' Name property
' (Read/write)
' Sets and retrieves Name info from the data file.
Public Name As String
' Create method.
Public Function Create() As Object
Dim Index As Integer
Dim iTrackCount As Integer
iTrackCount = frmControlPanel.Tracks
Me.Name = "<Untitled>"
If iTrackCount Then
ReDim NewTracks(1 To iTrackCount) As Track
For Index = 1 To iTrackCount
ControlPanel.Track = Index
Set NewTracks(Index) = New Track
NewTracks(Index).StartPosition = ControlPanel.TrackPosition
NewTracks(Index).Length = ControlPanel.TrackLength
NewTracks(Index).Name = "Track" & Index
NewTracks(Index).Parent Me, FLAG_INTERNAL
colTracks.Add NewTracks(Index), NewTracks(Index).Name
Next Index
End If
Set Create = Me
End Function
' Delete method
Public Sub Delete()
' Remove title from datafile
End Sub
' Tracks method (accessor function for
' colTracks collection).
Public Function Tracks() As Object
Set Tracks = colTracks
End Function
' CurrentTrack property
Public Property Get CurrentTrack() As Object
Set CurrentTrack = colTracks(ControlPanel.CurrentTrack)
End Property
Public Property Get Application() As Object
Set Application = Application
End Property
Public Function Parent(Optional objSetting, Optional iFlag)
If IsMissing(objSetting) And IsMissing(iFlag) Then
Set Parent = mParent
ElseIf Not IsMissing(objSetting) And Not IsMissing(iFlag) Then
If iFlag = FLAG_INTERNAL Then
Set mParent = objSetting
Else
Err.Raise 5, Application.Name
End If
Else
Err.Raise 5, Application.Name
End If
End Function