Add support for some custom VST opcodes
This commit is contained in:
		@@ -845,6 +845,36 @@ void PaulstretchpluginAudioProcessor::timerCallback(int id)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pointer_sized_int PaulstretchpluginAudioProcessor::handleVstPluginCanDo(int32 index, pointer_sized_int value, void * ptr, float opt)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (strcmp((char*)ptr, "xenakios") == 0)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							if (index == 0)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								double t0 = *getFloatParameter(cpi_soundstart);
 | 
				
			||||||
 | 
								double t1 = *getFloatParameter(cpi_soundend);
 | 
				
			||||||
 | 
								m_outlen = (t1-t0)*m_stretch_source->getInfileLengthSeconds()*(*getFloatParameter(cpi_stretchamount));
 | 
				
			||||||
 | 
								std::cout << "host requested output length, result " << m_outlen << "\n";
 | 
				
			||||||
 | 
								return pointer_sized_int(&m_outlen);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (index == 1 && (void*)value!=nullptr)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								String fn(CharPointer_UTF8((char*)value));
 | 
				
			||||||
 | 
								std::cout << "host requested to set audio file " << fn << "\n";
 | 
				
			||||||
 | 
								auto err = setAudioFile(File(fn));
 | 
				
			||||||
 | 
								std::cout << err << "\n";
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return 1;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						return pointer_sized_int();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pointer_sized_int PaulstretchpluginAudioProcessor::handleVstManufacturerSpecific(int32 index, pointer_sized_int value, void * ptr, float opt)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return pointer_sized_int();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PaulstretchpluginAudioProcessor::finishRecording(int lenrecording)
 | 
					void PaulstretchpluginAudioProcessor::finishRecording(int lenrecording)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	m_is_recording = false;
 | 
						m_is_recording = false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -115,7 +115,7 @@ public:
 | 
				
			|||||||
class PaulstretchpluginAudioProcessorEditor;
 | 
					class PaulstretchpluginAudioProcessorEditor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PaulstretchpluginAudioProcessor  : public AudioProcessor, 
 | 
					class PaulstretchpluginAudioProcessor  : public AudioProcessor, 
 | 
				
			||||||
	public MultiTimer
 | 
						public MultiTimer, public VSTCallbackHandler
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
	using EditorType = PaulstretchpluginAudioProcessorEditor;
 | 
						using EditorType = PaulstretchpluginAudioProcessorEditor;
 | 
				
			||||||
@@ -202,6 +202,16 @@ public:
 | 
				
			|||||||
    shared_envelope m_free_filter_envelope;
 | 
					    shared_envelope m_free_filter_envelope;
 | 
				
			||||||
	bool m_import_dlg_open = false;
 | 
						bool m_import_dlg_open = false;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						pointer_sized_int handleVstPluginCanDo(int32 index,
 | 
				
			||||||
 | 
							pointer_sized_int value,
 | 
				
			||||||
 | 
							void* ptr,
 | 
				
			||||||
 | 
							float opt) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pointer_sized_int handleVstManufacturerSpecific(int32 index,
 | 
				
			||||||
 | 
							pointer_sized_int value,
 | 
				
			||||||
 | 
							void* ptr,
 | 
				
			||||||
 | 
							float opt) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@@ -244,6 +254,7 @@ private:
 | 
				
			|||||||
	float m_cur_playrangeoffset = 0.0;
 | 
						float m_cur_playrangeoffset = 0.0;
 | 
				
			||||||
	void updateStretchParametersFromPluginParameters(ProcessParameters& pars);
 | 
						void updateStretchParametersFromPluginParameters(ProcessParameters& pars);
 | 
				
			||||||
	std::array<AudioParameterBool*, 9> m_sm_enab_pars;
 | 
						std::array<AudioParameterBool*, 9> m_sm_enab_pars;
 | 
				
			||||||
 | 
						double m_outlen = 0.0;
 | 
				
			||||||
	//==============================================================================
 | 
						//==============================================================================
 | 
				
			||||||
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor)
 | 
					    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor)
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user