summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-09 20:52:20 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-13 00:23:46 +0200
commit6d27b49a7a767a9c8b31dc0f799da940ddb7232f (patch)
tree1fe084da7f042bf3ddd3b042ef165803468fcc92 /src/tools
parent06d773174378a70289bee8d7abb62e67deaaddf8 (diff)
Tidy up Drive and unmounting a little.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic_disk.cc4
-rw-r--r--src/tools/dcpomatic_disk_writer.cc11
2 files changed, 8 insertions, 7 deletions
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc
index ba92cf94e..3ceead860 100644
--- a/src/tools/dcpomatic_disk.cc
+++ b/src/tools/dcpomatic_disk.cc
@@ -178,7 +178,7 @@ private:
if (!_nanomsg.send(DISK_WRITER_UNMOUNT "\n", 2000)) {
throw CommunicationFailedError ();
}
- if (!_nanomsg.send(drive.internal_name() + "\n", 2000)) {
+ if (!_nanomsg.send(drive.as_xml() + "\n", 2000)) {
throw CommunicationFailedError ();
}
optional<string> reply = _nanomsg.receive (2000);
@@ -218,7 +218,7 @@ private:
_drive->Clear ();
int re_select = wxNOT_FOUND;
int j = 0;
- _drives = get_drives ();
+ _drives = Drive::get ();
BOOST_FOREACH (Drive i, _drives) {
wxString const s = std_to_wx(i.description());
if (s == current) {
diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc
index 5e76341eb..4a93cba98 100644
--- a/src/tools/dcpomatic_disk_writer.cc
+++ b/src/tools/dcpomatic_disk_writer.cc
@@ -403,11 +403,12 @@ try
exit (EXIT_SUCCESS);
} else if (*s == DISK_WRITER_UNMOUNT) {
/* XXX: should do Linux polkit stuff here */
- optional<string> device = nanomsg->receive (LONG_TIMEOUT);
- if (!device) {
+ optional<string> xml_head = nanomsg->receive (LONG_TIMEOUT);
+ optional<string> xml_body = nanomsg->receive (LONG_TIMEOUT);
+ if (!xml_head || !xml_body) {
throw CommunicationFailedError ();
}
- if (unmount_drive(*device)) {
+ if (Drive(*xml_head + *xml_body).unmount()) {
if (!nanomsg->send (DISK_WRITER_OK "\n", LONG_TIMEOUT)) {
throw CommunicationFailedError();
}
@@ -449,8 +450,8 @@ try
bool on_drive_list = false;
bool mounted = false;
- for (auto const& i: get_drives()) {
- if (i.internal_name() == *device) {
+ for (auto const& i: Drive::get()) {
+ if (i.device() == *device) {
on_drive_list = true;
mounted = i.mounted();
}