home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / PGUIDE / VCR / VCR.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-27  |  16.4 KB  |  572 lines

  1. VERSION 5.00
  2. Begin VB.Form frmVCR 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "VBTV"
  5.    ClientHeight    =   6795
  6.    ClientLeft      =   1170
  7.    ClientTop       =   1545
  8.    ClientWidth     =   7110
  9.    FillStyle       =   0  'Solid
  10.    Icon            =   "vcr.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   6795
  14.    ScaleWidth      =   7110
  15.    Begin VB.CommandButton cmdSet 
  16.       Caption         =   "
  17.       Height          =   360
  18.       Left            =   4560
  19.       MaskColor       =   &H00000000&
  20.       TabIndex        =   13
  21.       ToolTipText     =   "
  22.       Top             =   6000
  23.       Width           =   1095
  24.    End
  25.    Begin VB.Timer tmr2 
  26.       Enabled         =   0   'False
  27.       Left            =   6240
  28.       Top             =   3240
  29.    End
  30.    Begin VB.Timer tmr1 
  31.       Interval        =   65535
  32.       Left            =   6240
  33.       Top             =   2640
  34.    End
  35.    Begin VB.CommandButton cmdDown 
  36.       Caption         =   "-"
  37.       Height          =   325
  38.       Left            =   6120
  39.       MaskColor       =   &H00000000&
  40.       TabIndex        =   11
  41.       ToolTipText     =   "
  42.       Top             =   1440
  43.       Width           =   735
  44.    End
  45.    Begin VB.CommandButton cmdUp 
  46.       Caption         =   "+"
  47.       Height          =   325
  48.       Left            =   6120
  49.       MaskColor       =   &H00000000&
  50.       TabIndex        =   10
  51.       ToolTipText     =   "
  52.       Top             =   1080
  53.       Width           =   735
  54.    End
  55.    Begin VB.CommandButton cmdExit 
  56.       Cancel          =   -1  'True
  57.       Caption         =   "
  58.       Height          =   360
  59.       Left            =   5760
  60.       MaskColor       =   &H00000000&
  61.       TabIndex        =   7
  62.       ToolTipText     =   "
  63.  VBTV"
  64.       Top             =   6000
  65.       Width           =   1095
  66.    End
  67.    Begin VB.CommandButton cmdPause 
  68.       Caption         =   "ll"
  69.       Enabled         =   0   'False
  70.       BeginProperty Font 
  71.          Name            =   "Arial"
  72.          Size            =   14.25
  73.          Charset         =   0
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       Height          =   360
  80.       Left            =   1005
  81.       MaskColor       =   &H00000000&
  82.       TabIndex        =   6
  83.       ToolTipText     =   "
  84.       Top             =   6000
  85.       Width           =   615
  86.    End
  87.    Begin VB.CommandButton cmdRec 
  88.       Caption         =   "
  89.       Height          =   360
  90.       Left            =   1650
  91.       MaskColor       =   &H00000000&
  92.       TabIndex        =   5
  93.       ToolTipText     =   "
  94.       Top             =   6000
  95.       Width           =   615
  96.    End
  97.    Begin VB.CommandButton cmdForward 
  98.       Caption         =   ">>"
  99.       BeginProperty Font 
  100.          Name            =   "
  101.          Size            =   13.5
  102.          Charset         =   134
  103.          Weight          =   700
  104.          Underline       =   0   'False
  105.          Italic          =   0   'False
  106.          Strikethrough   =   0   'False
  107.       EndProperty
  108.       Height          =   360
  109.       Left            =   2940
  110.       MaskColor       =   &H00000000&
  111.       TabIndex        =   4
  112.       ToolTipText     =   "
  113.       Top             =   6000
  114.       Width           =   615
  115.    End
  116.    Begin VB.CommandButton cmdRewind 
  117.       Caption         =   "<<"
  118.       BeginProperty Font 
  119.          Name            =   "
  120.          Size            =   13.5
  121.          Charset         =   134
  122.          Weight          =   700
  123.          Underline       =   0   'False
  124.          Italic          =   0   'False
  125.          Strikethrough   =   0   'False
  126.       EndProperty
  127.       Height          =   360
  128.       Left            =   2295
  129.       MaskColor       =   &H00000000&
  130.       TabIndex        =   3
  131.       ToolTipText     =   "
  132.       Top             =   6000
  133.       Width           =   615
  134.    End
  135.    Begin VB.CommandButton cmdStop 
  136.       Caption         =   "
  137.       Enabled         =   0   'False
  138.       Height          =   360
  139.       Left            =   3585
  140.       MaskColor       =   &H00000000&
  141.       TabIndex        =   2
  142.       ToolTipText     =   "
  143.       Top             =   6000
  144.       Width           =   615
  145.    End
  146.    Begin VB.PictureBox picTV 
  147.       AutoRedraw      =   -1  'True
  148.       BackColor       =   &H00C0C0C0&
  149.       BorderStyle     =   0  'None
  150.       FillStyle       =   2  'Horizontal Line
  151.       BeginProperty Font 
  152.          Name            =   "
  153.          Size            =   18
  154.          Charset         =   134
  155.          Weight          =   700
  156.          Underline       =   0   'False
  157.          Italic          =   0   'False
  158.          Strikethrough   =   0   'False
  159.       EndProperty
  160.       ForeColor       =   &H00FFFFFF&
  161.       Height          =   4215
  162.       Left            =   360
  163.       ScaleHeight     =   4215
  164.       ScaleWidth      =   5535
  165.       TabIndex        =   1
  166.       Top             =   240
  167.       Width           =   5535
  168.    End
  169.    Begin VB.CommandButton cmdPlay 
  170.       Caption         =   ">"
  171.       BeginProperty Font 
  172.          Name            =   "
  173.          Size            =   13.5
  174.          Charset         =   134
  175.          Weight          =   700
  176.          Underline       =   0   'False
  177.          Italic          =   0   'False
  178.          Strikethrough   =   0   'False
  179.       EndProperty
  180.       Height          =   360
  181.       Left            =   360
  182.       MaskColor       =   &H00000000&
  183.       TabIndex        =   0
  184.       ToolTipText     =   "
  185.       Top             =   6000
  186.       Width           =   615
  187.    End
  188.    Begin VB.Line Line2 
  189.       BorderColor     =   &H00808080&
  190.       X1              =   0
  191.       X2              =   7080
  192.       Y1              =   4660
  193.       Y2              =   4660
  194.    End
  195.    Begin VB.Line Line1 
  196.       BorderColor     =   &H00FFFFFF&
  197.       X1              =   0
  198.       X2              =   7080
  199.       Y1              =   4700
  200.       Y2              =   4700
  201.    End
  202.    Begin VB.Shape shpPlay 
  203.       FillColor       =   &H0000FF00&
  204.       FillStyle       =   0  'Solid
  205.       Height          =   105
  206.       Left            =   615
  207.       Shape           =   3  'Circle
  208.       Top             =   5835
  209.       Visible         =   0   'False
  210.       Width           =   105
  211.    End
  212.    Begin VB.Shape shpForward 
  213.       FillColor       =   &H0000FF00&
  214.       FillStyle       =   0  'Solid
  215.       Height          =   105
  216.       Left            =   3210
  217.       Shape           =   3  'Circle
  218.       Top             =   5835
  219.       Visible         =   0   'False
  220.       Width           =   105
  221.    End
  222.    Begin VB.Shape shpRewind 
  223.       FillColor       =   &H0000FF00&
  224.       FillStyle       =   0  'Solid
  225.       Height          =   105
  226.       Left            =   2565
  227.       Shape           =   3  'Circle
  228.       Top             =   5835
  229.       Visible         =   0   'False
  230.       Width           =   105
  231.    End
  232.    Begin VB.Shape shpRec 
  233.       FillColor       =   &H000000FF&
  234.       FillStyle       =   0  'Solid
  235.       Height          =   105
  236.       Left            =   1905
  237.       Shape           =   3  'Circle
  238.       Top             =   5835
  239.       Visible         =   0   'False
  240.       Width           =   105
  241.    End
  242.    Begin VB.Shape shpPause 
  243.       FillColor       =   &H0000FF00&
  244.       FillStyle       =   0  'Solid
  245.       Height          =   105
  246.       Left            =   1260
  247.       Shape           =   3  'Circle
  248.       Top             =   5835
  249.       Visible         =   0   'False
  250.       Width           =   105
  251.    End
  252.    Begin VB.Image img2 
  253.       Height          =   1155
  254.       Left            =   1680
  255.       Picture         =   "vcr.frx":0442
  256.       Top             =   6720
  257.       Visible         =   0   'False
  258.       Width           =   1155
  259.    End
  260.    Begin VB.Image img1 
  261.       Height          =   1155
  262.       Left            =   240
  263.       Picture         =   "vcr.frx":10CC
  264.       Top             =   6720
  265.       Visible         =   0   'False
  266.       Width           =   1155
  267.    End
  268.    Begin VB.Label lblTime 
  269.       Alignment       =   2  'Center
  270.       BackColor       =   &H00000000&
  271.       BorderStyle     =   1  'Fixed Single
  272.       BeginProperty Font 
  273.          Name            =   "
  274.          Size            =   18
  275.          Charset         =   134
  276.          Weight          =   700
  277.          Underline       =   0   'False
  278.          Italic          =   0   'False
  279.          Strikethrough   =   0   'False
  280.       EndProperty
  281.       ForeColor       =   &H000000FF&
  282.       Height          =   615
  283.       Left            =   480
  284.       TabIndex        =   12
  285.       Top             =   4920
  286.       Width           =   1935
  287.    End
  288.    Begin VB.Label lblBrand 
  289.       BackStyle       =   0  'Transparent
  290.       Caption         =   "Microsoft Visual Basic VCR - Version 1.0"
  291.       ForeColor       =   &H00FFFFFF&
  292.       Height          =   375
  293.       Left            =   3360
  294.       TabIndex        =   9
  295.       Top             =   5100
  296.       Width           =   2895
  297.    End
  298.    Begin VB.Image imgTapeSlot 
  299.       BorderStyle     =   1  'Fixed Single
  300.       Height          =   735
  301.       Left            =   2640
  302.       Top             =   4920
  303.       Width           =   4215
  304.    End
  305.    Begin VB.Label lblChannel 
  306.       Alignment       =   2  'Center
  307.       BackStyle       =   0  'Transparent
  308.       BorderStyle     =   1  'Fixed Single
  309.       Caption         =   "3"
  310.       BeginProperty Font 
  311.          Name            =   "
  312.          Size            =   24
  313.          Charset         =   134
  314.          Weight          =   700
  315.          Underline       =   0   'False
  316.          Italic          =   0   'False
  317.          Strikethrough   =   0   'False
  318.       EndProperty
  319.       ForeColor       =   &H0000FF00&
  320.       Height          =   615
  321.       Left            =   6120
  322.       TabIndex        =   8
  323.       ToolTipText     =   "
  324.       Top             =   240
  325.       Width           =   735
  326.    End
  327. Attribute VB_Name = "frmVCR"
  328. Attribute VB_GlobalNameSpace = False
  329. Attribute VB_Creatable = False
  330. Attribute VB_PredeclaredId = True
  331. Attribute VB_Exposed = False
  332. '**********************************************
  333.   VCR 
  334.  Visual Basic 
  335. '**********************************************
  336. Option Explicit
  337.  Tape 
  338. Dim Tape As New clsTape
  339. Dim vntChannel As Variant   '
  340. ' QBColor 
  341. Const vcrBlack = 0
  342. Const vcrGreen = 2
  343. Const vcrCyan = 3
  344. Const vcrRed = 4
  345. Const vcrMagenta = 5
  346. Const vcrYellow = 6
  347. Const vcrWhite = 7
  348. Const vcrGray = 8
  349. Const vcrLightBlue = 9
  350. Const vcrLightGreen = 10
  351. Const vcrLightCyan = 11
  352. Const vcrLightRed = 12
  353. Const vcrLightMagenta = 13
  354. Private Sub cmdDown_Click()
  355.     ' 
  356.     If vntChannel > 2 Then
  357.         vntChannel = vntChannel - 1
  358.     Else
  359.         vntChannel = 13
  360.     End If
  361.     ' 
  362.     lblChannel.Caption = vntChannel
  363. End Sub
  364. Private Sub cmdExit_Click()
  365.     ' 
  366.     Unload Me
  367.     Set frmVCR = Nothing
  368. End Sub
  369. Private Sub cmdForward_Click()
  370.     ' 
  371.     SaveChannel vntChannel
  372.     ' 
  373.     vntChannel = 3
  374.     lblChannel.Caption = vntChannel
  375.     ' 
  376.  Tape 
  377.     Tape.Forward = True
  378.     Tape.Speed = 50
  379.     ' 
  380.     tmr2.Enabled = True
  381.     tmr2.Interval = Tape.Speed
  382.     ' 
  383.     ButtonManager frmVCR.cmdForward
  384. End Sub
  385. Private Sub cmdPause_Click()
  386.     ' 
  387.     tmr2.Enabled = False
  388.     ' 
  389.     ButtonManager frmVCR.cmdPause
  390. End Sub
  391. Private Sub cmdPlay_Click()
  392.     ' 
  393.     SaveChannel vntChannel
  394.     ' 
  395.     vntChannel = 3
  396.     lblChannel.Caption = vntChannel
  397.     ' 
  398.  Tape 
  399.     Tape.Forward = True
  400.     Tape.Speed = 300
  401.     ' 
  402.     tmr2.Enabled = True
  403.     tmr2.Interval = Tape.Speed
  404.     ' 
  405.     ButtonManager frmVCR.cmdPlay
  406. End Sub
  407. Private Sub cmdRec_Click()
  408.     Dim strStatus As String     '
  409.     ' 
  410.     SaveChannel vntChannel
  411.     ' 
  412.     picTV.Cls
  413.     ' 
  414.     strStatus = "
  415. " & vntChannel & " 
  416.     picTV.Print strStatus
  417.     strStatus = lblTime.Caption
  418.     picTV.Print strStatus
  419.     ' 
  420.     ButtonManager frmVCR.cmdRec
  421. End Sub
  422. Private Sub cmdRewind_Click()
  423.     ' 
  424.     SaveChannel vntChannel
  425.     ' 
  426.     vntChannel = 3
  427.     lblChannel.Caption = vntChannel
  428.     ' 
  429.  Tape 
  430.     Tape.Forward = False
  431.     Tape.Speed = 50
  432.     ' 
  433.     tmr2.Enabled = True
  434.     tmr2.Interval = Tape.Speed
  435.     ' 
  436.     ButtonManager frmVCR.cmdRewind
  437. End Sub
  438. Private Sub cmdSet_Click()
  439.     ' 
  440.     frmSetTime.Show vbModal
  441. End Sub
  442. Private Sub cmdStop_Click()
  443.     Dim intChannel As Integer   '
  444.     ' 
  445.     tmr2.Enabled = False
  446.     ' 
  447.     ButtonManager frmVCR.cmdStop
  448.     ' 
  449.     picTV.Cls
  450.     ' 
  451.     intChannel = SaveChannel(0)
  452.     vntChannel = intChannel
  453.     lblChannel.Caption = vntChannel
  454. End Sub
  455. Private Sub cmdUp_Click()
  456.     ' 
  457.     If vntChannel < 13 Then
  458.         vntChannel = vntChannel + 1
  459.     Else
  460.         vntChannel = 2
  461.     End If
  462.      ' 
  463.      lblChannel.Caption = vntChannel
  464. End Sub
  465. Private Sub Form_Load()
  466.     ' 
  467.     lblTime.Caption = Format((Now), "h:mm AM/PM")
  468.     ' 
  469.     frmVCR.Height = 6990
  470.     img1.Visible = True
  471.     ' 
  472.     Me.Show
  473.     ' 
  474.     vntChannel = 3
  475.     lblChannel.Caption = vntChannel
  476. End Sub
  477. Private Sub Form_Unload(Cancel As Integer)
  478.     ' 
  479.     Set Tape = Nothing
  480.     Set Recorder = Nothing
  481.     Set frmVCR = Nothing
  482. End Sub
  483. Private Sub lblChannel_Change()
  484.     ' 
  485.     Select Case vntChannel
  486.         Case 2
  487.             picTV.BackColor = QBColor(vcrGreen)
  488.         Case 3
  489.             picTV.BackColor = QBColor(vcrWhite)
  490.         Case 4
  491.             picTV.BackColor = QBColor(vcrRed)
  492.         Case 5
  493.             picTV.BackColor = QBColor(vcrMagenta)
  494.         Case 6
  495.             picTV.BackColor = QBColor(vcrYellow)
  496.         Case 7
  497.             picTV.BackColor = QBColor(vcrCyan)
  498.         Case 8
  499.             picTV.BackColor = QBColor(vcrGray)
  500.         Case 9
  501.             picTV.BackColor = QBColor(vcrLightBlue)
  502.         Case 10
  503.             picTV.BackColor = QBColor(vcrLightGreen)
  504.         Case 11
  505.             picTV.BackColor = QBColor(vcrLightCyan)
  506.         Case 12
  507.             picTV.BackColor = QBColor(vcrLightRed)
  508.         Case 13
  509.             picTV.BackColor = QBColor(vcrLightMagenta)
  510.     End Select
  511.     ' 
  512.     picTV.Cls
  513.     ' 
  514.     picTV.Print "
  515. " & vntChannel
  516.     picTV.Print lblTime.Caption
  517. End Sub
  518. Private Sub tmr1_Timer()
  519.     ' 
  520.     lblTime.Caption = Format((Now), "h:mm AM/PM")
  521.     ' 
  522.  Recorder 
  523.     If Recorder.Enabled = True Then
  524.         ' 
  525.         If Recorder.StartRecording = lblTime.Caption Then
  526.             ' 
  527.             vntChannel = Recorder.Channel
  528.             lblChannel.Caption = vntChannel
  529.             ' 
  530.             cmdRec.Value = True
  531.             ' 
  532.  Recorder 
  533.             Recorder.StartRecording = Empty
  534.         End If
  535.     Else
  536.         ' 
  537.         If Recorder.StopRecording = lblTime.Caption Then
  538.             ' 
  539.             cmdStop.Value = True
  540.             ' 
  541.  Recorder 
  542.             Recorder.StopRecording = Empty
  543.         End If
  544.     End If
  545. End Sub
  546. Private Sub tmr2_Timer()
  547.     Dim intWidth As Integer     'Width 
  548.     Dim intLeft As Integer      'Left 
  549.     Dim objImage As Control     'Image 
  550.     ' 
  551.     intWidth = picTV.Width
  552.     ' 
  553.  Tape 
  554.     ' 
  555.     Tape.Animate intWidth
  556.     ' 
  557.  Left 
  558.     intLeft = Tape.Left
  559.     ' 
  560.     If img1.Visible = True Then
  561.         img1.Visible = False
  562.         Set objImage = img2
  563.     Else
  564.         img1.Visible = True
  565.         Set objImage = img1
  566.     End If
  567.     ' 
  568.     picTV.Cls
  569.     ' 
  570.     picTV.PaintPicture objImage.Picture, intLeft, 1200
  571. End Sub
  572.