home *** CD-ROM | disk | FTP | other *** search
/ Multimédia la Compil' 2 / Sybex_Multimedia_La_Compil_2.iso / cooltool / mfplayr / mfplayr.frm next >
Text File  |  1995-05-26  |  37KB  |  1,202 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   3  'Fixed Double
  6.    Caption         =   "MFPlayer Example"
  7.    ClientHeight    =   3990
  8.    ClientLeft      =   1305
  9.    ClientTop       =   1995
  10.    ClientWidth     =   9720
  11.    Height          =   4680
  12.    Icon            =   MFPLAYR.FRX:0000
  13.    Left            =   1245
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   3990
  17.    ScaleWidth      =   9720
  18.    Top             =   1365
  19.    Width           =   9840
  20.    Begin Frame Frame2 
  21.       BackColor       =   &H00C0C0C0&
  22.       Caption         =   "Playback Controls"
  23.       Height          =   1095
  24.       Left            =   60
  25.       TabIndex        =   14
  26.       Top             =   2760
  27.       Width           =   9495
  28.       Begin CommandButton CmdQueue 
  29.          Caption         =   "Queue "
  30.          Enabled         =   0   'False
  31.          Height          =   675
  32.          Left            =   120
  33.          TabIndex        =   20
  34.          Top             =   300
  35.          Width           =   1035
  36.       End
  37.       Begin Frame Frame5 
  38.          BackColor       =   &H00C0C0C0&
  39.          Caption         =   "MIDI Output"
  40.          FontBold        =   0   'False
  41.          FontItalic      =   0   'False
  42.          FontName        =   "MS Sans Serif"
  43.          FontSize        =   8.25
  44.          FontStrikethru  =   0   'False
  45.          FontUnderline   =   0   'False
  46.          Height          =   795
  47.          Left            =   3900
  48.          TabIndex        =   18
  49.          Top             =   180
  50.          Width           =   3195
  51.          Begin ComboBox OutputDevCombo 
  52.             Height          =   300
  53.             Left            =   180
  54.             Style           =   2  'Dropdown List
  55.             TabIndex        =   19
  56.             Top             =   300
  57.             Width           =   2835
  58.          End
  59.       End
  60.       Begin CommandButton CmdStop 
  61.          Caption         =   "Stop"
  62.          Height          =   675
  63.          Left            =   2520
  64.          TabIndex        =   17
  65.          Top             =   300
  66.          Width           =   1035
  67.       End
  68.       Begin CommandButton CmdPlay 
  69.          Caption         =   "Play"
  70.          Height          =   675
  71.          Left            =   1320
  72.          TabIndex        =   16
  73.          Top             =   300
  74.          Width           =   1035
  75.       End
  76.       Begin Frame Frame3 
  77.          BackColor       =   &H00C0C0C0&
  78.          Caption         =   "Playback Rate"
  79.          FontBold        =   0   'False
  80.          FontItalic      =   0   'False
  81.          FontName        =   "MS Sans Serif"
  82.          FontSize        =   8.25
  83.          FontStrikethru  =   0   'False
  84.          FontUnderline   =   0   'False
  85.          Height          =   795
  86.          Left            =   7260
  87.          TabIndex        =   15
  88.          Top             =   180
  89.          Width           =   2175
  90.          Begin HSlider PlaybackRateSlider 
  91.             BackColor       =   &H00C0C0C0&
  92.             BevelInner      =   1  'Raised
  93.             BevelOuter      =   0  'None
  94.             BevelWidth      =   2
  95.             BorderWidth     =   2
  96.             Gap             =   3
  97.             Height          =   435
  98.             LargeChange     =   10
  99.             Left            =   60
  100.             LinkControl     =   "MIDIOutput1"
  101.             LinkProperty    =   "PlaybackRate"
  102.             Max             =   100
  103.             Min             =   -100
  104.             ThumbHeight     =   310
  105.             ThumbStyle      =   2  'Pointed Down
  106.             ThumbWidth      =   120
  107.             TickColor       =   &H00000000&
  108.             TickCount       =   20
  109.             TickLength      =   4
  110.             TickMarks       =   2  'Bottom
  111.             TickWidth       =   1
  112.             Top             =   240
  113.             TrackBevel      =   2  'Inset
  114.             TrackWidth      =   2
  115.             Value           =   0
  116.             Width           =   2055
  117.          End
  118.       End
  119.    End
  120.    Begin MIDIFile MIDIFile1 
  121.       Filename        =   ""
  122.       Left            =   60
  123.       ReadOnly        =   0   'False
  124.       Top             =   3900
  125.    End
  126.    Begin Frame Frame1 
  127.       BackColor       =   &H00C0C0C0&
  128.       Caption         =   "MIDI File Track  -- VU Meters"
  129.       Height          =   1845
  130.       Left            =   0
  131.       TabIndex        =   1
  132.       Top             =   120
  133.       Width           =   8715
  134.       Begin VIndicator VIndicator1 
  135.          BackColor       =   &H00808080&
  136.          BevelInner      =   0  'None
  137.          BevelOuter      =   1  'Raised
  138.          BevelWidth      =   1
  139.          Border          =   1  'Single Width
  140.          BorderWidth     =   1
  141.          Height          =   1515
  142.          Index           =   0
  143.          ItemBackColor   =   &H00000000&
  144.          ItemCount1      =   7
  145.          ItemCount2      =   4
  146.          ItemCount3      =   3
  147.          ItemForeColor1  =   &H0000FF00&
  148.          ItemForeColor2  =   &H0000FFFF&
  149.          ItemForeColor3  =   &H000000FF&
  150.          Left            =   180
  151.          LinkControl     =   ""
  152.          LinkProperty    =   ""
  153.          Max             =   128
  154.          Min             =   1
  155.          ThreeD          =   -1  'True
  156.          Top             =   300
  157.          Value           =   0
  158.          Width           =   435
  159.       End
  160.       Begin VIndicator VIndicator1 
  161.          BackColor       =   &H00808080&
  162.          BevelInner      =   0  'None
  163.          BevelOuter      =   1  'Raised
  164.          BevelWidth      =   1
  165.          Border          =   1  'Single Width
  166.          BorderWidth     =   1
  167.          Height          =   1515
  168.          Index           =   1
  169.          ItemBackColor   =   &H00000000&
  170.          ItemCount1      =   7
  171.          ItemCount2      =   4
  172.          ItemCount3      =   3
  173.          ItemForeColor1  =   &H0000FF00&
  174.          ItemForeColor2  =   &H0000FFFF&
  175.          ItemForeColor3  =   &H000000FF&
  176.          Left            =   900
  177.          LinkControl     =   ""
  178.          LinkProperty    =   ""
  179.          Max             =   128
  180.          Min             =   1
  181.          ThreeD          =   -1  'True
  182.          Top             =   300
  183.          Value           =   0
  184.          Width           =   435
  185.       End
  186.       Begin VIndicator VIndicator1 
  187.          BackColor       =   &H00808080&
  188.          BevelInner      =   0  'None
  189.          BevelOuter      =   1  'Raised
  190.          BevelWidth      =   1
  191.          Border          =   1  'Single Width
  192.          BorderWidth     =   1
  193.          Height          =   1515
  194.          Index           =   2
  195.          ItemBackColor   =   &H00000000&
  196.          ItemCount1      =   7
  197.          ItemCount2      =   4
  198.          ItemCount3      =   3
  199.          ItemForeColor1  =   &H0000FF00&
  200.          ItemForeColor2  =   &H0000FFFF&
  201.          ItemForeColor3  =   &H000000FF&
  202.          Left            =   1620
  203.          LinkControl     =   ""
  204.          LinkProperty    =   ""
  205.          Max             =   128
  206.          Min             =   1
  207.          ThreeD          =   -1  'True
  208.          Top             =   300
  209.          Value           =   0
  210.          Width           =   435
  211.       End
  212.       Begin VIndicator VIndicator1 
  213.          BackColor       =   &H00808080&
  214.          BevelInner      =   0  'None
  215.          BevelOuter      =   1  'Raised
  216.          BevelWidth      =   1
  217.          Border          =   1  'Single Width
  218.          BorderWidth     =   1
  219.          Height          =   1515
  220.          Index           =   3
  221.          ItemBackColor   =   &H00000000&
  222.          ItemCount1      =   7
  223.          ItemCount2      =   4
  224.          ItemCount3      =   3
  225.          ItemForeColor1  =   &H0000FF00&
  226.          ItemForeColor2  =   &H0000FFFF&
  227.          ItemForeColor3  =   &H000000FF&
  228.          Left            =   2340
  229.          LinkControl     =   ""
  230.          LinkProperty    =   ""
  231.          Max             =   128
  232.          Min             =   1
  233.          ThreeD          =   -1  'True
  234.          Top             =   300
  235.          Value           =   0
  236.          Width           =   435
  237.       End
  238.       Begin VIndicator VIndicator1 
  239.          BackColor       =   &H00808080&
  240.          BevelInner      =   0  'None
  241.          BevelOuter      =   1  'Raised
  242.          BevelWidth      =   1
  243.          Border          =   1  'Single Width
  244.          BorderWidth     =   1
  245.          Height          =   1515
  246.          Index           =   4
  247.          ItemBackColor   =   &H00000000&
  248.          ItemCount1      =   7
  249.          ItemCount2      =   4
  250.          ItemCount3      =   3
  251.          ItemForeColor1  =   &H0000FF00&
  252.          ItemForeColor2  =   &H0000FFFF&
  253.          ItemForeColor3  =   &H000000FF&
  254.          Left            =   3060
  255.          LinkControl     =   ""
  256.          LinkProperty    =   ""
  257.          Max             =   128
  258.          Min             =   1
  259.          ThreeD          =   -1  'True
  260.          Top             =   300
  261.          Value           =   0
  262.          Width           =   435
  263.       End
  264.       Begin VIndicator VIndicator1 
  265.          BackColor       =   &H00808080&
  266.          BevelInner      =   0  'None
  267.          BevelOuter      =   1  'Raised
  268.          BevelWidth      =   1
  269.          Border          =   1  'Single Width
  270.          BorderWidth     =   1
  271.          Height          =   1515
  272.          Index           =   5
  273.          ItemBackColor   =   &H00000000&
  274.          ItemCount1      =   7
  275.          ItemCount2      =   4
  276.          ItemCount3      =   3
  277.          ItemForeColor1  =   &H0000FF00&
  278.          ItemForeColor2  =   &H0000FFFF&
  279.          ItemForeColor3  =   &H000000FF&
  280.          Left            =   3780
  281.          LinkControl     =   ""
  282.          LinkProperty    =   ""
  283.          Max             =   128
  284.          Min             =   1
  285.          ThreeD          =   -1  'True
  286.          Top             =   300
  287.          Value           =   0
  288.          Width           =   435
  289.       End
  290.       Begin VIndicator VIndicator1 
  291.          BackColor       =   &H00808080&
  292.          BevelInner      =   0  'None
  293.          BevelOuter      =   1  'Raised
  294.          BevelWidth      =   1
  295.          Border          =   1  'Single Width
  296.          BorderWidth     =   1
  297.          Height          =   1515
  298.          Index           =   6
  299.          ItemBackColor   =   &H00000000&
  300.          ItemCount1      =   7
  301.          ItemCount2      =   4
  302.          ItemCount3      =   3
  303.          ItemForeColor1  =   &H0000FF00&
  304.          ItemForeColor2  =   &H0000FFFF&
  305.          ItemForeColor3  =   &H000000FF&
  306.          Left            =   4500
  307.          LinkControl     =   ""
  308.          LinkProperty    =   ""
  309.          Max             =   128
  310.          Min             =   1
  311.          ThreeD          =   -1  'True
  312.          Top             =   300
  313.          Value           =   0
  314.          Width           =   435
  315.       End
  316.       Begin VIndicator VIndicator1 
  317.          BackColor       =   &H00808080&
  318.          BevelInner      =   0  'None
  319.          BevelOuter      =   1  'Raised
  320.          BevelWidth      =   1
  321.          Border          =   1  'Single Width
  322.          BorderWidth     =   1
  323.          Height          =   1515
  324.          Index           =   7
  325.          ItemBackColor   =   &H00000000&
  326.          ItemCount1      =   7
  327.          ItemCount2      =   4
  328.          ItemCount3      =   3
  329.          ItemForeColor1  =   &H0000FF00&
  330.          ItemForeColor2  =   &H0000FFFF&
  331.          ItemForeColor3  =   &H000000FF&
  332.          Left            =   5220
  333.          LinkControl     =   ""
  334.          LinkProperty    =   ""
  335.          Max             =   128
  336.          Min             =   1
  337.          ThreeD          =   -1  'True
  338.          Top             =   300
  339.          Value           =   0
  340.          Width           =   435
  341.       End
  342.       Begin VIndicator VIndicator1 
  343.          BackColor       =   &H00808080&
  344.          BevelInner      =   0  'None
  345.          BevelOuter      =   1  'Raised
  346.          BevelWidth      =   1
  347.          Border          =   1  'Single Width
  348.          BorderWidth     =   1
  349.          Height          =   1515
  350.          Index           =   8
  351.          ItemBackColor   =   &H00000000&
  352.          ItemCount1      =   7
  353.          ItemCount2      =   4
  354.          ItemCount3      =   3
  355.          ItemForeColor1  =   &H0000FF00&
  356.          ItemForeColor2  =   &H0000FFFF&
  357.          ItemForeColor3  =   &H000000FF&
  358.          Left            =   5940
  359.          LinkControl     =   ""
  360.          LinkProperty    =   ""
  361.          Max             =   128
  362.          Min             =   1
  363.          ThreeD          =   -1  'True
  364.          Top             =   300
  365.          Value           =   0
  366.          Width           =   435
  367.       End
  368.       Begin VIndicator VIndicator1 
  369.          BackColor       =   &H00808080&
  370.          BevelInner      =   0  'None
  371.          BevelOuter      =   1  'Raised
  372.          BevelWidth      =   1
  373.          Border          =   1  'Single Width
  374.          BorderWidth     =   1
  375.          Height          =   1515
  376.          Index           =   9
  377.          ItemBackColor   =   &H00000000&
  378.          ItemCount1      =   7
  379.          ItemCount2      =   4
  380.          ItemCount3      =   3
  381.          ItemForeColor1  =   &H0000FF00&
  382.          ItemForeColor2  =   &H0000FFFF&
  383.          ItemForeColor3  =   &H000000FF&
  384.          Left            =   6660
  385.          LinkControl     =   ""
  386.          LinkProperty    =   ""
  387.          Max             =   128
  388.          Min             =   1
  389.          ThreeD          =   -1  'True
  390.          Top             =   300
  391.          Value           =   0
  392.          Width           =   435
  393.       End
  394.       Begin VIndicator VIndicator1 
  395.          BackColor       =   &H00808080&
  396.          BevelInner      =   0  'None
  397.          BevelOuter      =   1  'Raised
  398.          BevelWidth      =   1
  399.          Border          =   1  'Single Width
  400.          BorderWidth     =   1
  401.          Height          =   1515
  402.          Index           =   10
  403.          ItemBackColor   =   &H00000000&
  404.          ItemCount1      =   7
  405.          ItemCount2      =   4
  406.          ItemCount3      =   3
  407.          ItemForeColor1  =   &H0000FF00&
  408.          ItemForeColor2  =   &H0000FFFF&
  409.          ItemForeColor3  =   &H000000FF&
  410.          Left            =   8100
  411.          LinkControl     =   ""
  412.          LinkProperty    =   ""
  413.          Max             =   128
  414.          Min             =   1
  415.          ThreeD          =   -1  'True
  416.          Top             =   300
  417.          Value           =   0
  418.          Width           =   435
  419.       End
  420.       Begin VIndicator VIndicator1 
  421.          BackColor       =   &H00808080&
  422.          BevelInner      =   0  'None
  423.          BevelOuter      =   1  'Raised
  424.          BevelWidth      =   1
  425.          Border          =   1  'Single Width
  426.          BorderWidth     =   1
  427.          Height          =   1515
  428.          Index           =   11
  429.          ItemBackColor   =   &H00000000&
  430.          ItemCount1      =   7
  431.          ItemCount2      =   4
  432.          ItemCount3      =   3
  433.          ItemForeColor1  =   &H0000FF00&
  434.          ItemForeColor2  =   &H0000FFFF&
  435.          ItemForeColor3  =   &H000000FF&
  436.          Left            =   7380
  437.          LinkControl     =   ""
  438.          LinkProperty    =   ""
  439.          Max             =   128
  440.          Min             =   1
  441.          ThreeD          =   -1  'True
  442.          Top             =   300
  443.          Value           =   0
  444.          Width           =   435
  445.       End
  446.    End
  447.    Begin Frame Frame4 
  448.       BackColor       =   &H00C0C0C0&
  449.       Caption         =   "VU Decay"
  450.       FontBold        =   0   'False
  451.       FontItalic      =   0   'False
  452.       FontName        =   "Small Fonts"
  453.       FontSize        =   6.75
  454.       FontStrikethru  =   0   'False
  455.       FontUnderline   =   0   'False
  456.       Height          =   2535
  457.       Left            =   8760
  458.       TabIndex        =   0
  459.       Top             =   120
  460.       Width           =   795
  461.       Begin Timer Timer1 
  462.          Enabled         =   0   'False
  463.          Interval        =   150
  464.          Left            =   60
  465.          Top             =   2040
  466.       End
  467.       Begin VSlider VSliderVuDecay 
  468.          BackColor       =   &H00C0C0C0&
  469.          BevelInner      =   0  'None
  470.          BevelOuter      =   0  'None
  471.          BevelWidth      =   2
  472.          BorderWidth     =   2
  473.          Gap             =   3
  474.          Height          =   2175
  475.          LargeChange     =   10
  476.          Left            =   180
  477.          LinkControl     =   ""
  478.          LinkProperty    =   ""
  479.          Max             =   1
  480.          Min             =   750
  481.          ThumbHeight     =   200
  482.          ThumbStyle      =   0  'Normal
  483.          ThumbWidth      =   295
  484.          TickColor       =   &H00000000&
  485.          TickCount       =   5
  486.          TickLength      =   4
  487.          TickMarks       =   3  'Both
  488.          TickWidth       =   1
  489.          Top             =   240
  490.          TrackBevel      =   0  'None
  491.          TrackWidth      =   0
  492.          Value           =   150
  493.          Width           =   435
  494.       End
  495.    End
  496.    Begin MIDIOutput MIDIOutput1 
  497.       DeviceID        =   0
  498.       Left            =   480
  499.       Top             =   3900
  500.       VolumeLeft      =   0
  501.       VolumeRight     =   0
  502.    End
  503.    Begin CommonDialog CMDialog1 
  504.       CancelError     =   -1  'True
  505.       DefaultExt      =   "mid"
  506.       DialogTitle     =   "Open MIDI File"
  507.       Filter          =   "(*.mid) MIDI files|*.mid|"
  508.       Left            =   900
  509.       Top             =   3900
  510.    End
  511.    Begin Label LabelTrackName 
  512.       BackColor       =   &H00C0C0C0&
  513.       BorderStyle     =   1  'Fixed Single
  514.       FontBold        =   0   'False
  515.       FontItalic      =   0   'False
  516.       FontName        =   "Small Fonts"
  517.       FontSize        =   6
  518.       FontStrikethru  =   0   'False
  519.       FontUnderline   =   0   'False
  520.       ForeColor       =   &H00000000&
  521.       Height          =   600
  522.       Index           =   11
  523.       Left            =   7980
  524.       TabIndex        =   13
  525.       Top             =   2040
  526.       Width           =   735
  527.       WordWrap        =   -1  'True
  528.    End
  529.    Begin Label LabelTrackName 
  530.       BackColor       =   &H00C0C0C0&
  531.       BorderStyle     =   1  'Fixed Single
  532.       FontBold        =   0   'False
  533.       FontItalic      =   0   'False
  534.       FontName        =   "Small Fonts"
  535.       FontSize        =   6
  536.       FontStrikethru  =   0   'False
  537.       FontUnderline   =   0   'False
  538.       ForeColor       =   &H00000000&
  539.       Height          =   600
  540.       Index           =   10
  541.       Left            =   7260
  542.       TabIndex        =   12
  543.       Top             =   2040
  544.       Width           =   675
  545.       WordWrap        =   -1  'True
  546.    End
  547.    Begin Label LabelTrackName 
  548.       BackColor       =   &H00C0C0C0&
  549.       BorderStyle     =   1  'Fixed Single
  550.       FontBold        =   0   'False
  551.       FontItalic      =   0   'False
  552.       FontName        =   "Small Fonts"
  553.       FontSize        =   6
  554.       FontStrikethru  =   0   'False
  555.       FontUnderline   =   0   'False
  556.       ForeColor       =   &H00000000&
  557.       Height          =   600
  558.       Index           =   9
  559.       Left            =   6540
  560.       TabIndex        =   11
  561.       Top             =   2040
  562.       Width           =   675
  563.       WordWrap        =   -1  'True
  564.    End
  565.    Begin Label LabelTrackName 
  566.       BackColor       =   &H00C0C0C0&
  567.       BorderStyle     =   1  'Fixed Single
  568.       FontBold        =   0   'False
  569.       FontItalic      =   0   'False
  570.       FontName        =   "Small Fonts"
  571.       FontSize        =   6
  572.       FontStrikethru  =   0   'False
  573.       FontUnderline   =   0   'False
  574.       ForeColor       =   &H00000000&
  575.       Height          =   600
  576.       Index           =   8
  577.       Left            =   5820
  578.       TabIndex        =   10
  579.       Top             =   2040
  580.       Width           =   675
  581.       WordWrap        =   -1  'True
  582.    End
  583.    Begin Label LabelTrackName 
  584.       BackColor       =   &H00C0C0C0&
  585.       BorderStyle     =   1  'Fixed Single
  586.       FontBold        =   0   'False
  587.       FontItalic      =   0   'False
  588.       FontName        =   "Small Fonts"
  589.       FontSize        =   6
  590.       FontStrikethru  =   0   'False
  591.       FontUnderline   =   0   'False
  592.       ForeColor       =   &H00000000&
  593.       Height          =   600
  594.       Index           =   7
  595.       Left            =   5100
  596.       TabIndex        =   9
  597.       Top             =   2040
  598.       Width           =   675
  599.       WordWrap        =   -1  'True
  600.    End
  601.    Begin Label LabelTrackName 
  602.       BackColor       =   &H00C0C0C0&
  603.       BorderStyle     =   1  'Fixed Single
  604.       FontBold        =   0   'False
  605.       FontItalic      =   0   'False
  606.       FontName        =   "Small Fonts"
  607.       FontSize        =   6
  608.       FontStrikethru  =   0   'False
  609.       FontUnderline   =   0   'False
  610.       ForeColor       =   &H00000000&
  611.       Height          =   600
  612.       Index           =   6
  613.       Left            =   4380
  614.       TabIndex        =   8
  615.       Top             =   2040
  616.       Width           =   675
  617.       WordWrap        =   -1  'True
  618.    End
  619.    Begin Label LabelTrackName 
  620.       BackColor       =   &H00C0C0C0&
  621.       BorderStyle     =   1  'Fixed Single
  622.       FontBold        =   0   'False
  623.       FontItalic      =   0   'False
  624.       FontName        =   "Small Fonts"
  625.       FontSize        =   6
  626.       FontStrikethru  =   0   'False
  627.       FontUnderline   =   0   'False
  628.       ForeColor       =   &H00000000&
  629.       Height          =   600
  630.       Index           =   5
  631.       Left            =   3660
  632.       TabIndex        =   7
  633.       Top             =   2040
  634.       Width           =   675
  635.       WordWrap        =   -1  'True
  636.    End
  637.    Begin Label LabelTrackName 
  638.       BackColor       =   &H00C0C0C0&
  639.       BorderStyle     =   1  'Fixed Single
  640.       FontBold        =   0   'False
  641.       FontItalic      =   0   'False
  642.       FontName        =   "Small Fonts"
  643.       FontSize        =   6
  644.       FontStrikethru  =   0   'False
  645.       FontUnderline   =   0   'False
  646.       ForeColor       =   &H00000000&
  647.       Height          =   600
  648.       Index           =   4
  649.       Left            =   2940
  650.       TabIndex        =   6
  651.       Top             =   2040
  652.       Width           =   675
  653.       WordWrap        =   -1  'True
  654.    End
  655.    Begin Label LabelTrackName 
  656.       BackColor       =   &H00C0C0C0&
  657.       BorderStyle     =   1  'Fixed Single
  658.       FontBold        =   0   'False
  659.       FontItalic      =   0   'False
  660.       FontName        =   "Small Fonts"
  661.       FontSize        =   6
  662.       FontStrikethru  =   0   'False
  663.       FontUnderline   =   0   'False
  664.       ForeColor       =   &H00000000&
  665.       Height          =   600
  666.       Index           =   3
  667.       Left            =   2220
  668.       TabIndex        =   5
  669.       Top             =   2040
  670.       Width           =   675
  671.       WordWrap        =   -1  'True
  672.    End
  673.    Begin Label LabelTrackName 
  674.       BackColor       =   &H00C0C0C0&
  675.       BorderStyle     =   1  'Fixed Single
  676.       FontBold        =   0   'False
  677.       FontItalic      =   0   'False
  678.       FontName        =   "Small Fonts"
  679.       FontSize        =   6
  680.       FontStrikethru  =   0   'False
  681.       FontUnderline   =   0   'False
  682.       ForeColor       =   &H00000000&
  683.       Height          =   600
  684.       Index           =   2
  685.       Left            =   1500
  686.       TabIndex        =   4
  687.       Top             =   2040
  688.       Width           =   675
  689.       WordWrap        =   -1  'True
  690.    End
  691.    Begin Label LabelTrackName 
  692.       BackColor       =   &H00C0C0C0&
  693.       BorderStyle     =   1  'Fixed Single
  694.       FontBold        =   0   'False
  695.       FontItalic      =   0   'False
  696.       FontName        =   "Small Fonts"
  697.       FontSize        =   6
  698.       FontStrikethru  =   0   'False
  699.       FontUnderline   =   0   'False
  700.       ForeColor       =   &H00000000&
  701.       Height          =   600
  702.       Index           =   1
  703.       Left            =   780
  704.       TabIndex        =   3
  705.       Top             =   2040
  706.       Width           =   675
  707.       WordWrap        =   -1  'True
  708.    End
  709.    Begin Label LabelTrackName 
  710.       BackColor       =   &H00C0C0C0&
  711.       BorderStyle     =   1  'Fixed Single
  712.       FontBold        =   0   'False
  713.       FontItalic      =   0   'False
  714.       FontName        =   "Small Fonts"
  715.       FontSize        =   6
  716.       FontStrikethru  =   0   'False
  717.       FontUnderline   =   0   'False
  718.       ForeColor       =   &H00000000&
  719.       Height          =   600
  720.       Index           =   0
  721.       Left            =   60
  722.       TabIndex        =   2
  723.       Top             =   2040
  724.       Width           =   675
  725.       WordWrap        =   -1  'True
  726.    End
  727.    Begin Menu FileMenu 
  728.       Caption         =   "&File"
  729.       Begin Menu FileOpen 
  730.          Caption         =   "&Open..."
  731.          Shortcut        =   ^O
  732.       End
  733.       Begin Menu FileSep1 
  734.          Caption         =   "-"
  735.       End
  736.       Begin Menu FileExit 
  737.          Caption         =   "E&xit"
  738.       End
  739.    End
  740. End
  741. Option Explicit
  742.  
  743. Dim lVolume As Integer
  744. Dim rVolume As Integer
  745.  
  746. Dim PreviousTime As Long
  747.  
  748. Dim msPerTick As Single
  749. Dim ticksPerMs As Single
  750.  
  751. Dim CurrentTime As Long
  752.  
  753. Sub CloseOutputDevice ()
  754.     '
  755.     ' Restore volume before closing
  756.     '
  757.     If MIDIOutput1.State >= MIDISTATE_OPEN Then
  758.     If (MIDIOutput1.HasLRVolume) Then
  759.         MIDIOutput1.VolumeLeft = lVolume
  760.         MIDIOutput1.VolumeRight = rVolume
  761.     ElseIf (MIDIOutput1.HasVolume) Then
  762.         MIDIOutput1.VolumeLeft = lVolume
  763.     End If
  764.     '
  765.     ' Close
  766.     '
  767.     MIDIOutput1.Action = MIDIOUT_CLOSE
  768.     End If
  769. End Sub
  770.  
  771. Sub CmdPlay_Click ()
  772.     StartPlay
  773.     Timer1.Enabled = True
  774. End Sub
  775.  
  776. Sub CmdQueue_Click ()
  777.     QueueSong
  778. End Sub
  779.  
  780. Sub CmdStop_Click ()
  781.     screen.MousePointer = 11
  782.     StopPlay
  783.     Timer1.Enabled = False
  784.     screen.MousePointer = 0
  785. End Sub
  786.  
  787. Sub DisplayTrackNames ()
  788.     Dim m As Integer
  789.     Dim t As Integer
  790.  
  791.     For m = 0 To 11
  792.     LabelTrackName(m) = ""
  793.     Next
  794.     
  795.  
  796.     For t = 1 To MIDIFile1.NumberOfTracks
  797.     If (t = 1) Then
  798.         msPerTick = ((MIDIFile1.Tempo) / 1000) / MIDIFile1.TicksPerQuarterNote
  799.         ticksPerMs = (MIDIFile1.TicksPerQuarterNote / MIDIFile1.Tempo) * 1000
  800.     ElseIf t <= 13 Then
  801.         LabelTrackName(t - 2).Caption = GetTrackName(t)
  802.         'Put 3D effect on label control
  803.         HighLight LabelTrackName(t - 2), 2
  804.     End If
  805.     Next
  806.  
  807. End Sub
  808.  
  809. Sub FileExit_Click ()
  810.     End
  811. End Sub
  812.  
  813. Sub FileOpen_Click ()
  814.     On Error Resume Next
  815.     CMDialog1.DialogTitle = "Open MIDI File"
  816.     CMDialog1.Flags = &H1000&
  817.     CMDialog1.Action = 1
  818.     If (Err) Then
  819.     Exit Sub
  820.     End If
  821.     MIDIFile1.Filename = CMDialog1.Filename
  822.     MIDIFile1.Action = MIDIFILE_OPEN
  823.     DisplayTrackNames
  824.     CmdQueue_Click
  825. End Sub
  826.  
  827. Sub Form_Load ()
  828.     Dim I As Integer
  829.  
  830.     Form1.Left = 0
  831.     Form1.Top = 0
  832.  
  833.     ' Fill output device combo box
  834.     For I = -1 To MIDIOutput1.DeviceCount - 1
  835.     MIDIOutput1.DeviceID = I
  836.     OutputDevCombo.AddItem MIDIOutput1.ProductName
  837.     Next
  838.     
  839.     ' Select first in list
  840.     MIDIOutput1.DeviceID = -1
  841.     OutputDevCombo.ListIndex = 0
  842.     
  843.     Form1.Show
  844.     CmdQueue.Enabled = False
  845.     CmdStop.Enabled = False
  846.     CmdPlay.Enabled = False
  847. End Sub
  848.  
  849. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  850.     Cancel = True
  851. End Sub
  852.  
  853. Sub Form_Unload (Cancel As Integer)
  854.     CloseOutputDevice
  855. End Sub
  856.  
  857. Function GetTrackName (Track As Integer) As String
  858.     Dim I As Integer
  859.  
  860.     MIDIFile1.TrackNumber = Track
  861.  
  862.     For I = 1 To MIDIFile1.MessageCount
  863.     MIDIFile1.MessageNumber = I
  864.     '
  865.     'Meta Event
  866.     '
  867.     If (MIDIFile1.Message = 255) And MIDIFile1.Data1 = 3 Then
  868.         If (MIDIFile1.MsgText = "") Then
  869.         GetTrackName = "Track" & Str(Track) & " (null)"
  870.         Else
  871.         GetTrackName = MIDIFile1.MsgText
  872.         End If
  873.         Exit Function
  874.     End If
  875.     Next
  876.     GetTrackName = "Track" & Str(Track)
  877. End Function
  878.  
  879. Sub MIDIOutput1_Error (ErrorCode As Integer, ErrorMessage As String)
  880.     MsgBox ErrorMessage
  881. End Sub
  882.  
  883. Sub MIDIOutput1_MessageSent (MessageTag As Long)
  884.     Dim TrackNumber As Integer
  885.  
  886.     TrackNumber = Int(MessageTag / 1000) - 2
  887.     
  888.  
  889.     If Val(Right(MessageTag, 3)) > 1 And TrackNumber < 12 Then
  890.     VIndicator1(TrackNumber).Value = Val(Right(MessageTag, 3))
  891.     End If
  892. End Sub
  893.  
  894. Sub MIDIOutput1_QueueEmpty ()
  895.     Dim n As Integer
  896.     StopPlay
  897.  
  898. End Sub
  899.  
  900. Sub MidiReset ()
  901.     Dim x As Integer
  902.     Dim y As Integer
  903.  
  904.     'Reset VU Meters to 0
  905.     For y = 0 To 11
  906.     VIndicator1(y).Value = 0
  907.     Next
  908.  
  909.     'Turn off all MIDI Notes on all channels.
  910.     For x = 176 To 191
  911.       MIDIOutput1.Message = x
  912.       MIDIOutput1.Data1 = 123
  913.       MIDIOutput1.Data2 = 0
  914.       MIDIOutput1.Action = MIDIOUT_SEND
  915.     Next
  916.     MIDIOutput1.Action = MIDIOUT_STOP
  917.  
  918. End Sub
  919.  
  920. Sub OpenOutputDevice ()
  921.     '
  922.     ' Restore defaults
  923.     '
  924.     PlaybackRateSlider = 0
  925.     '
  926.     ' Open selected device
  927.     '
  928.     MIDIOutput1.DeviceID = OutputDevCombo.ListIndex - 1
  929.     MIDIOutput1.Action = MIDIOUT_OPEN
  930.     '
  931.     ' Save volume if opened ok
  932.     '
  933.     If (MIDIOutput1.HMidiDevice <> 0) Then
  934.     '
  935.     ' If device supports volume, save starting volume
  936.     '
  937.     If (MIDIOutput1.HasLRVolume) Then
  938.         lVolume = MIDIOutput1.VolumeLeft
  939.         rVolume = MIDIOutput1.VolumeRight
  940.     ElseIf (MIDIOutput1.HasVolume) Then
  941.         lVolume = MIDIOutput1.VolumeLeft
  942.     End If
  943.     End If
  944. End Sub
  945.  
  946. Sub OutputDevCombo_Click ()
  947.     '
  948.     ' Stop and Close currently opened device (if any)
  949.     '
  950.     'StopPlay
  951. End Sub
  952.  
  953. Sub QueueSong ()
  954.     Select Case MIDIFile1.Format
  955.     Case Is = 0 'MIDI file type 0 (single track)
  956.         QueueSongType0
  957.     Case Is = 1 'MIDI File type 1 (multi track)
  958.         screen.MousePointer = 11
  959.         QueueSongType1
  960.         
  961.     End Select
  962. End Sub
  963.  
  964. Sub QueueSongType0 ()
  965.     Dim m As Integer
  966.     Dim mm As Integer
  967.     Dim I As Integer
  968.     ReDim CurrentTimeQueue(MIDIFile1.NumberOfTracks) As Long
  969.     ReDim PreviousTimeQueue(MIDIFile1.NumberOfTracks) As Long
  970.     ReDim LowestEvent(MIDIFile1.NumberOfTracks) As Long
  971.  
  972.     ReDim TrackDone(1) As Integer
  973.     Dim TracksLoadComplete As Integer
  974.     Dim Startme As Integer
  975.     Dim IncrementAmount As Integer
  976.  
  977.     LowestEvent(1) = 1
  978.     TrackDone(1) = False
  979.  
  980.     LabelTrackName(0) = "Track 1"
  981.     
  982.     IncrementAmount = 1000
  983.  
  984.     screen.MousePointer = 11
  985.  
  986.     Do While TracksLoadComplete = False
  987.     If TrackDone(1) = False Then
  988.         'Increment throught in groups of IncrementAmount events
  989.         If MIDIFile1.MessageCount > LowestEvent(1) + IncrementAmount Then
  990.         mm = LowestEvent(1) + IncrementAmount
  991.         Else
  992.         mm = MIDIFile1.MessageCount
  993.         End If
  994.  
  995.         For m = LowestEvent(1) To mm
  996.         I = DoEvents()
  997.         MIDIFile1.MessageNumber = m
  998.  
  999.         If m = IncrementAmount Then
  1000.             CmdPlay.Enabled = True
  1001.             CmdQueue.Enabled = False
  1002.             CmdStop.Enabled = False
  1003.              screen.MousePointer = 0
  1004.         End If
  1005.         
  1006.         ' Put message data in control
  1007.         MIDIOutput1.Message = MIDIFile1.Message
  1008.         MIDIOutput1.Data1 = MIDIFile1.Data1
  1009.         MIDIOutput1.Data2 = MIDIFile1.Data2
  1010.  
  1011.         'Tag notes to play on keyboard and VU meters
  1012.         If MIDIFile1.Message <= 159 And MIDIFile1.Message >= 144 Then
  1013.             MIDIOutput1.MessageTag = MIDIFile1.Data2 + 1 + (2 * 1000)
  1014.         End If
  1015.  
  1016.         CurrentTimeQueue(1) = PreviousTimeQueue(1) + MIDIFile1.Time
  1017.  
  1018.         MIDIOutput1.Time = Int(CurrentTimeQueue(1) * msPerTick)
  1019.         PreviousTimeQueue(1) = CurrentTimeQueue(1)
  1020.         
  1021.         ' Add to output queue
  1022.         MIDIOutput1.Action = MIDIOUT_QUEUE
  1023.         Next
  1024.         If mm = MIDIFile1.MessageCount Then
  1025.         TrackDone(1) = True
  1026.         TracksLoadComplete = TracksLoadComplete + 1
  1027.         Else
  1028.         LowestEvent(1) = LowestEvent(1) + IncrementAmount + 1
  1029.         End If
  1030.     End If
  1031.     Loop
  1032. End Sub
  1033.  
  1034. Sub QueueSongType1 ()
  1035.     Dim m As Integer
  1036.     Dim mm As Integer
  1037.     Dim Track As Integer
  1038.     Dim I As Integer
  1039.     ReDim CurrentTimeQueue(MIDIFile1.NumberOfTracks) As Long
  1040.     ReDim PreviousTimeQueue(MIDIFile1.NumberOfTracks) As Long
  1041.     ReDim LowestEvent(MIDIFile1.NumberOfTracks) As Long
  1042.  
  1043.     ReDim TrackDone(MIDIFile1.NumberOfTracks) As Integer
  1044.     Dim TracksLoadComplete As Integer
  1045.     Dim Startme As Integer
  1046.     Dim IncrementAmount As Integer
  1047.  
  1048.     For m = 1 To MIDIFile1.NumberOfTracks
  1049.     LowestEvent(m) = 1
  1050.     TrackDone(m) = False
  1051.     Next m
  1052.     
  1053.     'Since first track doesn't need to be queued
  1054.     TracksLoadComplete = 1
  1055.  
  1056.     IncrementAmount = 225
  1057.  
  1058.     Do While TracksLoadComplete < MIDIFile1.NumberOfTracks
  1059.  
  1060.     For Track = 2 To MIDIFile1.NumberOfTracks
  1061.     MIDIFile1.TrackNumber = Track
  1062.     
  1063.     If TrackDone(Track) = False Then
  1064.         'Increment throught in groups of IncrementAmount events
  1065.         If MIDIFile1.MessageCount > LowestEvent(Track) + IncrementAmount Then
  1066.         mm = LowestEvent(Track) + IncrementAmount
  1067.         Else
  1068.         mm = MIDIFile1.MessageCount
  1069.         End If
  1070.  
  1071.         For m = LowestEvent(Track) To mm
  1072.         I = DoEvents()
  1073.         MIDIFile1.MessageNumber = m
  1074.         
  1075.         ' Put message data in control
  1076.         MIDIOutput1.Message = MIDIFile1.Message
  1077.         MIDIOutput1.Data1 = MIDIFile1.Data1
  1078.         MIDIOutput1.Data2 = MIDIFile1.Data2
  1079.  
  1080.         'Tag notes to play on keyboard and VU meters
  1081.         If MIDIFile1.Message <= 159 And MIDIFile1.Message >= 144 Then
  1082.             MIDIOutput1.MessageTag = MIDIFile1.Data2 + 1 + (Track * 1000)
  1083.         End If
  1084.  
  1085.         CurrentTimeQueue(Track) = PreviousTimeQueue(Track) + MIDIFile1.Time
  1086.  
  1087.         MIDIOutput1.Time = Int(CurrentTimeQueue(Track) * msPerTick)
  1088.         PreviousTimeQueue(Track) = CurrentTimeQueue(Track)
  1089.         
  1090.         ' Add to output queue
  1091.         MIDIOutput1.Action = MIDIOUT_QUEUE
  1092.         Next
  1093.         If mm = MIDIFile1.MessageCount Then
  1094.         TrackDone(Track) = True
  1095.         TracksLoadComplete = TracksLoadComplete + 1
  1096.         Else
  1097.         LowestEvent(Track) = LowestEvent(Track) + IncrementAmount + 1
  1098.         End If
  1099.     End If
  1100.     Next
  1101.  
  1102.     'If 225 events have been loaded from each track then
  1103.     'let playback start.
  1104.     If screen.MousePointer = 11 Then
  1105.     screen.MousePointer = 0
  1106.     CmdPlay.Enabled = True
  1107.     CmdQueue.Enabled = False
  1108.     CmdStop.Enabled = False
  1109.     End If
  1110.     Loop
  1111. End Sub
  1112.  
  1113. Sub QueueTrack (Track As Integer)
  1114.     Dim m As Integer
  1115.     Dim I As Integer
  1116.     Dim CurrentTime As Long
  1117.     
  1118.     screen.MousePointer = 11
  1119.  
  1120.     MIDIFile1.TrackNumber = Track
  1121.  
  1122.     For m = 1 To MIDIFile1.MessageCount
  1123.  
  1124.     I = DoEvents()
  1125.     
  1126.     MIDIFile1.MessageNumber = m
  1127.     '
  1128.     'Meta Event
  1129.     '
  1130.     If (MIDIFile1.Message = 255) Then
  1131.         Select Case MIDIFile1.Data1
  1132.         Case 0 To 7, &H7F
  1133.             If (Len(MIDIFile1.Buffer) > 3) Then
  1134.             I = 2
  1135.             Do While (Val("&H" & Mid$(MIDIFile1.Buffer, I, 1)) And &H80)
  1136.                 I = I + 1
  1137.             Loop
  1138.             MIDIFile1.MsgText = Right$(MIDIFile1.Buffer, Len(MIDIFile1.Buffer) - 1)
  1139.             Else
  1140.             MIDIFile1.Buffer = ""
  1141.             End If
  1142.         End Select
  1143.     End If
  1144.     
  1145.     ' Put message data in control
  1146.     MIDIOutput1.Message = MIDIFile1.Message
  1147.     MIDIOutput1.Data1 = MIDIFile1.Data1
  1148.     MIDIOutput1.Data2 = MIDIFile1.Data2
  1149.     
  1150.     ' Set the MessageTag property with the value of the track and velocity
  1151.     ' When the MIDI message is sent from the MIDIOutput, the MessageSent event will
  1152.     ' be fired and the MessageTag is passed.  Examine the MIDIOutput1 MessageSent event
  1153.     ' to see this happening with each message.
  1154.     If MIDIFile1.Message <= 159 And MIDIFile1.Message >= 128 Then
  1155.         MIDIOutput1.MessageTag = MIDIFile1.Data2 + 1 + (MIDIFile1.Message * 1000) + (MIDIFile1.Data1 * 1000000)
  1156.     End If
  1157.  
  1158.     CurrentTime = PreviousTime + MIDIFile1.Time
  1159.  
  1160.     MIDIOutput1.Time = Int(CurrentTime * msPerTick)
  1161.     PreviousTime = CurrentTime
  1162.     '
  1163.     ' Add to output queue
  1164.     '
  1165.     MIDIOutput1.Action = MIDIOUT_QUEUE
  1166.     Next
  1167.     screen.MousePointer = 0
  1168. End Sub
  1169.  
  1170. Sub StartPlay ()
  1171.     OpenOutputDevice
  1172.     MIDIOutput1.Action = MIDIOUT_START
  1173.     CmdPlay.Enabled = False
  1174.     CmdQueue.Enabled = False
  1175.     CmdStop.Enabled = True
  1176. End Sub
  1177.  
  1178. Sub StopPlay ()
  1179.     CmdStop.Enabled = False
  1180.  
  1181.     MIDIOutput1.Action = MIDIOUT_STOP
  1182.     MidiReset
  1183.     CloseOutputDevice
  1184.     
  1185.     CmdPlay.Enabled = False
  1186.     CmdQueue.Enabled = True
  1187. End Sub
  1188.  
  1189. Sub Timer1_Timer ()
  1190.     Dim n As Integer
  1191.     For n = 0 To 11
  1192.     If VIndicator1(n).Value > 0 Then
  1193.        VIndicator1(n).Value = Int(VIndicator1(n).Value / 2 - .5)
  1194.     End If
  1195.     Next
  1196. End Sub
  1197.  
  1198. Sub VSliderVuDecay_Scroll ()
  1199.     Timer1.Interval = VSliderVuDecay.Value
  1200. End Sub
  1201.  
  1202.