Subtitle time modification software

Source: Internet
Author: User

Version 5.00:
Begin VB. Form form1
Caption = "form1"
Clientheight = 1, 5715
Clientleft = 60
Clienttop = 345
Clientwidth = 9015
Linktopic = "form1"
Lockcontrols =-1 'true'
Scaleheight = 5715
Scalewidth = 9015
Startupposition = 3' window default
Begin VB. ListBox list3
Height = 3660
Left = 1, 4080
Multiselect = 2' extended
Tabindex = 7
Maximum = 2040
Width = 4935
End
Begin VB. ListBox list2
Height = 3660
Left = 1, 960
Multiselect = 2' extended
Tabindex = 6
Maximum = 2040
Width = 3135
End
Begin VB. ListBox list1
Height = 3660
Left = 0
Multiselect = 2' extended
Tabindex = 5
Maximum = 2040
Width = 975
End
Begin VB. textbox text2
Height = 375
Left = 1, 1080
Tabindex = 3
TEXT = "20"
Maximum = 720
Width = 1335
End
Begin VB. textbox text1
Height = 375
Left = 1, 1080
Tabindex = 1
TEXT = "20"
Maximum = 120
Width = 1335
End
Begin VB. commandbutton command1
Caption = "modify"
Height = 495
Left = 1, 2760
Tabindex = 0
Maximum = 240
Width = 1095
End
Begin VB. Label label2
Caption = "lagging behind :"
Height = 375
Left = 1, 240
Tabindex = 4
Maximum = 720
Width = 615
End
Begin VB. Label label1
Caption = "advance :"
Height = 375
Left = 1, 240
Tabindex = 2
Maximum = 120
Width = 615
End
End
Attribute vb_name = "form1"
Attribute vb_globalnamespace = false
Attribute vb_creatable = false
Attribute vb_predeclaredid = true
Attribute vb_exposed = false
Dim nextzimu as integer
Dim lateorfast as Boolean
Dim readnull as Boolean
Dim nextmodify as Boolean
Private sub commandementclick ()
While (not EOF (1 ))
Line input #1, oneline
If trim (oneline) Like "?? :?? :??,??? --> ?? :?? :??,??? "Then
List2.additem oneline
If nextmodify then
Oneline1 = oneline
Oneline = modify_time (oneline)
End if
End if
If readnull and some_line (oneline) then
Nextmodify = true
Else
Nextmodify = false
End if
If Len (oneline) = 0 then
Readnull = true
Else
Readnull = false
End if
Tempstr = tempstr + oneline + vbcrlf
Wend
Print #2, tempstr
Close #1
Close #2
End sub

Private sub form_load ()
Lateorfast = true
Readnull = false
Nextmodify = false
Nextzimu = 1
Dim oneline as string
Dim tempstr as string
Open "G:/2.srt" for output as #2
Open "G:/1.srt" for input as #1
End sub
Private function some_line (byval numstr as string)
If trim (numstr) like "[1-9] [0-9] [0-9]" then
List1.additem numstr
If CINT (TRIM (numstr) = 2 then
Some_line = true
Exit Function
End if
End if
Someline = false
End Function
Private function modify_time (byval oneline as string)
Dim Tempa
Dim I as integer
Dim rstr as string
Tempa = Split (oneline, "--> ")
For I = 0 to 1
If I = 0 then
Rstr = modify_time1 (TRIM (Tempa (I )))
Else
Rstr = rstr + "-->" + modify_time1 (TRIM (Tempa (I )))
End if
Next I
Modify_time = rstr
End Function
Private function modify_time1 (byval Tempa as string)
Dim I as integer
Dim tempb
Dim rest as string
Dim timem as integer
Dim itempb0 as integer
Dim itempb1 as integer
Dim itemk2as integer
Rest = right (Tempa, 4)
Tempa = left (Tempa, Len (Tempa)-4)
Tempb = Split (Tempa ,":")
Itempb0 = CINT (tempb (0 ))
Itempb1 = CINT (tempb (1 ))
Itema35= CINT (tempb (2 ))
If lateorfast then' advance
Timem = CINT (text1.text)
Itema35= itemk2+ timem
If itemcd2> = 60 then
Itemk21-60
Itempb1 = itempb1 + 1
If itempb1 = 60 then
Itempb1 = itempb1-60
Itempb0 = itempb0 + 1
End if
End if
Else
Timem = CINT (text2.text)
End if
Tempb (0) = CSTR (itempb0)
If Len (tempb (0) = 1 then
Tempb (0) = "0" + tempb (0)
End if
Tempb (1) = CSTR (itempb1)
If Len (tempb (1) = 1 then
Tempb (1) = "0" + tempb (1)
End if
Tempb (2) = CSTR (itempbs)
If Len (tempb (2) = 1 then
Tempb (2) = "0" + tempb (2)
End if
Modify_time1 = tempb (0) + ":" + tempb (1) + ":" + tempb (2) + rest
End Function

Private sub form_unload (cancel as integer)

End sub

Private sub label2_click ()

End sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.