VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsTitleGeneralInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' -------------------------------------------------------------------------------
'
'   AVStoDVD - by MrC
'   File: clsTitleGeneralInfo.cls
'   Purpose: Class that handle Title Info properties
'   Requires: clsMediaInfo.cls
'
' -------------------------------------------------------------------------------


Option Explicit
Option Compare Binary
Option Base 0


Private GeneralMediaInfoVersion As String
Private GeneralFormat As String
Private GeneralAudioTracksCount As String
Private GeneralSubsTracksCount As String
Private GeneralTime As String
Private GeneralChaptersList As String

Public Function Initialize(SourceMediaInfo As clsMediaInfo) As Boolean

    With SourceMediaInfo
        GeneralMediaInfoVersion = .MediaInfoVersion
        GeneralFormat = .Format
        GeneralAudioTracksCount = .AudioTracksCount
        GeneralSubsTracksCount = .TextTracksCount
        GeneralTime = .Time
        GeneralChaptersList = .ChaptersList
    End With
    Initialize = CBool(Len(GeneralFormat))

End Function

Public Property Get MediaInfoVersion() As String

    MediaInfoVersion = GeneralMediaInfoVersion

End Property

Public Property Let MediaInfoVersion(value As String)

    GeneralMediaInfoVersion = value

End Property

Public Property Get Format() As String

    Format = GeneralFormat

End Property

Public Property Let Format(value As String)

    GeneralFormat = value

End Property

Public Property Get AudioTracksCount() As String

    AudioTracksCount = GeneralAudioTracksCount

End Property

Public Property Let AudioTracksCount(value As String)

    GeneralAudioTracksCount = value

End Property

Public Property Get SubsTracksCount() As String

    SubsTracksCount = GeneralSubsTracksCount

End Property

Public Property Let SubsTracksCount(value As String)

    GeneralSubsTracksCount = value

End Property

Public Property Get Time() As String

    Time = GeneralTime

End Property

Public Property Let Time(value As String)

    GeneralTime = value

End Property

Public Property Get ChaptersList() As String

    ChaptersList = GeneralChaptersList

End Property

Public Property Let ChaptersList(value As String)

    GeneralChaptersList = value

End Property

Public Property Get ChaptersSummary() As String

    Dim Chapters
    Dim jj As Integer
    
    If GeneralChaptersList <> "" Then
        Chapters = Split(GeneralChaptersList, " ")
        For jj = LBound(Chapters) To UBound(Chapters)
            ChaptersSummary = ChaptersSummary & "Chapter " & jj + 1 & ":" & Chr(9) & Chapters(jj) & vbCrLf
        Next
    End If

End Property

