void AudioFaderBox::slotChannelStateChanged() { if (m_isStereo) { setAudioChannels(1); emit audioChannelsChanged(1); } else { setAudioChannels(2); emit audioChannelsChanged(2); } }
void AudioFaderBox::slotSetInstrument(Studio *studio, Instrument *instrument) { if (m_audioInput) m_audioInput->slotSetInstrument(studio, instrument); if (m_audioOutput) m_audioOutput->slotSetInstrument(studio, instrument); if (instrument) setAudioChannels(instrument->getAudioChannels()); if (instrument) { RG_DEBUG << "AudioFaderBox::slotSetInstrument(" << instrument->getId() << ")" << endl; setIsSynth(instrument->getType() == Instrument::SoftSynth); if (instrument->getType() == Instrument::SoftSynth) { bool gui = false; RG_DEBUG << "AudioFaderBox::slotSetInstrument(" << instrument->getId() << "): is soft synth" << endl; gui = RosegardenMainWindow::self()->getPluginGUIManager()->hasGUI (instrument->getId(), Instrument::SYNTH_PLUGIN_POSITION); RG_DEBUG << "AudioFaderBox::slotSetInstrument(" << instrument->getId() << "): has gui = " << gui << endl; m_synthGUIButton->setEnabled(gui); } } }
//============================================================================== MainContentComponent() { setSize (800, 600); // specify the number of input and output channels that we want to open setAudioChannels (2, 2); }
MainContentComponent::MainContentComponent() { panSlider.setRange(0.0, 1.0); panSlider.setTextBoxStyle(Slider::TextBoxRight, false, 100, 20); panLabel.setText("Pan", dontSendNotification); addAndMakeVisible(panSlider); addAndMakeVisible(panLabel); setSize (800, 100); setAudioChannels (0, 2); // specify the number of input and output channels that we want to open }
void PrefGeneral::setData(Preferences * pref) { setMplayerPath( pref->mplayer_bin ); setScreenshotDir( pref->screenshot_directory ); QString vo = pref->vo; if (vo.isEmpty()) { #ifdef Q_OS_WIN vo = "directx,"; #else vo = "xv,"; #endif } setVO( vo ); QString ao = pref->ao; #ifndef Q_OS_WIN if (ao.isEmpty()) ao = "alsa,"; #endif setAO( ao ); setRememberSettings( !pref->dont_remember_media_settings ); setRememberTimePos( !pref->dont_remember_time_pos ); setFileSettingsMethod( pref->file_settings_method ); setAudioLang( pref->audio_lang ); setSubtitleLang( pref->subtitle_lang ); setAudioTrack( pref->initial_audio_track ); setSubtitleTrack( pref->initial_subtitle_track ); setCloseOnFinish( pref->close_on_finish ); setPauseWhenHidden( pref->pause_when_hidden ); setEq2( pref->use_soft_video_eq ); setUseAudioEqualizer( pref->use_audio_equalizer ); setSoftVol( pref->use_soft_vol ); setAc3DTSPassthrough( pref->use_hwac3 ); setInitialVolNorm( pref->initial_volnorm ); setAmplification( pref->softvol_max ); setInitialPostprocessing( pref->initial_postprocessing ); setInitialDeinterlace( pref->initial_deinterlace ); setInitialZoom( pref->initial_panscan_factor ); setDirectRendering( pref->use_direct_rendering ); setDoubleBuffer( pref->use_double_buffer ); setUseSlices( pref->use_slices ); setStartInFullscreen( pref->start_in_fullscreen ); setDisableScreensaver( pref->disable_screensaver ); setBlackbordersOnFullscreen( pref->add_blackborders_on_fullscreen ); setAutoq( pref->autoq ); setInitialVolume( pref->initial_volume ); setDontChangeVolume( pref->dont_change_volume ); setUseVolume( pref->use_volume_option ); setAudioChannels( pref->initial_audio_channels ); setScaleTempoFilter( pref->use_scaletempo ); }
//============================================================================== MainContentComponent() : phase (0.0f), phaseDelta (0.0f), frequency (5000.0f), amplitude (0.2f), sampleRate (0.0), expectedSamplesPerBlock (0) { setSize (800, 600); // Specify the number of input and output channels that we want to open. setAudioChannels (0, 2); }
HelmStandaloneEditor::HelmStandaloneEditor() { setSynth(&synth_); setGuiState(&gui_state_); keyboard_state_ = new MidiKeyboardState(); midi_manager_ = new MidiManager(&synth_, keyboard_state_, &gui_state_, &critical_section_, this); computer_keyboard_ = new HelmComputerKeyboard(&synth_, keyboard_state_, &critical_section_); output_memory_ = new mopo::Memory(MAX_OUTPUT_MEMORY); memory_offset_ = 0; Startup::doStartupChecks(midi_manager_, computer_keyboard_); setAudioChannels(0, mopo::NUM_CHANNELS); AudioDeviceManager::AudioDeviceSetup setup; deviceManager.getAudioDeviceSetup(setup); setup.sampleRate = mopo::DEFAULT_SAMPLE_RATE; deviceManager.initialise(0, mopo::NUM_CHANNELS, nullptr, true, "", &setup); if (deviceManager.getCurrentAudioDevice() == nullptr) { const OwnedArray<AudioIODeviceType>& device_types = deviceManager.getAvailableDeviceTypes(); for (AudioIODeviceType* device_type : device_types) { deviceManager.setCurrentAudioDeviceType(device_type->getTypeName(), true); if (deviceManager.getCurrentAudioDevice()) break; } } const StringArray all_midi_ins(MidiInput::getDevices()); for (int i = 0; i < all_midi_ins.size(); ++i) deviceManager.setMidiInputEnabled(all_midi_ins[i], true); deviceManager.addMidiInputCallback("", midi_manager_); setLookAndFeel(DefaultLookAndFeel::instance()); gui_ = new FullInterface(synth_.getControls(), synth_.getModulationSources(), synth_.getMonoModulations(), synth_.getPolyModulations(), keyboard_state_); gui_->setOutputMemory(output_memory_.get()); addAndMakeVisible(gui_); setSize(WIDTH, HEIGHT); grabKeyboardFocus(); setWantsKeyboardFocus(true); addKeyListener(computer_keyboard_); postMessage(new Message()); setOpaque(true); }
HelmStandaloneEditor::HelmStandaloneEditor() : SynthGuiInterface(this) { computer_keyboard_ = new HelmComputerKeyboard(&engine_, keyboard_state_); setAudioChannels(0, mopo::NUM_CHANNELS); AudioDeviceManager::AudioDeviceSetup setup; deviceManager.getAudioDeviceSetup(setup); setup.sampleRate = mopo::DEFAULT_SAMPLE_RATE; deviceManager.initialise(0, mopo::NUM_CHANNELS, nullptr, true, "", &setup); if (deviceManager.getCurrentAudioDevice() == nullptr) { const OwnedArray<AudioIODeviceType>& device_types = deviceManager.getAvailableDeviceTypes(); for (AudioIODeviceType* device_type : device_types) { deviceManager.setCurrentAudioDeviceType(device_type->getTypeName(), true); if (deviceManager.getCurrentAudioDevice()) break; } } const StringArray all_midi_ins(MidiInput::getDevices()); for (int i = 0; i < all_midi_ins.size(); ++i) deviceManager.setMidiInputEnabled(all_midi_ins[i], true); deviceManager.addMidiInputCallback("", midi_manager_); setLookAndFeel(DefaultLookAndFeel::instance()); addAndMakeVisible(gui_); gui_->setOutputMemory(getOutputMemory()); gui_->animate(LoadSave::shouldAnimateWidgets()); setSize(WIDTH, HEIGHT); setWantsKeyboardFocus(true); grabKeyboardFocus(); addKeyListener(computer_keyboard_); postMessage(new Message()); setOpaque(true); }
//============================================================================== MainContentComponent::MainContentComponent () : sampleRate(-1.0), gainParam(0.5), nfftParam(0), qParam(1.0), sParam(1.0), conv(0, 0), playheadAudioLock(), playheadState(PlayheadState::stopped), playheadAudio(0, 0), playheadAudioSamplesCompleted(0), soundIdNext(0) { //[Constructor_pre] You can add your own custom stuff here.. formatManager.registerFormat(new WavAudioFormat(), true); formatManager.registerFormat(new AiffAudioFormat(), false); formatManager.registerFormat(new OggVorbisAudioFormat(), false); //[/Constructor_pre] addAndMakeVisible (waveformGroupBox = new GroupComponent (String(), TRANS("Waveform"))); addAndMakeVisible (waveformComponent = new WaveformComponent ("No waveform to display")); addAndMakeVisible (inputGroupBox = new GroupComponent (String(), TRANS("Input"))); addAndMakeVisible (convGroupBox = new GroupComponent (String(), TRANS("Convolution"))); addAndMakeVisible (qSlider = new Slider (String())); qSlider->setRange (0, 8, 0.01); qSlider->setSliderStyle (Slider::LinearHorizontal); qSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20); qSlider->addListener (this); qSlider->setSkewFactor (0.4); addAndMakeVisible (qLabel = new Label (String(), TRANS("Mag Scale"))); qLabel->setFont (Font (15.00f, Font::plain)); qLabel->setJustificationType (Justification::centredLeft); qLabel->setEditable (false, false, false); qLabel->setColour (TextEditor::textColourId, Colours::black); qLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (convButton = new TextButton (String())); convButton->setButtonText (TRANS("Convolve")); convButton->addListener (this); addAndMakeVisible (authorLabel = new Label (String(), CharPointer_UTF8 ("\xc2\xa9 Chris Donahue 2016"))); authorLabel->setFont (Font (15.00f, Font::plain)); authorLabel->setJustificationType (Justification::centredLeft); authorLabel->setEditable (false, false, false); authorLabel->setColour (TextEditor::textColourId, Colours::black); authorLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (settingsButton = new TextButton (String())); settingsButton->setButtonText (TRANS("Audio Settings")); settingsButton->addListener (this); addAndMakeVisible (gainSlider = new Slider (String())); gainSlider->setRange (0, 1, 0.01); gainSlider->setSliderStyle (Slider::LinearHorizontal); gainSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20); gainSlider->addListener (this); addAndMakeVisible (gainLabel = new Label (String(), TRANS("Gain"))); gainLabel->setFont (Font (15.00f, Font::plain)); gainLabel->setJustificationType (Justification::centredLeft); gainLabel->setEditable (false, false, false); gainLabel->setColour (TextEditor::textColourId, Colours::black); gainLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (prBehaviorLabel = new Label (String(), TRANS("Mag/Phase Link"))); prBehaviorLabel->setFont (Font (15.00f, Font::plain)); prBehaviorLabel->setJustificationType (Justification::centredLeft); prBehaviorLabel->setEditable (false, false, false); prBehaviorLabel->setColour (TextEditor::textColourId, Colours::black); prBehaviorLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (prBehaviorComboBox = new ComboBox (String())); prBehaviorComboBox->setEditableText (false); prBehaviorComboBox->setJustificationType (Justification::centredLeft); prBehaviorComboBox->setTextWhenNothingSelected (String()); prBehaviorComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); prBehaviorComboBox->addItem (TRANS("Independent"), 1); prBehaviorComboBox->addItem (TRANS("Linked"), 2); prBehaviorComboBox->addItem (TRANS("Inverse"), 3); prBehaviorComboBox->addListener (this); addAndMakeVisible (playButton = new TextButton (String())); playButton->setButtonText (TRANS("Play")); playButton->addListener (this); addAndMakeVisible (loopButton = new TextButton (String())); loopButton->setButtonText (TRANS("Loop")); loopButton->addListener (this); addAndMakeVisible (stopButton = new TextButton (String())); stopButton->setButtonText (TRANS("Stop")); stopButton->addListener (this); addAndMakeVisible (qDefaultButton = new TextButton (String())); qDefaultButton->setButtonText (TRANS("Default")); qDefaultButton->addListener (this); addAndMakeVisible (sSlider = new Slider (String())); sSlider->setRange (0, 15, 0.01); sSlider->setSliderStyle (Slider::LinearHorizontal); sSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20); sSlider->addListener (this); addAndMakeVisible (sDefaultButton = new TextButton (String())); sDefaultButton->setButtonText (TRANS("Default")); sDefaultButton->addListener (this); addAndMakeVisible (nfftSlider = new Slider (String())); nfftSlider->setRange (0, 24, 1); nfftSlider->setSliderStyle (Slider::LinearHorizontal); nfftSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 40, 20); nfftSlider->addListener (this); addAndMakeVisible (nfftLabel = new Label (String(), TRANS("NFFT"))); nfftLabel->setFont (Font (15.00f, Font::plain)); nfftLabel->setJustificationType (Justification::centredLeft); nfftLabel->setEditable (false, false, false); nfftLabel->setColour (TextEditor::textColourId, Colours::black); nfftLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (saveButton = new TextButton (String())); saveButton->setButtonText (TRANS("Save")); saveButton->addListener (this); addAndMakeVisible (sLabel = new Label (String(), TRANS("Phase Scale"))); sLabel->setFont (Font (15.00f, Font::plain)); sLabel->setJustificationType (Justification::centredLeft); sLabel->setEditable (false, false, false); sLabel->setColour (TextEditor::textColourId, Colours::black); sLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); addAndMakeVisible (inputRemoveButton = new TextButton (String())); inputRemoveButton->setButtonText (TRANS("Remove")); inputRemoveButton->addListener (this); addAndMakeVisible (inputAddButton = new TextButton (String())); inputAddButton->setButtonText (TRANS("Add")); inputAddButton->addListener (this); addAndMakeVisible (inputFileListComponent = new InputFileTableListBox (InputFileTableListBox::PrBehavior::independent)); //[UserPreSize] inputFileListComponent->addChangeListener(this); waveformComponent->setSound(&playheadAudio); setPlayheadAudio(nullptr); //timerCallback(); inputFilesChanged(dontSendNotification); setUiFromParams(dontSendNotification); //[/UserPreSize] setSize (624, 600); //[Constructor] You can add your own custom stuff here.. setAudioChannels(0, JECT_CHANNELS_NUM); startTimerHz(JECT_FPS); //[/Constructor] }
MainContentComponent::MainContentComponent(): oscHandler(), clippingLed( *this ), audioIOComponent(), audioRecorder(), delayLine(), sourceImagesHandler(), ambi2binContainer() { // set window dimensions setSize (650, 700); // specify the required number of input and output channels setAudioChannels (2, 2); // add to change listeners oscHandler.addChangeListener(this); // add audioIOComponent as addAudioCallback for adc input deviceManager.addAudioCallback(&audioIOComponent); //========================================================================== // INIT GUI ELEMENTS // add GUI sub-components addAndMakeVisible(audioIOComponent); addAndMakeVisible(clippingLed); clippingLed.setAlwaysOnTop(true); // setup logo image logoImage = ImageCache::getFromMemory(BinaryData::evertims_logo_512_png, BinaryData::evertims_logo_512_pngSize); logoImage = logoImage.rescaled(logoImage.getWidth()/2, logoImage.getHeight()/2); // init log text box addAndMakeVisible (logTextBox); logTextBox.setMultiLine (true); logTextBox.setReturnKeyStartsNewLine (true); logTextBox.setReadOnly (true); logTextBox.setScrollbarsShown (true); logTextBox.setCaretVisible (false); logTextBox.setPopupMenuEnabled (true); logTextBox.setColour (TextEditor::textColourId, Colours::whitesmoke); logTextBox.setColour (TextEditor::backgroundColourId, Colour(PixelARGB(200,30,30,30))); logTextBox.setColour (TextEditor::outlineColourId, Colours::whitesmoke); logTextBox.setColour (TextEditor::shadowColourId, Colours::darkorange); // init text buttons buttonMap.insert({ { &saveIrButton, "Save RIRs to Desktop" }, { &saveOscButton, "Save OSC state to Desktop" }, { &clearSourceImageButton, "Clear" } }); for (auto& pair : buttonMap) { auto& obj = pair.first; const auto& param = pair.second; obj->setButtonText(param); obj->addListener (this); obj->setEnabled (true); addAndMakeVisible(obj); } saveIrButton.setColour (TextButton::buttonColourId, Colours::transparentBlack); saveOscButton.setColour (TextButton::buttonColourId, Colour(PixelARGB(160,0,0,0))); clearSourceImageButton.setColour (TextButton::buttonColourId, Colours::indianred); // init combo boxes comboBoxMap.insert({ { &numFrequencyBandsComboBox, {"3", "10"} }, { &srcDirectivityComboBox, {"omni", "directional"} }, }); for (auto& pair : comboBoxMap) { auto& obj = pair.first; const auto& param = pair.second; addAndMakeVisible(obj); obj->setEditableText(false); obj->setJustificationType(Justification::right); obj->setColour(ComboBox::backgroundColourId, Colour(PixelARGB(200,30,30,30))); obj->setColour(ComboBox::buttonColourId, Colour(PixelARGB(200,30,30,30))); obj->setColour(ComboBox::outlineColourId, Colour(PixelARGB(200,30,30,30))); obj->setColour(ComboBox::textColourId, Colours::whitesmoke); obj->setColour(ComboBox::arrowColourId, Colours::whitesmoke); obj->addListener (this); for( int i = 0; i < param.size(); i++ ){ obj->addItem(param[i], i+1); } obj->setSelectedId(1); } // init sliders sliderMap.insert({ { &gainReverbTailSlider, { 0.0, 2.0, 1.0} }, // min, max, value { &gainDirectPathSlider, { 0.0, 2.0, 1.0} }, { &gainEarlySlider, { 0.0, 2.0, 1.0} }, { &crossfadeStepSlider, { 0.001, 0.2, 0.1} } }); for (auto& pair : sliderMap) { auto& obj = pair.first; const auto& param = pair.second; addAndMakeVisible(obj); obj->setRange( param[0], param[1] ); obj->setValue( param[2] ); obj->setSliderStyle(Slider::LinearHorizontal); obj->setColour(Slider::textBoxBackgroundColourId, Colours::transparentBlack); obj->setColour(Slider::backgroundColourId, Colours::darkgrey); obj->setColour(Slider::trackColourId, Colours::lightgrey); obj->setColour(Slider::thumbColourId, Colours::white); obj->setColour(Slider::textBoxTextColourId, Colours::white); obj->setColour(Slider::textBoxOutlineColourId, Colours::transparentBlack); obj->setTextBoxStyle(Slider::TextBoxRight, true, 70, 20); obj->addListener(this); } crossfadeStepSlider.setSliderStyle(Slider::RotaryVerticalDrag); crossfadeStepSlider.setColour(Slider::rotarySliderFillColourId, Colours::white); crossfadeStepSlider.setColour(Slider::rotarySliderOutlineColourId, Colours::darkgrey); crossfadeStepSlider.setTextBoxStyle(Slider::TextBoxRight, true, 50, 20); crossfadeStepSlider.setRotaryParameters(10 / 8.f * 3.1416, 22 / 8.f * 3.1416, true); crossfadeStepSlider.setSkewFactor(0.7); // init labels labelMap.insert({ { &numFrequencyBandsLabel, "Num absorb freq bands:" }, { &srcDirectivityLabel, "Source directivity:" }, { &inputLabel, "Inputs" }, { ¶meterLabel, "Parameters" }, { &logLabel, "Logs" }, { &directPathLabel, "Direct path" }, { &earlyLabel, "Early reflections" }, { &crossfadeLabel, "Crossfade factor" }, { &clippingLedLabel, "clip" } }); for (auto& pair : labelMap) { auto& obj = pair.first; const auto& param = pair.second; addAndMakeVisible(obj); obj->setText( param, dontSendNotification ); obj->setColour(Label::textColourId, Colours::whitesmoke); } inputLabel.setColour(Label::backgroundColourId, Colour(30, 30, 30)); parameterLabel.setColour(Label::backgroundColourId, Colour(30, 30, 30)); logLabel.setColour(Label::backgroundColourId, Colour(30, 30, 30)); // init toggles toggleMap.insert({ { &reverbTailToggle, "Reverb tail" }, { &enableDirectToBinaural, "Direct to binaural" }, { &enableLog, "Enable logs" }, { &enableRecord, "Record Ambisonic to disk" } }); for (auto& pair : toggleMap) { auto& obj = pair.first; const auto& param = pair.second; addAndMakeVisible(obj); obj->setButtonText( param ); obj->setColour(ToggleButton::textColourId, Colours::whitesmoke); obj->setEnabled(true); obj->addListener(this); if( obj != &enableRecord ){ obj->setToggleState(true, juce::sendNotification); } } // disable direct to binaural until fixed // enableDirectToBinaural.setEnabled(false); enableDirectToBinaural.setToggleState(false, juce::sendNotification); enableRecord.setToggleState(false, juce::sendNotification); }