-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
191 lines (151 loc) · 10.1 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ConsoleWindow.RichTextBox1.Text = "[Bootstrapper] Console initalized."
DirListBox1.Path = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)
FileListBox1.Path = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)
Try
If My.Computer.Network.Ping("www.google.com") Then
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[NetworkMonitor] Network found, enabling network components."
End If
Catch ex As Exception
'' else ''
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[NetworkMonitor] No network found, disabling network components."
MsgBox("Er is geen internetverbinding gevonden, netwerkonderdelen werkt niet.", MsgBoxStyle.Exclamation, "Waarschuwing")
InternetradiostationsToolStripMenuItem.Enabled = False
AangepasteURLToolStripMenuItem.Enabled = False
End Try
End Sub
Private Sub DirListBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles DirListBox1.SelectedValueChanged
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[FileManager] Changing paths..."
FileListBox1.Path = DirListBox1.Path
End Sub
Private Sub FileListBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles FileListBox1.SelectedValueChanged
If Not String.IsNullOrEmpty(FileListBox1.FileName) Then
Me.Text = "Simplayer: " + FileListBox1.FileName
AxWindowsMediaPlayer1.URL = FileListBox1.Path + "\" + FileListBox1.FileName
End If
End Sub
Private Sub DriveListBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles DriveListBox1.SelectedValueChanged
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[FileManager] Changing drives..."
DirListBox1.Path = DriveListBox1.Drive
FileListBox1.Path = DriveListBox1.Drive
End Sub
Private Sub NPORadio1ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NPORadio1ToolStripMenuItem.Click
Me.Text = "Simplayer: NPO Radio 1"
AxWindowsMediaPlayer1.URL = "https://icecast.omroep.nl/radio1-bb-mp3"
End Sub
Private Sub NPORadio2ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NPORadio2ToolStripMenuItem.Click
Me.Text = "Simplayer: NPO Radio 2"
AxWindowsMediaPlayer1.URL = "https://icecast.omroep.nl/radio2-bb-mp3"
InternetradiostationsToolStripMenuItem.HideDropDown()
End Sub
Private Sub NPORadio3ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NPO3FMToolStripMenuItem.Click
Me.Text = "Simplayer: NPO 3FM"
AxWindowsMediaPlayer1.URL = "https://icecast.omroep.nl/3fm-bb-mp3"
End Sub
Private Sub NPORadio4ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NPORadio4ToolStripMenuItem.Click
Me.Text = "Simplayer: NPO Radio 4"
AxWindowsMediaPlayer1.URL = "https://icecast.omroep.nl/radio4-bb-mp3"
End Sub
Private Sub NPORadio5ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NPORadio5ToolStripMenuItem.Click
Me.Text = "Simplayer: NPO Radio 5"
AxWindowsMediaPlayer1.URL = "https://icecast.omroep.nl/radio5-bb-mp3"
End Sub
Private Sub NPORadio2SoulJazzToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NPORadio2SoulJazzToolStripMenuItem.Click
Me.Text = "Simplayer: NPO Radio 2 Soul & Jazz"
AxWindowsMediaPlayer1.URL = "https://icecast.omroep.nl/radio6-bb-mp3"
End Sub
Private Sub QmusicToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles QmusicToolStripMenuItem.Click
Me.Text = "Simplayer: Qmusic"
AxWindowsMediaPlayer1.URL = "https://stream.qmusic.nl/qmusic/mp3"
End Sub
Private Sub Radio538ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles Radio538ToolStripMenuItem.Click
Me.Text = "Simplayer: Radio 538"
AxWindowsMediaPlayer1.URL = "https://21253.live.streamtheworld.com/RADIO538.mp3"
End Sub
Private Sub SkyRadioToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SkyRadioToolStripMenuItem.Click
Me.Text = "Simplayer: Sky Radio"
AxWindowsMediaPlayer1.URL = "https://19993.live.streamtheworld.com/SKYRADIO.mp3"
End Sub
Private Sub Radio10ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles Radio10ToolStripMenuItem.Click
Me.Text = "Simplayer: Radio 10"
AxWindowsMediaPlayer1.URL = "http://19993.live.streamtheworld.com/RADIO10.mp3"
End Sub
Private Sub RadioVeronicaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VeronicaToolStripMenuItem.Click
Me.Text = "Simplayer: Veronica"
AxWindowsMediaPlayer1.URL = "https://20723.live.streamtheworld.com/VERONICA.mp3"
End Sub
Private Sub DECIBELToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DecibelToolStripMenuItem.Click
Me.Text = "Simplayer: DECIBEL"
AxWindowsMediaPlayer1.URL = "https://stream.decibel.nl/decibel.mp3"
End Sub
Private Sub SLAMToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SLAMToolStripMenuItem.Click
Me.Text = "Simplayer: SLAM!"
AxWindowsMediaPlayer1.URL = "https://stream.slam.nl/slam_mp3"
End Sub
Private Sub WebURLToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AangepasteURLToolStripMenuItem.Click
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Application] Loading Custom URL dialog..."
CustomURL.ShowDialog()
End Sub
Private Sub AxWindowsMediaPlayer1_CurrentItemChange(sender As Object, e As AxWMPLib._WMPOCXEvents_CurrentItemChangeEvent) Handles AxWindowsMediaPlayer1.CurrentItemChange
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Loading item: " & Me.AxWindowsMediaPlayer1.currentMedia.name
End Sub
Private Sub AxWindowsMediaPlayer1_PlayStateChange(sender As Object, e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
Select Case e.newState
Case 1 ' Stopped
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Stopped"
Me.Text = "Simplayer"
Case 2 ' Paused
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Paused"
Case 3 ' Playing
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Playing"
Case 4 ' ScanForward
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Scan Forward"
Case 5 ' ScanReverse
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Scan Reverse"
Case 6 ' Buffering
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Buffering"
Case 7 ' Waiting
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Waiting"
Case 8 ' MediaEnded
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Media Ended"
Case 9 ' Transitioning
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Transitioning"
Case 10 ' Ready
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Ready"
Case 11 ' Reconnecting
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Reconnecting"
Case 12 ' Last
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Last"
Case Else
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Player] Unknown status: " & e.newState
End Select
End Sub
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Sub NetCheckTimer_Tick(sender As Object, e As EventArgs) Handles NetCheckTimer.Tick
If GetActiveWindow <> 0 Then
If My.Computer.Keyboard.AltKeyDown = True Then
ConsoleWindow.Show()
End If
Else
'Application not in focus
End If
End Sub
'Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize
' Button1.Location = New Point(Me.Size.Width - 102, Button1.Location.Y)
'End Sub
'Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Application] Launching console window..."
' ConsoleWindow.Show()
'End Sub
Private Sub ShowConsoleToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ShowConsoleToolStripMenuItem.Click
ConsoleWindow.RichTextBox1.Text = ConsoleWindow.RichTextBox1.Text + Environment.NewLine + "[Application] Launching console window..."
ConsoleWindow.Show()
End Sub
Private Sub HelpToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles HelpToolStripMenuItem1.Click
MsgBox("Coming soon!")
End Sub
Private Sub OverToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OverToolStripMenuItem.Click
MsgBox("Simplayer 1.0.0.0" + vbNewLine + "Gemaakt door MarkPCExpert", MsgBoxStyle.Information, "Over Simplayer")
End Sub
End Class