<key>DYLD_LIBRARY_PATH</key>
<string><![CDATA[/Library/Application Support/com.dcpomatic]]></string>
</dict>
- <key>KeepAlive</key>
- <true/>
- <key>RunAtLoad</key>
- <true/>
- <key>Debug</key>
- <true/>
<key>StandardOutPath</key>
<string>/var/log/dcpomatic_disk_writer_out.log</string>
<key>StandardErrorPath</key>
<string>/var/log/dcpomatic_disk_writer_err.log</string>
+ <key>LaunchEvents</key>
+ <dict>
+ <key>com.apple.notifyd.matching</key>
+ <dict>
+ <key>com.dcpomatic.disk.writer.start</key>
+ <dict>
+ <key>Notification</key>
+ <string>com.dcpomatic.disk.writer.start</string>
+ </dict>
+ </dict>
+ </dict>
</dict>
</plist>
EOF
#endif
#ifdef DCPOMATIC_OSX
#include <ApplicationServices/ApplicationServices.h>
+#include <notify.h>
#endif
using std::string;
_writer = new boost::process::child (disk_writer_path());
#endif
- /* _writer is always running on macOS at the moment */
+#ifdef DCPOMATIC_OSX
+ LOG_DISK_NC("Sending notification to writer daemon");
+ notify_post ("com.dcpomatic.disk.writer.start");
+#endif
}
~DOMFrame ()
extern "C" {
#include <lwext4/file_dev.h>
}
+#include <xpc/xpc.h>
#endif
#ifdef DCPOMATIC_LINUX
LOG_DISK_NC("dcpomatic_disk_writer started");
#endif
+#ifdef DCPOMATIC_OSX
+ /* I *think* this confumes the notifyd event that we used to start the process, so we only
+ * get started once per notification.
+ */
+ xpc_set_event_stream_handler("com.apple.notifyd.matching", DISPATCH_TARGET_QUEUE_DEFAULT, ^(xpc_object_t event) {});
+#endif
+
try {
nanomsg = new Nanomsg (false);
} catch (runtime_error& e) {