Beispiel #1
0
void
tab_input_extra::translate_ui() {
  st_cues->SetLabel(Z("Cues:"));
  cob_cues->SetToolTip(TIP("Selects for which blocks mkvmerge will produce index entries ( = cue entries). \"default\" is a good choice for almost all situations."));
  st_compression->SetLabel(Z("Compression:"));
  cob_compression->SetToolTip(TIP("Sets the compression algorithm to be used for this track. "
                                  "If no option is selected mkvmerge will decide whether or not to compress and which algorithm to use based on the track type. "
                                  "Most track types are not compressed at all. "));
  st_user_defined->SetLabel(Z("User defined options:"));
  tc_user_defined->SetToolTip(TIP("Free-form edit field for user defined options for this track. What you input here is added after all the other options "
                                  "mmg adds so that you could overwrite any of mmg's options for this track. "
                                  "All occurences of the string \"<TID>\" will be replaced by the track's track ID."));

  setup_cues();
  setup_compression();
}
Beispiel #2
0
State::State(QPointF point)
    :m_center(point), m_id(s_numberOfNodes)
{
    m_circle = DRAW_SHAPE::DASHED;
    setAcceptHoverEvents(true);
    m_color = Qt::black;
    QGraphicsItem::setZValue(1);
    m_tipStanja = TIP(0);
    instructionLab = InstructionLab::instance();
}
Beispiel #3
0
void
tab_attachments::translate_ui() {
  sb_attached_files->SetLabel(Z("Attached files"));
  b_enable_all->SetLabel(Z("enable all"));
  b_disable_all->SetLabel(Z("disable all"));
  sb_attachments->SetLabel(Z("Attachments"));
  b_add_attachment->SetLabel(Z("add"));
  b_remove_attachment->SetLabel(Z("remove"));
  st_name->SetLabel(Z("Name:"));
  tc_name->SetToolTip(TIP("This is the name that will be stored in the output file for this attachment. It defaults to the file name of the original file but can be changed."));
  st_description->SetLabel(Z("Description:"));
  st_mimetype->SetLabel(Z("MIME type:"));
  cob_mimetype->SetToolTip(TIP("MIME type for this track. Select one of the pre-defined MIME types or enter one yourself."));
  st_style->SetLabel(Z("Attachment style:"));

  int selection = cob_style->GetSelection();
  cob_style->SetString(0, Z("To all files"));
  cob_style->SetString(1, Z("Only to the first"));
  cob_style->SetToolTip(TIP("If splitting is a file can be attached either to all files created or only to the first file. Has no effect if no splitting is used."));
  cob_style->SetSelection(selection);
}
Beispiel #4
0
void ti_dump( pset_h iset, int fd )
{
   unsigned u ;

   for ( u = 0 ; u < pset_count( iset ) ; u++ )
   {
      struct time_interval *tip = TIP( pset_pointer( iset, u ) ) ;

      Sprint( fd, " %02d:%02d-%02d:%02d",
         tip->min_start / 60, tip->min_start % 60,
         tip->min_end / 60, tip->min_end % 60 ) ;
   }
}
Beispiel #5
0
/*
 * Returns TRUE if the current time is within at least one of the intervals
 */
