Beispiel #1
0
void
tab_input_general::setup_forced_track() {
  cob_forced_translations.clear();
  cob_forced_translations.add(wxT("no"),  Z("no"));
  cob_forced_translations.add(wxT("yes"), Z("yes"));

  if (!cob_forced->GetCount()) {
    auto entries = wxArrayString{};
    entries.Alloc(cob_default_translations.entries.size());
    for (auto idx = cob_forced_translations.entries.size(); 0 < idx; --idx)
      entries.Add(wxEmptyString);
    append_combobox_items(cob_forced, entries);
  }

  auto selection = cob_forced->GetSelection();
  auto idx       = 0;
  for (auto const &entry : cob_forced_translations.entries)
    cob_forced->SetString(idx++, entry.translated);
  cob_forced->SetSelection(selection);
}
Beispiel #2
0
void
tab_input_extra::setup_compression() {
  int selection = cob_compression->GetSelection();

  auto entries  = wxArrayString{};
  entries.Alloc(3);
  entries.Add(wxEmptyString);
  entries.Add(wxEmptyString);
  entries.Add(wxT("zlib"));

  cob_compression->Clear();
  append_combobox_items(cob_compression, entries);

  cob_compression_translations.clear();
  cob_compression_translations.add(wxT("none"), Z("none"));

  selection = cob_compression->GetSelection();
  cob_compression->SetString(1, Z("none"));

  cob_compression->SetSelection((0 > selection) || (cob_compression->GetCount() >= static_cast<unsigned int>(selection)) ? 0 : selection);
}
Beispiel #3
0
void
tab_input_extra::setup_cues() {
  cob_cues_translations.clear();
  cob_cues_translations.add(wxT("default"),           Z("default"));
  cob_cues_translations.add(wxT("only for I frames"), Z("only for I frames"));
  cob_cues_translations.add(wxT("for all frames"),    Z("for all frames"));
  cob_cues_translations.add(wxT("none"),              Z("none"));

  if (!cob_cues->GetCount()) {
    auto entries = wxArrayString{};
    entries.Alloc(cob_cues_translations.entries.size());
    for (auto const &entry : cob_cues_translations.entries)
      entries.Add(entry.translated);
    append_combobox_items(cob_cues, entries);

  } else {
    auto selection = cob_cues->GetSelection();
    auto idx       = 0;
    for (auto const &entry : cob_cues_translations.entries)
      cob_cues->SetString(idx++, entry.translated);
    cob_cues->SetSelection(selection);
  }
}
Beispiel #4
0
void
tab_input_general::setup_languages() {
  size_t i;

  sorted_iso_codes.Clear();
  sorted_iso_codes.Add(Z("und (Undetermined)"));
  sorted_iso_codes.Add(Z("---common---"));

  std::map<wxString, bool> is_popular;
  for (i = 0; i < mdlg->options.popular_languages.Count(); ++i)
    is_popular[ mdlg->options.popular_languages[i] ] = true;

  for (auto &lang : iso639_languages) {
    wxString code = wxU(lang.iso639_2_code);
    if (!is_popular[code])
      continue;

    sorted_iso_codes.Add(wxString::Format(wxT("%s (%s)"), code.c_str(), wxUCS(lang.english_name)));
    is_popular[code] = false;
  }

  sorted_iso_codes.Add(Z("---all---"));

  wxArrayString temp;
  for (auto &lang : iso639_languages)
    temp.Add(wxString::Format(wxT("%s (%s)"), wxUCS(lang.iso639_2_code), wxUCS(lang.english_name)));
  temp.Sort();

  for (i = 0; temp.Count() > i; ++i)
    if ((0 == i) || (temp[i - 1].Lower() != temp[i].Lower()))
      sorted_iso_codes.Add(temp[i]);

  size_t selection = cob_language->GetSelection();
  cob_language->Clear();
  append_combobox_items(cob_language, sorted_iso_codes);
  cob_language->SetSelection(selection);
}
tab_input_format::tab_input_format(wxWindow *parent,
                                   tab_input *ti)
  : wxPanel(parent, -1, wxDefaultPosition, wxSize(100, 400), wxTAB_TRAVERSAL)
  , input(ti) {

  wxFlexGridSizer *siz_fg;
  wxBoxSizer *siz_all, *siz_line;

  siz_all = new wxBoxSizer(wxVERTICAL);
  siz_all->AddSpacer(TOPBOTTOMSPACING);

  siz_fg = new wxFlexGridSizer(4);
  siz_fg->AddGrowableCol(1);
  siz_fg->AddGrowableCol(3);

  rb_aspect_ratio = new wxRadioButton(this, ID_RB_ASPECTRATIO, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
  rb_aspect_ratio->SetValue(true);
  siz_fg->Add(rb_aspect_ratio, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  cob_aspect_ratio = new wxMTX_COMBOBOX_TYPE(this, ID_CB_ASPECTRATIO, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN);
  append_combobox_items(cob_aspect_ratio, wxArrayString{8, predefined_aspect_ratios});
  cob_aspect_ratio->SetSizeHints(0, -1);
  siz_fg->Add(cob_aspect_ratio, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  rb_display_dimensions = new wxRadioButton(this, ID_RB_DISPLAYDIMENSIONS, wxEmptyString);
  rb_display_dimensions->SetValue(false);
  siz_fg->Add(rb_display_dimensions, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  siz_line = new wxBoxSizer(wxHORIZONTAL);
  tc_display_width = new wxTextCtrl(this, ID_TC_DISPLAYWIDTH, wxEmptyString);
  tc_display_width->SetSizeHints(0, -1);
  siz_line->Add(tc_display_width, 1, wxGROW | wxALL, STDSPACING);

  st_x = new wxStaticText(this, wxID_STATIC, wxT("x"));
  st_x->Enable(false);
  siz_line->Add(st_x, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  tc_display_height = new wxTextCtrl(this, ID_TC_DISPLAYHEIGHT, wxEmptyString);
  tc_display_height->SetSizeHints(0, -1);
  siz_line->Add(tc_display_height, 1, wxGROW | wxALL, STDSPACING);
  siz_fg->Add(siz_line, 1, wxGROW, 0);

  st_fourcc = new wxStaticText(this, -1, wxEmptyString);
  st_fourcc->Enable(false);
  siz_fg->Add(st_fourcc, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  cob_fourcc = new wxMTX_COMBOBOX_TYPE(this, ID_CB_FOURCC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN);
  cob_fourcc->SetSizeHints(0, -1);
  siz_fg->Add(cob_fourcc, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_stereo_mode = new wxStaticText(this, -1, wxEmptyString);
  st_stereo_mode->Enable(false);
  siz_fg->Add(st_stereo_mode, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  cob_stereo_mode = new wxMTX_COMBOBOX_TYPE(this, ID_CB_STEREO_MODE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
  cob_stereo_mode->SetSizeHints(0, -1);
  siz_fg->Add(cob_stereo_mode, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_fps = new wxStaticText(this, -1, wxEmptyString);
  st_fps->Enable(false);
  siz_fg->Add(st_fps, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  cob_fps = new wxMTX_COMBOBOX_TYPE(this, ID_CB_FPS, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN);
  cob_fps->SetSizeHints(0, -1);
  siz_fg->Add(cob_fps, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_nalu_size_length = new wxStaticText(this, -1, wxEmptyString);
  st_nalu_size_length->Enable(false);
  siz_fg->Add(st_nalu_size_length, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  cob_nalu_size_length = new wxMTX_COMBOBOX_TYPE(this, ID_CB_NALU_SIZE_LENGTH, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
  cob_nalu_size_length->SetSizeHints(0, -1);
  siz_fg->Add(cob_nalu_size_length, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_delay = new wxStaticText(this, wxID_STATIC, wxEmptyString);
  st_delay->Enable(false);
  siz_fg->Add(st_delay, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  tc_delay = new wxTextCtrl(this, ID_TC_DELAY, wxEmptyString);
  tc_delay->SetSizeHints(0, -1);
  siz_fg->Add(tc_delay, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_stretch = new wxStaticText(this, wxID_STATIC, wxEmptyString);
  st_stretch->Enable(false);
  siz_fg->Add(st_stretch, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  tc_stretch = new wxTextCtrl(this, ID_TC_STRETCH, wxEmptyString);
  tc_stretch->SetSizeHints(0, -1);
  siz_fg->Add(tc_stretch, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_sub_charset = new wxStaticText(this, wxID_STATIC, wxEmptyString);
  st_sub_charset->Enable(false);
  siz_fg->Add(st_sub_charset, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  cob_sub_charset = new wxMTX_COMBOBOX_TYPE(this, ID_CB_SUBTITLECHARSET, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN | wxCB_READONLY);
  cob_sub_charset->SetSizeHints(0, -1);
  siz_fg->Add(cob_sub_charset, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  st_cropping = new wxStaticText(this, -1, wxEmptyString);
  st_cropping->Enable(false);
  siz_fg->Add(st_cropping, 0, wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  tc_cropping = new wxTextCtrl(this, ID_TC_CROPPING, wxEmptyString);
  tc_cropping->SetSizeHints(0, -1);
  siz_fg->Add(tc_cropping, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, STDSPACING);

  siz_all->Add(siz_fg, 0, wxGROW | wxLEFT | wxRIGHT, LEFTRIGHTSPACING);

  cb_aac_is_sbr = new wxCheckBox(this, ID_CB_AACISSBR, wxEmptyString);
  cb_aac_is_sbr->SetValue(false);

  cb_reduce_to_core = new wxCheckBox(this, ID_CB_REDUCE_TO_CORE, wxEmptyString);
  cb_reduce_to_core->SetValue(false);

  cb_fix_bitstream_timing_info = new wxCheckBox(this, ID_CB_FIX_BITSTREAM_TIMING_INFO, wxEmptyString);
  cb_fix_bitstream_timing_info->SetValue(false);

  siz_line = new wxBoxSizer(wxHORIZONTAL);
  siz_line->Add(cb_aac_is_sbr, 0, wxALL, STDSPACING);
  siz_line->Add(cb_reduce_to_core, 0, wxALL, STDSPACING);
  siz_line->Add(cb_fix_bitstream_timing_info, 0, wxALL, STDSPACING);
  siz_all->Add(siz_line, 0, wxLEFT | wxRIGHT, LEFTRIGHTSPACING);

  siz_all->AddSpacer(TOPBOTTOMSPACING);

  SetSizerAndFit(siz_all);
}
void
tab_input_format::setup_control_contents() {
  size_t i;
  int selection;
  if (!cob_fourcc->GetCount())
    append_combobox_items(cob_fourcc, wxArrayString{6, predefined_fourccs});

  auto num_stereo_modes = stereo_mode_c::max_index() + 1;
  if (!cob_stereo_mode->GetCount()) {
    auto entries = wxArrayString{};
    entries.Alloc(num_stereo_modes);
    for (i = 0; num_stereo_modes >= i; ++i)
      entries.Add(wxEmptyString);
    append_combobox_items(cob_stereo_mode, entries);
  }

  selection = cob_stereo_mode->GetSelection();
  for (i = 0; num_stereo_modes > i; ++i)
    cob_stereo_mode->SetString(i + 1, wxString::Format(wxT("%s (%u; %s)"), wxU(stereo_mode_c::translate(i)).c_str(), static_cast<unsigned int>(i), wxU(stereo_mode_c::s_modes[i]).c_str()));
  cob_stereo_mode->SetSelection(selection);

  if (!cob_fps->GetCount()) {
    auto entries = wxArrayString{};
    entries.Alloc(12);
    entries.Add(wxEmptyString);
    entries.Add(wxT("24p"));
    entries.Add(wxT("25p"));
    entries.Add(wxT("30p"));
    entries.Add(wxT("50i"));
    entries.Add(wxT("50p"));
    entries.Add(wxT("60i"));
    entries.Add(wxT("60p"));
    entries.Add(wxT("24000/1001p"));
    entries.Add(wxT("30000/1001p"));
    entries.Add(wxT("60000/1001i"));
    entries.Add(wxT("60000/1001p"));
    append_combobox_items(cob_fps, entries);
  }

  if (0 == cob_nalu_size_length->GetCount()) {
    auto entries = wxArrayString{};
    entries.Alloc(3);
    for (i = 0; 3 > i; ++i)
      entries.Add(wxEmptyString);
    append_combobox_items(cob_nalu_size_length, entries);
  }

  selection = cob_nalu_size_length->GetSelection();
  cob_nalu_size_length->SetString(0, Z("Default"));
  cob_nalu_size_length->SetString(1, Z("2 bytes"));
  cob_nalu_size_length->SetString(2, Z("4 bytes"));
  cob_nalu_size_length->SetSelection(selection);

  if (!sorted_charsets.Count())
    for (auto const &sub_charset : sub_charsets)
      sorted_charsets.Add(wxU(sub_charset));

  if (0 == cob_sub_charset->GetCount()) {
    cob_sub_charset->Append(wxEmptyString);
    append_combobox_items(cob_sub_charset, sorted_charsets);
  }

  cob_sub_charset_translations.clear();
  cob_sub_charset_translations.add(wxT("default"), Z("Default"));

  selection = cob_sub_charset->GetSelection();
  cob_sub_charset->SetString(0, cob_sub_charset_translations.entries[0].translated);
  cob_sub_charset->SetSelection(selection);
}