Option Explicit
Dim Looper1 As Boolean
Dim Looper2 As Boolean
Dim Filename As String
Dim HasTag As Boolean
Dim Tagg As String * 3
Dim Songname As String * 30
Dim Artist As String * 30
Dim Album As String * 30
Dim Year As String * 4
Dim Comment As String * 30
Dim Genre As String * 1
Dim a As String, b As String
Private Sub GetTag(Filename)
Open Filename For Binary As #1
Get #1, FileLen(Filename) - 127, Tagg
If Not Tagg = "TAG" Then
Close #1
HasTag = False
Songname = "No Tag Found"
Artist = "No Tag Found"
Album = "No Tag Found"
Year = "None"
Comment = "No Tag Found"
Genre = "0"
Exit Sub
Else
HasTag = True
Get #1, , Songname
Get #1, , Artist
Get #1, , Album
Get #1, , Year
Get #1, , Comment
Get #1, , Genre
Close #1
End If
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Dir2_Change()
File2.Path = Dir2.Path
End Sub
Private Sub Drive1_Change()
On Error Resume Next
Dir1.Path = Drive1.Drive
End Sub
Private Sub Drive2_Change()
On Error Resume Next
Dir2.Path = Drive2.Drive
End Sub
Private Sub File1_Click()
a = Dir1.Path + "\" + File1.Filename
File1.ToolTipText = File1.Filename
Call GetTag(a)
Artist1.Text = Artist & vbNullChar
Title1.Text = Songname & vbNullChar
Album1.Text = Album & vbNullChar
Year1.Text = Year & vbNullChar
Comment1.Text = Comment & vbNullChar
Artist1.ToolTipText = Artist1.Text
Title1.ToolTipText = Title1.Text
Album1.ToolTipText = Album1.Text
Year1.ToolTipText = Year1.Text
Comment1.ToolTipText = Comment1.Text
End Sub
Private Sub File1_dblClick()
Line1Play.Enabled = True
PosLine1.Enabled = True
Timer8.Enabled = False
tw1.Value = 1
tw2.Value = 1
tw3.Value = 1
tw4.Value = 1
tw5.Value = 1
tw6.Value = 1
tw7.Value = 1
tw8.Value = 1
WMPOCX1.URL = a
Call file("1")
Call Line1Stop_Click
End Sub
Private Sub File2_Click()
b = Dir2.Path + "\" + File2.Filename
File2.ToolTipText = File2.Filename
Call GetTag(b)
Artist2.Text = Artist & vbNullChar
Title2.Text = Songname & vbNullChar
Album2.Text = Album & vbNullChar
Year2.Text = Year & vbNullChar
Comment2.Text = Comment & vbNullChar
Artist2.ToolTipText = Artist2.Text
Title2.ToolTipText = Title2.Text
Album2.ToolTipText = Album2.Text
Year2.ToolTipText = Year2.Text
Comment2.ToolTipText = Comment2.Text
End Sub
Private Sub File2_dblClick()
Line2Play.Enabled = True
PosLine2.Enabled = True
Timer9.Enabled = False
tw1_2.Value = 1
tw2_2.Value = 1
tw3_2.Value = 1
tw4_2.Value = 1
tw5_2.Value = 1
tw6_2.Value = 1
tw7_2.Value = 1
tw8_2.Value = 1
WMPOCX2.URL = b
Call file("2")
Call Line2Stop_Click
End Sub
Private Sub Form_Load()
Me.Caption = App.Title & " vers. " & App.Major & "." & App.Minor & "." & App.Revision & " - By Natamas"
Randomize
Looper1 = True
Looper2 = True
WMPOCX1.settings.autoStart = False
WMPOCX2.settings.autoStart = False
Line1Play.Enabled = False
Line1Stop.Enabled = False
Line2Play.Enabled = False
Line2Stop.Enabled = False
Line1Pause.Enabled = False
Line2Pause.Enabled = False
PosLine1.Enabled = False
PosLine2.Enabled = False
WMPOCX1.settings.volume = -VolumeLine1.Value
WMPOCX2.settings.volume = -VolumeLine2.Value
Positioner1.Text = WMPOCX1.settings.volume
Positioner2.Text = WMPOCX2.settings.volume
End Sub
Private Sub Form_Unload(Cancel As Integer)
WMPOCX1.Controls.stop
WMPOCX2.Controls.stop
Unload Avvio
Unload Me
End
End Sub
Private Sub Label13_Click()
Timer5.Enabled = False
Timer6.Enabled = False
Timer7.Enabled = True
End Sub
Private Sub Label13_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label13.ForeColor = &HFF&
Timer4.Enabled = True
End Sub
Private Sub Label30_Click()
Timer5.Enabled = False
Timer7.Enabled = False
Timer6.Enabled = True
End Sub
Private Sub Label30_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label30.ForeColor = &HFF&
Timer4.Enabled = True
End Sub
Private Sub Label31_Click()
Timer6.Enabled = False
Timer7.Enabled = False
Timer5.Enabled = True
End Sub
Private Sub Label31_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label31.ForeColor = &HFF&
Timer4.Enabled = True
End Sub
Private Sub LabelDownWithCopyright_Click()
Avvio.Label3.Visible = False
Avvio.Show 1
End Sub
Private Sub LabelDownWithCopyright_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
LabelDownWithCopyright.ForeColor = &HFF&
Timer4.Enabled = True
End Sub
Private Sub Line1Pause_Click()
Timer1.Enabled = False
Timer8.Enabled = False
Line1Stop.Enabled = True
Line1Play.Enabled = True
Line1Pause.Enabled = False
WMPOCX1.Controls.pause
End Sub
Private Sub Line2Pause_Click()
Timer2.Enabled = False
Timer9.Enabled = False
Line2Stop.Enabled = True
Line2Play.Enabled = True
Line2Pause.Enabled = False
WMPOCX2.Controls.pause
End Sub
Private Sub Line1Play_Click()
Timer1.Enabled = True
WMPOCX1.Controls.play
'Line1Stop.Enabled = True
'Line1Play.Enabled = False
'Line1Pause.Enabled = True
End Sub
Private Sub Line1Stop_Click()
Timer1.Enabled = False
Timer8.Enabled = False
tw1.Value = 1
tw2.Value = 1
tw3.Value = 1
tw4.Value = 1
tw5.Value = 1
tw6.Value = 1
tw7.Value = 1
tw8.Value = 1
WMPOCX1.Controls.stop
Line1Stop.Enabled = False
Line1Play.Enabled = True
Line1Pause.Enabled = False
Bar1.Value = "0,0001"
PosLine1.Value = 0
Pos1.Text = ""
Left1.Text = ""
Total1.Text = ""
End Sub
Private Sub Line2Play_Click()
Timer2.Enabled = True
WMPOCX2.Controls.play
'Line2Stop.Enabled = True
'Line2Play.Enabled = False
'Line2Pause.Enabled = True
End Sub
Private Sub Line2Stop_Click()
Timer2.Enabled = False
Timer9.Enabled = False
tw1_2.Value = 1
tw2_2.Value = 1
tw3_2.Value = 1
tw4_2.Value = 1
tw5_2.Value = 1
tw6_2.Value = 1
tw7_2.Value = 1
tw8_2.Value = 1
WMPOCX2.Controls.stop
Line2Stop.Enabled = False
Line2Play.Enabled = True
Line2Pause.Enabled = False
Bar2.Value = "0,0001"
PosLine2.Value = 0
Pos2.Text = ""
Left2.Text = ""
Total2.Text = ""
End Sub
Private Sub PosLine1_Change()
Looper1 = True
End Sub
Private Sub PosLine2_Change()
Looper2 = True
End Sub
Private Sub PosLine1_scroll()
WMPOCX1.Controls.currentPosition = PosLine1.Value
Looper1 = False
Timer1.Enabled = True
WMPOCX1.Controls.play
End Sub
Private Sub PosLine2_scroll()
WMPOCX2.Controls.currentPosition = PosLine2.Value
Looper2 = False
Timer2.Enabled = True
WMPOCX2.Controls.play
End Sub
Private Sub Slider1_scroll()
Call slid
End Sub
Private Sub Timer1_Timer()
Bar1.Max = Format(WMPOCX1.currentMedia.duration + 1, "########.")
PosLine1.Max = Format(WMPOCX1.currentMedia.duration + 1, "########.")
Total1.Text = Format(WMPOCX1.currentMedia.duration + 1, "#######0.0")
If WMPOCX1.currentMedia.duration <> 0 Then
If WMPOCX1.Controls.currentPosition = 0 Then
Bar1.Value = "0,0001"
Line1Stop.Enabled = False
Line1Pause.Enabled = False
Line1Play.Enabled = True
Timer8.Enabled = False
tw1.Value = 1
tw2.Value = 1
tw3.Value = 1
tw4.Value = 1
tw5.Value = 1
tw6.Value = 1
tw7.Value = 1
tw8.Value = 1
Else
Bar1.Value = WMPOCX1.Controls.currentPosition
Line1Stop.Enabled = True
Line1Play.Enabled = False
Line1Pause.Enabled = True
Timer8.Enabled = True
End If
If Looper1 Then
PosLine1.Value = WMPOCX1.Controls.currentPosition
End If
Pos1.Text = Format(WMPOCX1.Controls.currentPosition, "#######0.0")
Left1.Text = Format((WMPOCX1.currentMedia.duration + 1) - WMPOCX1.Controls.currentPosition, "#######0.0")
End If
End Sub
Private Sub Timer2_Timer()
Bar2.Max = Format(WMPOCX2.currentMedia.duration + 1, "########.")
PosLine2.Max = Format(WMPOCX2.currentMedia.duration + 1, "########.")
Total2.Text = Format(WMPOCX2.currentMedia.duration + 1, "########0.0")
If WMPOCX2.currentMedia.duration <> 0 Then
If WMPOCX2.Controls.currentPosition = 0 Then
Bar2.Value = "0,0001"
Line2Stop.Enabled = False
Line2Pause.Enabled = False
Line2Play.Enabled = True
Timer9.Enabled = False
tw1_2.Value = 1
tw2_2.Value = 1
tw3_2.Value = 1
tw4_2.Value = 1
tw5_2.Value = 1
tw6_2.Value = 1
tw7_2.Value = 1
tw8_2.Value = 1
Else
Bar2.Value = WMPOCX2.Controls.currentPosition
Line2Stop.Enabled = True
Line2Play.Enabled = False
Line2Pause.Enabled = True
Timer9.Enabled = True
End If
If Looper2 Then
PosLine2.Value = WMPOCX2.Controls.currentPosition
End If
Pos2.Text = Format(WMPOCX2.Controls.currentPosition, "#######0.0")
Left2.Text = Format((WMPOCX2.currentMedia.duration + 1) - WMPOCX2.Controls.currentPosition, "#######0.0")
End If
End Sub
Private Sub Timer3_Timer()
Dim v1 As String, v2 As String
v1 = (VolumeLine1.Value / -1000) * 100
v2 = (VolumeLine2.Value / -1000) * 100
VolumeLine1.ToolTipText = " " & Int(v1) & "% "
VolumeLine2.ToolTipText = " " & Int(v2) & "% "
Slider1.ToolTipText = " " & Int(v1) & "% , " & Int(v2) & "% "
If Slider1.Value > 500 Then
VolumeLine1.Enabled = False
ElseIf Slider1.Value < 500 Then
VolumeLine2.Enabled = False
'Else
' VolumeLine1.Enabled = True
' VolumeLine2.Enabled = True
End If
End Sub
Private Sub Timer4_Timer()
Label13.ForeColor = &H808000
Label30.ForeColor = &H808000
Label31.ForeColor = &H808000
LabelDownWithCopyright.ForeColor = &H808080
Timer4.Enabled = False
End Sub
Private Sub Timer5_Timer()
Slider1.Value = Slider1.Value + 10
Call slid
If Slider1.Value = 1000 Then Timer5.Enabled = False
End Sub
Private Sub Timer6_Timer()
Slider1.Value = Slider1.Value - 10
Call slid
If Slider1.Value = 0 Then Timer6.Enabled = False
End Sub
Private Sub Timer7_Timer()
If Slider1.Value = 500 Then
VolumeLine1.Value = -1000
VolumeLine2.Value = -1000
VolumeLine1.Enabled = True
VolumeLine2.Enabled = True
Timer7.Enabled = False
ElseIf Slider1.Value < 500 Then
Slider1.Value = Slider1.Value + 10
VolumeLine1.Value = -1000
VolumeLine2.Value = -2 * Slider1.Value
VolumeLine1.Enabled = True
If Slider1.Value > 500 Then
Timer7.Enabled = False
Slider1.Value = 500
VolumeLine1.Value = -1000
VolumeLine2.Value = -2 * Slider1.Value
End If
ElseIf Slider1.Value > 500 Then
Slider1.Value = Slider1.Value - 10
VolumeLine1.Value = -1000 + (2 * (Slider1.Value - 500))
VolumeLine2.Value = -1000
VolumeLine2.Enabled = True
If Slider1.Value < 500 Then
Timer7.Enabled = False
Slider1.Value = 500
VolumeLine1.Value = -1000 + (2 * (Slider1.Value - 500))
VolumeLine2.Value = -1000
End If
End If
WMPOCX1.settings.volume = -VolumeLine1.Value / 10
WMPOCX2.settings.volume = -VolumeLine2.Value / 10
Positioner1.Text = WMPOCX1.settings.volume
Positioner2.Text = WMPOCX2.settings.volume
End Sub
Private Sub Timer8_Timer()
Dim twr1 As Long, twr2 As Long, twr3 As Long, twr4 As Long, twr5 As Long, twr6 As Long, twr7 As Long, twr8 As Long
twr1 = Int(999 * Rnd)
twr2 = Int(999 * Rnd)
twr3 = Int(999 * Rnd)
twr4 = Int(999 * Rnd)
twr5 = Int(999 * Rnd)
twr6 = Int(999 * Rnd)
twr7 = Int(999 * Rnd)
twr8 = Int(999 * Rnd)
If twr1 = 0 Then twr1 = 1
If twr2 = 0 Then twr2 = 1
If twr3 = 0 Then twr3 = 1
If twr4 = 0 Then twr4 = 1
If twr5 = 0 Then twr5 = 1
If twr6 = 0 Then twr6 = 1
If twr7 = 0 Then twr7 = 1
If twr8 = 0 Then twr8 = 1
tw1.Value = twr1
tw2.Value = twr2
tw3.Value = twr3
tw4.Value = twr4
tw5.Value = twr5
tw6.Value = twr6
tw7.Value = twr7
tw8.Value = twr8
End Sub
Private Sub Timer9_Timer()
Dim twr1_2 As Long, twr2_2 As Long, twr3_2 As Long, twr4_2 As Long, twr5_2 As Long, twr6_2 As Long, twr7_2 As Long, twr8_2 As Long
twr1_2 = Int(999 * Rnd)
twr2_2 = Int(999 * Rnd)
twr3_2 = Int(999 * Rnd)
twr4_2 = Int(999 * Rnd)
twr5_2 = Int(999 * Rnd)
twr6_2 = Int(999 * Rnd)
twr7_2 = Int(999 * Rnd)
twr8_2 = Int(999 * Rnd)
If twr1_2 = 0 Then twr1_2 = 1
If twr2_2 = 0 Then twr2_2 = 1
If twr3_2 = 0 Then twr3_2 = 1
If twr4_2 = 0 Then twr4_2 = 1
If twr5_2 = 0 Then twr5_2 = 1
If twr6_2 = 0 Then twr6_2 = 1
If twr7_2 = 0 Then twr7_2 = 1
If twr8_2 = 0 Then twr8_2 = 1
tw1_2.Value = twr1_2
tw2_2.Value = twr2_2
tw3_2.Value = twr3_2
tw4_2.Value = twr4_2
tw5_2.Value = twr5_2
tw6_2.Value = twr6_2
tw7_2.Value = twr7_2
tw8_2.Value = twr8_2
End Sub
Private Sub VolumeLine1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Slider1.Value > 500 Then
VolumeLine1.Enabled = False
Else
VolumeLine1.Enabled = True
End If
End Sub
Private Sub VolumeLine1_scroll()
WMPOCX1.settings.volume = -VolumeLine1.Value / 10
Positioner1.Text = WMPOCX1.settings.volume
End Sub
Private Sub VolumeLine2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Slider1.Value < 500 Then
VolumeLine2.Enabled = False
Else
VolumeLine2.Enabled = True
End If
End Sub
Private Sub VolumeLine2_scroll()
WMPOCX2.settings.volume = -VolumeLine2.Value / 10
Positioner2.Text = WMPOCX2.settings.volume
End Sub
Sub slid()
If Slider1.Value = 500 Then
VolumeLine1.Value = -1000
VolumeLine2.Value = -1000
VolumeLine1.Enabled = True
VolumeLine2.Enabled = True
ElseIf Slider1.Value < 500 Then
VolumeLine1.Value = -1000
VolumeLine2.Value = -2 * Slider1.Value
VolumeLine1.Enabled = True
ElseIf Slider1.Value > 500 Then
VolumeLine1.Value = -1000 + (2 * (Slider1.Value - 500))
VolumeLine2.Value = -1000
VolumeLine2.Enabled = True
End If
WMPOCX1.settings.volume = -VolumeLine1.Value / 10
WMPOCX2.settings.volume = -VolumeLine2.Value / 10
Positioner1.Text = WMPOCX1.settings.volume
Positioner2.Text = WMPOCX2.settings.volume
End Sub
Sub file(parte)
If parte = 1 Then
file1_sel.Text = File1.Filename
file1_sel.ToolTipText = file1_sel.Text
ElseIf parte = 2 Then
file2_sel.Text = File2.Filename
file2_sel.ToolTipText = file2_sel.Text
End If
Exit Sub
End Sub