//==============================================================================
MidiKeyboardComponent::MidiKeyboardComponent (MidiKeyboardState& s, Orientation o)
    : state (s), orientation (o)
{
    scrollDown.reset (new UpDownButton (*this, -1));
    scrollUp  .reset (new UpDownButton (*this, 1));

    addChildComponent (scrollDown.get());
    addChildComponent (scrollUp.get());

    // initialise with a default set of qwerty key-mappings..
    int note = 0;

    for (char c : "awsedftgyhujkolp;")
        setKeyPressForNote (KeyPress (c, 0, 0), note++);

    mouseOverNotes.insertMultiple (0, -1, 32);
    mouseDownNotes.insertMultiple (0, -1, 32);

    colourChanged();
    setWantsKeyboardFocus (true);

    state.addListener (this);

    startTimerHz (20);
}
示例#2
0
void WaveViewer::showRealtimeFeedback() {
  if (wave_state_ == nullptr) {
    SynthGuiInterface* parent = findParentComponentOfClass<SynthGuiInterface>();
    if (parent) {
      wave_state_ = parent->getModSource(getName().toStdString());
      startTimerHz(FRAMES_PER_SECOND);
    }
  }
}
示例#3
0
void Mapping::onContainerParameterChangedInternal(Parameter * p)
{
	BaseItem::onContainerParameterChangedInternal(p);
	if (p == continuousProcess)
	{
		if(continuousProcess->boolValue()) startTimerHz(30);
		else stopTimer();
	}
}
示例#4
0
void Oscilloscope::showRealtimeFeedback(bool show_feedback) {
  if (show_feedback)
    startTimerHz(FRAMES_PER_SECOND);
  else {
    stopTimer();
    wave_path_.clear();
    repaint();
  }
}
示例#5
0
 void setRawStream(MemoryInputStream* stream)
 {
     thumbnail.setSource(new RawSource(stream));
     const Range<double> newRange (0.0, thumbnail.getTotalLength());
     scrollbar.setRangeLimits (newRange);
     setRange (newRange);
     
     startTimerHz (40);
 }
GraphicalStepSequencer::GraphicalStepSequencer() {
  num_steps_slider_ = nullptr;
  step_generator_output_ = nullptr;
  last_step_ = -1;
  highlighted_step_ = -1;
  num_steps_ = 1;
  startTimerHz(FRAMES_PER_SECOND);

  setOpaque(true);
}
//==============================================================================
ZenAudioProcessorValueTreeState::ZenAudioProcessorValueTreeState(AudioProcessor& p, UndoManager* um)
	: processor(p),
	undoManager(um),
	valueType("PARAM"),
	valuePropertyID("value"),
	idPropertyID("id"),
	updatingConnections(false)
{
	startTimerHz(10);
	state.addListener(this);	
}
    void setFile (const File& file)
    {
        if (! file.isDirectory())
        {
            thumbnail.setSource (new FileInputSource (file));
            const Range<double> newRange (0.0, thumbnail.getTotalLength());
            scrollbar.setRangeLimits (newRange);
            setRange (newRange);

            startTimerHz (40);
        }
    }
FilterParametersComponent::FilterParametersComponent(FilterParameters * filterParams)
	:_filterParamsPtr(filterParams)
	, typeSelector("Filter-Type")
	, frequencySlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, qSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
{
	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	typeSelector.addItemList(_filterParamsPtr->Type->getAllValueStrings(), 1);
	typeSelector.setSelectedItemIndex(_filterParamsPtr->Type->getIndex(), dontSendNotification);
	typeSelector.setJustificationType(Justification::centred);
	typeSelector.addListener(this);
	addAndMakeVisible(typeSelector);

	frequencySlider.setRange(_filterParamsPtr->Frequency->range.start,
							 _filterParamsPtr->Frequency->range.end, 0.01);
	frequencySlider.setValue(_filterParamsPtr->Frequency->get(), dontSendNotification);
	frequencySlider.setSkewFactor(0.3, false);					// GUI側のfrequencySliderの値の変化を指数カーブにする。
	frequencySlider.setPopupDisplayEnabled(true, true, this);
	frequencySlider.setPopupMenuEnabled(true);
	frequencySlider.setTextValueSuffix(" hz");
	frequencySlider.addListener(this);
	addAndMakeVisible(frequencySlider);

	qSlider.setRange(_filterParamsPtr->Q->range.start, _filterParamsPtr->Q->range.end, 0.01);
	qSlider.setValue(_filterParamsPtr->Q->get(), dontSendNotification);
	qSlider.setPopupDisplayEnabled(true, true, this);
	qSlider.setPopupMenuEnabled(true);
	qSlider.addListener(this);
	addAndMakeVisible(qSlider);

	typeLabel.setFont(paramLabelFont);
	typeLabel.setText("Type", dontSendNotification);
	typeLabel.setJustificationType(Justification::centred);
	typeLabel.setEditable(false, false, false);
	addAndMakeVisible(typeLabel);

	frequencyLabel.setFont(paramLabelFont);
	frequencyLabel.setText("Frequency", dontSendNotification);
	frequencyLabel.setJustificationType(Justification::centred);
	frequencyLabel.setEditable(false, false, false);
	addAndMakeVisible(frequencyLabel);

	qLabel.setFont(paramLabelFont);
	qLabel.setText("Q", dontSendNotification);
	qLabel.setJustificationType(Justification::centred);
	qLabel.setEditable(false, false, false);
	addAndMakeVisible(qLabel);

	startTimerHz(30.0f);
}
示例#10
0
    void setDemo (GraphicsDemoBase* newDemo)
    {
        if (currentDemo != nullptr)
            removeChildComponent (currentDemo);

        currentDemo = newDemo;

        if (currentDemo != nullptr)
        {
            addAndMakeVisible (currentDemo);
            startTimerHz (60);
            resized();
        }
    }
