Mercurial > hg > dmlib
changeset 277:2e04f6827a52
Add two new functions to the simple demoengine for getting some information
about currently playing module (only when JSS is in use.)
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Oct 2012 22:17:55 +0300 |
parents | 40efff364904 |
children | 919e7de91758 |
files | dmsimple.c |
diffstat | 1 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/dmsimple.c Wed Oct 10 22:02:08 2012 +0300 +++ b/dmsimple.c Wed Oct 10 22:17:55 2012 +0300 @@ -417,6 +417,33 @@ } +#ifdef DM_USE_JSS +void engineGetJSSInfo(BOOL *playing, int *order, JSSPattern **pat, int *npattern, int *row) +{ + JSS_LOCK(engine.plr); + + *playing = engine.plr->isPlaying; + *row = engine.plr->row; + *pat = engine.plr->pattern; + *npattern = engine.plr->npattern; + *order = engine.plr->order; + + JSS_UNLOCK(engine.plr); +} + +void engineGetJSSChannelInfo(const int channel, int *ninst, int *nextInst, int *freq, int *note) +{ + JSS_LOCK(engine.plr); + JSSPlayerChannel *chn = &(engine.plr->channels[channel]); + *ninst = chn->ninstrument; + *nextInst = chn->nextInstrument; + *freq = chn->freq; + *note = chn->note; + JSS_UNLOCK(engine.plr); +} +#endif + + int main(int argc, char *argv[]) { int err;