void Mixer::addChannels(Channels* channels , Identifier channels_id) { // add channels group to the mixer addChildAndSetID(channels , String(channels_id)) ; channels->toFront(true) ; // update mixer layout resized() ; }
WizardComp() : projectName ("Project name"), nameLabel (String::empty, "Project Name:"), typeLabel (String::empty, "Project Type:"), fileBrowser (FileBrowserComponent::saveMode | FileBrowserComponent::canSelectDirectories, getLastWizardFolder(), nullptr, nullptr), fileOutline (String::empty, "Project Folder:"), createButton ("Create..."), cancelButton ("Cancel") { setOpaque (true); setSize (600, 500); addChildAndSetID (&projectName, "projectName"); projectName.setText ("NewProject"); projectName.setBounds ("100, 14, parent.width / 2 - 10, top + 22"); nameLabel.attachToComponent (&projectName, true); projectName.addListener (this); addChildAndSetID (&projectType, "projectType"); projectType.addItemList (getWizards(), 1); projectType.setSelectedId (1, true); projectType.setBounds ("100, projectName.bottom + 4, projectName.right, top + 22"); typeLabel.attachToComponent (&projectType, true); projectType.addListener (this); addChildAndSetID (&fileOutline, "fileOutline"); fileOutline.setColour (GroupComponent::outlineColourId, Colours::black.withAlpha (0.2f)); fileOutline.setTextLabelPosition (Justification::centred); fileOutline.setBounds ("10, projectType.bottom + 20, projectType.right, parent.height - 10"); addChildAndSetID (&fileBrowser, "fileBrowser"); fileBrowser.setBounds ("fileOutline.left + 10, fileOutline.top + 20, fileOutline.right - 10, fileOutline.bottom - 12"); fileBrowser.setFilenameBoxLabel ("Folder:"); addChildAndSetID (&createButton, "createButton"); createButton.setBounds ("right - 140, bottom - 24, parent.width - 10, parent.height - 10"); createButton.addListener (this); addChildAndSetID (&cancelButton, "cancelButton"); cancelButton.addShortcut (KeyPress (KeyPress::escapeKey)); cancelButton.setBounds ("right - 140, createButton.top, createButton.left - 10, createButton.bottom"); cancelButton.addListener (this); updateCustomItems(); updateCreateButton(); }
bool Channels::addChannel(ValueTree channel_store) { DEBUG_TRACE_ADD_CHANNEL_GUI_FAIL // ensure GUI for this channel does not already exist Identifier channel_id = channel_store.getType() ; if (!channel_store.isValid() || getChannel(channel_id)) return false ; // hide stereo slave channels if (int(channel_store[CONFIG::STEREO_ID]) == CONFIG::STEREO_R) return false ; // create channel GUI Channel* channel = newChannel(channel_store) ; addChildAndSetID(channel , String(channel_id)) ; channel->toFront(false) ; // resize and shift channel slices resized() ; DEBUG_TRACE_ADD_CHANNEL_GUI return true ; }