home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD102739292000.psc / modMain.bas < prev    next >
Encoding:
BASIC Source File  |  2000-09-29  |  2.5 KB  |  81 lines

  1. Attribute VB_Name = "modMain"
  2. Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
  3. Declare Function timeGetTime Lib "winmm.dll" () As Long
  4. Public BenchStart As Long
  5. Public eByte(399) As Byte, EPos As Long
  6.  
  7. Private Type PatchSaveStructure
  8. Knobs(19) As Integer
  9. Checks(1) As Byte
  10. ComboText(1) As String * 30
  11. End Type: Dim PSS As PatchSaveStructure
  12.  
  13. Public Function RndRange(ByVal Min As Single, ByVal Max As Single) As Single
  14. 'This Function Generates a Random number between 2 numbers.
  15. RndRange = (Rnd * (Max - Min + 1)) + Min
  16. End Function
  17.  
  18. Sub SavePatch(Filename As String)
  19. PSS.Knobs(0) = Form1.Knob1.KnobValue
  20. PSS.Knobs(1) = Form1.Knob2.KnobValue
  21. PSS.Knobs(2) = Form1.Knob3.KnobValue
  22. PSS.Knobs(3) = Form1.Knob4.KnobValue
  23. PSS.Knobs(4) = Form1.Knob5.KnobValue
  24. PSS.Knobs(5) = Form1.Knob6.KnobValue
  25. PSS.Knobs(6) = Form1.Knob7.KnobValue
  26. PSS.Knobs(7) = Form1.Knob8.KnobValue
  27. PSS.Knobs(8) = Form1.Knob9.KnobValue
  28. PSS.Knobs(9) = Form1.Knob10.KnobValue
  29. PSS.Knobs(10) = Form1.Knob11.KnobValue
  30. PSS.Knobs(11) = Form1.Knob12.KnobValue
  31. PSS.Knobs(12) = Form1.Knob13.KnobValue
  32. PSS.Knobs(13) = Form1.Knob14.KnobValue
  33. PSS.Knobs(14) = Form1.Knob15.KnobValue
  34. PSS.Knobs(15) = Form1.Knob16.KnobValue
  35. PSS.Knobs(16) = Form1.Knob17.KnobValue
  36. PSS.Knobs(17) = Form1.Knob18.KnobValue
  37. PSS.Knobs(18) = Form1.Knob19.KnobValue
  38. PSS.Knobs(19) = Form1.Knob20.KnobValue
  39. PSS.Checks(0) = Form1.EC.Value
  40. PSS.Checks(1) = Form1.WCE.Value
  41. PSS.ComboText(0) = Form1.FX1.Text
  42. PSS.ComboText(1) = Form1.FX2.Text
  43.  
  44. Open Filename For Binary As #1
  45. Put #1, , PSS
  46. Put #1, , eByte()
  47. Close #1
  48. End Sub
  49.  
  50. Sub LoadPatch(Filename As String)
  51. Open Filename For Binary As #1
  52. Get #1, , PSS
  53. Get #1, , eByte()
  54. Close #1
  55.  
  56. Form1.Knob1.SetVal PSS.Knobs(0)
  57. Form1.Knob2.SetVal PSS.Knobs(1)
  58. Form1.Knob3.SetVal PSS.Knobs(2)
  59. Form1.Knob4.SetVal PSS.Knobs(3)
  60. Form1.Knob5.SetVal PSS.Knobs(4)
  61. Form1.Knob6.SetVal PSS.Knobs(5)
  62. Form1.Knob7.SetVal PSS.Knobs(6)
  63. Form1.Knob8.SetVal PSS.Knobs(7)
  64. Form1.Knob9.SetVal PSS.Knobs(8)
  65. Form1.Knob10.SetVal PSS.Knobs(9)
  66. Form1.Knob11.SetVal PSS.Knobs(10)
  67. Form1.Knob12.SetVal PSS.Knobs(11)
  68. Form1.Knob13.SetVal PSS.Knobs(12)
  69. Form1.Knob14.SetVal PSS.Knobs(13)
  70. Form1.Knob15.SetVal PSS.Knobs(14)
  71. Form1.Knob16.SetVal PSS.Knobs(15)
  72. Form1.Knob17.SetVal PSS.Knobs(16)
  73. Form1.Knob18.SetVal PSS.Knobs(17)
  74. Form1.Knob19.SetVal PSS.Knobs(18)
  75. Form1.Knob20.SetVal PSS.Knobs(19)
  76. Form1.EC.Value = PSS.Checks(0)
  77. Form1.WCE.Value = PSS.Checks(1)
  78. Form1.FX1.Text = Trim(PSS.ComboText(0))
  79. Form1.FX2.Text = Trim(PSS.ComboText(1))
  80. End Sub
  81.