VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "cPlugIn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit

'
' cPlugIn class
'
'Instructions (Any "bending" of the rules can result in a crash or an inablity to load the plug):
'Just change all the Property Gets to contain the right info (like friendly name is "Xodiac Ogg Vorbis Player" and class name is "Xodiac_OggVorbis" and you should change the file name to match the class name)
'For the property PluginType you must choose either Xod_Input or Xod_Output constants (Required for the Xodiac host program). THE PROGRAM DOES NOT SUPPORT VISUALIZATION OR EFFECT PLUGINS YET (unless some1 has an idea about how ta make em)
'I will provide an installer later
'If your plug's an input plug, place a public function called PlayFile(FilePath as String) as Boolean (Set it 2 False if there is an error) and a public function called GetError() as String that Xodiac will call in case the first function returned False. the function will return the error number (use Err.Number, do not raise custom errors!)
'If your plug's an output plug (used for file conversion), place a public function called DoConversion(SourceFile as string, DestFile as string) as Boolean see the above line about the GetError function. The FileType property must be the file you get as a result of the conversion, and if you cannot convert FROM the source file type (like if you cant convert from MIDI to MP3, you should check that in DoConversion and if you cant convert, set it to false and make GetError return the value of "Xod_WrongExtension" (dont worry about the real errors because they are integers, Xodiac will use CInt before accessing the value).
'If you have any questions, post em in the VB Forums

'***Please dont write plugs to support MP3, Mpeg, AVI, MIDI, or CDA***

Private mFriendlyName As String ' Name of the Plug-In shown to the user
Private mClassName As String    ' COM Object's class name (ProgID)
Private mAuthor As String       ' Author of the plug-in
Private mVersion As String      ' Figure it out yourself
Private mDescription As String  ' Short description of what the plug-in does
Private mPlugObject As Object   ' An instanciated object of the plug-in (Dont touch)
Const Xod_Input = "Input"
Const Xod_Output = "Output"

Public Property Get PlugObject() As Object
    If mPlugObject Is Nothing Then CreatePlugObject
    Set PlugObject = mPlugObject
End Property

' At init time, the plug-in object itself is not instanciated.
' Only when the plug-in will be first used, it will be loaded
Public Sub Init(ClassName As String, FriendlyName As String)
    mClassName = ClassName
    mFriendlyName = FriendlyName
End Sub

' Actually create an instance of the plug-in object. This method is
' public, to allow forced creation of plug-ins, if you want.
Public Function CreatePlugObject() As Boolean
On Error GoTo CreatePlugObject_ErrHandler

    If mPlugObject Is Nothing Then
        Set mPlugObject = CreateObject(mClassName)
        
        ' Get extended info about the plug-in, that is now
        ' available
        mAuthor = mPlugObject.Author
        mDescription = mPlugObject.Description
        mVersion = mPlugObject.Version
    End If
    
    CreatePlugObject = True
    Exit Function
    
CreatePlugObject_ErrHandler:
    CreatePlugObject = False
End Function

Public Property Get Description() As String
    ' This information is only available once the plug-in
    ' itself was loaded
    If mPlugObject Is Nothing Then CreatePlugObject
    Description = mDescription
End Property

Public Property Get Version() As String
    If mPlugObject Is Nothing Then CreatePlugObject
    Version = mVersion
End Property

Public Property Get Author() As String
    If mPlugObject Is Nothing Then CreatePlugObject
    Author = mAuthor
End Property

Public Property Get ClassName() As String
    ClassName = mClassName
End Property

Public Property Get FriendlyName() As String
    FriendlyName = mFriendlyName
End Property
Public Property Get PluginType() As String
    'PluginType = Xod_Input
    'PluginType = Xod_Output
End Property
Public Property Get FileType() As String
    FileType = "Has to have a leading dot"
End Property
Public Sub ConfigureThyself()
    If mPlugObject Is Nothing Then CreatePlugObject
    mPlugObject.ConfigureMyself
End Sub
