diff options
Diffstat (limited to 'plugins/SDK')
-rw-r--r-- | plugins/SDK/UPartyDefs.pas | 189 | ||||
-rw-r--r-- | plugins/SDK/UPluginDefs.pas | 193 |
2 files changed, 0 insertions, 382 deletions
diff --git a/plugins/SDK/UPartyDefs.pas b/plugins/SDK/UPartyDefs.pas deleted file mode 100644 index 09f97812..00000000 --- a/plugins/SDK/UPartyDefs.pas +++ /dev/null @@ -1,189 +0,0 @@ -unit UPartyDefs; -{********************* - uPluginDefs - Some Basic Structures and Functions used to communicate with Plugins - Usable as Delphi Plugin SDK -*********************} - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I switches.inc} - -uses UPluginDefs; - -type - //---------------- - // TUS_Party_Proc_Init - Structure of the Party Init Proc - // This Function is called on SingScreen Init Everytime this Modi should be sung - // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded - //---------------- - TUS_Party_Proc_Init = Function (ID: Integer): integer; stdcall; - - //---------------- - // TUS_Party_Proc_Draw - Structure of the Party Draw Proc - // This Function is called on SingScreen Draw (Not when Paused). You should draw in this Proc - // Return Non Zero to Finish Song... In this Case Score Screen is loaded - //---------------- - TUS_Party_Proc_Draw = Function (ID: Integer): integer; stdcall; - - //---------------- - // TUS_Party_Proc_DeInit - Structure of the Party DeInit Proc - // This Function is called on SingScreen DeInit When Plugin abort Song or Song finishes - // Return Winner - //---------------- - TUS_Party_Proc_DeInit = Function (ID: Integer): integer; stdcall; - - //---------------- - // TUS_ModiInfo - Some Infos from Plugin to Partymode. - // Used to register party modi to Party manager - // --- - // Version Structure: - // First Byte: Head Revison - // Second Byte: Sub Revison - // Third Byte: Sub Revision 2 - // Fourth Byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z') - //---------------- - TModiInfo_Name = Array [0..31] of Char; - TModiInfo_Desc = Array [0..63] of Char; - - PUS_ModiInfo = ^TUS_ModiInfo; - TUS_ModiInfo = record - //Size of this record (usefull if record will be extended in the future) - cbSize: Integer; //Don't forget to set this as Plugin! - - //Infos about the Modi - Name : TModiInfo_Name; //Modiname to Register for the Plugin - Description: TModiInfo_Desc; //Plugin Description - - //------------ - // Loading Settings - // --- - // Bit to Set | Triggered Option - // 1 | Song should be loaded - // 2 | Song has to be Non Duett - // 4 | Song has to be Duett (If 2 and 4 is set, both will be ignored) - // 8 | Only Playable with 2 and more players - // 16 | Restrict Background Loading - // 32 | Restrict Video Loading - // 64 | Increase TimesPlayed for Cur. Player - // 128 | Not in Use, Don't set it! - LoadingSettings: Byte; - - // SingScreen Settings - // --- - // Bit to Set | Triggered Option - // 1 | ShowNotes - // 2 | ShowScores - // 4 | ShowTime - // 8 | Start Audio Playback automaticaly - // 16 | Not in Use, Don't set it! - // 32 | Not in Use, Don't set it! - // 64 | Not in Use, Don't set it! - // 128 | Not in Use, Don't set it! - SingScreenSettings: Byte; - - // With which count of players can this modi be played - // --- - //Set different Bits - //1 -> One Player - //2 -> Two Players - //4 -> Three Players - //8 -> Four Players - //16-> Six Players - //e.g. : 10 -> Playable with 2 and 4 Players - NumPlayers: Byte; - - // ID that is given to the Party Procs when they are called - // If this Modi is running - // (e.g. to register Until 2000 and Until 5000 with the same Procs - // ID is the Max Point Count in this example) - ID: Integer; - - // Party Procs called on Party - // --- - // Set to nil(C: NULL) if u don't want to use this method - ModiInit: TUS_Party_Proc_Init; - ModiDraw: TUS_Party_Proc_Draw; - ModiDeInit: TUS_Party_Proc_DeInit; - end; - - //-------------- - // Team Info Record. Used by "Party/GetTeamInfo" and "Party/SetTeamInfo" - //-------------- - TTeamInfo = record - NumTeams: Byte; - Teaminfo: array[0..5] of record - Name: PChar; //Teamname - Score: Word; //TeamScore - Joker: Byte; //Team Jokers available - CurPlayer: Byte; //Id of Cur. Playing Player - NumPlayers: Byte; - Playerinfo: array[0..3] of record - Name: PChar; //Playername - TimesPlayed: Byte; //How often this Player has Sung - end; - end; - end; - -//---------------- -// Some Default Constants -//---------------- -const - // to use for TUS_ModiInfo.LoadingSettings - MLS_LoadSong = 1; //Song should be loaded - MLS_NotDuett = 2; //Song has to be Non Duett - MLS_ForceDuett = 4; //Song has to be Duett (If 2 and 4 is set, both will be ignored) - MLS_TeamOnly = 8; //Only Playable with 2 and more players - MLS_RestrictBG = 16; //Restrict Background Loading - MLS_RestrictVid = 32; //Restrict Video Loading - MLS_IncTP = 64; //Increase TimesPlayed for Cur. Player - - // to use with TUS_ModiInfo.SingScreenSettings - MSS_ShowNotes = 1; //ShowNotes - MSS_ShowScores = 2; //ShowScores - MSS_ShowTime = 4; //ShowTime - MSS_AutoPlayback= 8; //Start Audio Playback automaticaly - - //Standard (Duell) for TUS_ModiInfo.LoadingSettings and TUS_ModiInfo.SingScreenSettings - MLS_Standard = MLS_LoadSong or MLS_IncTP; - MSS_Standard = MSS_ShowNotes or MSS_ShowScores or MSS_ShowTime or MSS_AutoPlayback; - -//------------- -// Some helper functions to register Party Modi -//------------- -Function RegisterModi(const PluginInterface: PUS_PluginInterface; const Name: TModiInfo_Name; const Description: TModiInfo_Desc; const LoadingSettings, SingScreenSettings, NumPlayers: Byte; const ID: Integer; const ModiInit: TUS_Party_Proc_Init = nil; const ModiDeInit: TUS_Party_Proc_DeInit = nil; const ModiDraw: TUS_Party_Proc_Draw = nil): THandle; - - - -implementation - -//------------- -// Function that Prepares the ModiInfo Record and Calls Party/RegisterModi -//------------- -Function RegisterModi(const PluginInterface: PUS_PluginInterface; const Name: TModiInfo_Name; const Description: TModiInfo_Desc; const LoadingSettings, SingScreenSettings, NumPlayers: Byte; const ID: Integer; const ModiInit: TUS_Party_Proc_Init; const ModiDeInit: TUS_Party_Proc_DeInit; const ModiDraw: TUS_Party_Proc_Draw): THandle; -var - ModiInfo: TUS_ModiInfo; -begin - //Init Record - ModiInfo.cbSize := SizeOf(TUS_ModiInfo); - - ModiInfo.Name := Name; - ModiInfo.Description := Description; - ModiInfo.LoadingSettings := LoadingSettings; - ModiInfo.SingScreenSettings := SingScreenSettings; - ModiInfo.NumPlayers := NumPlayers; - - ModiInfo.ID := ID; - ModiInfo.ModiInit := ModiInit; - ModiInfo.ModiDraw := ModiDraw; - ModiInfo.ModiDeInit := ModiDeInit; - - //Call Service - Result := PluginInterface.CallService('Party/RegisterModi', Integer(@ModiInfo), nil); -end; - -end.
\ No newline at end of file diff --git a/plugins/SDK/UPluginDefs.pas b/plugins/SDK/UPluginDefs.pas deleted file mode 100644 index 45bae864..00000000 --- a/plugins/SDK/UPluginDefs.pas +++ /dev/null @@ -1,193 +0,0 @@ -unit uPluginDefs; -{********************* - uPluginDefs - Some basic structures and functions used to communicate with plugins - Usable as Delphi plugin SDK -*********************} - -interface - -{$IFDEF FPC} - {$MODE Delphi} -{$ENDIF} - -{$I switches.inc} - -type - dword = LongWord; - - //Compatibility with 64 Bit Systems - {$IFDEF CPU32} - TwParam = integer; - TlParam = pointer; //lParam is used for 32 bit addresses. dword is large enough - {$ELSE} - TwParam = int64; - TlParam = pointer; //lParam used for 64 bit addresses in 64 bit systems (FreePascal) - {$ENDIF} - //wParam is mainly used for ordinals - //lparam is mainly used for pointers - - //---------------- - // TUS_PluginInfo - some infos from plugin to core. - // Send when Plugininfo procedure is called - // --- - // Version structure: - // First byte: Head Revison - // Second byte: Sub Revison - // Third byte: Sub Revision 2 - // Fourth byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z') - //---------------- - PUS_PluginInfo = ^TUS_PluginInfo; - TUS_PluginInfo = record - cbSize: integer; //Size of this record (usefull if record will be extended in the future) - - Name: array [0..31] of char; //Name of the Plugin - Version: dword; //Version of the Plugin - Description: array [0..127] of char; //Description, what does this Plugin do - Author: array [0..31] of char; //Author of this Plugin - AuthorEmail: array [0..63] of char; //Authors Email - Homepage: array [0..63] of char; //Homepage of Plugin/Author - end; - AUS_PluginInfo = array of TUS_PluginInfo; - PAUS_PluginInfo = ^AUS_PluginInfo; - - //---------------- - // TUS_Hook - Structure of the Hook function - // Return 0 if the Hook should be continue, - // or a non zero Value, if the Hook should be Interuped - // In this Case the Caller of the Notifier gets the Return Value - // Return Value Should not be -1 - //---------------- - TUS_Hook = function (wParam: TwParam; lParam: TlParam): integer; stdcall; - TUS_Hook_of_Object = function (wParam: TwParam; lParam: TlParam): integer of Object; - - //---------------- - // TUS_Service - Structure of the Service function - // This function is called if the Registered Service is Called - // Return Value Should not be SERVICE_NOT_FOUND - //---------------- - TUS_Service = function (wParam: TwParam; lParam: TlParam): integer; stdcall; - TUS_Service_of_Object = function (wParam: TwParam; lParam: TlParam): integer of Object; - - //---------------- - // TUS_PluginInterface - Structure that Includes all Methods callable - // from the Plugins - //---------------- - PUS_PluginInterface = ^TUS_PluginInterface; - TUS_PluginInterface = record - {******** Hook specific Methods ********} - {Function Creates a new Hookable Event and Returns the Handle - or 0 on Failure. (Name already exists)} - CreateHookableEvent: function (EventName: PChar): THandle; stdcall; - - {Function Destroys an Event and Unhooks all Hooks to this Event. - 0 on success, not 0 on Failure} - DestroyHookableEvent: function (hEvent: THandle): integer; stdcall; - - {Function start calling the Hook Chain - 0 if Chain is called until the End, -1 if Event Handle is not valid - otherwise Return Value of the Hook that breaks the Chain} - NotivyEventHooks: function (hEvent: THandle; wParam: TwParam; lParam: TlParam): integer; stdcall; - - {Function Hooks an Event by Name. - Returns Hook Handle on Success, otherwise 0} - HookEvent: function (EventName: PChar; HookProc: TUS_Hook): THandle; stdcall; - - {Function Removes the Hook from the Chain - Returns 0 on Success} - UnHookEvent: function (hHook: THandle): integer; stdcall; - - {Function Returns Non Zero if a Event with the given Name Exists, - otherwise 0} - EventExists: function (EventName: PChar): integer; stdcall; - - {******** Service specific Methods ********} - {Function Creates a new Service and Returns the Services Handle - or 0 on Failure. (Name already exists)} - CreateService: function (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall; - - {Function Destroys a Service. - 0 on success, not 0 on Failure} - DestroyService: function (hService: THandle): integer; stdcall; - - {Function Calls a Services Proc - Returns Services Return Value or SERVICE_NOT_FOUND on Failure} - CallService: function (ServiceName: PChar; wParam: TwParam; lParam: TlParam): integer; stdcall; - - {Function Returns Non Zero if a Service with the given Name Exists, - otherwise 0} - ServiceExists: function (ServiceName: PChar): integer; stdcall; - end; - - //---------------- - //TModuleInfo: Info about Modules. Result of Core/GetModuleInfo - //---------------- - PModuleInfo = ^TModuleInfo; - TModuleInfo = record - Name: string; - Version: LongWord; - Description: string; - end; - AModuleInfo = array of TModuleInfo; - - //---------------- - // Procs that should be exported by Plugin Dlls - //---------------- - //Procedure is called to check if this is USDx Plugin - //Info is Pointer to this Plugins Info. Size is already set. Don't write over this limit - Proc_PluginInfo = procedure (Info: PUS_PluginInfo); stdcall; - - //Called on Plugins Load. If Non Zero is Returned => abort Loading - //PInterface is Pointer to PluginInterface - Func_Load = function (const PInterface: PUS_PluginInterface): integer; stdcall; - - //Called on Plugins Init. If Non Zero is Returned => abort Loading - //PInterface is Pointer to PluginInterface - Func_Init = function (const PInterface: PUS_PluginInterface): integer; stdcall; - - //Called on Plugins Deinit. - //PInterface is Pointer to PluginInterface - Proc_DeInit = procedure (const PInterface: PUS_PluginInterface); stdcall; - -//---------------- -// Some Default Constants -//---------------- -const - {Returned if Service is not found from CallService} - SERVICE_NOT_FOUND = LongInt($80000000); - - //for use in Service 'Core/ShowMessage' lParam(Symbol) - CORE_SM_NOSYMBOL= 0; - CORE_SM_ERROR = 1; - CORE_SM_WARNING = 2; - CORE_SM_INFO = 3; - -//---------------- -// Some functions to Handle Version dwords -//---------------- -function MakeVersion(const HeadRevision, SubVersion, SubVersion2: byte; Letter: char): dword; -function VersionToString(const Version: dword): string; - -implementation - -//-------------- -// MakeVersion - converts 4 values to a valid version dword -//-------------- -function MakeVersion(const HeadRevision, SubVersion, SubVersion2: byte; Letter: char): dword; -begin - if(letter < 'a') or (Letter > 'z') then - letter := chr(0); - - Result := (HeadRevision shl 24) or (SubVersion shl 16) or (SubVersion2 shl 8) or Ord(Letter); -end; - -//-------------- -// VersiontoString - Returns some beauty '1.0.2a' like string -//-------------- -function VersionToString(const Version: dword): string; -begin // to-do : Write VersiontoString without SysUtils dependence - //Result := InttoStr((ver and $FF000000) shr 24); - Result := '1.0.1' -end; - -end. |