Re: [Csnd-dev] Plugin return types

Rory Walsh <[email protected]>
Newsgroups gmane.comp.audio.csound.devel
Message-ID <CAMJR=HNsPi5R7jUzyrZN2w+fLA9JwuhS-2zsu01ZdS4Gv8Kmjw@mail.gmail.com>
Can't you overload the opcode functions? I do this with a lot of Cabbage
opcodes:

    csnd::plugin<GetCabbageValue>((csnd::Csound*) getCsound(),
"cabbageGetValue", "k", "S", csnd::thread::k);
    csnd::plugin<GetCabbageValueArray>((csnd::Csound*) getCsound(),
"cabbageGetValue", "k[]", "S[]", csnd::thread::k);
    csnd::plugin<GetCabbageValue>((csnd::Csound*) getCsound(),
"cabbageGetValue", "i", "S", csnd::thread::i);
    csnd::plugin<GetCabbageValueWithTrigger>((csnd::Csound*) getCsound(),
"cabbageGetValue", "kk", "S", csnd::thread::k);
    csnd::plugin<GetCabbageValueArrayWithTrigger>((csnd::Csound*)
getCsound(), "cabbageGetValue", "k[]k[]", "S[]", csnd::thread::k);

On Mon, 5 Jun 2023 at 03:27, andy fillebrown <[email protected]>
wrote:

> I'm making a custom plugin for improved Websocket communication and
> I'm wondering if it's possible to use the same opcode name to return a
> string or a k-array. Right now I have two opcodes in the plugin named
> "WSget_s" that returns a string and "WSget_k" that returns a k-array,
> but I'd really like to drop the _s and _k suffixes so I can just use
> "WSget". Is this possible with arrays?
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.