forked from sayohnahilan/Casino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Music.vb
78 lines (65 loc) · 2.76 KB
/
Music.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
Public Class Music
Dim ResourceFilePathPrefix As String
Dim mysong As String
Private Sub Jazz_Click(sender As Object, e As EventArgs) Handles Jazz.Click
'Play song
mysong = ResourceFilePathPrefix & "Jazz.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
End Sub
Private Sub Casino_Click(sender As Object, e As EventArgs) Handles Casino.Click
'Play song
mysong = ResourceFilePathPrefix & "SlowJazz.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
End Sub
Private Sub Rock_Click(sender As Object, e As EventArgs) Handles Rock.Click
'Play song
mysong = ResourceFilePathPrefix & "Rock.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
'let them know
MsgBox("Wait 30 secs for the beat drop.")
End Sub
Private Sub Play_Click(sender As Object, e As EventArgs)
'start game
Me.Hide()
BlackJack.Show()
End Sub
Private Sub Home_Click(sender As Object, e As EventArgs) Handles Hom.Click
'back to home
Me.Hide()
Home.Show()
End Sub
Private Sub Music_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'pretty
InstructionHeader.Parent = Background
'load sound
If System.Diagnostics.Debugger.IsAttached() Then
'In Debugging mode
ResourceFilePathPrefix = System.IO.Path.GetFullPath(Application.StartupPath & "\..\..\Resources\Music\")
Else
'In Published mode
ResourceFilePathPrefix = Application.StartupPath & "\Resources\Music\"
End If
'Play song
mysong = ResourceFilePathPrefix & "SlowJazz.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
End Sub
Private Sub Pop_Click(sender As Object, e As EventArgs) Handles Pop.Click
'Play song
mysong = ResourceFilePathPrefix & "Pop.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
End Sub
Private Sub Classical_Click(sender As Object, e As EventArgs) Handles Classical.Click
'Play song
mysong = ResourceFilePathPrefix & "Classical.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
End Sub
Private Sub Reggae_Click(sender As Object, e As EventArgs) Handles Reggae.Click
'Play song
mysong = ResourceFilePathPrefix & "Reggae.wav"
My.Computer.Audio.Play(mysong, AudioPlayMode.BackgroundLoop)
End Sub
Private Sub stop7_Click(sender As Object, e As EventArgs) Handles stop7.Click
'Stop playing music
My.Computer.Audio.Stop()
End Sub
End Class