home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l405 / 4.ddi / CD.FR_ / CD.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  8.7 KB  |  270 lines

  1. VERSION 2.00
  2. Begin Form CD 
  3.    BorderStyle     =   1  'Fixed Single
  4.    ClientHeight    =   3120
  5.    ClientLeft      =   675
  6.    ClientTop       =   1800
  7.    ClientWidth     =   8415
  8.    Height          =   3525
  9.    Left            =   615
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3120
  15.    ScaleWidth      =   8415
  16.    Top             =   1455
  17.    Width           =   8535
  18.    Begin PictureBox Picture4 
  19.       BackColor       =   &H00808080&
  20.       Height          =   3255
  21.       Left            =   0
  22.       ScaleHeight     =   3225
  23.       ScaleWidth      =   1545
  24.       TabIndex        =   12
  25.       Top             =   -15
  26.       Width           =   1570
  27.       Begin PictureBox Picture5 
  28.          BackColor       =   &H00575757&
  29.          Height          =   2895
  30.          Left            =   120
  31.          ScaleHeight     =   2865
  32.          ScaleWidth      =   1275
  33.          TabIndex        =   13
  34.          Top             =   110
  35.          Width           =   1300
  36.       End
  37.    End
  38.    Begin PictureBox Picture6 
  39.       BackColor       =   &H00808080&
  40.       Height          =   3255
  41.       Left            =   6845
  42.       ScaleHeight     =   3225
  43.       ScaleWidth      =   1545
  44.       TabIndex        =   14
  45.       Top             =   -15
  46.       Width           =   1575
  47.       Begin PictureBox Picture7 
  48.          BackColor       =   &H00575757&
  49.          Height          =   2895
  50.          Left            =   120
  51.          ScaleHeight     =   2865
  52.          ScaleWidth      =   1275
  53.          TabIndex        =   15
  54.          Top             =   110
  55.          Width           =   1300
  56.       End
  57.    End
  58.    Begin Frame Frame1 
  59.       BackColor       =   &H00808080&
  60.       Caption         =   "MCI CD Player"
  61.       FontBold        =   -1  'True
  62.       FontItalic      =   0   'False
  63.       FontName        =   "MS Serif"
  64.       FontSize        =   12
  65.       FontStrikethru  =   0   'False
  66.       FontUnderline   =   0   'False
  67.       ForeColor       =   &H00000000&
  68.       Height          =   3135
  69.       Left            =   1560
  70.       TabIndex        =   0
  71.       Top             =   0
  72.       Width           =   5295
  73.       Begin PictureBox Picture3 
  74.          Height          =   255
  75.          Left            =   720
  76.          Picture         =   CD.FRX:0000
  77.          ScaleHeight     =   225
  78.          ScaleWidth      =   945
  79.          TabIndex        =   10
  80.          Top             =   2520
  81.          Visible         =   0   'False
  82.          Width           =   975
  83.       End
  84.       Begin Frame Frame4 
  85.          BackColor       =   &H00808080&
  86.          Height          =   975
  87.          Left            =   2160
  88.          TabIndex        =   6
  89.          Top             =   2040
  90.          Width           =   2895
  91.          Begin CommandButton Command1 
  92.             Caption         =   "Load"
  93.             Height          =   255
  94.             Left            =   1920
  95.             TabIndex        =   7
  96.             Top             =   600
  97.             Width           =   855
  98.          End
  99.          Begin PictureBox Picture1 
  100.             BackColor       =   &H00404040&
  101.             BorderStyle     =   0  'None
  102.             Height          =   255
  103.             Left            =   120
  104.             Picture         =   CD.FRX:09D2
  105.             ScaleHeight     =   255
  106.             ScaleWidth      =   2655
  107.             TabIndex        =   8
  108.             Top             =   240
  109.             Width           =   2655
  110.          End
  111.          Begin Label Label3 
  112.             BackColor       =   &H00404040&
  113.             Height          =   135
  114.             Left            =   1485
  115.             TabIndex        =   11
  116.             Top             =   600
  117.             Width           =   255
  118.          End
  119.       End
  120.       Begin PictureBox Picture2 
  121.          Height          =   255
  122.          Left            =   720
  123.          Picture         =   CD.FRX:1068
  124.          ScaleHeight     =   225
  125.          ScaleWidth      =   945
  126.          TabIndex        =   9
  127.          Top             =   2040
  128.          Visible         =   0   'False
  129.          Width           =   975
  130.       End
  131.       Begin Frame Frame2 
  132.          BackColor       =   &H00808080&
  133.          Height          =   1455
  134.          Left            =   240
  135.          TabIndex        =   1
  136.          Top             =   480
  137.          Width           =   4815
  138.          Begin MMControl MMControl1 
  139.             BackVisible     =   0   'False
  140.             Height          =   615
  141.             Left            =   2160
  142.             RecordVisible   =   0   'False
  143.             StepVisible     =   0   'False
  144.             TabIndex        =   2
  145.             Top             =   360
  146.             Width           =   2370
  147.          End
  148.          Begin Frame Frame3 
  149.             BackColor       =   &H00808080&
  150.             Height          =   855
  151.             Left            =   720
  152.             TabIndex        =   3
  153.             Top             =   240
  154.             Width           =   855
  155.             Begin Label Label4 
  156.                BackColor       =   &H00808080&
  157.                Caption         =   " Track   "
  158.                Height          =   255
  159.                Left            =   120
  160.                TabIndex        =   5
  161.                Top             =   480
  162.                Width           =   615
  163.             End
  164.             Begin Label Label1 
  165.                Alignment       =   2  'Center
  166.                Caption         =   "0"
  167.                Height          =   255
  168.                Left            =   240
  169.                TabIndex        =   4
  170.                Top             =   240
  171.                Width           =   375
  172.             End
  173.          End
  174.       End
  175.    End
  176. Sub Command1_Click ()
  177.     ' Open the CD device -- the disk must already be
  178.     ' in the drive.
  179.     On Error GoTo MCI_ERROR
  180.     MMControl1.Command = "Open"
  181.     On Error GoTo 0
  182.     ' Set the time format
  183.     MMControl1.TimeFormat = MCI_FORMAT_TMSF
  184.     ' Disable the Load command button, display the
  185.     ' "disk in drive" bitmap.
  186.     Command1.Enabled = False
  187.     Picture1.Picture = Picture3.Picture
  188.     ' Set the track number to the first track.
  189.     Label1.Caption = "1"
  190.     Exit Sub
  191. MCI_ERROR:
  192.     DisplayErrorMessageBox
  193.     Resume MCI_EXIT
  194. MCI_EXIT:
  195.     Unload CD
  196. End Sub
  197. Sub Form_Load ()
  198.     ' Force the MCI control to complete before returning
  199.     ' to the application.
  200.     MMControl1.Wait = True
  201.     MMControl1.UpdateInterval = 0
  202.     ' Set the DeviceType to a musical CD device.
  203.     MMControl1.DeviceType = "CDAudio"
  204.     ' Set the track number to 0 (default).
  205.     Label1.Caption = "0"
  206. End Sub
  207. Sub Form_Unload (Cancel As Integer)
  208.     MCITest.Show
  209. End Sub
  210. Sub MMControl1_EjectClick (Cancel As Integer)
  211.     ' Enable the Load command button, and display the
  212.     ' "disk out of drive" bitmap.
  213.     Command1.Enabled = True
  214.     Picture1.Picture = Picture2.Picture
  215.     MMControl1.UpdateInterval = 0
  216.     ' Eject the disk from the CD drive, and close the device.
  217.     On Error GoTo MCI_ERROR2
  218.     MMControl1.Command = "Eject"
  219.     MMControl1.Command = "Close"
  220.     On Error GoTo 0
  221.     ' Set the track number back to 0.
  222.     Label1.Caption = "0"
  223.     ' Set the "play indicator" to off.
  224.     Label3.BackColor = &H404040
  225.     Exit Sub
  226. MCI_ERROR2:
  227.     DisplayErrorMessageBox
  228.     Resume Next
  229. End Sub
  230. Sub MMControl1_NextCompleted (ErrorCode As Long)
  231.     ' Set the track number to the new track.
  232.     Label1.Caption = Str$(MMControl1.Track)
  233. End Sub
  234. Sub MMControl1_PauseClick (Cancel As Integer)
  235.     MMControl1.UpdateInterval = 0
  236.         
  237.     'Set the "play indicator" to off.
  238.     Label3.BackColor = &H404040
  239. End Sub
  240. Sub MMControl1_PlayClick (Cancel As Integer)
  241.     MMControl1.UpdateInterval = 1000
  242.     ' Set the track number to the current track.
  243.     Label1.Caption = Str$(MMControl1.Track)
  244. End Sub
  245. Sub MMControl1_PrevCompleted (ErrorCode As Long)
  246.     ' Set the track number to new track.
  247.     Label1.Caption = Str$(MMControl1.Track)
  248. End Sub
  249. Sub MMControl1_StatusUpdate ()
  250.     ' Set the track number to the current track.
  251.     Label1.Caption = Str$(MMControl1.Position And &HFF)
  252.     ' Determine if the "play indicator" is off or on,
  253.     ' based if the device is currently playing.
  254.     If MMControl1.Mode = MCI_MODE_PLAY Then
  255.         Label3.BackColor = &H80FF&
  256.     Else
  257.         Label3.BackColor = &H404040
  258.     End If
  259. End Sub
  260. Sub MMControl1_StopClick (Cancel As Integer)
  261.     MMControl1.UpdateInterval = 0
  262.     ' Set the "play indicator" to off.
  263.     Label3.BackColor = &H404040
  264.     ' Reset the CD to track 1.
  265.     MMControl1.To = MMControl1.Start
  266.     MMControl1.Command = "Seek"
  267.     MMControl1.Track = 1
  268.     Label1.Caption = "1"
  269. End Sub
  270.