Update .po files.
[dcpomatic.git] / src / lib / config.cc
index a72e1a9e43fa9c91bd9fb6919c542e357ca04450..79a7b01f1dd68f4aebf39cb07e5797533926abfa 100644 (file)
@@ -52,12 +52,15 @@ Config* Config::_instance = 0;
 Config::Config ()
        : _num_local_encoding_threads (max (2U, boost::thread::hardware_concurrency()))
        , _server_port (6192)
-       , _tms_path (N_("."))
+       , _tms_path (".")
        , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750")))
        , _default_still_length (10)
        , _default_container (Ratio::from_id ("185"))
        , _default_dcp_content_type (DCPContentType::from_dci_name ("TST"))
        , _default_j2k_bandwidth (200000000)
+       , _kdm_email (
+               "Dear Projectionist\n\nPlease find attached KDMs for $CPL_NAME.\n\nBest regards,\nDCP-o-matic"
+               )
 {
        _allowed_dcp_frame_rates.push_back (24);
        _allowed_dcp_frame_rates.push_back (25);
@@ -132,14 +135,23 @@ Config::read ()
 
        list<shared_ptr<cxml::Node> > cin = f.node_children ("Cinema");
        for (list<shared_ptr<cxml::Node> >::iterator i = cin.begin(); i != cin.end(); ++i) {
-               _cinemas.push_back (shared_ptr<Cinema> (new Cinema (*i)));
+               /* Slightly grotty two-part construction of Cinema here so that we can use
+                  shared_from_this.
+               */
+               shared_ptr<Cinema> cinema (new Cinema (*i));
+               cinema->read_screens (*i);
+               _cinemas.push_back (cinema);
        }
+
+       _mail_server = f.string_child ("MailServer");
+       _kdm_from = f.string_child ("KDMFrom");
+       _kdm_email = f.string_child ("KDMEmail");
 }
 
 void
 Config::read_old_metadata ()
 {
-       ifstream f (file(true).c_str ());
+       ifstream f (file(true).string().c_str ());
        string line;
 
        while (getline (f, line)) {
@@ -209,7 +221,8 @@ Config::file (bool old) const
        if (old) {
                p /= ".dvdomatic";
        } else {
-               p /= "dcpomatic.xml";
+               p /= "dcpomatic";
+               p /= "config.xml";
        }
        return p;
 }
@@ -219,7 +232,7 @@ Config::signer_chain_directory () const
 {
        boost::filesystem::path p;
        p /= g_get_user_config_dir ();
-       p /= "dvdomatic";
+       p /= "dcpomatic";
        p /= "crypt";
        boost::filesystem::create_directories (p);
        return p;
@@ -290,6 +303,10 @@ Config::write () const
                (*i)->as_xml (root->add_child ("Cinema"));
        }
 
+       root->add_child("MailServer")->add_child_text (_mail_server);
+       root->add_child("KDMFrom")->add_child_text (_kdm_from);
+       root->add_child("KDMEmail")->add_child_text (_kdm_email);
+
        doc.write_to_file_formatted (file(false).string ());
 }