//--------------------------------------------------------------------------- void File_Exr::FileHeader_Parse() { //Parsing int32u Flags; int8u Version; bool Deep, Multipart; Skip_L4( "Magic number"); Get_L1 (Version, "Version field"); Get_L3 (Flags, "Flags"); Skip_Flags(Flags, 0, "Single tile"); Get_Flags (Flags, 1, LongName, "Long name"); Get_Flags (Flags, 2, Deep, "Non-image"); Get_Flags (Flags, 3, Multipart, "Multipart"); //Filling if (Frame_Count==0) { Fill(Stream_General, 0, General_Format_Version, __T("Version ")+Ztring::ToZtring(Version)); Fill(StreamKind_Last, 0, "Format", "EXR"); Fill(StreamKind_Last, 0, "Format_Version", __T("Version ")+Ztring::ToZtring(Version)); Fill(StreamKind_Last, 0, "Format_Profile", (Flags&0x02)?"Tile":"Line"); if (Deep) Fill(Stream_General, 0, "Deep", "Yes"); if (Multipart) Fill(Stream_General, 0, "Multipart", "Yes"); } Frame_Count++; if (Frame_Count_NotParsedIncluded!=(int64u)-1) Frame_Count_NotParsedIncluded++; ImageData_End=Config->File_Current_Size; }
//--------------------------------------------------------------------------- // archive header void File_Rar::Header_Parse_Flags_73() { Skip_Flags(HEAD_FLAGS, 1, "Volume attribute (archive volume)"); Skip_Flags(HEAD_FLAGS, 2, "Archive comment present"); Skip_Flags(HEAD_FLAGS, 3, "Archive lock attribute"); Skip_Flags(HEAD_FLAGS, 4, "Solid attribute (solid archive)"); Skip_Flags(HEAD_FLAGS, 5, "New volume naming scheme"); // (\'volname.partN.rar\') Skip_Flags(HEAD_FLAGS, 6, "Authenticity information present"); Skip_Flags(HEAD_FLAGS, 7, "Recovery record present"); Skip_Flags(HEAD_FLAGS, 8, "Block headers are encrypted"); Skip_Flags(HEAD_FLAGS, 9, "First volume (set only by RAR 3.0 and later)"); Get_Flags (HEAD_FLAGS, 15, add_size, "ADD_SIZE present"); }
//--------------------------------------------------------------------------- void File_Jpeg::COD() { //Parsing int16u Levels; int8u Style, Style2, MultipleComponentTransform; bool PrecinctUsed; Get_B1 (Style, "Scod - Style"); Get_Flags (Style, 0, PrecinctUsed, "Precinct used"); Skip_Flags(Style, 1, "Use SOP (start of packet)"); Skip_Flags(Style, 2, "Use EPH (end of packet header)"); Skip_B1( "Number of decomposition levels"); Skip_B1( "Progression order"); Get_B2 (Levels, "Number of layers"); Info_B1(DimX, "Code-blocks dimensions X (2^(n+2))"); Param_Info2(1<<(DimX+2), " pixels"); Info_B1(DimY, "Code-blocks dimensions Y (2^(n+2))"); Param_Info2(1<<(DimY+2), " pixels"); Get_B1 (Style2, "Style of the code-block coding passes"); Skip_Flags(Style, 0, "Selective arithmetic coding bypass"); Skip_Flags(Style, 1, "MQ states for all contexts"); Skip_Flags(Style, 2, "Regular termination"); Skip_Flags(Style, 3, "Vertically stripe-causal context formation"); Skip_Flags(Style, 4, "Error resilience info is embedded on MQ termination"); Skip_Flags(Style, 5, "Segmentation marker is to be inserted at the end of each normalization coding pass"); Skip_B1( "Transform"); Get_B1(MultipleComponentTransform, "Multiple component transform"); if (PrecinctUsed) { BS_Begin(); Skip_S1(4, "LL sub-band width"); Skip_S1(4, "LL sub-band height"); BS_End(); for (int16u Pos=0; Pos<Levels; Pos++) { Element_Begin1("Decomposition level"); BS_Begin(); Skip_S1(4, "decomposition level width"); Skip_S1(4, "decomposition level height"); BS_End(); Element_End0(); } } FILLING_BEGIN(); if (Frame_Count==0 && Field_Count==0) { switch (MultipleComponentTransform) { case 0x01 : Fill(StreamKind_Last, 0, "Compression_Mode", "Lossless"); break; case 0x02 : Fill(StreamKind_Last, 0, "Compression_Mode", "Lossy"); break; default : ; } } FILLING_END(); }
//--------------------------------------------------------------------------- void File_Ogg::Header_Parse() { //Parsing int64u absolute_granule_position; int32u stream_serial_number, page_sequence_no; int16u total_page_size; int8u stream_structure_version, flags, page_segments, packet_lacing_value; Skip_C4( "capture_pattern"); Get_L1 (stream_structure_version, "stream_structure_version"); Get_L1 (flags, "header_type_flag"); Get_Flags (flags, 0, continued, "continued packet"); Skip_Flags(flags, 1, "first page of logical bitstream (bos)"); Skip_Flags(flags, 2, "last page of logical bitstream (eos)"); Get_L8 (absolute_granule_position, "absolute granule position"); Get_L4 (stream_serial_number, "stream serial number"); Get_L4 (page_sequence_no, "page sequence no"); Skip_L4( "page checksum"); Get_L1 (page_segments, "page_segments"); total_page_size=0; Chunk_Sizes.clear(); Chunk_Sizes.push_back(0); for (int8u Pos=0; Pos<page_segments; Pos++) { Get_L1 (packet_lacing_value, "packet lacing value"); total_page_size+=packet_lacing_value; Chunk_Sizes[Chunk_Sizes.size()-1]+=packet_lacing_value; if (packet_lacing_value!=0xFF) { Chunk_Sizes.push_back(0); Chunk_Sizes_Finnished=true; } else Chunk_Sizes_Finnished=false; } if (Chunk_Sizes_Finnished) Chunk_Sizes.resize(Chunk_Sizes.size()-1); //Keep out the last value //Filling Header_Fill_Size(27+page_segments+total_page_size); Header_Fill_Code(stream_serial_number, Ztring::ToZtring(stream_serial_number, 16)); Stream[stream_serial_number].absolute_granule_position=absolute_granule_position; }
//--------------------------------------------------------------------------- void File_ApeTag::HeaderFooter() { //Parsing int32u Flags; Skip_C8( "Preamble"); Skip_L4( "Version"); Skip_L4( "Size"); Skip_L4( "Count"); Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "Read Only"); Skip_Flags(Flags, 1, "Binary"); Skip_Flags(Flags, 2, "Locator of external stored information"); Skip_Flags(Flags, 29, "Is the header"); Skip_Flags(Flags, 30, "Contains a footer"); Skip_Flags(Flags, 31, "Contains a header"); Skip_L8( "Reserved"); }
//--------------------------------------------------------------------------- void File_ApeTag::Header_Parse() { //Testing if begin or end of tags if (CC8(Buffer+Buffer_Offset)==0x4150455441474558LL) //"APETAGEX" { //Filling Header_Fill_Code((int64u)-1, "File Footer"); Header_Fill_Size(0x20); return; } //Parsing Ztring Value; int32u Flags, Length; Get_L4 (Length, "Length"); Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "Read Only"); Skip_Flags(Flags, 1, "Binary"); Skip_Flags(Flags, 2, "Locator of external stored information"); Skip_Flags(Flags, 29, "Is the header"); Skip_Flags(Flags, 30, "Contains a footer"); Skip_Flags(Flags, 31, "Contains a header"); size_t Pos=(size_t)Element_Offset; for (; Pos<Element_Size; Pos++) if (Buffer[Buffer_Offset+Pos]==0x00) break; if (Pos==Element_Size) { Element_WaitForMoreData(); return; } Get_String(Pos-Element_Offset, Key, "Key"); Skip_L1( "0x00"); //Filling Header_Fill_Code(0, Key.c_str()); Header_Fill_Size(Element_Offset+Length); }
//--------------------------------------------------------------------------- // file header void File_Rar::Header_Parse_Flags_74() { Skip_Flags(HEAD_FLAGS,0, "file continued from previous volume"); Skip_Flags(HEAD_FLAGS,1, "file continued in next volume"); Skip_Flags(HEAD_FLAGS,2, "file encrypted with password"); Skip_Flags(HEAD_FLAGS,3, "file comment present"); Skip_Flags(HEAD_FLAGS,4, "information from previous files is used"); // (solid flag) // bits 7 6 5 (for RAR 2.0 and later) // 0 0 0 - dictionary size 64 KB // 0 0 1 - dictionary size 128 KB // 0 1 0 - dictionary size 256 KB // 0 1 1 - dictionary size 512 KB // 1 0 0 - dictionary size 1024 KB // 1 0 1 - dictionary size 2048 KB // 1 1 0 - dictionary size 4096 KB // 1 1 1 - file is directory Get_Flags (HEAD_FLAGS, 8, high_fields, "HIGH_PACK_SIZE and HIGH_UNP_SIZE fields"); Get_Flags (HEAD_FLAGS, 9, usual_or_utf8, "FILE_NAME contains usual and encoded unicode"); Get_Flags (HEAD_FLAGS, 10, salt, "SALT present"); Skip_Flags(HEAD_FLAGS, 11, "Version flag."); Get_Flags (HEAD_FLAGS, 12, exttime, "Extended time field present"); Get_Flags (HEAD_FLAGS, 15, add_size, "ADD_SIZE present"); }
//--------------------------------------------------------------------------- void File_Wvpk::Data_Parse() { //Specific if (FromMKV && !FromMKV_CodecPrivateParsed) { //Parsing Get_L2 (version, "version"); FILLING_BEGIN(); FromMKV_CodecPrivateParsed=true; FILLING_END(); return; } //Counting Frame_Count++; //Parsing Element_Begin("Block Header"); if (!FromMKV) Get_L2 (version, "version"); if (version/0x100==0x4) { while (Element_Offset<Element_Size) { int32u total_samples=(int32u)-1, block_index=(int32u)-1, block_samples=0, flags, blocksize=(int32u)-1; bool initial_block=true, final_block=true; if (!FromMKV) { Skip_L1( "track_no"); Skip_L1( "index_no"); Get_L4 (total_samples, "total_samples"); Get_L4 (block_index, "block_index"); } if (!FromMKV || (FromMKV && Element_Offset==0)) Get_L4 (block_samples, "block_samples"); if (block_samples!=0) //empty frames have other values empty { if (!FromMKV) { if (block_index==0) //Only the frame with block_index==0 total_samples_FirstFrame=total_samples; //Note: total_samples is not trustable for a cutted file if (Frame_Count==1) block_index_FirstFrame=block_index; //Save the block_index of the first block block_index_LastFrame=block_index; block_samples_LastFrame=block_samples; } Get_L4 (flags, "flags"); Get_Flags (flags, 0, resolution0, "resolution0"); Get_Flags (flags, 1, resolution1, "resolution1"); Get_Flags (flags, 2, mono, "mono"); Get_Flags (flags, 3, hybrid, "hybrid"); Get_Flags (flags, 4, joint_stereo, "joint stereo"); Get_Flags (flags, 5, cross_channel_decorrelation, "cross-channel decorrelation"); Skip_Flags(flags, 6, "hybrid noise shaping"); Skip_Flags(flags, 7, "floating point data"); Skip_Flags(flags, 8, "extended size integers"); Skip_Flags(flags, 9, "hybrid mode parameters control bitrate"); Skip_Flags(flags, 10, "hybrid noise balanced between channels"); Get_Flags (flags, 11, initial_block, "initial block in sequence"); Get_Flags (flags, 12, final_block, "final block in sequence"); Skip_Flags(flags, 13, "amount of data left-shift after decode"); Skip_Flags(flags, 14, "amount of data left-shift after decode"); Skip_Flags(flags, 15, "amount of data left-shift after decode"); Skip_Flags(flags, 16, "amount of data left-shift after decode"); Skip_Flags(flags, 17, "amount of data left-shift after decode"); Skip_Flags(flags, 18, "maximum magnitude of decoded data"); Skip_Flags(flags, 19, "maximum magnitude of decoded data"); Skip_Flags(flags, 20, "maximum magnitude of decoded data"); Skip_Flags(flags, 21, "maximum magnitude of decoded data"); Skip_Flags(flags, 22, "maximum magnitude of decoded data"); Skip_Flags(flags, 23, "sampling rate"); Skip_Flags(flags, 24, "sampling rate"); Skip_Flags(flags, 25, "sampling rate"); Skip_Flags(flags, 26, "sampling rate"); SamplingRate=(int8u)(((flags>>23)&0xF)); Param_Info(Wvpk_SamplingRate[SamplingRate]); Skip_Flags(flags, 27, "reserved"); Skip_Flags(flags, 28, "reserved"); Skip_Flags(flags, 29, "use IIR for negative hybrid noise shaping"); Skip_Flags(flags, 30, "false stereo"); Skip_Flags(flags, 31, "reserved"); } else { Skip_L4( "flags (empty)"); //Counting Frame_Count--; //This is not a real frame } Skip_L4( "crc"); Element_End(); int64u End=Element_Size; if (FromMKV && !(initial_block && final_block)) { Get_L4 (blocksize, "blocksize"); End=Element_Offset+blocksize; if (End>=Element_Size) End=Element_Size; } //Sub-block int8u id; while (Element_Offset<End) { Element_Begin(); int32u word_size; bool large, odd_size; BS_Begin(); Get_SB (large, "large"); Get_SB (odd_size, "odd_size"); Get_S1 (6, id, "id"); Element_Info(Wvpk_id(id)); BS_End(); if (large) { Get_L3 (word_size, "word_size"); } else { int8u word_size1; Get_L1 (word_size1, "word_size"); word_size=word_size1; } if (word_size==0 && odd_size) Size=0; //Problem! else Size=word_size*2-(odd_size?1:0); Element_Name(Ztring().From_CC1(id)); switch (id) { case 0x07 : id_07(); break; case 0x0D : id_0D(); break; case 0x25 : id_25(); break; default : if (word_size) Skip_XX(Size, "data"); } if (odd_size) Skip_XX(1, "padding"); Element_End(); } } }
//--------------------------------------------------------------------------- void File_Ogg::Header_Parse() { //Specific case if (SizedBlocks) { int16u Size; Get_B2 (Size, "Size"); Chunk_Sizes.clear(); Chunk_Sizes.push_back(Size); Header_Fill_Size(2+Size); Header_Fill_Code(0, Ztring::ToZtring(0, 16)); return; } if (XiphLacing) { if (Chunk_Sizes.empty()) { int8u CountMinus1; Get_B1 (CountMinus1, "Number of frames minus one"); int64u UsedSize=0; for (size_t Pos=0; Pos<CountMinus1; Pos++) { int32u Size=0; int8u Size8; do { Get_B1 (Size8, "Size"); Size+=Size8; } while (Size8==0xFF); Param_Info1(Size); Chunk_Sizes.push_back(Size); UsedSize+=Size; } Chunk_Sizes.push_back((size_t)(Element_Size-UsedSize-1)); } Header_Fill_Size(Element_Size); Header_Fill_Code(0, Ztring::ToZtring(0, 16)); return; } //Parsing int64u absolute_granule_position; int32u stream_serial_number, page_sequence_no; int16u total_page_size; int8u stream_structure_version, flags, page_segments, packet_lacing_value; Skip_C4( "capture_pattern"); Get_L1 (stream_structure_version, "stream_structure_version"); Get_L1 (flags, "header_type_flag"); Get_Flags (flags, 0, continued, "continued packet"); Skip_Flags(flags, 1, "first page of logical bitstream (bos)"); Get_Flags (flags, 2, eos, "last page of logical bitstream (eos)"); Get_L8 (absolute_granule_position, "absolute granule position"); Get_L4 (stream_serial_number, "stream serial number"); Get_L4 (page_sequence_no, "page sequence no"); Skip_L4( "page checksum"); Get_L1 (page_segments, "page_segments"); total_page_size=0; Chunk_Sizes.clear(); Chunk_Sizes.push_back(0); for (int8u Pos=0; Pos<page_segments; Pos++) { Get_L1 (packet_lacing_value, "packet lacing value"); total_page_size+=packet_lacing_value; Chunk_Sizes[Chunk_Sizes.size()-1]+=packet_lacing_value; if (packet_lacing_value!=0xFF) { Chunk_Sizes.push_back(0); Chunk_Sizes_Finished=true; } else Chunk_Sizes_Finished=false; } if (Chunk_Sizes_Finished) Chunk_Sizes.resize(Chunk_Sizes.size()-1); //Keep out the last value //Filling Header_Fill_Size(27+page_segments+total_page_size); Header_Fill_Code(stream_serial_number, Ztring::ToZtring(stream_serial_number, 16)); Stream[stream_serial_number].absolute_granule_position=absolute_granule_position; }
//--------------------------------------------------------------------------- void File_Wvpk::Data_Parse() { //Specific if (FromMKV && !FromMKV_CodecPrivateParsed) { //Parsing Get_L2 (version, "version"); FILLING_BEGIN(); FromMKV_CodecPrivateParsed=true; FILLING_END(); return; } //Counting Frame_Count++; //Parsing Element_Begin("Block Header"); if (!FromMKV) Get_L2 (version, "version"); if (version/0x100==0x4) { int32u total_samples, block_index, block_samples, flags; if (!FromMKV) { Skip_L1( "track_no"); Skip_L1( "index_no"); Get_L4 (total_samples, "total_samples"); Get_L4 (block_index, "block_index"); } Get_L4 (block_samples, "block_samples"); if (block_samples!=0) //empty frames have other values empty { if (!FromMKV) { if (block_index==0) //Only the frame with block_index==0 total_samples_FirstFrame=total_samples; //Note: total_samples is not trustable for a cutted file if (Frame_Count==1) block_index_FirstFrame=block_index; //Save the block_index of the first block block_index_LastFrame=block_index; block_samples_LastFrame=block_samples; } Get_L4 (flags, "flags"); Get_Flags (flags, 0, resolution0, "resolution0"); Get_Flags (flags, 1, resolution1, "resolution1"); Get_Flags (flags, 2, mono, "mono"); Get_Flags (flags, 3, hybrid, "hybrid"); Get_Flags (flags, 4, joint_stereo, "joint stereo"); Get_Flags (flags, 5, cross_channel_decorrelation, "cross-channel decorrelation"); Skip_Flags(flags, 6, "hybrid noise shaping"); Skip_Flags(flags, 7, "floating point data"); Skip_Flags(flags, 8, "extended size integers"); Skip_Flags(flags, 9, "hybrid mode parameters control bitrate"); Skip_Flags(flags, 10, "hybrid noise balanced between channels"); Skip_Flags(flags, 11, "initial block in sequence"); Skip_Flags(flags, 12, "final block in sequence"); Skip_Flags(flags, 13, "amount of data left-shift after decode"); Skip_Flags(flags, 14, "amount of data left-shift after decode"); Skip_Flags(flags, 15, "amount of data left-shift after decode"); Skip_Flags(flags, 16, "amount of data left-shift after decode"); Skip_Flags(flags, 17, "amount of data left-shift after decode"); Skip_Flags(flags, 18, "maximum magnitude of decoded data"); Skip_Flags(flags, 19, "maximum magnitude of decoded data"); Skip_Flags(flags, 20, "maximum magnitude of decoded data"); Skip_Flags(flags, 21, "maximum magnitude of decoded data"); Skip_Flags(flags, 22, "maximum magnitude of decoded data"); Skip_Flags(flags, 23, "sampling rate"); Skip_Flags(flags, 24, "sampling rate"); Skip_Flags(flags, 25, "sampling rate"); Skip_Flags(flags, 26, "sampling rate"); SamplingRate=(int8u)(((flags>>23)&0xF)); Param_Info(Wvpk_SamplingRate[SamplingRate]); Skip_Flags(flags, 27, "reserved"); Skip_Flags(flags, 28, "reserved"); Skip_Flags(flags, 29, "use IIR for negative hybrid noise shaping"); Skip_Flags(flags, 30, "false stereo"); Skip_Flags(flags, 31, "reserved"); } else {
//--------------------------------------------------------------------------- void File_Ape::FileHeader_Parse() { //Parsing int32u SampleRate=0, TotalFrames=0, FinalFrameSamples=0, SamplesPerFrame=0, SeekElements; int16u Version, CompressionLevel=0, Flags=0, Channels=0, Resolution=0; bool Resolution8=false, Resolution24=false, no_wav_header; Skip_C4( "Identifier"); Get_L2 (Version, "Version"); if (Version<3980) //<3.98 { Get_L2 (CompressionLevel, "CompressionLevel"); Param_Info(Ape_Codec_Settings(CompressionLevel)); Get_L2 (Flags, "FormatFlags"); Get_Flags (Flags, 0, Resolution8, "8-bit"); Skip_Flags(Flags, 1, "crc-32"); Skip_Flags(Flags, 2, "peak_level"); Get_Flags (Flags, 3, Resolution24, "24-bit"); Skip_Flags(Flags, 4, "seek_elements"); Get_Flags (Flags, 5, no_wav_header, "no_wav_header"); if (Resolution8) Resolution=8; else if (Resolution24) Resolution=24; else Resolution=16; Get_L2 (Channels, "Channels"); Get_L4 (SampleRate, "SampleRate"); Skip_L4( "WavHeaderDataBytes"); Skip_L4( "WavTerminatingBytes"); Get_L4 (TotalFrames, "TotalFrames"); Get_L4 (FinalFrameSamples, "FinalFrameSamples"); SamplesPerFrame=Ape_SamplesPerFrame(Version, CompressionLevel); Skip_L4( "PeakLevel"); Get_L4 (SeekElements, "SeekElements"); if (!no_wav_header) Skip_XX(44, "RIFF header"); Skip_XX(SeekElements*4, "Seek table"); } else { Skip_L2( "Version_High"); Skip_L4( "DescriptorBytes"); Skip_L4( "HeaderBytes"); Skip_L4( "SeekTableBytes"); Skip_L4( "WavHeaderDataBytes"); Skip_L4( "APEFrameDataBytes"); Skip_L4( "APEFrameDataBytesHigh"); Skip_L4( "WavTerminatingDataBytes"); Skip_L16( "FileMD5"); Get_L2 (CompressionLevel, "CompressionLevel"); Param_Info(Ape_Codec_Settings(CompressionLevel)); Get_L2 (Flags, "FormatFlags"); Get_L4 (SamplesPerFrame, "BlocksPerFrame"); Get_L4 (FinalFrameSamples, "FinalFrameBlocks"); Get_L4 (TotalFrames, "TotalFrames"); Get_L2 (Resolution, "BitsPerSample"); Get_L2 (Channels, "Channels"); Get_L4 (SampleRate, "SampleRate"); } FILLING_BEGIN(); //Coherancy int32u Samples=(TotalFrames-1)*SamplesPerFrame+FinalFrameSamples; if (Samples==0 || SampleRate==0 || Channels==0 || Resolution==0) { File__Tags_Helper::Reject("APE"); return; } //Filling File__Tags_Helper::Accept("APE"); File__Tags_Helper::Streams_Fill(); Duration=((int64u)Samples)*1000/SampleRate; UncompressedSize=Samples*Channels*(Resolution/8); File__Tags_Helper::Stream_Prepare(Stream_Audio); Fill(Stream_Audio, 0, Audio_Format, "Monkey's Audio"); Fill(Stream_Audio, 0, Audio_Encoded_Library_Settings, Ape_Codec_Settings(CompressionLevel)); Fill(Stream_Audio, 0, Audio_Codec, "APE"); Fill(Stream_Audio, 0, Audio_BitDepth, Resolution); Fill(Stream_Audio, 0, Audio_Channel_s_, Channels); Fill(Stream_Audio, 0, Audio_SamplingRate, SampleRate); Fill(Stream_Audio, 0, Audio_Duration, Duration); //No more need data File__Tags_Helper::Finish("APE"); FILLING_END(); }
//--------------------------------------------------------------------------- void File_ScreamTracker3::Read_Buffer_Continue() { //Parsing Ztring SongName; int16u OrdNum, InsNum, PatNum, Flags, Special; int8u SoftwareVersionMajor, SoftwareVersionMinor, IS, TS; Get_Local(28, SongName, "Song name"); Skip_L1( "0x1A"); Skip_L1( "Type"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Get_L2 (OrdNum, "Orders count"); Get_L2 (InsNum, "Instruments count"); Get_L2 (PatNum, "Paterns count"); Get_L2 (Flags, "Flags"); Skip_Flags(Flags, 0, "st2vibrato"); Skip_Flags(Flags, 1, "st2tempo"); Skip_Flags(Flags, 2, "amigaslides"); Skip_Flags(Flags, 3, "0vol optimizations"); Skip_Flags(Flags, 4, "amiga limits"); Skip_Flags(Flags, 5, "enable filter/sfx with sb"); Skip_Flags(Flags, 6, "st3.00 volumeslides"); Skip_Flags(Flags, 7, "pecial custom data in file"); Get_L1 (SoftwareVersionMajor, "Cwt/v (Major)"); Get_L1 (SoftwareVersionMinor, "Cwt/v (Minor)"); Skip_L2( "File format information"); Skip_B4( "Signature"); Skip_L1( "global volume"); Get_L1 (IS, "Initial Speed"); Get_L1 (TS, "Initial Temp"); Skip_L1( "master volume"); Skip_L1( "ultra click removal"); Skip_L1( "Default channel pan positions are present"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Get_L2 (Special, "Special"); Skip_XX(32, "Channel settings"); Skip_XX(OrdNum, "Orders"); Skip_XX(InsNum*2, "Instruments"); Skip_XX(PatNum*2, "Patterns"); FILLING_BEGIN(); Accept("Scream Tracker 3"); Fill(Stream_General, 0, General_Format, "Scream Tracker 3"); Fill(Stream_General, 0, General_Track, SongName); if ((SoftwareVersionMajor&0xF0)==0x10) Fill(Stream_General, 0, General_Encoded_Application, Ztring(__T("Scream Tracker ")+Ztring::ToZtring(SoftwareVersionMajor)+__T(".")+Ztring::ToZtring(SoftwareVersionMinor/16)+Ztring::ToZtring(SoftwareVersionMinor%16))); Fill(Stream_General, 0, "BPM", TS); Stream_Prepare(Stream_Audio); Finish("Scream Tracker 3"); FILLING_END(); }
//--------------------------------------------------------------------------- void File_ImpulseTracker::Read_Buffer_Continue() { //Parsing Ztring SongName; int16u OrdNum, InsNum, SmpNum, PatNum, Flags, Special; int8u VersionMajor, VersionMinor, SoftwareVersionMajor, SoftwareVersionMinor, IS, TS; bool Stereo; Skip_B4( "Signature"); Get_Local(26, SongName, "Song name"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Get_L2 (OrdNum, "Orders count"); Get_L2 (InsNum, "Instruments count"); Get_L2 (SmpNum, "Samples count"); Get_L2 (PatNum, "Paterns count"); Get_L1 (SoftwareVersionMinor, "Cwt/v (Minor)"); Get_L1 (SoftwareVersionMajor, "Cwt/v (Major)"); Get_L1 (VersionMinor, "Cwt (Minor)"); Get_L1 (VersionMajor, "Cwt (Major)"); Get_L2 (Flags, "Flags"); Get_Flags (Flags, 0, Stereo, "Stereo"); Skip_Flags(Flags, 1, "Vol0MixOptimizations"); Skip_Flags(Flags, 2, "Use instruments/Samples"); Skip_Flags(Flags, 3, "Linear/Amiga slides"); Skip_Flags(Flags, 4, "Old/IT Effects"); Get_L2 (Special, "Special"); Skip_Flags(Special, 0, "Song Message attached"); Skip_L1( "Global volume"); Skip_L1( "Mix volume"); Get_L1 (IS, "Initial Speed"); Get_L1 (TS, "Initial Temp"); Skip_L1( "Panning separation between channels"); Skip_L1( "0"); Skip_L2( "Message Length"); Skip_L4( "Message Offset"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_L1( "Unknown"); Skip_XX(64, "Chnl Pan"); Skip_XX(64, "Chnl Vol"); Skip_XX(OrdNum, "Orders"); Skip_XX(InsNum*4, "Instruments"); Skip_XX(SmpNum*4, "Samples"); Skip_XX(PatNum*4, "Patterns"); FILLING_BEGIN(); Stream_Prepare(Stream_General); Fill(Stream_General, 0, General_Format, "Impulse Tracker"); Fill(Stream_General, 0, General_Format_Version, Ztring(_T("Version "))+Ztring::ToZtring(VersionMajor)+_T(".")+Ztring::ToZtring(VersionMinor/16)+Ztring::ToZtring(VersionMinor%16)); Fill(Stream_General, 0, General_Track, SongName); Fill(Stream_General, 0, General_Encoded_Application, Ztring(_T("Impulse Tracker ")+Ztring::ToZtring(SoftwareVersionMajor)+_T(".")+Ztring::ToZtring(SoftwareVersionMinor/16)+Ztring::ToZtring(SoftwareVersionMinor%16))); Fill(Stream_General, 0, "BPM", TS); Stream_Prepare(Stream_Audio); Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, Stereo?2:1); Accept("Impulse Tracker"); Finish("Impulse Tracker"); FILLING_END(); }
bool File_Zip::central_directory() { if (Element_Offset+46>Element_Size) //central_directory up to relative offset of local header included return false; //Not enough data //Retrieving complete local_file_header size int16u file_name_length=LittleEndian2int16u(Buffer+(size_t)Element_Offset+28); int16u extra_field_length=LittleEndian2int16u(Buffer+(size_t)Element_Offset+30); int16u file_comment_length=LittleEndian2int16u(Buffer+(size_t)Element_Offset+32); if (Element_Offset+46+file_name_length+extra_field_length+file_comment_length>Element_Size) //central_directory_structure all included return false; //Not enough data int16u general_purpose_bit_flag; bool efs; int16u version_made_by,compression_method; //Parsing Element_Begin1("Central directory"); Skip_C4("central file header signature"); Get_L2 (version_made_by,"version made by");Param_Info1((version_made_by>>8)>20?"unused":Zip_made_by[version_made_by>>8]); Skip_L2("version needed to extract"); Get_L2 (general_purpose_bit_flag,"general purpose bit flag"); Skip_Flags(general_purpose_bit_flag, 0, "encrypted file"); Skip_Flags(general_purpose_bit_flag, 1, "8K sliding dictionary"); Skip_Flags(general_purpose_bit_flag, 2, "3 Shannon-Fano trees"); Skip_Flags(general_purpose_bit_flag, 3, "data descriptor"); Skip_Flags(general_purpose_bit_flag, 4, "Reserved for use with method 8"); Skip_Flags(general_purpose_bit_flag, 4, "file is compressed patched data"); Skip_Flags(general_purpose_bit_flag, 4, "Strong encryption"); //~ Skip_Flags(general_purpose_bit_flag, 4, "Currently unused"); //~ Skip_Flags(general_purpose_bit_flag, 4, "Currently unused"); //~ Skip_Flags(general_purpose_bit_flag, 4, "Currently unused"); //~ Skip_Flags(general_purpose_bit_flag, 4, "Currently unused"); Get_Flags (general_purpose_bit_flag, 11, efs, "Language encoding flag (EFS)"); //~ Skip_Flags(general_purpose_bit_flag, 4, "Reserved by PKWARE for enhanced compression"); //~ Skip_Flags(general_purpose_bit_flag, 4, ""); //~ Skip_Flags(general_purpose_bit_flag, 4, "Reserved by PKWARE"); //~ Skip_Flags(general_purpose_bit_flag, 4, "Reserved by PKWARE"); Get_L2 (compression_method,"compression method"); Param_Info1C((compression_method<20), Zip_compression_method[compression_method]); Param_Info1C((compression_method==97||compression_method==98), Zip_compression_method[compression_method-97+20]); Skip_L2("last mod file time"); Skip_L2("last mod file date"); Skip_L4("crc-32"); Skip_L4("compressed size"); Skip_L4("uncompressed size"); Skip_L2("file name length"); Skip_L2("extra field length"); Skip_L2("file comment length"); Skip_L2("disk number start"); Skip_L2("internal file attributes"); Skip_L4("external file attributes"); Skip_L4("relative offset of local header"); if(efs) { Skip_UTF8(file_name_length,"file name"); Skip_UTF8(extra_field_length,"extra field"); Skip_UTF8(file_comment_length,"file comment"); } else { Skip_Local(file_name_length,"file name"); Skip_Local(extra_field_length,"extra field"); Skip_Local(file_comment_length,"file comment"); } Element_End0(); return true; }