#include "filter_dialog.h"
#include "server_dialog.h"
#include "dir_picker_ctrl.h"
+#include "dci_metadata_dialog.h"
using namespace std;
using boost::bind;
ConfigDialog::ConfigDialog (wxWindow* parent)
- : wxDialog (parent, wxID_ANY, _("DVD-o-matic Configuration"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+ : wxDialog (parent, wxID_ANY, _("DVD-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
table->AddGrowableCol (1, 1);
table->Add (_default_directory, 1, wxEXPAND);
table->AddSpacer (0);
- add_label_to_sizer (table, this, "Colour look-up table");
- _colour_lut = new wxComboBox (this, wxID_ANY);
- for (int i = 0; i < 2; ++i) {
- _colour_lut->Append (std_to_wx (colour_lut_index_to_name (i)));
- }
- _colour_lut->SetSelection (0);
- table->Add (_colour_lut, 1, wxEXPAND);
- table->AddSpacer (0);
-
- add_label_to_sizer (table, this, "JPEG2000 bandwidth");
- _j2k_bandwidth = new wxSpinCtrl (this, wxID_ANY);
- table->Add (_j2k_bandwidth, 1, wxEXPAND);
- add_label_to_sizer (table, this, "MBps");
+ add_label_to_sizer (table, this, "Default DCI name details");
+ _default_dci_metadata_button = new wxButton (this, wxID_ANY, _("Edit..."));
+ table->Add (_default_dci_metadata_button);
+ table->AddSpacer (1);
add_label_to_sizer (table, this, "Reference scaler for A/B");
_reference_scaler = new wxComboBox (this, wxID_ANY);
_default_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()))));
_default_directory->Connect (wxID_ANY, wxEVT_COMMAND_DIRPICKER_CHANGED, wxCommandEventHandler (ConfigDialog::default_directory_changed), 0, this);
- _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::colour_lut_changed), 0, this);
-
- _j2k_bandwidth->SetRange (50, 250);
- _j2k_bandwidth->SetValue (rint ((double) config->j2k_bandwidth() / 1e6));
- _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::j2k_bandwidth_changed), 0, this);
+ _default_dci_metadata_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ConfigDialog::edit_default_dci_metadata_clicked), 0, this);
_reference_scaler->SetSelection (Scaler::as_index (config->reference_scaler ()));
_reference_scaler->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::reference_scaler_changed), 0, this);
Config::instance()->set_default_directory (wx_to_std (_default_directory->GetPath ()));
}
-void
-ConfigDialog::colour_lut_changed (wxCommandEvent &)
-{
- Config::instance()->set_colour_lut_index (_colour_lut->GetSelection ());
-}
-
-void
-ConfigDialog::j2k_bandwidth_changed (wxCommandEvent &)
-{
- Config::instance()->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
-}
-
void
ConfigDialog::add_server_to_control (ServerDescription* s)
{
}
void
-ConfigDialog::server_selection_changed (wxListEvent& ev)
+ConfigDialog::server_selection_changed (wxListEvent &)
{
int const i = _servers->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
_edit_server->Enable (i >= 0);
pair<string, string> p = Filter::ffmpeg_strings (Config::instance()->reference_filters ());
_reference_filters->SetLabel (std_to_wx (p.first + " " + p.second));
}
+
+void
+ConfigDialog::edit_default_dci_metadata_clicked (wxCommandEvent &)
+{
+ DCIMetadataDialog* d = new DCIMetadataDialog (this, Config::instance()->default_dci_metadata ());
+ d->ShowModal ();
+ Config::instance()->set_default_dci_metadata (d->dci_metadata ());
+ d->Destroy ();
+}