diff options
author | Richard Knight <q@1bpm.net> | 2022-12-30 22:19:45 +0000 |
---|---|---|
committer | Richard Knight <q@1bpm.net> | 2022-12-30 22:19:45 +0000 |
commit | 8b11ff540b36e612d9eff9a2ac9beda098341f0d (patch) | |
tree | b91c6c8102987605d1cea5b3c7cce67512c20427 /src | |
parent | 19265b8d0da2f999ddece4790f632e66bb8bf7cc (diff) | |
download | csound-datacore-8b11ff540b36e612d9eff9a2ac9beda098341f0d.tar.gz csound-datacore-8b11ff540b36e612d9eff9a2ac9beda098341f0d.tar.bz2 csound-datacore-8b11ff540b36e612d9eff9a2ac9beda098341f0d.zip |
new opcode
Diffstat (limited to 'src')
-rw-r--r-- | src/opcodes.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/opcodes.cpp b/src/opcodes.cpp index 2d7d8b8..fab6c7c 100644 --- a/src/opcodes.cpp +++ b/src/opcodes.cpp @@ -254,6 +254,19 @@ public: }; +struct mempssize : csnd::Plugin<1, 2> { + static constexpr char const *otypes = "i"; + static constexpr char const *itypes = "io"; + + int init() { + MemParser* mp = new MemParser(csound, (int)inargs[0], (inargs[1] > 0)); + + long length = mp->get_size(); + outargs[0] = FL(length); + return OK; + } +}; + // ifn mem2tab ipid, iskipzero=0 struct mem2tab : csnd::Plugin<1, 2> { static constexpr char const *otypes = "i"; @@ -579,6 +592,7 @@ void csnd::on_load(csnd::Csound *csound) { #ifdef USE_PROCMAPS csnd::plugin<memson>(csound, "memson", csnd::thread::ia); csnd::plugin<memps>(csound, "memps", csnd::thread::i); + csnd::plugin<mempssize>(csound, "mempssize", csnd::thread::i); csnd::plugin<mempsname>(csound, "mempsname", csnd::thread::i); csnd::plugin<mem2tab>(csound, "mem2tab", csnd::thread::i); #endif |