bool_int ti_current_time_check( const pset_h intervals )
{
   time_t      current_time ;
   unsigned    u ;
   int16_t     min_current ;
   struct tm   *tmp ;

   (void) time( &current_time ) ;
   tmp = localtime( &current_time ) ;
   min_current = tmp->tm_hour * 60 + tmp->tm_min ;

   for ( u = 0 ; u < pset_count( intervals ) ; u++ )
   {
      struct time_interval *tip ;
      
      tip = TIP( pset_pointer( intervals, u ) ) ;
      if ( IN_RANGE( min_current, tip->min_start, tip->min_end ) )
         return( TRUE ) ;
   }
   return( FALSE ) ;
}
Beispiel #6
0
void
tab_input_general::translate_ui() {
  st_track_name->SetLabel(Z("Track name:"));
  tc_track_name->SetToolTip(TIP("Name for this track, e.g. \"director's comments\"."));
  st_language->SetLabel(Z("Language:"));
  cob_language->SetToolTip(TIP("Language for this track. Select one of the ISO639-2 language codes."));
  st_default->SetLabel(Z("Default track flag:"));
  cob_default->SetToolTip(TIP("Make this track the default track for its type (audio, video, subtitles). Players should prefer tracks with the default track flag set."));
  st_forced->SetLabel(Z("Forced track flag:"));
  cob_forced->SetToolTip(TIP("Mark this track as 'forced'. Players must play this track."));
  st_tags->SetLabel(Z("Tags:"));
  b_browse_tags->SetLabel(Z("Browse"));
  st_timecodes->SetLabel(Z("Timecodes:"));
  tc_timecodes->SetToolTip(TIP("mkvmerge can read and use timecodes from an external text file. This feature is a very advanced feature. Almost all users should leave this entry empty."));
  b_browse_timecodes->SetLabel(Z("Browse"));
  b_browse_timecodes->SetToolTip(TIP("mkvmerge can read and use timecodes from an external text file. This feature is a very advanced feature. "
                                     "Almost all users should leave this entry empty."));

  setup_languages();
  setup_default_track();
  setup_forced_track();
}
void
tab_input_format::translate_ui() {
  rb_aspect_ratio->SetLabel(Z("Aspect ratio:"));
  cob_aspect_ratio->SetToolTip(TIP("Sets the display aspect ratio of the track. The format can be either 'a/b' in which case both numbers must be integer "
                                   "(e.g. 16/9) or just a single floating point number 'f' (e.g. 2.35)."));
  rb_display_dimensions->SetLabel(Z("Display width/height:"));
  tc_display_width->SetToolTip(TIP("Sets the display width of the track. The height must be set as well, or this field will be ignored."));
  tc_display_height->SetToolTip(TIP("Sets the display height of the track. The width must be set as well, or this field will be ignored."));
  st_fourcc->SetLabel(Z("FourCC:"));
  cob_fourcc->SetToolTip(TIP("Forces the FourCC of the video track to this value. Note that this only works for video "
                             "tracks that use the AVI compatibility mode or for QuickTime video tracks. This option CANNOT be used to change Matroska's CodecID."));
  st_stereo_mode->SetLabel(Z("Stereoscopy:"));
  cob_stereo_mode->SetToolTip(TIP("Sets the stereo mode of the video track to this value. If left empty then the track's original stereo mode will be kept or, if "
                                  "it didn't have one, none will be set at all."));
  st_fps->SetLabel(Z("FPS:"));
  cob_fps->SetToolTip(TIP("Sets the default duration or number of frames per second for a track. This can either be a floating point number or a fraction."));
  st_nalu_size_length->SetLabel(Z("NALU size length:"));
  cob_nalu_size_length->SetToolTip(TIP("Forces the NALU size length to a certain number of bytes. This parameter is only available for AVC/h.264 elementary "
                                       "streams read from AVC/h.264 ES files, AVIs or Matroska files created with '--engage allow_avc_in_vwf_mode'. "
                                       "It defaults to 4 bytes, but there are files which do not contain a frame or slice that is bigger than 65535 bytes. "
                                       "For such files you can use this parameter and decrease the size to 2."));
  st_delay->SetLabel(Z("Delay (in ms):"));
  tc_delay->SetToolTip(TIP("Delay this track's timecodes by a couple of ms. Can be negative. Works with all track types, "
                           "but negative delays should not be used with video tracks."));
  st_stretch->SetLabel(Z("Stretch by:"));
  tc_stretch->SetToolTip(TIP("Stretch this track's timecodes. This entry can have two formats. "
                             "It is either a positive floating point number, or a fraction like e.g. 1200/1253. "
                             "Works best on video and subtitle tracks."));
  st_sub_charset->SetLabel(Z("Charset:"));
  auto tip = (boost::format("%1% %2% %3% %4%")
              % Y("Selects the character set a subtitle file or chapter information was written with.")
              % Y("Only needed in certain situations:")
              % (boost::format(Y("1. for subtitle files that do not use a byte order marker (BOM) and that are not encoded in the system's current character set (%1%);"))
                 % g_cc_local_utf8->get_charset())
              % Y("2. for files with chapter information (e.g. OGM, MP4) for which mkvmerge does not detect the encoding correctly.")
              ).str();
  cob_sub_charset->SetToolTip(format_tooltip(wxU(tip)));
  st_cropping->SetLabel(Z("Cropping:"));
  tc_cropping->SetToolTip(TIP("Sets the cropping parameters. Must be comma-separated list of four numbers for the cropping to be used at the left, top, right and bottom."));
  cb_aac_is_sbr->SetLabel(Z("AAC is SBR/HE-AAC/AAC+"));
  cb_aac_is_sbr->SetToolTip(TIP("This track contains SBR AAC/HE-AAC/AAC+ data. Only needed for AAC input files, because SBR AAC cannot be detected automatically for "
                                "these files. Not needed for AAC tracks read from MP4 or Matroska files."));

  cb_reduce_to_core->SetLabel(Z("Reduce to audio core"));
  cb_reduce_to_core->SetToolTip(TIP("Drops the lossless extensions from an audio track and keeps only its lossy core. This only works with DTS tracks."));

  cb_fix_bitstream_timing_info->SetLabel(Z("Fix bitstream timing information"));
  cb_fix_bitstream_timing_info->SetToolTip(TIP("Normally mkvmerge does not change the timing information (frame/field rate) stored in the video bitstream. "
                                               "With this option that information is adjusted to match the container timing information. "
                                               "The container timing information can come from various sources: from the command line via --default-duration, "
                                               "the source container or derived from the bitstream."));

  setup_control_contents();
}
Beispiel #8
0
optdlg_mkvmerge_tab::optdlg_mkvmerge_tab(wxWindow *parent,
                                         mmg_options_t &options)
  : optdlg_base_tab(parent, options)
{
  // Setup static variables.

  if (cob_priority_translations.entries.empty()) {
#ifdef SYS_WINDOWS
    cob_priority_translations.add(wxT("highest"), Z("highest"));
    cob_priority_translations.add(wxT("higher"),  Z("higher"));
#endif
    cob_priority_translations.add(wxT("normal"),  Z("normal"));
    cob_priority_translations.add(wxT("lower"),   Z("lower"));
    cob_priority_translations.add(wxT("lowest"),  Z("lowest"));
  }

  // Create the controls.

  wxStaticText *st_mkvmerge = new wxStaticText(this, -1, Z("mkvmerge executable"));
  tc_mkvmerge               = new wxTextCtrl(this, ID_TC_MKVMERGE, m_options.mkvmerge);
  wxButton *b_browse        = new wxButton(this, ID_B_BROWSEMKVMERGE, Z("Browse"));

  wxStaticText *st_priority = new wxStaticText(this, -1, Z("Process priority:"));
  cob_priority              = new wxMTX_COMBOBOX_TYPE(this, ID_COB_PRIORITY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN | wxCB_READONLY);

  cob_priority->SetToolTip(TIP("Sets the priority that mkvmerge will run with. "
                               "Chosing 'lowest' will cause mkvmerge to select a low I/O priority as well."));

  size_t i;
  for (i = 0; cob_priority_translations.entries.size() > i; ++i)
    cob_priority->Append(cob_priority_translations.entries[i].translated);

  // Set the defaults.

  select_priority(m_options.priority);

  // Create the layout.

  wxBoxSizer *siz_all = new wxBoxSizer(wxVERTICAL);

  siz_all->AddSpacer(5);

  siz_all->Add(new wxStaticText(this, wxID_ANY, Z("mkvmerge options")), 0, wxGROW | wxLEFT | wxRIGHT, 5);
  siz_all->AddSpacer(5);
  siz_all->Add(new wxStaticLine(this),                                  0, wxGROW | wxLEFT | wxRIGHT, 5);
  siz_all->AddSpacer(5);

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

  siz_fg->Add(st_mkvmerge, 0, wxALIGN_CENTER_VERTICAL, 0);
  siz_fg->Add(tc_mkvmerge, 1, wxGROW | wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxLEFT, 5);
  siz_fg->Add(b_browse, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);

  siz_fg->Add(st_priority, 0, wxALIGN_CENTER_VERTICAL, 0);
  siz_fg->Add(cob_priority, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);

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

  SetSizerAndFit(siz_all);
}
Beispiel #9
0
job_dialog::job_dialog(wxWindow *parent)
  : wxDialog(parent, -1, Z("Job queue management"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
  , m_geometry_saver{this, "job_dialog"} {

  wxBoxSizer *siz_all = new wxBoxSizer(wxVERTICAL);
  siz_all->Add(new wxStaticText(this, -1, Z("Current and past jobs:")), 0, wxALIGN_LEFT | wxALL, 10);
  lv_jobs = new jobdlg_list_view(this, ID_JOBS_LV_JOBS);

  wxListItem item;
  item.m_mask  = wxLIST_MASK_TEXT;
  item.m_text  = Z("ID");
  item.m_image = -1;
  lv_jobs->InsertColumn(0, item);
  item.m_text  = Z("Status");
  lv_jobs->InsertColumn(1, item);
  item.m_text  = Z("Description");
  lv_jobs->InsertColumn(2, item);
  item.m_text  = Z("Added on");
  lv_jobs->InsertColumn(3, item);
  item.m_text  = Z("Started on");
  lv_jobs->InsertColumn(4, item);
  item.m_text  = Z("Finished on");
  lv_jobs->InsertColumn(5, item);

  size_t i;
  for (i = 0; i < jobs.size(); i++)
    create_list_item(i);

  long dummy = lv_jobs->InsertItem(0, wxT("12345"));
  lv_jobs->SetItem(dummy, 1, Z("aborted"));
  lv_jobs->SetItem(dummy, 2, wxT("2004-05-06 07:08:09"));
  lv_jobs->SetItem(dummy, 3, wxT("2004-05-06 07:08:09"));
  lv_jobs->SetItem(dummy, 4, wxT("2004-05-06 07:08:09"));
  lv_jobs->SetItem(dummy, 5, wxT("2004-05-06 07:08:09"));

  for (i = 0; i < 6; i++)
    lv_jobs->SetColumnWidth(i, wxLIST_AUTOSIZE);

  lv_jobs->DeleteItem(0);

  wxBoxSizer *siz_line = new wxBoxSizer(wxHORIZONTAL);
  siz_line->Add(lv_jobs, 1, wxGROW | wxRIGHT, 10);

  wxBoxSizer *siz_b_right = new wxBoxSizer(wxVERTICAL);
  b_up = new wxButton(this, ID_JOBS_B_UP, Z("&Up"));
  b_up->SetToolTip(TIP("Move the selected jobs up"));
  siz_b_right->Add(b_up, 0, wxGROW | wxLEFT | wxBOTTOM, 10);
  b_down = new wxButton(this, ID_JOBS_B_DOWN, Z("&Down"));
  b_down->SetToolTip(TIP("Move the selected jobs down"));
  siz_b_right->Add(b_down, 0, wxGROW | wxLEFT | wxBOTTOM, 10);
  siz_b_right->AddSpacer(15);

  b_reenable = new wxButton(this, ID_JOBS_B_REENABLE, Z("&Re-enable"));
  b_reenable->SetToolTip(TIP("Re-enable the selected jobs"));
  siz_b_right->Add(b_reenable, 0, wxGROW | wxLEFT | wxBOTTOM, 10);
  b_disable = new wxButton(this, ID_JOBS_B_DISABLE, Z("&Disable"));
  b_disable->SetToolTip(TIP("Disable the selected jobs and set their status to 'done'"));
  siz_b_right->Add(b_disable, 0, wxGROW | wxLEFT | wxBOTTOM, 10);
  siz_b_right->AddSpacer(15);

  b_delete = new wxButton(this, ID_JOBS_B_DELETE, Z("D&elete"));
  b_delete->SetToolTip(TIP("Delete the selected jobs from the job queue"));
  siz_b_right->Add(b_delete, 0, wxGROW | wxLEFT | wxBOTTOM, 10);
  siz_b_right->AddSpacer(15);

  b_view_log = new wxButton(this, ID_JOBS_B_VIEW_LOG, Z("&View log"));
  b_view_log->SetToolTip(TIP("View the output that mkvmerge generated during the muxing process for the selected jobs"));
  siz_b_right->Add(b_view_log, 0, wxGROW | wxLEFT, 10);
  siz_line->Add(siz_b_right, 0, 0, 0);
  siz_all->Add(siz_line, 1, wxGROW | wxLEFT | wxRIGHT, 10);

  siz_all->Add(new wxStaticLine(this, -1), 0, wxGROW | wxALL, 10);

  wxBoxSizer *siz_b_bottom = new wxBoxSizer(wxHORIZONTAL);
  b_ok = new wxButton(this, wxID_OK, Z("&Ok"));
  b_ok->SetDefault();
  siz_b_bottom->Add(b_ok, 0, 0, 0);
  siz_b_bottom->Add(1, 0, 1, wxGROW, 0);

  b_start = new wxButton(this, ID_JOBS_B_START, Z("&Start"));
  b_start->SetToolTip(TIP("Start the jobs whose status is 'pending'"));
  siz_b_bottom->Add(b_start, 0, wxGROW | wxRIGHT, 10);
  siz_b_bottom->Add(10, 0, 0, 0, 0);
  b_start_selected = new wxButton(this, ID_JOBS_B_START_SELECTED, Z("S&tart selected"));
  b_start_selected->SetToolTip(TIP("Start the selected jobs regardless of their status"));
  siz_b_bottom->Add(b_start_selected, 0, wxGROW | wxLEFT, 10);
  siz_all->Add(siz_b_bottom, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 10);
  siz_all->SetSizeHints(this);
  SetSizerAndFit(siz_all);

  m_geometry_saver.set_default_size(800, 500, true).restore();

  enable_buttons(false);

  b_start->Enable(!jobs.empty());

  ShowModal();
}
Beispiel #10
0
job_run_dialog::job_run_dialog(wxWindow *,
                               std::vector<int> &n_jobs_to_start)
  : wxDialog(nullptr, -1, Z("mkvmerge is running"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
  , t_update(new wxTimer(this, 1))
  , out(nullptr)
  , process(nullptr)
  , abort(false)
  , jobs_to_start(n_jobs_to_start)
  , current_job(-1)
  , m_progress(0)
  , m_scanning_playlists{}
#if defined(SYS_WINDOWS)
  , m_taskbar_progress(nullptr)
#endif
  , m_geometry_saver{this, "job_run_dialog"}
{
  wxBoxSizer *siz_all      = new wxBoxSizer(wxVERTICAL);
  wxStaticBoxSizer *siz_sb = new wxStaticBoxSizer(new wxStaticBox(this, -1, Z("Status and progress")), wxVERTICAL);

  wxFlexGridSizer *siz_fg  = new wxFlexGridSizer(2, 0, 10);
  siz_fg->AddGrowableCol(1);
  st_jobs = new wxStaticText(this, -1, Z("Processing 1000/1000"));
  siz_fg->Add(st_jobs, 0, wxALIGN_CENTER_VERTICAL, 0);
  g_jobs = new wxGauge(this, -1, jobs_to_start.size() * 100);
  siz_fg->Add(g_jobs, 1, wxALIGN_CENTER_VERTICAL | wxGROW, 0);

  wxStaticText *st_remaining_time_label       = new wxStaticText(this, -1, Z("Remaining time:"));
  st_remaining_time                           = new wxStaticText(this, -1, Z("is being estimated"));
  wxStaticText *st_remaining_time_label_total = new wxStaticText(this, -1, Z("Remaining time:"));
  st_remaining_time_total                     = new wxStaticText(this, -1, Z("is being estimated"));

  siz_fg->Add(st_remaining_time_label_total, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM,          10);
  siz_fg->Add(st_remaining_time_total,       1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxGROW, 10);

  st_current = new wxStaticText(this, -1, Z("Current job ID 1000:"));
  siz_fg->Add(st_current, 0, wxALIGN_CENTER_VERTICAL, 10);
  g_progress = new wxGauge(this, -1, 100);
  siz_fg->Add(g_progress, 1, wxALIGN_CENTER_VERTICAL | wxGROW, 0);

  siz_fg->Add(st_remaining_time_label, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM,          10);
  siz_fg->Add(st_remaining_time,       1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM | wxGROW, 10);

  siz_sb->Add(siz_fg, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 10);
  siz_sb->AddSpacer(10);

  siz_sb->Add(new wxStaticText(this, -1, Z("Log output:")), wxALIGN_LEFT, wxLEFT, 10);
  siz_sb->AddSpacer(5);
  tc_log = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxSize(450, 150), wxTE_MULTILINE | wxTE_READONLY);
  siz_sb->Add(tc_log, 1, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 10);
  siz_all->Add(siz_sb, 1, wxGROW | wxALL, 10);

  cb_abort_after_current = new wxCheckBox(this, -1, Z("Abort after current job"));
  cb_abort_after_current->SetToolTip(TIP("Abort processing after the current job"));
  siz_all->Add(cb_abort_after_current, 0, wxALIGN_LEFT | wxLEFT, 10);

  b_ok = new wxButton(this, wxID_OK, Z("&Ok"));
  b_ok->Enable(false);
  b_abort = new wxButton(this, ID_JOBS_B_ABORT, Z("&Abort"));
  b_abort->SetToolTip(TIP("Abort the muxing process right now"));

  wxBoxSizer *siz_line = new wxBoxSizer(wxHORIZONTAL);
  siz_line->Add(1,       0, 1, wxGROW, 0);
  siz_line->Add(b_ok,    0, 0, 0);
  siz_line->Add(1,       0, 1, wxGROW, 0);
  siz_line->Add(b_abort, 0, 0, 0);
  siz_line->Add(1,       0, 1, wxGROW, 0);
  siz_all->Add(siz_line, 0, wxGROW | wxTOP | wxBOTTOM, 10);
  siz_all->SetSizeHints(this);

  SetSizerAndFit(siz_all);

  m_geometry_saver.set_default_size(700, 700, true).restore();

#if defined(SYS_WINDOWS)
  if (mtx::sys::get_windows_version() >= WINDOWS_VERSION_7)
    m_taskbar_progress = new taskbar_progress_c(this);
#endif

  m_start_time_total                 = mtx::sys::get_current_time_millis();
  m_next_remaining_time_update_total = m_start_time_total + 8000;

  start_next_job();

  ShowModal();
}
Beispiel #11
0
optdlg_mmg_tab::optdlg_mmg_tab(wxWindow *parent,
                               mmg_options_t &options)
  : optdlg_base_tab(parent, options)
{
  // Create the controls.
  cb_autoset_output_filename = new wxCheckBox(this, ID_CB_AUTOSET_OUTPUT_FILENAME, Z("Auto-set output filename"));
  cb_autoset_output_filename->SetToolTip(TIP("If checked mmg will automatically set the output filename "
                                             "if it hasn't been set already. This happens when you add "
                                             "the first file. If unset mmg will not touch the output filename."));

  rb_odm_input_file = new wxRadioButton(this, ID_RB_ODM_INPUT_FILE, Z("Same directory as the first input file's"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
  rb_odm_previous   = new wxRadioButton(this, ID_RB_ODM_PREVIOUS, Z("Use the previous output directory"));
  rb_odm_fixed      = new wxRadioButton(this, ID_RB_ODM_FIXED, Z("Use this directory:"));

  tc_output_directory       = new wxTextCtrl(this, ID_TC_OUTPUT_DIRECTORY, m_options.output_directory);
  b_browse_output_directory = new wxButton(this, ID_B_BROWSE_OUTPUT_DIRECTORY, Z("Browse"));

  tc_output_directory->SetToolTip(TIP("If left empty then mmg will set the output file name to be in the same directory as the first file added to this job. "
                                      "Otherwise this directory will be used."));

  cb_ask_before_overwriting = new wxCheckBox(this, ID_CB_ASK_BEFORE_OVERWRITING, Z("Ask before overwriting things (files, jobs)"));
  cb_ask_before_overwriting->SetToolTip(TIP("If checked mmg will ask for "
                                            "confirmation before overwriting "
                                            "existing files, or before adding "
                                            "a new job if there's an old job "
                                            "whose description matches the "
                                            "new one."));

  cb_set_delay_from_filename = new wxCheckBox(this, ID_CB_SET_DELAY_FROM_FILENAME, Z("Set the delay input field from the file name"));
  cb_set_delay_from_filename->SetToolTip(TIP("When a file is added its name is scanned. If it contains "
                                             "the word 'DELAY' followed by a number then this number "
                                             "is automatically put into the 'delay' input field for "
                                             "any audio track found in the file."));

  cb_filenew_after_add_to_jobqueue = new wxCheckBox(this, ID_CB_NEW_AFTER_ADD_TO_JOBQUEUE, Z("Clear inputs after adding a job to the job queue"));

  cb_filenew_after_successful_mux  = new wxCheckBox(this, ID_CB_NEW_AFTER_SUCCESSFUL_MUX, Z("Clear inputs after a successful muxing run"));

  cb_on_top = new wxCheckBox(this, ID_CB_ON_TOP, Z("Always on top"));

  cb_warn_usage = new wxCheckBox(this, ID_CB_WARN_USAGE, Z("Warn about possible incorrect usage of mmg"));
  cb_warn_usage->SetToolTip(TIP("If checked mmg will warn if it thinks that "
                                "you're using it incorrectly. Such warnings "
                                "are shown at least once even if you turn "
                                "this feature off."));

  cb_disable_header_removal_compression = new wxCheckBox(this, ID_CB_DISABLE_HRC, Z("Disable header removal compression for audio and video tracks by default"));
  cb_disable_header_removal_compression->SetToolTip(TIP("If checked mmg will set the 'compression' drop down box to 'none' for all audio and video tracks by default. "
                                                        "The user can still change the compression setting afterwards."));

#if defined(HAVE_CURL_EASY_H)
  cb_check_for_updates = new wxCheckBox(this, ID_CB_CHECK_FOR_UPDATES, Z("Check online for the latest release"));
  cb_check_for_updates->SetToolTip(TIP("Check online whether or not a new release of MKVToolNix is available on the home page. "
                                       "Will only check when mmg starts and at most once a day. "
                                       "No information is transmitted to the server."));
#endif  // defined(HAVE_CURL_EASY_H)

  cb_gui_debugging = new wxCheckBox(this, ID_CB_GUI_DEBUGGING, Z("Show mmg's debug window"));
  cb_gui_debugging->SetToolTip(TIP("Shows mmg's debug window in which debug messages will appear. "
                                   "This is only useful if you're helping the author debug a problem in mmg."));

#if defined(HAVE_LIBINTL_H)
  wxStaticText *st_ui_language = new wxStaticText(this, -1, Z("Interface language:"));
  cob_ui_language = new wxMTX_COMBOBOX_TYPE(this, ID_COB_UI_LANGUAGE,  wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN | wxCB_READONLY);

  std::vector<translation_c>::iterator translation = translation_c::ms_available_translations.begin();
  wxString select_locale;
  std::vector<locale_sorter_t> sorted_entries;
  while (translation != translation_c::ms_available_translations.end()) {
    wxString curr_entry = wxU(boost::format("%1% (%2%)") % translation->m_translated_name % translation->m_english_name);
    sorted_entries.push_back(locale_sorter_t(curr_entry, translation->get_locale()));

    if (   (select_locale.IsEmpty() && (translation->m_english_name == "English"))
        || ba::iequals(app->m_ui_locale, translation->get_locale()))
      select_locale = curr_entry;

    ++translation;
  }

  wxLogMessage(wxT("Locale selection logic: select_locale %s uu_locale_lower %s translation_c::get_default_ui_locale() %s app->m_ui_locale %s"),
               select_locale.c_str(), wxUCS(app->m_ui_locale), wxUCS(translation_c::get_default_ui_locale()), wxUCS(app->m_ui_locale));

  std::sort(sorted_entries.begin(), sorted_entries.end());

  std::vector<locale_sorter_t>::iterator locale_entry = sorted_entries.begin();
  while (locale_entry != sorted_entries.end()) {
    cob_ui_language->Append(locale_entry->display_val);
    m_sorted_locales.push_back(locale_entry->locale);
    ++locale_entry;
  }
#endif  // HAVE_LIBINTL_H

  // Set the defaults.

  cb_autoset_output_filename->SetValue(m_options.autoset_output_filename);
  cb_ask_before_overwriting->SetValue(m_options.ask_before_overwriting);
  cb_on_top->SetValue(m_options.on_top);
  cb_filenew_after_add_to_jobqueue->SetValue(m_options.filenew_after_add_to_jobqueue);
  cb_filenew_after_successful_mux->SetValue(m_options.filenew_after_successful_mux);
  cb_warn_usage->SetValue(m_options.warn_usage);
  cb_gui_debugging->SetValue(m_options.gui_debugging);
  cb_set_delay_from_filename->SetValue(m_options.set_delay_from_filename);
  cb_disable_header_removal_compression->SetValue(m_options.disable_a_v_compression);

  rb_odm_input_file->SetValue(m_options.output_directory_mode == ODM_FROM_FIRST_INPUT_FILE);
  rb_odm_previous->SetValue(m_options.output_directory_mode == ODM_PREVIOUS);
  rb_odm_fixed->SetValue(m_options.output_directory_mode == ODM_FIXED);

#if defined(HAVE_LIBINTL_H)
  set_combobox_selection(cob_ui_language, select_locale);
#endif  // HAVE_LIBINTL_H

#if defined(HAVE_CURL_EASY_H)
  cb_check_for_updates->SetValue(m_options.check_for_updates);
#endif  // defined(HAVE_CURL_EASY_H)

  enable_output_filename_controls(m_options.autoset_output_filename);

  // Create the layout.

  wxBoxSizer *siz_all = new wxBoxSizer(wxVERTICAL);
  siz_all->AddSpacer(5);

  siz_all->Add(new wxStaticText(this, wxID_ANY, Z("mmg options")), 0, wxGROW | wxLEFT | wxRIGHT, 5);
  siz_all->AddSpacer(5);
  siz_all->Add(new wxStaticLine(this),                             0, wxGROW | wxLEFT | wxRIGHT, 5);
  siz_all->AddSpacer(5);

  wxBoxSizer *siz_line;
#if defined(HAVE_LIBINTL_H)
  siz_line = new wxBoxSizer(wxHORIZONTAL);
  siz_line->Add(st_ui_language, 0, wxALIGN_CENTER_VERTICAL);
  siz_line->Add(cob_ui_language, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);

  siz_all->Add(siz_line, 0, wxGROW | wxLEFT, 5);
  siz_all->AddSpacer(5);
#endif  // HAVE_LIBINTL_H

  siz_all->Add(cb_autoset_output_filename, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

#if defined(SYS_WINDOWS)
  int left_offset = 16;
#else
  int left_offset = 24;
#endif

  siz_all->Add(rb_odm_input_file, 0, wxLEFT, left_offset);
  siz_all->AddSpacer(5);

  siz_all->Add(rb_odm_previous, 0, wxLEFT, left_offset);
  siz_all->AddSpacer(5);

  siz_line = new wxBoxSizer(wxHORIZONTAL);
  siz_line->Add(rb_odm_fixed, 0, wxALIGN_CENTER_VERTICAL, 0);
  siz_line->Add(tc_output_directory, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);
  siz_line->Add(b_browse_output_directory, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);

  siz_all->Add(siz_line, 0, wxGROW | wxLEFT, left_offset);
  siz_all->AddSpacer(5);

  siz_all->Add(cb_ask_before_overwriting, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

  siz_all->Add(cb_set_delay_from_filename, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

  siz_all->Add(cb_filenew_after_add_to_jobqueue, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

  siz_all->Add(cb_filenew_after_successful_mux, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

#if defined(SYS_WINDOWS)
  siz_all->Add(cb_on_top, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);
#else
  cb_on_top->Show(false);
#endif

  siz_all->Add(cb_warn_usage, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

  siz_all->Add(cb_disable_header_removal_compression, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

#if defined(HAVE_CURL_EASY_H)
  siz_all->Add(cb_check_for_updates, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);
#endif  // defined(HAVE_CURL_EASY_H)

  siz_all->Add(cb_gui_debugging, 0, wxLEFT, 5);
  siz_all->AddSpacer(5);

  SetSizer(siz_all);
}