VERSION 5.00 Begin VB.Form Form1 Caption = "remote control 50-button demo" ClientHeight = 5208 ClientLeft = 60 ClientTop = 348 ClientWidth = 6816 Icon = "manybutt.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 434 ScaleMode = 3 'Pixel ScaleWidth = 568 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton Command1 Height = 375 Index = 49 Left = 6240 TabIndex = 70 Top = 2040 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 48 Left = 5640 TabIndex = 69 Top = 2040 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 47 Left = 5040 TabIndex = 68 Top = 2040 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 46 Left = 4440 TabIndex = 67 Top = 2040 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 45 Left = 3840 TabIndex = 66 Top = 2040 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 44 Left = 3240 TabIndex = 65 Top = 2040 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 43 Left = 6240 TabIndex = 64 Top = 1560 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 42 Left = 5640 TabIndex = 63 Top = 1560 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 41 Left = 5040 TabIndex = 62 Top = 1560 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 40 Left = 4440 TabIndex = 61 Top = 1560 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 39 Left = 3840 TabIndex = 60 Top = 1560 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 38 Left = 3240 TabIndex = 59 Top = 1560 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 37 Left = 6240 TabIndex = 58 Top = 1080 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 36 Left = 5640 TabIndex = 57 Top = 1080 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 35 Left = 5040 TabIndex = 56 Top = 1080 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 34 Left = 4440 TabIndex = 55 Top = 1080 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 33 Left = 3840 TabIndex = 54 Top = 1080 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 32 Left = 3240 TabIndex = 53 Top = 1080 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 31 Left = 6240 TabIndex = 52 Top = 600 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 30 Left = 5640 TabIndex = 51 Top = 600 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 29 Left = 5040 TabIndex = 50 Top = 600 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 28 Left = 4440 TabIndex = 49 Top = 600 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 27 Left = 3840 TabIndex = 48 Top = 600 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 26 Left = 3240 TabIndex = 47 Top = 600 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 25 Left = 6240 TabIndex = 46 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 24 Left = 5640 TabIndex = 45 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 23 Left = 5040 TabIndex = 44 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 22 Left = 4440 TabIndex = 43 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 21 Left = 3840 TabIndex = 42 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 375 Index = 20 Left = 3240 TabIndex = 41 Top = 120 Width = 492 End Begin VB.CheckBox Check1 Caption = "Samples locked" Height = 255 Left = 4920 TabIndex = 40 ToolTipText = "you must uncheck this to collect or change samples - prevents accidental modification" Top = 4560 Value = 1 'Checked Width = 1575 End Begin VB.CommandButton Command2 Caption = "20 buttons / 50 buttons / 50 + controls" Height = 255 Left = 120 TabIndex = 39 ToolTipText = "Show more or less screen junk and access sample controls" Top = 2520 Width = 2895 End Begin VB.CommandButton Command1 Height = 492 Index = 19 Left = 2520 TabIndex = 38 Top = 1920 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 18 Left = 1920 TabIndex = 37 Top = 1920 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 17 Left = 1320 TabIndex = 36 Top = 1920 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 16 Left = 720 TabIndex = 35 Top = 1920 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 15 Left = 120 TabIndex = 34 Top = 1920 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 14 Left = 2520 TabIndex = 33 Top = 1320 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 13 Left = 1920 TabIndex = 32 Top = 1320 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 12 Left = 1320 TabIndex = 31 Top = 1320 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 11 Left = 720 TabIndex = 30 Top = 1320 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 10 Left = 120 TabIndex = 29 Top = 1320 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 9 Left = 2520 TabIndex = 28 Top = 720 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 8 Left = 1920 TabIndex = 27 Top = 720 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 7 Left = 1320 TabIndex = 26 Top = 720 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 6 Left = 720 TabIndex = 25 Top = 720 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 5 Left = 120 TabIndex = 24 Top = 720 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 4 Left = 2520 TabIndex = 23 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 3 Left = 1920 TabIndex = 22 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 2 Left = 1320 TabIndex = 21 Top = 120 Width = 492 End Begin VB.CommandButton Command1 Height = 492 Index = 1 Left = 720 TabIndex = 20 Top = 120 Width = 492 End Begin VB.CommandButton Command4 Caption = "Refresh Captions" Height = 492 Left = 4920 TabIndex = 19 ToolTipText = "you must click this after collecting or changing sample to make changes visible" Top = 3360 Width = 852 End Begin VB.CommandButton Command9 Caption = "Restore Defaults" Height = 492 Left = 4920 TabIndex = 18 ToolTipText = "restores the three sliders to factory defaults" Top = 3960 Width = 852 End Begin VB.TextBox Text3 Alignment = 2 'Center DataSource = "HScroll3" Height = 288 Left = 4320 TabIndex = 14 Text = "Text3" Top = 3360 Width = 492 End Begin VB.TextBox Text2 Alignment = 2 'Center DataSource = "HScroll2" Height = 288 Left = 4320 TabIndex = 13 Text = "Text2" Top = 3960 Width = 492 End Begin VB.HScrollBar HScroll3 Height = 252 LargeChange = 200 Left = 2160 Max = 5000 Min = 1500 SmallChange = 20 TabIndex = 12 Top = 3360 Value = 2560 Width = 2052 End Begin VB.HScrollBar HScroll2 Height = 252 LargeChange = 200 Left = 2160 Max = 4898 Min = 700 SmallChange = 20 TabIndex = 11 Top = 3960 Value = 1500 Width = 2052 End Begin VB.TextBox Text1 Alignment = 2 'Center DataSource = "HScroll1" Height = 288 Left = 4320 TabIndex = 9 Text = "Text1" Top = 4560 Width = 372 End Begin VB.HScrollBar HScroll1 Height = 252 LargeChange = 10 Left = 2160 Max = 200 Min = 50 TabIndex = 8 Top = 4560 Value = 100 Width = 2052 End Begin VB.Frame Frame1 Caption = "Select COM Port" Height = 1812 Left = 240 TabIndex = 3 ToolTipText = "select a valid COM port to tell the sampler software where your sample or playback hardware lives" Top = 3240 Width = 1572 Begin VB.OptionButton Option4 Caption = "COM4" Height = 372 Left = 120 TabIndex = 7 Top = 1320 Width = 975 End Begin VB.OptionButton Option3 Caption = "COM3" Height = 372 Left = 120 TabIndex = 6 Top = 960 Width = 975 End Begin VB.OptionButton Option2 Caption = "COM2" Height = 372 Left = 120 TabIndex = 5 Top = 600 Width = 975 End Begin VB.OptionButton Option1 Caption = "COM1" Height = 372 Left = 120 TabIndex = 4 Top = 240 Width = 975 End End Begin VB.CommandButton Command8 Caption = "Help Screen" Height = 492 Left = 5880 TabIndex = 2 ToolTipText = "bring up dos mode help screen" Top = 3960 Width = 852 End Begin VB.CommandButton Command7 Caption = "Sample Screen" Height = 492 Left = 5880 TabIndex = 1 ToolTipText = "bring up sampler software in dos screen - diagnostic mode" Top = 3360 Width = 852 End Begin VB.CommandButton Command1 Height = 492 Index = 0 Left = 120 TabIndex = 0 Top = 120 Width = 492 End Begin VB.Label Label6 Alignment = 2 'Center Caption = "another 30 buttons if first 20 not enough" Height = 255 Left = 3360 TabIndex = 72 Top = 2520 Width = 3375 End Begin VB.Label Label5 Caption = "remember to hit 'refresh captions' after grabbing each sample" Height = 255 Left = 2040 TabIndex = 71 Top = 2880 Width = 4695 End Begin VB.Label Label4 Alignment = 2 'Center Caption = "read the docs before changing" Height = 252 Left = 2160 TabIndex = 17 Top = 4920 Width = 2532 End Begin VB.Label Label3 Alignment = 2 'Center Caption = "sample size" Height = 252 Left = 2280 TabIndex = 16 Top = 3120 Width = 1812 End Begin VB.Label Label2 Alignment = 2 'Center Caption = "position of timeout cursor" Height = 252 Left = 2280 TabIndex = 15 Top = 3720 Width = 1812 End Begin VB.Label Label1 Alignment = 2 'Center Caption = "chars for sample timeout" Height = 252 Left = 2280 TabIndex = 10 Top = 4320 Width = 1812 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim c$, p$, s$, t$, filename$ Dim buttonxset(50) Dim smallview Private Sub Check1_Click() If Check1.Value = 1 Then Check1.Caption = "samples locked" Else Check1.Caption = "samples unlocked" End If End Sub 'Sub Command1_Click() 'Call Shell("winsamp.exe butt1.but q" + c$ + p$ + s$ + t$, 2) 'End Sub Private Sub Command1_MouseUp(index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single) filename = "butt" + Right$(Str$(index + 1), Len(Str$(index + 1)) - 1) + ".but" If Shift = 0 And Button = 1 And buttonxset(index) = 1 Then Call Shell("winsamp.exe " + filename + c$, 2) End If If Shift = 1 And Button = 1 And Check1.Value = 0 Then Call Shell("winsamp.exe " + filename + " q" + c$ + p$ + s$ + t$, 2) End If If Button = 2 And buttonxset(index) = 1 And Check1.Value = 0 Then Call Shell("notepad.exe " + filename, 1) End If End Sub Private Sub buttonupdate() For x = 0 To 49 getbuttonfile (x) Next x End Sub Private Sub getbuttonfile(x) On Error GoTo badfile Command1(x).Caption = "" Command1(x).ToolTipText = "command button number" + Str$(x + 1) + " is not set - shift-leftmousebutton to sample" buttonxset(x) = 0 filename = "butt" + Right$(Str$(x + 1), Len(Str$(x + 1)) - 1) + ".but" myfile = FreeFile Open filename For Input As myfile Input #myfile, but1string Close #myfile If Len(but1string) < 10 Then Command1(x).ToolTipText = "no tooltip set - rightmousebutton to edit" Else Command1(x).ToolTipText = Right$(but1string, Len(but1string) - 9) End If Command1(x).Caption = Trim$(Left$(but1string, 9)) buttonxset(x) = 1 badfile: Close End Sub Private Sub Command2_Click() smallview = smallview + 1 If smallview > 2 Then smallview = 0 If smallview = 0 Then Form1.Width = 6930 Form1.Height = 5610 End If If smallview = 1 Then Form1.Width = 6930 * (210 / 454) Form1.Height = 5610 * (200 / 347) End If If smallview = 2 Then Form1.Width = 6930 Form1.Height = 5610 * (200 / 347) End If End Sub Private Sub Command4_Click() buttonupdate End Sub Sub Command7_Click() Call Shell("winsamp.exe" + c$ + p$ + s$ + t$, 3) End Sub Sub Command8_Click() Call Shell("winsamp.exe ?", 3) End Sub Sub Command9_Click() Text1.Text = Trim(Str$(100)) Text2.Text = Trim(Str$(1500)) Text3.Text = Trim(Str$(2560)) HScroll1.Value = 100 HScroll2.Value = 1500 HScroll3.Value = 2560 End Sub Sub Form_Load() c$ = GetSetting(appname:="threebut", section:="Startup", Key:="port", Default:=" C2") p$ = GetSetting(appname:="threebut", section:="Startup", Key:="silentcount", Default:=" !100") s$ = GetSetting(appname:="threebut", section:="Startup", Key:="samplesize", Default:=" =2560") t$ = GetSetting(appname:="threebut", section:="Startup", Key:="timeoutcursorposition", Default:=" +1500") smallview = Val(GetSetting(appname:="threebut", section:="Startup", Key:="formsize", Default:="0")) If smallview = 0 Then Form1.Width = 6930 Form1.Height = 5610 End If If smallview = 1 Then Form1.Width = 6930 * (210 / 454) Form1.Height = 5610 * (200 / 347) End If If smallview = 2 Then Form1.Width = 6930 Form1.Height = 5610 * (200 / 347) End If If c$ = " C1" Then Option1.Value = True End If If c$ = " C2" Then Option2.Value = True End If If c$ = " C3" Then Option3.Value = True End If If c$ = " C4" Then Option4.Value = True End If 'p$ = " !" + Trim(Str$(100)) 's$ = " =" + Trim(Str$(2560)) 't$ = " +" + Trim(Str$(1500)) Text1.Text = Right$(p$, (Len(p$) - 2)) Text2.Text = Right$(t$, (Len(t$) - 2)) Text3.Text = Right$(s$, (Len(s$) - 2)) HScroll1.Value = Val(Text1.Text) HScroll2.Value = Val(Text2.Text) HScroll3.Value = Val(Text3.Text) buttonupdate End Sub Private Sub Form_Unload(Cancel As Integer) SaveSetting "threebut", "Startup", "port", c$ SaveSetting "threebut", "Startup", "silentcount", p$ SaveSetting "threebut", "Startup", "samplesize", s$ SaveSetting "threebut", "Startup", "timeoutcursorposition", t$ SaveSetting "threebut", "Startup", "formsize", Str$(smallview) End Sub Sub HScroll1_Change() 'controls the minimum silent chars for timeout p$ = " !" + Trim(Str$(HScroll1.Value)) Text1.Text = Trim(Str$(HScroll1.Value)) End Sub Sub HScroll2_Change() 'controls the timeout cursor position t$ = " +" + Trim(Str$(HScroll2.Value)) Text2.Text = Trim(Str$(HScroll2.Value)) End Sub Sub HScroll3_Change() 'controls the size of the sample s$ = " =" + Trim(Str$(HScroll3.Value)) Text3.Text = Trim(Str$(HScroll3.Value)) End Sub Sub Option1_Click() c$ = " C1" End Sub Sub Option2_Click() c$ = " C2" End Sub Sub Option3_Click() c$ = " C3" End Sub Sub Option4_Click() c$ = " C4" End Sub