COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 06-23-2020, 12:26 PM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default SetDisplayText() not working properly in AAX and Audio Units - SOLVED

I have a 3 position toggle switch that is currently set up as an "InitInt()" control. It shows up in automation in most hosts as "0, 1, 2".

Is it possible to get this control to show up as it's text values ("Normal", "Fast", "Slow") in automation lanes?

Last edited by Nonlinear; 10-22-2020 at 01:01 PM.
Nonlinear is offline   Reply With Quote
Old 06-23-2020, 02:15 PM   #2
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Nevermind - I got it. Use "GetParam(kParameter)->SetDisplayText(Value, "Text")";
Nonlinear is offline   Reply With Quote
Old 10-22-2020, 09:06 AM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Well, this is madness - what works in Pro Tools does not work in Logic and vice versa.

1) SetDisplayText() applied to Bool parameters works in Pro Tools - but not in Logic (shows as "On"/"Off" rather than desired text)
2) SetDisplayText() applied to Int parameters works in Logic - but doesn't work in Pro Tools (value on automation lane always shows as "0.0")

Is there a fix for this so SetDisplayText() works the same EVERYWHERE? If not, what is the workaround?

Last edited by Nonlinear; 10-22-2020 at 10:42 AM.
Nonlinear is offline   Reply With Quote
Old 10-22-2020, 01:00 PM   #4
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

SOLVED (or at least it's a workaround that does what I want)

The Integer type parameter in iPlugAAX.xpp was set up as a continuous parameter with 128 steps and no apparent display text values. I commented out that entire section and moved the INT type down to the BOOL definition.

Doing this created a stepped control (INT) that works in Logic, Reaper and Pro Tools, etc., with SetDisplayText() values showing in the automation lanes.

I will only use BOOL parameter types (that show "On/Off" which corresponds to Logics' apparent "On/Off" forced text for bool) for On/Off controls, NOT controls where I want to specifically identify states such as "Hi/Lo", "Fast/Slow", etc. In those cases I will use the INT type.

The code change I made in iPlugAAX.cpp to do this:

Code:
/*      case IParam::kTypeInt:
      {
        param = new AAX_CParameter<int>(paramID->Get(),
                                        AAX_CString(p->GetNameForHost()), 
                                        (int)p->GetDefault(), 
                                        AAX_CLinearTaperDelegate<int>((int)p->GetMin(), (int)p->GetMax()),
                                        AAX_CUnitDisplayDelegateDecorator<int>( AAX_CNumberDisplayDelegate<int>(), AAX_CString(p->GetLabelForHost())),
                                        p->GetCanAutomate());
        
        param->SetNumberOfSteps(128);
        param->SetType(AAX_eParameterType_Continuous);

        break;
      }
*/
      case IParam::kTypeEnum:
      case IParam::kTypeInt: //  move to here from above
      case IParam::kTypeBool: 
      {
        int nTexts = p->GetNDisplayTexts();
        
        std::map<int, AAX_CString> displayTexts;
        
        for (int j=0; j<p->GetNDisplayTexts(); j++) 
        {
          int value;
          const char* text = p->GetDisplayTextAtIdx(j, &value);
          
          displayTexts.insert(std::pair<int, AAX_CString>(value, AAX_CString(text)) );
        }
        
        param = new AAX_CParameter<int>(paramID->Get(), 
                                        AAX_CString(p->GetNameForHost()), 
                                        (int)p->GetDefault(), 
                                        AAX_CStateTaperDelegate<int>((int)p->GetMin(), (int)p->GetMax()),
                                        AAX_CStringDisplayDelegate<int>(displayTexts),
                                        p->GetCanAutomate());
        
        param->SetNumberOfSteps(nTexts);
        param->SetType(AAX_eParameterType_Discrete);
                
        break; 
      }
Nonlinear is offline   Reply With Quote
Reply

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 09:38 PM.


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