void header_editor_frame_c::clear_pages() { m_ignore_tree_selection_changes = true; for (size_t i = 0; m_pages.size() > i; ++i) if (m_pages[i]->IsShown()) m_pages[i]->Hide(); m_bs_page->Clear(); m_bs_main->Hide(m_tc_tree); m_tc_tree->DeleteChildren(m_root_id); m_pages.clear(); m_top_level_pages.clear(); he_empty_page_c *page = new he_empty_page_c(this, YT("No file loaded"), YT("No file has been loaded yet. You can open a file by selecting\n'Open' from the 'File' menu.")); append_page(page); m_tc_tree->SelectItem(page->m_page_id); m_bs_main->Show(m_tc_tree); m_bs_main->Layout(); m_ignore_tree_selection_changes = false; }
void header_editor_frame_c::handle_segment_info(kax_analyzer_data_c *data) { m_e_segment_info = m_analyzer->read_element(data); if (!m_e_segment_info) return; he_top_level_page_c *page = new he_top_level_page_c(this, YT("Segment information"), m_e_segment_info); page->init(); KaxInfo *info = static_cast<KaxInfo *>(m_e_segment_info.get()); he_value_page_c *child_page; child_page = new he_string_value_page_c(this, page, info, KaxTitle::ClassInfos, YT("Title"), YT("The title for the whole movie.")); child_page->init(); child_page = new he_string_value_page_c(this, page, info, KaxSegmentFilename::ClassInfos, YT("Segment filename"), YT("The file name for this segment.")); child_page->init(); child_page = new he_string_value_page_c(this, page, info, KaxPrevFilename::ClassInfos, YT("Previous filename"), YT("An escaped filename corresponding to\nthe previous segment.")); child_page->init(); child_page = new he_string_value_page_c(this, page, info, KaxNextFilename::ClassInfos, YT("Next filename"), YT("An escaped filename corresponding to\nthe next segment.")); child_page->init(); child_page = new he_bit_value_page_c(this, page, info, KaxSegmentUID::ClassInfos, YT("Segment unique ID"), YT("A randomly generated unique ID to identify the current\nsegment between many others (128 bits)."), 128); child_page->init(); child_page = new he_bit_value_page_c(this, page, info, KaxPrevUID::ClassInfos, YT("Previous segment's unique ID"), YT("A unique ID to identify the previous chained\nsegment (128 bits)."), 128); child_page->init(); child_page = new he_bit_value_page_c(this, page, info, KaxNextUID::ClassInfos, YT("Next segment's unique ID"), YT("A unique ID to identify the next chained\nsegment (128 bits)."), 128); child_page->init(); // m_tc_tree->ExpandAllChildren(page->m_page_id); }
void header_editor_frame_c::handle_tracks(kax_analyzer_data_c *data) { m_e_tracks = m_analyzer->read_element(data); if (!m_e_tracks) return; KaxTracks *kax_tracks = static_cast<KaxTracks *>(m_e_tracks.get_object()); int track_type = -1; size_t i; for (i = 0; kax_tracks->ListSize() > i; ++i) { KaxTrackEntry *k_track_entry = dynamic_cast<KaxTrackEntry *>((*kax_tracks)[i]); if (NULL == k_track_entry) continue; KaxTrackType *k_track_type = dynamic_cast<KaxTrackType *>(FINDFIRST(k_track_entry, KaxTrackType)); if (NULL == k_track_type) continue; unsigned int track_number = 0; KaxTrackNumber *k_track_number = dynamic_cast<KaxTrackNumber *>(FINDFIRST(k_track_entry, KaxTrackNumber)); if (NULL != k_track_number) track_number = uint64(*k_track_number); wxString title; track_type = uint64(*k_track_type); he_track_type_page_c *page = new he_track_type_page_c(this, track_type, track_number, m_e_tracks); page->init(); he_value_page_c *child_page; child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxTrackNumber::ClassInfos, YT("Track number"), YT("The track number as used in the Block Header.")); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxTrackUID::ClassInfos, YT("Track UID"), YT("A unique ID to identify the Track. This should be\nkept the same when making a direct stream copy\nof the Track to another file.")); child_page->init(); child_page = new he_bool_value_page_c(this, page, k_track_entry, KaxTrackFlagDefault::ClassInfos, YT("'Default track' flag"), YT("Set if that track (audio, video or subs) SHOULD\nbe used if no language found matches the\nuser preference.")); child_page->init(); child_page = new he_bool_value_page_c(this, page, k_track_entry, KaxTrackFlagEnabled::ClassInfos, YT("'Track enabled' flag"), YT("Set if the track is used.")); child_page->init(); child_page = new he_bool_value_page_c(this, page, k_track_entry, KaxTrackFlagForced::ClassInfos, YT("'Forced display' flag"), YT("Set if that track MUST be used during playback.\n" "There can be many forced track for a kind (audio,\nvideo or subs). " "The player should select the one\nwhose language matches the user preference or the\ndefault + forced track.")); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxTrackMinCache::ClassInfos, YT("Minimum cache"), YT("The minimum number of frames a player\nshould be able to cache during playback.\n" "If set to 0, the reference pseudo-cache system\nis not used.")); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxTrackMaxCache::ClassInfos, YT("Maximum cache"), YT("The maximum number of frames a player\nshould be able to cache during playback.\n" "If set to 0, the reference pseudo-cache system\nis not used.")); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxTrackDefaultDuration::ClassInfos, YT("Default duration"), YT("Number of nanoseconds (not scaled) per frame.")); child_page->init(); child_page = new he_float_value_page_c(this, page, k_track_entry, KaxTrackTimecodeScale::ClassInfos, YT("Timecode scaling"), YT("The scale to apply on this track to work at normal\nspeed in relation with other tracks " "(mostly used\nto adjust video speed when the audio length differs).")); child_page->init(); child_page = new he_string_value_page_c(this, page, k_track_entry, KaxTrackName::ClassInfos, YT("Name"), YT("A human-readable track name.")); child_page->init(); child_page = new he_language_value_page_c(this, page, k_track_entry, KaxTrackLanguage::ClassInfos, YT("Language"), YT("Specifies the language of the track in the\nMatroska languages form.")); child_page->init(); child_page = new he_ascii_string_value_page_c(this, page, k_track_entry, KaxCodecID::ClassInfos, YT("Codec ID"), YT("An ID corresponding to the codec.")); child_page->init(); child_page = new he_string_value_page_c(this, page, k_track_entry, KaxCodecName::ClassInfos, YT("Codec name"), YT("A human-readable string specifying the codec.")); child_page->init(); if (track_video == track_type) { child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoPixelWidth::ClassInfos, YT("Video pixel width"), YT("Width of the encoded video frames in pixels.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoPixelHeight::ClassInfos, YT("Video pixel height"), YT("Height of the encoded video frames in pixels.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoDisplayWidth::ClassInfos, YT("Video display width"), YT("Width of the video frames to display.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoDisplayHeight::ClassInfos, YT("Video display height"), YT("Height of the video frames to display.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoDisplayUnit::ClassInfos, YT("Video display unit"), YT("Type of the unit for DisplayWidth/Height\n(0: pixels, 1: centimeters, 2: inches).")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoPixelCropLeft::ClassInfos, YT("Video crop left"), YT("The number of video pixels to remove\non the left of the image.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoPixelCropTop::ClassInfos, YT("Video crop top"), YT("The number of video pixels to remove\non the top of the image.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoPixelCropRight::ClassInfos, YT("Video crop right"), YT("The number of video pixels to remove\non the right of the image.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoPixelCropBottom::ClassInfos, YT("Video crop bottom"), YT("The number of video pixels to remove\non the bottom of the image.")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoAspectRatio::ClassInfos, YT("Video aspect ratio type"), YT("Specify the possible modifications to the aspect ratio\n(0: free resizing, 1: keep aspect ratio, 2: fixed).")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxVideoStereoMode::ClassInfos, YT("Video stereo mode"), YT("Stereo-3D video mode (0 - 11, see documentation).")); child_page->set_sub_master_callbacks(KaxTrackVideo::ClassInfos); child_page->init(); } else if (track_audio == track_type) { child_page = new he_float_value_page_c(this, page, k_track_entry, KaxAudioSamplingFreq::ClassInfos, YT("Audio sampling frequency"), YT("Sampling frequency in Hz.")); child_page->set_sub_master_callbacks(KaxTrackAudio::ClassInfos); child_page->init(); child_page = new he_float_value_page_c(this, page, k_track_entry, KaxAudioOutputSamplingFreq::ClassInfos, YT("Audio output sampling frequency"), YT("Real output sampling frequency in Hz.")); child_page->set_sub_master_callbacks(KaxTrackAudio::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxAudioChannels::ClassInfos, YT("Audio channels"), YT("Numbers of channels in the track.")); child_page->set_sub_master_callbacks(KaxTrackAudio::ClassInfos); child_page->init(); child_page = new he_unsigned_integer_value_page_c(this, page, k_track_entry, KaxAudioBitDepth::ClassInfos, YT("Audio bit depth"), YT("Bits per sample, mostly used for PCM.")); child_page->set_sub_master_callbacks(KaxTrackAudio::ClassInfos); child_page->init(); } // m_tc_tree->ExpandAllChildren(page->m_page_id); } }
void extract_cli_parser_c::init_parser() { add_information(YT("mkvextract <mode> <source-filename> [options] <extraction-spec>")); add_section_header(YT("Usage")); add_information(YT("mkvextract tracks <inname> [options] [TID1:out1 [TID2:out2 ...]]")); add_information(YT("mkvextract tags <inname> [options]")); add_information(YT("mkvextract attachments <inname> [options] [AID1:out1 [AID2:out2 ...]]")); add_information(YT("mkvextract chapters <inname> [options]")); add_information(YT("mkvextract cuesheet <inname> [options]")); add_information(YT("mkvextract timecodes_v2 <inname> [TID1:out1 [TID2:out2 ...]]")); add_information(YT("mkvextract <-h|-V>")); add_separator(); add_information(YT("The first word tells mkvextract what to extract. The second must be the source file. " "There are few global options that can be used with all modes. " "All other options depend on the mode.")); add_section_header(YT("Global options")); OPT("f|parse-fully", set_parse_fully, YT("Parse the whole file instead of relying on the index.")); add_common_options(); add_section_header(YT("Track extraction")); add_information(YT("The first mode extracts some tracks to external files.")); OPT("c=charset", set_charset, YT("Convert text subtitles to this charset (default: UTF-8).")); OPT("cuesheet", set_cuesheet, YT("Also try to extract the CUE sheet from the chapter information and tags for this track.")); OPT("blockadd=level", set_blockadd, YT("Keep only the BlockAdditions up to this level (default: keep all levels)")); OPT("raw", set_raw, YT("Extract the data to a raw file.")); OPT("fullraw", set_fullraw, YT("Extract the data to a raw file including the CodecPrivate as a header.")); add_informational_option("TID:out", YT("Write track with the ID TID to the file 'out'.")); add_section_header(YT("Example")); add_information(YT("mkvextract tracks \"a movie.mkv\" 2:audio.ogg -c ISO8859-1 3:subs.srt")); add_separator(); add_section_header(YT("Tag extraction")); add_information(YT("The second mode extracts the tags and converts them to XML. The output is written to the standard output. The output can be used as a source for mkvmerge.")); add_section_header(YT("Example")); add_information(YT("mkvextract tags \"a movie.mkv\" > movie_tags.xml")); add_section_header(YT("Attachment extraction")); add_information(YT("The third mode extracts attachments from the source file.")); add_informational_option("AID:outname", YT("Write the attachment with the ID 'AID' to 'outname'.")); add_section_header(YT("Example")); add_information(YT("mkvextract attachments \"a movie.mkv\" 4:cover.jpg")); add_section_header(YT("Chapter extraction")); add_information(YT("The fourth mode extracts the chapters and converts them to XML. The output is written to the standard output. The output can be used as a source for mkvmerge.")); OPT("s|simple", set_simple, YT("Exports the chapter information in the simple format used in OGM tools (CHAPTER01=... CHAPTER01NAME=...).")); add_section_header(YT("Example")); add_information(YT("mkvextract chapters \"a movie.mkv\" > movie_chapters.xml")); add_section_header(YT("CUE sheet extraction")); add_information(YT("The fifth mode tries to extract chapter information and tags and outputs them as a CUE sheet. This is the reverse of using a CUE sheet with " "mkvmerge's '--chapters' option.")); add_section_header(YT("Example")); add_information(YT("mkvextract cuesheet \"audiofile.mka\" > audiofile.cue")); add_section_header(YT("Timecode extraction")); add_information(YT("The sixth mode finds the timecodes of all blocks for a track and outputs a timecode v2 file with these timecodes.")); add_section_header(YT("Example")); add_information(YT("mkvextract timecodes_v2 \"a movie.mkv\" 1:timecodes_track1.txt")); add_hook(cli_parser_c::ht_unknown_option, std::bind(&extract_cli_parser_c::set_mode_or_extraction_spec, this)); }
static int BookGet(char cand[][MAX_CAND_LEN+1],int pos,int count) { ENGLISH_IM *e=&eim_book; if(!e->Priv1 || !e->Count || !count) return 0; if(e->Priv1==1) { char *p=cand[pos]; char *s=(char*)e->Priv2; int ret=sprintf(p,"$["); ret+=sprintf(p+ret,"%s",YT("设置密钥")); ret+=sprintf(p+ret,"]$KEY("); l_base64_encode(p+ret,(const uint8_t*)s,strlen(s)); strcat(p,")"); } else if(e->Priv1==2) { char *p=cand[pos]; char *s=(char*)e->Priv2; if(s[0]==0) { int ret=sprintf(p,"$["); ret+=sprintf(p+ret,"%s",YT("加密剪贴板内容")); ret+=sprintf(p+ret,"]$ENCRYPT()"); } else { y_im_book_encrypt(s,p); } } else if(e->Priv1==3) { char *s=(char*)e->Priv2; assert(book!=NULL); char **keys=l_key_file_get_keys(book,s); int i; for(i=pos;i<pos+count && i<e->Count;i++) { char *t=l_key_file_get_string(book,s,keys[i]); char *p=cand[i]; if(strlen(t)>MAX_CAND_LEN) { sprintf(p,"$[%s]",YT("太长了,不支持")); } else { l_utf8_to_gb(t,p,MAX_CAND_LEN); } l_free(t); } } else if(e->Priv1==4) { char *p=cand[pos]; char *s=(char*)e->Priv2; int i=strcspn(s,","); char grp[64]; char *t; memcpy(grp,s,i); grp[i]=0; assert(book!=NULL); t=l_key_file_get_string(book,grp,s+i+1); if(strlen(t)>MAX_CAND_LEN) { sprintf(p,"$[%s]",YT("太长了,不支持")); } else { l_utf8_to_gb(t,p,MAX_CAND_LEN); } l_free(t); } return 0; }