home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / Free / Prg / modcontrol.exe / tst.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-10-23  |  4.9 KB  |  170 lines

  1. VERSION 5.00
  2. Object = "{9A2F8DF9-6A84-11D2-B62A-00201853CFCC}#4.0#0"; "MODControl.ocx"
  3. Begin VB.Form frmTst 
  4.    Caption         =   "THEMA MIDAS MODControl example program"
  5.    ClientHeight    =   4950
  6.    ClientLeft      =   60
  7.    ClientTop       =   330
  8.    ClientWidth     =   5310
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   4950
  11.    ScaleWidth      =   5310
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.HScrollBar HScroll1 
  14.       Height          =   210
  15.       LargeChange     =   10
  16.       Left            =   900
  17.       Max             =   100
  18.       TabIndex        =   7
  19.       Top             =   4650
  20.       Value           =   100
  21.       Width           =   4245
  22.    End
  23.    Begin VB.CommandButton Command1 
  24.       Caption         =   "Play Module"
  25.       BeginProperty Font 
  26.          Name            =   "Arial"
  27.          Size            =   9.75
  28.          Charset         =   0
  29.          Weight          =   700
  30.          Underline       =   0   'False
  31.          Italic          =   0   'False
  32.          Strikethrough   =   0   'False
  33.       EndProperty
  34.       Height          =   495
  35.       Left            =   165
  36.       TabIndex        =   5
  37.       Top             =   3930
  38.       Width           =   5010
  39.    End
  40.    Begin VB.FileListBox File1 
  41.       Height          =   3210
  42.       Left            =   2385
  43.       Pattern         =   "*.mod;*.xm"
  44.       TabIndex        =   4
  45.       Top             =   645
  46.       Width           =   2820
  47.    End
  48.    Begin VB.DirListBox Dir1 
  49.       Height          =   2790
  50.       Left            =   105
  51.       TabIndex        =   3
  52.       Top             =   1035
  53.       Width           =   2205
  54.    End
  55.    Begin VB.DriveListBox Drive1 
  56.       Height          =   315
  57.       Left            =   105
  58.       TabIndex        =   2
  59.       Top             =   630
  60.       Width           =   2220
  61.    End
  62.    Begin MODControl.MODCtrl MODCtrl1 
  63.       Left            =   180
  64.       Top             =   690
  65.       _ExtentX        =   8890
  66.       _ExtentY        =   5530
  67.    End
  68.    Begin VB.Label Label3 
  69.       Caption         =   "Volume:"
  70.       BeginProperty Font 
  71.          Name            =   "Arial"
  72.          Size            =   8.25
  73.          Charset         =   0
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       Height          =   210
  80.       Left            =   165
  81.       TabIndex        =   6
  82.       Top             =   4650
  83.       Width           =   780
  84.    End
  85.    Begin VB.Label Label2 
  86.       Caption         =   "Special thankx to HouseMarque and David Brebner"
  87.       BeginProperty Font 
  88.          Name            =   "Arial"
  89.          Size            =   8.25
  90.          Charset         =   0
  91.          Weight          =   700
  92.          Underline       =   0   'False
  93.          Italic          =   0   'False
  94.          Strikethrough   =   0   'False
  95.       EndProperty
  96.       Height          =   240
  97.       Left            =   120
  98.       TabIndex        =   1
  99.       Top             =   300
  100.       Width           =   5115
  101.    End
  102.    Begin VB.Label Label1 
  103.       Caption         =   "by Maarten van Gompel"
  104.       BeginProperty Font 
  105.          Name            =   "Arial"
  106.          Size            =   8.25
  107.          Charset         =   0
  108.          Weight          =   700
  109.          Underline       =   0   'False
  110.          Italic          =   0   'False
  111.          Strikethrough   =   0   'False
  112.       EndProperty
  113.       Height          =   240
  114.       Left            =   105
  115.       TabIndex        =   0
  116.       Top             =   45
  117.       Width           =   3390
  118.    End
  119. Attribute VB_Name = "frmTst"
  120. Attribute VB_GlobalNameSpace = False
  121. Attribute VB_Creatable = False
  122. Attribute VB_PredeclaredId = True
  123. Attribute VB_Exposed = False
  124. Dim Playing As Boolean
  125. Private Sub Command1_Click()
  126. Dim File As String
  127. If Command1.Caption = "Play Module" Then
  128. 'Set File
  129. If Len(Dir1.Path) = 3 Then
  130.  File = Dir1.Path + File1.filename
  131.  File = Dir1.Path + "\" + File1.filename
  132. End If
  133. 'Load File into MODControl
  134. MODCtrl1.LoadModule File
  135. 'Play Loaded File
  136. MODCtrl1.PlayModule False
  137. Playing = True
  138. 'Change text of button
  139. Command1.Caption = "Stop Module"
  140. ElseIf Command1.Caption = "Stop Module" Then
  141. Command1.Caption = "Play Module"
  142. 'Stop the module
  143. MODCtrl1.StopModule
  144. Playing = False
  145. End If
  146. End Sub
  147. Private Sub Dir1_Change()
  148. File1.Path = Dir1.Path
  149. End Sub
  150. Private Sub Drive1_Change()
  151. On Error Resume Next
  152. Dir1.Path = Drive1.Drive
  153. End Sub
  154. Private Sub Form_Load()
  155. 'Initialize MODControl, very important!
  156. MODCtrl1.Initialize
  157. End Sub
  158. Private Sub Form_Unload(Cancel As Integer)
  159. 'DeActivate MODControl, very important!
  160. MODCtrl1.Deactivate
  161. End Sub
  162. Private Sub HScroll1_Change()
  163. Dim Volume As Long
  164. If Playing Then
  165.  Volume = HScroll1.Value
  166.  'set volume
  167.  MODCtrl1.SetVolume Volume
  168. End If
  169. End Sub
  170.