Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to build with JUCE-7.0.2 #604

Closed
umlaeute opened this issue Aug 19, 2022 · 2 comments
Closed

fails to build with JUCE-7.0.2 #604

umlaeute opened this issue Aug 19, 2022 · 2 comments

Comments

@umlaeute
Copy link
Contributor

i tried to upgrade JUCE to JUCE-7.0.2 and experienced build failures (as expected, as AudioPlayHead::getCurrentPosition() has been deprecated in JUCE-7.0.0)

here's a naive attempt to fix the build:

--- giada.orig/src/core/plugins/pluginHost.cpp
+++ giada/src/core/plugins/pluginHost.cpp
@@ -49,14 +49,15 @@
 
 /* -------------------------------------------------------------------------- */
 
-bool PluginHost::Info::getCurrentPosition(CurrentPositionInfo& result)
+juce::Optional<juce::AudioPlayHead::PositionInfo> PluginHost::Info::getPosition() const
 {
-	result.bpm           = m_sequencer.getBpm();
-	result.timeInSamples = m_sequencer.getCurrentFrame();
-	result.timeInSeconds = m_sequencer.getCurrentSecond(m_sampleRate);
-	result.isPlaying     = m_sequencer.isRunning();
+	juce::Optional<juce::AudioPlayHead::PositionInfo> info;
+	info->setBpm           (m_sequencer.getBpm());
+	info->setTimeInSamples (m_sequencer.getCurrentFrame());
+	info->setTimeInSeconds (m_sequencer.getCurrentSecond(m_sampleRate));
+	info->setIsPlaying     (m_sequencer.isRunning());
 
-	return true;
+	return info;
 }
 
 /* -------------------------------------------------------------------------- */
--- giada.orig/src/core/plugins/pluginHost.h
+++ giada/src/core/plugins/pluginHost.h
@@ -60,7 +60,7 @@
 	public:
 		Info(const Sequencer&, int sampleRate);
 
-		bool getCurrentPosition(CurrentPositionInfo& result) override;
+		juce::Optional<PositionInfo> getPosition() const override;
 		bool canControlTransport() override;
 
 	private:
@gvnnz
Copy link
Contributor

gvnnz commented Sep 3, 2022

Hi @umlaeute , we fixed those issues when we upgraded to JUCE 7 here: 42f1beb. Still not officially released though.

@umlaeute
Copy link
Contributor Author

since 0.24.0 is out (and the relevant commit was already in 0.23.0), i guess this issue can be closed.

@gvnnz gvnnz closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants