00001 /* 00002 csmodule.h: 00003 00004 Copyright (C) 2005 Istvan Varga 00005 based on dl_opcodes.c, Copyright (C) 2002 John ffitch 00006 00007 This file is part of Csound. 00008 00009 The Csound Library is free software; you can redistribute it 00010 and/or modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 Csound is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with Csound; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00022 02111-1307 USA 00023 */ 00024 00025 #ifndef CSOUND_CSMODULE_H 00026 #define CSOUND_CSMODULE_H 00027 00028 /****************************************************************************** 00029 * NEW PLUGIN INTERFACE * 00030 * ==================== * 00031 * * 00032 * Plugin libraries are loaded from the directory defined by the environment * 00033 * variable OPCODEDIR (or the current directory if OPCODEDIR is unset) by * 00034 * csoundPreCompile() while initialising a Csound instance, and are unloaded * 00035 * at the end of performance by csoundReset(). * 00036 * A library may export any of the following five interface functions, * 00037 * however, the presence of csoundModuleCreate() is required for identifying * 00038 * the file as a Csound plugin module. * 00039 * * 00040 * int csoundModuleCreate(CSOUND *csound) (required) * 00041 * -------------------------------------- * 00042 * * 00043 * Pre-initialisation function, called by csoundPreCompile(). * 00044 * * 00045 * int csoundModuleInit(CSOUND *csound) (optional) * 00046 * ------------------------------------ * 00047 * * 00048 * Called by Csound instances before orchestra translation. One possible use * 00049 * of csoundModuleInit() is adding new opcodes with csoundAppendOpcode(). * 00050 * * 00051 * int csoundModuleDestroy(CSOUND *csound) (optional) * 00052 * --------------------------------------- * 00053 * * 00054 * Destructor function for Csound instance 'csound', called at the end of * 00055 * performance, after closing audio output. * 00056 * * 00057 * const char *csoundModuleErrorCodeToString(int errcode) (optional) * 00058 * ------------------------------------------------------ * 00059 * * 00060 * Converts error codes returned by any of the initialisation or destructor * 00061 * functions to a string message. * 00062 * * 00063 * int csoundModuleInfo(void) (optional) * 00064 * -------------------------- * 00065 * * 00066 * Returns information that can be used to determine if the plugin was built * 00067 * for a compatible version of libcsound. The return value may be the sum of * 00068 * any of the following two values: * 00069 * * 00070 * ((CS_APIVERSION << 16) + (CS_APISUBVER << 8)) API version * 00071 * (int) sizeof(MYFLT) MYFLT type * 00072 * * 00073 ******************************************************************************/ 00074 00075 #ifdef __cplusplus 00076 extern "C" { 00077 #endif 00078 00079 /* ------------------------ INTERNAL API FUNCTIONS ------------------------ */ 00080 00088 int csoundLoadModules(CSOUND *csound); 00089 00096 int csoundInitModules(CSOUND *csound); 00097 00104 int csoundDestroyModules(CSOUND *csound); 00105 00106 #ifdef __cplusplus 00107 } 00108 #endif 00109 00110 #endif /* CSOUND_CSMODULE_H */ 00111