ConnectionComponent::ConnectionComponent() : curlSession (nullptr) { addAndMakeVisible(&urlLabel); addAndMakeVisible(&hostnameLabel); addAndMakeVisible(&usernameLabel); addAndMakeVisible(&passwordLabel); addAndMakeVisible(&protocolLabel); urlLabel.setComponentID("urlLabel"); hostnameLabel.setComponentID("hostnameLabel"); usernameLabel.setComponentID("usernameLabel"); passwordLabel.setComponentID("passwordLabel"); protocolLabel.setComponentID("protocolLabel"); urlLabel.setText("URL", dontSendNotification); hostnameLabel.setText("Hostname", dontSendNotification); usernameLabel.setText("Username", dontSendNotification); passwordLabel.setText("Password", dontSendNotification); protocolLabel.setText("Protocol", dontSendNotification); addAndMakeVisible(&urlEditor); addAndMakeVisible(&hostnameEditor); addAndMakeVisible(&usernameEditor); addAndMakeVisible(&passwordEditor); urlEditor.setComponentID("urlEditor"); hostnameEditor.setComponentID("hostnameEditor"); usernameEditor.setComponentID("usernameEditor"); passwordEditor.setComponentID("passwordEditor"); passwordEditor.setPasswordCharacter((juce_wchar) 0x2022); addAndMakeVisible(&protocolBox); protocolBox.addItemList (CURLManager::getInstance()->getSupportedProtocols(), 1); for (int i = 0; i < protocolBox.getNumItems(); ++i) if (protocolBox.getItemText (i) == "ftp") protocolBox.setSelectedItemIndex (i); addAndMakeVisible(&connectButton); connectButton.setButtonText("Connect"); connectButton.addListener(this); }
//============================================================================== EdoGaduSearch::EdoGaduSearch (EdoGadu *_edoGaduComponent) : edoGaduComponent(_edoGaduComponent), inpUin (0), label (0), inpFristName (0), label2 (0), inpLastName (0), label3 (0), label4 (0), inpNickName (0), label5 (0), inpCity (0), inpSex (0), label6 (0), label7 (0), inpBirthYear (0), searchResult (0), btnSearch (0), searchRunning (0) { addAndMakeVisible (inpUin = new TextEditor (T("new text editor"))); inpUin->setMultiLine (false); inpUin->setReturnKeyStartsNewLine (false); inpUin->setReadOnly (false); inpUin->setScrollbarsShown (true); inpUin->setCaretVisible (true); inpUin->setPopupMenuEnabled (true); inpUin->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpUin->setColour (TextEditor::outlineColourId, Colours::black); inpUin->setColour (TextEditor::shadowColourId, Colour (0x0)); inpUin->setText (String::empty); addAndMakeVisible (label = new Label (T("new label"), T("UIN"))); label->setFont (Font (18.0000f, Font::bold)); label->setJustificationType (Justification::centred); label->setEditable (false, false, false); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpFristName = new TextEditor (T("new text editor"))); inpFristName->setMultiLine (false); inpFristName->setReturnKeyStartsNewLine (false); inpFristName->setReadOnly (false); inpFristName->setScrollbarsShown (true); inpFristName->setCaretVisible (true); inpFristName->setPopupMenuEnabled (true); inpFristName->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpFristName->setColour (TextEditor::outlineColourId, Colours::black); inpFristName->setColour (TextEditor::shadowColourId, Colour (0x0)); inpFristName->setText (String::empty); addAndMakeVisible (label2 = new Label (T("new label"), T("First Name"))); label2->setFont (Font (18.0000f, Font::bold)); label2->setJustificationType (Justification::centred); label2->setEditable (false, false, false); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpLastName = new TextEditor (T("new text editor"))); inpLastName->setMultiLine (false); inpLastName->setReturnKeyStartsNewLine (false); inpLastName->setReadOnly (false); inpLastName->setScrollbarsShown (true); inpLastName->setCaretVisible (true); inpLastName->setPopupMenuEnabled (true); inpLastName->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpLastName->setColour (TextEditor::outlineColourId, Colours::black); inpLastName->setColour (TextEditor::shadowColourId, Colour (0x0)); inpLastName->setText (String::empty); addAndMakeVisible (label3 = new Label (T("new label"), T("Last Name"))); label3->setFont (Font (18.0000f, Font::bold)); label3->setJustificationType (Justification::centred); label3->setEditable (false, false, false); label3->setColour (TextEditor::textColourId, Colours::black); label3->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (label4 = new Label (T("new label"), T("Nick Name"))); label4->setFont (Font (18.0000f, Font::bold)); label4->setJustificationType (Justification::centred); label4->setEditable (false, false, false); label4->setColour (TextEditor::textColourId, Colours::black); label4->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpNickName = new TextEditor (T("new text editor"))); inpNickName->setMultiLine (false); inpNickName->setReturnKeyStartsNewLine (false); inpNickName->setReadOnly (false); inpNickName->setScrollbarsShown (true); inpNickName->setCaretVisible (true); inpNickName->setPopupMenuEnabled (true); inpNickName->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpNickName->setColour (TextEditor::outlineColourId, Colours::black); inpNickName->setColour (TextEditor::shadowColourId, Colour (0x0)); inpNickName->setText (String::empty); addAndMakeVisible (label5 = new Label (T("new label"), T("City"))); label5->setFont (Font (18.0000f, Font::bold)); label5->setJustificationType (Justification::centred); label5->setEditable (false, false, false); label5->setColour (TextEditor::textColourId, Colours::black); label5->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpCity = new TextEditor (T("new text editor"))); inpCity->setMultiLine (false); inpCity->setReturnKeyStartsNewLine (false); inpCity->setReadOnly (false); inpCity->setScrollbarsShown (true); inpCity->setCaretVisible (true); inpCity->setPopupMenuEnabled (true); inpCity->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpCity->setColour (TextEditor::outlineColourId, Colours::black); inpCity->setColour (TextEditor::shadowColourId, Colour (0x0)); inpCity->setText (String::empty); addAndMakeVisible (inpSex = new ComboBox (T("new combo box"))); inpSex->setEditableText (false); inpSex->setJustificationType (Justification::centredLeft); inpSex->setTextWhenNothingSelected (T("Female")); inpSex->setTextWhenNoChoicesAvailable (T("(no choices)")); inpSex->addItem (T("Male"), 1); inpSex->addItem (T("Female"), 2); inpSex->addListener (this); addAndMakeVisible (label6 = new Label (T("new label"), T("Sex"))); label6->setFont (Font (18.0000f, Font::bold)); label6->setJustificationType (Justification::centred); label6->setEditable (false, false, false); label6->setColour (TextEditor::textColourId, Colours::black); label6->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (label7 = new Label (T("new label"), T("Year of Birth"))); label7->setFont (Font (18.0000f, Font::bold)); label7->setJustificationType (Justification::centred); label7->setEditable (false, false, false); label7->setColour (TextEditor::textColourId, Colours::black); label7->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (inpBirthYear = new TextEditor (T("new text editor"))); inpBirthYear->setMultiLine (false); inpBirthYear->setReturnKeyStartsNewLine (false); inpBirthYear->setReadOnly (false); inpBirthYear->setScrollbarsShown (true); inpBirthYear->setCaretVisible (true); inpBirthYear->setPopupMenuEnabled (true); inpBirthYear->setColour (TextEditor::backgroundColourId, Colour (0x97ffffff)); inpBirthYear->setColour (TextEditor::outlineColourId, Colours::black); inpBirthYear->setColour (TextEditor::shadowColourId, Colour (0x0)); inpBirthYear->setText (T("1980 1986")); addAndMakeVisible (searchResult = new ListBox (T("searchResults"),this)); searchResult->setName (T("searchResults")); addAndMakeVisible (btnSearch = new ImageButton (T("new button"))); btnSearch->setTooltip (T("Start searching (and wait a while)")); btnSearch->addButtonListener (this); btnSearch->setImages (false, true, true, 0, 1.0000f, Colour (0x0), 0, 1.0000f, Colour (0x0), 0, 1.0000f, Colour (0x0)); addAndMakeVisible (searchRunning = new ProgressBar (searchSwitch)); searchRunning->setName (T("new component")); //[UserPreSize] searchResult->setColour (ListBox::backgroundColourId, Colour (0x97ffffff)); searchResult->setColour (ListBox::outlineColourId, Colours::black); searchResult->setOutlineThickness (1); searchRunning->setPercentageDisplay (false); btnSearch->setImages (false, true, true, EdoApp::getInstance()->getEdoImage(edoSearch), 0.7500f, Colour (0x0), EdoApp::getInstance()->getEdoImage(edoSearch), 1.0000f, Colour (0x0), EdoApp::getInstance()->getEdoImage(edoSearch), 1.0000f, Colour (0x23005fff)); //[/UserPreSize] setSize (400, 400); //[Constructor] You can add your own custom stuff here.. searchSwitch=0; //[/Constructor] }
void addItem (int width, LiveValueBase& v, CodeDocument& doc) { addAndMakeVisible (editors.add (v.createPropertyComponent (doc))); layout (width); }
StatusBar::StatusBar(ConcurrentParameterSet ¶meters, const ResourceCache*) : juce::Component(), juce::Timer(), ParameterObserver(), parameters(parameters), labelOpacity(1.0), clearTimeout(0) { addAndMakeVisible(¶meterNameLabel); addAndMakeVisible(¶meterValueLabel); }
void TabbedButtonBar::resized() { int depth = getWidth(); int length = getHeight(); if (orientation == TabsAtTop || orientation == TabsAtBottom) std::swap (depth, length); const int overlap = getLookAndFeel().getTabButtonOverlap (depth) + getLookAndFeel().getTabButtonSpaceAroundImage() * 2; int i, totalLength = overlap; int numVisibleButtons = tabs.size(); for (i = 0; i < tabs.size(); ++i) { TabBarButton* const tb = tabs.getUnchecked(i)->component; totalLength += tb->getBestTabLength (depth) - overlap; tb->overlapPixels = overlap / 2; } double scale = 1.0; if (totalLength > length) scale = jmax (minimumScale, length / (double) totalLength); const bool isTooBig = totalLength * scale > length; int tabsButtonPos = 0; if (isTooBig) { if (extraTabsButton == nullptr) { addAndMakeVisible (extraTabsButton = getLookAndFeel().createTabBarExtrasButton()); extraTabsButton->addListener (behindFrontTab); extraTabsButton->setAlwaysOnTop (true); extraTabsButton->setTriggeredOnMouseDown (true); } const int buttonSize = jmin (proportionOfWidth (0.7f), proportionOfHeight (0.7f)); extraTabsButton->setSize (buttonSize, buttonSize); if (orientation == TabsAtTop || orientation == TabsAtBottom) { tabsButtonPos = getWidth() - buttonSize / 2 - 1; extraTabsButton->setCentrePosition (tabsButtonPos, getHeight() / 2); } else { tabsButtonPos = getHeight() - buttonSize / 2 - 1; extraTabsButton->setCentrePosition (getWidth() / 2, tabsButtonPos); } totalLength = 0; for (i = 0; i < tabs.size(); ++i) { TabBarButton* const tb = tabs.getUnchecked(i)->component; const int newLength = totalLength + tb->getBestTabLength (depth); if (i > 0 && newLength * minimumScale > tabsButtonPos) { totalLength += overlap; break; } numVisibleButtons = i + 1; totalLength = newLength - overlap; } scale = jmax (minimumScale, tabsButtonPos / (double) totalLength); } else { extraTabsButton = nullptr; } int pos = 0; TabBarButton* frontTab = nullptr; for (i = 0; i < tabs.size(); ++i) { TabBarButton* const tb = getTabButton (i); if (tb != nullptr) { const int bestLength = roundToInt (scale * tb->getBestTabLength (depth)); if (i < numVisibleButtons) { if (orientation == TabsAtTop || orientation == TabsAtBottom) tb->setBounds (pos, 0, bestLength, getHeight()); else tb->setBounds (0, pos, getWidth(), bestLength); tb->toBack(); if (i == currentTabIndex) frontTab = tb; tb->setVisible (true); } else { tb->setVisible (false); } pos += bestLength - overlap; } } behindFrontTab->setBounds (getLocalBounds()); if (frontTab != nullptr) { frontTab->toFront (false); behindFrontTab->toBehind (frontTab); } }
void updateComponents() { const int visibleTop = -getY(); const int visibleBottom = visibleTop + getParentHeight(); { for (int i = items.size(); --i >= 0;) items.getUnchecked(i)->shouldKeep = false; } { TreeViewItem* item = owner.rootItem; int y = (item != 0 && ! owner.rootItemVisible) ? -item->itemHeight : 0; while (item != 0 && y < visibleBottom) { y += item->itemHeight; if (y >= visibleTop) { RowItem* const ri = findItem (item->uid); if (ri != 0) { ri->shouldKeep = true; } else { Component* const comp = item->createItemComponent(); if (comp != 0) { items.add (new RowItem (item, comp, item->uid)); addAndMakeVisible (comp); } } } item = item->getNextVisibleItem (true); } } for (int i = items.size(); --i >= 0;) { RowItem* const ri = items.getUnchecked(i); bool keep = false; if (isParentOf (ri->component)) { if (ri->shouldKeep) { Rectangle<int> pos (ri->item->getItemPosition (false)); pos.setSize (pos.getWidth(), ri->item->itemHeight); if (pos.getBottom() >= visibleTop && pos.getY() < visibleBottom) { keep = true; ri->component->setBounds (pos); } } if ((! keep) && isMouseDraggingInChildCompOf (ri->component)) { keep = true; ri->component->setSize (0, 0); } } if (! keep) items.remove (i); } }
Kmeter::Kmeter(const String& componentName, int posX, int posY, int nCrestFactor, int nNumChannels, const String& unitName, bool bIsSurround, bool bExpanded, bool bDisplayPeakMeter, int nSegmentHeight) { setName(componentName); // this component blends in with the background setOpaque(false); nInputChannels = nNumChannels; isSurround = bIsSurround; nStereoInputChannels = (nNumChannels + (nNumChannels % 2)) / 2; isExpanded = bExpanded; displayPeakMeter = bDisplayPeakMeter; strUnit = unitName; if (isSurround) { nMeterPositionTop = 20; } else { nMeterPositionTop = 0; } nPosX = posX; nPosY = posY; nMainSegmentHeight = nSegmentHeight; if (nCrestFactor == 0) { nMeterCrestFactor = 0; } else if (nCrestFactor == 12) { nMeterCrestFactor = 12; } else if (nCrestFactor == 14) { nMeterCrestFactor = 14; } else // K-20 { nMeterCrestFactor = 20; } int nPositionX = 0; LevelMeters = new MeterBar*[nInputChannels]; if (nInputChannels == 1) { nPositionX = KMETER_STEREO_WIDTH_2 - 10; LevelMeters[0] = new MeterBar("Level Meter #0", nPositionX - 2, nMeterPositionTop + 48, 24, nMeterCrestFactor, bExpanded, displayPeakMeter, nMainSegmentHeight); addAndMakeVisible(LevelMeters[0]); } else { for (int nChannel = 0; nChannel < nInputChannels; nChannel++) { nPositionX = 9 + nChannel * (KMETER_STEREO_WIDTH_2 + 3); if (nChannel % 2) { nPositionX += 12; } LevelMeters[nChannel] = new MeterBar("Level Meter #" + String(nChannel), nPositionX, nMeterPositionTop + 48, 20, nMeterCrestFactor, bExpanded, displayPeakMeter, nMainSegmentHeight); addAndMakeVisible(LevelMeters[nChannel]); } } OverflowMeters = new OverflowMeter*[nInputChannels]; MaximumPeakLabels = new PeakLabel*[nInputChannels]; if (nInputChannels == 1) { nPositionX = KMETER_STEREO_WIDTH_2 - 16; OverflowMeters[0] = new OverflowMeter("Overflows #0"); OverflowMeters[0]->setBounds(nPositionX, nMeterPositionTop + 4, 32, 16); addAndMakeVisible(OverflowMeters[0]); MaximumPeakLabels[0] = new PeakLabel("Maximum Peak #0", nCrestFactor); MaximumPeakLabels[0]->setBounds(nPositionX, nMeterPositionTop + 22, 32, 16); addAndMakeVisible(MaximumPeakLabels[0]); } else { for (int nChannel = 0; nChannel < nInputChannels; nChannel++) { nPositionX = 5 + nChannel * (KMETER_STEREO_WIDTH_2 + 3); if (nChannel % 2) { nPositionX += 8; } OverflowMeters[nChannel] = new OverflowMeter("Overflows #" + String(nChannel)); OverflowMeters[nChannel]->setBounds(nPositionX, nMeterPositionTop + 4, 32, 16); addAndMakeVisible(OverflowMeters[nChannel]); MaximumPeakLabels[nChannel] = new PeakLabel("Maximum Peak #" + String(nChannel), nCrestFactor); MaximumPeakLabels[nChannel]->setBounds(nPositionX, nMeterPositionTop + 22, 32, 16); addAndMakeVisible(MaximumPeakLabels[nChannel]); } } }
void mlrVSTGUI::buildSliders(int &xPosition, int &yPosition) { // work out the correct height width const int sliderWidth = (int)(270 / (float) (numChannels + 1)); const int sliderHeight = 66; // TODO: no magic numbers! // clear any existing sliders slidersArray.clear(); slidersMuteBtnArray.clear(); // Set master volume first addAndMakeVisible(&masterGainSlider); masterGainSlider.setSliderStyle(Slider::LinearVertical); masterGainSlider.setRange(0.0, 1.0, 0.01); masterGainSlider.setValue(0.0, NotificationType::dontSendNotification); masterGainSlider.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); masterGainSlider.setTextBoxStyle(Slider::NoTextBox, true, 0, 0); masterGainSlider.setColour(Slider::thumbColourId, Colours::darkgrey); masterGainSlider.setColour(Slider::backgroundColourId, (Colours::darkgrey).darker()); // and its label addAndMakeVisible(&masterSliderLabel); masterSliderLabel.setBounds(xPosition, yPosition + sliderHeight, sliderWidth, 16); masterSliderLabel.setColour(Label::backgroundColourId, Colours::black); masterSliderLabel.setColour(Label::textColourId, Colours::white); masterSliderLabel.setFont(defaultFont); xPosition += 1; // then individual channel volumes for(int i = 0; i < numChannels; ++i) { xPosition += sliderWidth; slidersArray.add(new Slider("channel " + String(i) + " vol")); addAndMakeVisible(slidersArray[i]); slidersArray[i]->setSliderStyle(Slider::LinearVertical); slidersArray[i]->addListener(this); slidersArray[i]->setRange(0.0, 1.0, 0.01); slidersArray[i]->setBounds(xPosition, yPosition, sliderWidth - 1, sliderHeight); slidersArray[i]->setValue(parent->getChannelGain(i)); Colour sliderColour = parent->getChannelColour(i); slidersArray[i]->setTextBoxStyle(Slider::NoTextBox, true, 0, 0); slidersArray[i]->setColour(Slider::thumbColourId, sliderColour); slidersArray[i]->setColour(Slider::backgroundColourId, sliderColour.darker()); // add the labels slidersMuteBtnArray.add(new ToggleButton("ch" + String(i))); addAndMakeVisible(slidersMuteBtnArray[i]); slidersMuteBtnArray[i]->setBounds(xPosition, yPosition + sliderHeight, sliderWidth - 1, 16); slidersMuteBtnArray[i]->setColour(Label::backgroundColourId, Colours::black); slidersMuteBtnArray[i]->setColour(Label::textColourId, Colours::white); slidersMuteBtnArray[i]->addListener(this); slidersMuteBtnArray[i]->setToggleState(parent->getChannelMuteStatus(i), NotificationType::dontSendNotification); } // increment yPosition for the next GUI item xPosition = PAD_AMOUNT; yPosition += sliderHeight + 3 * PAD_AMOUNT; }
void mlrVSTGUI::setupTempoUI(int &xPosition, int &yPosition) { int bpmSliderWidth = 180, bpmSliderHeight = 30; int bpmLabelWidth = bpmSliderWidth, bpmLabelHeight = 16; int quantiseBoxWidth = 80, quantiseBoxHeight = 30; int quantiseLabelWidth = quantiseBoxWidth, quantiseLabelHeight = 16; /////////////////////// // First add the labels addAndMakeVisible(&bpmLabel); bpmLabel.setBounds(xPosition, yPosition, bpmLabelWidth, bpmLabelHeight); bpmLabel.setColour(Label::textColourId, Colours::white); bpmLabel.setColour(Label::backgroundColourId, Colours::black); bpmLabel.setFont(defaultFont); xPosition += bpmLabelWidth + PAD_AMOUNT; addAndMakeVisible(&quantiseLabel); quantiseLabel.setBounds(xPosition, yPosition, quantiseLabelWidth, quantiseLabelHeight); quantiseLabel.setColour(Label::textColourId, Colours::white); quantiseLabel.setColour(Label::backgroundColourId, Colours::black); quantiseLabel.setFont(defaultFont); xPosition = PAD_AMOUNT; yPosition += quantiseLabelHeight; /////////////////////////////// // Then add sliders and boxes addAndMakeVisible(&bpmSlider); bpmSlider.setBounds(xPosition, yPosition, bpmSliderWidth, bpmSliderHeight); bpmSlider.setColour(Slider::backgroundColourId, Colours::black.withAlpha(0.3f)); bpmSlider.setSliderStyle(Slider::LinearBar); bpmSlider.setRange(20.0, 300.0, 0.01); bpmSlider.setTextBoxIsEditable(true); bpmSlider.addListener(this); bpmSlider.setLookAndFeel(&overrideLF); useExternalTempo = *static_cast<const bool*>(getGlobalSetting(GlobalSettings::sUseExternalTempo)); if (useExternalTempo) { bpmSlider.setEnabled(false); bpmLabel.setText("bpm (external)", NotificationType::dontSendNotification); } else { double newBPM = *static_cast<const double*>(getGlobalSetting(GlobalSettings::sCurrentBPM)); bpmSlider.setValue(newBPM); bpmLabel.setText("bpm (internal)", NotificationType::dontSendNotification); } xPosition += bpmSliderWidth + PAD_AMOUNT; // add dropdown box for quantisation settings addAndMakeVisible(&quantiseSettingsCbox); quantiseSettingsCbox.setBounds(xPosition, yPosition, quantiseBoxWidth, quantiseBoxHeight); quantiseSettingsCbox.addListener(this); // add items to it quantiseSettingsCbox.addItem("None", 1); for (int i = 2, denom = 1; i < 8; ++i, denom *= 2) quantiseSettingsCbox.addItem(String(denom) + "n", i); // and load the stored selection if suitable const int menuSelection = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sQuantiseMenuSelection)); if (menuSelection >= 0 && menuSelection < 8) quantiseSettingsCbox.setSelectedId(menuSelection); else quantiseSettingsCbox.setSelectedId(1); quantiseSettingsCbox.setLookAndFeel(&overrideLF); xPosition = PAD_AMOUNT; yPosition += bpmSliderHeight + PAD_AMOUNT; }
//============================================================================== mlrVSTGUI::mlrVSTGUI (mlrVSTAudioProcessor* owner, const int &newNumChannels, const int &newNumStrips) : AudioProcessorEditor (owner), // Communication //////////////////////// parent(owner), // Style / positioning objects ////////// myLookAndFeel(), overrideLF(), // Fonts /////////////////////////////////////////////////////// fontSize(12.f), defaultFont("ProggyCleanTT", 18.f, Font::plain), // Volume controls ////////////////////////////////////////////////// masterGainSlider("master gain"), masterSliderLabel("master", "mstr"), slidersArray(), slidersMuteBtnArray(), // Tempo controls /////////////////////////////////////// bpmSlider("bpm slider"), bpmLabel(), quantiseSettingsCbox("quantise settings"), quantiseLabel("quantise label", "quant."), // Buttons ////////////////////////////////// loadFilesBtn("load samples", "load samples"), sampleStripToggle("sample strip toggle", DrawableButton::ImageRaw), patternStripToggle("pattern strip toggle", DrawableButton::ImageRaw), sampleImg(), patternImg(), // Record / Resample / Pattern UI //////////////////////////////////////// precountLbl("precount", "precount"), recordLengthLbl("length", "length"), bankLbl("bank", "bank"), recordPrecountSldr(), recordLengthSldr(), recordBankSldr(), resamplePrecountSldr(), resampleLengthSldr(), resampleBankSldr(), patternPrecountSldr(), patternLengthSldr(), patternBankSldr(), recordBtn("record", Colours::black, Colours::white), resampleBtn("resample", Colours::black, Colours::white), patternBtn("pattern", Colours::black, Colours::white), // branding vstNameLbl("vst label", "mlrVST"), // Misc /////////////////////////////////////////// lastDisplayedPosition(), debugButton("loadfile", DrawableButton::ImageRaw), // temporary button // Presets ////////////////////////////////////////////////// presetLabel("presets", "presets"), presetCbox(), presetPrevBtn("prev", 0.25, Colours::black, Colours::white), presetNextBtn("next", 0.75, Colours::black, Colours::white), addPresetBtn("add", "add preset"), toggleSetlistBtn("setlist"), presetPanelBounds(294, PAD_AMOUNT, THUMBNAIL_WIDTH, 725), presetPanel(presetPanelBounds, owner), // Settings /////////////////////////////////////// numChannels(newNumChannels), useExternalTempo(true), toggleSettingsBtn("settings"), settingsPanelBounds(294, PAD_AMOUNT, THUMBNAIL_WIDTH, 725), settingsPanel(settingsPanelBounds, owner, this), // Mappings ////////////////////////////////////// mappingPanelBounds(294, PAD_AMOUNT, THUMBNAIL_WIDTH, 725), toggleMappingBtn("mappings"), mappingPanel(mappingPanelBounds, owner), // SampleStrip controls /////////////////////////// sampleStripControlArray(), numStrips(newNumStrips), waveformControlHeight( (GUI_HEIGHT - numStrips * PAD_AMOUNT) / numStrips), waveformControlWidth(THUMBNAIL_WIDTH), // Overlays ////////////////////////////// patternStripArray(), hintOverlay(owner) { DBG("GUI loaded " << " strips of height " << waveformControlHeight); parent->addChangeListener(this); // these are compile time constants setSize(GUI_WIDTH, GUI_HEIGHT); setWantsKeyboardFocus(true); int xPosition = PAD_AMOUNT; int yPosition = PAD_AMOUNT; // set up volume sliders buildSliders(xPosition, yPosition); // add the bpm slider and quantise settings setupTempoUI(xPosition, yPosition); // set up the various panels (settings, mapping, etc) // and the buttons that control them setupPanels(xPosition, yPosition); // preset associated UI elements setupPresetUI(xPosition, yPosition); // useful UI debugging components addAndMakeVisible(&debugButton); debugButton.addListener(this); debugButton.setColour(DrawableButton::backgroundColourId, Colours::blue); debugButton.setBounds(50, 300, 50, 25); sampleImg.setImage(ImageCache::getFromMemory(BinaryData::waveform_png, BinaryData::waveform_pngSize)); patternImg.setImage(ImageCache::getFromMemory(BinaryData::pattern_png, BinaryData::pattern_pngSize)); addAndMakeVisible(&sampleStripToggle); sampleStripToggle.addListener(this); sampleStripToggle.setImages(&sampleImg); sampleStripToggle.setBounds(100, 300, 70, 25); displayMode = modeSampleStrips; addAndMakeVisible(&loadFilesBtn); loadFilesBtn.addListener(this); loadFilesBtn.setBounds(50, 350, 100, 25); setUpRecordResampleUI(); buildSampleStripControls(numStrips); setupPatternOverlays(); masterGainSlider.addListener(this); // start timer to update play positions, slider values etc. startTimer(50); addAndMakeVisible(&vstNameLbl); vstNameLbl.setBounds(PAD_AMOUNT, 600, 250, 50); vstNameLbl.setFont(Font("ProggyCleanTT", 40.f, Font::plain)); vstNameLbl.setColour(Label::textColourId, Colours::white); addChildComponent(&hintOverlay); const int overlayHeight = 150; hintOverlay.setBounds(0, GUI_HEIGHT/2 - overlayHeight/2, GUI_WIDTH, overlayHeight); // This tells the GUI to use a custom "theme" LookAndFeel::setDefaultLookAndFeel(&myLookAndFeel); }
void mlrVSTGUI::setUpRecordResampleUI() { const int buttonWidth = 70; const int buttonHeight = 25; const int sliderWidth = 50; const int sliderHeight = buttonHeight; int xPosition = 90; int yPosition = 430; // Labels ////////////////////// addAndMakeVisible(&precountLbl); precountLbl.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); precountLbl.setFont(defaultFont); xPosition += PAD_AMOUNT + sliderWidth; addAndMakeVisible(&recordLengthLbl); recordLengthLbl.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); recordLengthLbl.setFont(defaultFont); xPosition += PAD_AMOUNT + sliderWidth; addAndMakeVisible(&bankLbl); bankLbl.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); bankLbl.setFont(defaultFont); xPosition = PAD_AMOUNT; yPosition += sliderHeight; // Resampling sliders / buttons //////////////////// addAndMakeVisible(&resampleBtn); resampleBtn.addListener(this); resampleBtn.setBounds(xPosition, yPosition, buttonWidth, buttonHeight); resampleBtn.setFont(defaultFont, fontSize); xPosition += PAD_AMOUNT + buttonWidth; addAndMakeVisible(&resamplePrecountSldr); resamplePrecountSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); resamplePrecountSldr.setRange(0.0, 8.0, 1.0); resamplePrecountSldr.setSliderStyle(Slider::LinearBar); resamplePrecountSldr.addListener(this); const int resamplePrecount = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sResamplePrecount)); resamplePrecountSldr.setValue(resamplePrecount); resamplePrecountSldr.setLookAndFeel(&overrideLF); xPosition += sliderWidth + PAD_AMOUNT; addAndMakeVisible(&resampleLengthSldr); resampleLengthSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); resampleLengthSldr.setRange(1.0, 32.0, 1.0); resampleLengthSldr.setSliderStyle(Slider::LinearBar); resampleLengthSldr.addListener(this); const int resampleLength = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sResampleLength)); resampleLengthSldr.setValue(resampleLength); resampleLengthSldr.setLookAndFeel(&overrideLF); xPosition += sliderWidth + PAD_AMOUNT; addAndMakeVisible(&resampleBankSldr); resampleBankSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); resampleBankSldr.setRange(0.0, 7.0, 1.0); resampleBankSldr.setSliderStyle(Slider::LinearBar); resampleBankSldr.addListener(this); const int resampleBank = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sResampleBank)); resampleBankSldr.setValue(resampleBank); resampleBankSldr.setLookAndFeel(&overrideLF); xPosition = PAD_AMOUNT; yPosition += sliderHeight + PAD_AMOUNT; // Recording sliders / buttons //////////////////// addAndMakeVisible(&recordBtn); recordBtn.addListener(this); recordBtn.setBounds(xPosition, yPosition, buttonWidth, buttonHeight); recordBtn.setFont(defaultFont, fontSize); xPosition += PAD_AMOUNT + buttonWidth; addAndMakeVisible(&recordPrecountSldr); recordPrecountSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); recordPrecountSldr.setRange(0.0, 8.0, 1.0); recordPrecountSldr.setSliderStyle(Slider::LinearBar); recordPrecountSldr.addListener(this); const int recordPrecount = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sRecordPrecount)); recordPrecountSldr.setValue(recordPrecount); recordPrecountSldr.setLookAndFeel(&overrideLF); xPosition += sliderWidth + PAD_AMOUNT; addAndMakeVisible(&recordLengthSldr); recordLengthSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); recordLengthSldr.setRange(1.0, 32.0, 1.0); recordLengthSldr.setSliderStyle(Slider::LinearBar); recordLengthSldr.addListener(this); const int recordLength = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sRecordLength)); recordLengthSldr.setValue(recordLength); recordLengthSldr.setLookAndFeel(&overrideLF); xPosition += sliderWidth + PAD_AMOUNT; addAndMakeVisible(&recordBankSldr); recordBankSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); recordBankSldr.setRange(0.0, 7.0, 1.0); recordBankSldr.setSliderStyle(Slider::LinearBar); recordBankSldr.addListener(this); const int recordBank = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sRecordBank)); resampleBankSldr.setValue(recordBank); resampleBankSldr.setLookAndFeel(&overrideLF); xPosition = PAD_AMOUNT; yPosition += sliderHeight + PAD_AMOUNT; // Pattern recording sliders / buttons //////////////////// addAndMakeVisible(&patternBtn); patternBtn.addListener(this); patternBtn.setBounds(xPosition, yPosition, buttonWidth, buttonHeight); patternBtn.setFont(defaultFont, fontSize); xPosition += PAD_AMOUNT + buttonWidth; addAndMakeVisible(&patternPrecountSldr); patternPrecountSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); patternPrecountSldr.setRange(0.0, 8.0, 1.0); patternPrecountSldr.setSliderStyle(Slider::LinearBar); patternPrecountSldr.addListener(this); const int patternPrecount = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sPatternPrecount)); patternPrecountSldr.setValue(patternPrecount); patternPrecountSldr.setLookAndFeel(&overrideLF); xPosition += sliderWidth + PAD_AMOUNT; addAndMakeVisible(&patternLengthSldr); patternLengthSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); patternLengthSldr.setRange(1.0, 32.0, 1.0); patternLengthSldr.setSliderStyle(Slider::LinearBar); patternLengthSldr.addListener(this); const int patternLength = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sPatternLength)); patternLengthSldr.setValue(patternLength); patternLengthSldr.setLookAndFeel(&overrideLF); xPosition += sliderWidth + PAD_AMOUNT; addAndMakeVisible(&patternBankSldr); patternBankSldr.setBounds(xPosition, yPosition, sliderWidth, sliderHeight); patternBankSldr.setRange(0.0, 7.0, 1.0); patternBankSldr.setSliderStyle(Slider::LinearBar); patternBankSldr.addListener(this); const int patternBank = *static_cast<const int*>(parent->getGlobalSetting(GlobalSettings::sPatternBank)); patternBankSldr.setValue(patternBank); patternBankSldr.setLookAndFeel(&overrideLF); }
void initialiseToggle (ToggleButton& b, const char* name, bool on) { addAndMakeVisible (b); b.setButtonText (name); b.setToggleState (on, dontSendNotification); }
//============================================================================== OscillatorEditor::OscillatorEditor () { //[Constructor_pre] You can add your own custom stuff here.. //[/Constructor_pre] addAndMakeVisible (m_waveformTypeSlider = new Slider ("Waveform Type Slider")); m_waveformTypeSlider->setRange (0, 1, 0); m_waveformTypeSlider->setSliderStyle (Slider::RotaryVerticalDrag); m_waveformTypeSlider->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); m_waveformTypeSlider->setColour (Slider::thumbColourId, Colour (0xff1de9b6)); m_waveformTypeSlider->setColour (Slider::trackColourId, Colour (0x00000000)); m_waveformTypeSlider->setColour (Slider::rotarySliderFillColourId, Colour (0xff1de9b6)); m_waveformTypeSlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0xff212121)); m_waveformTypeSlider->setColour (Slider::textBoxTextColourId, Colour (0xff212121)); m_waveformTypeSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); m_waveformTypeSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff1de9b6)); m_waveformTypeSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000)); m_waveformTypeSlider->addListener (this); addAndMakeVisible (m_detuneLabel = new Label ("Detune Label", TRANS("DETUNE"))); m_detuneLabel->setFont (Font ("Avenir Next", 14.00f, Font::plain)); m_detuneLabel->setJustificationType (Justification::centred); m_detuneLabel->setEditable (false, false, false); m_detuneLabel->setColour (Label::textColourId, Colour (0xff212121)); m_detuneLabel->setColour (TextEditor::textColourId, Colour (0xff212121)); m_detuneLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); m_detuneLabel->setColour (TextEditor::highlightColourId, Colour (0xff1de9b6)); addAndMakeVisible (m_waveTypeLabel = new Label ("Waveform Type Label", TRANS("WAVE"))); m_waveTypeLabel->setFont (Font ("Avenir Next", 14.00f, Font::plain)); m_waveTypeLabel->setJustificationType (Justification::centred); m_waveTypeLabel->setEditable (false, false, false); m_waveTypeLabel->setColour (Label::textColourId, Colour (0xff212121)); m_waveTypeLabel->setColour (TextEditor::textColourId, Colour (0xff212121)); m_waveTypeLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); m_waveTypeLabel->setColour (TextEditor::highlightColourId, Colour (0xff1de9b6)); addAndMakeVisible (m_detuneSlider = new Slider ("Detune Slider")); m_detuneSlider->setRange (0, 1, 0.0104166); m_detuneSlider->setSliderStyle (Slider::RotaryVerticalDrag); m_detuneSlider->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); m_detuneSlider->setColour (Slider::thumbColourId, Colour (0xff1de9b6)); m_detuneSlider->setColour (Slider::trackColourId, Colour (0x00000000)); m_detuneSlider->setColour (Slider::rotarySliderFillColourId, Colour (0xff1de9b6)); m_detuneSlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0xff212121)); m_detuneSlider->setColour (Slider::textBoxTextColourId, Colour (0xff212121)); m_detuneSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); m_detuneSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff1de9b6)); m_detuneSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000)); m_detuneSlider->addListener (this); addAndMakeVisible (m_distortionSlider = new Slider ("Distortion Slider")); m_distortionSlider->setRange (0, 1, 0); m_distortionSlider->setSliderStyle (Slider::RotaryVerticalDrag); m_distortionSlider->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); m_distortionSlider->setColour (Slider::thumbColourId, Colour (0xff1de9b6)); m_distortionSlider->setColour (Slider::trackColourId, Colour (0x00000000)); m_distortionSlider->setColour (Slider::rotarySliderFillColourId, Colour (0xff1de9b6)); m_distortionSlider->setColour (Slider::rotarySliderOutlineColourId, Colour (0xff212121)); m_distortionSlider->setColour (Slider::textBoxTextColourId, Colour (0xff212121)); m_distortionSlider->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); m_distortionSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff1de9b6)); m_distortionSlider->setColour (Slider::textBoxOutlineColourId, Colour (0x00000000)); m_distortionSlider->addListener (this); addAndMakeVisible (m_distLabel = new Label ("Distortion Label", TRANS("DIST."))); m_distLabel->setFont (Font ("Avenir Next", 14.00f, Font::plain)); m_distLabel->setJustificationType (Justification::centred); m_distLabel->setEditable (false, false, false); m_distLabel->setColour (Label::textColourId, Colour (0xff212121)); m_distLabel->setColour (TextEditor::textColourId, Colour (0xff212121)); m_distLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); m_distLabel->setColour (TextEditor::highlightColourId, Colour (0xff1de9b6)); //[UserPreSize] m_detuneSlider->setValue(0.5); //[/UserPreSize] setSize (176, 68); //[Constructor] You can add your own custom stuff here.. //[/Constructor] }
//------------------------------------------------------------------------------ AboutPage::AboutPage() : Component() { const double m(getSystemScaling()); String tempstr; Font tempFont(26.0f*m); tempFont.setHeight(28.0f*m); tempstr = T("MOD Live-ISO"); addAndMakeVisible(title = new Label(T("title"), tempstr)); title->setFont(tempFont); title->setColour(Label::textColourId, textColour); tempFont.setBold(true); tempFont.setHeight(14.0f*m); tempstr = T("Author:"); addAndMakeVisible(authorLabel = new Label(T("authorLabel"), tempstr)); authorLabel->setFont(tempFont); authorLabel->setColour(Label::textColourId, textColour); authorLabel->setJustificationType(Justification::centredLeft); tempstr = T("Website:"); addAndMakeVisible(websiteLabel = new Label(T("websiteLabel"), tempstr)); websiteLabel->setFont(tempFont); websiteLabel->setColour(Label::textColourId, textColour); websiteLabel->setJustificationType(Justification::centredLeft); tempstr = T("Credits:"); addAndMakeVisible(creditsLabel = new Label(T("creditsLabel"), tempstr)); creditsLabel->setFont(tempFont); creditsLabel->setColour(Label::textColourId, textColour); creditsLabel->setJustificationType(Justification::centredLeft); tempstr = T("About:"); addAndMakeVisible(descriptionLabel = new Label(T("descriptionLabel"), tempstr)); descriptionLabel->setFont(tempFont); descriptionLabel->setColour(Label::textColourId, textColour); descriptionLabel->setJustificationType(Justification::topLeft); tempstr = T("License:"); addAndMakeVisible(licenseLabel = new Label(T("licenseLabel"), tempstr)); licenseLabel->setFont(tempFont); licenseLabel->setColour(Label::textColourId, textColour); licenseLabel->setJustificationType(Justification::centredLeft); tempstr = T("falkTX"); addAndMakeVisible(author = new Label(T("author"), tempstr)); tempFont.setBold(false); author->setFont(tempFont); author->setColour(Label::textColourId, textColour); author->setJustificationType(Justification::centredLeft); tempstr = T("https://github.com/moddevices/mod-iso"); addAndMakeVisible(website = new Label(T("website"), tempstr)); website->setFont(tempFont); website->setColour(Label::textColourId, textColour); website->setJustificationType(Justification::centredLeft); tempstr = T("Niall Moody, for making Twindy. See: http://www.niallmoody.com/twindy/\n"); tempstr << T("Julian Storer, for making JUCE. See: http://www.rawmaterialsoftware.com/juce/"); addAndMakeVisible(credits = new Label(T("credits"), tempstr)); credits->setFont(tempFont); credits->setColour(Label::textColourId, textColour); credits->setJustificationType(Justification::topLeft); tempstr = T("Publications, products, content or services referenced herein or on the website are the exclusive"); tempstr << T(" trademarks or servicemarks of MOD.\nOther product and company names mentioned in the site may be"); tempstr << T(" the trademarks of their respective owners.\nAll software is available under the GPL license, see"); tempstr << T(" https://www.gnu.org/licenses/gpl-2.0.html for details."); addAndMakeVisible(description = new Label(T("description"), tempstr)); description->setFont(tempFont); description->setColour(Label::textColourId, textColour); description->setJustificationType(Justification::topLeft); tempstr = T("GPL - see the COPYING file for details."); addAndMakeVisible(license = new Label(T("license"), tempstr)); license->setFont(tempFont); license->setColour(Label::textColourId, textColour); license->setJustificationType(Justification::centredLeft); }
AudioPlaybackDemo::AudioPlaybackDemo (AudioFilePlayerExt& audioFilePlayer_, BufferTransformAudioSource& bufferTransformAudioSource) : audioFilePlayer (audioFilePlayer_), loopComponent (audioFilePlayer), backgroundThread ("Waveform Thread"), audioThumbnailCache (10), audioThumbnail (512, *audioFilePlayer.getAudioFormatManager(), audioThumbnailCache), distortionDemo (bufferTransformAudioSource) { audioThumbnailImage = new AudioThumbnailImage (audioFilePlayer, backgroundThread, audioThumbnail, 512); positionableWaveDisplay = new PositionableWaveDisplay (*audioThumbnailImage, backgroundThread); addAndMakeVisible (positionableWaveDisplay); draggableWaveDisplay = new DraggableWaveDisplay (*audioThumbnailImage); addAndMakeVisible (draggableWaveDisplay); addAndMakeVisible (&resolutionSlider); resolutionSlider.addListener (this); resolutionSlider.setRange (0, 20); resolutionSlider.setTextBoxStyle (Slider::NoTextBox, false, 50, 20); resolutionSlider.setValue (3.0); resolutionSlider.setSkewFactorFromMidPoint (3.0); resolutionSlider.setSliderStyle (Slider::RotaryHorizontalDrag); addAndMakeVisible (&resolutionLabel); resolutionLabel.setText ("Detail", dontSendNotification); resolutionLabel.setFont (12.0f); resolutionLabel.setJustificationType (Justification::centred); resolutionLabel.attachToComponent (&resolutionSlider, false); resolutionLabel.setColour (Label::textColourId, Colours::white); addAndMakeVisible (&zoomSlider); zoomSlider.addListener (this); zoomSlider.setRange (0.01, 2); zoomSlider.setTextBoxStyle (Slider::NoTextBox, false, 50, 20); zoomSlider.setSkewFactorFromMidPoint (1.0); zoomSlider.setValue (1.0); zoomSlider.setSliderStyle (Slider::RotaryVerticalDrag); addAndMakeVisible (&zoomLabel); zoomLabel.setText ("Zoom", dontSendNotification); zoomLabel.setFont (12.0f); zoomLabel.setJustificationType (Justification::centred); zoomLabel.attachToComponent (&zoomSlider, false); zoomLabel.setColour (Label::textColourId, Colours::white); addAndMakeVisible (&loopComponent); addAndMakeVisible (&filterGroup); addAndMakeVisible (&rateGroup); filterGroup.setText ("Filter"); rateGroup.setText ("Tempo and Pitch"); filterGroup.setColour (GroupComponent::outlineColourId, Colours::white); filterGroup.setColour (GroupComponent::textColourId, Colours::white); rateGroup.setColour (GroupComponent::outlineColourId, Colours::white); rateGroup.setColour (GroupComponent::textColourId, Colours::white); for (int i = 0; i < numControls; i++) { playerControls.add (new Slider()); playerControlLabels.add (new Label ()); addAndMakeVisible (playerControls[i]); addAndMakeVisible (playerControlLabels[i]); playerControlLabels[i]->setFont (12.0f); playerControlLabels[i]->attachToComponent (playerControls[i], false); playerControls[i]->addListener (this); playerControls[i]->setValue (1.0); playerControls[i]->setSliderStyle (Slider::RotaryVerticalDrag); playerControls[i]->setTextBoxStyle (Slider::TextBoxBelow, false, 50, 16); Justification centreJustification (Justification::centred); playerControlLabels[i]->setJustificationType (centreJustification); playerControlLabels[i]->setColour (Label::textColourId, Colours::white); } playerControls[lowEQ]->setRange (0.05, 2, 0.001); playerControls[midEQ]->setRange (0.05, 2, 0.001); playerControls[highEQ]->setRange (0.05, 2, 0.001); playerControls[rate]->setRange (0.5, 1.5, 0.001); playerControls[tempo]->setRange (0.5, 1.5, 0.001); playerControls[pitch]->setRange (0.5, 1.5, 0.001); for (int i = 0; i < numControls; i++) playerControls[i]->setSkewFactorFromMidPoint (1.0); playerControlLabels[lowEQ]->setText ("Low EQ", dontSendNotification); playerControlLabels[midEQ]->setText ("Mid EQ", dontSendNotification); playerControlLabels[highEQ]->setText ("High EQ", dontSendNotification); playerControlLabels[rate]->setText ("Rate", dontSendNotification); playerControlLabels[tempo]->setText ("Tempo", dontSendNotification); playerControlLabels[pitch]->setText ("Pitch", dontSendNotification); addAndMakeVisible (&distortionDemo); backgroundThread.startThread (1); }
LfpDisplayCanvas::LfpDisplayCanvas(LfpDisplayNode* processor_) : screenBufferIndex(0), timebase(1.0f), displayGain(1.0f), timeOffset(0.0f), processor(processor_), displayBufferIndex(0) { nChans = processor->getNumInputs(); sampleRate = processor->getSampleRate(); std::cout << "Setting num inputs on LfpDisplayCanvas to " << nChans << std::endl; displayBuffer = processor->getDisplayBufferAddress(); displayBufferSize = displayBuffer->getNumSamples(); std::cout << "Setting displayBufferSize on LfpDisplayCanvas to " << displayBufferSize << std::endl; screenBuffer = new AudioSampleBuffer(MAX_N_CHAN, MAX_N_SAMP); screenBuffer->clear(); viewport = new Viewport(); lfpDisplay = new LfpDisplay(this, viewport); timescale = new LfpTimescale(this); timescale->setTimebase(timebase); viewport->setViewedComponent(lfpDisplay, false); viewport->setScrollBarsShown(true, false); scrollBarThickness = viewport->getScrollBarThickness(); //viewport->getVerticalScrollBar()->addListener(this->scrollBarMoved(viewport->getVerticalScrollBar(), 1.0)); addAndMakeVisible(viewport); addAndMakeVisible(timescale); voltageRanges.add("50"); voltageRanges.add("100"); voltageRanges.add("500"); voltageRanges.add("1000"); voltageRanges.add("2000"); voltageRanges.add("5000"); timebases.add("0.5"); timebases.add("1.0"); timebases.add("2.0"); timebases.add("5.0"); timebases.add("10.0"); spreads.add("10"); spreads.add("20"); spreads.add("30"); spreads.add("40"); spreads.add("50"); spreads.add("60"); colorGroupings.add("1"); colorGroupings.add("2"); colorGroupings.add("4"); colorGroupings.add("8"); colorGroupings.add("16"); rangeSelection = new ComboBox("Voltage range"); rangeSelection->addItemList(voltageRanges, 1); rangeSelection->setSelectedId(4,false); rangeSelection->addListener(this); addAndMakeVisible(rangeSelection); timebaseSelection = new ComboBox("Timebase"); timebaseSelection->addItemList(timebases, 1); timebaseSelection->setSelectedId(2, false); timebaseSelection->addListener(this); addAndMakeVisible(timebaseSelection); spreadSelection = new ComboBox("Spread"); spreadSelection->addItemList(spreads, 1); spreadSelection->setSelectedId(5,false); spreadSelection->addListener(this); addAndMakeVisible(spreadSelection); colorGroupingSelection = new ComboBox("Color Grouping"); colorGroupingSelection->addItemList(colorGroupings, 1); colorGroupingSelection->setSelectedId(1,false); colorGroupingSelection->addListener(this); addAndMakeVisible(colorGroupingSelection); lfpDisplay->setNumChannels(nChans); lfpDisplay->setRange(1000.0f); // add event display-specific controls (currently just an enable/disable button) for (int i = 0; i < 8; i++) { EventDisplayInterface* eventOptions = new EventDisplayInterface(lfpDisplay, this, i); eventDisplayInterfaces.add(eventOptions); addAndMakeVisible(eventOptions); eventOptions->setBounds(500+(floor(i/2)*20), getHeight()-20-(i%2)*20, 40, 20); lfpDisplay->setEventDisplayState(i,true); } }
void update() { const AudioProcessorGraph::Node::Ptr f (graph.getNodeForId (filterID)); if (f == nullptr) { delete this; return; } numIns = f->getProcessor()->getNumInputChannels(); if (f->getProcessor()->acceptsMidi()) ++numIns; numOuts = f->getProcessor()->getNumOutputChannels(); if (f->getProcessor()->producesMidi()) ++numOuts; int w = 100; int h = 60; w = jmax (w, (jmax (numIns, numOuts) + 1) * 20); const int textWidth = font.getStringWidth (f->getProcessor()->getName()); w = jmax (w, 16 + jmin (textWidth, 300)); if (textWidth > 300) h = 100; setSize (w, h); setName (f->getProcessor()->getName()); { double x, y; graph.getNodePosition (filterID, x, y); setCentreRelative ((float) x, (float) y); } if (numIns != numInputs || numOuts != numOutputs) { numInputs = numIns; numOutputs = numOuts; deleteAllChildren(); int i; for (i = 0; i < f->getProcessor()->getNumInputChannels(); ++i) addAndMakeVisible (new PinComponent (graph, filterID, i, true)); if (f->getProcessor()->acceptsMidi()) addAndMakeVisible (new PinComponent (graph, filterID, FilterGraph::midiChannelNumber, true)); for (i = 0; i < f->getProcessor()->getNumOutputChannels(); ++i) addAndMakeVisible (new PinComponent (graph, filterID, i, false)); if (f->getProcessor()->producesMidi()) addAndMakeVisible (new PinComponent (graph, filterID, FilterGraph::midiChannelNumber, false)); resized(); } }
//============================================================================== SpectrumShift::SpectrumShift () : Component (T("SpectrumShift")), groupComponent (0), shift_valueslider (0), label (0), textButton (0), resetbutton (0), label2 (0), textButton2 (0) { addAndMakeVisible (groupComponent = new GroupComponent (T("new group"), T("Spectrum Shift"))); groupComponent->setTextLabelPosition (Justification::centredLeft); groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000)); addAndMakeVisible (shift_valueslider = new Slider (T("new slider"))); shift_valueslider->setRange (-22050, 22050, 0); shift_valueslider->setSliderStyle (Slider::LinearHorizontal); shift_valueslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); shift_valueslider->setColour (Slider::backgroundColourId, Colour (0x956565)); shift_valueslider->setColour (Slider::thumbColourId, Colour (0x7bfffcfc)); shift_valueslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); shift_valueslider->addListener (this); addAndMakeVisible (label = new Label (T("new label"), T("Shift value (Hz)"))); label->setFont (Font (15.0000f, Font::plain)); label->setJustificationType (Justification::centredLeft); label->setEditable (false, false, false); label->setColour (Label::backgroundColourId, Colour (0x0)); label->setColour (Label::textColourId, Colours::black); label->setColour (Label::outlineColourId, Colour (0x0)); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (textButton = new TextButton (T("new button"))); textButton->setButtonText (T("Do it!")); textButton->addButtonListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0x44bbbbff)); addAndMakeVisible (resetbutton = new TextButton (T("resetbutton"))); resetbutton->setButtonText (T("reset")); resetbutton->addButtonListener (this); resetbutton->setColour (TextButton::buttonColourId, Colour (0x25bbbbff)); addAndMakeVisible (label2 = new Label (T("new label"), T("Optimal spectrum shift, with no window artefacts. The frequency you specify (positive or negative) will be added to all frequency values, shifting the spectrum up or down."))); label2->setFont (Font (15.0000f, Font::plain)); label2->setJustificationType (Justification::centredLeft); label2->setEditable (false, false, false); label2->setColour (Label::backgroundColourId, Colour (0x0)); label2->setColour (Label::textColourId, Colours::black); label2->setColour (Label::outlineColourId, Colour (0x0)); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (textButton2 = new TextButton (T("new button"))); textButton2->setButtonText (T("Redo it!")); textButton2->addButtonListener (this); textButton2->setColour (TextButton::buttonColourId, Colour (0x40bbbbff)); setSize (600, 400); //[Constructor] You can add your own custom stuff here.. buttonClicked(resetbutton); #undef Slider //[/Constructor] }
SettingsPageComponent::SettingsPageComponent(LauncherComponent* lc) { bgColor = Colour(0xffd23c6d); bgImage = createImageFromFile(assetFile("settingsBackground.png")); mainPage = new Component(); addAndMakeVisible(mainPage); mainPage->toBack(); ChildProcess child{}; /* Adding the personalize button */ advancedPage = new AdvancedSettingsPage(lc); advanced = new TextButton("Advanced Settings"); advanced->addListener(this); addAndMakeVisible(advanced); brightness = 8; #if JUCE_LINUX // Get initial brightness value if(child.start("cat /sys/class/backlight/backlight/brightness")) { String result{child.readAllProcessOutput()}; brightness = result.getIntValue(); }; #endif volume = 90; #if JUCE_LINUX // Get initial volume value StringArray cmd{ "amixer","sget","Power Amplifier" }; if(child.start(cmd)) { const String result (child.readAllProcessOutput()); int resultIndex = result.indexOf("[")+1; child.waitForProcessToFinish (5 * 1000); char buff[4]; for (int i = 0; i<4; i++) { char c = result[resultIndex+i]; if( c >= '0' && c <= '9' ) { buff[i]=c; } else { buff[i]=(char)0; } } String newVol = String(buff); volume = newVol.getIntValue(); } #endif ScopedPointer<Drawable> brightLo = Drawable::createFromImageFile(assetFile("brightnessIconLo.png")); ScopedPointer<Drawable> brightHi = Drawable::createFromImageFile(assetFile("brightnessIconHi.png")); screenBrightnessSlider = ScopedPointer<IconSliderComponent>(new IconSliderComponent(*brightLo, *brightHi)); screenBrightnessSlider->addListener(this); screenBrightnessSlider->slider->setValue(1+(brightness-0.09)*10); ScopedPointer<Drawable> volLo = Drawable::createFromImageFile(assetFile("volumeIconLo.png")); ScopedPointer<Drawable> volHi = Drawable::createFromImageFile(assetFile("volumeIconHi.png")); volumeSlider = ScopedPointer<IconSliderComponent>(new IconSliderComponent(*volLo, *volHi)); volumeSlider->addListener(this); volumeSlider->slider->setValue(volume); // create back button backButton = createImageButton( "Back", createImageFromFile(assetFile("backIcon.png"))); backButton->addListener(this); backButton->setAlwaysOnTop(true); addAndMakeVisible(backButton); wifiCategoryItem = new WifiCategoryItemComponent(); wifiCategoryItem->button->addListener(this); addAndMakeVisible(wifiCategoryItem); getWifiStatus().addListener(wifiCategoryItem); addAndMakeVisible(screenBrightnessSlider); addAndMakeVisible(volumeSlider); wifiPage = new SettingsPageWifiComponent(); }
//============================================================================== WindowComponent::WindowComponent () : grpTextLayoutEditor (0), grpLayout (0), lblWordWrap (0), lblReadingDirection (0), lblJustification (0), lblLineSpacing (0), cmbWordWrap (0), cmbReadingDirection (0), cmbJustification (0), slLineSpacing (0), grpFont (0), lblFontFamily (0), lblFontStyle (0), tbUnderlined (0), tbStrikethrough (0), cmbFontFamily (0), cmbFontStyle (0), grpColor (0), ceColor (0), lblColor (0), grpDbgCaret (0), lblCaretPos (0), slCaretPos (0), lblCaretSelStart (0), slCaretSelStart (0), slCaretSelEnd (0), lblCaretSelEnd (0), grpDbgRanges (0), txtDbgRanges (0), txtEditor (0), tbDbgRanges (0), slFontSize (0), lblFontSize (0), grpDbgActions (0), tbR1C1 (0), tbR2C1 (0), tbR3C1 (0), tbR4C1 (0), tbR1C2 (0), tbR2C2 (0), tbR3C2 (0), tbR4C2 (0), tbR1C3 (0), tbR2C3 (0), tbR3C3 (0), tbR4C7 (0), tbR1C4 (0), tbR1C5 (0), tbR2C4 (0), tbR3C4 (0), tbR4C8 (0), tbR2C5 (0), tbR3C5 (0), tbR4C9 (0), tbR5C1 (0), tbR5C2 (0), tbR5C3 (0), tbR5C4 (0), tbR5C5 (0) { addAndMakeVisible (grpTextLayoutEditor = new GroupComponent (L"grpTextLayoutEditor", L"Text Layout Editor")); addAndMakeVisible (grpLayout = new GroupComponent (L"grpLayout", L"Layout")); addAndMakeVisible (lblWordWrap = new Label (L"lblWordWrap", L"Word Wrap:")); lblWordWrap->setFont (Font (15.0000f)); lblWordWrap->setJustificationType (Justification::centredLeft); lblWordWrap->setEditable (false, false, false); lblWordWrap->setColour (TextEditor::textColourId, Colours::black); lblWordWrap->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblReadingDirection = new Label (L"lblReadingDirection", L"Reading Direction:")); lblReadingDirection->setFont (Font (15.0000f)); lblReadingDirection->setJustificationType (Justification::centredLeft); lblReadingDirection->setEditable (false, false, false); lblReadingDirection->setColour (TextEditor::textColourId, Colours::black); lblReadingDirection->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblJustification = new Label (L"lblJustification", L"Justification:")); lblJustification->setFont (Font (15.0000f)); lblJustification->setJustificationType (Justification::centredLeft); lblJustification->setEditable (false, false, false); lblJustification->setColour (TextEditor::textColourId, Colours::black); lblJustification->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblLineSpacing = new Label (L"lblLineSpacing", L"Line Spacing:")); lblLineSpacing->setFont (Font (15.0000f)); lblLineSpacing->setJustificationType (Justification::centredLeft); lblLineSpacing->setEditable (false, false, false); lblLineSpacing->setColour (TextEditor::textColourId, Colours::black); lblLineSpacing->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (cmbWordWrap = new ComboBox (L"cmbWordWrap")); cmbWordWrap->setEditableText (false); cmbWordWrap->setJustificationType (Justification::centredLeft); cmbWordWrap->setTextWhenNothingSelected (String::empty); cmbWordWrap->setTextWhenNoChoicesAvailable (L"(no choices)"); cmbWordWrap->addItem (L"None", 1); cmbWordWrap->addItem (L"By Word", 2); cmbWordWrap->addItem (L"By Character", 3); cmbWordWrap->addListener (this); addAndMakeVisible (cmbReadingDirection = new ComboBox (L"cmbReadingDirection")); cmbReadingDirection->setEditableText (false); cmbReadingDirection->setJustificationType (Justification::centredLeft); cmbReadingDirection->setTextWhenNothingSelected (String::empty); cmbReadingDirection->setTextWhenNoChoicesAvailable (L"(no choices)"); cmbReadingDirection->addItem (L"Natural", 1); cmbReadingDirection->addItem (L"Left to Right", 2); cmbReadingDirection->addItem (L"Right to Left", 3); cmbReadingDirection->addListener (this); addAndMakeVisible (cmbJustification = new ComboBox (L"cmbJustification")); cmbJustification->setEditableText (false); cmbJustification->setJustificationType (Justification::centredLeft); cmbJustification->setTextWhenNothingSelected (String::empty); cmbJustification->setTextWhenNoChoicesAvailable (L"(no choices)"); cmbJustification->addItem (L"Left", 1); cmbJustification->addItem (L"Right", 2); cmbJustification->addItem (L"Centered", 3); cmbJustification->addItem (L"Justified", 4); cmbJustification->addListener (this); addAndMakeVisible (slLineSpacing = new Slider (L"slLineSpacing")); slLineSpacing->setRange (0, 10, 0.01); slLineSpacing->setSliderStyle (Slider::IncDecButtons); slLineSpacing->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slLineSpacing->addListener (this); addAndMakeVisible (grpFont = new GroupComponent (L"grpFont", L"Font")); addAndMakeVisible (lblFontFamily = new Label (L"lblFontFamily", L"Font Family:")); lblFontFamily->setFont (Font (15.0000f)); lblFontFamily->setJustificationType (Justification::centredLeft); lblFontFamily->setEditable (false, false, false); lblFontFamily->setColour (TextEditor::textColourId, Colours::black); lblFontFamily->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (lblFontStyle = new Label (L"lblFontStyle", L"Font Style:")); lblFontStyle->setFont (Font (15.0000f)); lblFontStyle->setJustificationType (Justification::centredLeft); lblFontStyle->setEditable (false, false, false); lblFontStyle->setColour (TextEditor::textColourId, Colours::black); lblFontStyle->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (tbUnderlined = new ToggleButton (L"new toggle button")); tbUnderlined->setButtonText (L"Underlined"); tbUnderlined->addListener (this); addAndMakeVisible (tbStrikethrough = new ToggleButton (L"new toggle button")); tbStrikethrough->setButtonText (L"Strikethrough"); tbStrikethrough->addListener (this); addAndMakeVisible (cmbFontFamily = new ComboBox (L"cmbFontFamily")); cmbFontFamily->setEditableText (false); cmbFontFamily->setJustificationType (Justification::centredLeft); cmbFontFamily->setTextWhenNothingSelected (String::empty); cmbFontFamily->setTextWhenNoChoicesAvailable (L"(no choices)"); cmbFontFamily->addListener (this); addAndMakeVisible (cmbFontStyle = new ComboBox (L"cmbFontStyle")); cmbFontStyle->setEditableText (false); cmbFontStyle->setJustificationType (Justification::centredLeft); cmbFontStyle->setTextWhenNothingSelected (String::empty); cmbFontStyle->setTextWhenNoChoicesAvailable (L"(no choices)"); cmbFontStyle->addListener (this); addAndMakeVisible (grpColor = new GroupComponent (L"grpColor", L"Color")); addAndMakeVisible (ceColor = new ColourEditorComponent(false)); ceColor->setName (L"ceColor"); addAndMakeVisible (lblColor = new Label (L"lblColor", L"Color:")); lblColor->setFont (Font (15.0000f)); lblColor->setJustificationType (Justification::centredLeft); lblColor->setEditable (false, false, false); lblColor->setColour (TextEditor::textColourId, Colours::black); lblColor->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (grpDbgCaret = new GroupComponent (L"grpDbgCaret", L"Debug Caret")); addAndMakeVisible (lblCaretPos = new Label (L"lblCaretPos", L"Caret Position")); lblCaretPos->setFont (Font (15.0000f)); lblCaretPos->setJustificationType (Justification::centredLeft); lblCaretPos->setEditable (false, false, false); lblCaretPos->setColour (TextEditor::textColourId, Colours::black); lblCaretPos->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (slCaretPos = new Slider (L"slCaretPos")); slCaretPos->setRange (0, 1000000, 1); slCaretPos->setSliderStyle (Slider::IncDecButtons); slCaretPos->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slCaretPos->addListener (this); addAndMakeVisible (lblCaretSelStart = new Label (L"lblCaretSelStart", L"Selection Start")); lblCaretSelStart->setFont (Font (15.0000f)); lblCaretSelStart->setJustificationType (Justification::centredLeft); lblCaretSelStart->setEditable (false, false, false); lblCaretSelStart->setColour (TextEditor::textColourId, Colours::black); lblCaretSelStart->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (slCaretSelStart = new Slider (L"slCaretSelStart")); slCaretSelStart->setRange (0, 1000000, 1); slCaretSelStart->setSliderStyle (Slider::IncDecButtons); slCaretSelStart->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slCaretSelStart->addListener (this); addAndMakeVisible (slCaretSelEnd = new Slider (L"slCaretSelEnd")); slCaretSelEnd->setRange (0, 1000000, 1); slCaretSelEnd->setSliderStyle (Slider::IncDecButtons); slCaretSelEnd->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slCaretSelEnd->addListener (this); addAndMakeVisible (lblCaretSelEnd = new Label (L"lblCaretSelEnd", L"Selection End")); lblCaretSelEnd->setFont (Font (15.0000f)); lblCaretSelEnd->setJustificationType (Justification::centredLeft); lblCaretSelEnd->setEditable (false, false, false); lblCaretSelEnd->setColour (TextEditor::textColourId, Colours::black); lblCaretSelEnd->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (grpDbgRanges = new GroupComponent (L"grpDbgRanges", L"Debug Ranges")); addAndMakeVisible (txtDbgRanges = new TextEditor (L"txtDbgRanges")); txtDbgRanges->setMultiLine (true); txtDbgRanges->setReturnKeyStartsNewLine (true); txtDbgRanges->setReadOnly (false); txtDbgRanges->setScrollbarsShown (true); txtDbgRanges->setCaretVisible (true); txtDbgRanges->setPopupMenuEnabled (true); txtDbgRanges->setText (String::empty); addAndMakeVisible (txtEditor = new TextEditor (L"txtEditor")); txtEditor->setMultiLine (true); txtEditor->setReturnKeyStartsNewLine (true); txtEditor->setReadOnly (false); txtEditor->setScrollbarsShown (true); txtEditor->setCaretVisible (true); txtEditor->setPopupMenuEnabled (true); txtEditor->setText (String::empty); addAndMakeVisible (tbDbgRanges = new TextButton (L"tbDbgRanges")); tbDbgRanges->setButtonText (L"Update"); tbDbgRanges->addListener (this); addAndMakeVisible (slFontSize = new Slider (L"slFontSize")); slFontSize->setRange (0, 256, 0.0001); slFontSize->setSliderStyle (Slider::IncDecButtons); slFontSize->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slFontSize->addListener (this); addAndMakeVisible (lblFontSize = new Label (L"lblFontSize", L"Font Size:")); lblFontSize->setFont (Font (15.0000f)); lblFontSize->setJustificationType (Justification::centredLeft); lblFontSize->setEditable (false, false, false); lblFontSize->setColour (TextEditor::textColourId, Colours::black); lblFontSize->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (grpDbgActions = new GroupComponent (L"grpDbgActions", L"Debug Actions")); addAndMakeVisible (tbR1C1 = new TextButton (L"tbR1C1")); tbR1C1->addListener (this); addAndMakeVisible (tbR2C1 = new TextButton (L"tbR2C1")); tbR2C1->addListener (this); addAndMakeVisible (tbR3C1 = new TextButton (L"tbR3C1")); tbR3C1->addListener (this); addAndMakeVisible (tbR4C1 = new TextButton (L"tbR4C1")); tbR4C1->addListener (this); addAndMakeVisible (tbR1C2 = new TextButton (L"tbR1C2")); tbR1C2->addListener (this); addAndMakeVisible (tbR2C2 = new TextButton (L"tbR2C2")); tbR2C2->addListener (this); addAndMakeVisible (tbR3C2 = new TextButton (L"tbR3C2")); tbR3C2->addListener (this); addAndMakeVisible (tbR4C2 = new TextButton (L"tbR4C2")); tbR4C2->addListener (this); addAndMakeVisible (tbR1C3 = new TextButton (L"tbR1C3")); tbR1C3->addListener (this); addAndMakeVisible (tbR2C3 = new TextButton (L"tbR2C3")); tbR2C3->addListener (this); addAndMakeVisible (tbR3C3 = new TextButton (L"tbR3C3")); tbR3C3->addListener (this); addAndMakeVisible (tbR4C7 = new TextButton (L"tbR4C3")); tbR4C7->addListener (this); addAndMakeVisible (tbR1C4 = new TextButton (L"tbR1C4")); tbR1C4->addListener (this); addAndMakeVisible (tbR1C5 = new TextButton (L"tbR1C5")); tbR1C5->addListener (this); addAndMakeVisible (tbR2C4 = new TextButton (L"tbR2C4")); tbR2C4->addListener (this); addAndMakeVisible (tbR3C4 = new TextButton (L"tbR3C4")); tbR3C4->addListener (this); addAndMakeVisible (tbR4C8 = new TextButton (L"tbR4C4")); tbR4C8->addListener (this); addAndMakeVisible (tbR2C5 = new TextButton (L"tbR2C5")); tbR2C5->addListener (this); addAndMakeVisible (tbR3C5 = new TextButton (L"tbR3C5")); tbR3C5->addListener (this); addAndMakeVisible (tbR4C9 = new TextButton (L"tbR4C5")); tbR4C9->addListener (this); addAndMakeVisible (tbR5C1 = new TextButton (L"tbR5C1")); tbR5C1->addListener (this); addAndMakeVisible (tbR5C2 = new TextButton (L"tbR5C2")); tbR5C2->addListener (this); addAndMakeVisible (tbR5C3 = new TextButton (L"tbR5C3")); tbR5C3->addListener (this); addAndMakeVisible (tbR5C4 = new TextButton (L"tbR5C4")); tbR5C4->addListener (this); addAndMakeVisible (tbR5C5 = new TextButton (L"tbR5C5")); tbR5C5->addListener (this); //[UserPreSize] //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. cmbWordWrap->setText("None"); cmbReadingDirection->setText("Natural"); cmbJustification->setText("Left"); cmbFontFamily->addItemList(Font::findAllTypefaceFamilies(), 1); cmbFontFamily->setText("Verdana"); slFontSize->setValue(15.0000f); //[/Constructor] }
//============================================================================== AmplitudeToPhase::AmplitudeToPhase () : Component (T("AmplitudeToPhase")), groupComponent (0), amplitude_multiplierslider (0), label (0), textButton (0), resetbutton (0), label2 (0), textButton2 (0) { addAndMakeVisible (groupComponent = new GroupComponent (T("new group"), T("Amplitude->Phase"))); groupComponent->setTextLabelPosition (Justification::centredLeft); groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000)); addAndMakeVisible (amplitude_multiplierslider = new Slider (T("new slider"))); amplitude_multiplierslider->setRange (0, 100, 0); amplitude_multiplierslider->setSliderStyle (Slider::LinearHorizontal); amplitude_multiplierslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); amplitude_multiplierslider->setColour (Slider::backgroundColourId, Colour (0x956565)); amplitude_multiplierslider->setColour (Slider::thumbColourId, Colour (0x79fffcfc)); amplitude_multiplierslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); amplitude_multiplierslider->addListener (this); addAndMakeVisible (label = new Label (T("new label"), T("Amplitude multiplier (0-100)"))); label->setFont (Font (15.0000f, Font::plain)); label->setJustificationType (Justification::centredLeft); label->setEditable (false, false, false); label->setColour (Label::backgroundColourId, Colour (0x0)); label->setColour (Label::textColourId, Colours::black); label->setColour (Label::outlineColourId, Colour (0x0)); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (textButton = new TextButton (T("new button"))); textButton->setButtonText (T("Do it!")); textButton->addListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0x4bbbbbff)); addAndMakeVisible (resetbutton = new TextButton (T("resetbutton"))); resetbutton->setButtonText (T("reset")); resetbutton->addListener (this); resetbutton->setColour (TextButton::buttonColourId, Colour (0x40bbbbff)); addAndMakeVisible (label2 = new Label (T("new label"), T("The phases of the partials are set to their respective amplitudes, after a specified gain multiplication. Rather useless."))); label2->setFont (Font (15.0000f, Font::plain)); label2->setJustificationType (Justification::centredLeft); label2->setEditable (false, false, false); label2->setColour (Label::backgroundColourId, Colour (0x0)); label2->setColour (Label::textColourId, Colours::black); label2->setColour (Label::outlineColourId, Colour (0x0)); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (textButton2 = new TextButton (T("new button"))); textButton2->setButtonText (T("Redo it!")); textButton2->addListener (this); textButton2->setColour (TextButton::buttonColourId, Colour (0x40bbbbff)); setSize (600, 400); //[Constructor] You can add your own custom stuff here.. buttonClicked(resetbutton); #undef Slider //[/Constructor] }
//============================================================================== WaveGenerationComponent::WaveGenerationComponent () { //[Constructor_pre] You can add your own custom stuff here.. //[/Constructor_pre] addAndMakeVisible (comboBox = new ComboBox ("new combo box")); comboBox->setEditableText (false); comboBox->setJustificationType (Justification::centredLeft); comboBox->setTextWhenNothingSelected (String::empty); comboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); comboBox->addItem (TRANS("Sine"), 1); comboBox->addItem (TRANS("Square"), 2); comboBox->addItem (TRANS("Saw"), 3); comboBox->addItem (TRANS("Triangle"), 4); comboBox->addItem (TRANS("Noise"), 5); comboBox->addListener (this); addAndMakeVisible (slider = new Slider ("new slider")); slider->setRange (0, 10, 0); slider->setSliderStyle (Slider::IncDecButtons); slider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slider->addListener (this); addAndMakeVisible (slider2 = new Slider ("new slider")); slider2->setRange (0, 10, 0); slider2->setSliderStyle (Slider::IncDecButtons); slider2->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); slider2->addListener (this); addAndMakeVisible (slider3 = new Slider ("new slider")); slider3->setRange (0, 10, 0); slider3->setSliderStyle (Slider::RotaryVerticalDrag); slider3->setTextBoxStyle (Slider::TextBoxBelow, false, 80, 20); slider3->addListener (this); addAndMakeVisible (label = new Label ("new label", TRANS("Octave"))); label->setFont (Font (15.00f, Font::plain)); label->setJustificationType (Justification::centredLeft); label->setEditable (false, false, false); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (label2 = new Label ("new label", TRANS("Pitch"))); label2->setFont (Font (15.00f, Font::plain)); label2->setJustificationType (Justification::centredLeft); label2->setEditable (false, false, false); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (label3 = new Label ("new label", TRANS("Detune"))); label3->setFont (Font (15.00f, Font::plain)); label3->setJustificationType (Justification::centred); label3->setEditable (false, false, false); label3->setColour (TextEditor::textColourId, Colours::black); label3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); //[UserPreSize] //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. //[/Constructor] }
//============================================================================== WdmChMapComponent::WdmChMapComponent () : m_out (false), m_group (0), m_input (0), m_output (0), m_dragging (0), m_speaker_label (0), m_speaker_table (0), m_dev_ch_label (0), m_device_channels (0), m_speaker(0), m_update (0) { setName("WDM Ch Mapper"); initWdmNames(); getChannelNames(); getMappedNames(); addAndMakeVisible (m_group = new GroupComponent ("channelsGroup", "In Channels")); addAndMakeVisible (m_input = new ToggleButton ("input")); m_input->setButtonText ("Input"); m_input->addListener (this); m_input->setRadioGroupId(1234); addAndMakeVisible (m_output = new ToggleButton ("output")); m_output->setButtonText ("Output"); m_output->addListener (this); m_output->setRadioGroupId(1234); addAndMakeVisible (m_reset = new TextButton ("reset")); m_reset->setButtonText ("Reset"); m_reset->addListener (this); addAndMakeVisible (m_speaker_label = new Label ("wdmChannelsLabel", "WDM Channels")); m_speaker_label->setFont (Font (15.0000f, Font::plain)); m_speaker_label->setJustificationType (Justification::centredBottom); m_speaker_label->setEditable (false, false, false); addAndMakeVisible (m_speaker_table = new SpeakerListComponent (*this, m_wdm_names, m_in_ch_names, m_out_ch_names, m_in_map_names, m_out_map_names, false)); m_speaker_table->setOutlineThickness(1); addAndMakeVisible (m_wdm_ch_label = new Label ("wdmChLabel", "Mapped WDM Channels")); m_wdm_ch_label->setFont (Font (15.0000f, Font::plain)); m_wdm_ch_label->setJustificationType (Justification::topLeft); m_wdm_ch_label->setEditable (false, false, false); addAndMakeVisible (m_dev_ch_label = new Label ("devChLabel", "Device Channels")); m_dev_ch_label->setFont (Font (15.0000f, Font::plain)); m_dev_ch_label->setJustificationType (Justification::topLeft); m_dev_ch_label->setEditable (false, false, false); addAndMakeVisible (m_instr_label = new Label ("instLabel", "Drag WDM channels \nto Device channels to map them.\n\nDrag maps out of the \nDevice channels list\nto unmap them.")); m_instr_label->setFont (Font (15.0000f, Font::plain)); m_instr_label->setJustificationType (Justification::centred); m_instr_label->setEditable (false, false, false); addAndMakeVisible (m_device_channels = new ChannelListComponent (*this, m_wdm_names, m_in_ch_names, m_out_ch_names, m_in_map_names, m_out_map_names)); m_device_channels->setOutlineThickness(1); if (m_out) m_input->setToggleState(true, true); else m_output->setToggleState(true, true); lookAndFeelChanged(); }
//============================================================================== Content::Content () : Component ("Content") { addAndMakeVisible (GroupServer = new GroupComponent ("GroupServer", "Server")); addAndMakeVisible (GroupSettings = new GroupComponent ("GroupSettings", "Settings")); addAndMakeVisible (InputDevices = new ComboBox ("InputDevices")); InputDevices->setEditableText (false); InputDevices->setJustificationType (Justification::centredLeft); InputDevices->setTextWhenNothingSelected ("(no server)"); InputDevices->setTextWhenNoChoicesAvailable ("(no server)"); InputDevices->addListener (this); addAndMakeVisible (LabelInputDevice = new Label ("LabelInputDevice", "Input Device:")); LabelInputDevice->setFont (Font (15.00f, Font::plain)); LabelInputDevice->setJustificationType (Justification::centredRight); LabelInputDevice->setEditable (false, false, false); LabelInputDevice->setColour (TextEditor::textColourId, Colours::black); LabelInputDevice->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (OutputDevices = new ComboBox ("OutputDevices")); OutputDevices->setEditableText (false); OutputDevices->setJustificationType (Justification::centredLeft); OutputDevices->setTextWhenNothingSelected ("(no server)"); OutputDevices->setTextWhenNoChoicesAvailable ("(no server)"); OutputDevices->addListener (this); addAndMakeVisible (LabelOutputDevice = new Label ("LabelOutputDevice", "Output Device:")); LabelOutputDevice->setFont (Font (15.00f, Font::plain)); LabelOutputDevice->setJustificationType (Justification::centredRight); LabelOutputDevice->setEditable (false, false, false); LabelOutputDevice->setColour (TextEditor::textColourId, Colours::black); LabelOutputDevice->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (SampleRate = new ComboBox ("SampleRate")); SampleRate->setEditableText (false); SampleRate->setJustificationType (Justification::centredLeft); SampleRate->setTextWhenNothingSelected ("(no server)"); SampleRate->setTextWhenNoChoicesAvailable ("(no choices)"); SampleRate->addItem ("44100", 1); SampleRate->addItem ("48000", 2); SampleRate->addItem ("88200", 3); SampleRate->addItem ("96000", 4); SampleRate->addListener (this); addAndMakeVisible (LabelSampleRate = new Label ("LabelSampleRate", "Sample Rate:")); LabelSampleRate->setFont (Font (15.00f, Font::plain)); LabelSampleRate->setJustificationType (Justification::centredRight); LabelSampleRate->setEditable (false, false, false); LabelSampleRate->setColour (TextEditor::textColourId, Colours::black); LabelSampleRate->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (LabelServerAddress = new Label ("LabelServerAddress", "Server Address:")); LabelServerAddress->setFont (Font (15.00f, Font::plain)); LabelServerAddress->setJustificationType (Justification::centredRight); LabelServerAddress->setEditable (false, false, false); LabelServerAddress->setColour (TextEditor::textColourId, Colours::black); LabelServerAddress->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (Server = new ComboBox ("Server")); Server->setEditableText (true); Server->setJustificationType (Justification::centredLeft); Server->setTextWhenNothingSelected (String::empty); Server->setTextWhenNoChoicesAvailable ("(no choices)"); Server->addItem ("127.0.0.1", 1); Server->addListener (this); addAndMakeVisible (LabelInput = new Label ("LabelInput", "I N P U T S")); LabelInput->setFont (Font (15.00f, Font::plain)); LabelInput->setJustificationType (Justification::centredLeft); LabelInput->setEditable (false, false, false); LabelInput->setColour (TextEditor::textColourId, Colours::black); LabelInput->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (LabelInput2 = new Label ("LabelInput", "O\nU\nT\nP\nU\nT\nS")); LabelInput2->setFont (Font (15.00f, Font::plain)); LabelInput2->setJustificationType (Justification::centredTop); LabelInput2->setEditable (false, false, false); LabelInput2->setColour (TextEditor::textColourId, Colours::black); LabelInput2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (textButton = new TextButton ("new button")); textButton->setButtonText ("Resync"); textButton->addListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0xffff8a8a)); textButton->setColour (TextButton::buttonOnColourId, Colour (0xffff7373)); //[UserPreSize] addAndMakeVisible (matrixView = new MatrixView()); matrixView->setName ("MatrixView"); matrixView->setBounds (368, 32, 224, 152); //[/UserPreSize] setSize (450, 250); //[Constructor] You can add your own custom stuff here.. //[/Constructor] }
//============================================================================== AudioDemoPlaybackPage::AudioDemoPlaybackPage (AudioDeviceManager& deviceManager_) : deviceManager (deviceManager_), thread ("audio file preview"), directoryList (0, thread), zoomLabel (0), thumbnail (0), startStopButton (0), fileTreeComp (0), explanation (0), zoomSlider (0) { addAndMakeVisible (zoomLabel = new Label (String::empty, T("zoom:"))); zoomLabel->setFont (Font (15.0000f, Font::plain)); zoomLabel->setJustificationType (Justification::centredRight); zoomLabel->setEditable (false, false, false); zoomLabel->setColour (TextEditor::textColourId, Colours::black); zoomLabel->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (thumbnail = new DemoThumbnailComp()); addAndMakeVisible (startStopButton = new TextButton (String::empty)); startStopButton->setButtonText (T("Play/Stop")); startStopButton->addButtonListener (this); startStopButton->setColour (TextButton::buttonColourId, Colour (0xff79ed7f)); addAndMakeVisible (fileTreeComp = new FileTreeComponent (directoryList)); addAndMakeVisible (explanation = new Label (String::empty, T("Select an audio file in the treeview above, and this page will display its waveform, and let you play it.."))); explanation->setFont (Font (14.0000f, Font::plain)); explanation->setJustificationType (Justification::bottomRight); explanation->setEditable (false, false, false); explanation->setColour (TextEditor::textColourId, Colours::black); explanation->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (zoomSlider = new Slider (String::empty)); zoomSlider->setRange (0, 1, 0); zoomSlider->setSliderStyle (Slider::LinearHorizontal); zoomSlider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20); zoomSlider->addListener (this); zoomSlider->setSkewFactor (2); //[UserPreSize] //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true); thread.startThread (3); fileTreeComp->setColour (FileTreeComponent::backgroundColourId, Colours::white); fileTreeComp->addListener (this); deviceManager.addAudioCallback (&audioSourcePlayer); audioSourcePlayer.setSource (&transportSource); currentAudioFileSource = 0; //[/Constructor] }
void StackComponent::handleContentComponentAdded (Component* newContent, int index, bool animate) { addAndMakeVisible (newContent); refreshLayout (); }
//============================================================================== PanelEngine::PanelEngine () { addAndMakeVisible (operatorGroup = new GroupComponent ("operator group", TRANS("Operators"))); operatorGroup->setTextLabelPosition (Justification::centredLeft); operatorGroup->setColour (GroupComponent::outlineColourId, Colour (0x60808080)); operatorGroup->setColour (GroupComponent::textColourId, Colour (0xff4f4f4f)); addAndMakeVisible (mixerGroup = new GroupComponent ("mixer group", TRANS("Mixer"))); mixerGroup->setTextLabelPosition (Justification::centredLeft); mixerGroup->setColour (GroupComponent::outlineColourId, Colour (0x60808080)); mixerGroup->setColour (GroupComponent::textColourId, Colour (0xff4f4f4f)); addAndMakeVisible (imGroup = new GroupComponent ("IM group", TRANS("Modulation indexes"))); imGroup->setTextLabelPosition (Justification::centredLeft); imGroup->setColour (GroupComponent::outlineColourId, Colour (0x60808080)); imGroup->setColour (GroupComponent::textColourId, Colour (0xff4f4f4f)); //[UserPreSize] for (int k=0; k<NUMBER_OF_MIX; k++) { addAndMakeVisible(volumeKnob[k] = new SliderPfm2("Volume " + String(k+1))); volumeKnob[k]->setRange (0, 1, .01f); volumeKnob[k]->setSliderStyle (Slider::RotaryVerticalDrag); volumeKnob[k]->setTextBoxStyle (Slider::NoTextBox, false, 20, 20); volumeKnob[k]->setDoubleClickReturnValue(true, 1.0f); volumeKnob[k]->setValue(1.0f, dontSendNotification); volumeKnob[k]->addListener (this); addAndMakeVisible(panKnob[k] = new SliderPfm2("Pan " + String(k+1))); panKnob[k]->setRange (-1, 1, .01f); panKnob[k]->setSliderStyle (Slider::LinearHorizontal); panKnob[k]->setTextBoxStyle (Slider::NoTextBox, false, 40, 20); panKnob[k]->setColour(Slider::thumbColourId, Colours::blue); panKnob[k]->setDoubleClickReturnValue(true, 0.0f); panKnob[k]->addListener (this); addAndMakeVisible(mixLabel[k] = new Label(String("mix label ")+ String(k+1), String("Mix ")+ String(k+1))); } for (int k=0; k<NUMBER_OF_IM; k++) { addAndMakeVisible(IMNumber[k] = new Label("IM Label" + String(k+1), String("IM") + String(k+1))); addAndMakeVisible(IMKnob[k] = new SliderPfm2("IM " + String(k+1))); IMKnob[k]->setRange (0, 16, .01f); IMKnob[k]->setSliderStyle (Slider::RotaryVerticalDrag); IMKnob[k]->setTextBoxStyle (Slider::TextBoxLeft, false, 30, 16); IMKnob[k]->setDoubleClickReturnValue(true, 1.0f); IMKnob[k]->setValue(1.0f, dontSendNotification); IMKnob[k]->addListener (this); addAndMakeVisible(IMVelocityKnob[k] = new SliderPfm2("IM Velocity " + String(k+1))); IMVelocityKnob[k]->setRange (0, 16, .01f); IMVelocityKnob[k]->setSliderStyle (Slider::RotaryVerticalDrag); IMVelocityKnob[k]->setTextBoxStyle (Slider::TextBoxLeft, false, 30, 16); IMVelocityKnob[k]->setDoubleClickReturnValue(true, 0.0f); IMVelocityKnob[k]->setValue(0.0f, dontSendNotification); IMVelocityKnob[k]->addListener (this); } addAndMakeVisible(IMLabel = new Label("IM Label", "Main")); IMLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(IMVelocityLabel = new Label("IM Velocity Label", "Velocity")); IMVelocityLabel->setJustificationType(Justification::centredTop); for (int k=0; k<NUMBER_OF_OPERATORS; k++) { enveloppe[k] = new Enveloppe (); enveloppe[k]->setName ("Op"+String(k+1)+" Env"); enveloppeButton[k] = new TextButton ("enveloppe button"); enveloppeButton[k]->setButtonText ("Op" + String(k+1)); enveloppeButton[k]->setColour (TextButton::buttonColourId, Colour (0xffa4c9e9)); enveloppeButton[k]->setColour (TextButton::buttonOnColourId, Colours::aliceblue); enveloppeButton[k]->setClickingTogglesState(true); enveloppeButton[k]->setRadioGroupId(4242); enveloppeButton[k]->setConnectedEdges((k!=0 ? Button::ConnectedOnLeft : 0) | (k!= NUMBER_OF_OPERATORS-1 ? Button::ConnectedOnRight : 0 )); enveloppeButton[k]->addListener (this); addAndMakeVisible(enveloppeButton[k]); opShape[k] = new ComboBox("Op"+String(k+1)+" Shape"); opShape[k]->setJustificationType (Justification::centred); opShape[k]->setColour (ComboBox::buttonColourId, Colours::blue); opShape[k]->addItem("Sin", 1); opShape[k]->addItem("Saw", 2); opShape[k]->addItem("Square", 3); opShape[k]->addItem("Sin^2", 4); opShape[k]->addItem("SinZero", 5); opShape[k]->addItem("SinPos", 6); opShape[k]->addItem("Noise", 7); opShape[k]->addItem("Off", 8); opShape[k]->setSelectedId(1); opShape[k]->setEditableText (false); opShape[k]->addListener (this); opFrequencyType[k] = new ComboBox("Op"+ String(k+1) + " Freq Type"); opFrequencyType[k]->setEditableText (false); opFrequencyType[k]->setJustificationType (Justification::centred); opFrequencyType[k]->setColour (ComboBox::buttonColourId, Colours::blue); opFrequencyType[k]->addItem("Keyboard", 1); opFrequencyType[k]->addItem("Fixed", 2); opFrequencyType[k]->setSelectedId(1); opFrequencyType[k]->addListener (this); opFrequency[k] = new SliderPfm2Always2Decimals("Op" + String(k+1) + " Frequency"); opFrequency[k]->setRange (0, 16, 1.0f / 12.0f); opFrequency[k]->setSliderStyle (Slider::RotaryVerticalDrag); opFrequency[k]->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 16); opFrequency[k]->setDoubleClickReturnValue(true, 1.0f); opFrequency[k]->addListener (this); opFrequencyFineTune[k] = new SliderPfm2("Op"+ String(k+1)+ " Fine Tune"); opFrequencyFineTune[k]->setRange (-1.0f, 1.0f, .01f); opFrequencyFineTune[k]->setSliderStyle (Slider::RotaryVerticalDrag); opFrequencyFineTune[k]->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 16); opFrequencyFineTune[k]->setDoubleClickReturnValue(true, 0.0f); opFrequencyFineTune[k]->addListener (this); if (k == 0) { addAndMakeVisible(enveloppe[k]); addAndMakeVisible(opShape[k]); addAndMakeVisible(opFrequencyType[k]); addAndMakeVisible(opFrequency[k]); addAndMakeVisible(opFrequencyFineTune[k]); } else { addChildComponent(enveloppe[k]); addChildComponent(opShape[k]); addChildComponent(opFrequencyType[k]); addChildComponent(opFrequency[k]); addChildComponent(opFrequencyFineTune[k]); } } enveloppeButton[0]->setToggleState(true, sendNotification); addAndMakeVisible(opShapeLabel = new Label("op shapelabel", "Shape")); opShapeLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(opFrequencyTypeLabel = new Label("op frequency type", "Follows")); opFrequencyTypeLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(opFrequencyLabel = new Label("op frequency label", "Frequency")); opFrequencyLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(opFrequencyFineTuneLabel = new Label("op frequency FT label", "Fine Tune")); opFrequencyFineTuneLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(algoChooser = new SliderPfm2("Algo")); algoChooser->setRange (1, NUMBER_OF_ALGO, 1); algoChooser->setTextBoxIsEditable(true); algoChooser->setSliderStyle (Slider::IncDecButtons); algoChooser->setTextBoxStyle (Slider::TextBoxAbove, false, 30, 16); algoChooser->setDoubleClickReturnValue(true, 1.0f); algoChooser->addListener (this); for (int a=0; a<NUMBER_OF_ALGO; a++) { algoImages[a] = ImageFileFormat::loadFrom(algo4_pngs[a], algo4_png_sizes[a]); } addAndMakeVisible(algoDrawableImage = new DrawableImage()); algoDrawableImage->setImage(algoImages[0]); addAndMakeVisible(algoChooserLabel = new Label("algo label", "Algo")); algoChooserLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(velocityLabel = new Label("velocity label", "Velocity")); velocityLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(velocity = new SliderPfm2("Velocity")); velocity->setRange (0, 16, 1); velocity->setSliderStyle (Slider::RotaryVerticalDrag); velocity->setTextBoxStyle (Slider::TextBoxAbove, false, 30, 16); velocity->setDoubleClickReturnValue(true, 1.0f); velocity->addListener (this); addAndMakeVisible(velocityLabel = new Label("velocity label", "Velocity")); velocityLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(velocity = new SliderPfm2("Velocity")); velocity->setRange (0, 16, 1); velocity->setValue(12, dontSendNotification); velocity->setSliderStyle (Slider::RotaryVerticalDrag); velocity->setTextBoxStyle (Slider::TextBoxAbove, false, 30, 16); velocity->setDoubleClickReturnValue(true, 1.0f); velocity->addListener (this); addAndMakeVisible(voicesLabel = new Label("voices label", "Voices")); voicesLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(voices = new SliderPfm2("Voices")); voices->setRange (0, 8, 1); voices->setSliderStyle (Slider::RotaryVerticalDrag); voices->setTextBoxStyle (Slider::TextBoxAbove, false, 30, 16); voices->setDoubleClickReturnValue(true, 3.0f); voices->addListener (this); addAndMakeVisible(glideLabel = new Label("glide label", "Glide")); glideLabel->setJustificationType(Justification::centredTop); addAndMakeVisible(glide = new SliderPfm2("Glide")); glide->setRange (0, 10, 1); glide->setSliderStyle (Slider::RotaryVerticalDrag); glide->setTextBoxStyle (Slider::TextBoxAbove, false, 30, 16); glide->setDoubleClickReturnValue(true, 3.0f); glide->addListener (this); // addAndMakeVisible (comboBox); // comboBox.setBounds (10, 85, 200, 24); // comboBox.setEditableText (true); // comboBox.setJustificationType (Justification::centred); // // for (int i = 1; i < 100; ++i) // comboBox.addItem ("combo box item " + String (i), i); // } // comboBox.setSelectedId (1); //[/UserPreSize] setSize (900, 700); //[Constructor] You can add your own custom stuff here.. eventsToAdd = nullptr; voices->setValue(4.0f, sendNotification); sliderValueChanged(voices); sliderValueChanged(algoChooser); initialized = false; //[/Constructor] }
//============================================================================== //transport controls //============================================================================== TransportComponent::TransportComponent(SidebarPanel &ownerPanel, String name): owner(ownerPanel), PropertyComponent(name, 70), lookAndFeel(), playButton("playButton", DrawableButton::ImageOnButtonBackground), stopButton("stopButton", DrawableButton::ImageOnButtonBackground), bpmSlider("bpmSlider"), timeLabel("TimeLabel"), beatsLabel("beatsLabel"), timingInfoBox(), standardLookAndFeel(new LookAndFeel_V2()) { bpmSlider.setSliderStyle(Slider::SliderStyle::LinearBarVertical); bpmSlider.setRange(1, 500, 1); bpmSlider.setValue(60, dontSendNotification); bpmSlider.addListener(this); bpmSlider.setVelocityBasedMode(true); bpmSlider.setColour(Slider::ColourIds::thumbColourId, Colours::black); bpmSlider.setColour(Slider::ColourIds::textBoxTextColourId, Colours::white); bpmSlider.setColour(Slider::ColourIds::textBoxBackgroundColourId, Colours::black); timeSigNum.setSliderStyle(Slider::SliderStyle::LinearBarVertical); timeSigNum.setRange(1, 24, 1); timeSigNum.setValue(4, dontSendNotification); timeSigNum.addListener(this); timeSigNum.setColour(Slider::ColourIds::thumbColourId, Colours::black); timeSigNum.setColour(Slider::ColourIds::textBoxTextColourId, Colours::white); timeSigNum.setColour(Slider::ColourIds::textBoxBackgroundColourId, Colours::black); timeSigDen.setSliderStyle(Slider::SliderStyle::LinearBarVertical); timeSigDen.setRange(1, 24, 1); timeSigDen.setValue(4, dontSendNotification); timeSigDen.addListener(this); timeSigDen.setColour(Slider::ColourIds::thumbColourId, Colours::black); timeSigDen.setColour(Slider::ColourIds::textBoxTextColourId, Colours::white); timeSigDen.setColour(Slider::ColourIds::textBoxBackgroundColourId, Colours::black); bpmSlider.setVelocityModeParameters(0.9); bpmSlider.setTextValueSuffix(" BPM"); timeLabel.setJustificationType(Justification::left); timeLabel.setFont(Font(24, 1)); timeLabel.setLookAndFeel(standardLookAndFeel); timeLabel.setColour(Label::backgroundColourId, Colours::black); timeLabel.setColour(Label::textColourId, Colours::cornflowerblue); timeLabel.setText("00 : 00 : 00", dontSendNotification); beatsLabel.setJustificationType(Justification::right); beatsLabel.setFont(Font(18, 1)); beatsLabel.setLookAndFeel(standardLookAndFeel); beatsLabel.setColour(Label::backgroundColourId, Colours::black); beatsLabel.setColour(Label::textColourId, Colours::cornflowerblue); beatsLabel.setText("Beat 1", dontSendNotification); playButton.setLookAndFeel(&lookAndFeel); playButton.setColour(TextButton::buttonColourId, Colours::green.darker(.8f)); playButton.setColour(TextButton::buttonOnColourId, Colours::yellow); playButton.setClickingTogglesState(true); stopButton.setLookAndFeel(&lookAndFeel); stopButton.setColour(TextButton::buttonColourId, Colours::green.darker(.8f)); playButton.setImages(cUtils::createPlayButtonPath(30, Colours::white), cUtils::createPlayButtonPath(30, Colours::white), cUtils::createPauseButtonPath(30), cUtils::createPauseButtonPath(30), cUtils::createPauseButtonPath(30)); stopButton.setImages(cUtils::createStopButtonPath(30, Colours::white)); addAndMakeVisible (timingInfoBox); addAndMakeVisible (playButton); addAndMakeVisible (stopButton); addAndMakeVisible (bpmSlider); addAndMakeVisible (bpmLabel); addAndMakeVisible (timeLabel); addAndMakeVisible (beatsLabel); // addAndMakeVisible (timeSigNum); // addAndMakeVisible (timeSigDen); playButton.addListener (this); stopButton.addListener (this); }
ToolBarControls::ToolBarControls() { addAndMakeVisible (audioStreamToggleButton = new ImageButton ("playButton")); audioStreamToggleButton->setClickingTogglesState(true); audioStreamToggleButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::Play128_png, BinaryData::Play128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), ImageCache::getFromMemory (BinaryData::Stop128_png, BinaryData::Stop128_pngSize), 1.0f, Colour (0x00000000)); addAndMakeVisible (recordToggleButton = new ImageButton ("recordButton")); recordToggleButton->setClickingTogglesState(true); recordToggleButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::RecordOff128_png, BinaryData::RecordOff128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), ImageCache::getFromMemory (BinaryData::RecordOn128_png, BinaryData::RecordOn128_pngSize), 1.0f, Colour (0x00000000)); addAndMakeVisible (saveTrainingButton = new ImageButton ("saveTrainingButton")); saveTrainingButton->setClickingTogglesState(false); saveTrainingButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::Save128_png, BinaryData::Save128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); addAndMakeVisible (loadTrainingButton = new ImageButton ("loadTrainingButton")); loadTrainingButton->setClickingTogglesState(false); loadTrainingButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::Load128_png, BinaryData::Load128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); addAndMakeVisible (addClassButton = new ImageButton ("addClassButton")); addClassButton->setClickingTogglesState(false); addClassButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::AddClass128_png, BinaryData::AddClass128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); addAndMakeVisible (deleteClassButton = new ImageButton ("deleteClassButton")); deleteClassButton->setClickingTogglesState(false); deleteClassButton->setTriggeredOnMouseDown(true); deleteClassButton->setImages (false, true, true, ImageCache::getFromMemory (BinaryData::DeleteClass128_png, BinaryData::DeleteClass128_pngSize), 1.0f, Colour (0x00000000), Image::null, 0.7f, Colour (0x00000000), Image::null, 1.0f, Colour (0x77000000)); //--- Labels ---// addAndMakeVisible (trainClassLabel = new Label ("trainClassLabel", TRANS("Train"))); trainClassLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); trainClassLabel->setJustificationType (Justification::centred); trainClassLabel->setEditable (false, false, false); trainClassLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); trainClassLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); trainClassLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); trainClassLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (playLabel = new Label ("playLabel", TRANS("Play"))); playLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); playLabel->setJustificationType (Justification::centred); playLabel->setEditable (false, false, false); playLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); playLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); playLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); playLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (addClassLabel = new Label ("addClassLabel", TRANS("Add Class"))); addClassLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); addClassLabel->setJustificationType (Justification::centred); addClassLabel->setEditable (false, false, false); addClassLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); addClassLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); addClassLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addClassLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (deleteClassLabel = new Label ("deleteClassLabel", TRANS("Delete Class"))); deleteClassLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); deleteClassLabel->setJustificationType (Justification::centred); deleteClassLabel->setEditable (false, false, false); deleteClassLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); deleteClassLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); deleteClassLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); deleteClassLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (saveTrainingLabel = new Label ("saveTrainingLabel", TRANS("Save"))); saveTrainingLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); saveTrainingLabel->setJustificationType (Justification::centred); saveTrainingLabel->setEditable (false, false, false); saveTrainingLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); saveTrainingLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); saveTrainingLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); saveTrainingLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); addAndMakeVisible (loadTrainingLabel = new Label ("loadTrainingLabel", TRANS("Load"))); loadTrainingLabel->setFont (Font ("Myriad Pro", 11.90f, Font::plain)); loadTrainingLabel->setJustificationType (Justification::centred); loadTrainingLabel->setEditable (false, false, false); loadTrainingLabel->setColour (Label::textColourId, Colour (0xFF5C6266)); loadTrainingLabel->setColour (TextEditor::textColourId, Colour (0xFF3D4248)); loadTrainingLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); loadTrainingLabel->setColour (TextEditor::highlightColourId, Colour (0x00000000)); // setSize (getParentWidth(), getParentHeight()); }
//============================================================================== CombSplit::CombSplit () : Component (L"CombSplit"), groupComponent (0), textButton (0), label (0), block_sizeslider (0), number_of_filesslider (0), label2 (0), resetbutton (0), textButton2 (0) { addAndMakeVisible (groupComponent = new GroupComponent (L"new group", L"Comb Split")); groupComponent->setTextLabelPosition (Justification::centredLeft); groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xb0000000)); addAndMakeVisible (textButton = new TextButton (L"new button")); textButton->setButtonText (L"Do it!"); textButton->addListener (this); textButton->setColour (TextButton::buttonColourId, Colour (0x2ebbbbff)); addAndMakeVisible (label = new Label (L"new label", L"Block size (# of bins)")); label->setFont (Font (15.0000f, Font::plain)); label->setJustificationType (Justification::centredLeft); label->setEditable (false, false, false); label->setColour (Label::backgroundColourId, Colour (0x0)); label->setColour (Label::textColourId, Colours::black); label->setColour (Label::outlineColourId, Colour (0x0)); label->setColour (TextEditor::textColourId, Colours::black); label->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (block_sizeslider = new Slider (L"new slider")); block_sizeslider->setRange (0, 99, 1); block_sizeslider->setSliderStyle (Slider::LinearHorizontal); block_sizeslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); block_sizeslider->setColour (Slider::thumbColourId, Colour (0x79ffffff)); block_sizeslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); block_sizeslider->addListener (this); addAndMakeVisible (number_of_filesslider = new Slider (L"new slider")); number_of_filesslider->setRange (1, 10, 1); number_of_filesslider->setSliderStyle (Slider::LinearHorizontal); number_of_filesslider->setTextBoxStyle (Slider::TextBoxLeft, false, 80, 20); number_of_filesslider->setColour (Slider::thumbColourId, Colour (0x6effffff)); number_of_filesslider->setColour (Slider::textBoxBackgroundColourId, Colour (0xffffff)); number_of_filesslider->addListener (this); addAndMakeVisible (label2 = new Label (L"new label", L"Number of files")); label2->setFont (Font (15.0000f, Font::plain)); label2->setJustificationType (Justification::centredLeft); label2->setEditable (false, false, false); label2->setColour (Label::backgroundColourId, Colour (0x0)); label2->setColour (Label::textColourId, Colours::black); label2->setColour (Label::outlineColourId, Colour (0x0)); label2->setColour (TextEditor::textColourId, Colours::black); label2->setColour (TextEditor::backgroundColourId, Colour (0x0)); addAndMakeVisible (resetbutton = new TextButton (L"resetbutton")); resetbutton->setButtonText (L"reset"); resetbutton->addListener (this); resetbutton->setColour (TextButton::buttonColourId, Colour (0x35bbbbff)); addAndMakeVisible (textButton2 = new TextButton (L"new button")); textButton2->setButtonText (L"Redo it!"); textButton2->addListener (this); textButton2->setColour (TextButton::buttonColourId, Colour (0x40bbbbff)); //[UserPreSize] //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. buttonClicked(resetbutton); #undef Slider //[/Constructor] }