📄 framemain.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "ComDlg32.OCX"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "转换为IPOD文件"
ClientHeight = 5010
ClientLeft = 4455
ClientTop = 4215
ClientWidth = 8655
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5010
ScaleWidth = 8655
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text5
Height = 270
Left = 6600
TabIndex = 11
Top = 4680
Width = 1935
End
Begin VB.OptionButton optother
Caption = "指定"
Height = 255
Left = 5880
TabIndex = 10
Top = 4680
Width = 735
End
Begin VB.OptionButton optcmd
Caption = "CMD"
Height = 255
Left = 5280
TabIndex = 9
Top = 4680
Width = 615
End
Begin VB.TextBox fps
Height = 270
Left = 3240
TabIndex = 7
Text = "30"
Top = 4680
Width = 735
End
Begin VB.TextBox kbpsa
Height = 270
Left = 2160
TabIndex = 6
Text = "128"
Top = 4665
Width = 495
End
Begin VB.TextBox kbpsv
Height = 270
Left = 600
TabIndex = 3
Text = "1600"
Top = 4665
Width = 495
End
Begin MSComDlg.CommonDialog dialog
Left = 2640
Top = 3480
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.TextBox edit
Height = 270
Left = 1680
TabIndex = 1
Top = 960
Width = 1215
End
Begin MSFlexGridLib.MSFlexGrid list
Height = 4575
Left = 0
TabIndex = 0
Top = 0
Width = 8655
_ExtentX = 15266
_ExtentY = 8070
_Version = 393216
Rows = 20
Cols = 5
AllowUserResizing= 1
Appearance = 0
FormatString = "|文件名|每秒流速|音频比率|FPS"
End
Begin VB.Line Line1
X1 = 0
X2 = 8640
Y1 = 5040
Y2 = 5040
End
Begin VB.Label Label5
Caption = "Mencoder位置:"
Height = 255
Left = 4080
TabIndex = 8
Top = 4680
Width = 1335
End
Begin VB.Label Label4
Caption = "FPS:"
Height = 255
Left = 2760
TabIndex = 5
Top = 4680
Width = 495
End
Begin VB.Label Label3
Caption = "音频比率:"
Height = 255
Left = 1200
TabIndex = 4
Top = 4680
Width = 975
End
Begin VB.Label Label2
Caption = "流速:"
Height = 375
Left = 120
TabIndex = 2
Top = 4680
Width = 615
End
Begin VB.Menu mnufile
Caption = "文件"
Begin VB.Menu mnuimport
Caption = "导入文件"
Shortcut = ^O
End
Begin VB.Menu mnuclear
Caption = "清除列表框"
Shortcut = ^C
End
Begin VB.Menu mnuhen
Caption = "-"
End
Begin VB.Menu mnustart
Caption = "开始转换"
Shortcut = ^S
End
Begin VB.Menu mnuhen2
Caption = "-"
End
Begin VB.Menu mnuexit
Caption = "退出"
Shortcut = ^E
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub mnustart_Click()
On Error Resume Next
Dim mencoder, convertstr As String
Dim file1, file2 As String
mencoder = "mencoder "
If optother.Value = 1 Then mencoder = Text5.Text
Open "c:\Convert.bat" For Output As #1
For I = 1 To list.Rows - 1
If list.TextMatrix(I, 1) <> "" Then
file1 = list.TextMatrix(I, 1)
For j = 0 To Len(file1) - 1
If Mid(file1, Len(file1) - j, 1) = "." Then
file2 = Left(file1, Len(file1) - j) & "mp4"
Exit For
End If
Next
convertstr = mencoder + " -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=" & list.TextMatrix(I, 2) & ":acodec=libfaac:abitrate=" & list.TextMatrix(I, 3) & " -af lavcresample=22050 -vf dsize=480:320:0,scale=0:0,expand=480:320,harddup -ofps " & list.TextMatrix(I, 4) & " -srate 22050 " & file1 & " -o " & file2
Print #1, convertstr
End If
Next
Close #1
Shell "c:\convert.bat"
End Sub
Private Sub Form_Load()
edit.Move -10000, -10000, 1, 1
With list
.ColWidth(1) = .Width / 10 * 3.445
.ColWidth(2) = .Width / 10 * 2
.ColWidth(3) = .Width / 10 * 2
.ColWidth(4) = .Width / 10 * 2
.ColWidth(0) = .Width / 10 * 0.5
End With
optcmd.Value = 1
End Sub
Private Sub list_EnterCell()
list.CellBackColor = vbBlue
list.CellForeColor = vbWhite
edit.Text = list.Text
edit.SelStart = 0
edit.SelLength = Len(edit.Text)
End Sub
Private Sub list_LeaveCell()
list.CellBackColor = vbWhite
list.CellForeColor = vbBlue
End Sub
Private Sub list_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
edit.SetFocus
End Sub
Private Sub edit_Change()
list.Text = edit.Text
End Sub
Private Sub edit_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft, vbKeyRight, vbKeyUp, vbKeyDown
KeyCode = 0
End Select
End Sub
Private Sub mnuclear_Click()
list.Clear
list.FormatString = "|文件名|每秒流速|音频比率|FPS"
Call Form_Load
End Sub
Private Sub mnuexit_Click()
Unload Me
End
End Sub
Private Sub mnuimport_Click()
Dim DlgInfo As DlgFileInfo
Dim I As Integer
On Error GoTo ErrHandle
With dialog
.CancelError = True
.MaxFileSize = 32767
.Flags = cdlOFNHideReadOnly Or cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNNoDereferenceLinks
.DialogTitle = "选择文件"
.Filter = "all file|*.*"
.ShowOpen
DlgInfo = GetDlgSelectFileInfo(.FileName)
.FileName = ""
End With
list.Rows = DlgInfo.iCount + 1
For I = 1 To DlgInfo.iCount
list.TextMatrix(I, 1) = DlgInfo.sPath & DlgInfo.sFile(I)
list.TextMatrix(I, 2) = kbpsv.Text
list.TextMatrix(I, 3) = kbpsa.Text
list.TextMatrix(I, 4) = fps.Text
Next I
Exit Sub
ErrHandle:
End Sub
Private Sub Text5_click()
On Error Resume Next
dialog.FileName = ""
dialog.ShowOpen
Text5.Text = dialog.FileName
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -