Пример #1
1
void GenericEditor::disable()
{
    isEnabled = false;
    GenericProcessor* p = (GenericProcessor*) getProcessor();
    p->enabledState(false);
}
Пример #2
0
bool ProcessorFactory::isProcessorKnown(const std::string& className) const {
    return (getProcessor(className) != 0);    
}
Пример #3
0
void LufsPluginEditor::exportToText( bool useCommasForDigitSeparation )
{
    LufsAudioProcessor* processor = getProcessor();

    const int updateSize = processor->m_lufsProcessor.getValidSize();

    const juce::String saveDirString( "saveDirectory" );
    const juce::String saveDir = getProcessor()->m_settings.getUserSettings()->getValue( saveDirString );

    juce::File directory;
    if ( saveDir.length() )
        directory = juce::File( directory );
    if ( !directory.exists() )
        directory = juce::File::getSpecialLocation( juce::File::userHomeDirectory );

    juce::FileChooser fileChooser( "Select text output file", directory, "*.txt" );
    if ( fileChooser.browseForFileToSave( true ) )
    {
        juce::File file( fileChooser.getResult() );
        if ( ! file.deleteFile() )
        {
            juce::AlertWindow::showMessageBox( juce::AlertWindow::NoIcon, "Unable to delete existing file, not saving.", "" );
            return;
        }

        // save chosen directory
        getProcessor()->m_settings.getUserSettings()->getValue( saveDirString, file.getParentDirectory().getFullPathName() );

        juce::FileOutputStream outputStream( file );

        juce::String text = "Time\tMomentary\tShort Term\tIntegrated\n";

        for ( int tens = 0; tens < updateSize ; tens += 10 )
        {
            // add time 
            const int seconds = tens / 10;
            const int hours = seconds / 3600;
            const int minutes = ( seconds - hours * 60 ) / 60;
            int shownSeconds = seconds - hours * 3600 - minutes * 60;
            juce::String line( hours );
            line << ":";
            if ( minutes < 10 )
                line << "0";
            line << minutes;
            line << ":";
            if ( shownSeconds < 10 )
                line << "0";
            line << shownSeconds;
            line << "\t";

            // add momentary
            line << juce::String( processor->m_lufsProcessor.getMomentaryVolumeArray()[ tens ], 1 );
            line << "\t";

            // add short term
            line << juce::String( processor->m_lufsProcessor.getShortTermVolumeArray()[ tens ], 1 );
            line << "\t";

            // add integrated
            line << juce::String( processor->m_lufsProcessor.getIntegratedVolumeArray()[ tens ], 1 );
            line << "\n";

            if ( useCommasForDigitSeparation )
                line = line.replaceCharacter( '.', ',' );

            text << line;
        }

        outputStream.writeText( text, false, false );
    }
}
Пример #4
0
bool GenericEditor::isMerger()
{
    return getProcessor()->isMerger();
}
Пример #5
0
//==============================================================================
AutoCompressorAudioProcessorEditor::AutoCompressorAudioProcessorEditor (AutoCompressorAudioProcessor* ownerFilter)
    : AudioProcessorEditor (ownerFilter)
{
    addAndMakeVisible (ratioSlider = new ParamSlider (*getProcessor(), ACProc::ratioParam));
    ratioSlider->setName ("ratioSlider");

    addAndMakeVisible (ratioLabel = new Label ("ratioLabel",
                                               TRANS("compression ratio")));
    ratioLabel->setFont (Font (15.00f, Font::plain));
    ratioLabel->setJustificationType (Justification::centredLeft);
    ratioLabel->setEditable (false, false, false);
    ratioLabel->setColour (TextEditor::textColourId, Colours::black);
    ratioLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (kneeWidthLabel = new Label ("kneeWidthLabel",
                                                   TRANS("knee width")));
    kneeWidthLabel->setFont (Font (15.00f, Font::plain));
    kneeWidthLabel->setJustificationType (Justification::centredLeft);
    kneeWidthLabel->setEditable (false, false, false);
    kneeWidthLabel->setColour (TextEditor::textColourId, Colours::black);
    kneeWidthLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (attackLabel = new Label ("attackLabel",
                                                TRANS("attack time")));
    attackLabel->setFont (Font (15.00f, Font::plain));
    attackLabel->setJustificationType (Justification::centredLeft);
    attackLabel->setEditable (false, false, false);
    attackLabel->setColour (TextEditor::textColourId, Colours::black);
    attackLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (releaseLabel = new Label ("releaseLabel",
                                                 TRANS("release time")));
    releaseLabel->setFont (Font (15.00f, Font::plain));
    releaseLabel->setJustificationType (Justification::centredLeft);
    releaseLabel->setEditable (false, false, false);
    releaseLabel->setColour (TextEditor::textColourId, Colours::black);
    releaseLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (gainLabel = new Label ("gainLabel",
                                              TRANS("make-up gain")));
    gainLabel->setFont (Font (15.00f, Font::plain));
    gainLabel->setJustificationType (Justification::centredLeft);
    gainLabel->setEditable (false, false, false);
    gainLabel->setColour (TextEditor::textColourId, Colours::black);
    gainLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (thresholdLabel = new Label ("thresholdLabel",
                                                   TRANS("threshold")));
    thresholdLabel->setFont (Font (15.00f, Font::plain));
    thresholdLabel->setJustificationType (Justification::centredLeft);
    thresholdLabel->setEditable (false, false, false);
    thresholdLabel->setColour (TextEditor::textColourId, Colours::black);
    thresholdLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (aboutButton = new ImageButton ("aboutButton"));
    aboutButton->setButtonText (String::empty);
    aboutButton->addListener (this);

    aboutButton->setImages (false, true, true,
                            Image(), 1.000f, Colour (0x00000000),
                            Image(), 1.000f, Colour (0x00000000),
                            Image(), 1.000f, Colour (0x00000000));
    addAndMakeVisible (presetBox = new ComboBox ("presetBox"));
    presetBox->setEditableText (true);
    presetBox->setJustificationType (Justification::centredLeft);
    presetBox->setTextWhenNothingSelected (String::empty);
    presetBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
    presetBox->addListener (this);

    addAndMakeVisible (thresholdSlider = new ParamSlider (*getProcessor(), ACProc::thresholdParam));
    thresholdSlider->setName ("thresholdSlider");

    addAndMakeVisible (kneeWidthSlider = new ParamSlider (*getProcessor(), ACProc::kneeWidthParam));
    kneeWidthSlider->setName ("kneeWidthSlider");

    addAndMakeVisible (gainSlider = new ParamSlider (*getProcessor(), ACProc::gainParam));
    gainSlider->setName ("gainSlider");

    addAndMakeVisible (attackSlider = new ParamSlider (*getProcessor(), ACProc::attackParam));
    attackSlider->setName ("attackSlider");

    addAndMakeVisible (releaseSlider = new ParamSlider (*getProcessor(), ACProc::releaseParam));
    releaseSlider->setName ("releaseSlider");

    addAndMakeVisible (activeButton = new ParamButton (*getProcessor(), ACProc::activeParam, true));
    activeButton->setName ("activeButton");

    addAndMakeVisible (autoKneeButton = new ParamButton (*getProcessor(), ACProc::autoKneeParam));
    autoKneeButton->setName ("autoKneeButton");

    addAndMakeVisible (autoGainButton = new ParamButton (*getProcessor(), ACProc::autoGainParam));
    autoGainButton->setName ("autoGainButton");

    addAndMakeVisible (autoAttackButton = new ParamButton (*getProcessor(), ACProc::autoAttackParam));
    autoAttackButton->setName ("autoAttackButton");

    addAndMakeVisible (autoReleaseButton = new ParamButton (*getProcessor(), ACProc::autoReleaseParam));
    autoReleaseButton->setName ("autoReleaseButton");

    addAndMakeVisible (meterComp = new MeterComponent (MeterComponent::MeterHorizontal, 20, 2, Colour(0xff176fff), Colour(0xff176fff), Colour(0xff176fff), Colour(0xff393939)));
    meterComp->setName ("meterComp");

    addAndMakeVisible (autoKneeLabel = new Label ("autoKneeLabel",
                                                  TRANS("auto knee")));
    autoKneeLabel->setFont (Font (11.00f, Font::plain));
    autoKneeLabel->setJustificationType (Justification::centredLeft);
    autoKneeLabel->setEditable (false, false, false);
    autoKneeLabel->setColour (TextEditor::textColourId, Colours::black);
    autoKneeLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (autoGainLabel = new Label ("autoGainLabel",
                                                  TRANS("auto gain")));
    autoGainLabel->setFont (Font (11.00f, Font::plain));
    autoGainLabel->setJustificationType (Justification::centredLeft);
    autoGainLabel->setEditable (false, false, false);
    autoGainLabel->setColour (TextEditor::textColourId, Colours::black);
    autoGainLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (autoAttackLabel = new Label ("autoAttackLabel",
                                                    TRANS("auto attack")));
    autoAttackLabel->setFont (Font (11.00f, Font::plain));
    autoAttackLabel->setJustificationType (Justification::centredLeft);
    autoAttackLabel->setEditable (false, false, false);
    autoAttackLabel->setColour (TextEditor::textColourId, Colours::black);
    autoAttackLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (autoReleaseLabel = new Label ("autoReleaseLabel",
                                                     TRANS("auto release")));
    autoReleaseLabel->setFont (Font (11.00f, Font::plain));
    autoReleaseLabel->setJustificationType (Justification::centredLeft);
    autoReleaseLabel->setEditable (false, false, false);
    autoReleaseLabel->setColour (TextEditor::textColourId, Colours::black);
    autoReleaseLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (meterLabel = new Label ("meterLabel",
                                               TRANS("gain reduction")));
    meterLabel->setFont (Font (11.00f, Font::plain));
    meterLabel->setJustificationType (Justification::centredLeft);
    meterLabel->setEditable (false, false, false);
    meterLabel->setColour (TextEditor::textColourId, Colours::black);
    meterLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (meterLabel2 = new Label ("meterLabel",
                                                TRANS("comp.\n"
                                                "active")));
    meterLabel2->setFont (Font (11.00f, Font::plain));
    meterLabel2->setJustificationType (Justification::centred);
    meterLabel2->setEditable (false, false, false);
    meterLabel2->setColour (TextEditor::textColourId, Colours::black);
    meterLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000));


    //[UserPreSize]
    aboutComp = new AboutComponent();

    for (int i = 0; i < getProcessor()->getNumPrograms(); ++i)
    {
        presetBox->addItem(getProcessor()->getProgramName(i), i + 1);
    }
    presetBox->setSelectedId(getProcessor()->getCurrentProgram() + 1, dontSendNotification);
    //[/UserPreSize]

    setSize (460, 400);


    //[Constructor] You can add your own custom stuff here..

    startTimer(50);

    //[/Constructor]
}
Пример #6
0
//==============================================================================
void JuceDemoPluginAudioProcessorEditor::timerCallback()
{
    updateTimecodeDisplay (getProcessor().lastPosInfo);
}
Пример #7
0
void GenericEditor::updateName()
{
    nodeId = getProcessor()->getNodeId();
    repaint();
}
Пример #8
0
void Ambix_converterAudioProcessorEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
{
    
    Ambix_converterAudioProcessor* ourProcessor = getProcessor();
	
	//std::cout << "index: " << comboBoxThatHasChanged->getSelectedId() << std::endl;

    if (comboBoxThatHasChanged != box_presets)
    {
        ourProcessor->active_preset = 0;
        ourProcessor->box_presets_text = "";
        box_presets->setText("", dontSendNotification);
    }
    
    if (comboBoxThatHasChanged == box_in_ch_seq)
    {
        //[UserComboBoxCode_box_in_ch_seq] -- add your combo box handling code here..
	
        float value = (float)box_in_ch_seq->getSelectedItemIndex() * 0.333f;
        ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, value);
        //[/UserComboBoxCode_box_in_ch_seq]
    }
    else if (comboBoxThatHasChanged == box_out_ch_seq)
    {
        //[UserComboBoxCode_box_out_ch_seq] -- add your combo box handling code here..
        float value = (float)box_out_ch_seq->getSelectedItemIndex() * 0.333f;
        ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, value);
        //[/UserComboBoxCode_box_out_ch_seq]
    }
    else if (comboBoxThatHasChanged == box_in_norm)
    {
        //[UserComboBoxCode_box_in_norm] -- add your combo box handling code here..
        float value = (float)box_in_norm->getSelectedItemIndex() * 0.333f;
        ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, value);
        //[/UserComboBoxCode_box_in_norm]
    }
    else if (comboBoxThatHasChanged == box_out_norm)
    {
        //[UserComboBoxCode_box_out_norm] -- add your combo box handling code here..
        float value = (float)box_out_norm->getSelectedItemIndex() * 0.333f;
        ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, value);
        //[/UserComboBoxCode_box_out_norm]
    }
    else if (comboBoxThatHasChanged == box_presets)
    {
        float seq_acn = 0.f;
        float seq_fuma = 0.5f;
        float seq_sid = 1.f;
        
        float norm_sn3d = 0.f;
        float norm_fuma = 0.5f;
        float norm_n3d = 1.f;
        
        /////////////////////////////
        // presets are defined here!
        ourProcessor->active_preset = box_presets->getSelectedId();
        ourProcessor->box_presets_text = box_presets->getText();
        
        if (box_presets->getSelectedId() == 1) { // .amb -> ambix
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_fuma);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_fuma);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 2) { // ambix -> .amb
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_fuma);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_fuma);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 3) { // UA -> ambix
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_n3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_sid);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 4) { // ambix -> UA
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_n3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_sid);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 5) { // Wigware/B2X -> ambix
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_fuma);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_fuma);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 6) { // ambix -> Wigware/B2X
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_fuma);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_fuma);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 7) { // iem_ambi -> ambix
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_sid);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 8) { // ambix -> iem_ambi
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_sid);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 9) { // ICST -> ambix
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_fuma);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 10) { // ambix -> ICST
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_fuma);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 11) { // mtx_spherical_harmonics -> ambix
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_n3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f); // ! dont ! flip condon shortley phase
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 1.f); // flip negative m
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);

        }
        
        
        if (box_presets->getSelectedId() == 12) { // ambix -> mtx_spherical_harmonics
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_n3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f); // !dont! flip condon shortley phase
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipParam, 1.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
        if (box_presets->getSelectedId() == 13) { // flat
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InNormParam, norm_sn3d);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutNormParam, norm_sn3d);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::InSeqParam, seq_acn);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::OutSeqParam, seq_acn);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlipCsParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlopParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::FlapParam, 0.f);
            
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::In2DParam, 0.f);
            ourProcessor->setParameterNotifyingHost(Ambix_converterAudioProcessor::Out2DParam, 0.f);
        }
        
        
    }
}
Пример #9
0
void Ambix_encoderAudioProcessorEditor::timerCallback()
{
    const ScopedTryLock myScopedTryLock (lock_);
    
    // try to lock -> avoid calling this method multiple times from outside
    if (myScopedTryLock.isLocked())
    {
        
        if (changed_)
        {
            changed_ = false;
            
            Ambix_encoderAudioProcessor* ourProcessor = getProcessor();
            
            sld_az->setValue((ourProcessor->getParameter(Ambix_encoderAudioProcessor::AzimuthParam) - 0.5f) * 360.f, dontSendNotification);
            sld_el->setValue((ourProcessor->getParameter(Ambix_encoderAudioProcessor::ElevationParam) - 0.5f) * 360.f, dontSendNotification);
            sld_size->setValue(ourProcessor->getParameter(Ambix_encoderAudioProcessor::SizeParam), dontSendNotification);
            
            /*
            // set for gui!
#if INPUT_CHANNELS > 1
            sphere_opengl->setSource((ourProcessor->getParameter(Ambix_encoderAudioProcessor::AzimuthParam) - 0.5f) * 360.f, (ourProcessor->getParameter(Ambix_encoderAudioProcessor::ElevationParam) - 0.5f) * 360.f, ourProcessor->getParameter(Ambix_encoderAudioProcessor::WidthParam));
#else
            sphere_opengl->setSource((ourProcessor->getParameter(Ambix_encoderAudioProcessor::AzimuthParam) - 0.5f) * 360.f, (ourProcessor->getParameter(Ambix_encoderAudioProcessor::ElevationParam) - 0.5f) * 360.f, 0.f);
#endif
            */
            
#if INPUT_CHANNELS > 1
            sld_width->setValue(ourProcessor->getParameter(Ambix_encoderAudioProcessor::WidthParam)*360.f, dontSendNotification);
#endif
            
            
            sld_speed->setValue(ourProcessor->getParameter(Ambix_encoderAudioProcessor::SpeedParam)*360, dontSendNotification);
            
            String az_mv;
            
            float azimuth_mv_param = ourProcessor->getParameter(Ambix_encoderAudioProcessor::AzimuthMvParam);
            float speed_param = ourProcessor->getParameter(Ambix_encoderAudioProcessor::SpeedParam);
            
            sld_az_move->setValue(azimuth_mv_param, dontSendNotification);
            
            
            
            if (azimuth_mv_param <= 0.48f)
            {
                az_mv << "-" << String((int)(pow(speed_param*360.f, (0.45f - azimuth_mv_param)*2.22222f)+0.5f)).substring(0, 5) << " deg/s"; // from 0->90deg/sec
            } else if (azimuth_mv_param >= 0.52f) {
                az_mv << String((int)(pow(speed_param*360.f, (azimuth_mv_param - 0.55f)*2.22222f) + 0.5f)).substring(0, 5) << " deg/s";
            } else {
                az_mv << "0 deg/s";
            }
            
            txt_az_move->setText(az_mv);
            
            
            String el_mv;
            
            float elevation_mv_param = ourProcessor->getParameter(Ambix_encoderAudioProcessor::ElevationMvParam);
            
            sld_el_move->setValue(elevation_mv_param, dontSendNotification);
            
            
            if (elevation_mv_param <= 0.48f)
            {
                el_mv << "-" << String((int)(pow(speed_param*360.f, (0.45f - elevation_mv_param)*2.22222f) + 0.5f)).substring(0, 4) << " deg/s"; // from 0->90deg/sec
            } else if (elevation_mv_param >= 0.52f) {
                el_mv << String((int)(pow(speed_param*360.f, (elevation_mv_param - 0.55f)*2.22222f) + 0.5f)).substring(0, 4) << " deg/s";
            } else {
                el_mv << "0 deg/s";
            }
            
            
            
            txt_el_move->setText(el_mv);
            
            
        }
    }
    
}
Пример #10
0
void TgcapstoneAudioProcessorEditor::comboBoxChanged (ComboBox* comboBox)
{
    getProcessor().distortionID = distSelect.getSelectedId();
}
Пример #11
0
void Ambix_converterAudioProcessorEditor::getParamsFromHost()
{
	std::cout << "getParams" << std::endl;
    Ambix_converterAudioProcessor* ourProcessor = getProcessor();
	
    // active preset
    
    if (ourProcessor->active_preset)
        box_presets->setSelectedId(ourProcessor->active_preset, dontSendNotification);
        
    
	// input channel sequence box
    float value = ourProcessor->getParameter(Ambix_converterAudioProcessor::InSeqParam);
	if (value < 0.33f) {
		box_in_ch_seq->setSelectedId(1, dontSendNotification);
	} else if (value >= 0.33 && value < 0.66f) {
		box_in_ch_seq->setSelectedId(2, dontSendNotification);
	} else if (value >= 0.66f) {
		box_in_ch_seq->setSelectedId(3, dontSendNotification);
	}
  
	// output channel sequence box
    value = ourProcessor->getParameter(Ambix_converterAudioProcessor::OutSeqParam);
	if (value < 0.33f) {
		box_out_ch_seq->setSelectedId(1, dontSendNotification);
	} else if (value >= 0.33 && value < 0.66f) {
		box_out_ch_seq->setSelectedId(2, dontSendNotification);
	} else if (value >= 0.66f) {
		box_out_ch_seq->setSelectedId(3, dontSendNotification);
	}
    
	// input normalization scheme box
    value = ourProcessor->getParameter(Ambix_converterAudioProcessor::InNormParam);
	if (value < 0.33f) {
		box_in_norm->setSelectedId(1, dontSendNotification);
	} else if (value >= 0.33 && value < 0.66f) {
		box_in_norm->setSelectedId(2, dontSendNotification);
	} else if (value >= 0.66f) {
		box_in_norm->setSelectedId(3, dontSendNotification);
	}
    
	// output normalization scheme box
    value = ourProcessor->getParameter(Ambix_converterAudioProcessor::OutNormParam);
	if (value < 0.33f) {
		box_out_norm->setSelectedId(1, dontSendNotification);
	} else if (value >= 0.33 && value < 0.66f) {
		box_out_norm->setSelectedId(2, dontSendNotification);
	} else if (value >= 0.66f) {
		box_out_norm->setSelectedId(3, dontSendNotification);
	}
    
    // condon shortley phase
    tgl_invert_cs->setToggleState((ourProcessor->getParameter(Ambix_converterAudioProcessor::FlipCsParam) > 0.5f), dontSendNotification);

    // flip
    tgl_flip->setToggleState((ourProcessor->getParameter(Ambix_converterAudioProcessor::FlipParam) > 0.5f), dontSendNotification);
    
    // flop
    tgl_flop->setToggleState((ourProcessor->getParameter(Ambix_converterAudioProcessor::FlopParam) > 0.5f), dontSendNotification);
    
    // flip
    tgl_flap->setToggleState((ourProcessor->getParameter(Ambix_converterAudioProcessor::FlapParam) > 0.5f), dontSendNotification);
    
    // in_2d
    tgl_in_2d->setToggleState((ourProcessor->getParameter(Ambix_converterAudioProcessor::In2DParam) > 0.5f), dontSendNotification);
    
    // out_2d
    tgl_out_2d->setToggleState((ourProcessor->getParameter(Ambix_converterAudioProcessor::Out2DParam) > 0.5f), dontSendNotification);
    
}
DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
:	QDialog( parent )
{
	setupUi( this );
	setAttribute( Qt::WA_DeleteOnClose, true );

	QString info;
	QTextStream s( &info );

	s << "<b>" << tr("Locale:") << "</b> ";
	QString locale = QLocale::c().name();
	s << (locale == "C" ? "en_us" : locale) << "<br /><br />";

#if defined(Q_OS_LINUX)
	QString package = getPackageVersion( QStringList() << "estonianidcard", false );
	QString utility = getPackageVersion( QStringList() << "qesteidutil", false );
	if ( !package.isEmpty() )
		s << "<b>" << tr("ID-card package version:") << "</b> " << package << "<br />";
	if ( !utility.isEmpty() )
		s << "<b>" << tr("ID-card utility version:") << "</b> " << utility << "<br />";
#else
	s << "<b>" << tr("ID-card utility version:") << "</b> " << QCoreApplication::applicationVersion() << "<br />";
#endif

	s << "<b>" << tr("OS:") << "</b> ";
#if defined(Q_OS_LINUX)
	QProcess p;
	p.start( "lsb_release", QStringList() << "-s" << "-d" );
	p.waitForReadyRead();
	s << p.readAll();
#elif defined(Q_OS_MAC)
	SInt32 major, minor, bugfix;
	
	if( Gestalt(gestaltSystemVersionMajor, &major) == noErr &&
			Gestalt(gestaltSystemVersionMinor, &minor) == noErr &&
			Gestalt(gestaltSystemVersionBugFix, &bugfix) == noErr )
		s << "Mac OS " << major << "." << minor << "." << bugfix;
	else
		s << "Mac OS 10.3";
#endif

	s << " (" << QSysInfo::WordSize << ")<br />";
#if defined(Q_OS_LINUX)
	s << "<b>" << tr("CPU:") << "</b> " << getProcessor() << "<br /><br />";
#endif

	s << "<b>" << tr("Library paths:") << "</b> " << QCoreApplication::libraryPaths().join( ";" ) << "<br />";

	s << "<b>" << tr("Libraries") << ":</b><br />";
#if defined(Q_OS_MAC)
	QProcess p;
	p.start( "/Library/OpenSC/bin/opensc-tool", QStringList() << "-i" );
	p.waitForReadyRead();
	s << p.readAll() << "<br />";
#elif defined(Q_OS_LINUX)
	s << getPackageVersion( QStringList() << "openssl" << "libpcsclite1" << "opensc" );
#endif
	s << "QT (" << qVersion() << ")<br />" << "<br />";

	s << "<b>" << tr("PCSC service status: ") << "</b>" << " " << (isPCSCRunning() ? tr("Running") : tr("Not running")) << "<br /><br />";

	s << "<b>" << tr("Card readers") << ":</b><br />" << getReaderInfo() << "<br />";

	QString browsers = getBrowsers();
	if ( !browsers.isEmpty() )
		s << "<b>" << tr("Browsers:") << "</b><br />" << browsers << "<br /><br />";

	diagnosticsText->setHtml( info );
}
Пример #13
0
void Multiband_compressorAudioProcessorEditor::timerCallback() {

    sliderOverallGain->setValue( getProcessor()->getOverallGain());
    sliderKneeWidth->setValue( getProcessor()->getKneeWidth());

    sliderLowGain->setValue(getProcessor()->getLowGain());
    sliderLowThreshold->setValue(getProcessor()->getLowThreshold());
    sliderLowRatio->setValue(getProcessor()->getLowRatio());
    sliderLowAttack->setValue(getProcessor()->getLowAttack());
    sliderLowRelease->setValue(getProcessor()->getLowRelease());

    sliderMidGain->setValue(getProcessor()->getMidGain());
    sliderMidThreshold->setValue(getProcessor()->getMidThreshold());
    sliderMidRatio->setValue(getProcessor()->getMidRatio());
    sliderMidAttack->setValue(getProcessor()->getMidAttack());
    sliderMidRelease->setValue(getProcessor()->getMidRelease());

    sliderHighGain->setValue(getProcessor()->getHighGain());
    sliderHighThreshold->setValue(getProcessor()->getHighThreshold());
    sliderHighRatio->setValue(getProcessor()->getHighRatio());
    sliderHighAttack->setValue(getProcessor()->getHighAttack());
    sliderHighRelease->setValue(getProcessor()->getHighRelease());

    buttonLowONOFF->setToggleState(getProcessor()->getLowONOFF(), dontSendNotification);
    buttonMidONOFF->setToggleState(getProcessor()->getMidONOFF(), dontSendNotification);
    buttonHighONOFF->setToggleState(getProcessor()->getHighONOFF(), dontSendNotification);

    sliderLowCutoff->setValue(getProcessor()->getLowCutoff());
    sliderHighCutoff->setValue(getProcessor()->getHighCutoff());


}
Пример #14
0
void Multiband_compressorAudioProcessorEditor::sliderValueChanged (Slider* sliderThatWasMoved)
{
    //[UsersliderValueChanged_Pre]
    //[/UsersliderValueChanged_Pre]

    if (sliderThatWasMoved == sliderLowThreshold)
    {
        //[UserSliderCode_sliderLowThreshold] -- add your slider handling code here..
        getProcessor()->setLowThreshold(sliderLowThreshold->getValue());
        //[/UserSliderCode_sliderLowThreshold]
    }
    else if (sliderThatWasMoved == sliderLowRatio)
    {
        //[UserSliderCode_sliderLowRatio] -- add your slider handling code here..
        getProcessor()->setLowRatio(sliderLowRatio->getValue());
        //[/UserSliderCode_sliderLowRatio]
    }
    else if (sliderThatWasMoved == sliderLowAttack)
    {
        //[UserSliderCode_sliderLowAttack] -- add your slider handling code here..
        getProcessor()->setLowAttack(sliderLowAttack->getValue());
        //[/UserSliderCode_sliderLowAttack]
    }
    else if (sliderThatWasMoved == sliderLowRelease)
    {
        //[UserSliderCode_sliderLowRelease] -- add your slider handling code here..
        getProcessor()->setLowRelease(sliderLowRelease->getValue());
        //[/UserSliderCode_sliderLowRelease]
    }
    else if (sliderThatWasMoved == sliderLowGain)
    {
        //[UserSliderCode_sliderLowGain] -- add your slider handling code here..
        getProcessor()->setLowGain(sliderLowGain->getValue());
        //[/UserSliderCode_sliderLowGain]
    }
    else if (sliderThatWasMoved == sliderMidThreshold)
    {
        //[UserSliderCode_sliderMidThreshold] -- add your slider handling code here..
        getProcessor()->setMidThreshold(sliderMidThreshold->getValue());
        //[/UserSliderCode_sliderMidThreshold]
    }
    else if (sliderThatWasMoved == sliderMidRatio)
    {
        //[UserSliderCode_sliderMidRatio] -- add your slider handling code here..
        getProcessor()->setMidRatio(sliderMidRatio->getValue());
        //[/UserSliderCode_sliderMidRatio]
    }
    else if (sliderThatWasMoved == sliderMidAttack)
    {
        //[UserSliderCode_sliderMidAttack] -- add your slider handling code here..
        getProcessor()->setMidAttack(sliderMidAttack->getValue());
        //[/UserSliderCode_sliderMidAttack]
    }
    else if (sliderThatWasMoved == sliderMidRelease)
    {
        //[UserSliderCode_sliderMidRelease] -- add your slider handling code here..
        getProcessor()->setMidRelease(sliderMidRelease->getValue());
        //[/UserSliderCode_sliderMidRelease]
    }
    else if (sliderThatWasMoved == sliderMidGain)
    {
        //[UserSliderCode_sliderMidGain] -- add your slider handling code here..
        getProcessor()->setMidGain(sliderMidGain->getValue());
        //[/UserSliderCode_sliderMidGain]
    }
    else if (sliderThatWasMoved == sliderHighThreshold)
    {
        //[UserSliderCode_sliderHighThreshold] -- add your slider handling code here..
        getProcessor()->setHighThreshold(sliderHighThreshold->getValue());
        //[/UserSliderCode_sliderHighThreshold]
    }
    else if (sliderThatWasMoved == sliderHighRatio)
    {
        //[UserSliderCode_sliderHighRatio] -- add your slider handling code here..
        getProcessor()->setHighRatio(sliderHighRatio->getValue());
        //[/UserSliderCode_sliderHighRatio]
    }
    else if (sliderThatWasMoved == sliderHighAttack)
    {
        //[UserSliderCode_sliderHighAttack] -- add your slider handling code here..
        getProcessor()->setHighAttack(sliderHighAttack->getValue());
        //[/UserSliderCode_sliderHighAttack]
    }
    else if (sliderThatWasMoved == sliderHighRelease)
    {
        //[UserSliderCode_sliderHighRelease] -- add your slider handling code here..
        getProcessor()->setHighRelease(sliderHighRelease->getValue());
        //[/UserSliderCode_sliderHighRelease]
    }
    else if (sliderThatWasMoved == sliderHighGain)
    {
        //[UserSliderCode_sliderHighGain] -- add your slider handling code here..
        getProcessor()->setHighGain(sliderHighGain->getValue());
        //[/UserSliderCode_sliderHighGain]
    }
    else if (sliderThatWasMoved == sliderKneeWidth)
    {
        //[UserSliderCode_sliderKneeWidth] -- add your slider handling code here..
        getProcessor()->setKneeWidth(sliderKneeWidth->getValue());
        //[/UserSliderCode_sliderKneeWidth]
    }
    else if (sliderThatWasMoved == sliderOverallGain)
    {
        //[UserSliderCode_sliderOverallGain] -- add your slider handling code here..
        getProcessor()->setOverallGain(sliderOverallGain->getValue());
        //[/UserSliderCode_sliderOverallGain]
    }
    else if (sliderThatWasMoved == sliderLowCutoff)
    {
        //[UserSliderCode_sliderLowCutoff] -- add your slider handling code here..
        getProcessor()->setLowCutoff(sliderLowCutoff->getValue());
        //[/UserSliderCode_sliderLowCutoff]
    }
    else if (sliderThatWasMoved == sliderHighCutoff)
    {
        //[UserSliderCode_sliderHighCutoff] -- add your slider handling code here..
        getProcessor()->setHighCutoff(sliderHighCutoff->getValue());
        //[/UserSliderCode_sliderHighCutoff]
    }

    //[UsersliderValueChanged_Post]
    //[/UsersliderValueChanged_Post]
}
Пример #15
0
void SpikeDetectorEditor::buttonEvent(Button* button)
{


    if (electrodeButtons.contains((ElectrodeButton*) button))
    {

        if (electrodeEditorButtons[0]->getToggleState()) // EDIT is active
        {
            ElectrodeButton* eb = (ElectrodeButton*) button;
            int electrodeNum = eb->getChannelNum()-1;

            // std::cout << "Channel number: " << electrodeNum << std::endl;
            Array<int> a;
            a.add(electrodeNum);
            channelSelector->setActiveChannels(a);

            SpikeDetector* processor = (SpikeDetector*) getProcessor();

            thresholdSlider->setActive(true);
            thresholdSlider->setValue(processor->getChannelThreshold(electrodeList->getSelectedItemIndex(),
                                                                     electrodeButtons.indexOf((ElectrodeButton*) button)));
        }
        else
        {

            SpikeDetector* processor = (SpikeDetector*) getProcessor();

            ElectrodeButton* eb = (ElectrodeButton*) button;
            int electrodeNum = electrodeList->getSelectedItemIndex();
            int channelNum = electrodeButtons.indexOf(eb);

            processor->setChannelActive(electrodeNum,
                                        channelNum,
                                        button->getToggleState());

            std::cout << "Disabling channel " << channelNum <<
                      " of electrode " << electrodeNum << std::endl;

        }


    }


    int num = numElectrodes->getText().getIntValue();

    if (button == upButton)
    {
        numElectrodes->setText(String(++num), sendNotification);

        return;

    }
    else if (button == downButton)
    {

        if (num > 1)
            numElectrodes->setText(String(--num), sendNotification);

        return;

    }
    else if (button == plusButton)
    {
        // std::cout << "Plus button pressed!" << std::endl;
        if (acquisitionIsActive)
        {
            sendActionMessage("Stop acquisition before adding electrodes.");
            return;
        }

        int type = electrodeTypes->getSelectedId();
        // std::cout << type << std::endl;
        int nChans;

        switch (type)
        {
            case 1:
                nChans = 1;
                break;
            case 2:
                nChans = 2;
                break;
            case 3:
                nChans = 4;
                break;
            default:
                nChans = 1;
        }

        for (int n = 0; n < num; n++)
        {
            if (!addElectrode(nChans))
            {
                sendActionMessage("Not enough channels to add electrode.");
            }
        }

        electrodeEditorButtons[1]->setToggleState(false, dontSendNotification);

        getEditorViewport()->makeEditorVisible(this, true, true);
        return;

    }
    else if (button == electrodeEditorButtons[0])   // EDIT
    {

        Array<int> activeChannels;

        for (int i = 0; i < electrodeButtons.size(); i++)
        {
            if (button->getToggleState())
            {
                electrodeButtons[i]->setToggleState(false, dontSendNotification);
                electrodeButtons[i]->setRadioGroupId(299);
                channelSelector->activateButtons();
                channelSelector->setRadioStatus(true);
            }
            else
            {
                electrodeButtons[i]->setToggleState(true, dontSendNotification);
                electrodeButtons[i]->setRadioGroupId(0);
                channelSelector->inactivateButtons();
                channelSelector->setRadioStatus(false);
                activeChannels.add(electrodeButtons[i]->getChannelNum()-1);
            }
        }


        if (!button->getToggleState())
        {
            thresholdSlider->setActive(false);

            // This will be -1 with nothing selected
            int selectedItemIndex = electrodeList->getSelectedItemIndex();
            if (selectedItemIndex != -1)
            {
                drawElectrodeButtons(selectedItemIndex);
            }
            else
            {
                electrodeButtons.clear();
            }
        }

        //   channelSelector->setActiveChannels(activeChannels);

        return;

    }
    else if (button == electrodeEditorButtons[1])   // MONITOR
    {

        Button* audioMonitorButton = electrodeEditorButtons[1];

        channelSelector->clearAudio();

        SpikeDetector* processor = (SpikeDetector*) getProcessor();

        Array<Electrode*> electrodes = processor->getElectrodes();

        for (int i = 0; i < electrodes.size(); i++)
        {
            Electrode* e = electrodes[i];
            e->isMonitored = false;
        }

        Electrode* e = processor->getActiveElectrode();

        if (e != nullptr)
        {

            e->isMonitored = audioMonitorButton->getToggleState();

            for (int i = 0; i < e->numChannels; i++)
            {
                std::cout << "Channel " << e->channels[i] << std::endl;
                int channelNum = e->channels[i];
                channelSelector->setAudioStatus(channelNum, audioMonitorButton->getToggleState());

            }
        }
        else
        {
            audioMonitorButton->setToggleState(false, dontSendNotification);
        }

        return;
    }
    else if (button == electrodeEditorButtons[2])   // DELETE
    {
        if (acquisitionIsActive)
        {
            sendActionMessage("Stop acquisition before deleting electrodes.");
            return;
        }

        removeElectrode(electrodeList->getSelectedItemIndex());

        getEditorViewport()->makeEditorVisible(this, true, true);

        return;
    }



}
Пример #16
0
//==============================================================================
StereoWidenerAudioProcessorEditor::StereoWidenerAudioProcessorEditor (StereoWidenerAudioProcessor* ownerFilter)
    : AudioProcessorEditor(ownerFilter)
{
    addAndMakeVisible (FreqLowSld = new Slider ("FreqLowSld"));
    FreqLowSld->setExplicitFocusOrder (5);
    FreqLowSld->setRange (0, 10, 0);
    FreqLowSld->setSliderStyle (Slider::ThreeValueHorizontal);
	//FreqLowSld->setMinAndMaxValues(minValue_, maxValue_, NotificationType::dontSendNotification);
    FreqLowSld->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20);
    FreqLowSld->addListener (this);

    addAndMakeVisible (FreqLowLabel = new Label ("FreqLowLabel",
                                                 TRANS("Low")));
    FreqLowLabel->setFont (Font (15.00f, Font::plain));
    FreqLowLabel->setJustificationType (Justification::centred);
    FreqLowLabel->setEditable (false, false, false);
    FreqLowLabel->setColour (TextEditor::textColourId, Colours::black);
    FreqLowLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (slider = new Slider ("new slider"));
    slider->setRange (0, 10, 0);
    slider->setSliderStyle (Slider::LinearHorizontal);
    slider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
    slider->addListener (this);

    addAndMakeVisible (slider2 = new Slider ("new slider"));
    slider2->setRange (0, 10, 0);
    slider2->setSliderStyle (Slider::LinearHorizontal);
    slider2->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
    slider2->addListener (this);

    addAndMakeVisible (slider3 = new Slider ("new slider"));
    slider3->setRange (0, 10, 0);
    slider3->setSliderStyle (Slider::LinearHorizontal);
    slider3->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
    slider3->addListener (this);

    addAndMakeVisible (slider4 = new Slider ("new slider"));
    slider4->setRange (0, 10, 0);
    slider4->setSliderStyle (Slider::LinearHorizontal);
    slider4->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
    slider4->addListener (this);

    addAndMakeVisible (Band1Label = new Label ("Band1Label",
                                               TRANS("Band 1")));
    Band1Label->setFont (Font (15.00f, Font::plain));
    Band1Label->setJustificationType (Justification::centred);
    Band1Label->setEditable (false, false, false);
    Band1Label->setColour (TextEditor::textColourId, Colours::black);
    Band1Label->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (Band2Label = new Label ("Band2Label",
                                               TRANS("Band 2")));
    Band2Label->setFont (Font (15.00f, Font::plain));
    Band2Label->setJustificationType (Justification::centred);
    Band2Label->setEditable (false, false, false);
    Band2Label->setColour (TextEditor::textColourId, Colours::black);
    Band2Label->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (Band3Label = new Label ("Band3Label",
                                               TRANS("Band 3\n")));
    Band3Label->setFont (Font (15.00f, Font::plain));
    Band3Label->setJustificationType (Justification::centredLeft);
    Band3Label->setEditable (false, false, false);
    Band3Label->setColour (TextEditor::textColourId, Colours::black);
    Band3Label->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

	//addAndMakeVisible (FreqLowPath = new Path ("Frequency Low Path", TRANS("Frequency Low\n")));

    //[UserPreSize]
    //[/UserPreSize]

    setSize (600, 400);


    //[Constructor] You can add your own custom stuff here..
	getProcessor()->RequestUIUpdate();//UI Update must be done each time a new editor is constructed
	startTimer(200);//starts timer with interval of 200mS
	//InvertStagesBtn->setClickingTogglesState(true);
    //[/Constructor]
}
Пример #17
0
SpikeDetectorEditor::SpikeDetectorEditor(GenericProcessor* parentNode, bool useDefaultParameterEditors=true)
    : GenericEditor(parentNode, useDefaultParameterEditors), isPlural(true)

