home *** CD-ROM | disk | FTP | other *** search
- #pragma once
-
- /*
- Visual Plug-in API
- ⌐1998, @soft
-
- Description: The plugin API for MacAmp visual plugins.
- Version: 1.0
- Released: 9/1/98
- Compatibility: MacAmp 1.0b6+
- Version history:
-
- Date Who Changes
- ------+------+------------------------------------------------------
- 090598 SK Commented the file, cleaned the unnesessary stuff.
- 090198 SK Initial release
- */
-
- #define VP_API_VERSION 0x01
-
- // Plugin types
- enum {
- plugVisual = 'vis!' // Visual plugin
- };
-
- // Plugin return values
- enum {
- visNoErr = noErr,
- visTerminate = 1, // terminate the plugin
- visNoMemory = 2 // terminate the plugin and display no memory alert
- // all other returns will cause plugin termination and "unknown plugin error" alert.
- };
-
- // plugin flags
- enum {
- flagHasSettings = 0x01, // Plugin can display and handle settings dialog
- flagGetKeyDown = 0x02, // Plugin wants to get keydown events
- flagGetIdle = 0x04 // Plugin wants to get idle events
- };
-
- // Function prototypes (see dummy plug for the explanations)
- extern OSErr PlugInitialize(WindowPtr* window, FSSpecPtr plug, UInt32* refcon);
- extern OSErr PlugTerminate(WindowPtr window, UInt32* refcon);
- extern OSErr PlugProcess(WindowPtr window, short chan, const double* stream, short dataSize, UInt32* refcon);
- extern OSErr PlugMacEvent(WindowPtr window, EventRecord* event, UInt32* refcon);
- extern OSErr PlugKeyDown(WindowPtr window, char key, short modifiers, UInt32* refcon);
- extern OSErr PlugIdle(WindowPtr window, UInt32* refcon);
- extern OSErr PlugSettings(WindowPtr window, UInt32* refcon);
- extern OSErr PlugAbout(WindowPtr window, UInt32* refcon);
-
- // Type defeinitions for plugin callbacks.
- typedef OSErr (*vpPlugInitializeProcPtr)(WindowPtr* window, FSSpecPtr plug, UInt32* refcon);
- typedef OSErr (*vpPlugTerminateProcPtr)(WindowPtr window, UInt32* refcon);
- typedef OSErr (*vpPlugProcessProcPtr)(WindowPtr window, short chan, const double* stream, short dataSize, UInt32* refcon);
- typedef OSErr (*vpPlugMacEventProcPtr)(WindowPtr window, EventRecord* event, UInt32* refcon);
- typedef OSErr (*vpPlugKeyDownProcPtr)(WindowPtr window, char key, short modifiers, UInt32* refcon);
- typedef OSErr (*vpPlugIdleProcPtr)(WindowPtr window, UInt32* refcon);
- typedef OSErr (*vpPlugSettingsProcPtr)(WindowPtr window, UInt32* refcon);
- typedef OSErr (*vpPlugAboutProcPtr)(WindowPtr window, UInt32* refcon);
-
- typedef struct {
- UInt16 api; // API used. Should always contain VP_API_VERSION
- OSType type; // Plugin type. Should always be plugVisual.
-
- UInt32 flags; // Plugin flags (flagXXX constants)
- UInt32 globRefcon; // Any global refcon you wish to use.
-
- Str63 name; // Plugin name (displayed in Plugin menu)
-
- // Pointers to plugin functions, or nil if they are not implemented.
- vpPlugInitializeProcPtr initProc;
- vpPlugTerminateProcPtr terminateProc;
- vpPlugProcessProcPtr processProc;
- vpPlugMacEventProcPtr macEventProc;
- vpPlugKeyDownProcPtr keyDownProc;
- vpPlugIdleProcPtr idleProc;
- vpPlugSettingsProcPtr settingsProc;
- vpPlugAboutProcPtr aboutProc;
- } VPInfoBlock, *VPInfoPtr;
-
-