home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / bwmp310 / sample.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-19  |  10.9 KB  |  365 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Object = "{543E41AF-DEA2-11D2-AC41-00C0DFE9A30F}#2.0#0"; "BWMP31OCX.OCX"
  5. Begin VB.Form Form1 
  6.    Caption         =   "BW MP3 OCX - Sample project"
  7.    ClientHeight    =   3660
  8.    ClientLeft      =   165
  9.    ClientTop       =   735
  10.    ClientWidth     =   7620
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3660
  13.    ScaleWidth      =   7620
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin BWMP3OCX10.BWMP3 BWMP31 
  16.       Left            =   5040
  17.       Top             =   2760
  18.       _ExtentX        =   1005
  19.       _ExtentY        =   979
  20.       PiPriority      =   0
  21.    End
  22.    Begin ComctlLib.Slider Slider1 
  23.       Height          =   495
  24.       Left            =   1800
  25.       TabIndex        =   27
  26.       Top             =   2640
  27.       Width           =   2655
  28.       _ExtentX        =   4683
  29.       _ExtentY        =   873
  30.       _Version        =   327682
  31.       Max             =   100
  32.    End
  33.    Begin VB.Timer Timer1 
  34.       Interval        =   1000
  35.       Left            =   4440
  36.       Top             =   1920
  37.    End
  38.    Begin VB.Frame Frame1 
  39.       Caption         =   "Output"
  40.       Height          =   1575
  41.       Left            =   4320
  42.       TabIndex        =   11
  43.       Top             =   120
  44.       Width           =   3135
  45.       Begin VB.TextBox Text1 
  46.          Height          =   285
  47.          Left            =   480
  48.          TabIndex        =   15
  49.          Top             =   1200
  50.          Width           =   2535
  51.       End
  52.       Begin VB.OptionButton Option3 
  53.          Caption         =   "Wave file"
  54.          Height          =   255
  55.          Left            =   120
  56.          TabIndex        =   14
  57.          Top             =   840
  58.          Width           =   1455
  59.       End
  60.       Begin VB.OptionButton Option2 
  61.          Caption         =   "DirectSound"
  62.          Height          =   255
  63.          Left            =   120
  64.          TabIndex        =   13
  65.          Top             =   600
  66.          Width           =   1455
  67.       End
  68.       Begin VB.OptionButton Option1 
  69.          Caption         =   "Wavemapper"
  70.          Height          =   255
  71.          Left            =   120
  72.          TabIndex        =   12
  73.          Top             =   360
  74.          Value           =   -1  'True
  75.          Width           =   1455
  76.       End
  77.       Begin VB.Label Label7 
  78.          Caption         =   "File"
  79.          Height          =   255
  80.          Left            =   120
  81.          TabIndex        =   16
  82.          Top             =   1200
  83.          Width           =   375
  84.       End
  85.    End
  86.    Begin VB.CommandButton Command5 
  87.       Caption         =   "Resume"
  88.       Height          =   495
  89.       Left            =   120
  90.       TabIndex        =   4
  91.       Top             =   2520
  92.       Width           =   1575
  93.    End
  94.    Begin VB.CommandButton Command4 
  95.       Caption         =   "Pause"
  96.       Height          =   495
  97.       Left            =   120
  98.       TabIndex        =   3
  99.       Top             =   1920
  100.       Width           =   1575
  101.    End
  102.    Begin VB.CommandButton Command3 
  103.       Caption         =   "Stop"
  104.       Height          =   495
  105.       Left            =   120
  106.       TabIndex        =   2
  107.       Top             =   1320
  108.       Width           =   1575
  109.    End
  110.    Begin VB.CommandButton Command2 
  111.       Caption         =   "Play"
  112.       Height          =   495
  113.       Left            =   120
  114.       TabIndex        =   1
  115.       Top             =   720
  116.       Width           =   1575
  117.    End
  118.    Begin MSComDlg.CommonDialog CommonDialog1 
  119.       Left            =   5160
  120.       Top             =   1920
  121.       _ExtentX        =   847
  122.       _ExtentY        =   847
  123.       _Version        =   327681
  124.    End
  125.    Begin VB.CommandButton Command1 
  126.       Caption         =   "Open MP3"
  127.       Height          =   495
  128.       Left            =   120
  129.       TabIndex        =   0
  130.       Top             =   120
  131.       Width           =   1575
  132.    End
  133.    Begin VB.Label Label21 
  134.       Height          =   255
  135.       Left            =   3000
  136.       TabIndex        =   31
  137.       Top             =   1800
  138.       Width           =   1335
  139.    End
  140.    Begin VB.Label Label20 
  141.       Caption         =   "Stereo mode :"
  142.       Height          =   255
  143.       Left            =   1920
  144.       TabIndex        =   30
  145.       Top             =   1800
  146.       Width           =   1095
  147.    End
  148.    Begin VB.Label Label19 
  149.       Height          =   255
  150.       Left            =   840
  151.       TabIndex        =   29
  152.       Top             =   3120
  153.       Width           =   3735
  154.    End
  155.    Begin VB.Label Label18 
  156.       Caption         =   "Status :"
  157.       Height          =   255
  158.       Left            =   120
  159.       TabIndex        =   28
  160.       Top             =   3120
  161.       Width           =   615
  162.    End
  163.    Begin VB.Label Label17 
  164.       Height          =   255
  165.       Left            =   2880
  166.       TabIndex        =   26
  167.       Top             =   1080
  168.       Width           =   1455
  169.    End
  170.    Begin VB.Label Label16 
  171.       Caption         =   "Time length : "
  172.       Height          =   255
  173.       Left            =   1920
  174.       TabIndex        =   25
  175.       Top             =   1080
  176.       Width           =   975
  177.    End
  178.    Begin VB.Label Label15 
  179.       Height          =   255
  180.       Left            =   3000
  181.       TabIndex        =   24
  182.       Top             =   1560
  183.       Width           =   1215
  184.    End
  185.    Begin VB.Label Label14 
  186.       Caption         =   "Time position : "
  187.       Height          =   255
  188.       Left            =   1920
  189.       TabIndex        =   23
  190.       Top             =   1560
  191.       Width           =   1095
  192.    End
  193.    Begin VB.Label Label13 
  194.       Height          =   255
  195.       Left            =   2640
  196.       TabIndex        =   22
  197.       Top             =   1320
  198.       Width           =   1575
  199.    End
  200.    Begin VB.Label Label12 
  201.       Caption         =   "Position :"
  202.       Height          =   255
  203.       Left            =   1920
  204.       TabIndex        =   21
  205.       Top             =   1320
  206.       Width           =   735
  207.    End
  208.    Begin VB.Label Label11 
  209.       Height          =   255
  210.       Left            =   2640
  211.       TabIndex        =   20
  212.       Top             =   840
  213.       Width           =   1455
  214.    End
  215.    Begin VB.Label Label10 
  216.       Caption         =   "Length :"
  217.       Height          =   255
  218.       Left            =   1920
  219.       TabIndex        =   19
  220.       Top             =   840
  221.       Width           =   735
  222.    End
  223.    Begin VB.Label Label9 
  224.       Height          =   255
  225.       Left            =   2880
  226.       TabIndex        =   18
  227.       Top             =   600
  228.       Width           =   1215
  229.    End
  230.    Begin VB.Label Label8 
  231.       Caption         =   "Frequency : "
  232.       Height          =   255
  233.       Left            =   1920
  234.       TabIndex        =   17
  235.       Top             =   600
  236.       Width           =   975
  237.    End
  238.    Begin VB.Label Label6 
  239.       Height          =   1095
  240.       Left            =   960
  241.       TabIndex        =   10
  242.       Top             =   3360
  243.       Width           =   3375
  244.    End
  245.    Begin VB.Label Label5 
  246.       Height          =   255
  247.       Left            =   2520
  248.       TabIndex        =   9
  249.       Top             =   360
  250.       Width           =   1575
  251.    End
  252.    Begin VB.Label Label4 
  253.       Caption         =   "Layer : "
  254.       Height          =   255
  255.       Left            =   1920
  256.       TabIndex        =   8
  257.       Top             =   360
  258.       Width           =   615
  259.    End
  260.    Begin VB.Label Label3 
  261.       Height          =   255
  262.       Left            =   2520
  263.       TabIndex        =   7
  264.       Top             =   120
  265.       Width           =   1575
  266.    End
  267.    Begin VB.Label Label2 
  268.       Caption         =   "Bitrate : "
  269.       Height          =   255
  270.       Left            =   1920
  271.       TabIndex        =   6
  272.       Top             =   120
  273.       Width           =   615
  274.    End
  275.    Begin VB.Label Label1 
  276.       Caption         =   "Errorcode :"
  277.       Height          =   255
  278.       Left            =   120
  279.       TabIndex        =   5
  280.       Top             =   3360
  281.       Width           =   855
  282.    End
  283.    Begin VB.Menu about 
  284.       Caption         =   "About"
  285.    End
  286. Attribute VB_Name = "Form1"
  287. Attribute VB_GlobalNameSpace = False
  288. Attribute VB_Creatable = False
  289. Attribute VB_PredeclaredId = True
  290. Attribute VB_Exposed = False
  291. Private Sub about_Click()
  292. BWMP31.about
  293. End Sub
  294. Private Sub BWMP31_PlaybackFinished()
  295. Form1.Caption = "Finished"  'this event is raised at the end of the playback
  296. End Sub
  297. Private Sub BWMP31_PlayerMode(ModeNumber As Long, modeDescription As String)
  298. Label19.Caption = modeDescription  'this event is raised in every change in the playback mode
  299. End Sub
  300. Private Sub BWMP31_ReturnError(ErrorCode As Long, ErrorDescription As String)
  301. Label6.Caption = ErrorDescription  'This event is raised in any exception
  302. End Sub
  303. Private Sub Command1_Click()
  304. Label6.Caption = ""     '  cleaning the errorcode label
  305. Dim ret As Long
  306. CommonDialog1.ShowOpen
  307. BWMP31.OpenMP3 CommonDialog1.filename
  308. 'The following commands retrieves the information about the MP3 file
  309. Label3.Caption = BWMP31.GetBitRate
  310. Label5.Caption = BWMP31.GetLayer
  311. Label9.Caption = BWMP31.GetFrequency
  312. Label11.Caption = BWMP31.GetLength
  313. Label17.Caption = BWMP31.GetTimeLength
  314. Label21.Caption = BWMP31.GetMP3StereoMode
  315. End Sub
  316. Private Sub Command2_Click()
  317. Form1.Caption = ""
  318. Label6.Caption = ""     '  cleaning the errorcode label
  319. 'The following command plays the MP3 file , and you can select also the start position and the end position
  320. 'To play from 10000 to 30000 -> BWMP31.PlayMP3 10000, 30000
  321. BWMP31.PlayMP3
  322. End Sub
  323. Private Sub Command3_Click()
  324. Label6.Caption = ""     ' cleaning the errorcode label
  325. BWMP31.StopMP3
  326. End Sub
  327. Private Sub Command4_Click()
  328. Label6.Caption = ""     ' cleaning the errorcode label
  329. BWMP31.PauseMP3
  330. End Sub
  331. Private Sub Command5_Click()
  332. Label6.Caption = ""     ' cleaning the errorcode label
  333. BWMP31.ResumeMP3
  334. End Sub
  335. Private Sub Option1_Click()
  336. Option2.Value = False
  337. Option3.Value = False
  338. BWMP31.OutPutDeviceType = WaveMapper
  339. End Sub
  340. Private Sub Option2_Click()
  341. Option1.Value = False
  342. Option3.Value = False
  343. BWMP31.OutPutDeviceType = DirectSound
  344. End Sub
  345. Private Sub Option3_Click()
  346. Option1.Value = False
  347. Option2.Value = False
  348. BWMP31.OutPutDeviceType = PCMFile 'in order to extract the MP3 file to a Wav file , you need to provide a outputfile , or an error will occur
  349. Text1.Enabled = True
  350. End Sub
  351. Private Sub Slider1_Scroll()
  352. Timer1.Enabled = False
  353. BWMP31.SetSliderPosition Slider1.Value
  354. Timer1.Enabled = True
  355. End Sub
  356. Private Sub Text1_Change()
  357. BWMP31.SetOutPutFile (Text1.Text)
  358. End Sub
  359. Private Sub Timer1_Timer()
  360. On Error Resume Next
  361. Label13.Caption = BWMP31.GetPosition
  362. Label15.Caption = BWMP31.GetTimePosition
  363. Slider1.Value = BWMP31.GetSliderPosition
  364. End Sub
  365.