void GraphicalStepSequencer::showRealtimeFeedback(bool show_feedback) {
  if (show_feedback) {
    if (step_generator_output_ == nullptr) {
      SynthGuiInterface* parent = findParentComponentOfClass<SynthGuiInterface>();
      startTimerHz(FRAMES_PER_SECOND);
      if (parent)
        step_generator_output_ = parent->getModSource(getName().toStdString());
    }
  }
  else {
    stopTimer();
    step_generator_output_ = nullptr;
    last_step_ = -1;
    repaint();
  }
}
//==============================================================================
MainEditorWindow::MainEditorWindow (AlkamistMIDIDelayAudioProcessor& inputProcessor)
    : mParentProcessor (&inputProcessor)
{
    //[Constructor_pre] You can add your own custom stuff here..
    //[/Constructor_pre]

    addAndMakeVisible (delaySlider = new Slider ("Delay Slider"));
    delaySlider->setRange (0, 10, 0.01);
    delaySlider->setSliderStyle (Slider::RotaryVerticalDrag);
    delaySlider->setTextBoxStyle (Slider::TextBoxAbove, false, 80, 20);
    delaySlider->setColour (Slider::thumbColourId, Colour (0xff909090));
    delaySlider->setColour (Slider::trackColourId, Colour (0x7fdddddd));
    delaySlider->setColour (Slider::rotarySliderFillColourId, Colour (0x7fdddddd));
    delaySlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0x66dddddd));
    delaySlider->setColour (Slider::textBoxTextColourId, Colour (0xffdddddd));
    delaySlider->setColour (Slider::textBoxBackgroundColourId, Colour (0xff4a4a4a));
    delaySlider->setColour (Slider::textBoxHighlightColourId, Colour (0x40e4e4e4));
    delaySlider->addListener (this);

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


    //[UserPreSize]
    setAllSliderRanges();
    //[/UserPreSize]

    setSize (104, 128);


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

    delaySlider->setVelocityModeParameters(0.45, 1, 0.05, true);
    delaySlider->setDoubleClickReturnValue(true, 0.0);

    updateAllSliderValues();

    startTimerHz(60);

    //[/Constructor]
}
MiscParametersComponent::MiscParametersComponent(AudioParameterFloat* masterVolumeParam,
												AudioParameterInt* voiceSizeParam,
												AudioParameterBool* velocitySenseParam)
	:_masterVolumeParamPtr(masterVolumeParam)
	, _voiceSizeParamPtr(voiceSizeParam)
	, _velocitySenseParamPtr(velocitySenseParam)
	, masterVolumeSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, voiceSizeSlider(Slider::SliderStyle::IncDecButtons, Slider::TextEntryBoxPosition::TextBoxRight)
	, velocitySenseButton()
{
	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	masterVolumeSlider.setRange(_masterVolumeParamPtr->range.start,
								_masterVolumeParamPtr->range.end, 0.01);
	masterVolumeSlider.setValue(_masterVolumeParamPtr->get(), dontSendNotification);
	masterVolumeSlider.setPopupDisplayEnabled(true, true, this);
	masterVolumeSlider.setPopupMenuEnabled(true);
	masterVolumeSlider.setDoubleClickReturnValue(true, 0.0);
	masterVolumeSlider.setTextValueSuffix(" dB");
	masterVolumeSlider.addListener(this);
	addAndMakeVisible(masterVolumeSlider);

	voiceSizeSlider.setRange(_voiceSizeParamPtr->getRange().getStart(),
							 _voiceSizeParamPtr->getRange().getEnd(), 1.0);
	voiceSizeSlider.setValue(_voiceSizeParamPtr->get(), dontSendNotification);
	voiceSizeSlider.setTooltip("Size of synthesiser voice");
	voiceSizeSlider.addListener(this);
	addAndMakeVisible(voiceSizeSlider);

	velocitySenseButton.setButtonText("Key Velocity Sense");
	velocitySenseButton.addListener(this);
	addAndMakeVisible(velocitySenseButton);

	masterVolumeLabel.setFont(paramLabelFont);
	masterVolumeLabel.setText("Volume", dontSendNotification);
	masterVolumeLabel.setJustificationType(Justification::centred);
	masterVolumeLabel.setEditable(false, false, false);
	addAndMakeVisible(masterVolumeLabel);

	voiceSizeLabel.setFont(paramLabelFont);
	voiceSizeLabel.setText("Voice Size", dontSendNotification);
	voiceSizeLabel.setJustificationType(Justification::centred);
	voiceSizeLabel.setEditable(false, false, false);
	addAndMakeVisible(voiceSizeLabel);

	startTimerHz(30.0f);
}
示例#14
0
void WaveViewer::showRealtimeFeedback(bool show_feedback) {
  if (show_feedback) {
    if (wave_phase_ == nullptr) {
      SynthGuiInterface* parent = findParentComponentOfClass<SynthGuiInterface>();
      if (parent) {
        wave_amp_ = parent->getModSource(getName().toStdString());
        wave_phase_ = parent->getModSource(getName().toStdString() + "_phase");
        startTimerHz(FRAMES_PER_SECOND);
      }
    }
  }
  else {
    wave_phase_ = nullptr;
    stopTimer();
    repaint();
  }
}
//==============================================================================
JuceDemoPluginAudioProcessorEditor::JuceDemoPluginAudioProcessorEditor (JuceDemoPluginAudioProcessor& owner)
    : AudioProcessorEditor (owner),
      midiKeyboard (owner.keyboardState, MidiKeyboardComponent::horizontalKeyboard),
      timecodeDisplayLabel (String::empty),
      gainLabel (String::empty, "Throughput level:"),
      delayLabel (String::empty, "Delay:")
{
    // add some sliders..
    addAndMakeVisible (gainSlider = new ParameterSlider (*owner.gainParam));
    gainSlider->setSliderStyle (Slider::Rotary);

    addAndMakeVisible (delaySlider = new ParameterSlider (*owner.delayParam));
    delaySlider->setSliderStyle (Slider::Rotary);

    // add some labels for the sliders..
    gainLabel.attachToComponent (gainSlider, false);
    gainLabel.setFont (Font (11.0f));

    delayLabel.attachToComponent (delaySlider, false);
    delayLabel.setFont (Font (11.0f));

    // add the midi keyboard component..
    addAndMakeVisible (midiKeyboard);

    // add a label that will display the current timecode and status..
    addAndMakeVisible (timecodeDisplayLabel);
    timecodeDisplayLabel.setColour (Label::textColourId, Colours::blue);
    timecodeDisplayLabel.setFont (Font (Font::getDefaultMonospacedFontName(), 15.0f, Font::plain));

    // add the triangular resizer component for the bottom-right of the UI
    addAndMakeVisible (resizer = new ResizableCornerComponent (this, &resizeLimits));
    resizeLimits.setSizeLimits (150, 150, 800, 300);

    // set our component's initial size to be the last one that was stored in the filter's settings
    setSize (owner.lastUIWidth,
             owner.lastUIHeight);

    // start a timer which will keep our timecode display updated
    startTimerHz (30);
}
DriveParametersComponent::DriveParametersComponent(AudioParameterFloat* driveParam)
	:_driveParamPtr(driveParam)
	, gainSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
{
	gainSlider.setRange(_driveParamPtr->range.start, _driveParamPtr->range.end, 0.01);
	gainSlider.setValue(_driveParamPtr->get(), dontSendNotification);
	gainSlider.setPopupDisplayEnabled(true, true, this);
	gainSlider.setDoubleClickReturnValue(true, 0.0);
	gainSlider.setTextValueSuffix(" dB");
	gainSlider.addListener(this);
	addAndMakeVisible(gainSlider);

	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	gainLabel.setFont(paramLabelFont);
	gainLabel.setText("Gain", dontSendNotification);
	gainLabel.setJustificationType(Justification::centred);
	gainLabel.setEditable(false, false, false);
	addAndMakeVisible(gainLabel);

	startTimerHz(30.0f);
}
void AnimatedAppComponent::setFramesPerSecond (int framesPerSecond)
{
    jassert (framesPerSecond > 0 && framesPerSecond < 1000);
    startTimerHz (framesPerSecond);
}
void AudioVisualiserComponent::setRepaintRate (int frequencyInHz)
{
    startTimerHz (frequencyInHz);
}
示例#19
0
CustomSlider::CustomSlider (AudioProcessorParameter& p)
: Slider (p.getName (256)), param (p)
{
    startTimerHz (30);
    updateSliderPos();
}
示例#20
0
//==============================================================================
AudioProcessorValueTreeState::AudioProcessorValueTreeState (AudioProcessor& p, UndoManager* um)
    : processor (p), undoManager (um)
{
    startTimerHz (10);
    state.addListener (this);
}
ReverbParametersComponent::ReverbParametersComponent(ReverbParameters * reverbParams)
	: _reverbParamsPtr(reverbParams)
	, roomSizeSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, dampingSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, wetLevelSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, dryLevelSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, widthSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, freezeModeSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
{
	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	roomSizeSlider.setRange(_reverbParamsPtr->RoomSize->range.start, _reverbParamsPtr->RoomSize->range.end, 0.01);
	roomSizeSlider.setValue(_reverbParamsPtr->RoomSize->get(), dontSendNotification);
	roomSizeSlider.setPopupDisplayEnabled(true, true, this);
	roomSizeSlider.setPopupMenuEnabled(true);
	roomSizeSlider.addListener(this);
	addAndMakeVisible(roomSizeSlider);

	dampingSlider.setRange(_reverbParamsPtr->Damping->range.start, _reverbParamsPtr->Damping->range.end, 0.01);
	dampingSlider.setValue(_reverbParamsPtr->Damping->get(), dontSendNotification);
	dampingSlider.setPopupDisplayEnabled(true, true, this);
	dampingSlider.setPopupMenuEnabled(true);
	dampingSlider.addListener(this);
	addAndMakeVisible(dampingSlider);

	wetLevelSlider.setRange(_reverbParamsPtr->WetLevel->range.start, _reverbParamsPtr->WetLevel->range.end, 0.01);
	wetLevelSlider.setValue(_reverbParamsPtr->WetLevel->get(), dontSendNotification);
	wetLevelSlider.setPopupDisplayEnabled(true, true, this);
	wetLevelSlider.setPopupMenuEnabled(true);
	wetLevelSlider.addListener(this);
	addAndMakeVisible(wetLevelSlider);

	dryLevelSlider.setRange(_reverbParamsPtr->DryLevel->range.start, _reverbParamsPtr->DryLevel->range.end, 0.01);
	dryLevelSlider.setValue(_reverbParamsPtr->DryLevel->get(), dontSendNotification);
	dryLevelSlider.setPopupDisplayEnabled(true, true, this);
	dryLevelSlider.setPopupMenuEnabled(true);
	dryLevelSlider.addListener(this);
	addAndMakeVisible(dryLevelSlider);

	widthSlider.setRange(_reverbParamsPtr->Width->range.start, _reverbParamsPtr->Width->range.end, 0.01);
	widthSlider.setValue(_reverbParamsPtr->Width->get(), dontSendNotification);
	widthSlider.setPopupDisplayEnabled(true, true, this);
	widthSlider.setPopupMenuEnabled(true);
	widthSlider.addListener(this);
	addAndMakeVisible(widthSlider);

	freezeModeSlider.setRange(_reverbParamsPtr->FreezeMode->range.start, _reverbParamsPtr->FreezeMode->range.end, 0.01);
	freezeModeSlider.setValue(_reverbParamsPtr->FreezeMode->get(), dontSendNotification);
	freezeModeSlider.setPopupDisplayEnabled(true, true, this);
	freezeModeSlider.setDoubleClickReturnValue(true, 0.0);
	freezeModeSlider.setPopupMenuEnabled(true);
	freezeModeSlider.addListener(this);
	addAndMakeVisible(freezeModeSlider);

	roomSizeLabel.setFont(paramLabelFont);
	roomSizeLabel.setText("RoomSize", dontSendNotification);
	roomSizeLabel.setJustificationType(Justification::centred);
	roomSizeLabel.setEditable(false, false, false);
	addAndMakeVisible(roomSizeLabel);

	dampingLabel.setFont(paramLabelFont);
	dampingLabel.setText("Damping", dontSendNotification);
	dampingLabel.setJustificationType(Justification::centred);
	dampingLabel.setEditable(false, false, false);
	addAndMakeVisible(dampingLabel);

	wetLevelLabel.setFont(paramLabelFont);
	wetLevelLabel.setText("WetLevel", dontSendNotification);
	wetLevelLabel.setJustificationType(Justification::centred);
	wetLevelLabel.setEditable(false, false, false);
	addAndMakeVisible(wetLevelLabel);

	dryLevelLabel.setFont(paramLabelFont);
	dryLevelLabel.setText("DryLevel", dontSendNotification);
	dryLevelLabel.setJustificationType(Justification::centred);
	dryLevelLabel.setEditable(false, false, false);
	addAndMakeVisible(dryLevelLabel);

	widthLabel.setFont(paramLabelFont);
	widthLabel.setText("Width", dontSendNotification);
	widthLabel.setJustificationType(Justification::centred);
	widthLabel.setEditable(false, false, false);
	addAndMakeVisible(widthLabel);

	freezeModeLabel.setFont(paramLabelFont);
	freezeModeLabel.setText("Freeze", dontSendNotification);
	freezeModeLabel.setJustificationType(Justification::centred);
	freezeModeLabel.setEditable(false, false, false);
	addAndMakeVisible(freezeModeLabel);

	startTimerHz(30.0f);
}
//==============================================================================
ConsoleComponent::ConsoleComponent (BlueLiteDevice::Ptr blueliteDevice_)
    : blueliteDevice (blueliteDevice_)
{
    //[Constructor_pre] You can add your own custom stuff here..
    numberOfFaders = -1;
    //[/Constructor_pre]

    addAndMakeVisible (gmLabel = new Label ("new label",
                                            TRANS("100%")));
    gmLabel->setFont (Font (12.00f, Font::plain));
    gmLabel->setJustificationType (Justification::centred);
    gmLabel->setEditable (false, false, false);
    gmLabel->setColour (Label::textColourId, Colour (0xffd8d8d8));
    gmLabel->setColour (TextEditor::textColourId, Colours::black);
    gmLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

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

    addAndMakeVisible (gmSlider = new Slider ("new slider"));
    gmSlider->setTooltip (TRANS("Grand Master"));
    gmSlider->setRange (0, 8192, 1);
    gmSlider->setSliderStyle (Slider::LinearVertical);
    gmSlider->setTextBoxStyle (Slider::NoTextBox, true, 30, 20);
    gmSlider->addListener (this);

    addAndMakeVisible (loadButton = new TextButton ("new button"));
    loadButton->setTooltip (TRANS("Load an existing show from disk"));
    loadButton->setButtonText (TRANS("Open"));
    loadButton->addListener (this);

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

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

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

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

    addAndMakeVisible (newButton = new TextButton ("new button"));
    newButton->setTooltip (TRANS("Create a new show"));
    newButton->setButtonText (TRANS("New"));
    newButton->addListener (this);

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

    addAndMakeVisible (clearAllButton = new TextButton ("new button"));
    clearAllButton->setTooltip (TRANS("Clear all fader cue assignements"));
    clearAllButton->setButtonText (TRANS("Clear All"));
    clearAllButton->addListener (this);

    addAndMakeVisible (xLabel = new Label ("new label",
                                           TRANS("100%")));
    xLabel->setFont (Font (12.00f, Font::plain));
    xLabel->setJustificationType (Justification::centred);
    xLabel->setEditable (false, false, false);
    xLabel->setColour (Label::textColourId, Colour (0xffd8d8d8));
    xLabel->setColour (TextEditor::textColourId, Colours::black);
    xLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

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

    addAndMakeVisible (xSlider = new Slider ("new slider"));
    xSlider->setTooltip (TRANS("X Fader"));
    xSlider->setRange (0, 8192, 1);
    xSlider->setSliderStyle (Slider::LinearVertical);
    xSlider->setTextBoxStyle (Slider::NoTextBox, true, 30, 20);
    xSlider->addListener (this);

    addAndMakeVisible (yLabel = new Label ("new label",
                                           TRANS("0%")));
    yLabel->setFont (Font (12.00f, Font::plain));
    yLabel->setJustificationType (Justification::centred);
    yLabel->setEditable (false, false, false);
    yLabel->setColour (Label::textColourId, Colour (0xffd8d8d8));
    yLabel->setColour (TextEditor::textColourId, Colours::black);
    yLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

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

    addAndMakeVisible (ySlider = new Slider ("new slider"));
    ySlider->setTooltip (TRANS("Y Fader"));
    ySlider->setRange (0, 8192, 1);
    ySlider->setSliderStyle (Slider::LinearVertical);
    ySlider->setTextBoxStyle (Slider::NoTextBox, true, 30, 20);
    ySlider->addListener (this);

    addAndMakeVisible (xCueButton = new TextButton ("new button"));
    xCueButton->setTooltip (TRANS("Crossfade to X"));
    xCueButton->setButtonText (TRANS("0"));
    xCueButton->addListener (this);

    addAndMakeVisible (yCueButton = new TextButton ("new button"));
    yCueButton->setTooltip (TRANS("Crossfade to Y"));
    yCueButton->setButtonText (TRANS("0"));
    yCueButton->addListener (this);

    addAndMakeVisible (artnetButton = new ToggleButton ("new toggle button"));
    artnetButton->setTooltip (TRANS("Turn Art-Net output on and off"));
    artnetButton->setButtonText (TRANS("Art-Net Output"));
    artnetButton->addListener (this);
    artnetButton->setColour (ToggleButton::textColourId, Colour (0xffd8d8d8));

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

    drawable1 = Drawable::createFromImageData (BinaryData::x2large_png, BinaryData::x2large_pngSize);

    //[UserPreSize]
    gmSlider->setValue (8192, dontSendNotification);
    updateThumb (gmSlider);
    xSlider->setValue (8192, dontSendNotification);
    updateThumb (xSlider);
    ySlider->setValue (8192, dontSendNotification);
    updateThumb (ySlider);

    artnetButton->setWantsKeyboardFocus (false);

    dmxLabel->setText ("DMX: " + blueliteDevice->getDeviceName(), dontSendNotification);
    //[/UserPreSize]

    setSize (456, 312);


    //[Constructor] You can add your own custom stuff here..
    console = new Console (blueliteDevice);

    xFader = console->addSlider();
    console->setLevel (xFader, 8192);
    yFader = console->addSlider();

    updateStats();
    startTimerHz (15);
    //[/Constructor]
}
AmpEnvelopeParametersComponent::AmpEnvelopeParametersComponent(AmpEnvelopeParameters * ampEnvParams)
	:_ampEnvParamsPtr(ampEnvParams)
	, attackSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, decaySlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, sustainSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, releaseSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
{
	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	attackSlider.setRange(_ampEnvParamsPtr->Attack->range.start, _ampEnvParamsPtr->Attack->range.end, 0.01);
	attackSlider.setValue(_ampEnvParamsPtr->Attack->get(), dontSendNotification);
	attackSlider.setPopupDisplayEnabled(true, true, this);
	attackSlider.setPopupMenuEnabled(true);
	attackSlider.setTextValueSuffix(" seconds");
	attackSlider.addListener(this);
	addAndMakeVisible(attackSlider);

	decaySlider.setRange(_ampEnvParamsPtr->Decay->range.start, _ampEnvParamsPtr->Decay->range.end, 0.01);
	decaySlider.setValue(_ampEnvParamsPtr->Decay->get(), dontSendNotification);
	decaySlider.setPopupDisplayEnabled(true, true, this);
	decaySlider.setPopupMenuEnabled(true);
	decaySlider.setTextValueSuffix(" seconds");
	decaySlider.addListener(this);
	addAndMakeVisible(decaySlider);

	sustainSlider.setRange(_ampEnvParamsPtr->Sustain->range.start, _ampEnvParamsPtr->Sustain->range.end, 0.01);
	sustainSlider.setValue(_ampEnvParamsPtr->Sustain->get(), dontSendNotification);
	sustainSlider.setPopupDisplayEnabled(true, true, this);
	sustainSlider.setPopupMenuEnabled(true);
	sustainSlider.addListener(this);
	addAndMakeVisible(sustainSlider);

	releaseSlider.setRange(_ampEnvParamsPtr->Release->range.start, _ampEnvParamsPtr->Release->range.end, 0.01);
	releaseSlider.setValue(_ampEnvParamsPtr->Release->get(), dontSendNotification);
	releaseSlider.setPopupDisplayEnabled(true, true, this);
	releaseSlider.setPopupMenuEnabled(true);
	releaseSlider.setTextValueSuffix(" seconds");
	releaseSlider.addListener(this);
	addAndMakeVisible(releaseSlider);

	attackLabel.setFont(paramLabelFont);
	attackLabel.setText("Attack", dontSendNotification);
	attackLabel.setJustificationType(Justification::centred);
	attackLabel.setEditable(false, false, false);
	addAndMakeVisible(attackLabel);

	decayLabel.setFont(paramLabelFont);
	decayLabel.setText("Decay", dontSendNotification);
	decayLabel.setJustificationType(Justification::centred);
	decayLabel.setEditable(false, false, false);
	addAndMakeVisible(decayLabel);

	sustainLabel.setFont(paramLabelFont);
	sustainLabel.setText("Sustain", dontSendNotification);
	sustainLabel.setJustificationType(Justification::centred);
	sustainLabel.setEditable(false, false, false);
	addAndMakeVisible(sustainLabel);

	releaseLabel.setFont(paramLabelFont);
	releaseLabel.setText("Release", dontSendNotification);
	releaseLabel.setJustificationType(Justification::centred);
	releaseLabel.setEditable(false, false, false);
	addAndMakeVisible(releaseLabel);

	startTimerHz(30.0f);
}
LfoParametersComponent::LfoParametersComponent(LfoParameters * lfoParams)
	:_lfoParamsPtr(lfoParams)
	, targetSelector("LFO-Target")
	, waveTypeSelector("LFO-WaveType")
	, amountSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
	, speedSlider(Slider::SliderStyle::RotaryHorizontalVerticalDrag, Slider::TextEntryBoxPosition::NoTextBox)
{
	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	targetSelector.addItemList(_lfoParamsPtr->LfoTarget->getAllValueStrings(), 1);
	targetSelector.setSelectedItemIndex(_lfoParamsPtr->LfoTarget->getIndex(), dontSendNotification);
	targetSelector.setJustificationType(Justification::centred);
	targetSelector.addListener(this);
	addAndMakeVisible(targetSelector);

	waveTypeSelector.addItemList(_lfoParamsPtr->LfoWaveType->getAllValueStrings(), 1);
	waveTypeSelector.setSelectedItemIndex(_lfoParamsPtr->LfoWaveType->getIndex(), dontSendNotification);
	waveTypeSelector.setJustificationType(Justification::centred);
	waveTypeSelector.addListener(this);
	addAndMakeVisible(waveTypeSelector);

	amountSlider.setRange(_lfoParamsPtr->LfoAmount->range.start, _lfoParamsPtr->LfoAmount->range.end, 0.01);
	amountSlider.setValue(_lfoParamsPtr->LfoAmount->get(), dontSendNotification);
	amountSlider.setDoubleClickReturnValue(true, _lfoParamsPtr->LfoAmount->range.end);
	amountSlider.setPopupDisplayEnabled(true, true, this);
	amountSlider.setPopupMenuEnabled(true);
	amountSlider.addListener(this);
	addAndMakeVisible(amountSlider);

	speedSlider.setRange(_lfoParamsPtr->LfoSpeed->range.start, _lfoParamsPtr->LfoSpeed->range.end, 0.01);
	speedSlider.setValue(_lfoParamsPtr->LfoSpeed->get(), dontSendNotification);
	speedSlider.setSkewFactor(0.5, false);					// GUI側のspeedSliderの値の変化を指数カーブにする。
	speedSlider.setPopupDisplayEnabled(true, true, this);
	speedSlider.setPopupMenuEnabled(true);
	speedSlider.setTextValueSuffix(" hz");
	speedSlider.addListener(this);
	addAndMakeVisible(speedSlider);

	targetLabel.setFont(paramLabelFont);
	targetLabel.setText("Target", dontSendNotification);
	targetLabel.setJustificationType(Justification::centred);
	targetLabel.setEditable(false, false, false);
	addAndMakeVisible(targetLabel);

	waveTypeLabel.setFont(paramLabelFont);
	waveTypeLabel.setText("WaveType", dontSendNotification);
	waveTypeLabel.setJustificationType(Justification::centred);
	waveTypeLabel.setEditable(false, false, false);
	addAndMakeVisible(waveTypeLabel);

	amountLabel.setFont(paramLabelFont);
	amountLabel.setText("Amount", dontSendNotification);
	amountLabel.setJustificationType(Justification::centred);
	amountLabel.setEditable(false, false, false);
	addAndMakeVisible(amountLabel);

	speedLabel.setFont(paramLabelFont);
	speedLabel.setText("Speed", dontSendNotification);
	speedLabel.setJustificationType(Justification::centred);
	speedLabel.setEditable(false, false, false);
	addAndMakeVisible(speedLabel);
	
	startTimerHz(30.0f);
}
// ②引数付きコンストラクタ。引数としてパラメータセットを受け取るとともにスライダーコンポーネントの初期化子も記述している。
OscillatorParametersComponent::OscillatorParametersComponent(OscillatorParameters* oscParams)
	: _oscParamsPtr(oscParams)
	, sineWaveLevelSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, sawWaveLevelSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, triWaveLevelSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, squareWaveLevelSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
	, noiseLevelSlider(Slider::SliderStyle::LinearVertical, Slider::TextEntryBoxPosition::NoTextBox)
{

	// ③正弦波音量レベル用スライダーの各種オプションを設定する。
	//   スライダーの最小値, 最大値, 変化量の間隔を設定する。
	sineWaveLevelSlider.setRange(_oscParamsPtr->SineWaveLevel->range.start,_oscParamsPtr->SineWaveLevel->range.end, 0.01);

	// スライダーの現在の値を設定する。
	sineWaveLevelSlider.setValue(_oscParamsPtr->SineWaveLevel->get(), dontSendNotification);

	// スライダーを操作した時にポップアップウインドウを表示して現在の値を表示するかどうかを設定する。
	sineWaveLevelSlider.setPopupDisplayEnabled(true, true, this);

	// 右クリックをするとポップアップメニューを表示するかどうかを設定する。
	sineWaveLevelSlider.setPopupMenuEnabled(true);

	// ④スライダーが操作されたことをトリガーとしてイベントハンドラを実行するオブジェクトを設定する。
	sineWaveLevelSlider.addListener(this);

	// ⑤スライダーをOSC MIXパネルの子コンポーネントとして追加して表示する。
	addAndMakeVisible(sineWaveLevelSlider);

	// 以降、他のスライダーコンポーネントに対しても同様の処理を行う。
	sawWaveLevelSlider.setRange(_oscParamsPtr->SawWaveLevel->range.start, _oscParamsPtr->SawWaveLevel->range.end, 0.01);
	sawWaveLevelSlider.setValue(_oscParamsPtr->SawWaveLevel->get(), dontSendNotification);
	sawWaveLevelSlider.setPopupDisplayEnabled(true, true, this);
	sawWaveLevelSlider.setPopupMenuEnabled(true);
	sawWaveLevelSlider.addListener(this);
	addAndMakeVisible(sawWaveLevelSlider);

	triWaveLevelSlider.setRange(_oscParamsPtr->TriWaveLevel->range.start, _oscParamsPtr->TriWaveLevel->range.end, 0.01);
	triWaveLevelSlider.setValue(_oscParamsPtr->TriWaveLevel->get(), dontSendNotification);
	triWaveLevelSlider.setPopupDisplayEnabled(true, true, this);
	triWaveLevelSlider.setPopupMenuEnabled(true);
	triWaveLevelSlider.addListener(this);
	addAndMakeVisible(triWaveLevelSlider);

	squareWaveLevelSlider.setRange(_oscParamsPtr->SquareWaveLevel->range.start, _oscParamsPtr->SquareWaveLevel->range.end, 0.01);
	squareWaveLevelSlider.setValue(_oscParamsPtr->SquareWaveLevel->get(), dontSendNotification);
	squareWaveLevelSlider.setPopupDisplayEnabled(true, true, this);
	squareWaveLevelSlider.setPopupMenuEnabled(true);
	squareWaveLevelSlider.addListener(this);
	addAndMakeVisible(squareWaveLevelSlider);

	noiseLevelSlider.setRange(_oscParamsPtr->NoiseLevel->range.start, _oscParamsPtr->NoiseLevel->range.end, 0.01);
	noiseLevelSlider.setValue(_oscParamsPtr->NoiseLevel->get(), dontSendNotification);
	noiseLevelSlider.setPopupDisplayEnabled(true, true, this);
	noiseLevelSlider.setPopupMenuEnabled(true);
	noiseLevelSlider.addListener(this);
	addAndMakeVisible(noiseLevelSlider);

	// ⑥テキストラベルに表示する文字のフォント設定を作成する。
	Font paramLabelFont = Font(PARAM_LABEL_FONT_SIZE, Font::plain).withTypefaceStyle("Regular");

	// ⑦テキストラベルに表示する文字のフォント設定を作成する。
	sineWaveLevelLabel.setFont(paramLabelFont);								// 使用するフォントを設定する。
	sineWaveLevelLabel.setText("Sine", dontSendNotification);					// テキストの初期値を設定
	sineWaveLevelLabel.setJustificationType(Justification::centred);			// 文字のアライメント設定
	sineWaveLevelLabel.setEditable(false, false, false);						// 文字を編集可/不可とする設定

	// ⑧テキストラベルをOSC MIXパネルの子コンポーネントとして追加して表示する。
	addAndMakeVisible(sineWaveLevelLabel);

	// 以降、他のテキストラベルコンポーネントに対しても同様の処理を行う

	sawWaveLevelLabel.setFont(paramLabelFont);
	sawWaveLevelLabel.setText("Saw", dontSendNotification);
	sawWaveLevelLabel.setJustificationType(Justification::centred);
	sawWaveLevelLabel.setEditable(false, false, false);
	addAndMakeVisible(sawWaveLevelLabel);

	squareWaveLevelLabel.setFont(paramLabelFont);
	squareWaveLevelLabel.setText("Square", dontSendNotification);
	squareWaveLevelLabel.setJustificationType(Justification::centred);
	squareWaveLevelLabel.setEditable(false, false, false);
	addAndMakeVisible(squareWaveLevelLabel);

	triWaveLevelLabel.setFont(paramLabelFont);
	triWaveLevelLabel.setText("Tri", dontSendNotification);
	triWaveLevelLabel.setJustificationType(Justification::centred);
	triWaveLevelLabel.setEditable(false, false, false);
	addAndMakeVisible(triWaveLevelLabel);

	noiseLevelLabel.setFont(paramLabelFont);
	noiseLevelLabel.setText("Noise", dontSendNotification);
	noiseLevelLabel.setJustificationType(Justification::centred);
	noiseLevelLabel.setEditable(false, false, false);
	addAndMakeVisible(noiseLevelLabel);

	// ⑨タイマースレッドを開始する関数。30Hzの間隔で当クラスの"timerCallback"関数を実行する。
	startTimerHz(30.0f);
}
示例#26
0
GlobalToolTip::GlobalToolTip() {
  startTimerHz(FRAMES_PER_SECOND);
}
示例#27
0
//==============================================================================
MainContentComponent::MainContentComponent ()
    : sampleRate(-1.0),
      gainParam(0.5),
      nfftParam(0),
      qParam(1.0),
      sParam(1.0),
      conv(0, 0),
      playheadAudioLock(),
      playheadState(PlayheadState::stopped),
      playheadAudio(0, 0),
      playheadAudioSamplesCompleted(0),
      soundIdNext(0)
{
    //[Constructor_pre] You can add your own custom stuff here..
	formatManager.registerFormat(new WavAudioFormat(), true);
	formatManager.registerFormat(new AiffAudioFormat(), false);
	formatManager.registerFormat(new OggVorbisAudioFormat(), false);
    //[/Constructor_pre]

    addAndMakeVisible (waveformGroupBox = new GroupComponent (String(),
                                                              TRANS("Waveform")));

    addAndMakeVisible (waveformComponent = new WaveformComponent ("No waveform to display"));

    addAndMakeVisible (inputGroupBox = new GroupComponent (String(),
                                                           TRANS("Input")));

    addAndMakeVisible (convGroupBox = new GroupComponent (String(),
                                                          TRANS("Convolution")));

    addAndMakeVisible (qSlider = new Slider (String()));
    qSlider->setRange (0, 8, 0.01);
    qSlider->setSliderStyle (Slider::LinearHorizontal);
    qSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20);
    qSlider->addListener (this);
    qSlider->setSkewFactor (0.4);

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

    addAndMakeVisible (convButton = new TextButton (String()));
    convButton->setButtonText (TRANS("Convolve"));
    convButton->addListener (this);

    addAndMakeVisible (authorLabel = new Label (String(),
                                                CharPointer_UTF8 ("\xc2\xa9 Chris Donahue 2016")));
    authorLabel->setFont (Font (15.00f, Font::plain));
    authorLabel->setJustificationType (Justification::centredLeft);
    authorLabel->setEditable (false, false, false);
    authorLabel->setColour (TextEditor::textColourId, Colours::black);
    authorLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (settingsButton = new TextButton (String()));
    settingsButton->setButtonText (TRANS("Audio Settings"));
    settingsButton->addListener (this);

    addAndMakeVisible (gainSlider = new Slider (String()));
    gainSlider->setRange (0, 1, 0.01);
    gainSlider->setSliderStyle (Slider::LinearHorizontal);
    gainSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20);
    gainSlider->addListener (this);

    addAndMakeVisible (gainLabel = new Label (String(),
                                              TRANS("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 (prBehaviorLabel = new Label (String(),
                                                    TRANS("Mag/Phase Link")));
    prBehaviorLabel->setFont (Font (15.00f, Font::plain));
    prBehaviorLabel->setJustificationType (Justification::centredLeft);
    prBehaviorLabel->setEditable (false, false, false);
    prBehaviorLabel->setColour (TextEditor::textColourId, Colours::black);
    prBehaviorLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));

    addAndMakeVisible (prBehaviorComboBox = new ComboBox (String()));
    prBehaviorComboBox->setEditableText (false);
    prBehaviorComboBox->setJustificationType (Justification::centredLeft);
    prBehaviorComboBox->setTextWhenNothingSelected (String());
    prBehaviorComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)"));
    prBehaviorComboBox->addItem (TRANS("Independent"), 1);
    prBehaviorComboBox->addItem (TRANS("Linked"), 2);
    prBehaviorComboBox->addItem (TRANS("Inverse"), 3);
    prBehaviorComboBox->addListener (this);

    addAndMakeVisible (playButton = new TextButton (String()));
    playButton->setButtonText (TRANS("Play"));
    playButton->addListener (this);

    addAndMakeVisible (loopButton = new TextButton (String()));
    loopButton->setButtonText (TRANS("Loop"));
    loopButton->addListener (this);

    addAndMakeVisible (stopButton = new TextButton (String()));
    stopButton->setButtonText (TRANS("Stop"));
    stopButton->addListener (this);

    addAndMakeVisible (qDefaultButton = new TextButton (String()));
    qDefaultButton->setButtonText (TRANS("Default"));
    qDefaultButton->addListener (this);

    addAndMakeVisible (sSlider = new Slider (String()));
    sSlider->setRange (0, 15, 0.01);
    sSlider->setSliderStyle (Slider::LinearHorizontal);
    sSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20);
    sSlider->addListener (this);

    addAndMakeVisible (sDefaultButton = new TextButton (String()));
    sDefaultButton->setButtonText (TRANS("Default"));
    sDefaultButton->addListener (this);

    addAndMakeVisible (nfftSlider = new Slider (String()));
    nfftSlider->setRange (0, 24, 1);
    nfftSlider->setSliderStyle (Slider::LinearHorizontal);
    nfftSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20);
    nfftSlider->addListener (this);

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

    addAndMakeVisible (saveButton = new TextButton (String()));
    saveButton->setButtonText (TRANS("Save"));
    saveButton->addListener (this);

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

    addAndMakeVisible (inputRemoveButton = new TextButton (String()));
    inputRemoveButton->setButtonText (TRANS("Remove"));
    inputRemoveButton->addListener (this);

    addAndMakeVisible (inputAddButton = new TextButton (String()));
    inputAddButton->setButtonText (TRANS("Add"));
    inputAddButton->addListener (this);

    addAndMakeVisible (inputFileListComponent = new InputFileTableListBox (InputFileTableListBox::PrBehavior::independent));


    //[UserPreSize]
	inputFileListComponent->addChangeListener(this);
	waveformComponent->setSound(&playheadAudio);
	setPlayheadAudio(nullptr);

	//timerCallback();
	inputFilesChanged(dontSendNotification);
	setUiFromParams(dontSendNotification);
    //[/UserPreSize]

    setSize (624, 600);


    //[Constructor] You can add your own custom stuff here..
	setAudioChannels(0, JECT_CHANNELS_NUM);
	startTimerHz(JECT_FPS);
    //[/Constructor]
}
示例#28
0
ParamGraph::ParamGraph(TimeLagFilterCore& c, bool doBW) : core(c){
    mode = doBW;
    startTimerHz(10);
}
//==============================================================================
PluginEditor::PluginEditor (PluginProcessor& p)
    : AudioProcessorEditor (&p),
      buttonAB ("A-B"),
      buttonCopyAB ("Copy"),
      backgroundImage {ImageCache::getFromMemory (BinaryData::BalanceWidth_02fs8_png,
                                                  BinaryData::BalanceWidth_02fs8_pngSize)},
      knobStyleImage  {ImageCache::getFromMemory (BinaryData::knob05LargeForeground4fs8_png,
                                                  BinaryData::knob05LargeForeground4fs8_pngSize)},
      filmstripImage  {ImageCache::getFromMemory (BinaryData::markerFilmstripfs8_png,
                                                  BinaryData::markerFilmstripfs8_pngSize)},
      processor (p)
{
    // Button AB
    buttonAB.setColour (TextButton::textColourOffId, Colour (0xff373737));
    buttonAB.setColour (TextButton::buttonColourId, Colour (0xff808080));
    addAndMakeVisible (buttonAB);
    buttonAB.addListener (this);

    // Button copy
    buttonCopyAB.setColour (TextButton::textColourOffId, Colour (0xff373737));
    buttonCopyAB.setColour (TextButton::buttonColourId, Colour (0xff808080));
    addAndMakeVisible (buttonCopyAB);
    buttonCopyAB.addListener (this);

    // StepSize slider
    String stepSizeParamName = processor.getParam(0).name;                     // magic constant!

    Slider* stepSizeSlider = new Slider (stepSizeParamName);
    jassert (stepSizeSlider);
    sliders.add (stepSizeSlider);

    stepSizeSlider->setSliderStyle (Slider::LinearHorizontal);
    stepSizeSlider->setTextBoxStyle (Slider::TextBoxLeft,false,60,15);         // magic constants!
    stepSizeSlider->setColour (Slider::textBoxTextColourId,       Colour (0xff373737));
    stepSizeSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0xff707070));
    stepSizeSlider->setColour (Slider::textBoxHighlightColourId,  Colour (0xffffffff));
    stepSizeSlider->setColour (Slider::textBoxOutlineColourId,    Colour (0x00000000));

    addAndMakeVisible (stepSizeSlider);
    stepSizeSlider->addListener (this);

    // StepSize label
    Label* stepSizeLabel = new Label (stepSizeParamName, stepSizeParamName);
    jassert (stepSizeLabel);
    labels.add (stepSizeLabel);

    stepSizeLabel->setJustificationType (Justification::centredLeft);
    stepSizeLabel->setEditable (false, false, false);
    stepSizeLabel->setColour (Label::textColourId, Colour (0xff2b2b2b));

    addAndMakeVisible (stepSizeLabel);

    // Main knob
    knob = new FilmStrip {filmstripImage, knobStyleImage};

    sliders.add (knob);

    knob->setDoubleClickReturnValue (true, sliders[0]->getValue()); // current getValue() is
                                                                    // the default value (0dB)

    addAndMakeVisible (knob);
    knob->addListener (this);

    // Init and size setting
    updateSlidersFromProcParams();  // set slider values and ranges

    setSize (400, 400);             // must be set before xtor finished

    startTimerHz (30);
}