{

    MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false);
    Typeface::Ptr typeface = new CustomTypeface(mis);
    font = Font(typeface);

    desiredWidth = 300;

    electrodeTypes = new ComboBox("Electrode Types");

    SpikeDetector* processor = (SpikeDetector*) getProcessor();

    for (int i = 0; i < processor->electrodeTypes.size(); i++)
    {
        String type = processor->electrodeTypes[i];
        electrodeTypes->addItem(type += "s", i+1);
    }

    electrodeTypes->setEditableText(false);
    electrodeTypes->setJustificationType(Justification::centredLeft);
    electrodeTypes->addListener(this);
    electrodeTypes->setBounds(65,40,110,20);
    electrodeTypes->setSelectedId(2);
    addAndMakeVisible(electrodeTypes);

    electrodeList = new ComboBox("Electrode List");
    electrodeList->setEditableText(false);
    electrodeList->setJustificationType(Justification::centredLeft);
    electrodeList->addListener(this);
    electrodeList->setBounds(15,75,115,20);
    addAndMakeVisible(electrodeList);

    numElectrodes = new Label("Number of Electrodes","1");
    numElectrodes->setEditable(true);
    numElectrodes->addListener(this);
    numElectrodes->setBounds(30,40,25,20);
    //labelTextChanged(numElectrodes);
    addAndMakeVisible(numElectrodes);

    upButton = new TriangleButton(1);
    upButton->addListener(this);
    upButton->setBounds(50,40,10,8);
    addAndMakeVisible(upButton);

    downButton = new TriangleButton(2);
    downButton->addListener(this);
    downButton->setBounds(50,50,10,8);
    addAndMakeVisible(downButton);

    plusButton = new UtilityButton("+", titleFont);
    plusButton->addListener(this);
    plusButton->setRadius(3.0f);
    plusButton->setBounds(15,42,14,14);
    addAndMakeVisible(plusButton);

    ElectrodeEditorButton* e1 = new ElectrodeEditorButton("EDIT",font);
    e1->addListener(this);
    addAndMakeVisible(e1);
    e1->setBounds(15,110,40,10);
    electrodeEditorButtons.add(e1);

    ElectrodeEditorButton* e2 = new ElectrodeEditorButton("MONITOR",font);
    e2->addListener(this);
    addAndMakeVisible(e2);
    e2->setBounds(55,110,70,10);
    electrodeEditorButtons.add(e2);

    ElectrodeEditorButton* e3 = new ElectrodeEditorButton("DELETE",font);
    e3->addListener(this);
    addAndMakeVisible(e3);
    e3->setBounds(130,110,70,10);
    electrodeEditorButtons.add(e3);

    thresholdSlider = new ThresholdSlider(font);
    thresholdSlider->setBounds(200,35,75,75);
    addAndMakeVisible(thresholdSlider);
    thresholdSlider->addListener(this);
    thresholdSlider->setActive(false);
    Array<double> v;
    thresholdSlider->setValues(v);

    thresholdLabel = new Label("Name","Threshold");
    font.setHeight(10);
    thresholdLabel->setFont(font);
    thresholdLabel->setBounds(202, 105, 95, 15);
    thresholdLabel->setColour(Label::textColourId, Colours::grey);
    addAndMakeVisible(thresholdLabel);

    // create a custom channel selector
    //deleteAndZero(channelSelector);

    // channelSelector = new ChannelSelector(false, font);
    //  addChildComponent(channelSelector);
    // channelSelector->setVisible(false);
    //
    //  Array<int> a;

    channelSelector->inactivateButtons();
    channelSelector->paramButtonsToggledByDefault(false);
    //  channelSelector->paramButtonsActiveByDefault(false);

}
Пример #18
0
void SpikeDetectorEditor::buttonEvent(Button* button)
{

    if (electrodeEditorButtons[0]->getToggleState()) // EDIT is active
    {

        std::cout << "Editing active." << std::endl;

        if (electrodeButtons.contains((ElectrodeButton*) button))
        {
            ElectrodeButton* eb = (ElectrodeButton*) button;
            int electrodeNum = eb->getChannelNum()-1;

            std::cout << "Channel number: " << electrodeNum << std::endl;
            Array<int> a;
            a.add(electrodeNum);
            channelSelector->setActiveChannels(a);

            SpikeDetector* processor = (SpikeDetector*) getProcessor();

            thresholdSlider->setActive(true);
            thresholdSlider->setValue(processor->getChannelThreshold(electrodeList->getSelectedItemIndex(),
                                                                     electrodeButtons.indexOf((ElectrodeButton*) button)));
        }
    }

    int num = numElectrodes->getText().getIntValue();

    if (button == upButton)
    {
        numElectrodes->setText(String(++num), true);

        return;

    }
    else if (button == downButton)
    {

        if (num > 1)
            numElectrodes->setText(String(--num), true);

        return;

    }
    else if (button == plusButton)
    {
        // std::cout << "Plus button pressed!" << std::endl;

        int type = electrodeTypes->getSelectedId();
        std::cout << type << std::endl;
        int nChans;

        switch (type)
        {
            case 1:
                nChans = 1;
                break;
            case 2:
                nChans = 2;
                break;
            case 3:
                nChans = 4;
                break;
            default:
                nChans = 1;
        }

        for (int n = 0; n < num; n++)
        {
            if (!addElectrode(nChans))
            {
                sendActionMessage("Not enough channels to add electrode.");
            }
        }

        refreshElectrodeList();

        if (electrodeList->getNumItems() > 0)
        {
            electrodeList->setSelectedId(electrodeList->getNumItems(), true);
            electrodeList->setText(electrodeList->getItemText(electrodeList->getNumItems()-1));
            lastId = electrodeList->getNumItems();
            electrodeList->setEditableText(true);

            drawElectrodeButtons(electrodeList->getNumItems()-1);
        }

        getEditorViewport()->makeEditorVisible(this, true, true);
        return;

    }
    else if (button == electrodeEditorButtons[0])   // EDIT
    {

        Array<int> activeChannels;

        for (int i = 0; i < electrodeButtons.size(); i++)
        {
            if (button->getToggleState())
            {
                electrodeButtons[i]->setToggleState(false, false);
                electrodeButtons[i]->setRadioGroupId(299);
                channelSelector->activateButtons();
                channelSelector->setRadioStatus(true);
            }
            else
            {
                electrodeButtons[i]->setToggleState(true, false);
                electrodeButtons[i]->setRadioGroupId(0);
                channelSelector->inactivateButtons();
                channelSelector->setRadioStatus(false);
                activeChannels.add(electrodeButtons[i]->getChannelNum()-1);
            }
        }


        if (!button->getToggleState())
        {
            thresholdSlider->setActive(false);

            // This will be -1 with nothing selected
            int selectedItemIndex = electrodeList->getSelectedItemIndex();
            if (selectedItemIndex != -1)
            {
                drawElectrodeButtons(selectedItemIndex);
            }
            else
            {
                electrodeButtons.clear();
            }
        }

        //   channelSelector->setActiveChannels(activeChannels);

        return;

    }
    else if (button == electrodeEditorButtons[1])   // MONITOR
    {
        return;
    }
    else if (button == electrodeEditorButtons[2])   // DELETE
    {

        removeElectrode(electrodeList->getSelectedItemIndex());

        getEditorViewport()->makeEditorVisible(this, true, true);

        return;
    }



}
Пример #19
0
PulsePalOutputEditor::PulsePalOutputEditor(GenericProcessor* parentNode, PulsePal* pp, bool useDefaultParameterEditors=true)
    : GenericEditor(parentNode, useDefaultParameterEditors), pulsePal(pp)

