/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "wx_util.h"
#include "isdcf_metadata_dialog.h"
#include "lib/ratio.h"
-#include "lib/scaler.h"
#include "lib/config.h"
#include "lib/dcp_content_type.h"
#include "lib/util.h"
return;
}
- _film->set_audio_channels (_audio_channels->GetValue ());
+ _film->set_audio_channels ((_audio_channels->GetSelection () + 1) * 2);
}
void
checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
setup_dcp_name ();
break;
- case Film::SCALER:
- checked_set (_scaler, Scaler::as_index (_film->scaler ()));
- break;
case Film::BURN_SUBTITLES:
checked_set (_burn_subtitles, _film->burn_subtitles ());
break;
break;
}
case Film::AUDIO_CHANNELS:
- checked_set (_audio_channels, _film->audio_channels ());
+ checked_set (_audio_channels, (_film->audio_channels () / 2) - 1);
setup_dcp_name ();
break;
case Film::THREE_D:
int const n = _container->GetSelection ();
if (n >= 0) {
vector<Ratio const *> ratios = Ratio::all ();
- assert (n < int (ratios.size()));
+ DCPOMATIC_ASSERT (n < int (ratios.size()));
_film->set_container (ratios[n]);
}
}
film_changed (Film::DCP_CONTENT_TYPE);
film_changed (Film::CONTAINER);
film_changed (Film::RESOLUTION);
- film_changed (Film::SCALER);
film_changed (Film::SIGNED);
film_changed (Film::BURN_SUBTITLES);
film_changed (Film::ENCRYPTED);
_use_isdcf_name->Enable (s);
_edit_isdcf_button->Enable (s);
_dcp_content_type->Enable (s);
+ _copy_isdcf_name_button->Enable (s);
bool si = s;
if (_film && _film->encrypted ()) {
_container->Enable (s);
_best_frame_rate->Enable (s && _film && _film->best_video_frame_rate () != _film->video_frame_rate ());
_resolution->Enable (s);
- _scaler->Enable (s);
_three_d->Enable (s);
_standard->Enable (s);
}
-/** Called when the scaler widget has been changed */
-void
-DCPPanel::scaler_changed ()
-{
- if (!_film) {
- return;
- }
-
- int const n = _scaler->GetSelection ();
- if (n >= 0) {
- _film->set_scaler (Scaler::from_index (n));
- }
-}
-
void
DCPPanel::use_isdcf_name_toggled ()
{
}
++r;
- add_label_to_grid_bag_sizer (grid, panel, _("Scaler"), true, wxGBPosition (r, 0));
- _scaler = new wxChoice (panel, wxID_ANY);
- grid->Add (_scaler, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
- ++r;
-
_container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::container_changed, this));
- _scaler->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::scaler_changed, this));
_frame_rate_choice->Bind(wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::frame_rate_choice_changed, this));
_frame_rate_spin->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::frame_rate_spin_changed, this));
_best_frame_rate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::best_frame_rate_clicked, this));
_burn_subtitles->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::burn_subtitles_toggled, this));
_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
+ /* Also listen to wxEVT_COMMAND_TEXT_UPDATED so that typing numbers directly in is always noticed */
+ _j2k_bandwidth->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
_resolution->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::resolution_changed, this));
_three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::three_d_changed, this));
- vector<Scaler const *> const sc = Scaler::all ();
- for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
- _scaler->Append (std_to_wx ((*i)->name()));
- }
-
vector<Ratio const *> const ratio = Ratio::all ();
for (vector<Ratio const *>::const_iterator i = ratio.begin(); i != ratio.end(); ++i) {
_container->Append (std_to_wx ((*i)->nickname ()));
int r = 0;
add_label_to_grid_bag_sizer (grid, panel, _("Channels"), true, wxGBPosition (r, 0));
- _audio_channels = new wxSpinCtrl (panel, wxID_ANY);
+ _audio_channels = new wxChoice (panel, wxID_ANY);
+ for (int i = 2; i <= 16; i += 2) {
+ _audio_channels->Append (wxString::Format ("%d", i));
+ }
grid->Add (_audio_channels, wxGBPosition (r, 1));
++r;
- _audio_channels->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::audio_channels_changed, this));
-
- _audio_channels->SetRange (0, MAX_DCP_AUDIO_CHANNELS);
+ _audio_channels->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::audio_channels_changed, this));
return panel;
}