diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-09 00:49:35 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-09 00:49:35 +0200 |
| commit | a16523af5f70b60f4890f198f6214177077a9c1d (patch) | |
| tree | 8f3f3a9001894564ae491709250172c292da8425 /src/lib | |
| parent | be2e6884aafa58053a0707bc629ae8c56dbf1eb5 (diff) | |
Improve disk_writer_messages.h commenting and add DISK_WRITER_QUIT and DISK_WRITER_WRITE #defines.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/copy_to_drive_job.cc | 2 | ||||
| -rw-r--r-- | src/lib/disk_writer_messages.h | 69 |
2 files changed, 31 insertions, 40 deletions
diff --git a/src/lib/copy_to_drive_job.cc b/src/lib/copy_to_drive_job.cc index b7bb5a60d..fe35daba6 100644 --- a/src/lib/copy_to_drive_job.cc +++ b/src/lib/copy_to_drive_job.cc @@ -63,7 +63,7 @@ CopyToDriveJob::json_name () const void CopyToDriveJob::run () { - if (!_nanomsg.nonblocking_send(String::compose("W\n%1\n%2\n", _dcp.string(), _drive.internal_name()))) { + if (!_nanomsg.nonblocking_send(String::compose(DISK_WRITER_WRITE "\n%1\n%2\n", _dcp.string(), _drive.internal_name()))) { throw CopyError ("Could not communicate with writer process", 0); } diff --git a/src/lib/disk_writer_messages.h b/src/lib/disk_writer_messages.h index 61cdbcfbd..39253a76e 100644 --- a/src/lib/disk_writer_messages.h +++ b/src/lib/disk_writer_messages.h @@ -18,60 +18,51 @@ */ -/* dcpomatic_disk_writer receives - -DCP pathname\n -Internal name of drive to write to\n +/* We have the front-end application dcpomatic2_disk and the back-end + * dcpomatic2_disk_writer. The communication is line-based, separated + * by \n. + */ - Then responds with one of the following. -*/ +/* REQUEST TO WRITE DCP */ -/** Write finished and everything was OK, e.g. +// Front-end sends: + +#define DISK_WRITER_WRITE "W" +// DCP pathname +// Internal name of the drive to write to -D\n +// Back-end responds: -*/ +// everything is ok #define DISK_WRITER_OK "D" -/** There was an error. Following this will come - -error message\n -error number\n - -e.g. - -E\n -Disc full\n -42\n - -*/ +// there was an error #define DISK_WRITER_ERROR "E" +// Error message +// Error number -/** The disk writer is formatting the drive. It is not possible - * to give progress reports on this so the writer just tells us - * it's happening. This is finished when DISK_WRITER_PROGRESS - * messages start arriving - */ +// the drive is being formatted #define DISK_WRITER_FORMATTING "F" -/** Some progress has been made in the main "copy" part of the task. - * Following this will come +// data is being copied, 30% done +#define DISK_WRITER_PROGRESS "P" +// 0.3\n -progress as a float from 0 to 1\n -e.g. +/* REQUEST TO QUIT */ -P\n -0.3\n +// Front-end sends: +#define DISK_WRITER_QUIT "Q" -*/ -#define DISK_WRITER_PROGRESS "P" -/** dcpomatic_disk_writer may also receive +/* REQUEST TO UNMOUNT A DRIVE */ -Q\n +// Front-end sends: +#define DISK_WRITER_UNMOUNT "U" +// Internal name of the drive to write to -as a request to quit. -*/ -#define DISK_WRITER_QUIT "Q" +// Back-end responds: +// DISK_WRITER_OK +// or +// DISK_WRITER_ERROR |
