COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 08-01-2013, 10:23 AM   #1
freak82
Human being with feelings
 
Join Date: Mar 2013
Posts: 1
Default Display and Refresh Text

I need to display and refresh a text value, but I can't seem to make this simple thing work...
I tried with ICaptionControl and calling inside the loop:

Code:
  // loop
  freq = GetFreq();
  if (GetGUI())
    {
      GetGUI()->SetParameterFromPlug(kICaptionControl,freq, false);
    }
  InformHostOfParamChange(kICaptionControl, freq);
but it keeps showing the default value.
Can someone help me?
freak82 is offline   Reply With Quote
Old 08-09-2013, 11:09 AM   #2
cisdsp
Human being with feelings
 
cisdsp's Avatar
 
Join Date: Mar 2013
Posts: 75
Default

her you are...

Code:
class IValueReadOut : public IControl
{
public:
    
    IValueReadOut(IPlugBase* pPlug, IRECT pR)
    : IControl(pPlug, pR)
    {
        mColor = IColor(255,87,87,87); //For later FilledRect()
        
    }

    ~IValueReadOut() {}
    
    bool Draw(IGraphics* pGraphics)
    {

        
        IText txt = IText(&COLOR_WHITE);
        IRECT readout = IRECT(mRECT.L, mRECT.T, mRECT.R , mRECT.B );
                
        char result[100];

        sprintf(result, "%.1f", mValue); 

            pGraphics->DrawIText(&txt, result, &readout);   
       
        return true;
    }
    
    bool IsDirty() { return true;}
    
protected:
    IColor mColor;
};
__________________
Website: CIS DSP Factory
cisdsp 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 04:45 PM.


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