├── .gitignore ├── LICENSE ├── README.md ├── ncmdumpGUI.sln └── ncmdumpGUI ├── Delegatres.cs ├── ExtFileStream.cs ├── Main.Designer.cs ├── Main.cs ├── Main.resx ├── NeteaseCopyrightData.cs ├── NeteaseCrypto.cs ├── Program.cs ├── ProgressDialogControl.cs ├── ProgressDialogDel.cs ├── ProgressDlg.Designer.cs ├── ProgressDlg.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources └── spinner.gif ├── TagLib ├── Aac │ ├── AudioHeader.cs │ ├── BitStream.cs │ └── File.cs ├── Aiff │ ├── File.cs │ └── StreamHeader.cs ├── Ape │ ├── File.cs │ ├── Footer.cs │ ├── Item.cs │ ├── StreamHeader.cs │ └── Tag.cs ├── Asf │ ├── ContentDescriptionObject.cs │ ├── ContentDescriptor.cs │ ├── DescriptionRecord.cs │ ├── ExtendedContentDescriptionObject.cs │ ├── File.cs │ ├── FilePropertiesObject.cs │ ├── Guid.cs │ ├── HeaderExtensionObject.cs │ ├── HeaderObject.cs │ ├── MetadataLibraryObject.cs │ ├── Object.cs │ ├── PaddingObject.cs │ ├── StreamPropertiesObject.cs │ ├── Tag.cs │ └── UnknownObject.cs ├── Audible │ ├── File.cs │ └── Tag.cs ├── ByteVector.cs ├── ByteVectorList.cs ├── CombinedTag.cs ├── CorruptFileException.cs ├── Debugger.cs ├── File.cs ├── FileTypes.cs ├── Flac │ ├── Block.cs │ ├── BlockHeader.cs │ ├── File.cs │ ├── Picture.cs │ └── StreamHeader.cs ├── Genres.cs ├── Gif │ ├── Codec.cs │ ├── File.cs │ └── GifCommentTag.cs ├── ICodec.cs ├── IFD │ ├── Entries │ │ ├── ByteIFDEntry.cs │ │ ├── ByteVectorIFDEntry.cs │ │ ├── LongArrayIFDEntry.cs │ │ ├── LongIFDEntry.cs │ │ ├── MakernoteIFDEntry.cs │ │ ├── Rational.cs │ │ ├── RationalArrayIFDEntry.cs │ │ ├── RationalIFDEntry.cs │ │ ├── SByteIFDEntry.cs │ │ ├── SLongArrayIFDEntry.cs │ │ ├── SLongIFDEntry.cs │ │ ├── SRational.cs │ │ ├── SRationalArrayIFDEntry.cs │ │ ├── SRationalIFDEntry.cs │ │ ├── SShortArrayIFDEntry.cs │ │ ├── SShortIFDEntry.cs │ │ ├── ShortArrayIFDEntry.cs │ │ ├── ShortIFDEntry.cs │ │ ├── StringIFDEntry.cs │ │ ├── StripOffsetsIFDEntry.cs │ │ ├── SubIFDArrayEntry.cs │ │ ├── SubIFDEntry.cs │ │ ├── ThumbnailDataIFDEntry.cs │ │ ├── UndefinedIFDEntry.cs │ │ └── UserCommentIFDEntry.cs │ ├── IFDDirectory.cs │ ├── IFDEntry.cs │ ├── IFDEntryType.cs │ ├── IFDReader.cs │ ├── IFDRenderer.cs │ ├── IFDStructure.cs │ ├── IFDTag.cs │ ├── Makernotes │ │ └── Nikon3MakernoteReader.cs │ └── Tags │ │ ├── CanonFileInfoEntryTag.cs │ │ ├── CanonMakerNoteEntryTag.cs │ │ ├── CanonPictureInfoEntryTag.cs │ │ ├── ExifEntryTag.cs │ │ ├── GPSEntryTag.cs │ │ ├── IFDEntryTag.cs │ │ ├── IOPEntryTag.cs │ │ ├── Nikon3MakerNoteEntryTag.cs │ │ ├── NikonIsoInfoEntryTag.cs │ │ ├── NikonLensData3EntryTag.cs │ │ ├── NikonPictureControlEntryTag.cs │ │ ├── NikonPreviewMakerNoteEntryTag.cs │ │ ├── NikonShotInfoEntryTag.cs │ │ ├── NikonVibrationReductionEntryTag.cs │ │ ├── NikonWorldTimeEntryTag.cs │ │ ├── OlympusMakerNoteEntryTag.cs │ │ ├── PanasonicMakerNoteEntryTag.cs │ │ ├── PentaxMakerNoteEntryTag.cs │ │ └── SonyMakerNoteEntryTag.cs ├── IIM │ ├── IIMReader.cs │ └── IIMTag.cs ├── Id3v1 │ ├── StringHandler.cs │ └── Tag.cs ├── Id3v2 │ ├── ExtendedHeader.cs │ ├── Footer.cs │ ├── Frame.cs │ ├── FrameFactory.cs │ ├── FrameHeader.cs │ ├── FrameTypes.cs │ ├── Frames │ │ ├── AttachedPictureFrame.cs │ │ ├── CommentsFrame.cs │ │ ├── GeneralEncapsulatedObjectFrame.cs │ │ ├── MusicCdIdentifierFrame.cs │ │ ├── PlayCountFrame.cs │ │ ├── PopularimeterFrame.cs │ │ ├── PrivateFrame.cs │ │ ├── RelativeVolumeFrame.cs │ │ ├── SynchronizedLyricsFrame.cs │ │ ├── TermsOfUseFrame.cs │ │ ├── TextIdentificationFrame.cs │ │ ├── UniqueFileIdentifierFrame.cs │ │ ├── UnknownFrame.cs │ │ └── UnsynchronisedLyricsFrame.cs │ ├── Header.cs │ ├── SynchData.cs │ └── Tag.cs ├── Image │ ├── Codec.cs │ ├── CombinedImageTag.cs │ ├── File.cs │ ├── ImageBlockFile.cs │ ├── ImageOrientation.cs │ ├── ImageTag.cs │ └── NoMetadata │ │ └── File.cs ├── Jpeg │ ├── Codec.cs │ ├── File.cs │ ├── JpegCommentTag.cs │ ├── Marker.cs │ └── Table.cs ├── ListBase.cs ├── Matroska │ ├── AudioTrack.cs │ ├── EBMLElement.cs │ ├── EBMLIDs.cs │ ├── File.cs │ ├── MatroskaIDs.cs │ ├── SubtitleTrack.cs │ ├── Tag.cs │ ├── Track.cs │ └── VideoTrack.cs ├── Mpc │ ├── File.cs │ └── StreamHeader.cs ├── Mpeg │ ├── AudioFile.cs │ ├── AudioHeader.cs │ ├── File.cs │ ├── VBRIHeader.cs │ ├── VideoHeader.cs │ └── XingHeader.cs ├── Mpeg4 │ ├── AppleTag.cs │ ├── Box.cs │ ├── BoxFactory.cs │ ├── BoxHeader.cs │ ├── BoxTypes.cs │ ├── Boxes │ │ ├── AppleAdditionalInfoBox.cs │ │ ├── AppleAnnotationBox.cs │ │ ├── AppleDataBox.cs │ │ ├── AppleElementaryStreamDescriptor.cs │ │ ├── AppleItemListBox.cs │ │ ├── FullBox.cs │ │ ├── IsoAudioSampleEntry.cs │ │ ├── IsoChunkLargeOffsetBox.cs │ │ ├── IsoChunkOffsetBox.cs │ │ ├── IsoFreeSpaceBox.cs │ │ ├── IsoHandlerBox.cs │ │ ├── IsoMetaBox.cs │ │ ├── IsoMovieHeaderBox.cs │ │ ├── IsoSampleDescriptionBox.cs │ │ ├── IsoSampleEntry.cs │ │ ├── IsoSampleTableBox.cs │ │ ├── IsoUserDataBox.cs │ │ ├── IsoVisualSampleEntry.cs │ │ ├── TextBox.cs │ │ ├── UnknownBox.cs │ │ └── UrlBox.cs │ ├── File.cs │ └── FileParser.cs ├── NonContainer │ ├── EndTag.cs │ ├── File.cs │ ├── StartTag.cs │ └── Tag.cs ├── Ogg │ ├── Bitstream.cs │ ├── Codec.cs │ ├── Codecs │ │ ├── Theora.cs │ │ └── Vorbis.cs │ ├── File.cs │ ├── GroupedComment.cs │ ├── Page.cs │ ├── PageHeader.cs │ ├── Paginator.cs │ └── XiphComment.cs ├── Picture.cs ├── Png │ ├── Codec.cs │ ├── File.cs │ └── PngTag.cs ├── Properties.cs ├── ReadOnlyByteVector.cs ├── Riff │ ├── AviHeaderList.cs │ ├── AviStream.cs │ ├── BitmapInfoHeader.cs │ ├── DivXTag.cs │ ├── File.cs │ ├── InfoTag.cs │ ├── List.cs │ ├── ListTag.cs │ ├── MovieIdTag.cs │ └── WaveFormatEx.cs ├── StringList.cs ├── SupportedMimeType.cs ├── Tag.cs ├── TagLib.sources ├── Tiff │ ├── Arw │ │ └── File.cs │ ├── BaseTiffFile.cs │ ├── Codec.cs │ ├── Cr2 │ │ └── File.cs │ ├── Dng │ │ └── File.cs │ ├── File.cs │ ├── Nef │ │ └── File.cs │ ├── Pef │ │ └── File.cs │ └── Rw2 │ │ ├── File.cs │ │ ├── IFDReader.cs │ │ └── IFDTag.cs ├── UnsupportedFormatException.cs ├── WavPack │ ├── File.cs │ └── StreamHeader.cs └── Xmp │ ├── XmlNodeExtensions.cs │ ├── XmpNode.cs │ ├── XmpNodeType.cs │ ├── XmpNodeVisitor.cs │ └── XmpTag.cs ├── bitbug_favicon.ico └── ncmdumpGUI.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | [Dd]ebug/ 3 | [Dd]ebugPublic/ 4 | [Rr]elease/ 5 | [Rr]eleases/ 6 | x64/ 7 | x86/ 8 | bld/ 9 | [Bb]in/ 10 | [Oo]bj/ 11 | [Ll]og/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 kpali 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ncmdumpGUI 2 | 3 | ### 声明 4 | 5 | 网易云音乐ncm文件格式转换,基于[anonymous5l/ncmdump-gui](https://github.com/anonymous5l/ncmdump-gui)修改 6 | 7 | 尊重音乐版权,本项目仅方便已购买的音乐在其他软件或设备播放,请勿大范围传播或用于商业行为。 8 | 9 | ### 使用方法 10 | 11 | 1. Windows7及以上版本 12 | 2. 先安装`.NET Framework 4.6`(或其他兼容版本) 13 | 3. 然后运行`ncmdumpGUI.exe` 14 | 4. 根据界面提示操作即可。 15 | 16 | ### 开发环境 17 | 18 | Visual Studio 2017 19 | 20 | .NET Framework 4.6.1 -------------------------------------------------------------------------------- /ncmdumpGUI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ncmdumpGUI", "ncmdumpGUI\ncmdumpGUI.csproj", "{A5187149-D5E9-4C7A-807B-6F6B9695ADA3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A5187149-D5E9-4C7A-807B-6F6B9695ADA3}.Debug|x86.ActiveCfg = Debug|x86 15 | {A5187149-D5E9-4C7A-807B-6F6B9695ADA3}.Debug|x86.Build.0 = Debug|x86 16 | {A5187149-D5E9-4C7A-807B-6F6B9695ADA3}.Release|x86.ActiveCfg = Release|x86 17 | {A5187149-D5E9-4C7A-807B-6F6B9695ADA3}.Release|x86.Build.0 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {394A68CA-26B6-46D5-AA26-08B6A01C41DB} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ncmdumpGUI/Delegatres.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ncmdumpGUI 8 | { 9 | public delegate object END_INVOKE(IAsyncResult asynRet); 10 | public delegate IAsyncResult PROGRESS_DIALOG(String msg); 11 | public delegate bool IS_FUN(); 12 | } 13 | -------------------------------------------------------------------------------- /ncmdumpGUI/ExtFileStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ncmdumpGUI 9 | { 10 | public static class ExtFileStream 11 | { 12 | public static uint ReadUInt32(this FileStream fs) 13 | { 14 | byte[] raw = new byte[4]; 15 | int ret = fs.Read(raw, 0, raw.Length); 16 | 17 | if (ret != raw.Length) 18 | { 19 | throw new IOException("out of stream"); 20 | } 21 | 22 | return BitConverter.ToUInt32(raw, 0); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ncmdumpGUI/NeteaseCopyrightData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ncmdumpGUI 9 | { 10 | [DataContract] 11 | class NeteaseCopyrightData 12 | { 13 | [DataMember(Name = "musicId")] 14 | public int MusicId { get; set; } 15 | 16 | [DataMember(Name = "musicName")] 17 | public string MusicName { get; set; } 18 | 19 | [DataMember(Name = "artist")] 20 | public List> Artist { get; set; } 21 | 22 | [DataMember(Name = "albumId")] 23 | public int AlbumId { get; set; } 24 | 25 | [DataMember(Name = "album")] 26 | public string Album { get; set; } 27 | 28 | [DataMember(Name = "albumPicDocId")] 29 | public string AlbumPicDocId { get; set; } 30 | 31 | [DataMember(Name = "albumPic")] 32 | public string AlbumPic { get; set; } 33 | 34 | [DataMember(Name = "bitrate")] 35 | public int Bitrate { get; set; } 36 | 37 | [DataMember(Name = "mp3DocId")] 38 | public string Mp3DocId { get; set; } 39 | 40 | [DataMember(Name = "duration")] 41 | public int Duration { get; set; } 42 | 43 | [DataMember(Name = "mvId")] 44 | public int MvId { get; set; } 45 | 46 | [DataMember(Name = "alias")] 47 | public List Alias { get; set; } 48 | 49 | // missing `transNames` unknow type usually empty 50 | 51 | [DataMember(Name = "format")] 52 | public string Format { get; set; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /ncmdumpGUI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace ncmdumpGUI 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Main()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ncmdumpGUI/ProgressDialogDel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ncmdumpGUI 8 | { 9 | /// 10 | /// 进度提示委托类 11 | /// 12 | public sealed class ProgressDialogDel 13 | { 14 | public ProgressDialogDel(PROGRESS_DIALOG begin, PROGRESS_DIALOG update, PROGRESS_DIALOG end, END_INVOKE endInvoke, IS_FUN isProgressDlgAlive) 15 | { 16 | BeginProgressDlg = begin; 17 | UpdateProgressDlg = update; 18 | EndProgressDlg = end; 19 | EndInvoke = endInvoke; 20 | ProgressDlgAlive = isProgressDlgAlive; 21 | } 22 | //启动提示窗体 23 | public PROGRESS_DIALOG BeginProgressDlg; 24 | //更新提示窗体 25 | public PROGRESS_DIALOG UpdateProgressDlg; 26 | //结束提示窗体 27 | public PROGRESS_DIALOG EndProgressDlg; 28 | public END_INVOKE EndInvoke; 29 | //判断当前提示窗体是否有效 30 | private IS_FUN ProgressDlgAlive; 31 | public bool IsProgressDlgAlive 32 | { 33 | get 34 | { 35 | return ProgressDlgAlive(); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ncmdumpGUI/ProgressDlg.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ncmdumpGUI 2 | { 3 | partial class ProgressDlg 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.labelProgress = new System.Windows.Forms.Label(); 32 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 33 | this.btnCancel = new System.Windows.Forms.Button(); 34 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 35 | this.SuspendLayout(); 36 | // 37 | // labelProgress 38 | // 39 | this.labelProgress.AutoSize = true; 40 | this.labelProgress.Location = new System.Drawing.Point(33, 26); 41 | this.labelProgress.Name = "labelProgress"; 42 | this.labelProgress.Size = new System.Drawing.Size(47, 12); 43 | this.labelProgress.TabIndex = 0; 44 | this.labelProgress.Text = "正在..."; 45 | this.labelProgress.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 46 | // 47 | // pictureBox1 48 | // 49 | this.pictureBox1.Image = global::ncmdumpGUI.Properties.Resources.spinner; 50 | this.pictureBox1.Location = new System.Drawing.Point(10, 24); 51 | this.pictureBox1.Name = "pictureBox1"; 52 | this.pictureBox1.Size = new System.Drawing.Size(16, 16); 53 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; 54 | this.pictureBox1.TabIndex = 1; 55 | this.pictureBox1.TabStop = false; 56 | // 57 | // btnCancel 58 | // 59 | this.btnCancel.Location = new System.Drawing.Point(276, 47); 60 | this.btnCancel.Name = "btnCancel"; 61 | this.btnCancel.Size = new System.Drawing.Size(75, 23); 62 | this.btnCancel.TabIndex = 2; 63 | this.btnCancel.Text = "取消"; 64 | this.btnCancel.UseVisualStyleBackColor = true; 65 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 66 | // 67 | // ProgressDlg 68 | // 69 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 70 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 71 | this.ClientSize = new System.Drawing.Size(363, 84); 72 | this.ControlBox = false; 73 | this.Controls.Add(this.btnCancel); 74 | this.Controls.Add(this.pictureBox1); 75 | this.Controls.Add(this.labelProgress); 76 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 77 | this.MaximizeBox = false; 78 | this.MinimizeBox = false; 79 | this.Name = "ProgressDlg"; 80 | this.ShowIcon = false; 81 | this.ShowInTaskbar = false; 82 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 83 | this.Text = "ProgressDlg"; 84 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 85 | this.ResumeLayout(false); 86 | this.PerformLayout(); 87 | 88 | } 89 | 90 | #endregion 91 | 92 | public System.Windows.Forms.Label labelProgress; 93 | private System.Windows.Forms.PictureBox pictureBox1; 94 | public System.Windows.Forms.Button btnCancel; 95 | } 96 | } -------------------------------------------------------------------------------- /ncmdumpGUI/ProgressDlg.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace ncmdumpGUI 12 | { 13 | public partial class ProgressDlg : Form 14 | { 15 | private Action _OnCancel; 16 | public ProgressDlg(String text, String caption) 17 | { 18 | InitializeComponent(); 19 | this.btnCancel.Visible = false; 20 | this.labelProgress.Text = text; 21 | this.Text = caption; 22 | //this.Width = 24 + this.labelProgress.Size.Width + 24; 23 | //this.labelProgress.Location = new Point(((this.Width-labelProgress.Size.Width)/2) + 26, this.labelProgress.Location.Y); 24 | this.labelProgress.Location = new Point(33, this.labelProgress.Location.Y); 25 | } 26 | bool isCancelInProgress = false; 27 | 28 | public void ShowProgress(Form parent) 29 | { 30 | StartPosition = FormStartPosition.Manual; 31 | int sY, sX; 32 | sY = (parent.Height - Height) / 2; 33 | sX = (parent.Width - Width) / 2; 34 | Location = parent.PointToScreen(new Point(sX, sY)); 35 | Show(parent); 36 | Update(); 37 | } 38 | 39 | public void setCancelButtonVisible(bool visible) 40 | { 41 | this.btnCancel.Visible = visible; 42 | } 43 | 44 | public bool getIsCancelInProgress() 45 | { 46 | return this.isCancelInProgress; 47 | } 48 | 49 | /// 50 | /// 设置取消按钮事件 51 | /// 52 | /// 53 | public void SetCancelEvent(Action ac) 54 | { 55 | _OnCancel = ac; 56 | } 57 | 58 | private void btnCancel_Click(object sender, EventArgs e) 59 | { 60 | this.btnCancel.Enabled = false; 61 | this.btnCancel.Text = "取消中..."; 62 | isCancelInProgress = true; 63 | if (_OnCancel != null) _OnCancel(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ncmdumpGUI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ncmdumpGUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ncmdumpGUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("a5187149-d5e9-4c7a-807b-6f6b9695ada3")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ncmdumpGUI/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ncmdumpGUI.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ncmdumpGUI.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。 65 | /// 66 | internal static System.Drawing.Bitmap spinner { 67 | get { 68 | object obj = ResourceManager.GetObject("spinner", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /ncmdumpGUI/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ncmdumpGUI.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ncmdumpGUI/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ncmdumpGUI/Resources/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkylin/ncmdumpGUI/4a1497e39d27f4837753b18274f265b79410ac82/ncmdumpGUI/Resources/spinner.gif -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Aac/BitStream.cs: -------------------------------------------------------------------------------- 1 | // 2 | // BitStream.cs: Helper to read bits from a byte array. 3 | // 4 | // Copyright (C) 2009 Patrick Dehne 5 | // 6 | // This library is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License version 8 | // 2.1 as published by the Free Software Foundation. 9 | // 10 | // This library is distributed in the hope that it will be useful, but 11 | // WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | // Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public 16 | // License along with this library; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | // USA 19 | // 20 | 21 | using System; 22 | using System.Collections.Generic; 23 | using System.Text; 24 | using System.Collections; 25 | using System.Diagnostics; 26 | 27 | namespace TagLib.Aac 28 | { 29 | /// 30 | /// This class is used to help reading arbitary number of bits from 31 | /// a fixed array of bytes 32 | /// 33 | public class BitStream 34 | { 35 | #region Private Fields 36 | 37 | private BitArray bits; 38 | private int bitindex; 39 | 40 | #endregion 41 | 42 | 43 | 44 | #region Constructors 45 | 46 | /// 47 | /// Construct a new . 48 | /// 49 | /// 50 | /// A , must be 7 bytes long. 51 | /// 52 | public BitStream(byte[] buffer) 53 | { 54 | Debug.Assert(buffer.Length == 7, "buffer.Length == 7", "buffer size invalid"); 55 | 56 | if (buffer.Length != 7) 57 | throw new ArgumentException("Buffer size must be 7 bytes"); 58 | 59 | // Reverse bits 60 | bits = new BitArray(buffer.Length * 8); 61 | for (int i = 0; i < buffer.Length; i++) 62 | { 63 | for (int y = 0; y < 8; y++) 64 | { 65 | bits[i * 8 + y] = ((buffer[i] & (1 << (7 - y))) > 0); 66 | } 67 | } 68 | 69 | bitindex = 0; 70 | } 71 | 72 | #endregion 73 | 74 | 75 | 76 | #region Public Methods 77 | 78 | /// 79 | /// Reads an Int32 from the bitstream 80 | /// 81 | /// 82 | /// A value containing the number 83 | /// of bits to read from the bitstream 84 | /// 85 | public int ReadInt32(int numberOfBits) 86 | { 87 | Debug.Assert(numberOfBits > 0, "numberOfBits < 1"); 88 | Debug.Assert(numberOfBits <= 32, "numberOfBits <= 32"); 89 | 90 | if (numberOfBits <= 0) 91 | throw new ArgumentException("Number of bits to read must be >= 1"); 92 | 93 | if (numberOfBits > 32) 94 | throw new ArgumentException("Number of bits to read must be <= 32"); 95 | 96 | int value = 0; 97 | int start = bitindex + numberOfBits - 1; 98 | for (int i = 0; i < numberOfBits; i++) 99 | { 100 | value += bits[start] ? (1 << i) : 0; 101 | bitindex++; 102 | start--; 103 | } 104 | 105 | return value; 106 | } 107 | 108 | #endregion 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Asf/Guid.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Guid.cs: Provides common GUID values used by ASF Objects. 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Copyright (C) 2006-2007 Brian Nickel 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | namespace TagLib.Asf { 27 | /// 28 | /// This static class contains common 29 | /// values used by ASF Objects. 30 | /// 31 | public static class Guid 32 | { 33 | /// 34 | /// Indicates that an object is a . 36 | /// 37 | public static readonly System.Guid AsfContentDescriptionObject = 38 | new System.Guid ("75B22633-668E-11CF-A6D9-00AA0062CE6C"); 39 | 40 | /// 41 | /// Indicates that an object is a . 43 | /// 44 | public static readonly System.Guid AsfExtendedContentDescriptionObject = 45 | new System.Guid ("D2D0A440-E307-11D2-97F0-00A0C95EA850"); 46 | 47 | /// 48 | /// Indicates that an object is a . 50 | /// 51 | public static readonly System.Guid AsfFilePropertiesObject = 52 | new System.Guid ("8CABDCA1-A947-11CF-8EE4-00C00C205365"); 53 | 54 | /// 55 | /// Indicates that an object is a . 57 | /// 58 | public static readonly System.Guid AsfHeaderExtensionObject = 59 | new System.Guid ("5FBF03B5-A92E-11CF-8EE3-00C00C205365"); 60 | 61 | /// 62 | /// Indicates that an object is a . 64 | /// 65 | public static readonly System.Guid AsfHeaderObject = 66 | new System.Guid ("75B22630-668E-11CF-A6D9-00AA0062CE6C"); 67 | 68 | /// 69 | /// Indicates that an object is a . 71 | /// 72 | public static readonly System.Guid AsfMetadataLibraryObject = 73 | new System.Guid ("44231C94-9498-49D1-A141-1D134E457054"); 74 | 75 | /// 76 | /// Indicates that an object is a . 78 | /// 79 | public static readonly System.Guid AsfPaddingObject = 80 | new System.Guid ("1806D474-CADF-4509-A4BA-9AABCB96AAE8"); 81 | 82 | /// 83 | /// Indicates that an object is a . 85 | /// 86 | public static readonly System.Guid AsfStreamPropertiesObject = 87 | new System.Guid ("B7DC0791-A9B7-11CF-8EE6-00C00C205365"); 88 | 89 | 90 | /// 91 | /// Indicates that a 92 | /// contains information about an audio stream. 93 | /// 94 | public static readonly System.Guid AsfAudioMedia = 95 | new System.Guid ("F8699E40-5B4D-11CF-A8FD-00805F5C442B"); 96 | 97 | /// 98 | /// Indicates that a 99 | /// contains information about an video stream. 100 | /// 101 | public static readonly System.Guid AsfVideoMedia = 102 | new System.Guid ("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B"); 103 | 104 | /// 105 | /// Indicates a placeholder portion of a file is correctly 106 | /// encoded. 107 | /// 108 | public static readonly System.Guid AsfReserved1 = 109 | new System.Guid ("ABD3D211-A9BA-11cf-8EE6-00C00C205365"); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Asf/PaddingObject.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PaddingObject.cs: Provides a representation of an ASF Padding object which 3 | // can be read from and written to disk. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | 27 | namespace TagLib.Asf { 28 | /// 29 | /// This class extends to provide a 30 | /// representation of an ASF Padding object which can be read from 31 | /// and written to disk. 32 | /// 33 | public class PaddingObject : Object 34 | { 35 | #region Private Fields 36 | 37 | /// 38 | /// Contains the size of the current instance. 39 | /// 40 | private ulong size; 41 | 42 | #endregion 43 | 44 | 45 | 46 | #region Constructors 47 | 48 | /// 49 | /// Constructs and initializes a new instance of by reading the contents from a 51 | /// specified position in a specified file. 52 | /// 53 | /// 54 | /// A object containing the file from 55 | /// which the contents of the new instance are to be read. 56 | /// 57 | /// 58 | /// A value specify at what position to 59 | /// read the object. 60 | /// 61 | /// 62 | /// is . 63 | /// 64 | /// 65 | /// is less than zero or greater 66 | /// than the size of the file. 67 | /// 68 | /// 69 | /// The object read from disk does not have the correct GUID 70 | /// or smaller than the minimum size. 71 | /// 72 | public PaddingObject (Asf.File file, long position) 73 | : base (file, position) 74 | { 75 | if (!Guid.Equals (Asf.Guid.AsfPaddingObject)) 76 | throw new CorruptFileException ( 77 | "Object GUID incorrect."); 78 | 79 | if (OriginalSize < 24) 80 | throw new CorruptFileException ( 81 | "Object size too small."); 82 | 83 | size = OriginalSize; 84 | } 85 | 86 | /// 87 | /// Constructs and initializes a new instance of of a specified size. 89 | /// 90 | /// 91 | /// A value specifying the number of 92 | /// bytes the new instance is to take up on disk. 93 | /// 94 | public PaddingObject (uint size) 95 | : base (Asf.Guid.AsfPaddingObject) 96 | { 97 | this.size = size; 98 | } 99 | 100 | #endregion 101 | 102 | 103 | 104 | #region Prublic Properties 105 | 106 | /// 107 | /// Gets and sets the number of bytes the current instance 108 | /// will take up on disk. 109 | /// 110 | /// 111 | /// A value containing the size of the 112 | /// current instance on disk. 113 | /// 114 | public ulong Size { 115 | get {return size;} 116 | set {size = value;} 117 | } 118 | 119 | #endregion 120 | 121 | 122 | 123 | #region Public Methods 124 | 125 | /// 126 | /// Renders the current instance as a raw ASF object. 127 | /// 128 | /// 129 | /// A object containing the 130 | /// rendered version of the current instance. 131 | /// 132 | public override ByteVector Render () 133 | { 134 | return Render (new ByteVector ((int) (size - 24))); 135 | } 136 | 137 | #endregion 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Asf/UnknownObject.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnknownObject.cs: Provides a simple and generic representation of an object 3 | // not identified by TagLib# so that its contents may be preserved. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | 27 | namespace TagLib.Asf 28 | { 29 | /// 30 | /// This class extends to provide a 31 | /// representation of an unknown object which can be read from and 32 | /// written to disk. 33 | /// 34 | public class UnknownObject : Object 35 | { 36 | #region Private Fields 37 | 38 | private ByteVector data; 39 | 40 | #endregion 41 | 42 | 43 | 44 | #region Constructors 45 | 46 | /// 47 | /// Constructs and initializes a new instance of by reading the contents from a 49 | /// specified position in a specified file. 50 | /// 51 | /// 52 | /// A object containing the file from 53 | /// which the contents of the new instance are to be read. 54 | /// 55 | /// 56 | /// A value specify at what position to 57 | /// read the object. 58 | /// 59 | /// 60 | /// is . 61 | /// 62 | /// 63 | /// is less than zero or greater 64 | /// than the size of the file. 65 | /// 66 | public UnknownObject (Asf.File file, long position) 67 | : base (file, position) 68 | { 69 | data = file.ReadBlock ((int) (OriginalSize - 24)); 70 | } 71 | 72 | #endregion 73 | 74 | 75 | 76 | #region Public Properties 77 | 78 | /// 79 | /// Gets and sets the data contained in the current instance. 80 | /// 81 | /// 82 | /// A object containing the data 83 | /// contained in the current instance. 84 | /// 85 | public ByteVector Data { 86 | get {return data;} 87 | set {data = value;} 88 | } 89 | 90 | #endregion 91 | 92 | 93 | 94 | #region Public Methods 95 | 96 | /// 97 | /// Renders the current instance as a raw ASF object. 98 | /// 99 | /// 100 | /// A object containing the 101 | /// rendered version of the current instance. 102 | /// 103 | public override ByteVector Render () 104 | { 105 | return Render (data); 106 | } 107 | 108 | #endregion 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Gif/Codec.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Codec.cs: 3 | // 4 | // Author: 5 | // Mike Gemuende (mike@gemuende.be) 6 | // 7 | // Copyright (C) 2010 Mike Gemuende 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | namespace TagLib.Gif 27 | { 28 | 29 | /// 30 | /// A Gif photo codec. Contains basic photo details. 31 | /// 32 | public class Codec : Image.Codec 33 | { 34 | 35 | /// 36 | /// Gets a text description of the media represented by the 37 | /// current instance. 38 | /// 39 | /// 40 | /// A object containing a description 41 | /// of the media represented by the current instance. 42 | /// 43 | public override string Description { get { return "GIF File"; } } 44 | 45 | 46 | /// 47 | /// Constructs a new with the given width 48 | /// and height. 49 | /// 50 | /// 51 | /// The width of the photo. 52 | /// 53 | /// 54 | /// The height of the photo. 55 | /// 56 | /// 57 | /// A new instance. 58 | /// 59 | public Codec (int width, int height) 60 | : base (width, height) {} 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Gif/GifCommentTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // GifCommentTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2010 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | using System; 27 | 28 | using TagLib.Image; 29 | 30 | namespace TagLib.Gif 31 | { 32 | /// 33 | /// Contains the Gif comment. 34 | /// 35 | public class GifCommentTag : ImageTag 36 | { 37 | #region Constructors 38 | 39 | /// 40 | /// Constructor. 41 | /// 42 | /// 43 | /// The value of the comment. 44 | /// 45 | public GifCommentTag (string value) 46 | { 47 | Value = value; 48 | } 49 | 50 | /// 51 | /// Constructor. Creates a new empty comment. 52 | /// 53 | public GifCommentTag () { 54 | Value = null; 55 | } 56 | 57 | #endregion 58 | 59 | #region Public Properties 60 | 61 | /// 62 | /// The value of the comment represented by the current instance. 63 | /// 64 | public string Value { get; set; } 65 | 66 | /// 67 | /// Gets or sets the comment for the image described 68 | /// by the current instance. 69 | /// 70 | /// 71 | /// A containing the comment of the 72 | /// current instace. 73 | /// 74 | public override string Comment { 75 | get { return Value; } 76 | set { Value = value; } 77 | } 78 | 79 | #endregion 80 | 81 | #region Public Methods 82 | 83 | /// 84 | /// Gets the tag types contained in the current instance. 85 | /// 86 | /// 87 | /// Always . 88 | /// 89 | public override TagTypes TagTypes { 90 | get { return TagTypes.GifComment; } 91 | } 92 | 93 | /// 94 | /// Clears the values stored in the current instance. 95 | /// 96 | public override void Clear () 97 | { 98 | Value = null; 99 | } 100 | 101 | #endregion 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/ByteIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ByteIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a byte value 30 | /// 31 | public class ByteIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public byte Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public ByteIFDEntry (ushort tag, byte value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Byte; 92 | count = 1; 93 | 94 | return Value; 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/ByteVectorIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ByteVectorIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains an BYTE value with a count > 1 (byte sequence). 30 | /// 31 | public class ByteVectorIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The data which is stored by the current instance 43 | /// 44 | public ByteVector Data { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public ByteVectorIFDEntry (ushort tag, ByteVector data) 61 | { 62 | Tag = tag; 63 | Data = data; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Byte; 92 | count = (uint) Data.Count; 93 | 94 | return Data; 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/LongArrayIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // LongArrayIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a LONG value with a count > 1 30 | /// 31 | public class LongArrayIFDEntry : ArrayIFDEntry 32 | { 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Construcor. 38 | /// 39 | /// 40 | /// A with the tag ID of the entry this instance 41 | /// represents 42 | /// 43 | /// 44 | /// A to be stored 45 | /// 46 | public LongArrayIFDEntry (ushort tag, uint [] values) : base (tag) 47 | { 48 | Values = values; 49 | } 50 | 51 | #endregion 52 | 53 | #region Public Methods 54 | 55 | /// 56 | /// Renders the current instance to a 57 | /// 58 | /// 59 | /// A indicating the endianess for rendering. 60 | /// 61 | /// 62 | /// A with the offset, the data is stored. 63 | /// 64 | /// 65 | /// A the ID of the type, which is rendered 66 | /// 67 | /// 68 | /// A with the count of the values which are 69 | /// rendered. 70 | /// 71 | /// 72 | /// A with the rendered data. 73 | /// 74 | public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 75 | { 76 | type = (ushort) IFDEntryType.Long; 77 | count = (uint) Values.Length; 78 | 79 | ByteVector data = new ByteVector (); 80 | foreach (uint value in Values) 81 | data.Add (ByteVector.FromUInt (value, is_bigendian)); 82 | 83 | return data; 84 | } 85 | 86 | #endregion 87 | 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/LongIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // LongIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a LONG value. 30 | /// 31 | public class LongIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public uint Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public LongIFDEntry (ushort tag, uint value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Long; 92 | count = 1; 93 | 94 | return ByteVector.FromUInt (Value, is_bigendian); 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/RationalArrayIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // RationalArrayIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a RATIONAL value with a count > 1 30 | /// 31 | public class RationalArrayIFDEntry : ArrayIFDEntry 32 | { 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Construcor. 38 | /// 39 | /// 40 | /// A with the tag ID of the entry this instance 41 | /// represents 42 | /// 43 | /// 44 | /// A to be stored 45 | /// 46 | public RationalArrayIFDEntry (ushort tag, Rational [] entries) 47 | : base (tag) 48 | { 49 | Values = entries; 50 | } 51 | 52 | #endregion 53 | 54 | #region Public Methods 55 | 56 | /// 57 | /// Renders the current instance to a 58 | /// 59 | /// 60 | /// A indicating the endianess for rendering. 61 | /// 62 | /// 63 | /// A with the offset, the data is stored. 64 | /// 65 | /// 66 | /// A the ID of the type, which is rendered 67 | /// 68 | /// 69 | /// A with the count of the values which are 70 | /// rendered. 71 | /// 72 | /// 73 | /// A with the rendered data. 74 | /// 75 | public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 76 | { 77 | type = (ushort) IFDEntryType.Rational; 78 | count = (uint) Values.Length; 79 | 80 | ByteVector data = new ByteVector (); 81 | foreach (Rational rational in Values) { 82 | data.Add (ByteVector.FromUInt (rational.Numerator, is_bigendian)); 83 | data.Add (ByteVector.FromUInt (rational.Denominator, is_bigendian)); 84 | } 85 | 86 | return data; 87 | } 88 | 89 | #endregion 90 | 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/RationalIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // RationalIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a RATIONAL value. 30 | /// 31 | public class RationalIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public Rational Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A 59 | /// 60 | public RationalIFDEntry (ushort tag, Rational value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Rational; 92 | count = 1; 93 | 94 | ByteVector data = new ByteVector (); 95 | data.Add (ByteVector.FromUInt (Value.Numerator, is_bigendian)); 96 | data.Add (ByteVector.FromUInt (Value.Denominator, is_bigendian)); 97 | 98 | return data; 99 | } 100 | 101 | #endregion 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SByteIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SByteIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a signed byte value 30 | /// 31 | public class SByteIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public sbyte Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public SByteIFDEntry (ushort tag, sbyte value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.SByte; 92 | count = 1; 93 | 94 | return (byte) Value; 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SLongArrayIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SLongArrayIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a SLONG value with a count > 1 30 | /// 31 | public class SLongArrayIFDEntry : ArrayIFDEntry 32 | { 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Construcor. 38 | /// 39 | /// 40 | /// A with the tag ID of the entry this instance 41 | /// represents 42 | /// 43 | /// 44 | /// A to be stored 45 | /// 46 | public SLongArrayIFDEntry (ushort tag, int [] values) : base (tag) 47 | { 48 | Values = values; 49 | } 50 | 51 | #endregion 52 | 53 | #region Public Methods 54 | 55 | /// 56 | /// Renders the current instance to a 57 | /// 58 | /// 59 | /// A indicating the endianess for rendering. 60 | /// 61 | /// 62 | /// A with the offset, the data is stored. 63 | /// 64 | /// 65 | /// A the ID of the type, which is rendered 66 | /// 67 | /// 68 | /// A with the count of the values which are 69 | /// rendered. 70 | /// 71 | /// 72 | /// A with the rendered data. 73 | /// 74 | public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 75 | { 76 | type = (ushort) IFDEntryType.Long; 77 | count = (uint) Values.Length; 78 | 79 | ByteVector data = new ByteVector (); 80 | foreach (int value in Values) 81 | data.Add (ByteVector.FromInt (value, is_bigendian)); 82 | 83 | return data; 84 | } 85 | 86 | #endregion 87 | 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SLongIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SLongIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a signed LONG value. 30 | /// 31 | public class SLongIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public int Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public SLongIFDEntry (ushort tag, int value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.SLong; 92 | count = 1; 93 | 94 | return ByteVector.FromInt (Value, is_bigendian); 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SRationalArrayIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SRationalArrayIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a SRATIONAL value with a count > 1 30 | /// 31 | public class SRationalArrayIFDEntry : ArrayIFDEntry 32 | { 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Construcor. 38 | /// 39 | /// 40 | /// A with the tag ID of the entry this instance 41 | /// represents 42 | /// 43 | /// 44 | /// A to be stored 45 | /// 46 | public SRationalArrayIFDEntry (ushort tag, SRational [] entries) 47 | : base (tag) 48 | { 49 | Values = entries; 50 | } 51 | 52 | #endregion 53 | 54 | #region Public Methods 55 | 56 | /// 57 | /// Renders the current instance to a 58 | /// 59 | /// 60 | /// A indicating the endianess for rendering. 61 | /// 62 | /// 63 | /// A with the offset, the data is stored. 64 | /// 65 | /// 66 | /// A the ID of the type, which is rendered 67 | /// 68 | /// 69 | /// A with the count of the values which are 70 | /// rendered. 71 | /// 72 | /// 73 | /// A with the rendered data. 74 | /// 75 | public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 76 | { 77 | type = (ushort) IFDEntryType.SRational; 78 | count = (uint) Values.Length; 79 | 80 | ByteVector data = new ByteVector (); 81 | foreach (SRational rational in Values) { 82 | data.Add (ByteVector.FromInt (rational.Numerator, is_bigendian)); 83 | data.Add (ByteVector.FromInt (rational.Denominator, is_bigendian)); 84 | } 85 | 86 | return data; 87 | } 88 | 89 | #endregion 90 | 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SRationalIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SRationalIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a SRATIONAL value. 30 | /// 31 | public class SRationalIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public SRational Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public SRationalIFDEntry (ushort tag, SRational value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.SRational; 92 | count = 1; 93 | 94 | ByteVector data = new ByteVector (); 95 | data.Add (ByteVector.FromInt (Value.Numerator, is_bigendian)); 96 | data.Add (ByteVector.FromInt (Value.Denominator, is_bigendian)); 97 | 98 | return data; 99 | } 100 | 101 | #endregion 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SShortArrayIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SShortArrayIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a SSHORT value with a count > 1 30 | /// 31 | public class SShortArrayIFDEntry : ArrayIFDEntry 32 | { 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Construcor. 38 | /// 39 | /// 40 | /// A with the tag ID of the entry this instance 41 | /// represents 42 | /// 43 | /// 44 | /// A to be stored 45 | /// 46 | public SShortArrayIFDEntry (ushort tag, short [] values) : base (tag) 47 | { 48 | Values = values; 49 | } 50 | 51 | #endregion 52 | 53 | #region Public Methods 54 | 55 | /// 56 | /// Renders the current instance to a 57 | /// 58 | /// 59 | /// A indicating the endianess for rendering. 60 | /// 61 | /// 62 | /// A with the offset, the data is stored. 63 | /// 64 | /// 65 | /// A the ID of the type, which is rendered 66 | /// 67 | /// 68 | /// A with the count of the values which are 69 | /// rendered. 70 | /// 71 | /// 72 | /// A with the rendered data. 73 | /// 74 | public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 75 | { 76 | type = (ushort) IFDEntryType.SShort; 77 | count = (uint) Values.Length; 78 | 79 | ByteVector data = new ByteVector (); 80 | foreach (ushort value in Values) 81 | data.Add (ByteVector.FromUShort ((ushort) value, is_bigendian)); 82 | 83 | return data; 84 | } 85 | 86 | #endregion 87 | 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SShortIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SShortIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a Signed SHORT value. 30 | /// 31 | public class SShortIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public short Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public SShortIFDEntry (ushort tag, short value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.SShort; 92 | count = 1; 93 | 94 | return ByteVector.FromUShort ((ushort) Value, is_bigendian); 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/ShortArrayIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ShortArrayIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a SHORT value with a count > 1 30 | /// 31 | public class ShortArrayIFDEntry : ArrayIFDEntry 32 | { 33 | 34 | #region Constructors 35 | 36 | /// 37 | /// Construcor. 38 | /// 39 | /// 40 | /// A with the tag ID of the entry this instance 41 | /// represents 42 | /// 43 | /// 44 | /// A to be stored 45 | /// 46 | public ShortArrayIFDEntry (ushort tag, ushort [] values) : base (tag) 47 | { 48 | Values = values; 49 | } 50 | 51 | #endregion 52 | 53 | #region Public Methods 54 | 55 | /// 56 | /// Renders the current instance to a 57 | /// 58 | /// 59 | /// A indicating the endianess for rendering. 60 | /// 61 | /// 62 | /// A with the offset, the data is stored. 63 | /// 64 | /// 65 | /// A the ID of the type, which is rendered 66 | /// 67 | /// 68 | /// A with the count of the values which are 69 | /// rendered. 70 | /// 71 | /// 72 | /// A with the rendered data. 73 | /// 74 | public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 75 | { 76 | type = (ushort) IFDEntryType.Short; 77 | count = (uint) Values.Length; 78 | 79 | ByteVector data = new ByteVector (); 80 | foreach (ushort value in Values) 81 | data.Add (ByteVector.FromUShort (value, is_bigendian)); 82 | 83 | return data; 84 | } 85 | 86 | #endregion 87 | 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/ShortIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ShortIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a SHORT value. 30 | /// 31 | public class ShortIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public ushort Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public ShortIFDEntry (ushort tag, ushort value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Short; 92 | count = 1; 93 | 94 | return ByteVector.FromUShort (Value, is_bigendian); 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/StringIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // StringIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains an ASCII STRING value. 30 | /// 31 | public class StringIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The value which is stored by the current instance 43 | /// 44 | public string Value { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public StringIFDEntry (ushort tag, string value) 61 | { 62 | Tag = tag; 63 | Value = value; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Ascii; 92 | 93 | ByteVector data = Value; 94 | data.Add ("\0"); 95 | 96 | count = (uint) data.Count; 97 | 98 | return data; 99 | } 100 | 101 | #endregion 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SubIFDArrayEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SubIFDArrayEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | using System.Collections.Generic; 26 | 27 | namespace TagLib.IFD.Entries 28 | { 29 | /// 30 | /// Contains the SubIFDs IFD entry. 31 | /// 32 | public class SubIFDArrayEntry : IFDEntry 33 | { 34 | 35 | /// 36 | /// The ID of the tag, the current instance belongs to 37 | /// 38 | public ushort Tag { 39 | get; 40 | set; 41 | } 42 | 43 | /// 44 | /// The structures of the IFDs to which this entry points. 45 | /// 46 | public IFDStructure [] Entries { get; private set; } 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Constructor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A set of ifd structures. 59 | /// 60 | public SubIFDArrayEntry (ushort tag, List entries) 61 | { 62 | Tag = tag; 63 | Entries = entries.ToArray (); 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | throw new NotImplementedException ("Not implemented yet!"); 92 | } 93 | 94 | #endregion 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/SubIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SubIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains a Sub IFD. 30 | /// 31 | public class SubIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The type of the IFD entry. 43 | /// 44 | public ushort Type { get; private set; } 45 | 46 | /// 47 | /// The count of the IFD entry. 48 | /// 49 | public uint Count { get; private set; } 50 | 51 | /// 52 | /// The structure of the sub-ifd which is stored by the current 53 | /// instance 54 | /// 55 | public IFDStructure Structure { get; private set; } 56 | 57 | /// 58 | /// The number of entries in the entire IFD. 59 | /// 60 | public int ChildCount { 61 | get { 62 | int sum = 0; 63 | foreach (var directory in Structure.Directories) 64 | sum += directory.Count; 65 | return sum; 66 | } 67 | } 68 | 69 | /// 70 | /// Construcor. 71 | /// 72 | /// 73 | /// A with the tag ID of the entry this instance 74 | /// represents 75 | /// 76 | /// 77 | /// A with the type of the IFD entry. 78 | /// 79 | /// 80 | /// A with the count of the IFD entry. 81 | /// 82 | /// 83 | /// A to be stored 84 | /// 85 | public SubIFDEntry (ushort tag, ushort type, uint count, IFDStructure structure) 86 | { 87 | Tag = tag; 88 | Type = type; 89 | Count = count; 90 | Structure = structure; 91 | } 92 | 93 | #endregion 94 | 95 | #region Public Methods 96 | 97 | /// 98 | /// Renders the current instance to a 99 | /// 100 | /// 101 | /// A indicating the endianess for rendering. 102 | /// 103 | /// 104 | /// A with the offset, the data is stored. 105 | /// 106 | /// 107 | /// A the ID of the type, which is rendered 108 | /// 109 | /// 110 | /// A with the count of the values which are 111 | /// rendered. 112 | /// 113 | /// 114 | /// A with the rendered data. 115 | /// 116 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 117 | { 118 | type = (ushort) Type; 119 | count = 1; 120 | 121 | count = Count; 122 | return new IFDRenderer (is_bigendian, Structure, offset).Render (); 123 | } 124 | 125 | #endregion 126 | 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/ThumbnailDataIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ThumbnailDataIFDEntry.cs: 3 | // 4 | // Author: 5 | // Mike Gemuende (mike@gemuende.de) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // Copyright (C) 2009 Mike Gemuende 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | namespace TagLib.IFD.Entries 26 | { 27 | /// 28 | /// Contains the data of a Thumbnail. Since the thumbnail is 29 | /// referenced by two long entries (offset to the data and length) 30 | /// we need to take care of this special case. 31 | /// This entry acts as the offset-entry but holds also the 32 | /// thumbail data. When rendering the entry, we have to render the 33 | /// data but write a long entry. 34 | /// 35 | public class ThumbnailDataIFDEntry : IFDEntry 36 | { 37 | 38 | #region Properties 39 | 40 | /// 41 | /// The ID of the tag, the current instance belongs to 42 | /// 43 | public ushort Tag { get; private set; } 44 | 45 | /// 46 | /// The data of the thumbnail which is stored by the current instance 47 | /// 48 | public ByteVector Data { get; private set; } 49 | 50 | #endregion 51 | 52 | #region Constructors 53 | 54 | /// 55 | /// Construcor. 56 | /// 57 | /// 58 | /// A with the tag ID of the entry this instance 59 | /// represents 60 | /// 61 | /// 62 | /// A with the thumbnail data to be stored 63 | /// 64 | public ThumbnailDataIFDEntry (ushort tag, ByteVector data) 65 | { 66 | Tag = tag; 67 | Data = data; 68 | } 69 | 70 | #endregion 71 | 72 | #region Public Methods 73 | 74 | /// 75 | /// Renders the current instance to a 76 | /// 77 | /// 78 | /// A indicating the endianess for rendering. 79 | /// 80 | /// 81 | /// A with the offset, the data is stored. 82 | /// 83 | /// 84 | /// A the ID of the type, which is rendered 85 | /// 86 | /// 87 | /// A with the count of the values which are 88 | /// rendered. 89 | /// 90 | /// 91 | /// A with the rendered data. 92 | /// 93 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 94 | { 95 | // the entry is a single long entry where the value is an offset to the data 96 | // the offset is automatically updated by the renderer. 97 | type = (ushort) IFDEntryType.Long; 98 | count = 1; 99 | 100 | return Data; 101 | } 102 | 103 | #endregion 104 | 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Entries/UndefinedIFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UndefinedIFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (miek@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Entries 27 | { 28 | /// 29 | /// Contains an Undefined value type, represented by a byte vector 30 | /// 31 | public class UndefinedIFDEntry : IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | public ushort Tag { get; private set; } 40 | 41 | /// 42 | /// The data which is stored by the current instance 43 | /// 44 | public ByteVector Data { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Constructors 49 | 50 | /// 51 | /// Construcor. 52 | /// 53 | /// 54 | /// A with the tag ID of the entry this instance 55 | /// represents 56 | /// 57 | /// 58 | /// A to be stored 59 | /// 60 | public UndefinedIFDEntry (ushort tag, ByteVector data) 61 | { 62 | Tag = tag; 63 | Data = data; 64 | } 65 | 66 | #endregion 67 | 68 | #region Public Methods 69 | 70 | /// 71 | /// Renders the current instance to a 72 | /// 73 | /// 74 | /// A indicating the endianess for rendering. 75 | /// 76 | /// 77 | /// A with the offset, the data is stored. 78 | /// 79 | /// 80 | /// A the ID of the type, which is rendered 81 | /// 82 | /// 83 | /// A with the count of the values which are 84 | /// rendered. 85 | /// 86 | /// 87 | /// A with the rendered data. 88 | /// 89 | public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) 90 | { 91 | type = (ushort) IFDEntryType.Undefined; 92 | count = (uint) Data.Count; 93 | 94 | return Data; 95 | } 96 | 97 | #endregion 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/IFDDirectory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IFDDirectory.cs: A dictionary grouping IFDEntries. 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System.Collections.Generic; 25 | 26 | namespace TagLib.IFD 27 | { 28 | /// 29 | /// Contains the entries in this IFD. 30 | /// 31 | public class IFDDirectory : Dictionary 32 | { 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/IFDEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IFDEntry.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD 27 | { 28 | /// 29 | /// An IFD entry, which is a key/value pair inside an IFD. 30 | /// 31 | public interface IFDEntry 32 | { 33 | 34 | #region Properties 35 | 36 | /// 37 | /// The ID of the tag, the current instance belongs to 38 | /// 39 | ushort Tag { 40 | get; 41 | } 42 | 43 | #endregion 44 | 45 | #region Methods 46 | 47 | /// 48 | /// Renders the current instance to a 49 | /// 50 | /// 51 | /// A indicating the endianess for rendering. 52 | /// 53 | /// 54 | /// A with the offset, the data is stored. 55 | /// 56 | /// 57 | /// A the ID of the type, which is rendered 58 | /// 59 | /// 60 | /// A with the count of the values which are 61 | /// rendered. 62 | /// 63 | /// 64 | /// A with the rendered data. 65 | /// 66 | ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count); 67 | 68 | #endregion 69 | 70 | } 71 | 72 | 73 | /// 74 | /// This class abstracts common stuff for array IFD entries 75 | /// 76 | public abstract class ArrayIFDEntry : IFDEntry 77 | { 78 | 79 | #region Properties 80 | 81 | /// 82 | /// The ID of the tag, the current instance belongs to 83 | /// 84 | public ushort Tag { get; private set; } 85 | 86 | /// 87 | /// The values stored by the current instance. 88 | /// 89 | public T [] Values { get; protected set; } 90 | 91 | #endregion 92 | 93 | #region Constructors 94 | 95 | /// 96 | /// Constructor. 97 | /// 98 | /// 99 | /// A with the tag ID of the entry this instance 100 | /// represents 101 | /// 102 | public ArrayIFDEntry (ushort tag) 103 | { 104 | Tag = tag; 105 | } 106 | 107 | #endregion 108 | 109 | #region Public Methods 110 | 111 | /// 112 | /// Renders the current instance to a 113 | /// 114 | /// 115 | /// A indicating the endianess for rendering. 116 | /// 117 | /// 118 | /// A with the offset, the data is stored. 119 | /// 120 | /// 121 | /// A the ID of the type, which is rendered 122 | /// 123 | /// 124 | /// A with the count of the values which are 125 | /// rendered. 126 | /// 127 | /// 128 | /// A with the rendered data. 129 | /// 130 | public abstract ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count); 131 | 132 | #endregion 133 | 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/IFDEntryType.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IFDEntryType.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD 27 | { 28 | /// 29 | /// A type indicator, which identifies how the corresponding value 30 | /// field should be interpreted. 31 | /// 32 | public enum IFDEntryType : ushort 33 | { 34 | /// 35 | /// Unknown (shouldn't occur) 36 | /// 37 | Unknown = 0, 38 | 39 | /// 40 | /// 8-bit unsigned integer. 41 | /// 42 | Byte = 1, 43 | 44 | /// 45 | /// 8-bit byte that contains a 7-bit ASCII code; the last byte 46 | /// must be NUL (binary zero). 47 | /// 48 | Ascii = 2, 49 | 50 | /// 51 | /// 16-bit (2-byte) unsigned integer. 52 | /// 53 | Short = 3, 54 | 55 | /// 56 | /// 32-bit (4-byte) unsigned integer. 57 | /// 58 | Long = 4, 59 | 60 | /// 61 | /// Two LONGs: the first represents the numerator of a 62 | /// fraction; the second, the denominator. 63 | /// 64 | Rational = 5, 65 | 66 | /// 67 | /// An 8-bit signed (twos-complement) integer. 68 | /// 69 | SByte = 6, 70 | 71 | /// 72 | /// An 8-bit byte that may contain anything, depending on 73 | /// the definition of the field. 74 | /// 75 | Undefined = 7, 76 | 77 | /// 78 | /// A 16-bit (2-byte) signed (twos-complement) integer. 79 | /// 80 | SShort = 8, 81 | 82 | /// 83 | /// A 32-bit (4-byte) signed (twos-complement) integer. 84 | /// 85 | SLong = 9, 86 | 87 | /// 88 | /// Two SLONG’s: the first represents the numerator of a 89 | /// fraction, the second the denominator. 90 | /// 91 | SRational = 10, 92 | 93 | /// 94 | /// Single precision (4-byte) IEEE format. 95 | /// 96 | Float = 11, 97 | 98 | /// 99 | /// Double precision (8-byte) IEEE format. 100 | /// 101 | Double = 12, 102 | 103 | /// 104 | /// IFD 105 | /// 106 | IFD = 13 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/CanonFileInfoEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // CanonFileInfoEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Label tags for Canon File Info. 28 | /// Based on http://www.exiv2.org/tags-canon.html 29 | /// 30 | public enum CanonFileInfoEntryTag : ushort 31 | { 32 | /// 33 | /// File Number. (Hex: 0X0001) 34 | /// 35 | FileNumber = 1, 36 | 37 | /// 38 | /// Bracket Mode. (Hex: 0X0003) 39 | /// 40 | BracketMode = 3, 41 | 42 | /// 43 | /// Bracket Value. (Hex: 0X0004) 44 | /// 45 | BracketValue = 4, 46 | 47 | /// 48 | /// Bracket Shot Number. (Hex: 0X0005) 49 | /// 50 | BracketShotNumber = 5, 51 | 52 | /// 53 | /// Raw Jpg Quality. (Hex: 0X0006) 54 | /// 55 | RawJpgQuality = 6, 56 | 57 | /// 58 | /// Raw Jpg Size. (Hex: 0X0007) 59 | /// 60 | RawJpgSize = 7, 61 | 62 | /// 63 | /// Noise Reduction. (Hex: 0X0008) 64 | /// 65 | NoiseReduction = 8, 66 | 67 | /// 68 | /// WB Bracket Mode. (Hex: 0X0009) 69 | /// 70 | WBBracketMode = 9, 71 | 72 | /// 73 | /// WB Bracket Value AB. (Hex: 0X000C) 74 | /// 75 | WBBracketValueAB = 12, 76 | 77 | /// 78 | /// WB Bracket Value GM. (Hex: 0X000D) 79 | /// 80 | WBBracketValueGM = 13, 81 | 82 | /// 83 | /// Filter Effect. (Hex: 0X000E) 84 | /// 85 | FilterEffect = 14, 86 | 87 | /// 88 | /// Toning Effect. (Hex: 0X000F) 89 | /// 90 | ToningEffect = 15, 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/CanonPictureInfoEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // CanonPictureInfoEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Label tags for Canon Picture Info. 28 | /// Based on http://www.exiv2.org/tags-canon.html 29 | /// 30 | public enum CanonPictureInfoEntryTag : ushort 31 | { 32 | /// 33 | /// Image width. (Hex: 0X0002) 34 | /// 35 | ImageWidth = 2, 36 | 37 | /// 38 | /// Image height. (Hex: 0X0003) 39 | /// 40 | ImageHeight = 3, 41 | 42 | /// 43 | /// Image width (as shot). (Hex: 0X0004) 44 | /// 45 | ImageWidthAsShot = 4, 46 | 47 | /// 48 | /// Image height (as shot). (Hex: 0X0005) 49 | /// 50 | ImageHeightAsShot = 5, 51 | 52 | /// 53 | /// AF points used. (Hex: 0X0016) 54 | /// 55 | AFPointsUsed = 22, 56 | 57 | /// 58 | /// AF points used (20D). (Hex: 0X001A) 59 | /// 60 | AFPointsUsed20D = 26, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/IOPEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IOPEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009-2010 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Tags 27 | { 28 | /// 29 | /// Entry tags occuring in the Interoperability IFD 30 | /// The complete overview can be obtained at: 31 | /// http://www.awaresystems.be/imaging/tiff.html 32 | /// 33 | public enum IOPEntryTag : ushort 34 | { 35 | /// 36 | /// Indicates the identification of the Interoperability rule. (Hex: 0x0001) 37 | /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/interoperability/interoperabilityindex.html 38 | /// 39 | InteroperabilityIndex = 1, 40 | 41 | /// 42 | /// Interoperability version. (Hex: 0x0002) 43 | /// 44 | InteroperabilityVersion = 2, 45 | 46 | /// 47 | /// File format of image file. (Hex: 0x1000) 48 | /// 49 | RelatedImageFileFormat = 4096, 50 | 51 | /// 52 | /// Image Width. (Hex: 0x1001) 53 | /// 54 | RelatedImageWidth = 4097, 55 | 56 | /// 57 | /// Image Height. (Hex: 0x1002) 58 | /// 59 | RelatedImageLength = 4098, 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonIsoInfoEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonIsoInfoEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Nikon Iso Info entry tags. 28 | /// Based on: 29 | /// http://exiv2.org/tags-nikon.html 30 | /// 31 | public enum NikonIsoInfoEntryTag : ushort 32 | { 33 | 34 | /// 35 | /// ISO. (Hex: 0X0000) 36 | /// 37 | ISO = 0, 38 | 39 | /// 40 | /// ISO expansion. (Hex: 0X0004) 41 | /// 42 | ISOExpansion = 4, 43 | 44 | /// 45 | /// ISO 2. (Hex: 0X0006) 46 | /// 47 | ISO2 = 6, 48 | 49 | /// 50 | /// ISO expansion 2. (Hex: 0X000A) 51 | /// 52 | ISOExpansion2 = 10, 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonLensData3EntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonLensData3EntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Nikon lens data entry tags. 28 | /// Based on: 29 | /// http://exiv2.org/tags-nikon.html 30 | /// 31 | public enum NikonLensData3EntryTag : ushort 32 | { 33 | 34 | /// 35 | /// Version. (Hex: 0X0000) 36 | /// 37 | Version = 0, 38 | 39 | /// 40 | /// Exit pupil position. (Hex: 0X0004) 41 | /// 42 | ExitPupilPosition = 4, 43 | 44 | /// 45 | /// AF aperture. (Hex: 0X0005) 46 | /// 47 | AFAperture = 5, 48 | 49 | /// 50 | /// Focus position. (Hex: 0X0008) 51 | /// 52 | FocusPosition = 8, 53 | 54 | /// 55 | /// Focus distance. (Hex: 0X000A) 56 | /// 57 | FocusDistance = 10, 58 | 59 | /// 60 | /// Focal length. (Hex: 0X000B) 61 | /// 62 | FocalLength = 11, 63 | 64 | /// 65 | /// Lens ID number. (Hex: 0X000C) 66 | /// 67 | LensIDNumber = 12, 68 | 69 | /// 70 | /// Lens F-stops. (Hex: 0X000D) 71 | /// 72 | LensFStops = 13, 73 | 74 | /// 75 | /// Min focal length. (Hex: 0X000E) 76 | /// 77 | MinFocalLength = 14, 78 | 79 | /// 80 | /// Max focal length. (Hex: 0X000F) 81 | /// 82 | MaxFocalLength = 15, 83 | 84 | /// 85 | /// Max aperture at min focal length. (Hex: 0X0010) 86 | /// 87 | MaxApertureAtMinFocal = 16, 88 | 89 | /// 90 | /// Max aperture at max focal length. (Hex: 0X0011) 91 | /// 92 | MaxApertureAtMaxFocal = 17, 93 | 94 | /// 95 | /// MCU version. (Hex: 0X0012) 96 | /// 97 | MCUVersion = 18, 98 | 99 | /// 100 | /// Effective max aperture. (Hex: 0X0013) 101 | /// 102 | EffectiveMaxAperture = 19, 103 | 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonPictureControlEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonPictureControlEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Nikon picture control entry tags. 28 | /// Based on: 29 | /// http://exiv2.org/tags-nikon.html 30 | /// 31 | public enum NikonPictureControlEntryTag : ushort 32 | { 33 | 34 | /// 35 | /// Version. (Hex: 0X0000) 36 | /// 37 | Version = 0, 38 | 39 | /// 40 | /// Name. (Hex: 0X0004) 41 | /// 42 | Name = 4, 43 | 44 | /// 45 | /// Base. (Hex: 0X0018) 46 | /// 47 | Base = 24, 48 | 49 | /// 50 | /// Adjust. (Hex: 0X0030) 51 | /// 52 | Adjust = 48, 53 | 54 | /// 55 | /// Quick adjust. (Hex: 0X0031) 56 | /// 57 | QuickAdjust = 49, 58 | 59 | /// 60 | /// Sharpness. (Hex: 0X0032) 61 | /// 62 | Sharpness = 50, 63 | 64 | /// 65 | /// Contrast. (Hex: 0X0033) 66 | /// 67 | Contrast = 51, 68 | 69 | /// 70 | /// Brightness. (Hex: 0X0034) 71 | /// 72 | Brightness = 52, 73 | 74 | /// 75 | /// Saturation. (Hex: 0X0035) 76 | /// 77 | Saturation = 53, 78 | 79 | /// 80 | /// Hue adjustment. (Hex: 0X0036) 81 | /// 82 | HueAdjustment = 54, 83 | 84 | /// 85 | /// Filter effect. (Hex: 0X0037) 86 | /// 87 | FilterEffect = 55, 88 | 89 | /// 90 | /// Toning effect. (Hex: 0X0038) 91 | /// 92 | ToningEffect = 56, 93 | 94 | /// 95 | /// Toning saturation. (Hex: 0X0039) 96 | /// 97 | ToningSaturation = 57, 98 | 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonPreviewMakerNoteEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonPreviewMakerNoteEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009-2010 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | namespace TagLib.IFD.Tags 27 | { 28 | /// 29 | /// Nikon makernote preview image tags 30 | /// The preview image is contained in a sub-IFD stored by the tag 31 | /// Nikon3MakerNoteEntryTag.Preview. 32 | /// Based on: 33 | /// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage 34 | /// 35 | public enum NikonPreviewMakerNoteEntryTag : ushort 36 | { 37 | 38 | /// 39 | /// Compression scheme used on the image data. (Hex: 0x0103) 40 | /// http://www.awaresystems.be/imaging/tiff/tifftags/compression.html 41 | /// 42 | Compression = 259, 43 | 44 | /// 45 | /// The number of pixels per ResolutionUnit in the ImageWidth direction. (Hex: 0x011A) 46 | /// http://www.awaresystems.be/imaging/tiff/tifftags/xresolution.html 47 | /// 48 | XResolution = 282, 49 | 50 | /// 51 | /// The number of pixels per ResolutionUnit in the ImageLength direction. (Hex: 0x011B) 52 | /// http://www.awaresystems.be/imaging/tiff/tifftags/yresolution.html 53 | /// 54 | YResolution = 283, 55 | 56 | /// 57 | /// The unit of measurement for XResolution and YResolution. (Hex: 0x0128) 58 | /// http://www.awaresystems.be/imaging/tiff/tifftags/resolutionunit.html 59 | /// 60 | ResolutionUnit = 296, 61 | 62 | /// 63 | /// Start of the preview image data. (Hex: 0x0201) 64 | /// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage 65 | /// 66 | PreviewImageStart = 513, 67 | 68 | /// 69 | /// Length of the preview image data. (Hex: 0x0202) 70 | /// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage 71 | /// 72 | PreviewImageLength = 514, 73 | 74 | /// 75 | /// Specifies the positioning of subsampled chrominance components relative to luminance samples. (Hex: 0x0213) 76 | /// http://www.awaresystems.be/imaging/tiff/tifftags/ycbcrpositioning.html 77 | /// 78 | YCbCrPositioning = 531 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonShotInfoEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonShotInfoEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Nikon shot info entry tags. 28 | /// Based on: 29 | /// http://exiv2.org/tags-nikon.html 30 | /// 31 | public enum NikonShotInfoEntryTag : ushort 32 | { 33 | 34 | /// 35 | /// Version. (Hex: 0X0000) 36 | /// 37 | Version = 0, 38 | 39 | /// 40 | /// Shutter count 1. (Hex: 0X006A) 41 | /// 42 | ShutterCount1 = 106, 43 | 44 | /// 45 | /// Deleted image count. (Hex: 0X006E) 46 | /// 47 | DeletedImageCount = 110, 48 | 49 | /// 50 | /// Vibration reduction. (Hex: 0X0075) 51 | /// 52 | VibrationReduction = 117, 53 | 54 | /// 55 | /// . (Hex: 0X0082) 56 | /// 57 | VibrationReduction1 = 130, 58 | 59 | /// 60 | /// Shutter count 2. (Hex: 0X0157) 61 | /// 62 | ShutterCount2 = 343, 63 | 64 | /// 65 | /// Vibration reduction 2. (Hex: 0X01AE) 66 | /// 67 | VibrationReduction2 = 430, 68 | 69 | /// 70 | /// ISO. (Hex: 0X0256) 71 | /// 72 | ISO = 598, 73 | 74 | /// 75 | /// Shutter count. (Hex: 0X0276) 76 | /// 77 | ShutterCount = 630, 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonVibrationReductionEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonVibrationReductionEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Nikon vibration reduction entry tags. 28 | /// Based on: 29 | /// http://exiv2.org/tags-nikon.html 30 | /// 31 | public enum NikonVibrationReductionEntryTag : ushort 32 | { 33 | 34 | /// 35 | /// Version. (Hex: 0X0000) 36 | /// 37 | Version = 0, 38 | 39 | /// 40 | /// Vibration reduction. (Hex: 0X0004) 41 | /// 42 | VibrationReduction = 4, 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IFD/Tags/NikonWorldTimeEntryTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NikonWorldTimeEntryTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.IFD.Tags 25 | { 26 | /// 27 | /// Nikon world time entry tags. 28 | /// Based on: 29 | /// http://exiv2.org/tags-nikon.html 30 | /// 31 | public enum NikonWorldTimeEntryTag : ushort 32 | { 33 | 34 | /// 35 | /// Timezone. (Hex: 0X0000) 36 | /// 37 | Timezone = 0, 38 | 39 | /// 40 | /// Daylight savings. (Hex: 0X0002) 41 | /// 42 | DaylightSavings = 2, 43 | 44 | /// 45 | /// Date display format. (Hex: 0X0003) 46 | /// 47 | DateDisplayFormat = 3, 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IIM/IIMReader.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IIMReader.cs 3 | // 4 | // Author: 5 | // Eberhard Beilharz 6 | // 7 | // Copyright (c) 2012 Eberhard Beilharz 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as 11 | // published by the Free Software Foundation; either version 2.1 of the 12 | // License, or (at your option) any later version. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | using System; 23 | 24 | namespace TagLib.IIM 25 | { 26 | /// 27 | /// Processes all IPTC-IIM segments 28 | /// 29 | public class IIMReader 30 | { 31 | /// 32 | /// The magic bytes that start a new IPTC-IIM segment 33 | /// 34 | private static readonly byte[] IPTC_IIM_SEGMENT = new byte[] { 0x1C, 0x02}; 35 | 36 | private IIMTag Tag { get; set; } 37 | private ByteVector Data { get; set; } 38 | 39 | public IIMReader (ByteVector data) 40 | { 41 | Data = data; 42 | Tag = new IIMTag (); 43 | } 44 | 45 | public IIMTag Process () 46 | { 47 | // now process the IIM segments which all start with 0x1C 0x02 followed by the type 48 | // of the IIM segment 49 | int findOffset = 0; 50 | int count = 0; 51 | for (int i = Data.Find (IPTC_IIM_SEGMENT, findOffset); i >= findOffset; i = Data.Find (IPTC_IIM_SEGMENT, findOffset)) { 52 | count++; 53 | // skip over segment marker 54 | i += IPTC_IIM_SEGMENT.Length; 55 | 56 | int len = Data.Mid (i + 1).ToUShort (); 57 | 58 | // ENHANCE: enhance encoding used for string conversion. Unfortunately this is 59 | // not detectable from IIM data. 60 | switch (Data [i]) { 61 | case 5: // Object Name 62 | Tag.Title = Data.ToString (StringType.Latin1, i + 3, len); 63 | break; 64 | case 25: // Keywords 65 | Tag.AddKeyword (Data.ToString (StringType.Latin1, i + 3, len)); 66 | break; 67 | case 80: // By-line 68 | Tag.Creator = Data.ToString (StringType.Latin1, i + 3, len); 69 | break; 70 | case 116: // Copyright notice 71 | Tag.Copyright = Data.ToString (StringType.Latin1, i + 3, len); 72 | break; 73 | case 120: // Caption/Abstract 74 | Tag.Comment = Data.ToString (StringType.Latin1, i + 3, len); 75 | break; 76 | } 77 | findOffset = i + 3 + len; 78 | } 79 | if (count == 0) 80 | return null; 81 | return Tag; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/IIM/IIMTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IIMTag.cs 3 | // 4 | // Author: 5 | // Eberhard Beilharz 6 | // 7 | // Copyright (c) 2012 Eberhard Beilharz 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as 11 | // published by the Free Software Foundation; either version 2.1 of the 12 | // License, or (at your option) any later version. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | using System; 23 | using System.Collections.Generic; 24 | 25 | using TagLib.Image; 26 | using TagLib.IFD.Entries; 27 | 28 | namespace TagLib.IIM 29 | { 30 | public class IIMTag: Xmp.XmpTag 31 | { 32 | private List m_Keywords; 33 | 34 | public IIMTag () 35 | { 36 | } 37 | 38 | public override TagLib.TagTypes TagTypes 39 | { 40 | get 41 | { 42 | return TagLib.TagTypes.IPTCIIM; 43 | } 44 | } 45 | 46 | public override void Clear () 47 | { 48 | Title = null; 49 | m_Keywords = null; 50 | Creator = null; 51 | Copyright = null; 52 | Comment = null; 53 | } 54 | 55 | public override string Title { get; set; } 56 | public override string Creator { get; set; } 57 | public override string Copyright { get; set; } 58 | public override string Comment { get; set; } 59 | 60 | public override string[] Keywords 61 | { 62 | get { 63 | if (m_Keywords == null) 64 | return null; 65 | return m_Keywords.ToArray (); 66 | } 67 | } 68 | 69 | internal void AddKeyword (string keyword) 70 | { 71 | if (m_Keywords == null) 72 | m_Keywords = new List (); 73 | m_Keywords.Add (keyword); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Id3v1/StringHandler.cs: -------------------------------------------------------------------------------- 1 | // 2 | // StringHandler.cs: 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Original Source: 8 | // id3v1tag.cpp from TagLib 9 | // 10 | // Copyright (C) 2005-2007 Brian Nickel 11 | // Copyright (C) 2002,2003 Scott Wheeler (Original Implementation) 12 | // 13 | // This library is free software; you can redistribute it and/or modify 14 | // it under the terms of the GNU Lesser General Public License version 15 | // 2.1 as published by the Free Software Foundation. 16 | // 17 | // This library is distributed in the hope that it will be useful, but 18 | // WITHOUT ANY WARRANTY; without even the implied warranty of 19 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | // Lesser General Public License for more details. 21 | // 22 | // You should have received a copy of the GNU Lesser General Public 23 | // License along with this library; if not, write to the Free Software 24 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 25 | // USA 26 | // 27 | 28 | using System.Collections; 29 | using System; 30 | 31 | namespace TagLib.Id3v1 32 | { 33 | /// 34 | /// This class provides a mechanism for customizing how Id3v1 text 35 | /// is read and written. 36 | /// 37 | public class StringHandler 38 | { 39 | /// 40 | /// Converts raw ID3v1 text data to a 41 | /// object. 42 | /// 43 | /// 44 | /// A object containing raw Id3v1 45 | /// text data. 46 | /// 47 | /// 48 | /// A object containing the converted 49 | /// text. 50 | /// 51 | public virtual string Parse (ByteVector data) 52 | { 53 | if (data == null) 54 | throw new ArgumentNullException ("data"); 55 | 56 | string output = data.ToString (StringType.Latin1).Trim (); 57 | int i = output.IndexOf ('\0'); 58 | return (i >= 0) ? output.Substring (0, i) : output; 59 | } 60 | 61 | /// 62 | /// Converts a object to raw ID3v1 text 63 | /// data. 64 | /// 65 | /// 66 | /// A object to convert. 67 | /// 68 | /// 69 | /// A containing the raw ID3v1 text 70 | /// data. 71 | /// 72 | public virtual ByteVector Render (string text) 73 | { 74 | return ByteVector.FromString (text, StringType.Latin1); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Id3v2/ExtendedHeader.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ExtendedHeader.cs: 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Original Source: 8 | // id3v2extendedheader.cpp from TagLib 9 | // 10 | // Copyright (C) 2005-2007 Brian Nickel 11 | // Copyright (C) 2002,2003 Scott Wheeler (Original Implementation) 12 | // 13 | // This library is free software; you can redistribute it and/or modify 14 | // it under the terms of the GNU Lesser General Public License version 15 | // 2.1 as published by the Free Software Foundation. 16 | // 17 | // This library is distributed in the hope that it will be useful, but 18 | // WITHOUT ANY WARRANTY; without even the implied warranty of 19 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | // Lesser General Public License for more details. 21 | // 22 | // You should have received a copy of the GNU Lesser General Public 23 | // License along with this library; if not, write to the Free Software 24 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 25 | // USA 26 | // 27 | 28 | using System.Collections; 29 | using System; 30 | 31 | namespace TagLib.Id3v2 32 | { 33 | /// 34 | /// This class is a filler until support for reading and writing the 35 | /// ID3v2 extended header is implemented. 36 | /// 37 | public class ExtendedHeader : ICloneable 38 | { 39 | /// 40 | /// Contains the size of the read header. 41 | /// 42 | private uint size; 43 | 44 | /// 45 | /// Constructs and initializes a new instance of with no contents. 47 | /// 48 | public ExtendedHeader () 49 | { 50 | } 51 | 52 | /// 53 | /// Constructs and initializes a new instance of by reading the raw contents from 55 | /// a object. 56 | /// 57 | /// 58 | /// A object containing the raw 59 | /// extended header structure. 60 | /// 61 | /// 62 | /// A value indicating the ID3v2 version. 63 | /// 64 | public ExtendedHeader (ByteVector data, byte version) 65 | { 66 | Parse (data, version); 67 | } 68 | 69 | /// 70 | /// Gets the size of the data on disk in bytes. 71 | /// 72 | /// 73 | /// A value containing the size of the 74 | /// data on disk. 75 | /// 76 | public uint Size { 77 | get {return size;} 78 | } 79 | 80 | /// 81 | /// Populates the current instance with the contents of the 82 | /// raw ID3v2 frame. 83 | /// 84 | /// 85 | /// A object containing the raw 86 | /// extended header structure. 87 | /// 88 | /// 89 | /// A value indicating the ID3v2 version. 90 | /// 91 | protected void Parse (ByteVector data, byte version) 92 | { 93 | if (data == null) 94 | throw new ArgumentNullException ("data"); 95 | 96 | size = (version == 3 ? 4u : 0u) + SynchData.ToUInt (data.Mid (0, 4)); 97 | } 98 | 99 | #region ICloneable 100 | 101 | /// 102 | /// Creates a deep copy of the current instance. 103 | /// 104 | /// 105 | /// A new object identical to 106 | /// the current instance. 107 | /// 108 | public ExtendedHeader Clone () 109 | { 110 | ExtendedHeader header = new ExtendedHeader (); 111 | header.size = size; 112 | return header; 113 | } 114 | 115 | object ICloneable.Clone () 116 | { 117 | return Clone (); 118 | } 119 | 120 | #endregion 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Id3v2/FrameTypes.cs: -------------------------------------------------------------------------------- 1 | // 2 | // FrameTypes.cs: 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Copyright (C) 2007 Brian Nickel 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | namespace TagLib.Id3v2 { 27 | /// 28 | /// provides references to different frame 29 | /// types used by the library. 30 | /// 31 | /// 32 | /// This class is used to severely reduce the number of times 33 | /// these types are created in , 34 | /// greatly improving the speed at which warm files are read. It is, 35 | /// however, not necessary for external users to use this class. While 36 | /// the library may use GetTextAsString (FrameType.TIT2); an 37 | /// external user could use tag.GetTextAsString ("TIT2"); with 38 | /// the same result. 39 | /// 40 | internal static class FrameType { 41 | public static readonly ReadOnlyByteVector APIC = "APIC"; 42 | public static readonly ReadOnlyByteVector COMM = "COMM"; 43 | public static readonly ReadOnlyByteVector EQUA = "EQUA"; 44 | public static readonly ReadOnlyByteVector GEOB = "GEOB"; 45 | public static readonly ReadOnlyByteVector MCDI = "MCDI"; 46 | public static readonly ReadOnlyByteVector PCNT = "PCNT"; 47 | public static readonly ReadOnlyByteVector POPM = "POPM"; 48 | public static readonly ReadOnlyByteVector PRIV = "PRIV"; 49 | public static readonly ReadOnlyByteVector RVA2 = "RVA2"; 50 | public static readonly ReadOnlyByteVector RVAD = "RVAD"; 51 | public static readonly ReadOnlyByteVector SYLT = "SYLT"; 52 | public static readonly ReadOnlyByteVector TALB = "TALB"; 53 | public static readonly ReadOnlyByteVector TBPM = "TBPM"; 54 | public static readonly ReadOnlyByteVector TCOM = "TCOM"; 55 | public static readonly ReadOnlyByteVector TCON = "TCON"; 56 | public static readonly ReadOnlyByteVector TCOP = "TCOP"; 57 | public static readonly ReadOnlyByteVector TCMP = "TCMP"; 58 | public static readonly ReadOnlyByteVector TDRC = "TDRC"; 59 | public static readonly ReadOnlyByteVector TDAT = "TDAT"; 60 | public static readonly ReadOnlyByteVector TEXT = "TEXT"; 61 | public static readonly ReadOnlyByteVector TIT1 = "TIT1"; 62 | public static readonly ReadOnlyByteVector TIT2 = "TIT2"; 63 | public static readonly ReadOnlyByteVector TIME = "TIME"; 64 | public static readonly ReadOnlyByteVector TOLY = "TOLY"; 65 | public static readonly ReadOnlyByteVector TOPE = "TOPE"; 66 | public static readonly ReadOnlyByteVector TPE1 = "TPE1"; 67 | public static readonly ReadOnlyByteVector TPE2 = "TPE2"; 68 | public static readonly ReadOnlyByteVector TPE3 = "TPE3"; 69 | public static readonly ReadOnlyByteVector TPE4 = "TPE4"; 70 | public static readonly ReadOnlyByteVector TPOS = "TPOS"; 71 | public static readonly ReadOnlyByteVector TRCK = "TRCK"; 72 | public static readonly ReadOnlyByteVector TRDA = "TRDA"; 73 | public static readonly ReadOnlyByteVector TSIZ = "TSIZ"; 74 | public static readonly ReadOnlyByteVector TSOA = "TSOA"; // Album Title Sort Frame 75 | public static readonly ReadOnlyByteVector TSO2 = "TSO2"; // Album Artist Sort Frame 76 | public static readonly ReadOnlyByteVector TSOC = "TSOC"; // Composer Sort Frame 77 | public static readonly ReadOnlyByteVector TSOP = "TSOP"; // Performer Sort Frame 78 | public static readonly ReadOnlyByteVector TSOT = "TSOT"; // Track Title Sort Frame 79 | public static readonly ReadOnlyByteVector TXXX = "TXXX"; 80 | public static readonly ReadOnlyByteVector TYER = "TYER"; 81 | public static readonly ReadOnlyByteVector UFID = "UFID"; 82 | public static readonly ReadOnlyByteVector USER = "USER"; 83 | public static readonly ReadOnlyByteVector USLT = "USLT"; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Image/ImageOrientation.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ImageOrientation.cs: Enum for the orientation of an image 3 | // 4 | // Author: 5 | // Paul Lange (palango@gmx.de) 6 | // 7 | // Copyright (C) 2009 Paul Lange 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | 23 | using System; 24 | 25 | namespace TagLib.Image 26 | { 27 | /** 28 | 29 | 1 2 3 4 5 6 7 8 30 | 31 | 888888 888888 88 88 8888888888 88 88 8888888888 32 | 88 88 88 88 88 88 88 88 88 88 88 88 33 | 8888 8888 8888 8888 88 8888888888 8888888888 88 34 | 88 88 88 88 35 | 88 88 888888 888888 36 | 37 | t-l t-r b-r b-l l-t r-t r-b l-b 38 | 39 | **/ 40 | 41 | /// 42 | /// Describes the orientation of an image. 43 | /// Values are viewed in terms of rows and columns. 44 | /// 45 | public enum ImageOrientation : uint 46 | { 47 | /// 48 | /// No value is known. 49 | /// 50 | None = 0, 51 | 52 | /// 53 | /// No need to do any transformations. 54 | /// 55 | TopLeft = 1, 56 | 57 | /// 58 | /// Mirror image vertically. 59 | /// 60 | TopRight = 2, 61 | 62 | /// 63 | /// Rotate image 180 degrees. 64 | /// 65 | BottomRight = 3, 66 | 67 | /// 68 | /// Mirror image horizontally 69 | /// 70 | BottomLeft = 4, 71 | 72 | /// 73 | /// Mirror image horizontally and rotate 90 degrees clockwise. 74 | /// 75 | LeftTop = 5, 76 | 77 | /// 78 | /// Rotate image 90 degrees clockwise. 79 | /// 80 | RightTop = 6, 81 | 82 | /// 83 | /// Mirror image vertically and rotate 90 degrees clockwise. 84 | /// 85 | RightBottom = 7, 86 | 87 | /// 88 | /// Rotate image 270 degrees clockwise. 89 | /// 90 | LeftBottom = 8 91 | } 92 | } -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Jpeg/Codec.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Codec.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // Mike Gemuende (mike@gemuende.de) 7 | // 8 | // Copyright (C) 2009 Ruben Vermeersch 9 | // Copyright (C) 2009 Mike Gemuende 10 | // 11 | // This library is free software; you can redistribute it and/or modify 12 | // it under the terms of the GNU Lesser General Public License version 13 | // 2.1 as published by the Free Software Foundation. 14 | // 15 | // This library is distributed in the hope that it will be useful, but 16 | // WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | // Lesser General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU Lesser General Public 21 | // License along with this library; if not, write to the Free Software 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 | // USA 24 | // 25 | 26 | using System; 27 | 28 | namespace TagLib.Jpeg 29 | { 30 | /// 31 | /// A Jpeg photo codec. Contains basic photo details. 32 | /// 33 | public class Codec : Image.Codec 34 | { 35 | 36 | /// 37 | /// Gets a text description of the media represented by the 38 | /// current instance. 39 | /// 40 | /// 41 | /// A object containing a description 42 | /// of the media represented by the current instance. 43 | /// 44 | public override string Description { get { return "JFIF File"; } } 45 | 46 | 47 | /// 48 | /// Constructs a new with the given width 49 | /// and height. 50 | /// 51 | /// 52 | /// The width of the photo. 53 | /// 54 | /// 55 | /// The height of the photo. 56 | /// 57 | /// 58 | /// The quality of the photo. 59 | /// 60 | /// 61 | /// A new instance. 62 | /// 63 | public Codec (int width, int height, int quality) 64 | : base (width, height, quality) {} 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Jpeg/JpegCommentTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // JpegCommentTag.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | using TagLib.Image; 27 | 28 | namespace TagLib.Jpeg 29 | { 30 | /// 31 | /// Contains the JPEG comment. 32 | /// 33 | public class JpegCommentTag : ImageTag 34 | { 35 | #region Constructors 36 | 37 | /// 38 | /// Constructor. 39 | /// 40 | /// 41 | /// The value of the comment. 42 | /// 43 | public JpegCommentTag (string value) 44 | { 45 | Value = value; 46 | } 47 | 48 | /// 49 | /// Constructor. Creates a new empty comment. 50 | /// 51 | public JpegCommentTag () { 52 | Value = null; 53 | } 54 | 55 | #endregion 56 | 57 | #region Public Properties 58 | 59 | /// 60 | /// The value of the comment represented by the current instance. 61 | /// 62 | public string Value { get; set; } 63 | 64 | /// 65 | /// Gets or sets the comment for the image described 66 | /// by the current instance. 67 | /// 68 | /// 69 | /// A containing the comment of the 70 | /// current instace. 71 | /// 72 | public override string Comment { 73 | get { return Value; } 74 | set { Value = value; } 75 | } 76 | 77 | #endregion 78 | 79 | #region Public Methods 80 | 81 | /// 82 | /// Gets the tag types contained in the current instance. 83 | /// 84 | /// 85 | /// Always . 86 | /// 87 | public override TagTypes TagTypes { 88 | get { return TagTypes.JpegComment; } 89 | } 90 | 91 | /// 92 | /// Clears the values stored in the current instance. 93 | /// 94 | public override void Clear () 95 | { 96 | Value = null; 97 | } 98 | 99 | #endregion 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Jpeg/Table.cs: -------------------------------------------------------------------------------- 1 | // 2 | // TagLib.Jpeg.Table.cs: 3 | // 4 | // Author: 5 | // Stephane Delcroix (stephane@delcroix.org) 6 | // 7 | // Copyright (c) 2009 Stephane Delcroix 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.Jpeg 25 | { 26 | /// 27 | /// Contains static predefined tables and helpers 28 | /// 29 | public static class Table 30 | { 31 | /// 32 | /// Standard Luminance Quantization table 33 | /// 34 | /// See CCIT Rec. T.81 (1992 E), K.1 (p143) 35 | /// 36 | public static int [] StandardLuminanceQuantization = new int [] { 37 | 16, 11, 12, 14, 12, 10, 16, 14, 38 | 13, 14, 18, 17, 16, 19, 24, 40, 39 | 26, 24, 22, 22, 24, 49, 35, 37, 40 | 29, 40, 58, 51, 61, 60, 57, 51, 41 | 56, 55, 64, 72, 92, 78, 64, 68, 42 | 87, 69, 55, 56, 80, 109, 81, 87, 43 | 95, 98, 103, 104, 103, 62, 77, 113, 44 | 121, 112, 100, 120, 92, 101, 103, 99 45 | }; 46 | 47 | /// 48 | /// Standard Chrominance Quantization table 49 | /// 50 | /// See CCIT Rec. T.81 (1992 E), K.1 (p143) 51 | /// 52 | public static int [] StandardChrominanceQuantization = new int [] { 53 | 17, 18, 18, 24, 21, 24, 47, 26, 54 | 26, 47, 99, 66, 56, 66, 99, 99, 55 | 99, 99, 99, 99, 99, 99, 99, 99, 56 | 99, 99, 99, 99, 99, 99, 99, 99, 57 | 99, 99, 99, 99, 99, 99, 99, 99, 58 | 99, 99, 99, 99, 99, 99, 99, 99, 59 | 99, 99, 99, 99, 99, 99, 99, 99, 60 | 99, 99, 99, 99, 99, 99, 99, 99 61 | }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Matroska/EBMLIDs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // EBMLIDs.cs: 3 | // 4 | // Author: 5 | // Julien Moutte 6 | // 7 | // Copyright (C) 2011 FLUENDO S.A. 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.Matroska 25 | { 26 | /// 27 | /// Public enumeration listing the possible EBML element identifiers. 28 | /// 29 | public enum EBMLID 30 | { 31 | /// 32 | /// Indicates an EBML Header element. 33 | /// 34 | EBMLHeader = 0x1A45DFA3, 35 | 36 | /// 37 | /// Indicates an EBML Version element. 38 | /// 39 | EBMLVersion = 0x4286, 40 | 41 | /// 42 | /// Indicates an EBML Read Version element. 43 | /// 44 | EBMLReadVersion = 0x42F7, 45 | 46 | /// 47 | /// Indicates an EBML Max ID Length element. 48 | /// 49 | EBMLMaxIDLength = 0x42F2, 50 | 51 | /// 52 | /// Indicates an EBML Max Size Length element. 53 | /// 54 | EBMLMaxSizeLength = 0x42F3, 55 | 56 | /// 57 | /// Indicates an EBML Doc Type element. 58 | /// 59 | EBMLDocType = 0x4282, 60 | 61 | /// 62 | /// Indicates an EBML Doc Type Version element. 63 | /// 64 | EBMLDocTypeVersion = 0x4287, 65 | 66 | /// 67 | /// Indicates an EBML Doc Type Read Version element. 68 | /// 69 | EBMLDocTypeReadVersion = 0x4285, 70 | 71 | /// 72 | /// Indicates an EBML Void element. 73 | /// 74 | EBMLVoid = 0xEC 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Matroska/SubtitleTrack.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SubtitleTrack.cs: 3 | // 4 | // Author: 5 | // Julien Moutte 6 | // 7 | // Copyright (C) 2011 FLUENDO S.A. 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System.Collections.Generic; 25 | using System; 26 | 27 | namespace TagLib.Matroska 28 | { 29 | /// 30 | /// Describes a Matroska Subtitle Track. 31 | /// 32 | public class SubtitleTrack : Track 33 | { 34 | #region Private fields 35 | 36 | private List unknown_elems = new List (); 37 | 38 | #endregion 39 | 40 | #region Constructors 41 | 42 | /// 43 | /// Constructs a parsing from provided 44 | /// file data. 45 | /// Parsing will be done reading from _file at position references by 46 | /// parent element's data section. 47 | /// 48 | /// instance to read from. 49 | /// Parent . 50 | public SubtitleTrack (File _file, EBMLElement element) 51 | : base (_file, element) 52 | { 53 | // Here we handle the unknown elements we know, and store the rest 54 | foreach (EBMLElement elem in base.UnknownElements) { 55 | MatroskaID matroska_id = (MatroskaID) elem.ID; 56 | 57 | switch (matroska_id) { 58 | default: 59 | unknown_elems.Add (elem); 60 | break; 61 | } 62 | } 63 | } 64 | 65 | #endregion 66 | 67 | #region Public fields 68 | 69 | /// 70 | /// List of unknown elements encountered while parsing. 71 | /// 72 | public new List UnknownElements 73 | { 74 | get { return unknown_elems; } 75 | } 76 | 77 | #endregion 78 | 79 | #region Public methods 80 | 81 | #endregion 82 | 83 | #region ICodec 84 | 85 | /// 86 | /// This type of track only has text media type. 87 | /// 88 | public override MediaTypes MediaTypes 89 | { 90 | get 91 | { 92 | return MediaTypes.Text; 93 | } 94 | } 95 | 96 | #endregion 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/AppleAdditionalInfoBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // AppleAdditionalInfoBox.cs: Provides an implementation of an Apple 3 | // AdditionalInfoBox. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | 27 | namespace TagLib.Mpeg4 { 28 | /// 29 | /// This class extends to provide an 30 | /// implementation of an Apple AdditionalInfoBox. 31 | /// 32 | public class AppleAdditionalInfoBox : Box 33 | { 34 | #region Private Fields 35 | 36 | /// 37 | /// Contains the box data. 38 | /// 39 | private ByteVector data; 40 | 41 | #endregion 42 | 43 | 44 | 45 | #region Constructors 46 | 47 | /// 48 | /// Constructs and initializes a new instance of with a provided header 50 | /// and handler by reading the contents from a specified 51 | /// file. 52 | /// 53 | /// 54 | /// A object containing the header 55 | /// to use for the new instance. 56 | /// 57 | /// 58 | /// A object to read the contents 59 | /// of the box from. 60 | /// 61 | /// 62 | /// A object containing the 63 | /// handler that applies to the new instance. 64 | /// 65 | /// 66 | /// is . 67 | /// 68 | public AppleAdditionalInfoBox (BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base (header, handler) 69 | { 70 | // We do not care what is in this custom data section 71 | // see: https://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap2/qtff2.html 72 | Data = LoadData (file); 73 | } 74 | 75 | /// 76 | /// Constructs and initializes a new instance of using specified header, version and flags 78 | /// 79 | /// 80 | /// 81 | /// 82 | public AppleAdditionalInfoBox (ByteVector header) : base (header) 83 | { 84 | } 85 | 86 | #endregion 87 | 88 | 89 | 90 | #region Public Properties 91 | 92 | /// 93 | /// Gets and sets the data contained in the current instance. 94 | /// 95 | /// 96 | /// A object containing the data 97 | /// contained in the current instance. 98 | /// 99 | public override ByteVector Data { 100 | get {return data;} 101 | set {data = value != null ? value : new ByteVector ();} 102 | } 103 | 104 | /// 105 | /// Gets and sets the text contained in the current instance. 106 | /// 107 | /// 108 | /// A object containing the text 109 | /// contained in the current instance. 110 | /// 111 | public string Text { 112 | get {return Data.ToString (StringType.Latin1);} 113 | set { 114 | Data = ByteVector.FromString (value, 115 | StringType.Latin1); 116 | } 117 | } 118 | 119 | #endregion 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/AppleAnnotationBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // AppleAnnotationBox.cs: Provides an implementation of an Apple AnnotationBox. 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Copyright (C) 2006-2007 Brian Nickel 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | using System.Collections.Generic; 26 | 27 | namespace TagLib.Mpeg4 { 28 | /// 29 | /// This class extends to provide an 30 | /// implementation of an Apple AnnotationBox. 31 | /// 32 | public class AppleAnnotationBox : Box 33 | { 34 | #region Private Fields 35 | 36 | /// 37 | /// Contains the children of the box. 38 | /// 39 | private IEnumerable children; 40 | 41 | #endregion 42 | 43 | 44 | 45 | #region Constructors 46 | 47 | /// 48 | /// Constructs and initializes a new instance of with a provided header and 50 | /// handler by reading the contents from a specified file. 51 | /// 52 | /// 53 | /// A object containing the header 54 | /// to use for the new instance. 55 | /// 56 | /// 57 | /// A object to read the contents 58 | /// of the box from. 59 | /// 60 | /// 61 | /// A object containing the 62 | /// handler that applies to the new instance. 63 | /// 64 | /// 65 | /// is . 66 | /// 67 | public AppleAnnotationBox (BoxHeader header, TagLib.File file, 68 | IsoHandlerBox handler) 69 | : base (header, handler) 70 | { 71 | if (file == null) 72 | throw new ArgumentNullException ("file"); 73 | 74 | children = LoadChildren (file); 75 | } 76 | 77 | /// 78 | /// Constructs and initializes a new instance of of specified type with no 80 | /// children. 81 | /// 82 | /// 83 | /// A object containing a 4-byte 84 | /// box type. 85 | /// 86 | public AppleAnnotationBox (ByteVector type) : base (type) 87 | { 88 | children = new List (); 89 | } 90 | 91 | #endregion 92 | 93 | 94 | 95 | #region Public Properties 96 | 97 | /// 98 | /// Gets the children of the current instance. 99 | /// 100 | /// 101 | /// A object enumerating the 102 | /// children of the current instance. 103 | /// 104 | public override IEnumerable Children { 105 | get {return children;} 106 | } 107 | 108 | #endregion 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/AppleItemListBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // AppleItemListBox.cs: Provides an implementation of an Apple ItemListBox. 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Copyright (C) 2006-2007 Brian Nickel 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | using System.Collections.Generic; 26 | 27 | namespace TagLib.Mpeg4 { 28 | /// 29 | /// This class extends to provide an 30 | /// implementation of an Apple ItemListBox. 31 | /// 32 | public class AppleItemListBox : Box 33 | { 34 | #region Private Fields 35 | 36 | /// 37 | /// Contains the children of the box. 38 | /// 39 | private IEnumerable children; 40 | 41 | #endregion 42 | 43 | 44 | 45 | #region Constructors 46 | 47 | /// 48 | /// Constructs and initializes a new instance of with a provided header and 50 | /// handler by reading the contents from a specified file. 51 | /// 52 | /// 53 | /// A object containing the header 54 | /// to use for the new instance. 55 | /// 56 | /// 57 | /// A object to read the contents 58 | /// of the box from. 59 | /// 60 | /// 61 | /// A object containing the 62 | /// handler that applies to the new instance. 63 | /// 64 | /// 65 | /// is . 66 | /// 67 | public AppleItemListBox (BoxHeader header, TagLib.File file, 68 | IsoHandlerBox handler) 69 | : base (header, handler) 70 | { 71 | if (file == null) 72 | throw new ArgumentNullException ("file"); 73 | 74 | children = LoadChildren (file); 75 | } 76 | 77 | /// 78 | /// Constructs and initializes a new instance of with no children. 80 | /// 81 | public AppleItemListBox () : base ("ilst") 82 | { 83 | children = new List (); 84 | } 85 | 86 | #endregion 87 | 88 | 89 | 90 | #region Public Properties 91 | 92 | /// 93 | /// Gets the children of the current instance. 94 | /// 95 | /// 96 | /// A object enumerating the 97 | /// children of the current instance. 98 | /// 99 | public override IEnumerable Children { 100 | get {return children;} 101 | } 102 | 103 | #endregion 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/IsoFreeSpaceBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IsoFreeSpaceBox.cs: Provides an implementation of a ISO/IEC 14496-12 3 | // FreeSpaceBox. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | namespace TagLib.Mpeg4 { 27 | /// 28 | /// This class extends to provide an 29 | /// implementation of a ISO/IEC 14496-12 FreeSpaceBox. 30 | /// 31 | public class IsoFreeSpaceBox : Box 32 | { 33 | #region Private Fields 34 | 35 | /// 36 | /// Contains the size of the padding. 37 | /// 38 | private long padding; 39 | 40 | #endregion 41 | 42 | 43 | 44 | #region Constructors 45 | 46 | /// 47 | /// Constructs and initializes a new instance of with a provided header and 49 | /// handler by reading the contents from a specified file. 50 | /// 51 | /// 52 | /// A object containing the header 53 | /// to use for the new instance. 54 | /// 55 | /// 56 | /// A object to read the contents 57 | /// of the box from. 58 | /// 59 | /// 60 | /// A object containing the 61 | /// handler that applies to the new instance. 62 | /// 63 | public IsoFreeSpaceBox (BoxHeader header, TagLib.File file, 64 | IsoHandlerBox handler) 65 | : base (header, handler) 66 | { 67 | padding = DataSize; 68 | } 69 | 70 | /// 71 | /// Constructs and initializes a new instance of to occupy a specified number of 73 | /// bytes. 74 | /// 75 | /// 76 | /// A value specifying the number of 77 | /// bytes the new instance should occupy when rendered. 78 | /// 79 | public IsoFreeSpaceBox (long padding) : base ("free") 80 | { 81 | PaddingSize = padding; 82 | } 83 | 84 | #endregion 85 | 86 | 87 | 88 | #region Public Properties 89 | 90 | /// 91 | /// Gets and sets the data contained in the current instance. 92 | /// 93 | /// 94 | /// A object containing the data 95 | /// contained in the current instance. 96 | /// 97 | public override ByteVector Data { 98 | get {return new ByteVector ((int) padding);} 99 | set {padding = (value != null) ? value.Count : 0;} 100 | } 101 | 102 | /// 103 | /// Gets and sets the size the current instance will occupy 104 | /// when rendered. 105 | /// 106 | /// 107 | /// A value containing the size the 108 | /// current instance will occupy when rendered. 109 | /// 110 | public long PaddingSize { 111 | get {return padding + 8;} 112 | set {padding = value - 8;} 113 | } 114 | 115 | #endregion 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/IsoMetaBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IsoMetaBox.cs: Provides an implementation of a ISO/IEC 14496-12 MetaBox. 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Copyright (C) 2006-2007 Brian Nickel 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | using System.Collections.Generic; 26 | 27 | namespace TagLib.Mpeg4 { 28 | /// 29 | /// This class extends to provide an 30 | /// implementation of a ISO/IEC 14496-12 MetaBox. 31 | /// 32 | public class IsoMetaBox : FullBox 33 | { 34 | #region Private Fields 35 | 36 | /// 37 | /// Contains the children of the box. 38 | /// 39 | private IEnumerable children; 40 | 41 | #endregion 42 | 43 | 44 | 45 | #region Constructors 46 | 47 | /// 48 | /// Constructs and initializes a new instance of with a provided header and 50 | /// handler by reading the contents from a specified file. 51 | /// 52 | /// 53 | /// A object containing the header 54 | /// to use for the new instance. 55 | /// 56 | /// 57 | /// A object to read the contents 58 | /// of the box from. 59 | /// 60 | /// 61 | /// A object containing the 62 | /// handler that applies to the new instance. 63 | /// 64 | /// 65 | /// is . 66 | /// 67 | public IsoMetaBox (BoxHeader header, TagLib.File file, 68 | IsoHandlerBox handler) 69 | : base (header, file, handler) 70 | { 71 | children = LoadChildren (file); 72 | } 73 | 74 | /// 75 | /// Constructs and initializes a new instance of with a specified handler. 77 | /// 78 | /// 79 | /// A object specifying a 4 byte 80 | /// handler type. 81 | /// 82 | /// 83 | /// A object specifying the handler 84 | /// name. 85 | /// 86 | /// 87 | /// is . 89 | /// 90 | /// 91 | /// is less than 4 bytes 92 | /// long. 93 | /// 94 | public IsoMetaBox (ByteVector handlerType, string handlerName) 95 | : base ("meta", 0, 0) 96 | { 97 | if (handlerType == null) 98 | throw new ArgumentNullException ("handlerType"); 99 | 100 | if (handlerType.Count < 4) 101 | throw new ArgumentException ( 102 | "The handler type must be four bytes long.", 103 | "handlerType"); 104 | 105 | children = new List (); 106 | AddChild (new IsoHandlerBox (handlerType, handlerName)); 107 | } 108 | 109 | #endregion 110 | 111 | 112 | 113 | #region Public Properties 114 | 115 | /// 116 | /// Gets the children of the current instance. 117 | /// 118 | /// 119 | /// A object enumerating the 120 | /// children of the current instance. 121 | /// 122 | public override IEnumerable Children { 123 | get {return children;} 124 | } 125 | 126 | #endregion 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IsoSampleEntry.cs: Provides an implementation of a ISO/IEC 14496-12 3 | // SampleEntry. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | 27 | namespace TagLib.Mpeg4 { 28 | /// 29 | /// This class extends to provide an 30 | /// implementation of a ISO/IEC 14496-12 SampleEntry. 31 | /// 32 | public class IsoSampleEntry : Box 33 | { 34 | #region Private Fields 35 | 36 | /// 37 | /// Contains the data reference index. 38 | /// 39 | private ushort data_reference_index; 40 | 41 | #endregion 42 | 43 | 44 | 45 | #region Constructors 46 | 47 | /// 48 | /// Constructs and initializes a new instance of with a provided header and 50 | /// handler by reading the contents from a specified file. 51 | /// 52 | /// 53 | /// A object containing the header 54 | /// to use for the new instance. 55 | /// 56 | /// 57 | /// A object to read the contents 58 | /// of the box from. 59 | /// 60 | /// 61 | /// A object containing the 62 | /// handler that applies to the new instance. 63 | /// 64 | /// 65 | /// is . 66 | /// 67 | public IsoSampleEntry (BoxHeader header, TagLib.File file, 68 | IsoHandlerBox handler) 69 | : base (header, handler) 70 | { 71 | if (file == null) 72 | throw new ArgumentNullException ("file"); 73 | 74 | file.Seek (base.DataPosition + 6); 75 | data_reference_index = file.ReadBlock (2).ToUShort (); 76 | } 77 | 78 | #endregion 79 | 80 | 81 | 82 | #region Public Properties 83 | 84 | /// 85 | /// Gets the position of the data contained in the current 86 | /// instance, after any box specific headers. 87 | /// 88 | /// 89 | /// A value containing the position of 90 | /// the data contained in the current instance. 91 | /// 92 | protected override long DataPosition { 93 | get {return base.DataPosition + 8;} 94 | } 95 | 96 | /// 97 | /// Gets the data reference index of the current instance. 98 | /// 99 | /// 100 | /// A value containing the data 101 | /// reference index of the current instance. 102 | /// 103 | public ushort DataReferenceIndex { 104 | get {return data_reference_index;} 105 | } 106 | 107 | #endregion 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/IsoSampleTableBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IsoSampleTableBox.cs: Provides an implementation of a ISO/IEC 14496-12 3 | // SampleTableBox. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | using System.Collections.Generic; 27 | 28 | namespace TagLib.Mpeg4 { 29 | /// 30 | /// This class extends to provide an 31 | /// implementation of a ISO/IEC 14496-12 SampleTableBox. 32 | /// 33 | public class IsoSampleTableBox : Box 34 | { 35 | #region Private Fields 36 | 37 | /// 38 | /// Contains the children of the box. 39 | /// 40 | private IEnumerable children; 41 | 42 | #endregion 43 | 44 | 45 | 46 | #region Constructors 47 | 48 | /// 49 | /// Constructs and initializes a new instance of with a provided header and 51 | /// handler by reading the contents from a specified file. 52 | /// 53 | /// 54 | /// A object containing the header 55 | /// to use for the new instance. 56 | /// 57 | /// 58 | /// A object to read the contents 59 | /// of the box from. 60 | /// 61 | /// 62 | /// A object containing the 63 | /// handler that applies to the new instance. 64 | /// 65 | /// 66 | /// is . 67 | /// 68 | public IsoSampleTableBox (BoxHeader header, TagLib.File file, 69 | IsoHandlerBox handler) 70 | : base (header, handler) 71 | { 72 | if (file == null) 73 | throw new ArgumentNullException ("file"); 74 | 75 | children = LoadChildren (file); 76 | } 77 | 78 | #endregion 79 | 80 | 81 | 82 | #region Public Properties 83 | 84 | /// 85 | /// Gets the children of the current instance. 86 | /// 87 | /// 88 | /// A object enumerating the 89 | /// children of the current instance. 90 | /// 91 | public override IEnumerable Children { 92 | get {return children;} 93 | } 94 | 95 | #endregion 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IsoUserDataBox.cs: Provides an implementation of a ISO/IEC 14496-12 3 | // UserDataBox. 4 | // 5 | // Author: 6 | // Brian Nickel (brian.nickel@gmail.com) 7 | // 8 | // Copyright (C) 2006-2007 Brian Nickel 9 | // 10 | // This library is free software; you can redistribute it and/or modify 11 | // it under the terms of the GNU Lesser General Public License version 12 | // 2.1 as published by the Free Software Foundation. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 | // USA 23 | // 24 | 25 | using System; 26 | using System.Collections.Generic; 27 | 28 | namespace TagLib.Mpeg4 { 29 | /// 30 | /// This class extends to provide an 31 | /// implementation of a ISO/IEC 14496-12 UserDataBox. 32 | /// 33 | public class IsoUserDataBox : Box 34 | { 35 | #region Private Fields 36 | 37 | /// 38 | /// Contains the children of the box. 39 | /// 40 | private IEnumerable children; 41 | 42 | /// 43 | /// Contains the box headers from the top of the file to the 44 | /// current udta box. 45 | /// 46 | private BoxHeader [] parent_tree; 47 | 48 | #endregion 49 | 50 | 51 | 52 | #region Constructors 53 | 54 | /// 55 | /// Constructs and initializes a new instance of with a provided header and 57 | /// handler by reading the contents from a specified file. 58 | /// 59 | /// 60 | /// A object containing the header 61 | /// to use for the new instance. 62 | /// 63 | /// 64 | /// A object to read the contents 65 | /// of the box from. 66 | /// 67 | /// 68 | /// A object containing the 69 | /// handler that applies to the new instance. 70 | /// 71 | /// 72 | /// is . 73 | /// 74 | public IsoUserDataBox (BoxHeader header, TagLib.File file, 75 | IsoHandlerBox handler) 76 | : base (header, handler) 77 | { 78 | if (file == null) 79 | throw new ArgumentNullException ("file"); 80 | 81 | children = LoadChildren (file); 82 | } 83 | 84 | /// 85 | /// Constructs and initializes a new instance of with no children. 87 | /// 88 | public IsoUserDataBox () : base ("udta") 89 | { 90 | children = new List (); 91 | } 92 | 93 | #endregion 94 | 95 | 96 | 97 | #region Public Properties 98 | 99 | /// 100 | /// Gets the children of the current instance. 101 | /// 102 | /// 103 | /// A object enumerating the 104 | /// children of the current instance. 105 | /// 106 | public override IEnumerable Children { 107 | get {return children;} 108 | } 109 | 110 | /// 111 | /// Gets the box headers for the current "udta" box and 112 | /// all parent boxes up to the top of the file. 113 | /// 114 | /// 115 | /// A containing the headers for 116 | /// the current "udta" box and its parent boxes up to 117 | /// the top of the file, in the order they appear, or if none is present. 119 | /// 120 | public BoxHeader [] ParentTree { 121 | get {return parent_tree;} 122 | set {parent_tree = value;} 123 | } 124 | 125 | #endregion 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/TextBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // TextBox.cs 3 | // 4 | // Author: 5 | // Alan McGovern 6 | // 7 | // Copyright (c) 2012 Alan McGovern 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as 11 | // published by the Free Software Foundation; either version 2.1 of the 12 | // License, or (at your option) any later version. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | using System; 23 | using TagLib.Mpeg4; 24 | 25 | namespace TagLib 26 | { 27 | public class TextBox : Box 28 | { 29 | #region Private Fields 30 | 31 | /// 32 | /// Contains the box's data. 33 | /// 34 | private ByteVector data; 35 | 36 | #endregion 37 | 38 | 39 | 40 | #region Constructors 41 | 42 | /// 43 | /// Constructs and initializes a new instance of with a provided header and handler 45 | /// by reading the contents from a specified file. 46 | /// 47 | /// 48 | /// A object containing the header 49 | /// to use for the new instance. 50 | /// 51 | /// 52 | /// A object to read the contents 53 | /// of the box from. 54 | /// 55 | /// 56 | /// A object containing the 57 | /// handler that applies to the new instance. 58 | /// 59 | /// 60 | /// is . 61 | /// 62 | public TextBox (BoxHeader header, TagLib.File file, 63 | IsoHandlerBox handler) 64 | : base (header, handler) 65 | { 66 | if (file == null) 67 | throw new ArgumentNullException ("file"); 68 | 69 | this.data = LoadData (file); 70 | } 71 | 72 | #endregion 73 | 74 | 75 | 76 | #region Public Properties 77 | 78 | /// 79 | /// Gets and sets the box data contained in the current 80 | /// instance. 81 | /// 82 | /// 83 | /// A object containing the box 84 | /// data contained in the current instance. 85 | /// 86 | public override ByteVector Data { 87 | get {return data;} 88 | set {data = value;} 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | 95 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/UnknownBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnknownBox.cs: Provides a simple implementation of a box of unknown type. 3 | // 4 | // Author: 5 | // Brian Nickel (brian.nickel@gmail.com) 6 | // 7 | // Copyright (C) 2006-2007 Brian Nickel 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | namespace TagLib.Mpeg4 { 27 | /// 28 | /// This class extends to provide a simple 29 | /// implementation of a box of unknown type. 30 | /// 31 | public class UnknownBox : Box 32 | { 33 | #region Private Fields 34 | 35 | /// 36 | /// Contains the box's data. 37 | /// 38 | private ByteVector data; 39 | 40 | #endregion 41 | 42 | 43 | 44 | #region Constructors 45 | 46 | /// 47 | /// Constructs and initializes a new instance of with a provided header and handler 49 | /// by reading the contents from a specified file. 50 | /// 51 | /// 52 | /// A object containing the header 53 | /// to use for the new instance. 54 | /// 55 | /// 56 | /// A object to read the contents 57 | /// of the box from. 58 | /// 59 | /// 60 | /// A object containing the 61 | /// handler that applies to the new instance. 62 | /// 63 | /// 64 | /// is . 65 | /// 66 | public UnknownBox (BoxHeader header, TagLib.File file, 67 | IsoHandlerBox handler) 68 | : base (header, handler) 69 | { 70 | if (file == null) 71 | throw new ArgumentNullException ("file"); 72 | 73 | this.data = LoadData (file); 74 | } 75 | 76 | #endregion 77 | 78 | 79 | 80 | #region Public Properties 81 | 82 | /// 83 | /// Gets and sets the box data contained in the current 84 | /// instance. 85 | /// 86 | /// 87 | /// A object containing the box 88 | /// data contained in the current instance. 89 | /// 90 | public override ByteVector Data { 91 | get {return data;} 92 | set {data = value;} 93 | } 94 | 95 | #endregion 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Mpeg4/Boxes/UrlBox.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UrlBox.cs 3 | // 4 | // Author: 5 | // Alan McGovern 6 | // 7 | // Copyright (c) 2012 Alan McGovern 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License as 11 | // published by the Free Software Foundation; either version 2.1 of the 12 | // License, or (at your option) any later version. 13 | // 14 | // This library is distributed in the hope that it will be useful, but 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with this library; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | using System; 23 | using TagLib.Mpeg4; 24 | 25 | namespace TagLib 26 | { 27 | public class UrlBox : Box 28 | { 29 | #region Private Fields 30 | 31 | /// 32 | /// Contains the box's data. 33 | /// 34 | private ByteVector data; 35 | 36 | #endregion 37 | 38 | 39 | 40 | #region Constructors 41 | 42 | /// 43 | /// Constructs and initializes a new instance of with a provided header and handler 45 | /// by reading the contents from a specified file. 46 | /// 47 | /// 48 | /// A object containing the header 49 | /// to use for the new instance. 50 | /// 51 | /// 52 | /// A object to read the contents 53 | /// of the box from. 54 | /// 55 | /// 56 | /// A object containing the 57 | /// handler that applies to the new instance. 58 | /// 59 | /// 60 | /// is . 61 | /// 62 | public UrlBox (BoxHeader header, TagLib.File file, 63 | IsoHandlerBox handler) 64 | : base (header, handler) 65 | { 66 | if (file == null) 67 | throw new ArgumentNullException ("file"); 68 | 69 | this.data = LoadData (file); 70 | } 71 | 72 | #endregion 73 | 74 | 75 | 76 | #region Public Properties 77 | 78 | /// 79 | /// Gets and sets the box data contained in the current 80 | /// instance. 81 | /// 82 | /// 83 | /// A object containing the box 84 | /// data contained in the current instance. 85 | /// 86 | public override ByteVector Data { 87 | get {return data;} 88 | set {data = value;} 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | 95 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Png/Codec.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Codec.cs: 3 | // 4 | // Author: 5 | // Mike Gemuende (mike@gemuende.be) 6 | // 7 | // Copyright (C) 2010 Mike Gemuende 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | namespace TagLib.Png 27 | { 28 | 29 | /// 30 | /// A Png photo codec. Contains basic photo details. 31 | /// 32 | public class Codec : Image.Codec 33 | { 34 | 35 | /// 36 | /// Gets a text description of the media represented by the 37 | /// current instance. 38 | /// 39 | /// 40 | /// A object containing a description 41 | /// of the media represented by the current instance. 42 | /// 43 | public override string Description { get { return "PNG File"; } } 44 | 45 | 46 | /// 47 | /// Constructs a new with the given width 48 | /// and height. 49 | /// 50 | /// 51 | /// The width of the photo. 52 | /// 53 | /// 54 | /// The height of the photo. 55 | /// 56 | /// 57 | /// A new instance. 58 | /// 59 | public Codec (int width, int height) 60 | : base (width, height) {} 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/TagLib.sources: -------------------------------------------------------------------------------- 1 | TAGLIB_CSFILES = \ 2 | $(wildcard *.cs) \ 3 | $(wildcard */*.cs) \ 4 | $(wildcard */*/*.cs) \ 5 | $(wildcard */*/*/*.cs) 6 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Tiff/Codec.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Codec.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | 26 | namespace TagLib.Tiff 27 | { 28 | /// 29 | /// A TIFF photo codec. Contains basic photo details. 30 | /// 31 | public class Codec : Image.Codec 32 | { 33 | private string description = "TIFF File"; 34 | 35 | /// 36 | /// Gets a text description of the media represented by the 37 | /// current instance. 38 | /// 39 | /// 40 | /// A object containing a description 41 | /// of the media represented by the current instance. 42 | /// 43 | public override string Description { get { return description; } } 44 | 45 | 46 | /// 47 | /// Constructs a new with the given width 48 | /// and height. 49 | /// 50 | /// 51 | /// The width of the photo. 52 | /// 53 | /// 54 | /// The height of the photo. 55 | /// 56 | /// 57 | /// A new instance. 58 | /// 59 | public Codec (int width, int height) 60 | : base (width, height) {} 61 | 62 | /// 63 | /// Constructs a new with the given width 64 | /// and height. 65 | /// 66 | /// 67 | /// The width of the photo. 68 | /// 69 | /// 70 | /// The height of the photo. 71 | /// 72 | /// 73 | /// The description of the photo type. 74 | /// 75 | /// 76 | /// A new instance. 77 | /// 78 | public Codec (int width, int height, string description) 79 | : base (width, height) { 80 | this.description = description; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Tiff/Rw2/IFDTag.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IFDTag.cs: Handles Panasonics weird metadata structure. 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2010 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using TagLib.IFD.Tags; 25 | 26 | namespace TagLib.Tiff.Rw2 27 | { 28 | /// 29 | /// Handles the weird structure of Panasonic metadata. 30 | /// 31 | public class IFDTag : TagLib.IFD.IFDTag 32 | { 33 | private File file; 34 | 35 | internal IFDTag (File file) : base () 36 | { 37 | this.file = file; 38 | } 39 | 40 | /// 41 | /// Gets the ISO speed the image, the current instance belongs 42 | /// to, was taken with. 43 | /// 44 | /// 45 | /// A with the ISO speed as defined in ISO 12232. 46 | /// 47 | /// 48 | /// Panasonic stores these in a somewhat unstandard location. 49 | /// 50 | public override uint? ISOSpeedRatings { 51 | // TODO: The value in JPGFromRAW should probably be used as well. 52 | get { 53 | return Structure.GetLongValue (0, (ushort) PanasonicMakerNoteEntryTag.ISO); 54 | } 55 | set { 56 | Structure.SetLongValue (0, (ushort) PanasonicMakerNoteEntryTag.ISO, value.HasValue ? (uint) value : 0); 57 | } 58 | } 59 | 60 | /// 61 | /// Gets the focal length the image, the current instance belongs 62 | /// to, was taken with, assuming a 35mm film camera. 63 | /// 64 | /// 65 | /// A with the focal length in 35mm equivalent in millimeters. 66 | /// 67 | /// 68 | /// Panasonic stores these in a somewhat unstandard location. 69 | /// 70 | public override uint? FocalLengthIn35mmFilm { 71 | get { 72 | var jpg = file.JpgFromRaw; 73 | if (jpg == null) 74 | return base.FocalLengthIn35mmFilm; 75 | var tag = jpg.GetTag (TagTypes.TiffIFD, true) as Image.ImageTag; 76 | if (tag == null) 77 | return base.FocalLengthIn35mmFilm; 78 | return tag.FocalLengthIn35mmFilm ?? base.FocalLengthIn35mmFilm; 79 | } 80 | set { 81 | (file.JpgFromRaw.GetTag (TagTypes.TiffIFD, true) as Image.ImageTag).FocalLengthIn35mmFilm = value; 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Xmp/XmlNodeExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // XmlNodeExtensions.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | using System.Collections.Generic; 26 | using System.Xml; 27 | 28 | namespace TagLib.Xmp 29 | { 30 | internal static class XmlNodeExtensions 31 | { 32 | public static bool In (this XmlNode node, string ns) 33 | { 34 | return node.NamespaceURI == ns; 35 | } 36 | 37 | public static bool Is (this XmlNode node, string ns, string name) 38 | { 39 | return node.In (ns) && node.LocalName == name; 40 | } 41 | 42 | // 7.2.2 coreSyntaxTerms 43 | // rdf:RDF | rdf:ID | rdf:about | rdf:parseType | rdf:resource | rdf:nodeID | rdf:datatype 44 | public static bool IsCoreSyntax (this XmlNode node) 45 | { 46 | return node.In (XmpTag.RDF_NS) && ( 47 | node.LocalName == XmpTag.RDF_URI || 48 | node.LocalName == XmpTag.ID_URI || 49 | node.LocalName == XmpTag.ABOUT_URI || 50 | node.LocalName == XmpTag.PARSE_TYPE_URI || 51 | node.LocalName == XmpTag.RESOURCE_URI || 52 | node.LocalName == XmpTag.NODE_ID_URI || 53 | node.LocalName == XmpTag.DATA_TYPE_URI 54 | ); 55 | } 56 | 57 | // 7.2.4 oldTerms 58 | // rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID 59 | public static bool IsOld (this XmlNode node) 60 | { 61 | return node.In (XmpTag.RDF_NS) && ( 62 | node.LocalName == XmpTag.ABOUT_EACH_URI || 63 | node.LocalName == XmpTag.ABOUT_EACH_PREFIX_URI || 64 | node.LocalName == XmpTag.BAG_ID_URI 65 | ); 66 | } 67 | 68 | // 7.2.5 nodeElementURIs 69 | // anyURI - ( coreSyntaxTerms | rdf:li | oldTerms ) 70 | public static bool IsNodeElement (this XmlNode node) 71 | { 72 | return !node.IsCoreSyntax () && 73 | !node.Is (XmpTag.RDF_NS, XmpTag.LI_URI) && 74 | !node.IsOld (); 75 | } 76 | 77 | // 7.2.6 propertyElementURIs 78 | // anyURI - ( coreSyntaxTerms | rdf:Description | oldTerms ) 79 | public static bool IsPropertyElement (this XmlNode node) 80 | { 81 | return !node.IsCoreSyntax () && 82 | !node.Is (XmpTag.RDF_NS, XmpTag.DESCRIPTION_URI) && 83 | !node.IsOld (); 84 | } 85 | 86 | // 7.2.7 propertyAttributeURIs 87 | // anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms ) 88 | public static bool IsPropertyAttribute (this XmlNode node) 89 | { 90 | return node is XmlAttribute && 91 | !node.IsCoreSyntax () && 92 | !node.Is (XmpTag.RDF_NS, XmpTag.DESCRIPTION_URI) && 93 | !node.Is (XmpTag.RDF_NS, XmpTag.LI_URI) && 94 | !node.IsOld (); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Xmp/XmpNodeType.cs: -------------------------------------------------------------------------------- 1 | // 2 | // XmpNodeType.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | using System; 25 | using System.Collections.Generic; 26 | 27 | namespace TagLib.Xmp 28 | { 29 | /// 30 | /// Denotes the type of a node. 31 | /// 32 | public enum XmpNodeType 33 | { 34 | /// 35 | /// Unstructured (simple) value node. 36 | /// 37 | Simple, 38 | 39 | /// 40 | /// Structured value node. 41 | /// 42 | Struct, 43 | 44 | /// 45 | /// Ordered array. 46 | /// 47 | Seq, 48 | 49 | /// 50 | /// Language alternative. 51 | /// 52 | Alt, 53 | 54 | /// 55 | /// Unordered structured value. 56 | /// 57 | Bag 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ncmdumpGUI/TagLib/Xmp/XmpNodeVisitor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // XmpNodeVisitor.cs: 3 | // 4 | // Author: 5 | // Ruben Vermeersch (ruben@savanne.be) 6 | // 7 | // Copyright (C) 2009 Ruben Vermeersch 8 | // 9 | // This library is free software; you can redistribute it and/or modify 10 | // it under the terms of the GNU Lesser General Public License version 11 | // 2.1 as published by the Free Software Foundation. 12 | // 13 | // This library is distributed in the hope that it will be useful, but 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | // Lesser General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU Lesser General Public 19 | // License along with this library; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 | // USA 22 | // 23 | 24 | namespace TagLib.Xmp 25 | { 26 | /// 27 | /// A visitor that walks the XMP node tree. This can be used to 28 | /// perform cleanups of XMP data. See the Visitor pattern for 29 | /// more info if you don't know how to use this. 30 | /// 31 | public interface XmpNodeVisitor 32 | { 33 | /// 34 | /// Visit an . 35 | /// 36 | /// 37 | /// The that is being visited. 38 | /// 39 | void Visit (XmpNode node); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ncmdumpGUI/bitbug_favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkylin/ncmdumpGUI/4a1497e39d27f4837753b18274f265b79410ac82/ncmdumpGUI/bitbug_favicon.ico --------------------------------------------------------------------------------