diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-07 00:10:59 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-08-07 00:10:59 +0200 |
| commit | 334d3cb564c72bd430a17c6e6f01aeb488fb191c (patch) | |
| tree | 52b4e97d21f24e55b377e5f1e1a11e4e3c22ed3b /src/tools/dcpomatic_disk.cc | |
| parent | e28f10cd045d3a420689c9aafc5abaa64d35fa92 (diff) | |
Check that we have a connection to the disk writer before starting to use it in earnest.
Diffstat (limited to 'src/tools/dcpomatic_disk.cc')
| -rw-r--r-- | src/tools/dcpomatic_disk.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index b94d4bf94..7bea4d8e9 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -210,6 +210,31 @@ private: DCPOMATIC_ASSERT (_drive->GetSelection() != wxNOT_FOUND); DCPOMATIC_ASSERT (static_cast<bool>(_dcp_path)); + bool have_writer = true; + if (!_nanomsg.send(DISK_WRITER_PING "\n", 2000)) { + have_writer = false; + } else { + optional<string> reply = _nanomsg.receive (2000); + if (!reply || *reply != DISK_WRITER_PONG) { + have_writer = false; + } + } + + if (!have_writer) { +#ifdef DCPOMATIC_WINDOWS + MessageDialog* m = new MessageDialog ( + this, + _("DCP-o-matic Disk Writer"), + _("Do you see a 'User Account Control' dialogue asking about dcpomatic2_disk_writer.exe? If so, click 'Yes', then try again.") + ); + m->ShowModal (); + m->Destroy (); + return; +#else + throw CommunicationFailedError (); +#endif + } + Drive const& drive = _drives[_drive->GetSelection()]; if (drive.mounted()) { TryUnmountDialog* d = new TryUnmountDialog(this, drive.description()); |
