Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 11-15-2019, 02:21 AM   #1
Human being with feelings
Join Date: Oct 2019
Location: Roseto degli Abruzzi (TE, Italy)
Posts: 8
Default IActionFunction, call from code...

Ciao to everybody

I call the following listener from a IVButtonControl:

auto RESETact = [&](IControl* pCaller) {
IMidiMsg m;
for (int i = 0; i < 6; i++) {
m.mStatus = 0xB0 + i; m.mData1 = 121; m.mData2 = 0; SendMidiMsgFromUI(m);
m.mData1 = 123; SendMidiMsgFromUI(m);

My question is: how I can call it from code, for example when key pressed???
Folowing code NOT WORKS...

if (key.VK == 49 && isUp) { RESETact(); }

Thank you very much
R is offline   Reply With Quote
Old 11-15-2019, 05:22 AM   #2
Human being with feelings
olilarkin's Avatar
Join Date: Apr 2009
Location: UK
Posts: 1,164

define a separate lambda function to do the thing, and call it from both the IActionFunction and the e.g. IGraphics key handler function
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 11-16-2019, 02:17 AM   #3
Human being with feelings
Join Date: Oct 2019
Location: Roseto degli Abruzzi (TE, Italy)
Posts: 8

Thanks Oli

I am a professional musician but an amateur programmer.
As images I need "Live behaviors" that programmers generally don't see.
For this I am converting a MIDI PANEL for live performances into VST, which I have already created in javascript (web midi api). The work is already finished but the final optimizations are missing.

I hope I understand your advices ... but C++ is new to me.
If you could show me the code, this would help me a lot.


Last edited by; 11-16-2019 at 06:06 AM. is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 02:04 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.