Initial work to implement offline render in stand alone build

This commit is contained in:
xenakios 2018-05-07 20:21:42 +03:00
parent b71eea227d
commit 29bc7bd5ee
2 changed files with 24 additions and 19 deletions

View File

@ -55,6 +55,13 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
m_settings_button.setButtonText("Settings..."); m_settings_button.setButtonText("Settings...");
m_settings_button.onClick = [this]() { showSettingsMenu(); }; m_settings_button.onClick = [this]() { showSettingsMenu(); };
if (processor.wrapperType == AudioProcessor::wrapperType_Standalone)
{
addAndMakeVisible(&m_render_button);
m_render_button.setButtonText("Render...");
m_render_button.onClick = [this]() { showRenderDialog(); };
}
addAndMakeVisible(&m_info_label); addAndMakeVisible(&m_info_label);
m_info_label.setJustificationType(Justification::centredRight); m_info_label.setJustificationType(Justification::centredRight);
@ -237,6 +244,10 @@ PaulstretchpluginAudioProcessorEditor::~PaulstretchpluginAudioProcessorEditor()
{ {
} }
void PaulstretchpluginAudioProcessorEditor::showRenderDialog()
{
}
void PaulstretchpluginAudioProcessorEditor::paint (Graphics& g) void PaulstretchpluginAudioProcessorEditor::paint (Graphics& g)
{ {
g.fillAll(Colours::darkgrey); g.fillAll(Colours::darkgrey);
@ -248,12 +259,19 @@ void PaulstretchpluginAudioProcessorEditor::resized()
m_import_button.changeWidthToFitText(); m_import_button.changeWidthToFitText();
m_settings_button.setBounds(m_import_button.getRight() + 1, 1, 60, 24); m_settings_button.setBounds(m_import_button.getRight() + 1, 1, 60, 24);
m_settings_button.changeWidthToFitText(); m_settings_button.changeWidthToFitText();
m_perfmeter.setBounds(m_settings_button.getRight() + 1, 1, 150, 24); int yoffs = m_settings_button.getRight() + 1;
if (processor.wrapperType == AudioProcessor::wrapperType_Standalone)
{
m_render_button.setBounds(yoffs, 1, 60, 24);
m_render_button.changeWidthToFitText();
yoffs = m_render_button.getRight() + 1;
}
m_perfmeter.setBounds(yoffs, 1, 150, 24);
m_info_label.setBounds(m_perfmeter.getRight() + 1, m_settings_button.getY(), m_info_label.setBounds(m_perfmeter.getRight() + 1, m_settings_button.getY(),
getWidth()- m_perfmeter.getRight()-1, 24); getWidth()- m_perfmeter.getRight()-1, 24);
int w = getWidth(); int w = getWidth();
int xoffs = 1; int xoffs = 1;
int yoffs = 30; yoffs = 30;
int div = w / 5; int div = w / 5;
//std::vector<std::vector<int>> layout; //std::vector<std::vector<int>> layout;
//layout.emplace_back(cpi_capture_enabled, cpi_passthrough, cpi_pause_enabled, cpi_freeze); //layout.emplace_back(cpi_capture_enabled, cpi_passthrough, cpi_pause_enabled, cpi_freeze);
@ -490,16 +508,12 @@ void PaulstretchpluginAudioProcessorEditor::showSettingsMenu()
for (int i=0;i<capturelens.size();++i) for (int i=0;i<capturelens.size();++i)
capturelenmenu.addItem(200+i, String(capturelens[i])+" seconds", true, capturelen == capturelens[i]); capturelenmenu.addItem(200+i, String(capturelens[i])+" seconds", true, capturelen == capturelens[i]);
menu.addSubMenu("Capture buffer length", capturelenmenu); menu.addSubMenu("Capture buffer length", capturelenmenu);
menu.addItem(3, "About...", true, false); menu.addItem(3, "About...", true, false);
#ifdef JUCE_DEBUG #ifdef JUCE_DEBUG
menu.addItem(6, "Dump preset to clipboard", true, false); menu.addItem(6, "Dump preset to clipboard", true, false);
#endif #endif
menu.addItem(7, "Show technical info", true, processor.m_show_technical_info); menu.addItem(7, "Show technical info", true, processor.m_show_technical_info);
/*
if (processor.m_offline_render_state==-1 || processor.m_offline_render_state == 200)
menu.addItem(8, "Offline render...", true, false);
else menu.addItem(9, "Cancel render", true, false);
*/
int r = menu.show(); int r = menu.show();
if (r >= 200 && r < 210) if (r >= 200 && r < 210)
{ {
@ -557,18 +571,7 @@ void PaulstretchpluginAudioProcessorEditor::showSettingsMenu()
toggleBool(processor.m_show_technical_info); toggleBool(processor.m_show_technical_info);
processor.m_propsfile->m_props_file->setValue("showtechnicalinfo", processor.m_show_technical_info); processor.m_propsfile->m_props_file->setValue("showtechnicalinfo", processor.m_show_technical_info);
} }
if (r == 8)
{
#ifdef JUCE_WINDOWS
processor.offlineRender(File("C:\\MusicAudio\\sourcesamples\\paultesmaus\\plugin_offline_test\\out.wav"));
#else
processor.offlineRender(File("/Users/teemu/AudioProjects/sourcesamples/paultests/pspout.wav"));
#endif
}
if (r == 9)
{
processor.m_offline_render_cancel_requested = true;
}
} }
WaveformComponent::WaveformComponent(AudioFormatManager* afm, AudioThumbnail* thumb) WaveformComponent::WaveformComponent(AudioFormatManager* afm, AudioThumbnail* thumb)

View File

@ -241,6 +241,7 @@ public:
WaveformComponent m_wavecomponent; WaveformComponent m_wavecomponent;
void chooseFile(); void chooseFile();
void showRenderDialog();
private: private:
PaulstretchpluginAudioProcessor& processor; PaulstretchpluginAudioProcessor& processor;
uptrvec<ParameterComponent> m_parcomps; uptrvec<ParameterComponent> m_parcomps;
@ -248,6 +249,7 @@ private:
PerfMeterComponent m_perfmeter; PerfMeterComponent m_perfmeter;
TextButton m_import_button; TextButton m_import_button;
TextButton m_settings_button; TextButton m_settings_button;
TextButton m_render_button;
Label m_info_label; Label m_info_label;
SpectralChainEditor m_spec_order_ed; SpectralChainEditor m_spec_order_ed;