📄 form1.frm
字号:
TabIndex = 16
Top = 720
Width = 5205
_ExtentX = 9181
_ExtentY = 794
_Version = 327682
Max = 1000
SelStart = 500
TickFrequency = 50
Value = 500
End
Begin ComctlLib.Slider Slider4
Height = 450
Left = 690
TabIndex = 18
Top = 1200
Width = 5205
_ExtentX = 9181
_ExtentY = 794
_Version = 327682
Max = 1000
SelStart = 500
TickFrequency = 50
Value = 500
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "饱和度"
Height = 180
Left = 90
TabIndex = 19
Top = 1350
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "对比度"
Height = 180
Left = 90
TabIndex = 17
Top = 870
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "亮 度"
Height = 180
Left = 90
TabIndex = 15
Top = 390
Width = 540
End
End
Begin VB.Frame Frame3
Caption = "声道"
Height = 585
Left = 2730
TabIndex = 9
Top = 3240
Width = 3405
Begin VB.OptionButton optChannel
Caption = "立体声"
Height = 180
Index = 2
Left = 2310
TabIndex = 12
Top = 270
Value = -1 'True
Width = 855
End
Begin VB.OptionButton optChannel
Caption = "右声道"
Height = 180
Index = 1
Left = 1245
TabIndex = 11
Top = 270
Width = 855
End
Begin VB.OptionButton optChannel
Caption = "左声道"
Height = 180
Index = 0
Left = 180
TabIndex = 10
Top = 270
Width = 855
End
End
Begin VB.Frame Frame2
Caption = "媒体打开方式"
Height = 585
Left = 120
TabIndex = 6
Top = 3240
Width = 2535
Begin VB.OptionButton optPlaymode
Caption = "流方式"
Height = 195
Index = 1
Left = 1380
TabIndex = 8
Top = 270
Width = 885
End
Begin VB.OptionButton optPlaymode
Caption = "文件方式"
Height = 195
Index = 0
Left = 240
TabIndex = 7
Top = 270
Value = -1 'True
Width = 1095
End
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 7710
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "文件列表"
Height = 3045
Left = 120
TabIndex = 1
Top = 120
Width = 6015
Begin NNSREALmagicCtrl.REALmagicCtrl rc
Height = 495
Left = 3120
OleObjectBlob = "Form1.frx":628A
TabIndex = 47
Top = 1200
Width = 1935
End
Begin VB.Timer tmrVOD
Interval = 100
Left = 5040
Top = 120
End
Begin VB.CommandButton cmdClear
Caption = "清 除(&C)"
Height = 405
Left = 4620
TabIndex = 5
Top = 2520
Width = 1065
End
Begin VB.CommandButton cmdErase
Caption = "删 除(&D)"
Height = 405
Left = 2430
TabIndex = 4
Top = 2520
Width = 1065
End
Begin VB.CommandButton cmdAdd
Caption = "添 加(&A)"
Height = 405
Left = 240
TabIndex = 3
Top = 2520
Width = 1065
End
Begin VB.ListBox lstFiles
Height = 2220
ItemData = "Form1.frx":63BC
Left = 90
List = "Form1.frx":63BE
TabIndex = 2
Top = 240
Width = 5805
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Me.Caption = "新网星REALmagic多媒体控制控件DEMO"
rc.Visible = False
rc.AutoCloseDriver = False
rc.SerialString = ""
If rc.OpenDriver = False Then MsgBox "不能打开REALmagic驱动!请检查REALmagic多媒体播放卡是否驱动正常!", vbCritical, "错误"
End Sub
Private Sub cmdadd_Click()
With CommonDialog1
.FileName = ""
.Filter = "*.DAT;*.MPG;*.AVI;*.VOB;*.VOD;*.MPEG;*.MP1;*.MP2|*.DAT;*.MPG;*.AVI;*.VOB;*.VOD;*.MPEG;*.MP1;*.MP2|所有文件|*.*"
.Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames 'Or cdlOFNAllowMultiselect
.ShowOpen
If .FileName = "" Then Exit Sub
lstFiles.AddItem (.FileName)
End With
End Sub
Private Sub cmderase_Click()
If lstFiles.SelCount < 1 Then Exit Sub
lstFiles.RemoveItem (lstFiles.ListIndex)
End Sub
Private Sub cmdClear_Click()
lstFiles.Clear
End Sub
Private Sub Command1_Click()
If lstFiles.SelCount < 1 Then
MsgBox "请先选定一个要打开的项目!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If rc.OpenFile = False Then MsgBox "打开" & lstFiles.List(lstFiles.ListIndex) & "失败!", vbOKOnly + vbCritical, "错误"
Frame7.Enabled = IIf(rc.MediaFormat = vfDVD, True, False)
End Sub
Private Sub Command2_Click()
rc.Play
End Sub
Private Sub Command3_Click()
rc.Pause
End Sub
Private Sub Command4_Click()
rc.Stop
End Sub
Private Sub chkMute_Click()
rc.Mute = IIf(chkMute.Value = 0, False, True)
End Sub
Private Sub Command5_Click()
rc.CloseFile
End Sub
Private Sub Command6_Click()
rc.AboutBox
End Sub
Private Sub Command7_Click()
rc.CurrentFrame = rc.CurrentFrame + 125
End Sub
Private Sub Command8_Click()
rc.CurrentFrame = rc.CurrentFrame - 125
End Sub
Private Sub Form_Unload(Cancel As Integer)
rc.CloseDriver
End Sub
Private Sub lstFiles_Click()
rc.FileName = lstFiles.List(lstFiles.ListIndex)
End Sub
Private Sub optChannel_Click(Index As Integer)
Select Case Index
Case 0
rc.AudioChannel = acLEFT
Case 1
rc.AudioChannel = acRIGHT
Case 2
rc.AudioChannel = acSTEREO
End Select
End Sub
Private Sub optOutput_Click(Index As Integer)
If Index = 0 Then rc.DisplayDevice = ddTV Else rc.DisplayDevice = ddVGA
End Sub
Private Sub optPlaymode_Click(Index As Integer)
If Index = 0 Then
rc.PlayMode = pmFILE
Else
rc.PlayMode = pmSTREAM
End If
End Sub
Private Sub optTrack_Click(Index As Integer)
rc.CurrentDVDTrack = Index + 1
End Sub
Private Sub optTV_Click(Index As Integer)
If Index = 0 Then rc.VideoMode = tmPAL Else rc.VideoMode = tmNTSC
End Sub
Private Sub Slider1_Change()
rc.Volume = Slider1.Value
End Sub
Private Sub Slider2_Change()
rc.Brightness = Slider2.Value
End Sub
Private Sub Slider3_Change()
rc.Contrast = Slider3.Value
End Sub
Private Sub Slider4_Click()
rc.Saturation = Slider4.Value
End Sub
Private Sub tmrVOD_Timer()
Dim ts As String
Select Case rc.MediaFormat
Case vfDVD
ts = "DVD视频"
Case vfVCD
ts = "VCD视频"
Case vfUNKNOWN
ts = "未知格式"
End Select
stBar.Panels(2).Text = ts
Select Case rc.DeviceState
Case dsCLOSED
ts = "关闭"
stBar.Panels(4).Text = "0/0"
Case dsREADY
ts = "准备"
stBar.Panels(4).Text = "0/" & Format(rc.FrameCount)
Case dsPLAYING
ts = "播放"
stBar.Panels(4).Text = Format(rc.CurrentFrame) & "/" & Format(rc.FrameCount)
Case dsPAUSED
ts = "暂停"
Case dsENDED
ts = "停止"
stBar.Panels(4).Text = "0/" & Format(rc.FrameCount)
End Select
stBar.Panels(6).Text = ts
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -