diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-30 00:10:46 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-30 00:11:33 +0200 |
| commit | 7c998afc2711a112dc70a0b247746932bc9ae4ea (patch) | |
| tree | 9d47c415a4e08dbc298faf2d93394389acb20695 /src/tools | |
| parent | 66188f33fbe6b042e765fdf6f73d51cba5ffd488 (diff) | |
Change internal name dist -> disk.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_disk.cc (renamed from src/tools/dcpomatic_dist.cc) | 16 | ||||
| -rw-r--r-- | src/tools/dcpomatic_disk_writer.cc (renamed from src/tools/dcpomatic_dist_writer.cc) | 54 | ||||
| -rw-r--r-- | src/tools/wscript | 14 |
3 files changed, 42 insertions, 42 deletions
diff --git a/src/tools/dcpomatic_dist.cc b/src/tools/dcpomatic_disk.cc index 16228b09a..28945deff 100644 --- a/src/tools/dcpomatic_dist.cc +++ b/src/tools/dcpomatic_disk.cc @@ -30,7 +30,7 @@ #include "lib/cross.h" #include "lib/copy_to_drive_job.h" #include "lib/job_manager.h" -#include "lib/dist_writer_messages.h" +#include "lib/disk_writer_messages.h" #include <wx/wx.h> #include <boost/process.hpp> #ifdef DCPOMATIC_WINDOWS @@ -107,9 +107,9 @@ public: /* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's * a better place to put them. */ - dcpomatic_log.reset(new FileLog(config_path() / "dist.log")); - dcpomatic_log->set_types (dcpomatic_log->types() | LogEntry::TYPE_DIST); - LOG_DIST_NC("dcpomatic_dist started"); + dcpomatic_log.reset(new FileLog(config_path() / "disk.log")); + dcpomatic_log->set_types (dcpomatic_log->types() | LogEntry::TYPE_DISK); + LOG_DISK_NC("dcpomatic_disk started"); drive_refresh (); @@ -119,16 +119,16 @@ public: #ifdef DCPOMATIC_WINDOWS /* We must use ::shell here, it seems, to avoid error code 740 (related to privilege escalation) */ - _writer = new boost::process::child (dist_writer_path(), boost::process::shell, boost::process::windows::hide); + _writer = new boost::process::child (disk_writer_path(), boost::process::shell, boost::process::windows::hide); #else - LOG_DIST("Starting writer process %1", dist_writer_path().string()); - _writer = new boost::process::child (dist_writer_path()); + LOG_DISK("Starting writer process %1", disk_writer_path().string()); + _writer = new boost::process::child (disk_writer_path()); #endif } ~DOMFrame () { - _nanomsg.blocking_send(DIST_WRITER_QUIT "\n"); + _nanomsg.blocking_send(DISK_WRITER_QUIT "\n"); } private: diff --git a/src/tools/dcpomatic_dist_writer.cc b/src/tools/dcpomatic_disk_writer.cc index f7ed50345..08f06ff02 100644 --- a/src/tools/dcpomatic_dist_writer.cc +++ b/src/tools/dcpomatic_disk_writer.cc @@ -18,7 +18,7 @@ */ -#include "lib/dist_writer_messages.h" +#include "lib/disk_writer_messages.h" #include "lib/compose.hpp" #include "lib/exceptions.h" #include "lib/cross.h" @@ -146,7 +146,7 @@ write (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total } remaining -= this_time; total_remaining -= this_time; - nanomsg->blocking_send(String::compose(DIST_WRITER_PROGRESS "\n%1\n", (1 - float(total_remaining) / total))); + nanomsg->blocking_send(String::compose(DISK_WRITER_PROGRESS "\n%1\n", (1 - float(total_remaining) / total))); } fclose (in); @@ -161,12 +161,12 @@ string read (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total) { ext4_file in; - LOG_DIST("Opening %1 for read", to.generic_string()); + LOG_DISK("Opening %1 for read", to.generic_string()); int r = ext4_fopen(&in, to.generic_string().c_str(), "rb"); if (r != EOK) { throw VerifyError (String::compose("Failed to open file %1", to.generic_string()), r); } - LOG_DIST("Opened %1 for read", to.generic_string()); + LOG_DISK("Opened %1 for read", to.generic_string()); uint8_t* buffer = new uint8_t[block_size]; Digester digester; @@ -185,7 +185,7 @@ read (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_ digester.add (buffer, this_time); remaining -= this_time; total_remaining -= this_time; - nanomsg->blocking_send(String::compose(DIST_WRITER_PROGRESS "\n%1\n", (1 - float(total_remaining) / total))); + nanomsg->blocking_send(String::compose(DISK_WRITER_PROGRESS "\n%1\n", (1 - float(total_remaining) / total))); } ext4_fclose (&in); @@ -202,7 +202,7 @@ static void copy (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total) { - LOG_DIST ("Copy %1 -> %2", from.string(), to.generic_string()); + LOG_DISK ("Copy %1 -> %2", from.string(), to.generic_string()); using namespace boost::filesystem; @@ -219,9 +219,9 @@ copy (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_ } } else { string const write_digest = write (from, cr, total_remaining, total); - LOG_DIST ("Wrote %1 %2 with %3", from.string(), cr.generic_string(), write_digest); + LOG_DISK ("Wrote %1 %2 with %3", from.string(), cr.generic_string(), write_digest); string const read_digest = read (from, cr, total_remaining, total); - LOG_DIST ("Read %1 %2 with %3", from.string(), cr.generic_string(), write_digest); + LOG_DISK ("Read %1 %2 with %3", from.string(), cr.generic_string(), write_digest); if (write_digest != read_digest) { throw VerifyError ("Hash of written data is incorrect", 0); } @@ -253,7 +253,7 @@ try if (!bd) { throw CopyError ("Failed to open drive", 0); } - LOG_DIST_NC ("Opened drive"); + LOG_DISK_NC ("Opened drive"); struct ext4_mbr_parts parts; parts.division[0] = 100; @@ -271,7 +271,7 @@ try if (r) { throw CopyError ("Failed to write MBR", r); } - LOG_DIST_NC ("Wrote MBR"); + LOG_DISK_NC ("Wrote MBR"); #ifdef DCPOMATIC_WINDOWS struct ext4_mbr_bdevs bdevs; @@ -305,27 +305,27 @@ try if (!bd) { throw CopyError ("Failed to open partition", 0); } - LOG_DIST_NC ("Opened partition"); + LOG_DISK_NC ("Opened partition"); - nanomsg->blocking_send(DIST_WRITER_FORMATTING "\n"); + nanomsg->blocking_send(DISK_WRITER_FORMATTING "\n"); r = ext4_mkfs(&fs, bd, &info, F_SET_EXT4); if (r != EOK) { throw CopyError ("Failed to make filesystem", r); } - LOG_DIST_NC ("Made filesystem"); + LOG_DISK_NC ("Made filesystem"); r = ext4_device_register(bd, "ext4_fs"); if (r != EOK) { throw CopyError ("Failed to register device", r); } - LOG_DIST_NC ("Registered device"); + LOG_DISK_NC ("Registered device"); r = ext4_mount("ext4_fs", "/mp/", false); if (r != EOK) { throw CopyError ("Failed to mount device", r); } - LOG_DIST_NC ("Mounted device"); + LOG_DISK_NC ("Mounted device"); uint64_t total_bytes = 0; count (dcp_path, total_bytes); @@ -341,16 +341,16 @@ try throw CopyError ("Failed to unmount device", r); } - nanomsg->blocking_send(DIST_WRITER_OK "\n"); + nanomsg->blocking_send(DISK_WRITER_OK "\n"); } catch (CopyError& e) { - LOG_DIST("CopyError: %1 %2", e.message(), e.number()); - nanomsg->blocking_send(String::compose(DIST_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number())); + LOG_DISK("CopyError: %1 %2", e.message(), e.number()); + nanomsg->blocking_send(String::compose(DISK_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number())); } catch (VerifyError& e) { - LOG_DIST("VerifyError: %1 %2", e.message(), e.number()); - nanomsg->blocking_send(String::compose(DIST_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number())); + LOG_DISK("VerifyError: %1 %2", e.message(), e.number()); + nanomsg->blocking_send(String::compose(DISK_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number())); } catch (exception& e) { - LOG_DIST("Exception: %1", e.what()); - nanomsg->blocking_send(String::compose(DIST_WRITER_ERROR "\n%1\n0\n", e.what())); + LOG_DISK("Exception: %1", e.what()); + nanomsg->blocking_send(String::compose(DISK_WRITER_ERROR "\n%1\n0\n", e.what())); } #ifdef DCPOMATIC_LINUX @@ -382,7 +382,7 @@ idle () dcp_path = nanomsg->blocking_get(); device = nanomsg->blocking_get(); - LOG_DIST ("Here we go writing %1 to %2", dcp_path, device); + LOG_DISK ("Here we go writing %1 to %2", dcp_path, device); #ifdef DCPOMATIC_LINUX polkit_authority = polkit_authority_get_sync (0, 0); @@ -404,14 +404,14 @@ main () /* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's * a better place to put them. */ - dcpomatic_log.reset(new FileLog(config_path() / "dist_writer.log")); - dcpomatic_log->set_types (dcpomatic_log->types() | LogEntry::TYPE_DIST); - LOG_DIST_NC("dcpomatic_dist_writer started"); + dcpomatic_log.reset(new FileLog(config_path() / "disk_writer.log")); + dcpomatic_log->set_types (dcpomatic_log->types() | LogEntry::TYPE_DISK); + LOG_DISK_NC("dcpomatic_disk_writer started"); try { nanomsg = new Nanomsg (false); } catch (runtime_error& e) { - LOG_DIST_NC("Could not set up nanomsg socket"); + LOG_DISK_NC("Could not set up nanomsg socket"); exit (EXIT_FAILURE); } diff --git a/src/tools/wscript b/src/tools/wscript index 3ff081522..c4fb7b820 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -32,7 +32,7 @@ def build(bld): uselib += 'AVUTIL SWSCALE SWRESAMPLE POSTPROC CURL BOOST_FILESYSTEM SSH ZIP CAIROMM FONTCONFIG PANGOMM SUB ' uselib += 'SNDFILE SAMPLERATE BOOST_REGEX ICU NETTLE RTAUDIO PNG ' - if bld.env.ENABLE_DIST: + if bld.env.ENABLE_DISK: if bld.env.TARGET_LINUX: uselib += 'POLKIT ' uselib += 'LWEXT4 NANOMSG ' @@ -47,8 +47,8 @@ def build(bld): cli_tools = ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create', 'swaroop_dcpomatic_ecinema', 'swaroop_dcpomatic_uuid'] else: cli_tools = ['dcpomatic_cli', 'dcpomatic_server_cli', 'server_test', 'dcpomatic_kdm_cli', 'dcpomatic_create'] - if bld.env.ENABLE_DIST: - cli_tools.append('dcpomatic_dist_writer') + if bld.env.ENABLE_DISK: + cli_tools.append('dcpomatic_disk_writer') for t in cli_tools: obj = bld(features='cxx cxxprogram') @@ -56,9 +56,9 @@ def build(bld): obj.includes = ['..'] obj.use = ['libdcpomatic2'] obj.source = '%s.cc' % t - if bld.env.TARGET_WINDOWS and t == 'dcpomatic_dist_writer': + if bld.env.TARGET_WINDOWS and t == 'dcpomatic_disk_writer': obj.source += ' ../../platform/windows/%s.rc' % t - # Prevent a console window opening when we start dcpomatic2_dist_writer + # Prevent a console window opening when we start dcpomatic2_disk_writer bld.env.LINKFLAGS.append('-Wl,-subsystem,windows') obj.target = t.replace('dcpomatic', 'dcpomatic2').replace('swaroop_', '') if t == 'server_test': @@ -72,8 +72,8 @@ def build(bld): gui_tools = ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player', 'swaroop_dcpomatic_playlist'] else: gui_tools = ['dcpomatic', 'dcpomatic_batch', 'dcpomatic_server', 'dcpomatic_kdm', 'dcpomatic_player', 'dcpomatic_playlist'] - if bld.env.ENABLE_DIST: - gui_tools.append('dcpomatic_dist') + if bld.env.ENABLE_DISK: + gui_tools.append('dcpomatic_disk') for t in gui_tools: obj = bld(features='cxx cxxprogram') |
