Posted: Wed Oct 24, 2007 11:30 am Post subject: messenger 4.7 advanced what im listening to beta
Code:
Option Explicit
Public WithEvents msn As MsgrObject
Private Type TagInfo
Tag As String * 3
Songname As String * 30
artist As String * 30
album As String * 30
year As String * 4
End Type
Dim filename As String
Dim CurrentTag As TagInfo
Function Play()
'//Decode The MP3
On Error Resume Next
filename = List1.Text
Open filename For Binary As #1
With CurrentTag
Get #1, FileLen(filename) - 127, .Tag
If Not .Tag = "TAG" Then
Close #1
' Exit Sub
End If
Get #1, , .Songname
Get #1, , .artist
Get #1, , .album
Get #1, , .year
Close #1
'//Set The Messenger Display Name To Song Info
On Error Resume Next
msn.Services.PrimaryService.friendlyName = " Currently Listening to :/ " & " Album : " & stralbum.Text & " / Song: " & strsongname.Text & " / Artist: " & strartist.Text & " / Year : " & stryear.Text & "/ Duration: " & "0" & Label4.Caption & ":" & Label5.Caption & "/" & WindowsMediaPlayer1.currentMedia.durationString
End Function
Private Sub Form_Load()
'// set messnger object blah blah
On Error Resume Next
Set msn = New MsgrObject
'// Centering the form
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
'// set timer to a interval it can change your name without getting flagged
Timer1.Interval = 7500
End Sub
Private Sub KewlButtons1_Click()
'//play the song
Call Play
End Sub
Private Sub KewlButtons2_Click()
'//move forward a track
List1.ListIndex = List1.ListIndex + 1
Call Play
End Sub
Private Sub KewlButtons3_Click()
'//move back a track
List1.ListIndex = List1.ListIndex - 1
Call Play
End Sub
Private Sub KewlButtons4_Click()
'// Load An MP3 Into List1
CommonDialog1.DialogTitle = "Load An MP3."
CommonDialog1.filename = ""
CommonDialog1.Filter = "MP3 Format|*.MP3"
CommonDialog1.ShowOpen
If CommonDialog1.FileTitle <> "" Then
List1.AddItem CommonDialog1.filename
Exit Sub
Else
Exit Sub
End If
End Sub
Private Sub KewlButtons5_Click()
'//Kill The Program
Unload Me
End Sub
Private Sub msn_OnTextReceived(ByVal pIMSession As Messenger.IMsgrIMSession, ByVal User As Messenger.IMsgrUser, ByVal bstrMsgHeader As String, ByVal bstrMsgText As String, pfEnableDefault As Boolean)
'//send the name of the song if they send '!song'
Select Case bstrMsgText
Case "!song"
User.SendText bstrMsgHeader, Text3.Text, MMSGTYPE_ALL_RESULTS
End Select
End Sub
Private Sub Slider1_Click()
'//Change song volume
WindowsMediaPlayer1.settings.volume = Slider1.Value
End Sub
Private Sub Slider3_Click()
'// set the speed of song ex.(playrate x2)
On Error Resume Next
WindowsMediaPlayer1.settings.Rate = Slider3.Value
End Sub
Private Sub Timer1_Timer()
'// Change Msn Name
Call SetDName
End Sub
Private Sub Timer4_Timer()
'// Quick ass stop watch i made for song duration
Label5.Caption = Label5.Caption + 1
If Label5.Caption = "60" Then
Label5.Caption = "0"
Label4.Caption = Label4.Caption + 1
End If