{

    desiredWidth = 315;

    for (int i = 1; i < 5; i++)
    {
        ChannelTriggerInterface* cti = new ChannelTriggerInterface(pp, (PulsePalOutput*) getProcessor(), i);

        channelTriggerInterfaces.add(cti);

        cti->setBounds(10+75*(i-1),30,65,90);

        addAndMakeVisible(cti);

    }


}
Пример #20
0
bool SpikeDetectorEditor::addElectrode(int nChans)
{
    SpikeDetector* processor = (SpikeDetector*) getProcessor();
    return processor->addElectrode(nChans);
}
Пример #21
0
bool GenericEditor::isSplitter()
{
    return getProcessor()->isSplitter();
}
Пример #22
0
// This is our Slider::Listener callback, when the user drags a slider.
void AutomizerAudioProcessorEditor::sliderValueChanged (Slider* slider)
{
    // It's vital to use setParameterNotifyingHost to change any parameters that are automatable
    // by the host, rather than just modifying them directly, otherwise the host won't know
    // that they've changed.
    
    if (slider == &outputGainSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kOutputGain,
                                                   (float)outputGainSlider.getValue());
    }

    else if (slider == &voice1GainSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kVoice1Gain,
                                                   (float)voice1GainSlider.getValue());
    }
    else if (slider == &voice2GainSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kVoice2Gain,
                                                   (float)voice2GainSlider.getValue());
    }
    else if (slider == &transposeSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kTranspose,
                                                   (float)transposeSlider.getValue());
    }
    else if (slider == &pan1Slider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kPan1,
                                                   (float)pan1Slider.getValue());
    }

	 else if (slider == &pan2Slider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kPan2,
	                                              (float)pan2Slider.getValue());
	}
	 else if (slider == &attackSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kAttack,
	                                              (float)attackSlider.getValue());
	}
	 else if (slider == &refSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kRef,
	                                              (float)refSlider.getValue());
	}

	 else if (slider == &rollOnSlider)
    {
		getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kRollOn,
	                                              (float)rollOnSlider.getValue());
	}
	 else if (slider == &whitenSlider)
    {
		getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kWhite,
	                                              (float)whitenSlider.getValue());
	}


	 else if (slider == &harm1AttackSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kHarm1Attack,
	                                              (float)harm1AttackSlider.getValue());
	}
	 else if (slider == &harm2AttackSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kHarm2Attack,
	                                              (float)harm2AttackSlider.getValue());
	}
	 else if (slider == &vDepthSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kVibratoDepth,
	                                              (float)vDepthSlider.getValue());
	}
	 else if (slider == &vRateSlider)
    {
        getProcessor()->setParameterNotifyingHost (AutomizerAudioProcessor::kVibratoRate,
	                                              (float)vRateSlider.getValue());
	}
}
Пример #23
0
MLPluginView* MLPluginView::addSubView(const MLRect & r, const MLSymbol name)
{
	MLPluginView* b = new MLPluginView(getProcessor(), mpController);
	addWidgetToView(b, r, name);
	return b;
}
Пример #24
0
int GenericEditor::getStartChannel()
{
	return getProcessor()->getStartChannel();
}
Пример #25
0
Channel* GenericEditor::getEventChannel(int chan)
{
    return getProcessor()->eventChannels[chan];
}
Пример #26
0
void JuceDemoPluginAudioProcessorEditor::sliderValueChanged (Slider* sliderThatWasMoved)
{
    //[UsersliderValueChanged_Pre]
    //[/UsersliderValueChanged_Pre]

    if (sliderThatWasMoved == panSlider)
    {
        //[UserSliderCode_panSlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::PAN,                                                  (float)panSlider->getValue());
        //[/UserSliderCode_panSlider]
    }
    else if (sliderThatWasMoved == delaySlider)
    {
        //[UserSliderCode_delaySlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::DELAYAMOUNT,                                                  (float)delaySlider->getValue());
        //[/UserSliderCode_delaySlider]
    }
    else if (sliderThatWasMoved == delayTimeSlider)
    {
        //[UserSliderCode_delayTimeSlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::DELAYTIME, (float)delayTimeSlider->getValue());
        //[/UserSliderCode_delayTimeSlider]
    }
    else if (sliderThatWasMoved == midSideSlider)
    {
        //[UserSliderCode_midSideSlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::WIDTH,                                                  (float)midSideSlider->getValue());
        //[/UserSliderCode_midSideSlider]
    }
    else if (sliderThatWasMoved == saturationSlider)
    {
        //[UserSliderCode_saturationSlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::SATURATION,                                                  (float)saturationSlider->getValue());
        //[/UserSliderCode_saturationSlider]
    }
    else if (sliderThatWasMoved == hpfSlider)
    {
        //[UserSliderCode_hpfSlider] -- add your slider handling code here..
        double lpfFreq = lpfSlider->getValue();
        double hpfFreq = hpfSlider->getValue();
        if (hpfFreq > lpfFreq)
        {
            lpfSlider->setValue(hpfFreq);
            getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::LPFFREQ, (float)lpfFreq);
        }
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::HPFFREQ,			(float)hpfSlider->getValue());
        //[/UserSliderCode_hpfSlider]
    }
    else if (sliderThatWasMoved == reverbSizeSlider)
    {
        //[UserSliderCode_reverbSizeSlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::ROOMSIZE,			(float)reverbSizeSlider->getValue());
        //[/UserSliderCode_reverbSizeSlider]
    }
    else if (sliderThatWasMoved == wetGainSlider)
    {
        //[UserSliderCode_wetGainSlider] -- add your slider handling code here..
        getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::WETAMOUNT, (float)wetGainSlider->getValue());
        //[/UserSliderCode_wetGainSlider]
    }
    else if (sliderThatWasMoved == roomDampSlider)
    {
        //[UserSliderCode_roomDampSlider] -- add your slider handling code here..
		getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::ROOMDAMP, (float)roomDampSlider->getValue());
        //[/UserSliderCode_roomDampSlider]
    }
    else if (sliderThatWasMoved == lpfSlider)
    {
        //[UserSliderCode_lpfSlider] -- add your slider handling code here..
        double lpfFreq = lpfSlider->getValue();
        double hpfFreq = hpfSlider->getValue();
        if (lpfFreq < hpfFreq)
        {
            hpfSlider->setValue(lpfFreq);
            getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::HPFFREQ, (float)hpfFreq);
        }
        getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::LPFFREQ, (float)lpfFreq);

        //[/UserSliderCode_lpfSlider]
    }
    else if (sliderThatWasMoved == delayFeedbackSlider)
    {
        //[UserSliderCode_delayFeedbackSlider] -- add your slider handling code here..
        getProcessor()->setParameterNotifyingHost(JuceDemoPluginAudioProcessor::DELAYFEEDBACK, (float)delayFeedbackSlider->getValue());
        //[/UserSliderCode_delayFeedbackSlider]
    }

    //[UsersliderValueChanged_Post]
    //[/UsersliderValueChanged_Post]
}
Пример #27
0
void GenericEditor::enable()
{
    isEnabled = true;
    GenericProcessor* p = (GenericProcessor*) getProcessor();
    p->enabledState(true);
}
Пример #28
0
void LfpDisplayEditor::buttonClicked(Button* button)
{

	if (canvas == 0) {
		canvas = new LfpDisplayCanvas((LfpDisplayNode*) getProcessor());
		if (isPlaying)
			canvas->beginAnimation();
	}

	if (button == windowSelector)
	{
		if (dataWindow == 0) {

			dataWindow = new DataWindow(windowSelector);

			//if (canvas == 0)
			//	canvas = new LfpDisplayCanvas((LfpDisplayNode*) getProcessor());

			//dataWindow->setContentComponent(new LfpDisplayCanvas(streamBuffer,eventBuffer,getConfiguration(), this));

			if (tabSelector->getToggleState())
			{
				tabSelector->setToggleState(false, false);
				dataViewport->removeTab(tabIndex);
				tabIndex = -1;
			}

			//LfpDisplayNode* p = (LfpDisplayNode*) getProcessor();

			dataWindow->setContentNonOwned(canvas, false);
			//p->isVisible = true;

			//getProcessor()->parentComponentChanged();
			dataWindow->setVisible(true);
			
		} else {

			if (tabSelector->getToggleState())
			{
				tabSelector->setToggleState(false, false);
				dataViewport->removeTab(tabIndex);
				tabIndex = -1;
			}

			dataWindow->setVisible(windowSelector->getToggleState());

			//LfpDisplayNode* p = (LfpDisplayNode*) getProcessor();
			//p->isVisible = windowSelector->getToggleState();
			//getProcessor()->parentComponentChanged();
		}

	} else if (button == tabSelector)
	{
		if (tabSelector->getToggleState() && tabIndex < 0)
		{

			//std::cout << "Editor data viewport: " << dataViewport << std::endl;
			
			if (windowSelector->getToggleState())
			{
				windowSelector->setToggleState(false, false);
				dataWindow->setVisible(false);
			}

			//tabIndex = dataViewport->addTabToDataViewport("LFP",new LfpDisplayCanvas(streamBuffer,eventBuffer,getConfiguration(), this));
			//Component* p = (Component*) getProcessor();

			//LfpDisplayNode* p = (LfpDisplayNode*) getProcessor();
			tabIndex = dataViewport->addTabToDataViewport("LFP",canvas);
			//p->isVisible = true;

		} else if (!tabSelector->getToggleState() && tabIndex > -1)
		{
			dataViewport->removeTab(tabIndex);
			tabIndex = -1;
			//LfpDisplayNode* p = (LfpDisplayNode*) getProcessor();
			//p->isVisible = false;
		}
	}
}
Пример #29
0
bool GenericEditor::getEnabledState()
{
    GenericProcessor* p = (GenericProcessor*) getProcessor();
    return p->enabledState();
}
Пример #30
0
void FilterEditor::labelTextChanged(Label* label)
{
    FilterNode* fn = (FilterNode*) getProcessor();

    Value val = label->getTextValue();
    double requestedValue = double(val.getValue());

    if (requestedValue < 0.01 || requestedValue > 10000)
    {
        sendActionMessage("Value out of range.");

        if (label == highCutValue)
        {
            label->setText(lastHighCutString, dontSendNotification);
			lastHighCutString = label->getText();
        }
        else
        {
            label->setText(lastLowCutString, dontSendNotification);
			lastLowCutString = label->getText();
        }

        return;
    }

    Array<int> chans = getActiveChannels();

    // This needs to change, since there's not enough feedback about whether
    // or not individual channel settings were altered:

    for (int n = 0; n < chans.size(); n++)
    {

        if (label == highCutValue)
        {
            double minVal = fn->getLowCutValueForChannel(n);

            if (requestedValue > minVal)
            {
                fn->setCurrentChannel(n);
                fn->setParameter(1, requestedValue);
            }

            lastHighCutString = label->getText();

        }
        else
        {
            double maxVal = fn->getHighCutValueForChannel(n);

            if (requestedValue < maxVal)
            {
                fn->setCurrentChannel(n);
                fn->setParameter(0, requestedValue);
            }

            lastLowCutString = label->getText();
        }

    }

}