Fix build with RtAudio 6.
authorCarl Hetherington <cth@carlh.net>
Fri, 26 Jul 2024 10:15:12 +0000 (12:15 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 27 Jul 2024 06:28:02 +0000 (08:28 +0200)
src/wx/audio_backend.cc
src/wx/audio_backend.h
src/wx/film_viewer.cc

index 9c8b1c386d032da4ea140cf33918d93461ad739d..68bc06004bf93968268a760c671fc7224a7c0951 100644 (file)
 
 
 #include "audio_backend.h"
+#include <boost/bind/bind.hpp>
 
 
 using std::string;
 using std::vector;
 using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 
 AudioBackend* AudioBackend::_instance = nullptr;
@@ -86,8 +90,8 @@ AudioBackend::output_device_names()
        vector<string> names;
 
 #if (RTAUDIO_VERSION_MAJOR >= 6)
-       for (auto device_id: audio.getDeviceIds()) {
-               auto dev = audio.getDeviceInfo(device_id);
+       for (auto device_id: _rtaudio.getDeviceIds()) {
+               auto dev = _rtaudio.getDeviceInfo(device_id);
                if (dev.outputChannels > 0) {
                        names.push_back(dev.name);
                }
@@ -130,7 +134,7 @@ AudioBackend::device_output_channels(string name)
 {
 #if (RTAUDIO_VERSION_MAJOR >= 6)
        for (auto device_id: _rtaudio.getDeviceIds()) {
-               auto info = audio.getDeviceInfo(device_id);
+               auto info = _rtaudio.getDeviceInfo(device_id);
                if (info.name == name) {
                        return info.outputChannels;
                }
index aa4adf13ce25000c14240d6970e2c44b57ac1ad0..faca6eb0acc4e21e6df9daf2b213f3550e2165ec 100644 (file)
@@ -24,6 +24,7 @@ LIBDCP_DISABLE_WARNINGS
 #include <RtAudio.h>
 LIBDCP_ENABLE_WARNINGS
 #include <boost/optional.hpp>
+#include <boost/thread/mutex.hpp>
 
 
 
index 1876aac74829687eb405fb11c74059300914e18b..7a3d58734edee00d1fc4b5cf59c7d96311af7428 100644 (file)
@@ -602,7 +602,8 @@ FilmViewer::config_changed (Config::Property p)
                return;
        }
 
-       auto& audio = AudioBackend::instance()->rtaudio();
+       auto backend = AudioBackend::instance();
+       auto& audio = backend->rtaudio();
 
        if (audio.isStreamOpen()) {
                audio.closeStream();
@@ -632,7 +633,7 @@ FilmViewer::config_changed (Config::Property p)
                        _audio_channels = 0;
                        error_dialog(
                                _video_view->get(),
-                               _("Could not set up audio output.  There will be no audio during the preview."), std_to_wx(audio.last_rtaudio_error())
+                               _("Could not set up audio output.  There will be no audio during the preview."), std_to_wx(backend->last_rtaudio_error())
                                );
                }
 #else