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

Enable building with a libopenshot-audio that's based on non-bundled JUCE #515

Merged
merged 3 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/Qt/AudioPlaybackThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace openshot
static AudioDeviceManagerSingleton * Instance();

/// Public device manager property
AudioDeviceManager audioDeviceManager;
juce::AudioDeviceManager audioDeviceManager;

/// Close audio device
void CloseAudioDevice();
Expand All @@ -86,9 +86,9 @@ namespace openshot
*/
class AudioPlaybackThread : juce::Thread
{
AudioSourcePlayer player;
AudioTransportSource transport;
MixerAudioSource mixer;
juce::AudioSourcePlayer player;
juce::AudioTransportSource transport;
juce::MixerAudioSource mixer;
AudioReaderSource *source;
double sampleRate;
int numChannels;
Expand Down
13 changes: 7 additions & 6 deletions src/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ void Frame::AddImage(std::shared_ptr<QImage> new_image, bool only_odd_lines)
if (ret) {
return;
}

// Get the frame's image
const GenericScopedLock<juce::CriticalSection> lock(addingImageSection);
#pragma omp critical (AddImage)
Expand Down Expand Up @@ -979,7 +979,8 @@ void Frame::Play()
return;

juce::AudioDeviceManager deviceManager;
String error = deviceManager.initialise (0, /* number of input channels */
juce::String error = deviceManager.initialise (
0, /* number of input channels */
2, /* number of output channels */
0, /* no XML settings.. */
true /* select default device on failure */);
Expand All @@ -992,17 +993,17 @@ void Frame::Play()
juce::AudioSourcePlayer audioSourcePlayer;
deviceManager.addAudioCallback (&audioSourcePlayer);

ScopedPointer<AudioBufferSource> my_source;
my_source = new AudioBufferSource(audio.get());
std::unique_ptr<AudioBufferSource> my_source;
my_source.reset (new AudioBufferSource (audio.get()));

// Create TimeSliceThread for audio buffering
juce::TimeSliceThread my_thread("Audio buffer thread");

// Start thread
my_thread.startThread();

AudioTransportSource transport1;
transport1.setSource (my_source,
juce::AudioTransportSource transport1;
transport1.setSource (my_source.get(),
5000, // tells it to buffer this many samples ahead
&my_thread,
(double) sample_rate,
Expand Down
3 changes: 3 additions & 0 deletions src/bindings/ruby/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ endif()
set_property(SOURCE openshot.i PROPERTY CPLUSPLUS ON)
set_property(SOURCE openshot.i PROPERTY SWIG_MODULE_NAME openshot)

### Unbreak std::isfinite()
add_compile_definitions(HAVE_ISFINITE=1)

### Suppress a ton of warnings in the generated SWIG C++ code
set(SWIG_CXX_FLAGS "-Wno-unused-variable -Wno-unused-function \
-Wno-deprecated-copy -Wno-class-memaccess -Wno-cast-function-type \
Expand Down