ATKColoredCompressor::ATKColoredCompressor(IPlugInstanceInfo instanceInfo) : IPLUG_CTOR(kNumParams, kNumPrograms, instanceInfo), inFilter(nullptr, 1, 0, false), outFilter(nullptr, 1, 0, false), gainCompressorFilter(1, 256*1024) { TRACE; //arguments are: name, defaultVal, minVal, maxVal, step, label GetParam(kPower)->InitDouble("Power", 10., 0., 100.0, 0.1, "ms"); GetParam(kPower)->SetShape(2.); GetParam(kAttack)->InitDouble("Attack", 10., 1., 100.0, 0.1, "ms"); GetParam(kAttack)->SetShape(2.); GetParam(kRelease)->InitDouble("Release", 10, 1., 100.0, 0.1, "ms"); GetParam(kRelease)->SetShape(2.); GetParam(kThreshold)->InitDouble("Threshold", 0., -40., 0.0, 0.1, "dB"); // threshold is actually power GetParam(kSlope)->InitDouble("Slope", 2., 1.5, 100, .1, "-"); GetParam(kSlope)->SetShape(2.); GetParam(kColored)->InitDouble("Color", 0, -.5, .5, 0.01, "-"); GetParam(kQuality)->InitDouble("Quality", 0.1, 0.01, .2, 0.01, "-"); GetParam(kSoftness)->InitDouble("Softness", -2, -4, 0, 0.1, "-"); GetParam(kSoftness)->SetShape(2.); GetParam(kMakeup)->InitDouble("Makeup Gain", 0, 0, 40, 0.1, "dB"); // Makeup is expressed in amplitude GetParam(kDryWet)->InitDouble("Dry/Wet", 1, 0, 1, 0.01, "-"); IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight); pGraphics->AttachBackground(COLORED_COMPRESSOR_ID, COLORED_COMPRESSOR_FN); IBitmap knob = pGraphics->LoadIBitmap(KNOB_ID, KNOB_FN, kKnobFrames); IBitmap knob1 = pGraphics->LoadIBitmap(KNOB1_ID, KNOB1_FN, kKnobFrames1); IColor color = IColor(255, 255, 255, 255); IText text = IText(10, &color, nullptr, IText::kStyleBold); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kPowerX, kPowerY, kPowerX + 78, kPowerY + 78 + 21), kPower, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kAttackX, kAttackY, kAttackX + 78, kAttackY + 78 + 21), kAttack, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kReleaseX, kReleaseY, kReleaseX + 78, kReleaseY + 78 + 21), kRelease, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kThresholdX, kThresholdY, kThresholdX + 78, kThresholdY + 78 + 21), kThreshold, &knob, &text, "dB")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kSlopeX, kSlopeY, kSlopeX + 78, kSlopeY + 78 + 21), kSlope, &knob, &text, "")); pGraphics->AttachControl(new IKnobMultiControl(this, kSoftnessX, kSoftnessY, kSoftness, &knob)); pGraphics->AttachControl(new IKnobMultiControl(this, kColoredX, kColoredY, kColored, &knob1)); pGraphics->AttachControl(new IKnobMultiControl(this, kQualityX, kQualityY, kQuality, &knob)); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kMakeupX, kMakeupY, kMakeupX + 78, kMakeupY + 78 + 21), kMakeup, &knob, &text, "dB")); pGraphics->AttachControl(new IKnobMultiControl(this, kDryWetX, kDryWetY, kDryWet, &knob1)); AttachGraphics(pGraphics); //MakePreset("preset 1", ... ); MakePreset("Serial Compression", 10., 10., 10., 0., 2., .1, 0., .01, 0., 1.); MakePreset("Parallel Compression", 10., 10., 10., 0., 2., .1, 0., .01, 0., 0.5); powerFilter.set_input_port(0, &inFilter, 0); attackReleaseFilter.set_input_port(0, &powerFilter, 0); gainCompressorFilter.set_input_port(0, &attackReleaseFilter, 0); applyGainFilter.set_input_port(0, &gainCompressorFilter, 0); applyGainFilter.set_input_port(1, &inFilter, 0); volumeFilter.set_input_port(0, &applyGainFilter, 0); drywetFilter.set_input_port(0, &volumeFilter, 0); drywetFilter.set_input_port(1, &inFilter, 0); outFilter.set_input_port(0, &drywetFilter, 0); Reset(); }
//------------------------------+ // DispWindow constructor | //------------------------------+ DispWindow::DispWindow( IWindow* dw) : IMultiCellCanvas( idwin,dw,dw) { IPresSpaceHandle hps; hps = IPresSpaceHandle(); ICommandHandler::handleEventsFor( this ); IMouseClickHandler::handleEventsFor( this ); setColor(IColor(IColor::cyan)); output = new IStaticText(DSP_ID,this,this); output->setText("OPENDOC+ICLUI"); IFont tempFont; tempFont.setOutline(true); tempFont.setPointSize(15); tempFont.setName("Helv"); output->setFont(tempFont); output->setAlignment(IStaticText::centerRight); addToCell(output,1,1); setRowHeight(1,5,true); setColumnWidth(1,10,true); output->setAutoDeleteObject(); setAutoDeleteObject(); }
IPlugEffect::IPlugEffect(IPlugInstanceInfo instanceInfo) : IPLUG_CTOR(kNumPublicParams, kNumPrivateParams, kNumPrograms, instanceInfo) { TRACE; //arguments are: name, defaultVal, minVal, maxVal, step, label GetParam(kGain)->InitDouble("Gain", 50., 0., 100.0, 0.01, "%"); GetParam(kGain)->SetShape(2.); IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight); pGraphics->AttachPanelBackground(&COLOR_GRAY); IBitmap* knob = pGraphics->LoadPointerToBitmap(KNOB_ID, KNOB_FN, kKnobFrames); pGraphics->AttachControl(new IKnobMultiControl(this, kGainX, kGainY, kGain, knob)); IColor textColor = IColor(255, 0, 0, 0); IText textProps4(24, &textColor, "Arial", IText::kStyleNormal, IText::kAlignCenter, 0, IText::kQualityDefault); pGraphics->AttachControl(new ITextControl(this, DRAW_RECT(80, 44, 220, 84), &textProps4, "Hello IPlug!")); AttachGraphics(pGraphics); //MakePreset("preset 1", ... ); MakeDefaultPreset((char *) "-", kNumPrograms); }
Core::IColor IProperty::GetColor() { if (m_pVar) { float temp; switch (m_iType) { case IPT_BOOL: temp = *((bool*)m_pVar); return IColor(temp,temp,temp,temp); case IPT_INTEGER: temp = *((int*)m_pVar); return IColor(temp,temp,temp,temp); case IPT_FLOAT: temp = *((float*)m_pVar); return IColor(temp,temp,temp,temp); case IPT_VEC2: { IVector2D temp = (*(IVector2D*)m_pVar); return IColor(temp.x,temp.y,0,0); } case IPT_VEC3: { IVector3D temp = (*(IVector3D*)m_pVar); return IColor(temp.x,temp.y,temp.z,0); } case IPT_COLOR: return (*(IColor*)m_pVar); case IPT_CHOICE: return IColor(*((int*)m_pVar),0,0,0); } } return IColor(0,0,0,0); }
IColor nSurface::GetPixel( u32 x, u32 y ) { if ((x>=m_Dimension.Width) || (y>=m_Dimension.Height)) return IColor(0); switch (m_ColorFormat) { case ECF_R8G8B8: // 24 bit { u8 *bit = &((u8 *)m_pData)[(y*3) * m_Dimension.Width + (x*3)]; return IColor(bit[0], bit[1], bit[2], 255); } break; case ECF_A8R8G8B8: // 32 bit return IColor(((u32 *)m_pData)[y * m_Dimension.Width + x]); } return IColor(0); }
void INodeLight::Render(Video::IRenderDriver *driver, IFrustum *frustum, int flags) { if (!m_bShow || !IsSelected()) return; float cubeSize=0.1; //Draw Cube driver->UseMaterial(m_pEmissiveVertex); driver->_SetColor(IColor(1.0,1.0,1.0,1.0)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,cubeSize,cubeSize),GetPosition()+IVector3D(cubeSize,cubeSize,cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,-cubeSize,cubeSize),GetPosition()+IVector3D(cubeSize,-cubeSize,cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,cubeSize,-cubeSize),GetPosition()+IVector3D(cubeSize,cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,-cubeSize,-cubeSize),GetPosition()+IVector3D(cubeSize,-cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,cubeSize,cubeSize),GetPosition()+IVector3D(-cubeSize,-cubeSize,cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(cubeSize,cubeSize,cubeSize),GetPosition()+IVector3D(cubeSize,-cubeSize,cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,cubeSize,-cubeSize),GetPosition()+IVector3D(-cubeSize,-cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(cubeSize,cubeSize,-cubeSize),GetPosition()+IVector3D(cubeSize,-cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,cubeSize,cubeSize),GetPosition()+IVector3D(-cubeSize,cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(cubeSize,-cubeSize,cubeSize),GetPosition()+IVector3D(cubeSize,-cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(-cubeSize,-cubeSize,cubeSize),GetPosition()+IVector3D(-cubeSize,-cubeSize,-cubeSize)); driver->_DrawLine(GetPosition()+IVector3D(cubeSize,cubeSize,cubeSize),GetPosition()+IVector3D(cubeSize,cubeSize,-cubeSize)); IVector3D pos = GetPosition(); //Draw Radius for (float i=0;i<=RADIUS_QUALITY;i++) { driver->_DrawLine(IVector3D(pos.GetX()+m_fRadius*cos(i/RADIUS_QUALITY*2*I_PIE),pos.GetY()+m_fRadius*sin(i/RADIUS_QUALITY*2*I_PIE),pos.GetZ()), IVector3D(pos.GetX()+m_fRadius*cos((i+1)/RADIUS_QUALITY*2*I_PIE),pos.GetY()+m_fRadius*sin((i+1)/RADIUS_QUALITY*2*I_PIE),pos.GetZ())); driver->_DrawLine(IVector3D(pos.GetX()+m_fRadius*cos(i/RADIUS_QUALITY*2*I_PIE),pos.GetY(),pos.GetZ()+m_fRadius*sin(i/RADIUS_QUALITY*2*I_PIE)), IVector3D(pos.GetX()+m_fRadius*cos((i+1)/RADIUS_QUALITY*2*I_PIE),pos.GetY(),pos.GetZ()+m_fRadius*sin((i+1)/RADIUS_QUALITY*2*I_PIE))); driver->_DrawLine(IVector3D(pos.GetX(),pos.GetY()+m_fRadius*sin(i/RADIUS_QUALITY*2*I_PIE),pos.GetZ()+m_fRadius*cos(i/RADIUS_QUALITY*2*I_PIE)), IVector3D(pos.GetX(),pos.GetY()+m_fRadius*sin((i+1)/RADIUS_QUALITY*2*I_PIE),pos.GetZ()+m_fRadius*cos((i+1)/RADIUS_QUALITY*2*I_PIE))); } //RenderFrustum /*IFrustum frustum2; for (int i=0;i<6;i++) { frustum2.SetFrustumFromMatrix(GetProjectionMatrix(i)); frustum2.CalcVertice(); frustum2.DrawFrustum(driver); }*/ BaseClass::Render(driver,frustum,flags); }
IPlugEffectGUILiveEdit::IPlugEffectGUILiveEdit(IPlugInstanceInfo instanceInfo) : IPLUG_CTOR(kNumPublicParams, kNumPrivateParams, kNumPrograms, instanceInfo) { TRACE; //arguments are: name, defaultVal, minVal, maxVal, step, label GetParam(kGain)->InitDouble("Gain", 50., 0., 100.0, 0.01, "%"); GetParam(kGain)->SetShape(2.); IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight); // Here we are attaching our GUI resize control ------------------------------------------------------------------------------ // It is important to create on top of all controls! AttachGUIResize(new IPlugGUIResize(this, pGraphics, true, 16, 16)); // --------------------------------------------------------------------------------------------------------------------------- pGraphics->AttachPanelBackground(&COLOR_GRAY); // Start Live GUI edit GUI_EDIT_START; NEW_LAYER; IRECT knobPosition = DRAW_RECT(80, 110, 128, 158); IBitmap* knob = pGraphics->LoadPointerToBitmap(KNOB_ID, KNOB_FN, kKnobFrames); pGraphics->AttachControl(new IKnobMultiControl(this, knobPosition.L, knobPosition.T, kGain, knob)); END; NEW_LAYER; IColor textColor = IColor(255, 0, 0, 0); IText textProps(24, &textColor, "Arial", IText::kStyleNormal, IText::kAlignCenter, 0, IText::kQualityDefault); pGraphics->AttachControl(new ITextControl(this, DRAW_RECT(50, 20, 190, 60), &textProps, "Hello IPlug!")); END; // End Live GUI edit GUI_EDIT_FINISH; // Attach GUI live edit control. Use __FILE__ macro to get source file path. You can remove it after you edit your GUI. pGraphics->AttachControl(new IPlugGUILiveEdit(this, __FILE__, 10)); AttachGraphics(pGraphics); //MakePreset("preset 1", ... ); MakeDefaultPreset((char *) "-", kNumPrograms); }
IColor IGraphics::GetPoint(int x, int y) { LICE_pixel pix = _LICE::LICE_GetPixel(mDrawBitmap, x, y); return IColor(LICE_GETA(pix), LICE_GETR(pix), LICE_GETG(pix), LICE_GETB(pix)); }
/*------------------------------------------------------------------------------ | Amp::Amp | | | | | ------------------------------------------------------------------------------*/ Amp::Amp( IMMAmpMixer* aAmp1, IMMAmpMixer* aAmp2, IMMAmpMixer* aAmp3, unsigned long windowid, IWindow* parent, IWindow* owner) : IMultiCellCanvas(windowid,parent,owner), name (AMPNAMEID, this,owner), slVolume (SL_VOLUME_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slBalance (SL_BALANCE_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slBass (SL_BASS_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slTreble (SL_TREBLE_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slPitch (SL_PITCH_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), slGain (SL_GAIN_ID,this,this,IRectangle(), ICircularSlider::defaultStyle() | ICircularSlider::proportionalTicks ), pAmpMixer1(aAmp1), pAmpMixer2(aAmp2), pAmpMixer3(aAmp3), ampHandler() { IResourceLibrary reslib; //Set up the title name.setText(reslib.loadString(TITLE_MIXER)); name.setForegroundColor ( IColor(IColor::kRed) ); slVolume.setArmRange (IRange(0,100)); slVolume.setRotationIncrement (10); slVolume.setTickSpacing (1); slVolume.setText (reslib.loadString(STR_VOLUME)); addToCell (&slVolume, 1, 1, 1, 1); slBalance.setArmRange (IRange(0,100)); slBalance.setRotationIncrement(10); slBalance.setTickSpacing (1); slBalance.setText (reslib.loadString(STR_BALANCE)); addToCell (&slBalance, 2, 1, 1, 1); slBass.setArmRange (IRange(0,100)); slBass.setRotationIncrement (10); slBass.setTickSpacing (1); slBass.setText (reslib.loadString(STR_BASS)); addToCell (&slBass, 3, 1, 1, 1); slTreble.setArmRange (IRange(0,100)); slTreble.setRotationIncrement (10); slTreble.setTickSpacing (1); slTreble.setText (reslib.loadString(STR_TREBLE)); addToCell (&slTreble, 4, 1, 1, 1); slPitch.setArmRange (IRange(0,100)); slPitch.setRotationIncrement (10); slPitch.setTickSpacing (1); slPitch.setText (reslib.loadString(STR_PITCH)); addToCell (&slPitch, 5, 1, 1, 1); slGain.setArmRange (IRange(0,100)); slGain.setRotationIncrement (10); slGain.setTickSpacing (1); slGain.setText (reslib.loadString(STR_GAIN)); addToCell (&slGain, 6, 1, 1, 1); addToCell (&name, 3, 2, 3, 1); ampHandler.handleEventsFor(this); IMMAmpMixer* tempAmp = 0; if (pAmpMixer3) tempAmp=pAmpMixer3; else if (pAmpMixer2) tempAmp=pAmpMixer2; else if (pAmpMixer1) tempAmp=pAmpMixer1; if (tempAmp) { slVolume.setValue (tempAmp->volume ()); slBalance.setValue(tempAmp->balance()); slBass.setValue (tempAmp->bass ()); slTreble.setValue (tempAmp->treble ()); slPitch.setValue (tempAmp->pitch ()); slGain.setValue (tempAmp->gain ()); } /* endif */ }
ATKSideChainCompressor::ATKSideChainCompressor(IPlugInstanceInfo instanceInfo) : IPLUG_CTOR(kNumParams, kNumPrograms, instanceInfo), inLFilter(nullptr, 1, 0, false), inRFilter(nullptr, 1, 0, false), inSideChainLFilter(nullptr, 1, 0, false), inSideChainRFilter(nullptr, 1, 0, false), volumesplitFilter(4), applyGainFilter(2), volumemergeFilter(2), drywetFilter(2), outLFilter(nullptr, 1, 0, false), outRFilter(nullptr, 1, 0, false) { TRACE; //arguments are: name, defaultVal, minVal, maxVal, step, label GetParam(kMiddleside)->InitBool("Middle/Side processing", 0, ""); GetParam(kLinkChannels)->InitBool("Link channels", 0, ""); GetParam(kActivateChannel1)->InitBool("Enable Channel 1", 1, ""); GetParam(kActivateChannel2)->InitBool("Enable Channel 2", 1, ""); GetParam(kAttack1)->InitDouble("Attack ch1", 10., 1., 100.0, 0.1, "ms"); GetParam(kAttack1)->SetShape(2.); GetParam(kRelease1)->InitDouble("Release ch1", 10, 1., 100.0, 0.1, "ms"); GetParam(kRelease1)->SetShape(2.); GetParam(kThreshold1)->InitDouble("Threshold ch1", 0., -40., 0.0, 0.1, "dB"); // threshold is actually power GetParam(kThreshold1)->SetShape(2.); GetParam(kRatio1)->InitDouble("Ratio ch1", 2., .1, 100, .1, "-"); GetParam(kRatio1)->SetShape(2.); GetParam(kSoftness1)->InitDouble("Softness ch1", -2, -4, 0, 0.1, "-"); GetParam(kSoftness1)->SetShape(2.); GetParam(kMakeup1)->InitDouble("Makeup Gain ch1", 0, 0, 40, 0.1, "-"); // Makeup is expressed in amplitude GetParam(kMakeup1)->SetShape(2.); GetParam(kAttack2)->InitDouble("Attack ch2", 10., 1., 100.0, 0.1, "ms"); GetParam(kAttack2)->SetShape(2.); GetParam(kRelease2)->InitDouble("Release ch2", 10, 1., 100.0, 0.1, "ms"); GetParam(kRelease2)->SetShape(2.); GetParam(kThreshold2)->InitDouble("Threshold ch2", 0., -40., 0.0, 0.1, "dB"); // threshold is actually power GetParam(kThreshold2)->SetShape(2.); GetParam(kRatio2)->InitDouble("Ratio ch2", 2., .1, 100, .1, "-"); GetParam(kRatio2)->SetShape(2.); GetParam(kSoftness2)->InitDouble("Softness ch2", -2, -4, 0, 0.1, "-"); GetParam(kSoftness2)->SetShape(2.); GetParam(kMakeup2)->InitDouble("Makeup Gain ch2", 0, 0, 40, 0.1, "-"); // Makeup is expressed in amplitude GetParam(kMakeup2)->SetShape(2.); GetParam(kDryWet)->InitDouble("Dry/Wet", 1, 0, 1, 0.01, "-"); GetParam(kDryWet)->SetShape(1.); IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight); pGraphics->AttachBackground(STEREO_COMPRESSOR_ID, STEREO_COMPRESSOR_FN); IBitmap knob = pGraphics->LoadIBitmap(KNOB_ID, KNOB_FN, kKnobFrames); IBitmap knob1 = pGraphics->LoadIBitmap(KNOB1_ID, KNOB1_FN, kKnobFrames1); IBitmap myswitch = pGraphics->LoadIBitmap(SWITCH_ID, SWITCH_FN, 2); IColor color = IColor(255, 255, 255, 255); IText text = IText(10, &color, nullptr, IText::kStyleBold); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kAttack1X, kAttack1Y, kAttack1X + 78, kAttack1Y + 78 + 21), kAttack1, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kRelease1X, kRelease1Y, kRelease1X + 78, kRelease1Y + 78 + 21), kRelease1, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kThreshold1X, kThreshold1Y, kThreshold1X + 78, kThreshold1Y + 78 + 21), kThreshold1, &knob, &text, "dB")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kRatio1X, kRatio1Y, kRatio1X + 78, kRatio1Y + 78 + 21), kRatio1, &knob, &text, "")); pGraphics->AttachControl(new IKnobMultiControl(this, kSoftness1X, kSoftness1Y, kSoftness1, &knob)); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kMakeup1X, kMakeup1Y, kMakeup1X + 78, kMakeup1Y + 78 + 21), kMakeup1, &knob, &text, "dB")); attack2 = new IKnobMultiControlText(this, IRECT(kAttack2X, kAttack2Y, kAttack2X + 78, kAttack2Y + 78 + 21), kAttack2, &knob, &text, "ms"); pGraphics->AttachControl(attack2); release2 = new IKnobMultiControlText(this, IRECT(kRelease2X, kRelease2Y, kRelease2X + 78, kRelease2Y + 78 + 21), kRelease2, &knob, &text, "ms"); pGraphics->AttachControl(release2); threshold2 = new IKnobMultiControlText(this, IRECT(kThreshold2X, kThreshold2Y, kThreshold2X + 78, kThreshold2Y + 78 + 21), kThreshold2, &knob, &text, "dB"); pGraphics->AttachControl(threshold2); ratio2 = new IKnobMultiControlText(this, IRECT(kRatio2X, kRatio2Y, kRatio2X + 78, kRatio2Y + 78 + 21), kRatio2, &knob, &text, ""); pGraphics->AttachControl(ratio2); softness2 = new IKnobMultiControl(this, kSoftness2X, kSoftness2Y, kSoftness2, &knob); pGraphics->AttachControl(softness2); makeup2 = new IKnobMultiControlText(this, IRECT(kMakeup2X, kMakeup2Y, kMakeup2X + 78, kMakeup2Y + 78 + 21), kMakeup2, &knob, &text, "dB"); pGraphics->AttachControl(makeup2); pGraphics->AttachControl(new IKnobMultiControl(this, kDryWetX, kDryWetY, kDryWet, &knob1)); pGraphics->AttachControl(new ISwitchControl(this, kMiddlesideX, kMiddlesideY, kMiddleside, &myswitch)); pGraphics->AttachControl(new ISwitchControl(this, kLinkChannelsX, kLinkChannelsY, kLinkChannels, &myswitch)); pGraphics->AttachControl(new ISwitchControl(this, kActivateChannel1X, kActivateChannel1Y, kActivateChannel1, &myswitch)); pGraphics->AttachControl(new ISwitchControl(this, kActivateChannel2X, kActivateChannel2Y, kActivateChannel2, &myswitch)); AttachGraphics(pGraphics); //MakePreset("preset 1", ... ); MakePreset("Serial compression", false, false, true, true, 10., 10., 0., 2., -2., 0., 10., 10., 0., 2., -2., 0., 0.); MakePreset("Middle/side compression", true, false, true, true, 10., 10., 0., 2., -2., 0., 10., 10., 0., 2., -2., 0., 0.); MakePreset("Parallel compression", false, false, false, false, 10., 10., 0., 2., -2., 0., 10., 10., 0., 2., -2., 0., 0.5); volumesplitFilter.set_volume(std::sqrt(.5)); volumemergeFilter.set_volume(std::sqrt(.5)); endpoint.add_filter(&outLFilter); endpoint.add_filter(&outRFilter); powerFilter1.set_input_port(0, &inSideChainLFilter, 0); gainCompressorFilter1.set_input_port(0, &powerFilter1, 0); attackReleaseFilter1.set_input_port(0, &gainCompressorFilter1, 0); applyGainFilter.set_input_port(0, &attackReleaseFilter1, 0); applyGainFilter.set_input_port(1, &inLFilter, 0); makeupFilter1.set_input_port(0, &applyGainFilter, 0); drywetFilter.set_input_port(0, &makeupFilter1, 0); drywetFilter.set_input_port(1, &inLFilter, 0); outLFilter.set_input_port(0, &drywetFilter, 0); powerFilter2.set_input_port(0, &inSideChainRFilter, 0); gainCompressorFilter2.set_input_port(0, &powerFilter2, 0); attackReleaseFilter2.set_input_port(0, &gainCompressorFilter2, 0); applyGainFilter.set_input_port(2, &attackReleaseFilter2, 0); applyGainFilter.set_input_port(3, &inRFilter, 0); makeupFilter2.set_input_port(0, &applyGainFilter, 1); drywetFilter.set_input_port(2, &makeupFilter2, 0); drywetFilter.set_input_port(3, &inRFilter, 0); outRFilter.set_input_port(0, &drywetFilter, 1); middlesidesplitFilter.set_input_port(0, &inLFilter, 0); middlesidesplitFilter.set_input_port(1, &inRFilter, 0); sidechainmiddlesidesplitFilter.set_input_port(0, &inSideChainLFilter, 0); sidechainmiddlesidesplitFilter.set_input_port(1, &inSideChainRFilter, 0); volumesplitFilter.set_input_port(0, &middlesidesplitFilter, 0); volumesplitFilter.set_input_port(1, &middlesidesplitFilter, 1); volumesplitFilter.set_input_port(2, &sidechainmiddlesidesplitFilter, 0); volumesplitFilter.set_input_port(3, &sidechainmiddlesidesplitFilter, 1); middlesidemergeFilter.set_input_port(0, &makeupFilter1, 0); middlesidemergeFilter.set_input_port(1, &makeupFilter2, 0); volumemergeFilter.set_input_port(0, &middlesidemergeFilter, 0); volumemergeFilter.set_input_port(1, &middlesidemergeFilter, 1); sumFilter.set_input_port(0, &powerFilter1, 0); sumFilter.set_input_port(1, &powerFilter2, 0); powerFilter1.set_memory(0); powerFilter2.set_memory(0); Reset(); }
Blackboard::Blackboard( unsigned long id, IWindow * parent, IWindow * owner, const IRectangle & rect, const IFrameWindow::Style & style, const char * title) : IFrameWindow((partWindowId) ? partWindowId : id, parent, owner, rect, style, title) { partWindowId = (partWindowId) ? partWindowId : id; iCanvas = new ICanvas( IC_FRAME_CLIENT_ID, this, this, IRectangle()); iWriteBoard = new IPushButton( partWindowId+WNDOFFSET_Blackboard_WriteBoard, iCanvas, iCanvas, IRectangle(IPoint(10,15),ISize(80, 30)), IPushButton::defaultStyle() | IPushButton::defaultButton); iClearButton = new IPushButton( partWindowId+WNDOFFSET_Blackboard_ClearButton, iCanvas, iCanvas, IRectangle(IPoint(115,15),ISize(80, 30))); iExitButton = new IPushButton( partWindowId+WNDOFFSET_Blackboard_ExitButton, iCanvas, iCanvas, IRectangle(IPoint(222,15),ISize(80, 30))); iOutputGroup = new IGroupBox( partWindowId+WNDOFFSET_Blackboard_OutputGroup, iCanvas, iCanvas, IRectangle(IPoint(14,240),ISize(282, 137))); iInputGroup = new IGroupBox( partWindowId+WNDOFFSET_Blackboard_InputGroup, iCanvas, iCanvas, IRectangle(IPoint(14,84),ISize(282, 138))); iNameTxt = new IStaticText( partWindowId+WNDOFFSET_Blackboard_NameTxt, iCanvas, iCanvas, IRectangle(IPoint(29,183),ISize(256, 21))); iCompanyTxt = new IStaticText( partWindowId+WNDOFFSET_Blackboard_CompanyTxt, iCanvas, iCanvas, IRectangle(IPoint(29,130),ISize(256, 21))); iNameTxt1 = new IStaticText( partWindowId+WNDOFFSET_Blackboard_NameTxt1, iCanvas, iCanvas, IRectangle(IPoint(29,336),ISize(256, 21))); iCompanyTxt3 = new IStaticText( partWindowId+WNDOFFSET_Blackboard_CompanyTxt3, iCanvas, iCanvas, IRectangle(IPoint(29,283),ISize(256, 21))); iCompanyEntry = new IEntryField( partWindowId+WNDOFFSET_Blackboard_CompanyEntry, iCanvas, iCanvas, IRectangle(IPoint(29,101),ISize(256, 21)), IEntryField::defaultStyle() | IControl::tabStop); iNameEntry = new IEntryField( partWindowId+WNDOFFSET_Blackboard_NameEntry, iCanvas, iCanvas, IRectangle(IPoint(29,160),ISize(256, 21)), IEntryField::defaultStyle() | IControl::tabStop); iCompanyBoard = new IEntryField( partWindowId+WNDOFFSET_Blackboard_CompanyBoard, iCanvas, iCanvas, IRectangle(IPoint(29,255),ISize(256, 21)), IEntryField::defaultStyle() | IEntryField::autoTab | IEntryField::readOnly); iNameBoard = new IEntryField( partWindowId+WNDOFFSET_Blackboard_NameBoard, iCanvas, iCanvas, IRectangle(IPoint(29,313),ISize(256, 21)), IEntryField::defaultStyle() | IEntryField::readOnly); conn0 = new BlackboardConn0(); conn3 = new BlackboardConn3(); conn4 = new BlackboardConn4(); conn5 = new BlackboardConn5(); conn7 = new BlackboardConn7(); conn17 = new BlackboardConn17(); this->setFocus(); this->setClient(iCanvas); iCanvas->setBackgroundColor(IColor(IColor::paleGray)); iWriteBoard->setText("~Write"); iClearButton->setText("~Clear"); iExitButton->setText("E~xit"); iOutputGroup->setText("Output"); iInputGroup->setText("Input"); iNameTxt->setAlignment(IStaticText::centerCenter); iNameTxt->setText("Name"); iCompanyTxt->setAlignment(IStaticText::centerCenter); iCompanyTxt->setText("Company"); iNameTxt1->setAlignment(IStaticText::centerCenter); iNameTxt1->setText("Name"); iCompanyTxt3->setAlignment(IStaticText::centerCenter); iCompanyTxt3->setText("Company"); iCompanyEntry->setLimit(100); iNameEntry->setLimit(100); iCompanyBoard->setLimit(100); iCompanyBoard->setBackgroundColor(IColor(IColor::paleGray)); iNameBoard->setLimit(100); iNameBoard->setBackgroundColor(IColor(IColor::paleGray)); } //end constructor
ATKTransientSplitter::ATKTransientSplitter(IPlugInstanceInfo instanceInfo) : IPLUG_CTOR(kNumParams, kNumPrograms, instanceInfo), inFilter(nullptr, 1, 0, false), gainSwellFilter(1, 256*1024), applyGainFilter(2), outTransientFilter(nullptr, 1, 0, false), outSustainFilter(nullptr, 1, 0, false) { TRACE; //arguments are: name, defaultVal, minVal, maxVal, step, label GetParam(kPower)->InitDouble("Power", 10., 0., 100.0, 0.1, "ms"); GetParam(kPower)->SetShape(2.); GetParam(kAttack)->InitDouble("Attack", 10., 1., 100.0, 0.1, "ms"); GetParam(kAttack)->SetShape(2.); GetParam(kAttackRatio)->InitDouble("Attack Ratio", 10., 0.1, 100.0, 0.1, "%"); GetParam(kRelease)->InitDouble("Release", 10, 1., 100.0, 0.1, "ms"); GetParam(kRelease)->SetShape(2.); GetParam(kReleaseRatio)->InitDouble("Release Ratio", 100, 0.1, 100.0, 0.1, "%"); GetParam(kThreshold)->InitDouble("Threshold", -30., -60., -20.0, 0.1, "dB"); // threshold is actually power GetParam(kSlope)->InitDouble("Slope", 2., 1, 10, .1, "-"); GetParam(kSlope)->SetShape(2.); GetParam(kSoftness)->InitDouble("Softness", -2, -4, 0, 0.1, "-"); GetParam(kSoftness)->SetShape(2.); IGraphics* pGraphics = MakeGraphics(this, kWidth, kHeight); pGraphics->AttachBackground(COLORED_COMPRESSOR_ID, COLORED_COMPRESSOR_FN); IBitmap knob = pGraphics->LoadIBitmap(KNOB_ID, KNOB_FN, kKnobFrames); IColor color = IColor(255, 255, 255, 255); IText text = IText(10, &color, nullptr, IText::kStyleBold); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kPowerX, kPowerY, kPowerX + 78, kPowerY + 78 + 21), kPower, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kAttackX, kAttackY, kAttackX + 78, kAttackY + 78 + 21), kAttack, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kAttackRatioX, kAttackRatioY, kAttackRatioX + 78, kAttackRatioY + 78 + 21), kAttackRatio, &knob, &text, "%")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kReleaseX, kReleaseY, kReleaseX + 78, kReleaseY + 78 + 21), kRelease, &knob, &text, "ms")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kReleaseRatioX, kReleaseRatioY, kReleaseRatioX + 78, kReleaseRatioY + 78 + 21), kReleaseRatio, &knob, &text, "%")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kThresholdX, kThresholdY, kThresholdX + 78, kThresholdY + 78 + 21), kThreshold, &knob, &text, "dB")); pGraphics->AttachControl(new IKnobMultiControlText(this, IRECT(kSlopeX, kSlopeY, kSlopeX + 78, kSlopeY + 78 + 21), kSlope, &knob, &text, "")); pGraphics->AttachControl(new IKnobMultiControl(this, kSoftnessX, kSoftnessY, kSoftness, &knob)); AttachGraphics(pGraphics); //MakePreset("preset 1", ... ); MakePreset("Serial Shaper", 10., 10., 10., 10., 100., -30., 2., -2.); MakePreset("Parallel Shaper", 10., 10., 10., 10., 100., -30., 2., -2.); powerFilter.set_input_port(0, &inFilter, 0); slowAttackReleaseFilter.set_input_port(0, &powerFilter, 0); fastAttackReleaseFilter.set_input_port(0, &powerFilter, 0); invertFilter.set_input_port(0, &slowAttackReleaseFilter, 0); sumFilter.set_input_port(0, &invertFilter, 0); sumFilter.set_input_port(1, &fastAttackReleaseFilter, 0); gainSwellFilter.set_input_port(0, &sumFilter, 0); oneMinusFilter.set_input_port(0, &gainSwellFilter, 0); applyGainFilter.set_input_port(0, &gainSwellFilter, 0); applyGainFilter.set_input_port(1, &inFilter, 0); applyGainFilter.set_input_port(2, &oneMinusFilter, 0); applyGainFilter.set_input_port(3, &inFilter, 0); outTransientFilter.set_input_port(0, &applyGainFilter, 1); outSustainFilter.set_input_port(0, &applyGainFilter, 0); invertFilter.set_volume(-1); sinkFilter.add_filter(&outTransientFilter); sinkFilter.add_filter(&outSustainFilter); Reset(); }