VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsPlugin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True


Option Base 0
Option Explicit
Option Compare Text
Private BotIndex As Integer
Private Bot As Object
Private MainForm As Object

Private Sub Class_Terminate()
    Set Bot = Nothing
    Set MainForm = Nothing
End Sub

Public Sub RunPlugin(ByVal frmMain As Object, ByRef Info() As String)
    Set MainForm = frmMain
    ReDim Info(1)
    Info(0) = "Author: l2k-Shadow"
    Info(1) = "Plugin: Winamp Plugin"
End Sub

Public Sub AddToUserMenu(ByRef ChildMenus() As String)
'
End Sub

Public Sub AddToPluginsMenu(ByRef ChildMenus() As String)
    ReDim ChildMenus(8)
    ChildMenus(0) = "Get Song"
    ChildMenus(1) = "Load Winamp"
    ChildMenus(2) = "Quit Winamp"
    ChildMenus(3) = "Play"
    ChildMenus(4) = "Pause"
    ChildMenus(5) = "Stop"
    ChildMenus(6) = "Next"
    ChildMenus(7) = "Previous"
    ChildMenus(8) = "-"
End Sub

Public Sub ProfileSwitch(ByVal objBot As Object, ByVal Index As Integer)
    Set Bot = objBot
    BotIndex = Index
End Sub

Public Sub MenuClicked(ByVal MenuName As String, Optional ByVal UserClicked As String)
    Select Case MenuName
        Case "Get Song"
            Bot.AddChat vbGreen, modWinamp.GetSong
        Case "Load Winamp"
            modWinamp.LoadWinamp
        Case "Quit Winamp"
            modWinamp.QuitWinamp
        Case "Play"
            modWinamp.PlaySong
        Case "Pause"
            modWinamp.PauseSong
        Case "Stop"
            modWinamp.StopSong
        Case "Next"
            modWinamp.NextTrack
        Case "Previous"
            modWinamp.PreviousTrack
    End Select
End Sub

Public Function MessageSend(ByVal Index As Integer, ByVal Message As String, Optional ByRef ReturnMessage As String) As Boolean
Dim splt() As String
    splt = Split(Message, Space(1), 2)
    Select Case LCase$(splt(0))
        Case "/sendmp3"
            ReturnMessage = modWinamp.GetSong
        Case "/lwinamp"
            modWinamp.LoadWinamp
            MessageSend = True
        Case "/play"
            If UBound(splt) = 1 Then
                modWinamp.PlaySong splt(1)
            Else
                modWinamp.PlaySong
            End If
            MessageSend = True
        Case "/stop"
            modWinamp.StopSong
            MessageSend = True
        Case "/pause"
            modWinamp.PauseSong
            MessageSend = True
        Case "/next"
            modWinamp.NextTrack
            MessageSend = True
        Case "/previous", "/prev"
            modWinamp.PreviousTrack
            MessageSend = True
        Case "/qwinamp", "/quit"
            modWinamp.QuitWinamp
            MessageSend = True
        Case "/volume", "/vol", "/setvol"
            If UBound(splt) = 1 Then
                modWinamp.SetVolume CInt(splt(1))
                MessageSend = True
            End If
        Case "/mp3", "/song"
            Bot.AddChat vbGreen, modWinamp.GetSong
            MessageSend = True
    End Select
End Function

Public Sub MessageReceive(ByVal Index As Integer, ByVal EventID As Long, Optional ByVal Username As String, Optional ByVal Message As String, Optional ByVal Ping As Long, Optional ByVal Flags As Long, Optional ByVal Statstring As String)
'
End Sub
