Skip to content

Commit

Permalink
csoundGetInstrument() added
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Dec 9, 2019
1 parent 6924337 commit cca2bd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Top/csound.c
Expand Up @@ -57,6 +57,7 @@
#include "fftlib.h"
#include "cs_par_base.h"
#include "cs_par_orc_semantics.h"
#include "namedins.h"
//#include "cs_par_dispatch.h"
#include "find_opcode.h"

Expand Down Expand Up @@ -100,6 +101,7 @@ extern int isstrcod(MYFLT );
extern int fterror(const FGDATA *ff, const char *s, ...);
PUBLIC int csoundErrCnt(CSOUND *);
void (*msgcallback_)(CSOUND *, int, const char *, va_list) = NULL;
INSTRTXT *csoundGetInstrument(CSOUND *csound, int insno, const char *name);

void csoundDebuggerBreakpointReached(CSOUND *csound);
void message_dequeue(CSOUND *csound);
Expand Down Expand Up @@ -506,10 +508,11 @@ static const CSOUND cenviron_ = {
csoundListChannels,
csoundErrCnt,
csoundFTnp2Finde,
csoundGetInstrument,
{
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
},
/* ------- private data (not to be used by hosts or externals) ------- */
/* callback function pointers */
Expand Down Expand Up @@ -4439,6 +4442,12 @@ MYFLT csoundGetA4(CSOUND *csound) { return (MYFLT) csound->A4; }

int csoundErrCnt(CSOUND *csound) { return csound->perferrcnt; }

INSTRTXT *csoundGetInstrument(CSOUND *csound, int insno, const char *name) {
if (name != NULL)
insno = named_instr_find(csound, (char *)name);
return csound->engineState.instrtxtp[insno];
}

#if 0
PUBLIC int csoundPerformKsmpsAbsolute(CSOUND *csound)
{
Expand Down
3 changes: 2 additions & 1 deletion include/csoundCore.h
Expand Up @@ -1384,11 +1384,12 @@ typedef struct _message_queue_t_ {
int (*ListChannels)(CSOUND *, controlChannelInfo_t **);
int (*GetErrorCnt)(CSOUND *);
FUNC* (*FTnp2Finde)(CSOUND*, MYFLT *);
INSTRTXT *(*GetInstrument)(CSOUND*, int, const char *);
/**@}*/
/** @name Placeholders
To allow the API to grow while maintining backward binary compatibility. */
/**@{ */
SUBR dummyfn_2[30];
SUBR dummyfn_2[29];
/**@}*/
#ifdef __BUILDING_LIBCSOUND
/* ------- private data (not to be used by hosts or externals) ------- */
Expand Down

0 comments on commit cca2bd9

Please sign in to comment.