VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "cLyric" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Option Explicit ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Objeto responsável por armazenar a letra (inteira) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Guarda o nome do objeto Private Const ST_MY_NAME As String = "cLyric" ' Indicador inicial de propriedades Private Const ST_INIT_PROPERTY As String = "[PROPERTY]" ' Indicador final de propriedade Private Const ST_FINAL_PROPERTY As String = "[\PROPERTY]" ' Leitura de propriedade Private Const CH_PROPERTY_READ As String = ":" ' Indicador de propriedade mutação Private Const ST_PROPERTY_MUTATION As String = "MUTATION" ' Indicador de propriedade right-to-left Private Const ST_PROPERTY_RIGHTTOLEFT As String = "RIGHTTOLEFT" ' Indicador de propriedade duração (em milisegundos) Private Const ST_PROPERTY_TRACKLENGTH As String = "TRACKLENGTH" ' Indicador de propriedade charset Private Const ST_PROPERTY_CHARSET As String = "CHARSET" ' Vetor de texto (linhas) Private oa_Line As cObjectArray ' Guarda a referência de um PictureBox auxiliar para uso de texto Private pb_Aux As PictureBox ' Tags da letra LRC Private st_IDTags As String ' Se a letra é simples (sem demarcação de tempos) Private bl_SimpleLyric As Boolean ' Guarda as dimensões totais da letra Private cd_Delta As cDelta ' Mutação do texto Private ln_Mutation As Long ' Alinhamento do texto Private ta_Alignment As TEXT_ALIGNMENT ' Se um texto é da direita pra esquerda Private bl_RightToLeft As Boolean ' Duração da faixa Private ln_TrackLength As Long ' Charset da letra Private bt_Charset As Byte Private bl_Charset As Boolean ' Se letra é editável Private bl_Editable As Boolean ' Link da letra ao ser clicada Private st_URL As String ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do texto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get text() As String Dim lnI As Long Dim lnJ As Long Dim stAux As String Dim stBuff As String On Error GoTo ErrTreat: ' Inicia retorno stAux = ST_INVALID_VALUE ' Varre lista de linhas lnJ = GetLineSize - 1 For lnI = 0 To lnJ ' Recupera texto stBuff = GetLine(lnI).text ' Verifica se é válido If (stBuff <> ST_SEP) Then ' Concatena ao texto stAux = stAux + stBuff + ST_LINESEP Else ' Adiciona linha vazia stAux = stAux + ST_LINESEP End If Next lnI ' Retorna text = stAux Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Text [Get]" End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do texto (modo remontagem) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get TextRebuild() As String Dim lnI As Long Dim lnJ As Long Dim stAux As String Dim stBuff As String On Error GoTo ErrTreat: ' Inicia retorno stAux = ST_INVALID_VALUE ' Varre lista de linhas lnJ = GetLineSize - 1 For lnI = 0 To lnJ ' Recupera texto stBuff = GetLine(lnI).TextRebuild ' Verifica se é válido If (stBuff <> ST_SEP) Then ' Concatena ao texto stAux = stAux + stBuff + ST_LINESEP Else ' Adiciona linha vazia stAux = stAux + ST_LINESEP End If Next lnI ' Retorna TextRebuild = stAux Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".TextRebuild [Get]" End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do tamamnho do texto (altura) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get TextHeight() As Long Dim lnLines As Long ' Recupera número de linhas lnLines = GetLineSize ' Se possuir linhas If (lnLines > 0) Then ' Retorna valor TextHeight = cd_Delta.Final.Y / lnLines Else ' Retorna inválido TextHeight = LN_INVALID_VALUE End If End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade de ID Tags ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get IDTags() As String ' Retorna IDTags = st_IDTags End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade da mutação do texto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Mutation() As Long ' Retorna Mutation = ln_Mutation End Property Public Property Let Mutation(lnInput As Long) ' Seta ln_Mutation = lnInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do alinhamento do texto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Alignment() As TEXT_ALIGNMENT ' Retorna Alignment = ta_Alignment End Property Public Property Let Alignment(taInput As TEXT_ALIGNMENT) ' Seta ta_Alignment = taInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade de right-to-left ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get RightToLeft() As Boolean ' Retorna RightToLeft = bl_RightToLeft End Property Public Property Let RightToLeft(blInput As Boolean) ' Seta bl_RightToLeft = blInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade da duração da faixa ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get TrackLength() As Long ' Retorna TrackLength = ln_TrackLength End Property Public Property Let TrackLength(lnInput As Long) ' Seta ln_TrackLength = lnInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do charset usado ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Charset() As Byte ' Especificado? If (bl_Charset) Then ' Retorna Charset = bt_Charset Else ' Retorna padrão do sistema Charset = fn_Charset End If End Property Public Property Let Charset(btInput As Byte) ' Seta bt_Charset = btInput bl_Charset = True End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Seta um novo código de mutação ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub Mutate() On Error GoTo ErrTreat: ' Gera novo valor mutante Mutation = (Rnd * LN_LIMIT_VALUE) + 1 Exit Sub ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Mutate" End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do tamanho ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Delta() As cDelta ' Retorna Set Delta = cd_Delta End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade do Simples ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Simple() As Boolean ' Retorna Simple = bl_SimpleLyric End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade de referência auxiliar PictureBox ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get AuxPictureBox() As PictureBox ' Retorna Set AuxPictureBox = pb_Aux End Property Public Property Let AuxPictureBox(pbInput As PictureBox) ' Seta novo valor Set pb_Aux = pbInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Retorna uma linha dado seu Index no texto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function GetLine(Index As Long) As cLyricLine On Error GoTo ErrTreat: ' Retorna Set GetLine = oa_Line.Element(Index) Exit Function ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".GetLine", Index End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Remove uma linha dado seu Index ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub RemoveLine(Index As Long) On Error GoTo ErrTreat: ' Remove oa_Line.Remove Index Exit Sub ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".RemoveLine", Index End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Retorna o número de linhas ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function GetLineSize() As Long ' Retorna GetLineSize = oa_Line.Size End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade das propriedades da Lyrik ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Properties() As String Dim stAux As String Dim stDuration As String On Error GoTo ErrTreat: ' Se possui duração válida da faixa If (ln_TrackLength <> LN_INVALID_VALUE) Then ' Cria duração stDuration = ST_PROPERTY_TRACKLENGTH + CH_PROPERTY_READ + CStr(ln_TrackLength) + ST_LINESEP Else ' Duração indefinida stDuration = ST_INVALID_VALUE End If ' Monta stAux = ST_INIT_PROPERTY + ST_LINESEP + _ ST_PROPERTY_MUTATION + CH_PROPERTY_READ + CStr(Mutation) + ST_LINESEP + _ stDuration + _ ST_PROPERTY_CHARSET + CH_PROPERTY_READ + CStr(bt_Charset) + ST_LINESEP + _ ST_PROPERTY_RIGHTTOLEFT + CH_PROPERTY_READ + boolTOchar(RightToLeft) + ST_LINESEP + _ ST_FINAL_PROPERTY ' Retorna Properties = stAux Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Properties [Get]" End Property Public Property Let Properties(stInput As String) Dim lnNaux0 As Long Dim lnNaux1 As Long Dim lnNaux2 As Long Dim lnInputLen As Long Dim stAux As String Dim stValue As String On Error GoTo ErrTreat: ' Inicia variáveis lnNaux0 = 1 + Len(ST_LINESEP) ' Recupera tamanho da entrada lnInputLen = Len(stInput) ' Enquanto não chegar ao final While (lnNaux0 < lnInputLen) ' Verifica qual a próxima quebra de linha lnNaux1 = InStr(lnNaux0, stInput, ST_LINESEP) ' Se não encontrou If (lnNaux1 = 0) Then ' Carrega o restante stAux = Mid(stInput, lnNaux0) lnNaux1 = lnInputLen ' Se é válido ElseIf (lnNaux1 > lnNaux0) Then ' Carrega entre os demarcadores stAux = Mid(stInput, lnNaux0, lnNaux1 - lnNaux0) ' Encontra o separador de leitura lnNaux2 = InStr(1, stAux, CH_PROPERTY_READ) ' Se encontrou If (lnNaux2 > 0) Then ' Lê propriedade stValue = Mid(stAux, lnNaux2 + Len(CH_PROPERTY_READ)) ' Verifica qual é a propriedade Select Case UCase(Mid(stAux, 1, lnNaux2 - 1)) ' Mutação Case ST_PROPERTY_MUTATION ' Se for numérico If IsNumeric(stValue) Then ' Seta mutação Mutation = CLng(stValue) End If ' Direita para esquerda Case ST_PROPERTY_RIGHTTOLEFT ' Se tiver tamanho 1 If (Len(stValue) = 1) Then ' Seta valor RightToLeft = charTObool(stValue) End If ' Duração da faixa Case ST_PROPERTY_TRACKLENGTH ' Se for numérico If IsNumeric(stValue) Then ' Seta duração ln_TrackLength = CLng(stValue) End If ' Charset Case ST_PROPERTY_CHARSET ' SE for numérico If IsNumeric(stValue) Then ' Seta charset Charset = CByte(stValue) End If End Select End If End If ' Seta posição na leitura lnNaux0 = lnNaux1 + Len(ST_LINESEP) Wend ' Modo debug? #If debugmode Then fDebug.cLyric_LastLoadCharset = Charset #End If Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Properties [Let]" End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade da Lyric (LRC) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get LoadLRC() As String On Error GoTo ErrTreat: Dim lnI As Long Dim stAux As String ' Inicia retorno stAux = ST_INVALID_VALUE ' Se possui lines If (GetLineSize > 0) Then ' Varre lista de lines For lnI = 0 To (GetLineSize - 1) ' Concatena linhas stAux = stAux + GetLine(lnI).LoadLRC + ST_LINESEP Next lnI End If ' Retorna LoadLRC = stAux Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".LoadLRC [Get]" End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Propriedade da Lyric ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Load() As String On Error GoTo ErrTreat: Dim lnI As Long Dim stAux As String ' Inicia retorno stAux = ST_INVALID_VALUE ' Se possui lines If (GetLineSize > 0) Then ' Varre lista de lines For lnI = 0 To (GetLineSize - 1) ' Concatena linhas stAux = stAux + GetLine(lnI).Load + ST_LINESEP Next lnI End If ' Retorna Load = stAux Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Load [Get]" End Property Public Property Let Load(stInput As String) Dim lnNaux0 As Long Dim lnNaux1 As Long Dim lnNaux2 As Long Dim lnInputLen As Long Dim stAux As String Dim llAux As cLyricLine Dim blID As Boolean On Error GoTo ErrTreat: ' Libera vetor de linhas, caso já exista oa_Line.Clear ' Seta que letra é do tipo simples bl_SimpleLyric = True ' Recupera tamanho da entrada lnInputLen = Len(stInput) ' Verifica se possui entrada If (lnInputLen > 0) Then ' Inicia valores lnNaux0 = 1 lnNaux1 = 0 blID = False ' Verifica se Lyrik possui propriedades lnNaux1 = InStr(1, stInput, ST_INIT_PROPERTY) ' Se encontrou If (lnNaux1 > 0) Then ' Verifica se encontra o marcador final de propriedade lnNaux2 = InStr(lnNaux1, stInput, ST_FINAL_PROPERTY) ' Se encontrou If (lnNaux2 > 0) Then ' Seta propriedades Properties = Mid(stInput, lnNaux1 + Len(ST_INIT_PROPERTY), lnNaux2 - lnNaux1 - Len(ST_INIT_PROPERTY)) ' Seta próximo caracter de leitura da lyrik lnNaux0 = lnNaux2 + Len(ST_FINAL_PROPERTY) End If Else ' Seta que pode estar em uma tag blID = True End If ' Enquanto não chegar ao final do arquivo While (lnNaux0 <= lnInputLen) ' Cria objeto Set llAux = New cLyricLine ' Verifica qual a próxima quebra de linha lnNaux1 = InStr(lnNaux0, stInput, ST_LINESEP) ' Se encontrou If (lnNaux1 > 0) Then ' Seta entre os demarcadores stAux = Mid(stInput, lnNaux0, lnNaux1 - lnNaux0) Else ' Seta o restante da letra stAux = Mid(stInput, lnNaux0) lnNaux1 = lnInputLen End If ' Carrega texto llAux.Load = stAux ' Se ainda puder estar entre ID Tags If (blID) Then ' Se linha não possuir timer mas possuir tags de time If (llAux.GetTimeSize = 0) And (InStr(1, stAux, "]") > (InStr(1, stAux, "[") + 1)) Then ' Adiciona linha na tags st_IDTags = st_IDTags + stAux + ST_LINESEP Else ' Seta que não é mais uma tag blID = False ' Continua com não tag GoTo NonTag: End If Else NonTag: ' Se letra ainda for do tipo simples If bl_SimpleLyric Then ' Verifica se linha é simples If Not llAux.Simple Then ' Seta que letra não é do tipo simples bl_SimpleLyric = False End If End If ' Adiciona linha ao array oa_Line.Add llAux End If ' Incrementa contadores lnNaux0 = lnNaux1 + Len(ST_LINESEP) Wend End If ' Redimenciona Resize Exit Property ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Load [Let]" End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Se letra é editável ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get Editable() As Boolean ' Recuperando Editable = bl_Editable End Property Public Property Let Editable(blInput As Boolean) ' Seta valor bl_Editable = blInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Link da letra ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Property Get URL() As String ' Recuperando URL = st_URL End Property Public Property Let URL(stInput As String) ' Setando st_URL = stInput End Property ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Redimenciona a lyric (reimprime) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub Resize() On Error GoTo ErrTreat: Dim lnJ As Long, lnK As Long Dim lnMaxX As Long Dim lnY As Long Dim stAux As String Dim llAux As cLyricLine Dim ptAux As POINTAPI ' Inicia valores lnJ = 0 lnMaxX = 0 lnY = 0 ' Limpa imagem auxiliar pbClear pb_Aux ' Se possuir charset específico If (bl_Charset) Then ' Seta o tipo de fonte no auxiliar (com charset específico) SetFontType pb_Aux, bt_Charset Else ' Seta o tipo de fonte no auxiliar (com charset padrão) SetFontType pb_Aux End If ' Seta propriedade no auxiliar pb_Aux.ScaleMode = 3 ' Processa informações DoEvents ' Usa padrão do programa Alignment = ta_TextAlignment ' Recupera a posição da última linha lnK = (GetLineSize - 1) ' Varre a lista de linhas For lnJ = 0 To lnK ' Recupera objeto linha Set llAux = GetLine(lnJ) ' Linka auxiliar llAux.AuxPictureBox = pb_Aux ' Recupera texto da linha stAux = llAux.text ' Determina tamanho do texto GetTextExtentPoint32E pb_Aux.hDC, stAux, ptAux ' Seta deltas do texto With llAux.Delta .Initial.Y = lnY .Final.Y = lnY + ptAux.Y .Final.X = ptAux.X End With ' Incrementa delta Y lnY = lnY + ptAux.Y ' Verifica se esta linha tem um X maior If (ptAux.X > lnMaxX) Then ' Guarda valor lnMaxX = ptAux.X End If Next lnJ ' Verifica qual é o alinhamento Select Case Alignment ' Se for na esquerda Case TEXT_ALIGNMENT.taLeft, TEXT_ALIGNMENT.taNone ' Varre a lista de linhas novamente, para que estas possam alinhar as words For lnJ = 0 To lnK ' Recupera objeto Set llAux = oa_Line.Element(lnJ) ' Define posição inicial llAux.Delta.Initial.X = 0 ' Redimenciona words llAux.Resize Next lnJ ' Se for centralizado Case TEXT_ALIGNMENT.taCenter ' Varre a lista de linhas novamente, para que estas possam alinhar as words For lnJ = 0 To lnK ' Recupera objeto Set llAux = oa_Line.Element(lnJ) ' Define posição inicial & final With llAux.Delta .Initial.X = (lnMaxX - .Final.X) / 2 .Final.X = .Final.X + .Initial.X End With ' Redimenciona linha & words llAux.Resize Next lnJ ' Se for à direita Case TEXT_ALIGNMENT.taRigth ' Varre a lista de linhas novamente, para que estas possam alinhar as words For lnJ = 0 To lnK ' Recupera objeto Set llAux = oa_Line.Element(lnJ) ' Define posição inicial & final With llAux.Delta .Initial.X = lnMaxX - .Final.X .Final.X = .Final.X + .Initial.X End With ' Redimenciona linha & words llAux.Resize Next lnJ End Select ' Define delta iniciais cd_Delta.Initial.X = 0 cd_Delta.Initial.Y = 0 ' Verifica se houve linhas carregadas If (GetLineSize > 0) Then ' Recupera objeto Set llAux = oa_Line.Element(GetLineSize - 1) ' Define delta finais cd_Delta.Final.X = lnMaxX cd_Delta.Final.Y = llAux.Delta.Final.Y Else ' Define delta finais cd_Delta.Final.X = 0 cd_Delta.Final.Y = 0 End If ' Limpa auxiliar pbClear pb_Aux ' Libera objetos Set pb_Aux = Nothing Exit Sub ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".Resize" End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Requesitando arquivo LRK ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function LRK() As String On Error GoTo ErrTreat: ' Preenche com timers e retorna LRK = Properties + Load Exit Function ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".LRK" End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Requesitando arquivo LRC ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function LRC(cmMusic As cMusic) As String Dim stAux As String Dim stTAG As String On Error GoTo ErrTreat: ' Inicia sem idtag stTAG = ST_INVALID_VALUE ' Se atual possui tags definidas If (Len(st_IDTags) > 0) Then ' Seta tags atuais stTAG = st_IDTags Else ' Se há música definida If Not (cmMusic Is Nothing) Then ' Recupera tag da música stTAG = cmMusic.IDTag End If End If ' Preenche com timers stAux = stTAG + LoadLRC ' Retorna LRC = stAux Exit Function ErrTreat: LogErrMessage Err.Description, ST_MY_NAME + ".LRC" End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Procedimentos de criação e destruição do objeto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Private Sub Class_Initialize() ' Inicia array Set oa_Line = New cObjectArray ' Carrega delta Set cd_Delta = New cDelta ' Inicia valores cd_Delta.Initial.X = 0 cd_Delta.Initial.Y = 0 cd_Delta.Final.X = 0 cd_Delta.Final.Y = 0 ta_Alignment = taNone bl_RightToLeft = False bl_SimpleLyric = True ln_TrackLength = LN_INVALID_VALUE ln_Mutation = LN_INVALID_VALUE bl_Editable = True st_URL = ST_INVALID_VALUE st_IDTags = ST_INVALID_VALUE bt_Charset = fn_Charset bl_Charset = False End Sub Private Sub Class_Terminate() ' Libera objetos Set pb_Aux = Nothing Set cd_Delta = Nothing ' Esvazia arrays oa_Line.Free ' Libera array Set oa_Line = Nothing End Sub