Remove Monitor / EDID code that was used for the swaroop variant.
authorCarl Hetherington <cth@carlh.net>
Thu, 29 Apr 2021 09:03:38 +0000 (11:03 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 29 Apr 2021 18:53:49 +0000 (20:53 +0200)
src/lib/config.h
src/lib/edid.cc [deleted file]
src/lib/edid.h [deleted file]
src/lib/wscript
src/wx/monitor_dialog.cc [deleted file]
src/wx/monitor_dialog.h [deleted file]
src/wx/player_config_dialog.cc
src/wx/wscript

index da29a8955d68f2b9a4eda4d151621345ebe51fa0..1662671249209ec4abc60ce070351de6bdcb8da3 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "types.h"
 #include "state.h"
 
 #include "types.h"
 #include "state.h"
-#include "edid.h"
 #include "audio_mapping.h"
 #include <dcp/name_format.h>
 #include <dcp/certificate_chain.h>
 #include "audio_mapping.h"
 #include <dcp/name_format.h>
 #include <dcp/certificate_chain.h>
diff --git a/src/lib/edid.cc b/src/lib/edid.cc
deleted file mode 100644 (file)
index a530b8e..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "compose.hpp"
-#include "edid.h"
-#include "warnings.h"
-#include <dcp/raw_convert.h>
-DCPOMATIC_DISABLE_WARNINGS
-#include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
-#include <boost/filesystem.hpp>
-#include <boost/algorithm/string.hpp>
-#include <iostream>
-
-#define EDID_SYS_PATH "/sys/class/drm"
-static uint8_t const edid_header[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
-
-using std::vector;
-using std::string;
-using std::cout;
-
-vector<Monitor>
-get_monitors()
-{
-       using namespace boost::filesystem;
-       using namespace boost::algorithm;
-
-       vector<Monitor> monitors;
-
-       int card = 0;
-       while (true) {
-               path card_dir = String::compose("%1/card%2", EDID_SYS_PATH, card);
-               if (!is_directory(card_dir)) {
-                       break;
-               }
-
-               for (directory_iterator i = directory_iterator(card_dir); i != directory_iterator(); ++i) {
-                       if (!starts_with(i->path().filename().string(), String::compose("card%1", card))) {
-                               continue;
-                       }
-
-                       FILE* edid_file = fopen(path(i->path() / "edid").string().c_str(), "r");
-                       if (!edid_file) {
-                               continue;
-                       }
-
-                       uint8_t edid[128];
-                       int const N = fread(edid, 1, sizeof(edid), edid_file);
-                       fclose(edid_file);
-                       if (N != 128) {
-                               continue;
-                       }
-
-                       if (memcmp(edid, edid_header, 8) != 0) {
-                               continue;
-                       }
-
-                       Monitor mon;
-
-                       uint16_t mid = (edid[8] << 8) | edid[9];
-                       mon.manufacturer_id += char(((mid >> 10) & 0x1f) + 'A' - 1);
-                       mon.manufacturer_id += char(((mid >> 5) & 0x1f) + 'A' - 1);
-                       mon.manufacturer_id += char(((mid >> 0) & 0x1f) + 'A' - 1);
-
-                       mon.manufacturer_product_code = (edid[11] << 8) | edid[10];
-
-                       mon.serial_number = (edid[15] << 24) | (edid[14] << 16) | (edid[13] << 8) | edid[12];
-                       mon.week_of_manufacture = edid[16];
-                       mon.year_of_manufacture = edid[17];
-                       monitors.push_back (mon);
-               }
-
-               ++card;
-       }
-
-       return monitors;
-}
-
-Monitor::Monitor ()
-       : manufacturer_product_code (0)
-       , serial_number (0)
-       , week_of_manufacture (0)
-       , year_of_manufacture (0)
-{
-
-}
-
-Monitor::Monitor (cxml::ConstNodePtr node)
-       : manufacturer_id(node->string_child("ManufacturerId"))
-       , manufacturer_product_code(node->number_child<uint32_t>("ManufacturerProductCode"))
-       , serial_number(node->number_child<uint32_t>("SerialNumber"))
-       , week_of_manufacture(node->number_child<int>("WeekOfManufacture"))
-       , year_of_manufacture(node->number_child<int>("YearOfManufacture"))
-
-{
-
-}
-
-void
-Monitor::as_xml (xmlpp::Node* parent) const
-{
-       parent->add_child("ManufacturerId")->add_child_text(manufacturer_id);
-       parent->add_child("ManufacturerProductCode")->add_child_text(dcp::raw_convert<string>(manufacturer_product_code));
-       parent->add_child("SerialNumber")->add_child_text(dcp::raw_convert<string>(serial_number));
-       parent->add_child("WeekOfManufacture")->add_child_text(dcp::raw_convert<string>(week_of_manufacture));
-       parent->add_child("YearOfManufacture")->add_child_text(dcp::raw_convert<string>(year_of_manufacture));
-}
-
-bool
-operator== (Monitor const & a, Monitor const & b)
-{
-       return a.manufacturer_id == b.manufacturer_id &&
-               a.manufacturer_product_code == b.manufacturer_product_code &&
-               a.serial_number == b.serial_number &&
-               a.week_of_manufacture == b.week_of_manufacture &&
-               a.year_of_manufacture == b.year_of_manufacture;
-}
diff --git a/src/lib/edid.h b/src/lib/edid.h
deleted file mode 100644 (file)
index e29c77c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_EDID_H
-#define DCPOMATIC_EDID_H
-
-#include <libcxml/cxml.h>
-#include <vector>
-#include <string>
-
-namespace xmlpp {
-       class Node;
-}
-
-class Monitor
-{
-public:
-       Monitor ();
-       Monitor (cxml::ConstNodePtr node);
-       void as_xml (xmlpp::Node* parent) const;
-
-       std::string manufacturer_id;
-       uint16_t manufacturer_product_code;
-       uint32_t serial_number;
-       uint8_t week_of_manufacture;
-       uint8_t year_of_manufacture;
-};
-
-bool operator== (Monitor const & a, Monitor const & b);
-
-extern std::vector<Monitor> get_monitors();
-
-#endif
index 2965111ad1aee303bc844ff16ab9027634777e79..fcd33cec194d6fae04bc4b8a43c78fa68d595924 100644 (file)
@@ -83,7 +83,6 @@ sources = """
           dkdm_recipient.cc
           dkdm_wrapper.cc
           dolby_cp750.cc
           dkdm_recipient.cc
           dkdm_wrapper.cc
           dolby_cp750.cc
-          edid.cc
           emailer.cc
           empty.cc
           encoder.cc
           emailer.cc
           empty.cc
           encoder.cc
diff --git a/src/wx/monitor_dialog.cc b/src/wx/monitor_dialog.cc
deleted file mode 100644 (file)
index 933f2f4..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "monitor_dialog.h"
-#include "wx_util.h"
-#include "lib/encode_server.h"
-#include <dcp/locale_convert.h>
-
-using std::string;
-using dcp::locale_convert;
-using std::shared_ptr;
-using boost::optional;
-
-MonitorDialog::MonitorDialog (wxWindow* parent)
-       : TableDialog (parent, _("Device"), 2, 1, true)
-{
-       add (_("Manufacturer ID"), true);
-       _manufacturer_id = add (new wxTextCtrl(this, wxID_ANY, wxT("")));
-       add (_("Manufacturer product code"), true);
-       _manufacturer_product_code = add (new wxTextCtrl(this, wxID_ANY, wxT("")));
-       add (_("Serial number"), true);
-       _serial_number = add (new wxTextCtrl(this, wxID_ANY, wxT("")));
-       add (_("Week of manufacture"), true);
-       _week_of_manufacture = add (new wxTextCtrl(this, wxID_ANY, wxT("")));
-       add (_("Year of manufacture"), true);
-       _year_of_manufacture = add (new wxTextCtrl(this, wxID_ANY, wxT("")));
-
-       layout ();
-
-       _manufacturer_id->SetFocus ();
-}
-
-void
-MonitorDialog::set (Monitor monitor)
-{
-       _manufacturer_id->SetValue (std_to_wx(monitor.manufacturer_id));
-       _manufacturer_product_code->SetValue (std_to_wx(locale_convert<string>(monitor.manufacturer_product_code)));
-       _serial_number->SetValue (std_to_wx(locale_convert<string>(monitor.serial_number)));
-       _week_of_manufacture->SetValue (std_to_wx(locale_convert<string>(monitor.week_of_manufacture)));
-       _year_of_manufacture->SetValue (std_to_wx(locale_convert<string>(monitor.year_of_manufacture)));
-}
-
-optional<Monitor>
-MonitorDialog::get () const
-{
-       Monitor m;
-       m.manufacturer_id = wx_to_std (_manufacturer_id->GetValue());
-       m.manufacturer_product_code = locale_convert<uint16_t>(wx_to_std(_manufacturer_product_code->GetValue()));
-       m.serial_number = locale_convert<uint32_t>(wx_to_std(_serial_number->GetValue()));
-       m.week_of_manufacture = locale_convert<uint8_t>(wx_to_std(_week_of_manufacture->GetValue()));
-       m.year_of_manufacture = locale_convert<uint8_t>(wx_to_std (_year_of_manufacture->GetValue()));
-       return m;
-}
diff --git a/src/wx/monitor_dialog.h b/src/wx/monitor_dialog.h
deleted file mode 100644 (file)
index 00804f4..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "table_dialog.h"
-#include "lib/edid.h"
-#include <boost/optional.hpp>
-
-class MonitorDialog : public TableDialog
-{
-public:
-       explicit MonitorDialog (wxWindow *);
-
-       void set (Monitor);
-       boost::optional<Monitor> get () const;
-
-private:
-       wxTextCtrl* _manufacturer_id;
-       wxTextCtrl* _manufacturer_product_code;
-       wxTextCtrl* _serial_number;
-       wxTextCtrl* _week_of_manufacture;
-       wxTextCtrl* _year_of_manufacture;
-};
index 3c480e37ed2b19ad58d00d1ec1e879867ffad8a7..557e6b8e71236126b71628ad8bd7ece03ff6de95 100644 (file)
@@ -33,7 +33,6 @@
 #include "email_dialog.h"
 #include "name_format_editor.h"
 #include "nag_dialog.h"
 #include "email_dialog.h"
 #include "name_format_editor.h"
 #include "nag_dialog.h"
-#include "monitor_dialog.h"
 #include "check_box.h"
 #include "static_text.h"
 #include "lib/config.h"
 #include "check_box.h"
 #include "static_text.h"
 #include "lib/config.h"
index 1d0fb0810339da93532f5250a526055e519e1f3a..b868292f583e6db60fa20eb22ed2d1c05620b433 100644 (file)
@@ -99,7 +99,6 @@ sources = """
           markers_dialog.cc
           message_dialog.cc
           metadata_dialog.cc
           markers_dialog.cc
           message_dialog.cc
           metadata_dialog.cc
-          monitor_dialog.cc
           move_to_dialog.cc
           nag_dialog.cc
           name_format_editor.cc
           move_to_dialog.cc
           nag_dialog.cc
           name_format_editor.cc