Note that newer libsub version is required.
[dcpomatic.git] / src / lib / cross_osx.cc
index 0f25732f2aa3e667050998f94e4cfc07f578542d..913b19103865ae2992e4bbfc802d3c4e0eb70d20 100644 (file)
@@ -25,6 +25,7 @@
 #include "dcpomatic_log.h"
 #include "config.h"
 #include "exceptions.h"
+#include <dcp/filesystem.h>
 #include <dcp/raw_convert.h>
 #include <glib.h>
 #include <boost/algorithm/string.hpp>
@@ -84,7 +85,7 @@ cpu_info ()
 boost::filesystem::path
 directory_containing_executable ()
 {
-       return boost::filesystem::canonical(boost::dll::program_location()).parent_path();
+       return dcp::filesystem::canonical(boost::dll::program_location()).parent_path();
 }
 
 
@@ -106,7 +107,7 @@ void
 run_ffprobe(boost::filesystem::path content, boost::filesystem::path out, bool err, string args)
 {
        auto path = directory_containing_executable () / "ffprobe";
-       if (!boost::filesystem::exists(path)) {
+       if (!dcp::filesystem::exists(path)) {
                /* This is a hack but we need ffprobe during tests */
                path = "/Users/ci/workspace/bin/ffprobe";
        }
@@ -377,11 +378,15 @@ Drive::get ()
        using namespace boost::algorithm;
        vector<OSXDisk> disks;
 
+       LOG_DISK_NC("Drive::get() starts");
+
        auto session = DASessionCreate(kCFAllocatorDefault);
        if (!session) {
                return {};
        }
 
+       LOG_DISK_NC("Drive::get() has session");
+
        DARegisterDiskAppearedCallback (session, NULL, disk_appeared, &disks);
        auto run_loop = CFRunLoopGetCurrent ();
        DASessionScheduleWithRunLoop (session, run_loop, kCFRunLoopDefaultMode);
@@ -390,7 +395,14 @@ Drive::get ()
        DAUnregisterCallback(session, (void *) disk_appeared, &disks);
        CFRelease(session);
 
-       return osx_disks_to_drives (disks);
+       auto drives = osx_disks_to_drives(disks);
+
+       LOG_DISK("Drive::get() found %1 drives:", drives.size());
+       for (auto const& drive: drives) {
+               LOG_DISK("%1 %2 mounted=%3", drive.description(), drive.device(), drive.mounted() ? "yes" : "no");
+       }
+
+       return drives;
 }