taglib-sharp-2.1.0.0/0000755000175000017500000000000011774620113014173 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/docs/0000755000175000017500000000000011774620113015123 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/docs/XmlInjector.cs0000644000175000017500000001435011442021373017706 0ustar00alexalex00000000000000/*************************************************************************** * XmlInjector.cs * * Copyright (C) 2008 Brian Nickel * Written by Brian Nickel (brian.nickel@gmail.com) ****************************************************************************/ /* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW: * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ using System; using System.Xml; public static class XmlInjector { public static int Main (string [] args) { if (args.Length != 2) { Console.WriteLine ("XmlInjector.exe ACTIONFILE.XML ACTION_NAME"); return 1; } XmlDocument doc = new XmlDocument (); try { doc.Load (args [0]); } catch { Console.WriteLine ("Could not open {0}.", args [0]); return 1; } string dir = System.IO.Directory.GetParent (args [0]).FullName; Console.WriteLine ("Setting working directory to {0}.", dir); System.IO.Directory.SetCurrentDirectory (dir); string path = string.Format ("//ActionSet[@Name='{0}']/File[@Path]", args [1]); foreach (XmlNode node in doc.SelectNodes (path)) if (!RunFileAction (node)) return 1; return 0; } private static bool RunFileAction (XmlNode fileElement) { string path = GetAttribute (fileElement, "Path"); XmlDocument doc = new XmlDocument (); try { doc.Load (path); } catch { Console.WriteLine ("ERROR: Could not open {0}.", path); return false; } Console.WriteLine ("Processing {0}...", path); foreach (XmlNode element in fileElement.SelectNodes ("Replace")) if (!ReplaceNode (fileElement.OwnerDocument, doc, element)) return false; foreach (XmlNode element in fileElement.SelectNodes ("Insert")) if (!InsertNode (fileElement.OwnerDocument, doc, element)) return false; foreach (XmlNode element in fileElement.SelectNodes ("Remove")) if (!RemoveNodes (doc, element)) return false; doc.Save (path); Console.WriteLine ("{0} saved.", path); return true; } private static bool ReplaceNode (XmlDocument sourceDocument, XmlDocument targetDocument, XmlNode replaceElement) { string sourcePath = GetAttribute (replaceElement, "Source"); string targetPath = GetAttribute (replaceElement, "Target"); if (OperationNotNeccessary (targetDocument, replaceElement)) { Console.WriteLine (" Skipping replacement of {0}.", targetPath); return true; } Console.WriteLine (" Replacing {0}.", targetPath); XmlNode sourceNode = sourcePath == null ? null : sourceDocument.SelectSingleNode (sourcePath); XmlNode targetNode = targetPath == null ? null : targetDocument.SelectSingleNode (targetPath); if (sourceNode == null) sourceNode = replaceElement.FirstChild; if (sourceNode == null) { Console.WriteLine ("ERROR: Could not find source node: {0}", sourcePath); return false; } if (targetNode == null) { Console.WriteLine ("ERROR: Could not find target node: {0}", targetPath); return false; } targetNode.ParentNode.ReplaceChild (targetDocument.ImportNode (sourceNode, true), targetNode); return true; } private static bool InsertNode (XmlDocument sourceDocument, XmlDocument targetDocument, XmlNode insertElement) { string sourcePath = GetAttribute (insertElement, "Source"); string targetPath = GetAttribute (insertElement, "Target"); if (OperationNotNeccessary (targetDocument, insertElement)) { Console.WriteLine (" Skipping insertion into {0}.", targetPath); return true; } Console.WriteLine (" Inserting into {0}.", targetPath); XmlNode sourceNode = sourcePath == null ? null : sourceDocument.SelectSingleNode (sourcePath); XmlNode targetNode = targetPath == null ? null : targetDocument.SelectSingleNode (targetPath); if (sourceNode == null) sourceNode = insertElement.FirstChild; if (sourceNode == null) { Console.WriteLine ("ERROR: Could not find source node: {0}", sourcePath); return false; } if (targetNode == null) { Console.WriteLine ("ERROR: Could not find target node: {0}", targetPath); return false; } targetNode.AppendChild (targetDocument.ImportNode (sourceNode, true)); return true; } private static bool RemoveNodes (XmlDocument targetDocument, XmlNode removeElement) { string targetPath = GetAttribute (removeElement, "Target"); if (OperationNotNeccessary (targetDocument, removeElement)) { Console.WriteLine (" Skipping removal of {0}.", targetPath); return true; } Console.WriteLine (" Removing {0}.", targetPath); while (true) { XmlNode targetNode = targetDocument.SelectSingleNode (targetPath); if (targetNode == null) return true; targetNode.ParentNode.RemoveChild (targetNode); } } private static bool OperationNotNeccessary (XmlDocument targetDocument, XmlNode actionElement) { string ifMissingPath = GetAttribute (actionElement, "IfMissing"); if (ifMissingPath != null && targetDocument.SelectSingleNode (ifMissingPath) != null) return true; return false; } private static string GetAttribute (XmlNode node, string attribute) { XmlAttribute xmlAttr = node.Attributes [attribute]; return xmlAttr == null ? null : xmlAttr.Value; } } taglib-sharp-2.1.0.0/docs/Makefile.in0000644000175000017500000003505111774620076017204 0ustar00alexalex00000000000000# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/Package.en.xml.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = Package.en.xml CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(monodocdir)" DATA = $(monodoc_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AL = @AL@ AMTAR = @AMTAR@ ASSEMBLY_NAME = @ASSEMBLY_NAME@ ASSEMBLY_VERSION = @ASSEMBLY_VERSION@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOCDIR = @DOCDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXIV2_CFLAGS = @EXIV2_CFLAGS@ EXIV2_LIBS = @EXIV2_LIBS@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GACUTIL_POLICY_FLAGS = @GACUTIL_POLICY_FLAGS@ GNOME_SHARP_CFLAGS = @GNOME_SHARP_CFLAGS@ GNOME_SHARP_LIBS = @GNOME_SHARP_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MDASSEMBLER = @MDASSEMBLER@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONODOCER = @MONODOCER@ MONO_FLAGS = @MONO_FLAGS@ MONO_NUNIT_CFLAGS = @MONO_NUNIT_CFLAGS@ MONO_NUNIT_LIBS = @MONO_NUNIT_LIBS@ NUNIT_CMD = @NUNIT_CMD@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POLICY_2_0_VERSIONS = @POLICY_2_0_VERSIONS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDIR = @WINDIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DOC_UPDATER = @MONODOCER@ -delete -pretty DOC_ASSEMBLER = @MDASSEMBLER@ --out taglib-sharp-docs --ecma ASSEMBLY = $(top_builddir)/src/$(ASSEMBLY_NAME).dll SLASHDOC = $(ASSEMBLY).xml @BUILD_DOCS_TRUE@monodocdir = $(DOCDIR) @BUILD_DOCS_TRUE@monodoc_DATA = \ @BUILD_DOCS_TRUE@ taglib-sharp-docs.zip \ @BUILD_DOCS_TRUE@ taglib-sharp-docs.tree \ @BUILD_DOCS_TRUE@ taglib-sharp-docs.source EXTRA_DIST = \ taglib-sharp-docs.source \ XmlInjector.cs \ Package.en.xml.in DISTCLEANFILES = \ taglib-sharp-docs.zip \ taglib-sharp-docs.tree MAINTAINERCLEANFILES = \ Makefile.in CLEANFILES = \ XmlInjector.exe all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Package.en.xml: $(top_builddir)/config.status $(srcdir)/Package.en.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-monodocDATA: $(monodoc_DATA) @$(NORMAL_INSTALL) @list='$(monodoc_DATA)'; test -n "$(monodocdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(monodocdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(monodocdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(monodocdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(monodocdir)" || exit $$?; \ done uninstall-monodocDATA: @$(NORMAL_UNINSTALL) @list='$(monodoc_DATA)'; test -n "$(monodocdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(monodocdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(monodocdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) @BUILD_DOCS_FALSE@clean-local: @BUILD_DOCS_FALSE@install-data-hook: @BUILD_DOCS_FALSE@uninstall-hook: clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-monodocDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-monodocDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-local \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-monodocDATA install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-hook \ uninstall-monodocDATA @BUILD_DOCS_TRUE@all: XmlInjector.exe @BUILD_DOCS_TRUE@XmlInjector.exe: XmlInjector.cs @BUILD_DOCS_TRUE@ $(MCS) -out:$@ -r:System.Xml $< @BUILD_DOCS_TRUE@en/index.xml: $(ASSEMBLY) $(SLASHDOC) XmlInjector.exe Package.en.xml # monodocer will create duplicate tags if run multiple times. Delete the whole # directory and start over. @BUILD_DOCS_TRUE@ if [ -d en ]; then \ @BUILD_DOCS_TRUE@ rm -rf en; \ @BUILD_DOCS_TRUE@ fi @BUILD_DOCS_TRUE@ $(DOC_UPDATER) -assembly:$(ASSEMBLY) -importslashdoc:$(SLASHDOC) -path:en > /dev/null @BUILD_DOCS_TRUE@ $(MONO) XmlInjector.exe Package.en.xml InsertMissingValues @BUILD_DOCS_TRUE@update-html: en @BUILD_DOCS_TRUE@ if [ -d taglib-sharp-web-docs ]; then \ @BUILD_DOCS_TRUE@ rm -rf taglib-sharp-web-docs; \ @BUILD_DOCS_TRUE@ fi; \ @BUILD_DOCS_TRUE@ mkdir taglib-sharp-web-docs; \ @BUILD_DOCS_TRUE@ monodocs2html -o taglib-sharp-web-docs en; @BUILD_DOCS_TRUE@taglib-sharp-docs.tree: taglib-sharp-docs.zip @BUILD_DOCS_TRUE@taglib-sharp-docs.zip: en/index.xml @BUILD_DOCS_TRUE@ $(DOC_ASSEMBLER) en @BUILD_DOCS_TRUE@install-data-hook: XmlInjector.exe Package.en.xml @BUILD_DOCS_TRUE@ $(MONO) XmlInjector.exe Package.en.xml InjectMenuItem @BUILD_DOCS_TRUE@uninstall-hook: XmlInjector.exe Package.en.xml @BUILD_DOCS_TRUE@ $(MONO) XmlInjector.exe Package.en.xml RemoveMenuItem @BUILD_DOCS_TRUE@clean-local: @BUILD_DOCS_TRUE@ if [ -d en ]; then \ @BUILD_DOCS_TRUE@ rm -rf en; \ @BUILD_DOCS_TRUE@ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: taglib-sharp-2.1.0.0/docs/taglib-sharp-docs.source0000644000175000017500000000020211442021373021635 0ustar00alexalex00000000000000 taglib-sharp-2.1.0.0/docs/Makefile.am0000644000175000017500000000300511773612154017162 0ustar00alexalex00000000000000DOC_UPDATER = @MONODOCER@ -delete -pretty DOC_ASSEMBLER = @MDASSEMBLER@ --out taglib-sharp-docs --ecma ASSEMBLY = $(top_builddir)/src/$(ASSEMBLY_NAME).dll SLASHDOC = $(ASSEMBLY).xml if BUILD_DOCS all: XmlInjector.exe XmlInjector.exe: XmlInjector.cs $(MCS) -out:$@ -r:System.Xml $< monodocdir = $(DOCDIR) monodoc_DATA = \ taglib-sharp-docs.zip \ taglib-sharp-docs.tree \ taglib-sharp-docs.source en/index.xml: $(ASSEMBLY) $(SLASHDOC) XmlInjector.exe Package.en.xml # monodocer will create duplicate tags if run multiple times. Delete the whole # directory and start over. if [ -d en ]; then \ rm -rf en; \ fi $(DOC_UPDATER) -assembly:$(ASSEMBLY) -importslashdoc:$(SLASHDOC) -path:en > /dev/null $(MONO) XmlInjector.exe Package.en.xml InsertMissingValues update-html: en if [ -d taglib-sharp-web-docs ]; then \ rm -rf taglib-sharp-web-docs; \ fi; \ mkdir taglib-sharp-web-docs; \ monodocs2html -o taglib-sharp-web-docs en; taglib-sharp-docs.tree: taglib-sharp-docs.zip taglib-sharp-docs.zip: en/index.xml $(DOC_ASSEMBLER) en install-data-hook: XmlInjector.exe Package.en.xml $(MONO) XmlInjector.exe Package.en.xml InjectMenuItem uninstall-hook: XmlInjector.exe Package.en.xml $(MONO) XmlInjector.exe Package.en.xml RemoveMenuItem clean-local: if [ -d en ]; then \ rm -rf en; \ fi endif EXTRA_DIST = \ taglib-sharp-docs.source \ XmlInjector.cs \ Package.en.xml.in DISTCLEANFILES = \ taglib-sharp-docs.zip \ taglib-sharp-docs.tree MAINTAINERCLEANFILES = \ Makefile.in CLEANFILES = \ XmlInjector.exe taglib-sharp-2.1.0.0/docs/Package.en.xml.in0000644000175000017500000002012611442021373020202 0ustar00alexalex00000000000000 TagLib# This package provides support for reading and writing the tagging information for a large number of tagging formats, as well as reading media properties for many standard audio and video formats. Copyright (C) 2007-2008 Brian Nickel TagLib provides a generic interface for reading media properties and editing tags on different audio and video files. The most straightforward way to read a file is through , which does type detection to create the correct . The TagLib.Aac namespace contains classes for handling the AAC file format. See http://www.hydrogenaudio.org/forums/lofiversion/index.php/t21617.html for the complete specification. The TagLib.Aiff namespace contains classes for handling the AIFF file format. See http://en.wikipedia.org/wiki/Audio_Interchange_File_Format for the complete specification. The TagLib.Ape namespace contains classes for reading APE tags. See http://wiki.hydrogenaudio.org/index.php?title=APEv2 for the complete specification. The TagLib.Asf namespace contains classes for handling the Microsoft Advanced Systems Format file format. See http://www.microsoft.com/windows/windowsmedia/forpros/format/asfspec.aspx for the complete specification. The TagLib.Flac namespace contains classes for handling the Xiph FLAC file format. See http://flac.sourceforge.net/format.html for the complete specification. The TagLib.Id3v1 namespace contains classes for handling the ID3v1.1 tagging format. See http://www.id3.org/ID3v1 for the complete specification. The TagLib.Id3v2 namespace contains classes for handling the ID3v2 tagging format. See http://www.id3.org/Developer_Information for the complete specification. The TagLib.Mpeg4 namespace contains classes for handling the MPEG-4 file format. See http://standards.iso.org/ittf/PubliclyAvailableStandards/c041828_ISO_IEC_14496-12_2005(E).zip for the complete specification. The TagLib.Mpeg namespace contains classes for handling MPEG-1/2 files and MPEG audio files. The TagLib.MusePack namespace contains classes for handling the MusePack file format. See http://www.musepack.net/ for the complete specification. The TagLib.NonContainer namespace provides classes for dealing with files that do not have a standardized tagging mechanism and may have any number of tags at their beginning or end. The FLAC file format is included in this because despite having a standard tagging mechanism, ID3 and APE tags are not uncommonly attached to the file. The TagLib.Ogg.Codecs namespace contains standard codecs used in Xiph Ogg files. The TagLib.Ogg namespace contains classes for handling the Xiph OGG file format. See http://www.xiph.org/ogg/ for the complete specification. The TagLib.Riff namespace contains all classes relevant to the reading of Microsoft RIFF files. These files include namely the WAV and AVI file formats. See http://msdn2.microsoft.com/en-us/library/ms779636.aspx for information on the RIFF AVI format. The TagLib.WavPack namespace contains all classes relevant to the reading of WavPack files. See http://www.wavpack.com/ for the complete specification. taglib-sharp-2.1.0.0/install-sh0000755000175000017500000003325611762620517016215 0ustar00alexalex00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: taglib-sharp-2.1.0.0/AUTHORS0000644000175000017500000000121211774617675015262 0ustar00alexalex00000000000000Maintainer: Gabriel Burt Contributors: Aaron Bockover Alan McGovern Alexander Kojevnikov Andrés G. Aragoneses Andy Beal Anton Drachev Bernd Niedergesaess Bertrand Lorentz Colin Turner Eamon Nerbonne Eberhard Beilharz Félix Velasco Gregory S. Chudov Guy Taylor Helmut Wahrmann Jakub 'Fiołek' Fijałkowski Jeffrey Stedfast Jeroen Asselman John Millikin Julien Moutte Marek Habersack Mike Gemünde Patrick Dehne Paul Lange Ruben Vermeersch Samuel D. Jack Stephane Delcroix Stephen Shaw Tim Howard Creator, past maintainer: Brian Nickel taglib-sharp-2.1.0.0/taglib-sharp.snk0000644000175000017500000000112411442021373017256 0ustar00alexalex00000000000000$RSA2|qwkgs#h8.oHp[Uy9J/j}.Ϸ5}NV ^L5 í}ÕoNGaޞ >:6:ٗĘ - |L1|vMmccS=s8ġ]. k(aoޢ0iؐz PTѳb{I8k֓ 8` /õ$p*ի KKC ĖY`7Ze'Y!5Z5SȘ彟yMa렰щO7()|tR&hCn^9,ņ+ 'BN!q. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR taglib-sharp-2.1.0.0/Makefile.in0000644000175000017500000006557511774620077016273 0ustar00alexalex00000000000000# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @IN_DIST_FALSE@am__append_1 = tests subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/taglib-sharp.pc.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = taglib-sharp.pc CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AL = @AL@ AMTAR = @AMTAR@ ASSEMBLY_NAME = @ASSEMBLY_NAME@ ASSEMBLY_VERSION = @ASSEMBLY_VERSION@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOCDIR = @DOCDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXIV2_CFLAGS = @EXIV2_CFLAGS@ EXIV2_LIBS = @EXIV2_LIBS@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GACUTIL_POLICY_FLAGS = @GACUTIL_POLICY_FLAGS@ GNOME_SHARP_CFLAGS = @GNOME_SHARP_CFLAGS@ GNOME_SHARP_LIBS = @GNOME_SHARP_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MDASSEMBLER = @MDASSEMBLER@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONODOCER = @MONODOCER@ MONO_FLAGS = @MONO_FLAGS@ MONO_NUNIT_CFLAGS = @MONO_NUNIT_CFLAGS@ MONO_NUNIT_LIBS = @MONO_NUNIT_LIBS@ NUNIT_CMD = @NUNIT_CMD@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POLICY_2_0_VERSIONS = @POLICY_2_0_VERSIONS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDIR = @WINDIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src examples docs $(am__append_1) DIST_SUBDIRS = \ src \ examples \ docs pkgconfig_in_files = taglib-sharp.pc.in pkgconfigdir = $(datadir)/pkgconfig pkgconfig_DATA = $(pkgconfig_in_files:.pc.in=.pc) EXTRA_DIST = \ $(pkgconfig_in_files) \ taglib-sharp.snk \ taglib-sharp.sln DISTCLEANFILES = taglib-sharp.pc MAINTAINERCLEANFILES = \ compile \ INSTALL \ config.h.in \ aclocal.m4 \ ltmain.sh \ Makefile.in \ depcomp \ missing \ install-sh \ configure \ config.sub \ config.guess \ mkinstalldirs UPLOAD_HOST = "$$BANSHEE_USER@banshee.fm" UPLOAD_PATH = "web/download.banshee.fm/taglib-sharp" all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): taglib-sharp.pc: $(top_builddir)/config.status $(srcdir)/taglib-sharp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-pkgconfigDATA @IN_DIST_FALSE@test: @IN_DIST_FALSE@ cd tests; make test; cd ..; distwin: all mkdir -p $(srcdir)/$(WINDIR) cp $(srcdir)/NEWS $(srcdir)/$(WINDIR)/NEWS.txt cp $(srcdir)/ChangeLog $(srcdir)/$(WINDIR)/ChangeLog.txt cp $(srcdir)/COPYING $(srcdir)/$(WINDIR)/COPYING.txt cp $(srcdir)/README $(srcdir)/$(WINDIR)/README.txt cp $(srcdir)/AUTHORS $(srcdir)/$(WINDIR)/AUTHORS.txt if [ -e $(srcdir)/windows-files ]; \ then cp -r $(srcdir)/windows-files/* $(srcdir)/$(WINDIR); \ fi cd $(srcdir)/src && make distwin zip -9 -r $(srcdir)/$(WINDIR).zip $(srcdir)/$(WINDIR) rm -rf $(srcdir)/$(WINDIR) push-release: distcheck distwin [[ -z "$$BANSHEE_USER" ]] && { echo "Set BANSHEE_USER"; exit 1; } || true mkdir -p release mv $(WINDIR).zip release mv $(PACKAGE)-$(VERSION).tar.* release cp ChangeLog release/$(PACKAGE)-$(VERSION).changes cp NEWS release/$(PACKAGE)-$(VERSION).news pushd release; sha256sum * > $(PACKAGE)-$(VERSION).sha256sum; popd scp -r release $(UPLOAD_HOST):$(UPLOAD_PATH)/$(VERSION) rm -rf release ssh $(UPLOAD_HOST) rm -f $(UPLOAD_PATH)/LATEST-IS\* ssh $(UPLOAD_HOST) touch $(UPLOAD_PATH)/LATEST-IS-$(VERSION) git tag -a -m "Tag for taglib-sharp release ${VERSION}" taglib-sharp-${VERSION} || bail "Could not create tag" git push origin taglib-sharp-${VERSION} || bail "Failed to push tag to remote" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: taglib-sharp-2.1.0.0/ChangeLog0000644000175000017500000102455711774617166016001 0ustar00alexalex00000000000000commit 3be76517089d5f13f57d3b0d9032f206618243de Author: Alan McGovern Date: Mon Jul 2 12:51:57 2012 -0400 [Audible] Commit the initial support for Audible files Only .aa files are supported. Parsing for .aax is not yet implemented. Patch was contributed by Guy Taylor and fixes bug: https://bugzilla.gnome.org/show_bug.cgi?id=601543 commit dff85c0e44fba553e124980a70d5d2584c67c1a7 Author: Alexander Kojevnikov Date: Sun Jul 1 14:43:22 2012 -0400 build: Don't need the MONO_USER commit 9543df0375ea20f78184a7f379a7c8953e5c807c Author: Alexander Kojevnikov Date: Sun Jul 1 10:16:49 2012 -0400 build: Prepare for 2.0.5.0 release commit be743939588613cdff187abaac0b534cd470c2e7 Author: Eamon Nerbonne Date: Sun May 22 16:58:39 2011 +0200 Use O(N) rather than O(N^2) deunsynchronization algorithm. Signed-off-by: Alexander Kojevnikov commit 9469df6a78842a7bfbf443e77eecc91aeb184567 Author: Eamon Nerbonne Date: Sun May 22 16:58:35 2011 +0200 On corrupt Id3v2 frame, skip just that frame, not the entire tag Fixes bgo#650674 Signed-off-by: Alexander Kojevnikov commit df93521dd409e5f568178d34131950a93d3a5ba2 Author: Eamon Nerbonne Date: Sun May 22 16:58:24 2011 +0200 Check for short popularimeter tags Signed-off-by: Alexander Kojevnikov commit 7e6d0a89feb3c7c40a54fc17fcdbfd1fec1dc5ba Author: Jakub 'Fiołek' Fijałkowski Date: Sat Jun 30 16:30:57 2012 -0400 StartTag.ReadTag should not silence exceptions Signed-off-by: Alexander Kojevnikov commit 0f0268457c465702657b64abc18b30dc83d184f3 Author: Alexander Kojevnikov Date: Sat Jun 30 16:19:09 2012 -0400 An additional MarkAsCorrupt call commit e4380983772a56b81c5527404325f6fd7efd778d Author: Tim Howard Date: Sat Jun 30 16:16:35 2012 -0400 Mark the file as corrupt instead of throwing exception Fixes bgo#643477 Signed-off-by: Alexander Kojevnikov commit e53ffcc4c417bac611fae80d1d0a88ecfafcfc6d Author: Alan McGovern Date: Sat Jun 30 12:27:48 2012 -0400 [Mpeg4] Attempt to handle corrupt tags a little better If an mpeg4 file contains an atom whose length is greater than the amount of bytes left in the file, mark the file as corrupt and bail out of the parsing step. Fixes bug #676934 commit 0158f137085da6eb988f089d3cecedba4a90a239 Author: samuel_d_jack Date: Wed Nov 9 15:57:11 2011 +0000 Fix nested UDTA boxes Fixed bug where a Udta box nested inside a track would be picked in preference to one at a higher level in the tree. Signed-off-by: Alexander Kojevnikov commit ec365a66807d09f3712e7910fce17992d412fc0c Author: Alexander Kojevnikov Date: Sat Jun 30 13:00:03 2012 -0400 Solution code formatting policy commit 21ef764e0a9c394d70dc3917c7bbebdce0a2eadd Author: Eberhard Beilharz Date: Sat Jan 7 18:15:36 2012 +0100 Add partial support for IPTC-IIM Allows reading a subset of possible IPTC-IIM tags from JPEG files. Specifically those tags are read that directly map to XMP tags. If both XMP and IIM tags exist the XMP tags take precedence. This change supports IIM as far as necessary to import images from Mediadex into f-spot. Signed-off-by: Alexander Kojevnikov commit 663c5fb0d90a5ba9222104213b55d8f7a8b99d09 Author: Alan McGovern Date: Fri Jun 29 16:27:42 2012 -0400 [Build] Glob together all the cs files for the taglib makefile build Keeps things nice and simple! commit d4879482f30517a85844c08ffda5c0249d21ea05 Author: Alan McGovern Date: Fri Jun 29 15:51:31 2012 -0400 [Mpeg4] Fix parsing of some more apple tags We correctly handle 'text' atoms inside an 'stda' atom now. commit 17a2404275aceb5273c88db525e526dc0a74a038 Author: Stephen Shaw Date: Wed Jun 27 12:28:23 2012 -0400 Didn't fix this test, but it is at the very least documented for the next brave individual that tries to fix it commit 363f8aeb89739dce4a88e22e42410b9eb0eed074 Author: Alan McGovern Date: Wed Jun 27 19:51:00 2012 -0400 [Mpeg4] Ensure that we parse AppleAdditionalInfoBox elements properly We do not care what the contents of these elements are. They can literally be anything. As such, we should parse them as a black box and assume nothing about their contents. Add a test to ensure we parse the file correctly. Fixes bgo 658920. commit 0f1a349cec8995294cb711f2fde13198130d2c72 Author: Alan McGovern Date: Wed Jun 27 12:13:30 2012 -0400 Test commit 64e9fa90636072a1cc1e9a125735366faf23496a Author: Alan McGovern Date: Wed Jun 27 12:09:28 2012 -0400 [Build] Commit the updated csproj/sln files We're now VS2010 format and do not enable Makefile integration. This fixes the build from MonoDevelop/Visual Studio. commit 475b7c1888f0d297168deaaddf8d432feee7b1fd Author: Alan McGovern Date: Wed Jun 27 12:04:56 2012 -0400 [File] Properly implement partial matching for File.Find and File.RFind Remove the need to care about partial matches be always rewinding the stream a little before reading the next chunk of data so that we can ensure we never have data which exists at the end of one read and the start of the next. commit 9d8bea03800591d46374938bf5b54cbad571bfe8 Author: Alan McGovern Date: Wed Jun 27 10:10:52 2012 -0400 [Tests] Fix some compiler warnings commit 9fcfb6f7c76e00cd64fd95d6fdf2bb4c2d2f9caf Merge: f33b2b1 6962832 Author: Alexander Kojevnikov Date: Thu Mar 22 03:35:22 2012 -0700 Merge pull request #9 from omgtehlion/master Fixed freeze on some mp3-files, where header was at the end of file commit f33b2b12fbd8b96fe3563f80672ef2cd16e8ff4e Author: Alexander Kojevnikov Date: Mon Feb 6 21:56:25 2012 +0800 Fix monodocdir commit 665acfa908bbb2f2e22dbd2760daafb09b3241fa Author: Chow Loong Jin Date: Sun Feb 5 23:42:25 2012 +0800 Use gacutil for ICSharpCode.SharpZipLib check commit 4f00a742695ea305a65e5ac21ef5d6c938735378 Author: Chow Loong Jin Date: Mon Feb 6 01:06:24 2012 +0800 Readd Taglib.Mpeg4.FileParser.UserDataBox property The UserDataBox property was renamed to UserDataBoxes and its return type changed to an array between 2.0.3.7 and 2.0.4.0, resulting in an ABI breakage. This patch readds the property for backward compatibility. commit 6962832ae288adcff77a1ca9071a42466b8ce30d Author: Anton Drachev Date: Wed Feb 1 23:22:19 2012 +0400 taglib freezes on certain mp3 files commit 1d4191f1bc09f600e691181ec0c5ffad3a4a4ec3 Author: Gabriel Burt Date: Wed Apr 13 12:15:39 2011 -0500 build: Fix push-release target commit b289765aa9096432508301711b9bd0c363b138a3 Author: Gabriel Burt Date: Wed Apr 13 12:10:46 2011 -0500 build: Remove IntList, copy README/AUTHORS in distwin commit 0fdcb611b931523f489fbf1e6cd4ce7c0a139526 Author: Gabriel Burt Date: Wed Apr 13 11:59:50 2011 -0500 build: Fix .csproj/.sln build Remove obsolete/duplicate taglib-sharp.csproj in favor of src/taglib-sharp.csproj. commit e4e8d00a77f63a5cf2da22ee11c068e62ced3175 Author: Gabriel Burt Date: Wed Apr 13 11:27:56 2011 -0500 Update NEWS etc for 2.0.4.0 release commit 28a9b08cb4dc99133295f58b0903bd4ea594cda8 Author: Ruben Vermeersch Date: Wed Apr 13 18:19:44 2011 +0200 Revert "Make sure the entry size is even possible before trying to create it" This reverts commit 8975dafa64d2f31219fe7f1177a3a08933cd82e4. commit e2ed0e612eedbf8fd3c69b294950727b22398179 Author: Gabriel Burt Date: Wed Apr 13 11:02:05 2011 -0500 ICodec: Fix MediaTypes flag enum values (bgo#645844) These values need to be 2^n so they are distinguishable. This is an API break for folks who have been using git master, but is not an API break of any taglib# release. commit 5fe7555cdb881ee81de3f9d2ee65e29746e1c556 Author: Jeroen Asselman Date: Tue Mar 1 16:10:37 2011 +0100 Fix File.ReadBlock for slow connections (bgo#639817) Stream.Read might read fewer bytes then requested (this is documented), so try to continue reading until all requested bytes are read. Signed-off-by: Gabriel Burt commit ff0117e4094f217e584a87876554bb880583e2aa Author: Julien Moutte Date: Mon Mar 7 13:43:41 2011 +0100 Fix more warnings for assigned but never used variables. commit 4aa51d7b3438493ce8a5ef47172fc6525ed2a7fd Author: Julien Moutte Date: Mon Mar 7 13:30:30 2011 +0100 Add comments on all public members/methods to fix warnings. commit a40ae47748793f1773a8258c57941945cb0cf769 Author: Julien Moutte Date: Mon Mar 7 12:27:47 2011 +0100 Add Matroska source files for Linux build. commit 925b97d929cf05fb348e1c4fba6b17b995b9b086 Author: Julien Moutte Date: Mon Mar 7 11:51:21 2011 +0100 Add initial support for Matroska file reader. commit 8659479f7c2b2532ad1a7629692c7c8411abf58e Author: Julien Moutte Date: Mon Mar 7 11:50:59 2011 +0100 Add an enumeration for text streams (subtitles). commit 37b0859e42c6fccdc52da7af5f4b626171d29d58 Author: Julien Moutte Date: Mon Mar 7 11:50:25 2011 +0100 Add methods to read doubles and floats. commit 0fe3191ae5e71ffa00017c18d5e2f84002f82b73 Author: Alexander Kojevnikov Date: Sun Jan 30 20:52:16 2011 +0800 Fix `gmake test` under FreeBSD commit 3817310700909ba9b58b15004556e7737fd6af6c Author: Alexander Kojevnikov Date: Sun Jan 30 20:45:11 2011 +0800 Sort tests/Makefile.am commit 86054f74f68b7307005cccc5ef6a23ad1300ec1a Author: Ruben Vermeersch Date: Sun Dec 19 14:31:31 2010 +0100 Accidentally added RW2, doh! commit aa7978fca9dd7da59d7f64931b5fadbb13bc70c4 Author: Ruben Vermeersch Date: Sun Dec 19 13:04:25 2010 +0100 Add yet-to-support types to NoMetadata to prevent F-Spot crashes. These files can be loaded in F-Spot. commit 8975dafa64d2f31219fe7f1177a3a08933cd82e4 Author: Tim Howard Date: Sun Dec 12 12:23:29 2010 -0500 Make sure the entry size is even possible before trying to create it https://bugzilla.gnome.org/show_bug.cgi?id=633972 commit 7541844d9f151baf10a945ac9eaa22007364c902 Author: Ruben Vermeersch Date: Mon Nov 29 10:45:01 2010 +0100 Add test for broken CR2 file. https://bugzilla.gnome.org/show_bug.cgi?id=633972 commit c408cb26ab2d45ac680554d5c001699cfe6ddb43 Author: Tim Howard Date: Wed Nov 17 12:58:09 2010 -0500 Make sure that size of the SubIFD is sane https://bugzilla.gnome.org/show_bug.cgi?id=633972 commit 47728711d5a993c19ae1b4e7a89ea5c769caf97c Author: Ruben Vermeersch Date: Tue Nov 16 22:08:44 2010 +0100 Fix another Length issue. PTP not supporting stream length is such a pain. https://bugzilla.gnome.org/show_bug.cgi?id=629766 commit 51558b0d74db63a96cd9a2358f7f6b81a555770d Author: Gabriel Burt Date: Wed Oct 27 14:33:07 2010 -0500 [File] Make MarkAsCorrupt internal commit 4ea972fc86006e976d6a2e255dac8bfea33a21d9 Merge: 8d6e98c c6a6d93 Author: Gabriel Burt Date: Wed Oct 27 14:26:23 2010 -0500 Merge branch 'photo-support' Conflicts: tests/tests.csproj commit c6a6d93da9b29a247d0f25210dc02e0d9535e2c1 Author: Ruben Vermeersch Date: Wed Oct 27 11:37:42 2010 +0200 Fix an XMP parse failure. https://bugzilla.gnome.org/show_bug.cgi?id=631333 commit 884aabafe9fdf1e965b01be227a8c12e657cc1df Author: Ruben Vermeersch Date: Wed Oct 27 11:36:02 2010 +0200 Extend fixture generator for XmpBag with multiple items. commit 2d62c8deb2cf6b758b3b18b07f72c05a055ea172 Author: Ruben Vermeersch Date: Sat Oct 23 13:31:03 2010 +0200 Update DNG test to check the new DNG geometry code. commit fe267bfc7c2d520900e8553cdd6cf940ca72dc57 Author: Ruben Vermeersch Date: Sat Oct 23 13:26:11 2010 +0200 Correctly extract image size for DNG. commit 59bb02db11d80103ffe6d3a64b3fcd7b860d8d08 Author: Ruben Vermeersch Date: Sat Oct 23 13:02:14 2010 +0200 Fix tests. commit d50efa92d05f2ff53281797ddaa6e2fa4aa829eb Author: Ruben Vermeersch Date: Fri Oct 22 21:44:29 2010 +0200 Be a bit more tolerant about XMP parsing failures. commit 0ea33a9efd6b8daaa5f9d5f1a96baaf49fa742d0 Author: Ruben Vermeersch Date: Fri Oct 22 21:15:44 2010 +0200 Handle a file with a bad user comment marker. https://bugzilla.gnome.org/show_bug.cgi?id=632930 commit 19abba541d4d5057be899c5fbb0a701f1b71f88a Author: Ruben Vermeersch Date: Fri Oct 22 20:48:14 2010 +0200 Make it possible to debug corruptions. commit 5b8a05f130d7e2bf6e284ae0486c9193112806fa Author: Marek Habersack Date: Wed Sep 15 23:18:08 2010 +0200 All fields of a struct must be initialized before the constructor returns https://bugzilla.gnome.org/show_bug.cgi?id=629222 commit b597fe772b8f2278bde0cc3d0815c5a51c54370e Author: Ruben Vermeersch Date: Mon Sep 13 15:08:11 2010 +0200 More file.Length protection fixes. commit 3bc3d802044028daa755b424f91ac73ded049b95 Author: Ruben Vermeersch Date: Mon Sep 13 11:04:43 2010 +0200 Make IFD parsing slightly more robust. Not all IO backends support finding the length of a stream. I relaxed the safety check slightly to fall back to using the max length of a TIFF file as per the specification: 4 gigabyte. https://bugzilla.gnome.org/show_bug.cgi?id=629386 commit 8d6e98ce97b731556be11096e9841baadfa3683d Author: Colin Turner Date: Wed Sep 8 14:12:07 2010 +1000 2010-09-08 Alexander Kojevnikov * src/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/FileParser.cs: * tests/Makefile.am: * tests/fixtures/TagLib.Tests.FileFormats/M4vFormatTest.cs: * tests/samples/sample.m4v: * tests/tests.csproj: Patch from Colin Turner fixing mpeg4 file parsing of udta boxes (bgo#575842) Signed-off-by: Alexander Kojevnikov commit b8f78f4cbda5bdd09d484824eaa72bff1d9b82a2 Author: Gabriel Burt Date: Wed Sep 1 12:02:43 2010 -0500 Update README with git instructions commit d123960445605992b3cd74c626aab3b39526ff42 Author: Ruben Vermeersch Date: Thu Aug 12 13:43:19 2010 +0200 Fix Leica M8 makernote parsing. commit 9d567a7bcbd607129457dc80cb8bf14818501e60 Author: Ruben Vermeersch Date: Thu Aug 12 13:41:59 2010 +0200 Don't fail parsing IFDs with invalid entry types. https://bugzilla.gnome.org/show_bug.cgi?id=625367 commit 9d92818411c42c05798307624ff375c3b4f3fcc2 Author: Ruben Vermeersch Date: Tue Aug 10 12:35:19 2010 +0200 Add image/x-panasonic-raw mime type. commit ef058da50ce8d82d8e5740317aceee78f9a807c9 Author: Ruben Vermeersch Date: Mon Aug 9 15:31:59 2010 +0200 Add Leica .RAW support. https://bugzilla.gnome.org/show_bug.cgi?id=622104 commit 162333e1906959707693dec8cae04016d567294f Author: Ruben Vermeersch Date: Sat Aug 7 20:48:57 2010 +0200 Lock on the file while detecting IFD loops. Fixes a potential race-condition crash. commit 33f4fd526d9e7091dc97c14235aed54f65ed85e9 Author: Ruben Vermeersch Date: Sat Aug 7 21:35:33 2010 +0200 Trim nulls in UserComment. Some files are littered by null bytes. Make sure we trim them. commit f9c29e94f14869cf22468782cc356e2079cdd921 Author: Ruben Vermeersch Date: Sat Aug 7 18:48:09 2010 +0200 Fix width/height parsing for RW2 files. commit 0394adaa79b04476192aafa89b63e1ef39f2d748 Author: Ruben Vermeersch Date: Sat Aug 7 18:40:55 2010 +0200 Add Pentax RAW support. https://bugzilla.gnome.org/show_bug.cgi?id=622103 commit 1c69bc61eb8da13eb83b366b6f068d6ef4385c3a Author: Ruben Vermeersch Date: Sat Aug 7 18:10:30 2010 +0200 Remove unused variable. commit 1008c7d161bdca6368844367054944b111f0bbea Author: Ruben Vermeersch Date: Sat Aug 7 17:44:06 2010 +0200 Fix the extraction of some values in RW2. Panasonic stores these in unstandard locations. commit 3f6c8a5a3dabfb335ab67259e258bc747219a9ae Author: Ruben Vermeersch Date: Sat Aug 7 16:43:59 2010 +0200 [IFD] Fix parsing with non-null delimited strings. There was an interesting off-by-one parsing error for strings that were not delimited by a null byte. This commit makes sure we read the entire byte array and then cut of everything up to the null byte. https://bugzilla.gnome.org/show_bug.cgi?id=493530 commit dbad977936d4efc6187767b9ae1cec1edfa288f1 Author: Ruben Vermeersch Date: Thu Jul 22 15:26:13 2010 +0200 [Jpeg] Don't complain if the stream Length can't be read. https://bugzilla.gnome.org/show_bug.cgi?id=624671 commit be510696d1b0d7eee1e8947c29ff0d7949e4f543 Author: Ruben Vermeersch Date: Thu Jul 22 15:08:32 2010 +0200 Detect IFD entry type 0 corruption. https://bugzilla.gnome.org/show_bug.cgi?id=625009 commit 8d44e11a5473417f3bbf2590260c57257ec8d7ab Author: Ruben Vermeersch Date: Thu Jul 22 15:08:04 2010 +0200 Ignore compiled helper binaries. commit ce41ae6314ab5a891140856e6b7c7d1c50b8d91d Author: Ruben Vermeersch Date: Thu Jul 22 14:50:17 2010 +0200 Comment out unused lines. commit a1161e8b901ca73f56a3984a23f64379c6522dbb Author: Ruben Vermeersch Date: Thu Jul 22 14:48:14 2010 +0200 Update unit tests, the used XMP tags do not contain the Orientation. commit 2bdf23c46adff2d46a58694005a8e5beb3063f38 Author: Ruben Vermeersch Date: Thu Jul 22 14:47:13 2010 +0200 Don't throw exception on invalid IFD offsets. Mark as corrupt instead. commit e88f64ec9c9953037ff6aad0d3d8dcc4ec432473 Author: Mike Gemünde Date: Tue Jul 20 12:52:08 2010 +0200 Fix CopyFromTest to be unsensitive to different formats of ToString for DateTime commit ecfe021ae3549140067de5ea7fd990bf606d4d91 Author: Mike Gemünde Date: Tue Jul 20 12:50:02 2010 +0200 Add default value for ImageOrientation (None = 0) It was not possible to distinguish wether a orientation is not set or it is set to TopLeft, because TopLeft was used as the default. This caused problems when determining the orientation in CombinedImageTag. Therfore, a default is now added to get the correct value. commit 486632c7bc8ef86c41a60680272481c3e5fdee24 Author: Mike Gemünde Date: Sun Jul 18 09:51:05 2010 +0200 Fix typo in mime type of cr2 files commit 8c922c0387d32176ef940791f25ec9db533ac0cf Author: Ruben Vermeersch Date: Tue Jul 13 20:31:27 2010 +0200 Cycle detection to avoid endless IFD loops. https://bugzilla.gnome.org/show_bug.cgi?id=391671 commit 0bf4c68da62ad73a927b127d9d61571a68cbd43c Author: Ruben Vermeersch Date: Tue Jul 13 18:47:55 2010 +0200 Parse and detect corruption in Olympus makernotes. https://bugzilla.gnome.org/show_bug.cgi?id=555340 commit 634a55d461819277f1cd032e602b0468e5c71870 Author: Ruben Vermeersch Date: Tue Jul 13 17:47:24 2010 +0200 Handle all space comments. https://bugzilla.gnome.org/show_bug.cgi?id=397002 commit 9ac4daf03c50f697aea45333692d9d0e51396095 Author: Ruben Vermeersch Date: Tue Jul 13 17:46:31 2010 +0200 Support generating fixtures for Olympus files. commit 5b595bef6bdf74f70239248bf46a8a8193c5b085 Author: Ruben Vermeersch Date: Tue Jul 13 17:34:30 2010 +0200 Add support for empty comments consisting of only spaces. commit fb8e08b00909eea17cf2c08553c3c5aaf165dd5a Author: Ruben Vermeersch Date: Tue Jul 13 17:22:07 2010 +0200 Add SVG support via NoMetadata, for now. commit a67a562149925fd0862b9d3858c401f4f5d97ddb Author: Ruben Vermeersch Date: Mon Jul 12 17:48:24 2010 +0200 Refuse to write files with unknown corruptions. Certain Nikon files can have strange corruptions which we're not sure how to parse (nor do other metadata libraries). This may be a bug or a feature. We detect it and refuse to write in such cases. https://bugzilla.gnome.org/show_bug.cgi?id=624097 commit 6c3ce99097a13e6194a755dfeec8ab82aeec23a1 Author: Ruben Vermeersch Date: Sun Jul 11 13:05:01 2010 +0200 Validate remaining XmpTag values. commit 785e4cb1bbfccc3a2d4a2d2258b69937abf3f524 Author: Ruben Vermeersch Date: Sun Jul 11 12:42:59 2010 +0200 Start validating ImageTag implementations. Fixes some bugs in XmpTag and adds some fallbacks. commit 0659501225f66d8e22df141502fc1a897d797067 Author: Ruben Vermeersch Date: Wed Jul 7 00:33:26 2010 +0200 Parse embedded JpgFromRaw in RW2 files. commit a58728170f54fd7823df1bca318cf2a6214f9c02 Author: Ruben Vermeersch Date: Mon Jul 5 19:08:27 2010 +0200 Remove debug statements. commit fa81e725cd7104e12a75b92c622d302780713892 Author: Ruben Vermeersch Date: Thu Jul 1 19:30:21 2010 +0200 Add Rw2 files to Monodevelop projects. commit c8964265eebde4e623716e4e9ef906f3a505eef0 Author: Ruben Vermeersch Date: Sun Jun 27 17:39:10 2010 +0200 First incomplete attempt at RW2 support. Different approach is needed, but I'm too frustrated with Panasonics horrible format for now. commit adddbacf46b928c207e1104be98c5ed584d58b53 Author: Ruben Vermeersch Date: Tue Jul 6 19:28:13 2010 +0200 Fix build breakage. commit 4a6f66c806c0f725778e4fb091c674bf6434cc62 Author: Ruben Vermeersch Date: Mon Jul 5 23:20:27 2010 +0200 Add initial DNG support. Gets the size wrong, but I'll fix that soon, when I start adding a simple API test for each file type. commit 97668fecb6f55ec15610c39f58c81608f9caa015 Author: Ruben Vermeersch Date: Mon Jul 5 19:50:35 2010 +0200 Add Sony ARW support. commit dd99430ab167520497e584eb9a562eceadf269c6 Author: Ruben Vermeersch Date: Fri Jul 2 23:17:50 2010 +0200 Add PCX support to NoMetadata. commit f96cca366b0d34a76a9679df69de8868d435df33 Author: Ruben Vermeersch Date: Fri Jul 2 23:12:42 2010 +0200 Add mime types and extensions for Netpbm to NoMetadata. commit 454ae09e6cb5f5d6d1815bb5d3ed2785b2de0c5a Author: Ruben Vermeersch Date: Fri Jul 2 23:09:43 2010 +0200 Add mime types for bitmaps. commit 9f7bdc3a04a89cd339dbe647198cbcb1f9536c78 Author: Ruben Vermeersch Date: Fri Jul 2 22:37:43 2010 +0200 Add bitmap as a non-metadata type. commit a96174f6eae4eabeeda59b427afe7d9ba1f5d76b Author: Ruben Vermeersch Date: Fri Jul 2 22:31:13 2010 +0200 Add a fallback type for images without metadata. commit 3e2f3819ad7ce424672e2127c5894a33ab372573 Author: Ruben Vermeersch Date: Fri Jul 2 10:32:31 2010 +0200 Make a list copy to avoid out-of-sync enumerators. commit 8445fc0927f14607f0c4a32d4233ec2f1e9f703d Author: Ruben Vermeersch Date: Fri Jul 2 10:29:55 2010 +0200 Remove empty Sub IFDs before rendering. commit 7d632cc334efea165190c19863363252bf2b6539 Author: Ruben Vermeersch Date: Fri Jul 2 10:23:14 2010 +0200 Revert "Don't render empty Sub IFDs" This reverts commit 359bf87df97b991d9e9de53d0e63ba02424796ab. Not the right way to fix it. commit aa93264a11e5b994c829d57521860d62bac58191 Author: Ruben Vermeersch Date: Fri Jul 2 10:17:11 2010 +0200 Don't render empty Sub IFDs commit 0c1bf35b0cf9f68dbb96df6501ae1cd3144daa08 Author: Ruben Vermeersch Date: Fri Jul 2 10:04:30 2010 +0200 Fix handling of nullable assignments. commit d4ab524264c5defe57046950697ba41c9dc96715 Author: Ruben Vermeersch Date: Fri Jul 2 01:25:53 2010 +0200 Add metadata copying between images. Only copies the values from ImageTag. Good enough. https://bugzilla.gnome.org/show_bug.cgi?id=618770 commit f8bc4a360d158cbc76852d94f5e0ab8baddfb976 Author: Ruben Vermeersch Date: Thu Jul 1 18:14:02 2010 +0200 Update MonoDevelop support. commit 3a625b1054f3cb1eed898471dbb4406783d94142 Author: Ruben Vermeersch Date: Sun Jun 27 17:11:51 2010 +0200 Indent values in ParsePhoto. commit 00a049969c3428e06c81422afa0ed8258ef117fc Author: Ruben Vermeersch Date: Sun Jun 27 00:54:55 2010 +0200 Remove stray file from build. This shouldn't have been committed. commit 80942aae30028a919022c26ae117296fc0912c3a Author: Ruben Vermeersch Date: Sun Jun 27 00:08:10 2010 +0200 Make the Tiff Codec type reusable. Avoid having to define a new one for each new Tiff-derived type. commit f5a98009508fc8961eff1cb5c0c18447dfaf7af7 Author: Ruben Vermeersch Date: Sat Jun 26 23:54:58 2010 +0200 Move Tiff-based RAW types into Tiff namespace. There will be a lot of them, don't want to clutter the main source tree. commit dd7c59b844ee8c840b544b7bffb60935f1b1409e Author: Ruben Vermeersch Date: Sat Jun 26 23:19:08 2010 +0200 Don't crash when writing empty XMP collections. commit 06211a9fc78172fb7bce88136d268391c11c974f Author: Ruben Vermeersch Date: Thu Jun 24 20:27:59 2010 +0200 Expand Nikon format support. Nikon encodes a ton of info into byte arrays. These are not parsed yet. Perhaps we should do so at some point, or at least pull the interesting bits out. commit 6d75fdc99e004d0b1e24e15474d163c638d3ffb6 Author: Ruben Vermeersch Date: Thu Jun 24 20:26:43 2010 +0200 Add support for SubIFDs and SubImages. commit 737857b640e60a0424e9317b83d768685ca096a7 Author: Ruben Vermeersch Date: Thu Jun 24 20:11:04 2010 +0200 Update to test repository with NEF file. commit 8fe3d0ee40610d78e27da996d3a379a022eeadb3 Author: Ruben Vermeersch Date: Thu Jun 24 18:26:36 2010 +0200 Don't inherit file type attributes. This makes it possible to make an inherited TIFF type for NEF files. commit 40af7636c446833561d203b64e47e961e51cb973 Author: Ruben Vermeersch Date: Wed Jun 23 11:36:09 2010 +0200 Add initial NEF support. commit 7b1311a55c9a2d4173ac3f3c472007f87668a827 Author: Ruben Vermeersch Date: Wed Jun 23 11:09:40 2010 +0200 Fix copy/paste error in comments. commit 5c986c18a831105556aff482cd75be6e6ba213d9 Author: Ruben Vermeersch Date: Sun Jun 20 15:29:27 2010 +0200 Compare visual data based on hashes. Slightly faster. commit 5d39e3d9dbe06cf357469335a9f698a4afefe1cf Author: Mike Gemünde Date: Thu Jun 17 13:14:34 2010 +0200 Add Canon CR2 test commit 405d847b7ac611cbe07555987096df6a9ab0d692 Author: Ruben Vermeersch Date: Sun Jun 20 15:55:09 2010 +0200 Add IFD tags for a bunch of Canon fields. commit 731f2e0b76e79b8587c8ea1d9c1f53e336cccbe8 Author: Ruben Vermeersch Date: Sun Jun 20 15:22:45 2010 +0200 Compare very large values by MD5. commit 640714afe48fe208dbdd7f8366db4757192f859e Author: Mike Gemünde Date: Thu Jun 17 13:13:30 2010 +0200 Extend ImageTest ImageTest is extended to handle image files in different locations and to allow read-only images tested. commit 51ceeb695ba0d42bfc06cea67c8e8b2d269efc5a Author: Mike Gemünde Date: Thu Jun 17 13:12:33 2010 +0200 Extend test generation tool The test generation tool now handles all namespaces from exiv2 for Canon makernotes. commit 6e214001a1815f4f725b0453b97d1fc7eec1b09e Author: Mike Gemünde Date: Mon Jun 14 10:28:13 2010 +0200 Extend the ParsePhoto example to also show the image size https://bugzilla.gnome.org/show_bug.cgi?id=621508 commit b664ec978484b78805e71a88c6fdf8d589564039 Author: Mike Gemünde Date: Mon Jun 14 10:13:22 2010 +0200 Add support for Canon CR2 raw files This commits adds support to parse Canon CR2 RAW files. Since this format is based on the TIFF structure, reading is mostly based on this code. https://bugzilla.gnome.org/show_bug.cgi?id=621508 commit e43bf7115c00f0f81f086e11b4eef69d9cd47143 Author: Mike Gemünde Date: Mon Jun 14 10:05:03 2010 +0200 Add Property Writeable to Image.File Since we start supporting some file formats just for reading (at least for now) the property Writeable is added to Image.File to indicate if a file can be written back or not. https://bugzilla.gnome.org/show_bug.cgi?id=621508 commit c8832c3dcaa62098e120eb52bb2a8b0394f6b412 Author: Mike Gemünde Date: Mon Jun 14 10:03:24 2010 +0200 Introduce the class BaseTiffFile as base for all Tiff-based file formats The class BaseTiffFile is introduced to factor out some behavior which is common for all Tiff-based file formats. https://bugzilla.gnome.org/show_bug.cgi?id=621508 commit aa090622f9d0221af5014570b4e0bb1ccf98372e Author: Ruben Vermeersch Date: Fri Jun 18 19:01:48 2010 +0200 Add XMP node replacement, which will be used for sidecar support. commit 3dd2d467cbbb6556a26e8673f5161124c8554dbd Author: Ruben Vermeersch Date: Tue Jun 15 00:50:51 2010 +0200 Add stubs for hooking in RAW tests. commit b19bac3b7ed4e3ed258d4da55215b492a90d1b7c Author: Ruben Vermeersch Date: Tue Jun 15 00:36:06 2010 +0200 Only enable "make test" for git builds. commit e849883343b2b7c1f77af696946a6aed40ca4a2a Author: Ruben Vermeersch Date: Tue Jun 15 00:31:19 2010 +0200 Don't ship test suite in tarball. Only built from git. commit 83693068bcf0c98d6b27c2244f6eae41ea8325e4 Author: Ruben Vermeersch Date: Sat Jun 12 16:43:00 2010 +0200 Fix XMP initialization and fixture test. commit 00f130e287724be3dbe806136c6989b610854cb1 Author: Ruben Vermeersch Date: Sat Jun 12 16:18:55 2010 +0200 Add prism namespace. commit d460c17c4edf90b8d08ac2fb4db669c2d59a0c9f Author: Mike Gemünde Date: Thu Jun 3 10:10:56 2010 +0200 Add support for compressed PNG chunks Support for compressed PNG chunks is added by using ICSharpCode.SharpZipLib.dll. Configure and compilation is conditional whether ICSharpCode.SharpZipLib.dll is available or not. https://bugzilla.gnome.org/show_bug.cgi?id=620438 commit 56b2fa9e773bb39f78c34ce623b633ae37378e9e Author: Ruben Vermeersch Date: Sun May 30 22:51:12 2010 +0200 Fix some typos in the comments. commit b2abb6b51f8718fadb9245824c848de6ff054a14 Author: Mike Gemünde Date: Thu May 27 10:27:37 2010 +0200 Add tests for PNG support This commit adds a bunch of tests for the PNG support. The sample files are created with GIMP and modified with exiftool. https://bugzilla.gnome.org/show_bug.cgi?id=619921 commit 94b8bfc406bda2231a0239782bdc0b8a819487e0 Author: Mike Gemünde Date: Thu May 27 10:25:04 2010 +0200 Introduce support for PNG files This commit introduces support for PNG files. A PNG file is parsed completely and XMP metdata and PNG keywords are extracted. Additionally, some image properties such as height and with are determined. https://bugzilla.gnome.org/show_bug.cgi?id=619921 commit d1e8903491c89c7a015c748358084ba61f15c200 Author: Mike Gemünde Date: Tue May 25 21:34:07 2010 +0200 Create class ImageBlockFile for image files organized with data blocks Some image file formats are organized as data blocks which can be reordered. Those block are called 'segments' for Jpeg/Jfif files, or 'blocks' for Gif files. Some of the blocks are metadata and handled by TagLib#. When metadata is saved back to file, the following must be typically done: (1) some of the blocks have to be deleted (2) other blocks are overwritten with the new metadata The new class ImageBlockFile allows to mark some blocks in the file as metadata. When metadata is written back to file, the blocks which can be reused are overwritten, the others are deleted. The File-classes for Jpeg and Gif can now share this functionality. Currently, ImageBlockFile only supports saving one data block (which may contain multiple metadata blocks) and removing all other marked blocks in file. That is fine for the currently implemented file formats, but may be changed in future. https://bugzilla.gnome.org/show_bug.cgi?id=619921 commit 6c5c56ca76d6bc4c976dfbf5a18eab324bcac390 Author: Ruben Vermeersch Date: Sun May 30 17:54:21 2010 +0200 Fix unused variable warning. commit 014eeaaaa25629aae1589f5c346bcda4dccc2375 Author: Mike Gemünde Date: Fri May 28 10:38:44 2010 +0200 Remove CommentTest for jpeg test without metadata It does not make sense to have that test here, because a comment cannot be added, when no tag is present. And it is against the current taglib policy to add tags without a request from the user. https://bugzilla.gnome.org/show_bug.cgi?id=619920 commit 6446fd2116446e67335c0e5c21b2ceda854a7667 Author: Mike Gemünde Date: Thu May 27 16:05:59 2010 +0200 Add Function which ensures that all possible image tags for an image file are in place https://bugzilla.gnome.org/show_bug.cgi?id=619920 commit 20c02ec406477c39edf57d90605c784e6f3e41fc Author: Mike Gemünde Date: Thu May 27 16:06:43 2010 +0200 Add Test to ensure that the ImageTag properties work correctly https://bugzilla.gnome.org/show_bug.cgi?id=619920 commit d11b9bfe861b47e0bbfd3a999376bdeb265cb802 Author: Mike Gemünde Date: Thu May 27 15:46:29 2010 +0200 Add more flexible PropertyModificationValidator The new class PropertyModificationValidator allows to test modifications for every property defined in ImageTag. This makes it more flexible to test them all. https://bugzilla.gnome.org/show_bug.cgi?id=619920 commit a8651759588cc587b20dad4a2cabf1a189925f8d Author: Mike Gemünde Date: Thu May 27 10:07:09 2010 +0200 Add some properties which are usefull for image tags The property Creator is added to ImageTag. The properties Copyright, Comment and Title are implemented in CombinedImageTag to reuse them from Audio/Video. https://bugzilla.gnome.org/show_bug.cgi?id=619920 commit 2f27f26fc3aad9f256942c4ea64e4a00f6a0384c Author: Mike Gemünde Date: Thu May 27 15:11:04 2010 +0200 JpegComment need not to be terminated by 0 Some programs set an jpeg comment which is not terminated by a 0. Therfore, we cannot remove the last character in every case. Rather, check for a terminated string. https://bugzilla.gnome.org/show_bug.cgi?id=619920 commit f3309790ba158f3c0b460c87260b74876dfa2a10 Author: Ruben Vermeersch Date: Sun May 23 15:02:07 2010 +0200 Remove a bit of unreadable code. commit c71ae99fe735b4a07387360a561554a597a0be56 Author: Mike Gemünde Date: Sun May 23 14:23:38 2010 +0200 Add tests for GIF support This commit adds a bunch of tests for the GIF support. The sample files are created with GIMP and modified with exiftool. Some sample files are hand-edited to provide input data for some special tests. https://bugzilla.gnome.org/show_bug.cgi?id=619432 commit da6378ddd68eccc82c478f4da66399d912e413ac Author: Mike Gemünde Date: Sun May 23 14:21:53 2010 +0200 Add Validator to test removal of tags from files A new Validator for the image tests is added which can be used to test if tags are correctly removed from files. https://bugzilla.gnome.org/show_bug.cgi?id=619432 commit 63ccf602c6523d1aa66b9f506b16a7d9f4c4018b Author: Mike Gemünde Date: Sun May 23 14:06:24 2010 +0200 Extend Validators to specify an own comment string for the test The current implementation of CommentModificationValidator and TagCommentModificationValidator uses a fixed comment for testing. This commit extends the Validators that the comment string can be changed and an arbitrary comment can be used for the test. https://bugzilla.gnome.org/show_bug.cgi?id=619432 commit d731abbab07c83242fd63ddb67ebd215f02bb8a5 Author: Mike Gemünde Date: Sun May 23 14:03:07 2010 +0200 Introduce support for GIF files This commit introduces support for GIF files. A GIF file is parsed completely and XMP metadata and GIF comments are extracted. Additionally, the size of the image is extracted. Since GIF files can be used as an animation, it would be reasonable to determine some Properties which are related to Audio/Video files. This is currently not covered. https://bugzilla.gnome.org/show_bug.cgi?id=619432 commit 68722264132abced296ccfa049d90b6549fecddf Author: Mike Gemünde Date: Thu May 20 16:32:54 2010 +0200 Remove uneccessary if condition in CombinedImageTag https://bugzilla.gnome.org/show_bug.cgi?id=619200 commit 9c321e650273c9f890d706a5599d8c813a2b201d Author: Ruben Vermeersch Date: Sun Apr 11 15:17:40 2010 +0200 Make the initialization of XmpTag thread-safe. commit ecb22bf31b518a54f085b86a8f96d8a69c1d5548 Author: Ruben Vermeersch Date: Sat Apr 3 15:21:26 2010 +0200 Fix warning, add docs. commit d63b87f909fdb92e3cdb75d7c31d91f0b73d9269 Author: Ruben Vermeersch Date: Sat Apr 3 15:21:13 2010 +0200 Add missing Dispose () doc block. commit 0ef04eaab535d1baa030fef0042f766fb9ce8b61 Author: Ruben Vermeersch Date: Sat Apr 3 14:30:18 2010 +0200 Ignore monodevelop test results. commit 13a407f2a8e8a4731787cb7068047135bcc4d1ea Author: Ruben Vermeersch Date: Sat Apr 3 14:28:23 2010 +0200 Skip visual comparison on large TIFFs. Running unit tests became too slow on my netbook. Remember that you can run the full set of validators by running: make run COMPARE_LARGE_FILES=1 Should be done before each merge/release. commit 3d176ca43b1dea87b6ba0e3667416909d4059d13 Author: Ruben Vermeersch Date: Sat Apr 3 14:26:12 2010 +0200 Add support for value pairs in unit test generator. Exiv2 has the stupid habit of printing a list of values joined by a comma. This means that a field that looks like this: [ "a, b", "c, d" ] Is printed as: "a, b, c, d" Fortunately we can use the length field to detect this and do the right thing. commit 1ea7a011e2de479320a3948a359ccf276969afe9 Author: Ruben Vermeersch Date: Sat Apr 3 14:24:56 2010 +0200 Fix exception for files without orientation entry. Trying to cast null to an ImageOrientation enum member throws an exception. Fall back to TopLeft to avoid it. Unit test added to test this. commit eeb815ed8e04671a0a429261859d42af030cb61b Author: Ruben Vermeersch Date: Sat Apr 3 14:06:07 2010 +0200 Add aux XMP namespace. commit dbd404b4a025f0c6e11b2df825ab03bd5fe0e805 Author: Ruben Vermeersch Date: Sat Mar 20 19:05:00 2010 +0100 Fix XMP unit test failure. We disagree with exiv2 on the meaning of Struct. In Taglib#, struct is meant to denote parseType=Resource types only, not the shorthand equivalent. Also see XmpNode.RenderInto() commit dd7d2ded96bdf310b8e96f08bcf654aba2b153e5 Author: Mike Gemünde Date: Fri Mar 5 11:39:21 2010 +0100 regenerate basic tiff test with generation tool commit 901cab9d0d27d0428f098d49f7a8bc9775f30bda Author: Mike Gemünde Date: Thu Feb 11 23:17:40 2010 +0100 Add a bunch of new tests for tiff and jpeg commit 0c164d4e844aacb8b449d380b11db0b18f61c641 Author: Mike Gemünde Date: Thu Feb 11 23:14:13 2010 +0100 Extend GenerateTestFixture commit 8640ef4e11e9a2ba107bf98edac9b3394b364408 Author: Mike Gemünde Date: Thu Feb 11 23:13:11 2010 +0100 First implementation of tiff-writing commit fd87a160d8f5238db3d1ee7d4845a2a2f439b8f9 Author: Ruben Vermeersch Date: Tue Feb 9 16:14:13 2010 +0100 Replace fubar namespace commit 92bc4a1b40aeebf23cfdbb5fcec9da216eaface5 Author: Ruben Vermeersch Date: Sat Feb 20 17:17:51 2010 +0100 Monodevelop build fixes. commit 90b7c1527bedf4b738940b7e5ab4da2f1cec62a6 Author: Ruben Vermeersch Date: Sat Feb 20 16:41:51 2010 +0100 Use autotools to build src/ commit 32e16e3a90ef37854ed5896e78f2122f661d9b63 Author: Ruben Vermeersch Date: Sat Feb 20 16:41:28 2010 +0100 Make NamespacePrefixes public. Needed for the unit test generator. commit 40dbaee8956348bb8b7fb491e4a3985c733a521d Author: Ruben Vermeersch Date: Tue Feb 16 19:18:45 2010 +0100 Kill all warnings This now means we can build without any warnings! commit 9230695e84e8f7f414728816ab08439e63579442 Author: Ruben Vermeersch Date: Sat Feb 13 16:55:35 2010 +0100 Fix build in Monodevelop. This was done against a Monodevelop version from trunk, but it should work with any reasonably new version. Unit tests are synchronized with the Makefile, the main assembly uses a special .sources file which does not allow that trick. Might deprecate that one at some point. The tests makefile was modified to allow building in Monodevelop. commit fd429ea366b095cf8d67294e721c2efb85b3e5e2 Author: Ruben Vermeersch Date: Sat Jan 23 18:26:55 2010 +0100 Replace JpegEmptyTest. This new test highlights one of the problems that CombinedImageTag currently has: if there's no metadata tag capable of storing the field, the change will be lost. We should try to accomodate that. commit 8ab09e06b6e810794681e9fc43e40fcf647ce149 Author: Ruben Vermeersch Date: Sat Jan 23 16:55:31 2010 +0100 Remove compile warning. commit e705fd4ecbd723efbb8e5eaf00cd4248118b4581 Author: Ruben Vermeersch Date: Sat Jan 23 16:53:03 2010 +0100 Use String.Empty as the default value for Keywords in CombinedImageTag. commit fc04c52a18fdcba1c58a6bff20696414c77f6acd Author: Ruben Vermeersch Date: Sat Jan 23 16:49:56 2010 +0100 Ignore three failing tests. This doesn't mean that we don't need to fix them, but I got tired of parsing them every time I compile my code. commit 443a43c7fe516d3017396c48fb631b7d3e1282d3 Author: Ruben Vermeersch Date: Sat Jan 23 16:47:02 2010 +0100 Replace Panasonic test by much expanded version. commit 92995954ce437aeccc95e56bd7f0df7bee364bdd Author: Ruben Vermeersch Date: Sat Jan 23 16:36:02 2010 +0100 Add a bunch of Panasonic makernote entry tags. commit cb3300243013283c8f6d5ce06f9c0fefeb4363aa Author: Ruben Vermeersch Date: Sat Jan 23 16:28:47 2010 +0100 Replace the Nikon1 test with a generated one. This one tests all the original assumptions (including properties), but also all the fields that weren't checked. commit 93fda71c1833ac30d95d7ad1471b4b4192eec88c Author: Ruben Vermeersch Date: Sat Jan 23 16:23:34 2010 +0100 Add a ton of Nikon3 IFD entry tags. commit 0cd061e536fc54cdee747a4a7288566eaf16292a Author: Ruben Vermeersch Date: Sat Jan 23 15:58:36 2010 +0100 Add support for generating test fixtures for Panasonic files. commit 33880f7723388699fc8cfd00abc62ca8aa2eedad Author: Ruben Vermeersch Date: Sat Jan 23 15:43:29 2010 +0100 Add conditional for running slow image comparisons. Comparing huge files is slow. Therefor, we don't do that by default. If you want to run the full tests, you'll need to pass the COMPARE_LARGE_IMAGES flag: make test COMPARE_LARGE_IMAGES=1 It's best to do this occasionally for sanity reasons, but you probably don't want to do this every time you compile your code. commit 5e4a20af289c2ed2b5148641331e25174dd3170d Author: Ruben Vermeersch Date: Sat Jan 23 15:42:53 2010 +0100 Make sure GDK is initialized. commit 50ffad60a1362c091a5d632b2bc13677bda5ee70 Author: Ruben Vermeersch Date: Sat Jan 23 14:05:39 2010 +0100 Implement visual validation of image data. This means that not only the metadata is checked pre/post write, but also the image data itself. This is done by reading the image using GdkPixbuf (RAW support still TODO) and then rendering it to a PNG without metadata. This byte dump is then compared for the original and the modified file. This makes the tests a bit slower. I don't care. commit a19e70680880efbafc9853e1624fa7dcb3202779 Author: Ruben Vermeersch Date: Sat Jan 23 14:04:12 2010 +0100 Add missing Nikon3 makernote tag. Tons of them left to do. commit 9a8b89588c1dae7c1a80958feee27d32379faa7f Author: Ruben Vermeersch Date: Sat Jan 23 13:09:39 2010 +0100 Always reuse the same NoModificationValidator in unit tests. commit 828a6c147f6dfb38267b847063d37a36284e1a19 Author: Ruben Vermeersch Date: Sat Jan 23 12:25:57 2010 +0100 Let GenerateTestFixture use Nikon3MakerNoteEntryTag. commit 62f1af61fef25d02e116dda01f7b1b42e0ec3601 Author: Ruben Vermeersch Date: Sat Jan 23 12:25:33 2010 +0100 Fix wrong value for the Preview tag. commit aba2b7b59ca3658b00cf7ea2c25469ea7e63e6b5 Author: Ruben Vermeersch Date: Sat Jan 23 12:20:34 2010 +0100 Add missing IFD tags for ratings. commit 6d39456992c538993ec89cfa030eda8fab55d51f Author: Ruben Vermeersch Date: Sat Jan 23 12:05:30 2010 +0100 Add some comments to Nikon3MakernoteReader. commit e0ca4fe802b209fc7916f1f6e06e02c198461502 Author: Ruben Vermeersch Date: Sat Jan 23 12:00:16 2010 +0100 Add Nikon3MakerNoteEntryTag to remove hex value in Nikon3MakernoteReader. commit 286b1e327ed657b860c2d088c3bcdbb8eb6c7131 Author: Ruben Vermeersch Date: Sat Jan 23 11:49:23 2010 +0100 Split IFD entry types out into separate files. Moved these into a new namespace and updated all files accordingly (unit test generator included). commit 87edb107fe6a373c44ac7102bd77bb2378caafbf Author: Ruben Vermeersch Date: Sat Jan 23 11:30:49 2010 +0100 Clean up the IFD-offset fix a bit and add some docs. commit f7c8f24e435268aa3430af1f60140435fc1595b4 Author: Mike Gemünde Date: Tue Jan 12 22:06:23 2010 +0100 Fix for the Nikon makernote preview image The jpeg file of the nikon2 contains a preview image referenced by the makernote but not stored along with the other makernote data. Additionally, the preview image ifd does not contain a next-ifd pointer. This commits handles that and parses the preview image ifd. commit b95dbadf74d1a7dd8ba605c52cab1dfbff869673 Author: Ruben Vermeersch Date: Tue Dec 29 01:38:28 2009 +0100 Fix XapTest naming. commit 5d535fc8a949b111155b24d432868927ca70382a Author: Ruben Vermeersch Date: Tue Dec 29 01:37:14 2009 +0100 Expand JpegCanonZoombrowserTest with all available values. commit c0f135011487ab5c297fcda9c21a4b4d27afb0ca Author: Ruben Vermeersch Date: Tue Dec 29 01:25:55 2009 +0100 Add a ton of missing IFDEntryTags, handle them. commit 76ef1952856d46aa5c12c7b95542503aab358bb3 Author: Ruben Vermeersch Date: Mon Dec 28 20:42:39 2009 +0100 Split out UserComment code into a separate IFD entry. This allows it to be tested with generated test cases. commit bacff80016206092652bc9c3e4c7ce2041856f78 Author: Ruben Vermeersch Date: Mon Dec 28 19:05:37 2009 +0100 Add custom exiv2 data-extraction programs. This adds two custom c++ programs that allow for much better data extraction. Bad characters in the output of exiv2 caused certain keys to be missed. commit 5c81b09a7566d6c87799308c4984f60b8c874844 Author: Ruben Vermeersch Date: Mon Dec 28 15:26:45 2009 +0100 Fix CanonSi handling as well. Canon MakerNotes get validated correctly now. This means that they are preserved when writing. Awesome. commit 3e2113e0d84470799e0990b974953c1293e5a756 Author: Ruben Vermeersch Date: Mon Dec 28 15:23:11 2009 +0100 Fix handling of CanonCs directories from exiv2. commit ce8e07334dbf7d0e7e9e42089d8fc66f99901f52 Author: Ruben Vermeersch Date: Mon Dec 28 12:53:45 2009 +0100 Trim output for empty strings. Due to exiv2's output not having delimiters, there is no way we can figure out how long an empty string is (some fields in Nikon makernotes are 12 empty spaces or 15 empty spaces). Therefor we trim the parsed value from Taglib# and hope it equals to the empty string. This is one of those cases where generated unit tests will not be 100% correct, yet still decently sufficient. Note that trimming only happens if the expected output is empty. Otherwise, values are compared as-is. commit 1e1238a6f9cc49559ae09c89ad743bea6333838c Author: Ruben Vermeersch Date: Mon Dec 28 11:58:38 2009 +0100 Fix MakerNote handling in unit test generator a bit. This includes: * Correctly identifying the Nikon preview as a SubIFD * Ignoring the exiv2 made-up entries. commit 2977064ce5625bad91e17e64ecda83cd4954df35 Author: Ruben Vermeersch Date: Mon Dec 28 11:57:37 2009 +0100 Add custom IFD reader for Nikon3 MakerNotes. Nikon makernotes have a special sub-ifd for previews. This reader picks up on the relevant tag and makes sure it's parsed. commit 6eac0efb479d1e73f4a37f422c8da5f6c7214bdb Author: Ruben Vermeersch Date: Mon Dec 28 11:02:26 2009 +0100 Verify that simple XMP text nodes don't have children. commit c54627eff721c8c8114188b5e93bb7f62b608b78 Author: Ruben Vermeersch Date: Mon Dec 28 11:01:25 2009 +0100 Replace XapTest with a generated fixture. This version has a much better coverage of the metadata and features half a dozen of modification tests. commit cd087e86d4c62f10ca6375cf1a820ef7c80113ce Author: Ruben Vermeersch Date: Mon Dec 28 09:45:31 2009 +0100 Add empty constructor for files that don't have a comment yet. commit 3171805c57a9078f083c905e0275c6d4d75e687b Author: Ruben Vermeersch Date: Mon Dec 28 09:31:07 2009 +0100 Ensure correct naming of GPSInfo and Thumbnail members. commit ec8ac47259a16e009871fb0b7427d4d14cf0850e Author: Ruben Vermeersch Date: Sat Dec 26 21:17:09 2009 +0100 Fix some exiv2 quirks. commit c49002b6025b69fdf8eea07d038906fabae80f27 Author: Ruben Vermeersch Date: Sat Dec 26 21:02:27 2009 +0100 Also generate XMP fixtures. commit 6ef39781c3389cdf6b8f35ed7de08a598e2131ff Author: Ruben Vermeersch Date: Sat Dec 26 18:52:52 2009 +0100 Add a ton of missing namespaces for XMP rendering. commit 5c2d5d4ecf57dc70a374e2a610716ebc84b3f29a Author: Ruben Vermeersch Date: Sat Dec 26 18:34:48 2009 +0100 Correctly test Byte arrays. commit 608e6912a809f284dbdddc4b50e8ff2680f59fa0 Author: Ruben Vermeersch Date: Sat Dec 26 18:34:25 2009 +0100 Fix Thumbnail test case generation. commit febde3d56b47b7c8804fd8ff1a1bf98dc5840ab5 Author: Ruben Vermeersch Date: Sat Dec 26 17:57:19 2009 +0100 Generate test cases for the GPS IFD. commit b0a8f76e54fddc1b4a4a572e8ca73b7869018662 Author: Ruben Vermeersch Date: Sat Dec 26 14:57:52 2009 +0100 Initial version of unit test generator. This uses data from exiv2 to create a test case. Should be taken with a grain of salt though, I'm suspecting to have found a bug in exiv2 while testing this. commit 668ec86b5f3636524533d53cdab417816795fee7 Author: Ruben Vermeersch Date: Sat Dec 26 14:56:59 2009 +0100 Also test a write with no changes in JpegCanonZoombrowserTest. commit 092ead732bd54504a0e56197dc5784d35f5623d8 Author: Ruben Vermeersch Date: Fri Dec 25 14:28:52 2009 +0100 Validate orientation. commit c437c647898aa38ec2f69bb35d2c9ed1fa7784a9 Author: Ruben Vermeersch Date: Fri Dec 25 14:24:52 2009 +0100 Add a new validator based testing framework. This gives us a much better coverage of write/rewrite testing. commit 0c87736cf6c349136d794e2c697b34d24baffeed Author: Ruben Vermeersch Date: Thu Dec 24 18:26:22 2009 +0100 Register the MicrosoftPhoto namespace and correct it. Some files get written with an invalid namespace (according to the XMP specs, namespaces should end with '/' or '#'). commit 1d7bcaa386e91e387be65338a099006dcc852af2 Author: Ruben Vermeersch Date: Thu Dec 24 18:14:21 2009 +0100 Factor out a common method. commit d437ce4ef8bf7571cdc041328171a197cd0d3f14 Author: Mike Gemünde Date: Mon Dec 7 15:15:18 2009 +0100 Add tests for Rational and SRational commit 0082efab1c5937e2b5ba93da3c2144fbfceca12d Author: Mike Gemünde Date: Mon Dec 7 14:20:26 2009 +0100 add Comments to IFD namespace and remove a bunch of warnings commit d52d71f52fb679babc7a73f4aca94425a00eb0dd Author: Mike Gemünde Date: Sun Dec 6 17:58:05 2009 +0100 fix Jpeg strip tool to substitue greates found data segment commit 1d06c80962c1140be37daa1f1594d9920bdddb26 Author: Mike Gemünde Date: Sun Dec 6 17:20:38 2009 +0100 Fix some documentation warnings commit 272d92e551fbe5996580247bebf387a0e0514886 Author: Mike Gemünde Date: Wed Dec 2 22:12:50 2009 +0100 do not read data in other segments even if it is referenced This is a quick hack to fixes the Sony makernotes, where some data is stored in other segments than in the exif segment, but referenced by an makernote entry. commit 105a95741ce0ce117506208320ac66ecda11a26f Author: Mike Gemünde Date: Wed Dec 2 21:10:47 2009 +0100 complete property tests commit 590907408af1618907266513ccec7edbafe8eb40 Author: Mike Gemünde Date: Wed Dec 2 20:17:29 2009 +0100 add support to read Sony makernotes commit 8f7b44ef7032dde19cf7834dd1964bb4a9a67eab Author: Mike Gemünde Date: Wed Dec 2 15:15:08 2009 +0100 Do not render jpeg segments if they are too big commit 0fb069d15f964df17ed12405097cb45c65d9ee4e Author: Mike Gemünde Date: Wed Dec 2 15:02:23 2009 +0100 add test for the case the metadata segments are too big to fit into a jpeg segment commit 17cfef37d3bdbc368cbfe0e2064be87c4f858aea Author: Mike Gemünde Date: Sun Dec 6 18:13:01 2009 +0100 Cleanup Jpeg related stuff commit 796754e6c5a685382f7c094ae233efd967cbe050 Author: Mike Gemünde Date: Mon Nov 30 21:14:24 2009 +0100 preserve existing JFIF header in jpegs commit 88f372927cb23c852da42f89051468110410731b Author: Mike Gemünde Date: Sun Dec 6 18:12:32 2009 +0100 Add support to write XMP data in jpegs together with some basic tests commit 207592ab98fd6dc5f672b5724921518fc026aef8 Author: Mike Gemünde Date: Sun Nov 29 12:21:55 2009 +0100 complete some copyright notice commit f7702f8b0d3159e4cbbebee039831888d77365ab Author: Mike Gemünde Date: Tue Dec 1 09:14:55 2009 +0100 Use own class for Makernotes to take care about some special things commit 2b8c587afde382f4cb7848777020aad11ab8b987 Author: Mike Gemünde Date: Sun Nov 29 11:04:06 2009 +0100 Add tests for File.Find and File.RFind which fail for current implementation The test cannot succeed for current imlementation of Find and RFind because those methods only consider the greatest partial match and do not take care about smaller ones. commit dd00c6327b28948fdb403b1c61434f7b4af591f6 Author: Mike Gemünde Date: Sun Nov 29 10:50:56 2009 +0100 Fix File.RFind partly and add a test RFind is fixed to do not crash when file size is smaller than the read buffer. A test is added to take care about RFind and Find methods of the class File. However, there is still an issue with matches spread above different buffer reads. commit 5b15309936b714426715c5769ddab92d91753ecb Author: Paul Lange Date: Fri Dec 4 15:32:04 2009 +0100 Update MonoDevelop project files This commit updates the MonoDevelop projects files and makes it possible to build in MonoDevelop. Furthermore it creates a project which includes all tests and runs nunit-console2 after a successful build for them. commit 066624c09e92fb3561d3639d7733a6289de9504e Author: Paul Lange Date: Sun Dec 6 16:16:31 2009 +0100 Fix filename in header commit 33cf614f999eb20a60e44b5c1c1ffe7ce6604639 Author: Paul Lange Date: Sat Dec 5 20:25:11 2009 +0100 Document ImageOrientation items commit ed9e22f2db4372a3bd368aee13feaa563e5790fd Author: Paul Lange Date: Sat Dec 5 14:13:55 2009 +0100 Remove ImageOrientation.Unknown value commit 672933310089a18b594205d4b463b854f6bde053 Author: Paul Lange Date: Sat Dec 5 12:59:31 2009 +0100 Add documentation to ImageOrientation commit 7d2416aa1f394dfc547a5586a35908139260b860 Author: Paul Lange Date: Sat Dec 5 12:56:20 2009 +0100 Convert the Orientation property to an enumeration. commit cb4c85fcb1e247f8b15e25665c963edc1fee31b3 Author: Paul Lange Date: Fri Dec 4 00:16:57 2009 +0100 Documentation fixes commit 063e41e52afbb71d6763f98da64564f47a439e29 Author: Paul Lange Date: Thu Dec 3 23:59:47 2009 +0100 Update test to test latest properties commit 7f56151dfc9e7108accdb3da57aea36f187cd558 Author: Paul Lange Date: Thu Dec 3 23:58:26 2009 +0100 Implement Orientation property commit a8a2f8a8888bd9dc9e90aae1e453f09268617e36 Author: Paul Lange Date: Thu Dec 3 17:44:06 2009 +0100 Add FocalLengthIn35mm Tag commit fd8c2f912e75d8072799f6763397fa7d9b998408 Author: Ruben Vermeersch Date: Mon Nov 30 00:00:27 2009 +0100 Register stDim namespace. Also fix crap spelling in unit test. commit aa967c6431e74d7d1feb0568dadf8ab0b693138b Author: Ruben Vermeersch Date: Sun Nov 29 23:48:51 2009 +0100 Add XMP rendering for most spec samples. Handles most of the spec samples correctly, except for the one I still have to fix. Fixed bugs in the parser along the way. This includes the fact that I'm not keeping track of a new type of node called Struct. This is always rendered into a parseType Resource. commit ad8163f097f9337e60699689a241cc239d7b0849 Author: Ruben Vermeersch Date: Sun Nov 29 21:18:52 2009 +0100 Add some documentation. commit b69b78b64b118fb5752a9d4faed3f3f9761fcb01 Author: Ruben Vermeersch Date: Sun Nov 29 21:18:39 2009 +0100 Fix some malformed XML comments. commit 5cb8ccfe8448ead95872a6b566da4e8afa10e4b9 Author: Ruben Vermeersch Date: Sun Nov 29 21:12:27 2009 +0100 Register the xmpTPg namespace. Makes the rendering of files that use this namespace nicer, it means they will get xmpTPg:element nodes instead of ns1:element nodes. Off-course, all of this doesn't matter when you use a proper namespaced-XML parser (like our code), but I bet there are a ton of stupid implementations out there. commit 49f5de819a962dbcd63026cf75d71577737c8029 Author: Ruben Vermeersch Date: Sun Nov 29 21:09:48 2009 +0100 Initial XMP writing! Breaks a ton of stuff, since only simple values are supported for now. commit 559781fd057913e77cd913b56ed712bf43292582 Author: Ruben Vermeersch Date: Sun Nov 29 17:01:22 2009 +0100 Add comment from last commit message, serves as good explanation. commit fe9396868ad844de9aa00021ebd1964555d0cbbf Author: Ruben Vermeersch Date: Sun Nov 29 16:09:00 2009 +0100 Convert the XMP tests into idempotency tests during XMP rendering. This makes every test do the following: * Parse the string and validate if all expected data is there. * Render back into a string, parse that new string and revalidate. It's important to note that I'm testing for semantical idempotency: data that was in will stay in. The representation might change though. This is okay, nearly all XMP libraries do this. Doing the reparse and revalidate ensures that whatever it generated is valid XMP and contains the same information. commit 423bc7bfbbd5bfb272039a2b0389847b51574e09 Author: Paul Lange Date: Sat Nov 28 20:46:59 2009 +0100 Remove old file commit 1506cb5c70aa01865583efbfe9ffc7c451f1b5af Author: Paul Lange Date: Sat Nov 28 20:42:00 2009 +0100 Add Makernote test to Sony test. commit f4b811a449dd66ed9eae3dde56afcec39b4ab1cd Author: Paul Lange Date: Thu Nov 26 00:56:41 2009 +0100 Create test for Sony Alpha 200. commit a27ea7cbc1795fb637d4daed8bac3df8a326ecfa Author: Stephane Delcroix Date: Wed Nov 25 17:11:47 2009 +0100 Guesstimate the jpeg quality from DQT tables commit 02e4eab345ac9fd33b1230f8a9a2f4be5e0acb23 Author: Stephane Delcroix Date: Wed Nov 25 11:36:37 2009 +0100 Define std tables commit b360005357e9b2b5c38ce45ce604072314be091d Author: Stephane Delcroix Date: Wed Nov 25 16:57:34 2009 +0100 unit test for image width and height commit 3d647645881d5f2d3ef71c4691b31a89fa2a7b12 Author: Stephane Delcroix Date: Wed Nov 25 16:45:39 2009 +0100 Read width and height from SOFn segment Parse SOFn segment, retrieve WxH, use them to set the properties commit c37b12648f7e48bfcd9aa627a171924f07e180ff Author: Stephane Delcroix Date: Wed Nov 25 10:48:10 2009 +0100 replace if/elif/elif by a switch commit 9728f102cd9716b27a834c6e933592d4449e7c5e Author: Stephane Delcroix Date: Wed Nov 25 10:45:06 2009 +0100 only call ReadSegmentMarker once commit 88c3005d9470e5df8c8a17c0b20d97727543ccb1 Author: Stephane Delcroix Date: Wed Nov 25 10:27:09 2009 +0100 complete the Marker table Add missing markers, use the TagLib.Jpeg.Marker type instead of byte in Jpeg.File commit abb724e102fff70baa5841ddb9be02d4bdea374a Author: Ruben Vermeersch Date: Fri Nov 20 23:32:47 2009 +0100 Fix a ton of warnings. commit 055de25226d4f1179e7b95bd5496972f3d343c91 Author: Ruben Vermeersch Date: Fri Nov 20 23:24:36 2009 +0100 Split XmpNodeType into another file. commit e71b79d06b6593d5a98f32e369ea60b74974c2dd Author: Mike Gemünde Date: Sun Nov 15 21:28:56 2009 +0100 ... and remove the SkipDataSegment We only recognize metadata segments occuring before the data segment in the file. This is the same way exiv2 handles it. commit 17d4042cd39490c54e1cc97c33103395b3f52698 Author: Mike Gemünde Date: Sun Nov 15 20:37:38 2009 +0100 Substitute SkipDataSegment() with a much faster implementation commit 1314b55a9bae19f9e582438f1ca7ae45f47adc02 Author: Mike Gemünde Date: Sun Nov 15 21:16:04 2009 +0100 Added test for reading and writing tangled Jpeg files Mostly, the image metadata is stored in Jpegs in the segments at the beginning of the file. Some tests are added for files, where the metadata segments are tangled around the file. Also a bug for writing such files back is fixed. Conflicts: tests/Makefile.am commit a67c36600bf8d9a3bf08e2e3c6b8600c448bbccd Author: Ruben Vermeersch Date: Sun Nov 15 21:03:38 2009 +0100 Disable a stray debug dump. commit 0b21d567869b31bcdb94e83d9ce19521f996ec58 Author: Ruben Vermeersch Date: Sun Nov 15 20:57:12 2009 +0100 Add a lot of XMP spec compliance tests. This uncovered a bug, which is now fixed and a bug that still has to be fixed. commit 014a77ae24536e215d46576c91ce5d0fe5c1dfd5 Author: Ruben Vermeersch Date: Sun Nov 15 18:21:00 2009 +0100 Move the XMP test to another test file. commit 4d7dc8a74e9daa2c698215d5c68fafeb93d21671 Author: Ruben Vermeersch Date: Sun Nov 15 18:20:08 2009 +0100 Drop a useless parameter on XmpTag and use string instead of ByteVector. This will allow me to write unit tests easier. commit bf5747d7bf5ee86979db797eedfd3147e5fc6ce0 Author: Ruben Vermeersch Date: Sat Nov 14 21:03:03 2009 +0100 Minimize sample, using tiggers awesome tool. commit 43658ce3ac52183a8fc26b4604077d9e19565909 Author: Ruben Vermeersch Date: Sat Nov 14 20:54:57 2009 +0100 Implement a missing XMP dialect, additional test. commit 839aa430542a495a89f8bccd3de45c43753c90db Author: Ruben Vermeersch Date: Mon Nov 9 18:46:37 2009 +0100 Ignore XML comments. commit 255d53a969a783beced00a726a3ac05be2060c75 Author: Ruben Vermeersch Date: Mon Nov 9 18:46:10 2009 +0100 Old versions of XMP were called XAP, also look for those tags. Unit test will follow. commit 501464daa156195c2005706aa5e0373915a93438 Author: Mike Gemünde Date: Sat Nov 7 12:15:27 2009 +0100 add very rudimentary support for Olympus makernotes commit f5edd229d8392dffde630d42fb3404729a6f4dc6 Author: Mike Gemünde Date: Sat Nov 7 12:13:43 2009 +0100 add very basic example to substitute the image data in a jpeg file with some (very small) dummy data commit 05f51cc1e883a6ce61573c881613d14e87d77742 Author: Mike Gemünde Date: Sat Nov 7 12:12:43 2009 +0100 add another Nikon jpeg test commit e4d3394d33f1dafccf0eb4cef565a6ba7a3c114d Author: Mike Gemünde Date: Fri Nov 6 00:13:17 2009 +0100 first introduction of reading and writing of nikon makernotes commit eb1f30ce21194fe7c30c661ae72818562d3c5cf9 Author: Mike Gemünde Date: Thu Nov 5 23:43:56 2009 +0100 Add more information to unit tests to easier find an error commit 1ea38571eada751b29fd95a49942f0fb37bfc608 Author: Mike Gemünde Date: Wed Nov 4 23:51:48 2009 +0100 remove comment tags if a null is set for comment commit 87f3bb32953b657a01e98476082458e9ee77afdb Author: Mike Gemünde Date: Wed Nov 4 00:26:28 2009 +0100 reduce warnings by adding some comments to IFDStructure methods commit 7b5b2d47f8a36c1b33ec0422b2f8bf5427f8c38a Author: Mike Gemünde Date: Tue Nov 3 09:15:00 2009 +0100 remove comment property from ImageTag The Comment property is also included as virtual member in Tag. So we do not need to provide another default implementation. commit f85e1e1829b0adc27259e00af5ed0097266ab7d1 Author: Mike Gemünde Date: Tue Nov 3 09:13:10 2009 +0100 implement Comment property for JpegComment commit 79bbf6dbe4d577ff6212cd7b63da4025fec7e23a Author: Mike Gemünde Date: Wed Nov 4 00:29:24 2009 +0100 Rating in ImageTag should also be a Nullable type to allow removing the rating. commit cadcc5e60db30887bc60e25ed5fecb6ffa55a1c2 Author: Mike Gemünde Date: Wed Nov 4 00:09:30 2009 +0100 add support for the Altitude property in IFDTag commit 50313af3a3395e5d21da55eb051c222cda0a83ff Author: Mike Gemünde Date: Tue Nov 3 23:13:24 2009 +0100 change plain values to Nullable in ImageTag For a lot of properties, a scalar value does not make sense, since the default value has also a meaning. To allow to express that a tag is not existant, we use now nullable types. This is the case e.g. for ExposureTime or FocalLength. Conflicts: src/TagLib/IFD/IFDTag.cs commit 4db7440a13a33cd6dff37ad2df6425bd57101513 Author: Mike Gemünde Date: Tue Nov 3 00:47:10 2009 +0100 fix GPS stuff to allow also negative longitude values commit 1b4bd6c144ed2e35a98698547c88b7607ef035b6 Author: Ruben Vermeersch Date: Tue Nov 3 00:26:23 2009 +0100 Kill two more warnings. commit 32629b5f3b9b3755701b6b73a397c7ba889e81c6 Author: Ruben Vermeersch Date: Tue Nov 3 00:24:17 2009 +0100 Kill warnings due to incorrect usage of keywords. commit 8acb7b766891c03bbcd574f2d4f51de6b71804fd Author: Ruben Vermeersch Date: Tue Nov 3 00:02:43 2009 +0100 Fix a crash at XMP parsing due to nonstandard placement of xmlns attributes. commit 749c14e82cb7f72e6ffef81f98fb0ebeef96c508 Author: Ruben Vermeersch Date: Sun Nov 1 20:37:45 2009 +0100 Kill two warnings. commit afa443e0136c3babf51c864b9d88ad8cd2d59dc0 Author: Ruben Vermeersch Date: Sun Nov 1 10:52:29 2009 +0100 Kill more warnings. commit 82cc9ac2d66f77900ada7ede075d6a68993e1d92 Author: Mike Gemünde Date: Sun Nov 1 14:35:48 2009 +0100 add support to read and write GPS inforamtion in exif. commit 521d45753525830ca9656a345cef7139453210a9 Author: Mike Gemünde Date: Sun Nov 1 11:53:47 2009 +0100 use the values directly for an IFD array entry instead commit 920585b928b058332cf59b411aefa63ffafcd114 Author: Mike Gemünde Date: Sun Nov 1 11:44:06 2009 +0100 add support to write makernotes of Canon and Panasonic back to file commit 799b2aa1daa55bc8c8f3a65777bdb40df09966ad Author: Mike Gemünde Date: Sun Nov 1 10:02:57 2009 +0100 move image tests in own namespace The image tests are now contained in an own namespace. This is to not flood the existing one with a bunch of image tests comming in the future. commit 875779f9e5d34e19478d739a454699a62bab8947 Author: Ruben Vermeersch Date: Sun Nov 1 09:57:38 2009 +0100 Cut down on the number of warnings. commit 2e5e7800de5726cc7695737271b2c3f80d723e76 Author: Mike Gemünde Date: Wed Oct 28 21:43:18 2009 +0100 fix warnings on use of obsolete methods in Bytevector commit cbc20f221e139c5cbd0b755bde2bb7a5ea93e887 Author: Mike Gemünde Date: Wed Oct 28 20:07:14 2009 +0100 add ThumbnailIFDEntry to handle thumbnail data correctly commit 3a19b17396873cc253a25fe46b23358b68222135 Author: Mike Gemünde Date: Wed Oct 28 19:10:49 2009 +0100 the id of on IFD entry type is also an unsigned short commit a6f8d00aec73cb73d024c7871d4d4d5445d84838 Author: Mike Gemünde Date: Wed Oct 28 19:07:15 2009 +0100 a tag of an IFD Entry is an unsigned short, so take an usnigned short for representation, too commit 3cb1a37881778072cc74835cdfa8cf1017d0dc7e Author: Mike Gemünde Date: Wed Oct 28 18:59:47 2009 +0100 move some of the renderer code to the IFD Entries itself commit c32734b0f03dcb8f541014df98ab9888ada5646f Author: Mike Gemünde Date: Wed Oct 28 18:26:38 2009 +0100 add Rational and SRational struct for IFD Entries commit ad18345b7f417e4b59a16582c3246b60bb342cea Author: Mike Gemünde Date: Tue Oct 27 23:53:47 2009 +0100 add unit test for Panasonic file (Exif, Makernote) commit bce29cacf6603d39f7847dda4695633dd9130e51 Author: Mike Gemünde Date: Tue Oct 27 23:51:35 2009 +0100 add support for some other Makernotes (Panasonic, Pentax) commit 2724f556a6d8a73249d384cfac65889b27b55325 Author: Mike Gemünde Date: Tue Oct 27 23:47:56 2009 +0100 add support for more entry types commit 557f95441d25bcaee3f14411d28790380422135a Author: Mike Gemünde Date: Tue Oct 27 22:42:18 2009 +0100 take care of restart marker in data segment of jpeg The markers 0xFFD0 ... 0xFFD7 are used as restart marker within the data segment. So we must keep searching for the end of data instead of returning the marker. commit 9f17499d32f2dbdc02f5e2f2d35cd5bed4b0d3e8 Author: Mike Gemünde Date: Mon Oct 26 23:02:44 2009 +0100 add support for reading XMP keywords commit 41c56e19c0eac6b396193ef1370b7be842e2d961 Author: Mike Gemünde Date: Mon Oct 26 21:13:05 2009 +0100 adding GPS support in ImageTag commit 655de1f5442721a192a87fd42da21608880248bd Author: Ruben Vermeersch Date: Sun Oct 25 15:58:24 2009 +0100 Add an example (and test) app for photos. commit fbbff6a6716ffe37a9b04629cbb1da48f3346fbf Author: Ruben Vermeersch Date: Sun Oct 25 15:05:42 2009 +0100 Cut back on the number of warnings. commit 6cf5ab452f9fbc42f734f0e8ec7d76b18789c50f Author: Mike Gemünde Date: Tue Oct 20 23:31:17 2009 +0200 Extend UserComment handling for undefined data We can now handle undefined entries in the UserComment field. Since the program CanonZoomBrowser decides to not fill the 8 byte correctly for an undefined entry, we have to be more liberal for parsing it. commit ece09bcf9cb44b7ef47574d0e105c4695b33e003 Author: Mike Gemünde Date: Tue Oct 20 23:29:02 2009 +0200 Extend Reading of ASCII text fields Keep Adobe practice for reading ASCII field and only read it to the first '\0'. Since more than one value can be stored and some programs fills the fields with '\0's, this seems to be a reasonable choice to keep trouble away. commit 95520e015a2d2659eae04af7e21b1c51bfa47b97 Author: Mike Gemünde Date: Tue Oct 20 21:23:33 2009 +0200 Change also Model to IFD0 instead of ExifIfd commit 6e47449ef9fae5b06a9b4f8c9e74a77b95663d48 Author: Mike Gemünde Date: Tue Oct 20 21:11:03 2009 +0200 ImageDescription is part of IFD0 and not the ExifIFD commit 7e84a12193e17714aa9ea64b910719c46ce7b76a Author: Mike Gemünde Date: Tue Oct 20 20:47:28 2009 +0200 complete IFD entry tag ids The tag ids are fetched from http://www.awaresystems.be/imaging/tiff/tifftags.html. Since the GPS IFD and the Interoperability IFD uses the same tag-id (1), we take this change to split the ids into different enums, according to the IFDs or subIFDs they occur. commit 8662c7a95c1c6fe551912493e1fd974974ecb682 Author: Ruben Vermeersch Date: Sun Oct 18 17:58:51 2009 +0200 Restructure IFD. Able to represent everything now. commit a43b49180ff0803cfc4cae5e6e26235d5d00b3b6 Author: Ruben Vermeersch Date: Sun Oct 18 15:20:42 2009 +0200 Prevent writing empty sub-IFDs. commit 403c87c10f6ff215eeb78d088ea4be4b0437b210 Author: Ruben Vermeersch Date: Sun Oct 18 14:16:39 2009 +0200 Add bits of the convenience API. Imposes ordering: Xmp before Exif before all the rest. commit 8dc9997baefbb92f7ddf68e3d339a053a0e74e79 Author: Ruben Vermeersch Date: Sun Oct 18 12:50:30 2009 +0200 Split IFD reading and rendering code into Readers and Renderers. commit eff47010115a487deaabc6217a38ae963c269764 Author: Ruben Vermeersch Date: Sat Oct 17 17:57:04 2009 +0200 Fix a couple of warnings. commit 21dc3e088e5fb8c0d6de86888aa65389fdc86830 Author: Ruben Vermeersch Date: Sat Oct 17 17:18:26 2009 +0200 Only expose tag types that make sense, move stuff around. commit c387fdb40d86c4de06b47646ef4e31b6f51136c8 Author: Ruben Vermeersch Date: Sat Oct 17 11:45:11 2009 +0200 Add common Image.File base class for image types. And some cleanups. commit db77414ae3974a58cc73e564139382a54bce8674 Author: Mike Gemünde Date: Thu Oct 15 00:28:31 2009 +0200 add support to read write some image properties by the ExifTag class commit 838f7d1d596add212957aa5fb9ff9b06a2156b88 Author: Mike Gemünde Date: Thu Oct 15 00:27:41 2009 +0200 add support to merge image properties in CombinedImageTag commit 4fbf51e36caa72285462f54912b172fe23b81c1d Author: Mike Gemünde Date: Wed Oct 14 19:41:31 2009 +0200 possibility to add new tags (Exif, GPS, IFD) to Jpegs commit a3ff09e1447c05ef8651af6195953b66beeb60e9 Author: Mike Gemünde Date: Wed Oct 14 15:36:29 2009 +0200 introducing Image.ImageTag and Image.CombinedImageTag The both classes are used to provide a unified access to all types of image metadata. commit 5c1c307318c23f0f582204bd9424b542924d7567 Author: Mike Gemünde Date: Wed Oct 14 01:23:31 2009 +0200 support to add JpegComment to Jpeg File commit 4827d042e87d0b7c25c89adc66adaa5105edb633 Author: Mike Gemünde Date: Tue Oct 13 23:42:06 2009 +0200 Add support for reading and writing the GPS Directory commit c995075b4191fe47929e96cdd0f77d64d1ecd3cc Author: Mike Gemünde Date: Tue Oct 13 23:38:18 2009 +0200 remove unused private methods from Tiff.File commit dc6f6196a3304e12f67874f8bdbd5f772eb9b39c Author: Mike Gemünde Date: Tue Oct 13 22:57:54 2009 +0200 fix comment commit a87f24e12453a3bab1e6acf49d6fc5d71cb80ca0 Author: Ruben Vermeersch Date: Sun Oct 11 13:09:24 2009 +0200 2009-10-11 Ruben Vermeersch * src/TagLib/TagLib.sources: * src/TagLib/FileTypes.cs: * src/TagLib/Jpeg/Codec.cs: * src/TagLib/Jpeg/File.cs: * src/TagLib/Jpeg/JpegCommentTag.cs: * src/TagLib/Jpeg/JpegTag.cs: * src/TagLib/Jpeg/Marker.cs: Jpeg support, extracts XMP and exif, initial write support. * tests/Makefile.am: * tests/fixtures/TagLib.Tests.FileFormats/JpegFormatTest.cs: * tests/samples/sample.jpg: Jpeg parsing test cases. Patch written by: Ruben Vermeersch (Initial work) Mike Gemünde (Significant improvements) commit b6bd1379eca52d504bf3e1f67533c5469c4ceedd Author: Ruben Vermeersch Date: Sun Oct 11 13:04:13 2009 +0200 2009-10-11 Mike Gemuende This commit adds EXIF parsing support, by reusing most of IFD. * src/TagLib/Exif/CanonMakerNoteTag.cs: * src/TagLib/Exif/ExifTag.cs: * src/TagLib/Exif/GPSTag.cs: * src/TagLib/Exif/IOPTag.cs: * src/TagLib/Exif/ThumbnailTag.cs: Exif data tags. * src/TagLib/Tag.cs: * src/TagLib/TagLib.sources: * src/TagLib/IFD/IFDTag.cs: Recognize most important special case tags. * tests/Makefile.am: * tests/fixtures/TagLib.Tests.FileFormats/StandardExifTests.cs: * tests/fixtures/TagLib.Tests.FileFormats/TiffFormatTest.cs: Adapt test cases to handle the newly recognized Exif SubIFDEntry. commit 339bae5d5465d2dec2f2832e31352ed11f88e679 Author: Ruben Vermeersch Date: Sun Oct 11 12:59:06 2009 +0200 2009-10-11 Ruben Vermeersch * src/TagLib/TagLib.sources: * src/TagLib/Xmp/XmlNodeExtensions.cs: * src/TagLib/Xmp/XmpNode.cs: * src/TagLib/Xmp/XmpNodeVisitor.cs: * src/TagLib/Xmp/XmpTag.cs: XMP parser, according to the implementation notes in the XMP specification. Uses a NameTable to speed up string comparison. Not fully finished yet, but handles most common XMP formats. * src/TagLib/Tiff/TiffTag.cs: Extract XMP blocks from the relevant IFD entry for TIFF files. * tests/fixtures/TagLib.Tests.FileFormats/TiffFormatTest.cs: Test case for XMP extraction. commit c5b357416f1ad71befabad8272975f0abb6f3b5d Author: Ruben Vermeersch Date: Sun Oct 11 12:43:08 2009 +0200 2009-10-11 Ruben Vermeersch * src/TagLib/FileTypes.cs: * src/TagLib/TagLib.sources: * src/TagLib/Tiff/Codec.cs: * src/TagLib/Tiff/File.cs: * src/TagLib/Tiff/TiffTag.cs: Support for TIFF decoding. * src/TagLib/IFD/Entries/ByteVectorIFDEntry.cs: * src/TagLib/IFD/Entries/LongArrayIFDEntry.cs: * src/TagLib/IFD/Entries/LongIFDEntry.cs: * src/TagLib/IFD/Entries/RationalIFDEntry.cs: * src/TagLib/IFD/Entries/SRationalIFDEntry.cs: * src/TagLib/IFD/Entries/ShortArrayIFDEntry.cs: * src/TagLib/IFD/Entries/ShortIFDEntry.cs: * src/TagLib/IFD/Entries/StringIFDEntry.cs: * src/TagLib/IFD/Entries/SubIFDEntry.cs: * src/TagLib/IFD/Entries/UndefinedIFDEntry.cs: * src/TagLib/IFD/IFDEntry.cs: * src/TagLib/IFD/IFDEntryTag.cs: * src/TagLib/IFD/IFDTag.cs: TIFF IFD support. This is the metadata encoding structure in TIFF, which is also used in other formats such as EXIF and multiple RAW formats. Hence the separate namespace. * tests/Makefile.am: * tests/fixtures/TagLib.Tests.FileFormats/TiffFormatTest.cs: * tests/samples/sample.tiff: Add tests for TIFF reading. Patch written by: Ruben Vermeersch Mike Gemünde commit e2b13c97822f6f63b0aa7d26394b5acf1d7a15ec Author: Ruben Vermeersch Date: Sun Oct 11 11:03:58 2009 +0200 2009-10-11 Ruben Vermeersch * src/TagLib/ByteVector.cs: * tests/fixtures/TagLib.Tests.Collections/ByteVectorTest.cs: Add new FromInt and ToInt methods to ByteVector, which will be used in image metadata processing. Update unit tests with test cases. * src/TagLib/ICodec.cs: Introduce a new Photo content type and IPhotoCodec, which encapsulates photo properties such as it's width and height. * src/TagLib/Image/Codec.cs: Abstract base type for image codecs, as most fields are common for all image types. * src/TagLib/Properties.cs: Extended with support for IPhotoCodec. * src/TagLib/Tag.cs: Add a number of tag types related to image metadata. Patch written by: Ruben Vermeersch Mike Gemünde commit 680892aa0534508d687b2436576f7dbea4f996d5 Author: Gabriel Burt Date: Sat Mar 20 17:06:37 2010 +0000 2010-03-20 Gabriel Burt * README: Add svn info svn path=/trunk/taglib-sharp/; revision=153940 commit 9c0969f779c01dc7c3bc4ec97890898d2f4cc5e8 Author: Gabriel Burt Date: Sat Mar 20 17:02:38 2010 +0000 2010-03-20 Gabriel Burt * README: add some real, useful info svn path=/trunk/taglib-sharp/; revision=153939 commit 160841bfafef60da2d0be6830ea03a5483bebafd Author: Gabriel Burt Date: Sat Mar 20 16:54:05 2010 +0000 2010-03-20 Gabriel Burt * configure.ac: * NEWS: Update for 2.0.3.7 release svn path=/trunk/taglib-sharp/; revision=153938 commit 857c9a84b60c232e334bdd118dbd237c69f2419b Author: Alexander Kojevnikov Date: Sat Mar 20 07:49:42 2010 +0000 2010-03-20 Alexander Kojevnikov * configure.ac: * src/Makefile.am: Patch from Bertrand Lorentz adding a check for the `al` tool (bgo#575303) svn path=/trunk/taglib-sharp/; revision=153935 commit f657f9ff312b28f52f7be93dfff4df67ee84aa7a Author: Alexander Kojevnikov Date: Sat Mar 20 07:34:13 2010 +0000 2010-03-20 Alexander Kojevnikov * configure.ac: Patch from Ruben Vermeersch adding a fall back to nunit-console if nunit-console2 is not found (bgo#593673) svn path=/trunk/taglib-sharp/; revision=153934 commit c815c88583f625ca3ab1e247a696c0a2ac87cb36 Author: Alexander Kojevnikov Date: Sat Mar 20 07:06:30 2010 +0000 2010-03-20 Alexander Kojevnikov * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Id3V2Test.cs: Don't throw an exception if RVA2 data is partially incorrect svn path=/trunk/taglib-sharp/; revision=153933 commit 01cb5415eaa5017a0b24b96fc0cf24f76fe33608 Author: Alexander Kojevnikov Date: Sat Mar 20 04:51:38 2010 +0000 2010-03-20 Alexander Kojevnikov * Makefile.am: * src/Makefile.am: Fix `make distcheck` svn path=/trunk/taglib-sharp/; revision=153931 commit 27db4ba286399349af7596f18217adc3828a315e Author: Alexander Kojevnikov Date: Sat Mar 20 03:10:52 2010 +0000 2010-03-20 Alexander Kojevnikov * src/TagLib/File.cs: Make TagLib.File IDisposable svn path=/trunk/taglib-sharp/; revision=153929 commit 356094ea343dbb85de183c875672b979bd175a9d Author: Alexander Kojevnikov Date: Sat Mar 20 03:04:28 2010 +0000 2010-03-20 Alexander Kojevnikov * src/TagLib/Id3v2/ExtendedHeader.cs: * tests/fixtures/TagLib.Tests.FileFormats/Id3V2FormatTest.cs: * tests/samples/sample_v2_3_ext_header.mp3: Fix ID3v2.3 extended header size calculation (bgo#604488) svn path=/trunk/taglib-sharp/; revision=153928 commit b2fb500435776fe685b3dd7f894232e03403a70c Author: Alexander Kojevnikov Date: Sat Mar 20 02:53:58 2010 +0000 2010-03-20 Alexander Kojevnikov * src: * docs: * tests: * tests/samples: * .gitignore: * examples: Add svn:ignore and .gitignore svn path=/trunk/taglib-sharp/; revision=153927 commit a589453d5e842e7e161d5cbca9721e4e9c3924fe Author: Alexander Kojevnikov Date: Sat Mar 20 02:31:42 2010 +0000 2010-03-20 Alexander Kojevnikov * src/TagLib/Id3v2/Tag.cs: * tests/Makefile.am: * tests/fixtures/TagLib.Tests.FileFormats/Id3V24FormatTest.cs: * tests/samples/sample_v2_4_unsynch.mp3: * tests/tests.csproj: Patch and unit tests from Eamon Nerbonne fixing ID3v2 unsyncing (bgo#593138) svn path=/trunk/taglib-sharp/; revision=153926 commit 9beda4fbb27e255d8eafc496a81fb49dd13fe16f Author: Andrés G. Aragoneses Date: Wed Mar 3 23:59:47 2010 +0000 2010-03-02 Andrés G. Aragoneses * src/TagLib/Aac/AudioHeader.cs: Fix all warnings not related to XML documentation. svn path=/trunk/taglib-sharp/; revision=152975 commit df439f8529b7194b5424358fca9490e791e7a073 Author: Andrés G. Aragoneses Date: Tue Mar 2 11:01:39 2010 +0000 forgot changelog svn path=/trunk/taglib-sharp/; revision=152820 commit f175da0d302b18f2d3296da64e8f7f5ad30ccb1b Author: Andrés G. Aragoneses Date: Tue Mar 2 10:58:48 2010 +0000 * tests/tests.mdp: * taglib-sharp.mds: * taglib-sharp.sln: * tests/tests.csproj: * src/taglib-sharp.mdp: * src/taglib-sharp.csproj: * examples/ReadFromUri.mdp: * examples/SetPictures.mdp: * examples/ReadFromUri.csproj: * examples/SetPictures.csproj: Projects/solution format migration, deleting deprecated MD1.0 format. svn path=/trunk/taglib-sharp/; revision=152819 commit 63ff2db7fc275c88d018cc2cb751053986e7ff96 Author: Gabriel Burt Date: Wed Feb 24 18:57:13 2010 +0000 2010-02-24 Gabriel Burt * configure.ac: * NEWS: Update for 2.0.3.6 release svn path=/trunk/taglib-sharp/; revision=152385 commit 9f8664ec69ee36046be5e8070a0463e3fea403d7 Author: Gabriel Burt Date: Wed Feb 24 18:51:42 2010 +0000 2010-02-24 Gabriel Burt * src/TagLib/Riff/WaveFormatEx.cs: Fix API break in 2.0.3.5. svn path=/trunk/taglib-sharp/; revision=152384 commit 6902a83d09086ac84884ff72dd99f1af9e771bdc Author: Gabriel Burt Date: Tue Feb 23 22:57:51 2010 +0000 2010-02-23 Gabriel Burt * NEWS: Update for 2.0.3.5 release svn path=/trunk/taglib-sharp/; revision=152310 commit aeb2315f921fb7c854966b2f206ff67793ca7bcd Author: Gabriel Burt Date: Sun Feb 21 22:31:23 2010 +0000 2010-02-21 Gabriel Burt * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/ICodec.cs: * src/TagLib/Properties.cs: * src/TagLib/Flac/StreamHeader.cs: * src/TagLib/Ape/StreamHeader.cs: * src/TagLib/Aiff/StreamHeader.cs: * src/TagLib/WavPack/StreamHeader.cs: Patch from Alexander Kojevnikov adding BitsPerSample property to TagLib.Properties (BGO #610585) svn path=/trunk/taglib-sharp/; revision=152153 commit 0cf7cde9011e9f2d5a548f4b88198a9e8ff18c67 Author: Gabriel Burt Date: Thu Feb 4 01:40:03 2010 +0000 2010-02-03 Gabriel Burt * src/TagLib/Ogg/XiphComment.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/XiphTest.cs: Patch and unit tests from Alexander Kojevnikov adding support for COMPILATION to Vorbis/XiphComments (eg for ogg and flac files) (BGO #586336) svn path=/trunk/taglib-sharp/; revision=150805 commit 939ae5abdb8757f438a72050bbac262a56b5f964 Author: Gabriel Burt Date: Tue Feb 2 00:28:56 2010 +0000 2010-02-01 Gabriel Burt * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: * tests/fixtures/TagLib.Tests.FileFormats/Id3BothFormatTest.cs: Patch and unit tests from Helmut Wahrmann (with assistance from Alexander Kojevnikov) fixing bug with removing some/all tag-types from a file (BGO #574653) svn path=/trunk/taglib-sharp/; revision=150687 commit 21458f4451b57d10e373817cbee58101f9501579 Author: Gabriel Burt Date: Wed Jan 27 01:07:50 2010 +0000 2010-01-26 Gabriel Burt * configure.ac: * NEWS: Bump to 2.0.3.5 in prep for next release svn path=/trunk/taglib-sharp/; revision=150265 commit a2a8010c2830c163af693231d7d6893c8ede4409 Author: Gabriel Burt Date: Thu Jan 21 00:30:16 2010 +0000 2010-01-20 Gabriel Burt * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Id3V2Test.cs: Patch from Alexander Kojevnikov fixing IndexOutOfRangeException (BGO #607376) svn path=/trunk/taglib-sharp/; revision=149945 commit 466e24d5340be9653e538168526557f49b0fbd96 Author: Gabriel Burt Date: Thu Jan 7 22:56:22 2010 +0000 2010-01-07 Gabriel Burt * NEWS: * configure.ac: Bump to 2.0.3.4 for upcoming release. svn path=/trunk/taglib-sharp/; revision=149201 commit df89366fb2a7365bf11767e2bf746c5c34e0c1fd Author: Gabriel Burt Date: Thu Jan 7 20:31:48 2010 +0000 2010-01-07 Gabriel Burt * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameHeader.cs: Fix multiple issues with converting release data metadata. Was converting (renaming) TDAT to TDRC, but that's mapping MMDD onto YYYY which doesn't make sense. Now it will map only TYER to TDRC, and then append the TDAT and TIME info to the TDRC if they exist. Fixes BGO #606283 * tests/fixtures/TagLib.Tests.FileFormats/AiffFormatTest.cs: Fix test that depended on the incorrect behavior above. svn path=/trunk/taglib-sharp/; revision=149189 commit 5e0e952df97bc485f5fcf4411b785c6251ae24cc Author: Gabriel Burt Date: Sun Dec 13 22:00:43 2009 +0000 2009-12-13 Gabriel Burt * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/Mpeg4/BoxFactory.cs: Support the 'alis' handler code/track type, found in the wild in an iTunes-ripped .m4a file (BGO #584193) svn path=/trunk/taglib-sharp/; revision=148357 commit 6f160becd6baf821b65f5f6ba6ac71d29b909f83 Author: Aaron Bockover Date: Wed Sep 30 23:53:22 2009 +0000 Fix NEWS uploading svn path=/trunk/taglib-sharp/; revision=143089 commit 28a2feb8ffdd78e687d2200c678b88a3234b9168 Author: Aaron Bockover Date: Wed Sep 30 23:48:14 2009 +0000 2009-09-30 Aaron Bockover * NEWS: Update for 2.0.3.3 release * configure.ac: Bump to 2.0.3.3 svn path=/trunk/taglib-sharp/; revision=143088 commit 713ed6438ba96810cdcdef29d90b1b5e5f6efb95 Author: Gabriel Burt Date: Mon May 18 19:23:36 2009 +0000 2009-05-18 Gabriel Burt * src/TagLib/ByteVector.cs: * tests/fixtures/TagLib.Tests.Collections/ByteVectorTest.cs: Patch from Alexander Kojevnikov fixing ArgumentOutOfRangeException when parsing some comment frames (BGO #582735) svn path=/trunk/taglib-sharp/; revision=134348 commit bf2aaa4c8f68da49fe24088f4b56e9b8be58b987 Author: Gabriel Burt Date: Fri May 15 15:48:50 2009 +0000 2009-05-15 Gabriel Burt * src/TagLib/Riff/File.cs: * src/TagLib/FileTypes.cs: * src/TagLib/Aac/File.cs: * src/TagLib/Aac/AudioHeader.cs: * src/TagLib/Aac/BitStream.cs: * src/TagLib/TagLib.sources: * src/taglib-sharp.mdp: * docs/Package.en.xml.in: * tests/tests.mdp: * tests/fixtures/TagLib.Tests.FileFormats/AacFormatTest.cs: * tests/Makefile.am: * taglib-sharp.csproj: Patch from Patrick Dehne adding support for ADTS AAC files (BGO #580553) svn path=/trunk/taglib-sharp/; revision=134211 commit 13b29dabc38a4258fbb66ca24b0ce20ed71582b3 Author: Gabriel Burt Date: Thu May 14 20:23:56 2009 +0000 2009-05-14 Gabriel Burt * src/TagLib/Aiff/File.cs: * src/TagLib/Aiff/StreamHeader.cs: * src/TagLib/FileTypes.cs: * src/TagLib/TagLib.sources: * src/taglib-sharp.mdp: * docs/Package.en.xml.in: * tests/tests.mdp: * tests/fixtures/TagLib.Tests.FileFormats/AiffFormatTest.cs: * tests/Makefile.am: * taglib-sharp.csproj: Patch from Helmut Wahrmann adding support for the AIFF file format (BGO #579261) svn path=/trunk/taglib-sharp/; revision=134161 commit 2207974d1385133c910e2d352bcbd9f858ebbdf4 Author: Gabriel Burt Date: Mon Apr 20 19:10:43 2009 +0000 Correct a couple 2008s that should be 2009 svn path=/trunk/taglib-sharp/; revision=132204 commit b5d885b5ef0458fd0d2ea707ec3bbd38a60a4829 Author: Gabriel Burt Date: Wed Mar 25 23:15:23 2009 +0000 2009-03-25 Gabriel Burt * src/TagLib/Ogg/XiphComment.cs: Patch from Helmut Wahrmann adding two fallback options for the album artist getter (BGO #574652) svn path=/trunk/taglib-sharp/; revision=130253 commit 6f22bf46936fa62d8dc4f9ea01fff8de5921e486 Author: Gabriel Burt Date: Fri Mar 20 04:54:24 2009 +0000 2009-03-19 Gabriel Burt * src/TagLib/Ape/Tag.cs: Patch from Gregory S. Chudov fixing bug with Ape.Tag's Pictures setter (BGO #575943) svn path=/trunk/taglib-sharp/; revision=129858 commit f70f7b27b2e9bf923a8f907aa1dec61599121168 Author: Gabriel Burt Date: Thu Mar 19 03:21:23 2009 +0000 2009-03-18 Gabriel Burt * tests/Makefile.am: * examples/Makefile.am: Patch from Bertrand Lorentz fixing issue with random files slipping into the tarball/dist (BGO #575302). make distcheck and running ./configure && make && make test work on the tarball svn path=/trunk/taglib-sharp/; revision=129762 commit 446b14bd5997c51d0a6edd31988058837a1fc283 Author: Gabriel Burt Date: Tue Mar 10 19:41:12 2009 +0000 2009-03-10 Gabriel Burt * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/AudioFile.cs: Patch from Andy Beal adding support for m2v and m2v files (BGO #574411) svn path=/trunk/taglib-sharp/; revision=129008 commit f9ccf65c85d4dc1f1b1924a52e8b59cb902480e7 Author: Gabriel Burt Date: Tue Mar 10 05:01:00 2009 +0000 2009-03-09 Gabriel Burt * src/TagLib/Ape/Tag.cs: Patch from Bernd Niedergesaess adding support for Sort* values in Ape tags (BGO #571421) svn path=/trunk/taglib-sharp/; revision=128940 commit 877b873e2aa8e999a1ffd451f55c78b677c3b5ed Author: Gabriel Burt Date: Tue Mar 10 04:53:30 2009 +0000 2009-03-09 Gabriel Burt * src/TagLib/Ogg/GroupedComment.cs: Patch from Bernd Niedergesaess and Andy Beal improving code consistency (BGO #571443) svn path=/trunk/taglib-sharp/; revision=128939 commit 96e698124f34e42b85d1c0618af1900ad156843e Author: Gabriel Burt Date: Tue Mar 10 04:47:07 2009 +0000 2009-03-09 Gabriel Burt * src/TagLib/Riff/AviHeaderList.cs: Patch from Bernd Niedergesaess to not use obsolete ctor (BGO #571452) svn path=/trunk/taglib-sharp/; revision=128938 commit 74e848482a4adb6ea951d3ca60429295ddf33c4a Author: Gabriel Burt Date: Tue Mar 10 04:37:09 2009 +0000 2009-03-09 Gabriel Burt * docs/Makefile.am: Reduce the verbosity of docs build output. svn path=/trunk/taglib-sharp/; revision=128937 commit a5c66dedc41e14ea667da68804391f574cbb2a5a Author: Gabriel Burt Date: Tue Mar 10 04:25:40 2009 +0000 2009-03-09 Gabriel Burt Patch from Andy Beal adding new properties: MusicBrainz -ArtistId, -ReleaseId, -ReleaseArtistId, -TrackId, -DiscId, -ReleaseStatus, -ReleaseType, -ReleaseCountry, MusicIpId, and AmazonId (BGO #563170) * src/TagLib/CombinedTag.cs: * src/TagLib/Tag.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/GroupedComment.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Mpeg4Test.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/ApeTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Id3V2Test.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/XiphTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/AsfTest.cs: Add and test the new properties. svn path=/trunk/taglib-sharp/; revision=128936 commit 2822fea172a0ce858bfb96bbb4a1520f7e6c399a Author: Gabriel Burt Date: Wed Mar 4 16:25:48 2009 +0000 2009-03-04 Gabriel Burt * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Patch from John Millikin to be more robust in the face of tags with NULL bytes in the middle of them by truncating the value before the first one (BGO #558123) * tests/samples/corrupt/null_title_v2.mp3: * tests/fixtures/TagLib.Tests.FileFormats/Id3V2FormatTest.cs: New corrupt file with NULL bytes in the title field, and a test that we handle it ok. svn path=/trunk/taglib-sharp/; revision=128567 commit adfc5f7ee25c53f6a95d0849441957cb1f0a55f0 Author: Gabriel Burt Date: Fri Feb 20 02:37:59 2009 +0000 2009-02-19 Gabriel Burt * src/TagLib/Flac/File.cs: Patch from Gregory S. Chudov fixing NRE thrown when calling GetTag on a flac File (BGO #572380) * tests/fixtures/TagLib.Tests.FileFormats/FlacFormatTest.cs: Add a unit test written by me that fails without Gregory's patch, passes with it. svn path=/trunk/taglib-sharp/; revision=127496 commit 447239a8964b6637cf570635fff2071098f20430 Author: Gabriel Burt Date: Fri Feb 20 02:29:07 2009 +0000 2009-02-19 Gabriel Burt * src/TagLib/Ogg/XiphComment.cs: Patch from Gregory S. Chudov fixing typo in the Ogg DiscNumber setter that wrote the TrackCount to the DISCTOTAL field (BGO #572381) svn path=/trunk/taglib-sharp/; revision=127492 commit 179f20ff6731f59250b71bc95c4c58fe52fb1818 Author: Gabriel Burt Date: Fri Feb 20 02:25:49 2009 +0000 2009-02-19 Gabriel Burt * src/TagLib/Tag.cs: Patch from Gregory S. Chudov fixing bug in the CopyTo method that copied the Copyright into the Conductor tag (BGO #572382) svn path=/trunk/taglib-sharp/; revision=127491 commit d7431fc9c8b22cac2f65317c7df44329ab5a912f Author: Gabriel Burt Date: Fri Feb 20 02:21:55 2009 +0000 2009-02-19 Gabriel Burt * src/TagLib/File.cs: Patch from Félix Velasco fixing a bug in our XML documentation (BGO #572253) svn path=/trunk/taglib-sharp/; revision=127490 commit 9c76cd75a24589edcf63249d65b5b670412c3182 Author: Gabriel Burt Date: Fri Feb 20 02:18:11 2009 +0000 2009-02-19 Gabriel Burt * configure.ac: Patch from Bertrand Lorentz using $(prefix)/lib in GACUTIL_FLAGS instead of $(libdir) (BGO #572259) svn path=/trunk/taglib-sharp/; revision=127489 commit 1dacd700bfe4aef4f7acbc440b59099579bac308 Author: Gabriel Burt Date: Thu Feb 19 19:00:12 2009 +0000 2009-02-19 Gabriel Burt * docs/Makefile.am: Patch from Bertrand Lorentz fixing hardcoded mcs reference (BGO #572450) svn path=/trunk/taglib-sharp/; revision=127441 commit a17a7339518964ff719d38eb59a98b2f9c941b93 Author: Gabriel Burt Date: Mon Feb 16 23:07:25 2009 +0000 2009-02-16 Gabriel Burt * NEWS: Update for 2.0.3.2 release svn path=/trunk/taglib-sharp/; revision=127078 commit bfc0685985ad6ea2c6c84d7d83181a68cee206ed Author: Gabriel Burt Date: Mon Feb 16 22:39:12 2009 +0000 Forgot to credit Bernd in last commit svn path=/trunk/taglib-sharp/; revision=127077 commit c680ca61d0fb2056885d3c9fd3896fd8a968d119 Author: Gabriel Burt Date: Mon Feb 16 21:48:27 2009 +0000 2009-02-16 Gabriel Burt * src/TagLib/Ape/Tag.cs: Patch from Andy Beal fixing our APE tag writing from writing out all uppercase tags to writing the recommended tag casing. But we support reading in any casing. Also, use BPM instead of TEMPO, and use Album Artist instead of AlbumArtist, but read/write the latter for compabibility (BGO #571563) svn path=/trunk/taglib-sharp/; revision=127070 commit 96664cc7e3eea268fb6ec5e9ca50842323a672c4 Author: Gabriel Burt Date: Mon Feb 16 21:24:58 2009 +0000 2009-02-16 Gabriel Burt * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Ape/Tag.cs: * docs/Package.en.xml.in: * docs/Makefile.am: Patch from Bertrand Lorentz fixing build issue with docs (BGO #571368) svn path=/trunk/taglib-sharp/; revision=127066 commit 29a97a8d909075306da240d9c96b8420afbe0ce6 Author: Gabriel Burt Date: Thu Feb 12 19:01:51 2009 +0000 2009-02-12 Gabriel Burt * src/TagLib/Mpeg/AudioFile.cs: Patch from Bernd Niedergesaess with style help from Andy Beal, adding mp1/mp2 extensions/mimetypes (BGO #571466) svn path=/trunk/taglib-sharp/; revision=126743 commit 17b4c1e010f3c02b140d7c95dfbf0e7fb3166df1 Author: Gabriel Burt Date: Thu Feb 12 18:46:03 2009 +0000 2009-02-12 Gabriel Burt * src/TagLib/Mpeg4/AppleTag.cs: Patch from Bernd Niedergesaess fixing mpeg4 writing of BPM to file (BGO #571411) svn path=/trunk/taglib-sharp/; revision=126741 commit 12b894385f4194df2f865c20d2b4483ddcaac698 Author: Gabriel Burt Date: Thu Feb 12 00:54:19 2009 +0000 2009-02-11 Gabriel Burt Patches from Bertrand Lorentz. * tests/Makefile.am: fixes the typo that caused the test source files not to be included in the tarball (BGO #569299) * configure.ac: remove the call to AC_CANONICAL_SYSTEM (BGO #571361) svn path=/trunk/taglib-sharp/; revision=126670 commit fc1d68289f28ca1a02f884922eaa714c6e9f9bd2 Author: Gabriel Burt Date: Wed Feb 11 03:53:05 2009 +0000 2009-02-10 Gabriel Burt * src/TagLib/Mpeg/File.cs: Patch from Andy Beal fixing issue where offset was not being advanced when trying to read a GOP video packet inside a video sequence (BGO #568964) svn path=/trunk/taglib-sharp/; revision=126547 commit 2af0d2725ea1d5269b46810e2d2d712944fcf8e9 Author: Gabriel Burt Date: Wed Feb 11 02:54:37 2009 +0000 2009-02-10 Gabriel Burt * configure.ac: Bump in prep for the next release. * examples/ReadFromUri.cs: Refactor a bit, and print out the *Sort properties. svn path=/trunk/taglib-sharp/; revision=126546 commit 6a1db30cd8ca012c76e7575e9adf2e44d505e1b9 Author: Gabriel Burt Date: Tue Feb 10 17:09:56 2009 +0000 2009-02-10 Gabriel Burt * src/TagLib/Riff/File.cs: Patch from Andy Beal fixing bug where within a while clause we would 'continue', but the actual counter incrementing happened later in the while clause so the while condition was always true, causing a freezing while writing video files (BGO #570892) svn path=/trunk/taglib-sharp/; revision=126477 commit 11ed49d59e0f37bf1567f1dec514cd5df1fcf031 Author: Gabriel Burt Date: Tue Feb 10 17:07:03 2009 +0000 2009-02-10 Gabriel Burt * tests/Makefile.am: * tests/samples/sample.avi: * tests/fixtures/TagLib.Tests.FileFormats/AviFormatTest.cs: Patch from Andy Beal adding unit testing for AVI files; currently gets stuck in infinite loop because of bug with writing to AVI files. svn path=/trunk/taglib-sharp/; revision=126476 commit 98289c9e8c02faa9ef194108c4908fd0c7ae1931 Author: Gabriel Burt Date: Fri Feb 6 18:02:38 2009 +0000 2009-02-06 Gabriel Burt * src/TagLib/Properties.cs: Patch from Andy Beal fixing VideoWidth getter, was incorrectly returning height (BGO #570745) svn path=/trunk/taglib-sharp/; revision=126082 commit dfa9ddd46fdcd6e486f9493e6569cfe8b9190196 Author: Gabriel Burt Date: Fri Feb 6 17:54:30 2009 +0000 2009-02-06 Gabriel Burt * src/TagLib/Id3v2/Frame.cs: Patch from Andy Beal, fixing bug with not skipping over Data Length Indicator field properly (BGO #568946) svn path=/trunk/taglib-sharp/; revision=126081 commit ff43233d912b071852b1698754889f70a3087f29 Author: Aaron Bockover Date: Fri Jan 23 20:27:11 2009 +0000 2009-01-23 Aaron Bockover * Makefile.am: Install .pc file to datadir since we're noarch svn path=/trunk/taglib-sharp/; revision=124369 commit ddd55a94f0b8e66896e172d344386ba1da5e943a Author: Gabriel Burt Date: Fri Jan 23 00:17:54 2009 +0000 2009-01-22 Gabriel Burt * src/TagLib/CombinedTag.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameTypes.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/Tag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/GroupedComment.cs: Patch from John Millikin and Andy Beal adding support for PerformerSort, AlbumArtistSort, ComposerSort, TitleSort, and AlbumSort to TagLib.Tag, with backends for Ogg, ID3, mpeg4, and asf (BGO #567657). svn path=/trunk/taglib-sharp/; revision=124277 commit c47ade767d2b3d2a8f372b5c8974c727fad337da Author: Aaron Bockover Date: Tue Jan 20 22:32:25 2009 +0000 Fix tag name svn path=/trunk/taglib-sharp/; revision=123953 commit 0961c724b29468a9f5107b02286d3b614545442e Author: Aaron Bockover Date: Tue Jan 20 22:29:28 2009 +0000 Missing \ svn path=/trunk/taglib-sharp/; revision=123952 commit 8db9530ed1873d0246acb84f561176dcca8f9ee1 Author: Aaron Bockover Date: Tue Jan 20 22:27:07 2009 +0000 2009-01-20 Aaron Bockover * configure.ac: Bumped version to 2.0.3.1, output bz2 and gz * Makefile.am: Added a push-release target * NEWS: Updated for 2.0.3.1 release svn path=/trunk/taglib-sharp/; revision=123950 commit ff9b5afa5a3ef8b9a79edde5343faffa482d7f7c Author: Gabriel Burt Date: Tue Jan 20 21:23:25 2009 +0000 Update for release svn path=/trunk/taglib-sharp/; revision=123928 commit 7a518bd93334ec93a5414e4e0d0c14642cf76702 Author: Aaron Bockover Date: Tue Jan 20 21:21:21 2009 +0000 SUBDIRS tests svn path=/trunk/taglib-sharp/; revision=123926 commit 9288a468d586e88533ebd380ba0eabe71e90a254 Author: Aaron Bockover Date: Tue Jan 20 21:21:11 2009 +0000 Fix use of obsolete API svn path=/trunk/taglib-sharp/; revision=123925 commit f46fbd1bf53a1d2eeee5f6fb3604d93907c542e2 Author: Aaron Bockover Date: Tue Jan 20 21:18:20 2009 +0000 2009-01-20 Aaron Bockover * configure.ac: Bumped version to 2.0.3.1 * NEWS: Updated for 2.0.3.1 release svn path=/trunk/taglib-sharp/; revision=123923 commit e09402baf120df02b4aadbfff46d600f6699d640 Author: Gabriel Burt Date: Fri Jan 16 02:12:17 2009 +0000 2009-01-15 Gabriel Burt * tests/fixtures/TagLib.Tests.TaggingFormats/XiphTest.cs: Update unit test to reflect that we do now support writing cover art to ogg files. svn path=/trunk/taglib-sharp/; revision=123568 commit ac160cc7839f31263fe8500fd693ff19b881dabb Author: Gabriel Burt Date: Fri Jan 16 02:08:16 2009 +0000 2009-01-15 Gabriel Burt * src/TagLib/Ogg/XiphComment.cs: Patch from John Millikin adding cover art reading and writing support to Ogg (BGO #563168) svn path=/trunk/taglib-sharp/; revision=123567 commit 48f6a94a29ae04e6adc5a514c208b890106bfbd2 Author: Gabriel Burt Date: Thu Jan 15 19:06:00 2009 +0000 2009-01-15 Gabriel Burt * src/TagLib/Ape/File.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Ogg/File.cs: Add more mimetypes and file extensions including .oga and .ogv (BGO #532561) * examples/ReadFromUri.cs: Avoid NRE crash svn path=/trunk/taglib-sharp/; revision=123522 commit 21daae26e341c14c833a433f5c88533dac04f495 Author: Gabriel Burt Date: Thu Jan 15 19:01:15 2009 +0000 2008-01-15 Gabriel Burt * src/TagLib/Mpeg4/file.cs: Patch from Andy Beal to recognize .m4b files (Audiobook extention) in mpeg4 (BGO #567826) svn path=/trunk/taglib-sharp/; revision=123520 commit 721fb8fc79715c34f7a06ced460ef7e1891888d1 Author: Gabriel Burt Date: Tue Jan 13 18:26:16 2009 +0000 2008-01-13 Gabriel Burt Patch from Andy Beal adding support for Dash atoms, used primarily for storing extra text tags, such as the MusicBrainz tags. The equivalent in ID3 are the UserTextInfo frames. * src/TagLib/Mpeg4/Boxes/AppleAdditionalInfoBox.cs: Add Constructor to enable Instantiating a new AdditionalInfoBox without reading from file. * src/TagLib/Mpeg4/AppleTag.cs: Add Methods for reading and writing values to/from Dash Boxes (----) svn path=/trunk/taglib-sharp/; revision=123227 commit b6ff6f306fcedb04acf01c18eb3689f50fb1bad1 Author: Gabriel Burt Date: Fri Dec 19 21:24:40 2008 +0000 Whoops, didn't mean to revert this, got confused about what was the new patch and what was there before svn path=/trunk/taglib-sharp/; revision=121890 commit f1b527ed4a8da14eb73e1965a37cdb9ca9e8dfd5 Author: Gabriel Burt Date: Tue Dec 16 01:41:48 2008 +0000 2008-12-15 Gabriel Burt * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: Add an alreadyUnsynched argument to CreateFrame that is true when the overall id3v2 Tag has the Unsync flag set, and used to ensure we don't double-synchronize the data for a frame. * src/TagLib/Id3v2/FrameHeader.cs: Fix typo * src/TagLib/Id3v2/Frame.cs: Fix typo, use the new CreateFrame * src/TagLib/File.cs: Remove unnecessary (and buggy) position/length adjustments in ReadBlock method. * src/TagLib/NonContainer/StartTag.cs: Fix typos, ensure that ReadTag returns the valid start value even if there is an exception creating it, and write any tag-creation exceptions to Console.Error. svn path=/trunk/taglib-sharp/; revision=121568 commit d043e77cd667c924d51fe5fc252d798e30d50ca5 Author: Gabriel Burt Date: Thu Dec 11 23:45:44 2008 +0000 2008-12-11 Gabriel Burt * tests/ConsoleUi.cs: * tests/Makefile.am: * configure.ac: Remove ConsoleUi in favor of system-installed nunit-console2. Make the tests depend on the taglib-sharp.dll, and rename the target 'test'. * Makefile.am: Add 'test' target that calls make test in tests/ svn path=/trunk/taglib-sharp/; revision=121368 commit 96541ba2588aef666d6c9a8b09def2252e5a1161 Author: Gabriel Burt Date: Thu Dec 11 23:43:56 2008 +0000 Actually commit Jeff's patch, already mentioned in the ChangeLog svn path=/trunk/taglib-sharp/; revision=121365 commit 6da96266229c1ed419d77a23d9ddc0e446a6958b Author: Gabriel Burt Date: Thu Dec 11 23:24:42 2008 +0000 2008-12-11 Gabriel Burt * src/AssemblyInfo.cs.in: remove the if #SIGN - always sign * tests/Makefile.am: Fix up source files list. * tests/tests.mdp: enable Makefile integration * configure.ac: Uncomment the nunit check and generate tests/Makefile svn path=/trunk/taglib-sharp/; revision=121363 commit ca2086339d75e17841227ae5045bd093630081bb Author: Rusty Howell Date: Thu Jul 17 01:42:11 2008 +0000 Fixed syntax error in xml doc strings svn path=/trunk/taglib-sharp/; revision=108108 commit dada5252ec43f0824226bb906a6a55c83d22cfd2 Author: Jeffrey Stedfast Date: Tue Jan 29 22:08:55 2008 +0000 2008-01-16 Jeffrey Stedfast * src/TagLib/Mpeg/AudioHeader.cs (AudioHeader): Do a bit more thorough bitwise examination of the second byte in the MPEG sync header. svn path=/trunk/taglib-sharp/; revision=94328 commit 492f1e407d1d1b6769edfabf5a20db118dff2d89 Author: Brian Nickel Date: Thu Jan 10 23:28:46 2008 +0000 2008-01-10 Brian Nickel * NEWS: Updated for new release. * configure.ac: Now 2.0.3.0 svn path=/trunk/taglib-sharp/; revision=92635 commit 0f23f4b07d569b4a447d95b29a9a693d93f96fe4 Author: Brian Nickel Date: Thu Jan 10 01:30:11 2008 +0000 2008-01-09 Brian Nickel This commit does the following: - Finishes XML documentation. - Makes ASF tags enumerable. - Allows saving RelativeVolumeFrames in 2.2 and 2.3 via semi-standard XRV and XRVA names. - Prevents duplicates when genres are stored in "(0)Blues" format. * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Footer.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/Header.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/UnknownFrame.cs: * src/TagLib/Id3v2/Frame.cs: * src/TagLib/ListBase.cs: * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/Codecs/Vorbis.cs: * src/TagLib/Ogg/Codec.cs: * src/TagLib/Ogg/Bitstream.cs: Finish documentation. * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: * src/TagLib/Asf/MetadataLibraryObject.cs: Make enumerable. * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: If genre index is followed by genre text, don't store it twice. * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/FrameHeader.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Id3V2Test.cs: Save RVA2 as XRVA and XRV in older versions. * configure.ac: Now 2.0.2.22. svn path=/trunk/taglib-sharp/; revision=92562 commit e38d5652387c1225ccdd709c982f5cb43b19a3b2 Author: Brian Nickel Date: Thu Jan 3 07:59:47 2008 +0000 2008-01-03 Brian Nickel * src/Makefile.am: Generate taglib-sharp.dll.xml instead. * docs/Package.en.xml.in: Contains missing documentation and rules for XmlInjector.exe. * docs/XmlInjector.cs: A new XML manager which can remove, replace, and insert nodes into an XML document based on XPath queries. * docs/Makefile.am: Build XML from the slashdoc and use XmlInjector.exe to insert missing parts into documentation as well as modify monodoc.xml * docs/Package.en.xml: Depreciated by docs/Package.en.xml.in. * docs/MonodocNodeConfig.cs: Depreciated by docs/XmlInjector.cs. * configure.ac: Generate docs/Package.en.xml from docs/Package.en.xml.in svn path=/trunk/taglib-sharp/; revision=92157 commit 44578d8d281dbe301464180fcb272d0a703463df Author: Brian Nickel Date: Thu Jan 3 02:43:28 2008 +0000 2008-01-02 Brian Nickel * src/Makefile.am: Generate taglib-sharp-docs.xml when building docs. * docs/en/: Deleted. Will be replaced with autogeneration after this update. * docs/Makefile.am: Add docs/Packages.en.xml do DIST_EXTRA * docs/Package.en.xml: Contains values not in slashdocs. svn path=/trunk/taglib-sharp/; revision=92148 commit 5932a1adfb5a243de2d0f70f3ae4fa4cc8d9e583 Author: Brian Nickel Date: Thu Jan 3 01:05:18 2008 +0000 2008-01-02 Brian Nickel * src/TagLib/CombinedTag.cs: * src/TagLib/ByteVectorList.cs: * src/TagLib/Id3v1/Tag.cs: * src/TagLib/Id3v1/StringHandler.cs: * src/TagLib/Riff/List.cs: * src/TagLib/Riff/File.cs: * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/AviHeaderList.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/Genres.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/ExtendedHeader.cs: * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/VideoHeader.cs: * src/TagLib/Mpeg/AudioFile.cs: * src/TagLib/Mpeg/AudioHeader.cs: * src/TagLib/ByteVector.cs: * src/TagLib/SupportedMimeType.cs: * src/TagLib/Flac/Picture.cs: * src/TagLib/Flac/File.cs: * src/TagLib/Flac/StreamHeader.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Footer.cs: * src/TagLib/Ape/File.cs: * src/TagLib/ListBase.cs: * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMetaBox.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxHeader.cs: * src/TagLib/Mpeg4/Box.cs: * src/TagLib/Picture.cs: * src/TagLib/Tag.cs: * src/TagLib/Mpc/File.cs: * src/TagLib/Mpc/StreamHeader.cs: * src/TagLib/File.cs: * src/TagLib/WavPack/File.cs: * src/TagLib/WavPack/StreamHeader.cs: * src/TagLib/NonContainer/Tag.cs: * src/TagLib/NonContainer/File.cs: * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/HeaderExtensionObject.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/FilePropertiesObject.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: * src/TagLib/Asf/UnknownObject.cs: * src/TagLib/Asf/MetadataLibraryObject.cs: * src/TagLib/Asf/PaddingObject.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Asf/Object.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/Page.cs: * src/TagLib/Ogg/File.cs: * src/TagLib/Ogg/Paginator.cs: * src/TagLib/Ogg/PageHeader.cs: * src/TagLib/Ogg/GroupedComment.cs: More docs, corrected some typos. svn path=/trunk/taglib-sharp/; revision=92141 commit 6893f5fca42ac8df165a4d7147f6b7ebf62fed8c Author: Brian Nickel Date: Wed Jan 2 03:30:34 2008 +0000 2008-01-01 Brian Nickel I'm working to finish up the xmldocs so I can get rid of the aging docs directory. * src/TagLib/Riff/List.cs: * src/TagLib/Riff/AviStream.cs: * src/TagLib/Riff/File.cs: * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/AviHeaderList.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/PopularimeterFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: * src/TagLib/Id3v2/ExtendedHeader.cs: * src/TagLib/Id3v2/Frame.cs: * src/TagLib/ByteVector.cs: * src/TagLib/Flac/BlockHeader.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Item.cs: * src/TagLib/Picture.cs: * src/TagLib/Ogg/XiphComment.cs: A little documentation and reformatting. * examples/BatchSet.cs: Add support for setting the ID3v2 version. svn path=/trunk/taglib-sharp/; revision=92094 commit 7fc0f6bd46e6e34224c57a4842ca3e155e8dd4c8 Author: Brian Nickel Date: Sun Dec 30 09:50:36 2007 +0000 2007-12-30 Brian Nickel This commit does the following: - Makes Id3v2 skip iTunes settings-style comments. - Makes ; the separator for multivalue fields in Mpeg4, rather than storing in multiple boxes. - Cleans up Mpeg4 genre logic. - Uses System.Globalization to choose the default language in Id3v2. - Moves the comment written when Id3v2.Tag.Comment to be the first COMM in the frame so it is the first one recognized by other programs. * src/TagLib/Id3v2/Tag.cs: Move the written comment to be the first COMM frame if it isn't. Make " " the fallback comment per instructions on id3.org. Get the default language from CultureInfo.CurrentCulture .ThreeLetterISOLanguageName. * src/TagLib/Id3v2/Frames/CommentsFrame.cs: Skip iTunes comments if they are set. There's no need for gibberish to show up as the comment. * src/TagLib/Mpeg4/AppleTag.cs: Instead of adding multiple data boxes for multi-string values, use `;' as a separator. It wasn't working out in iTunes. (TagLib# can still read the tags is wrote earlier just fine.) Use `@gnr' or `gnre', but don't attempt a weird mix of both at the same time. * tests/tests.mdp: Automatic changes by MonoDevelop 0.18. * configure.ac: Now 2.0.2.21. svn path=/trunk/taglib-sharp/; revision=92033 commit 4b09fb0a7d34cb10272090e98d982dfe29d7047e Author: Brian Nickel Date: Sun Dec 30 02:50:29 2007 +0000 2007-12-29 Brian Nickel This commit introduces some powerful new tests. They add more intensive checking of saving and rendering and have lead to the preemptive correction of several bugs. * tests/tests.mdp: * tests/fixtures/Helpers.cs: * tests/fixtures/TagLib.FormatTests/FlacFormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3V1FormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3V2FormatTest.cs: * tests/fixtures/TagLib.FormatTests/IFormatTest.cs: * tests/fixtures/TagLib.FormatTests/AsfFormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3BothFormatTest.cs: * tests/fixtures/TagLib.FormatTests/OggFormatTest.cs: * tests/fixtures/TagLib.FormatTests/MpcFormatTest.cs: * tests/fixtures/TagLib.FormatTests/M4aFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/FlacFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/Id3V1FormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/Id3V2FormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/IFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/AsfFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/StandardTests.cs: * tests/fixtures/TagLib.Tests.FileFormats/Id3BothFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/OggFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/MpcFormatTest.cs: * tests/fixtures/TagLib.Tests.FileFormats/M4aFormatTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Mpeg4Test.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/ApeTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Id3V1Test.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/Id3V2Test.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/InfoTagTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/XiphTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/MovieIdTagTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/AsfTest.cs: * tests/fixtures/TagLib.Tests.TaggingFormats/DivXTest.cs: Replaced unit tests with new versions. svn path=/trunk/taglib-sharp/; revision=92025 commit 74de4b8edad100c3f460afac42aa36506f683347 Author: Brian Nickel Date: Sun Dec 30 01:26:31 2007 +0000 2007-12-29 Brian Nickel This commit does the following: - Fixes support for IsCompilation when saving as ID3v2.2. - Makes Id3v2.Tag clonable. - Fixes the project files. - Fixes cloning UserTextInformationFrame. - CHANGES THE DEFAULT ID3v2 VERSION TO 3. While this may result in some boos from people who consider ID3v2.4 to be the perfect tagging format (myself included), the number of applications that hiccup on ID3v2.4 is too astounding. This will not cause tags already encoded at 2.4 to be reencoded at 2.3, but if new tags are added to the file, they will be 2.3. * src/TagLib/Id3v2/Tag.cs: Make Tag cloneable. Make default version 3. * src/TagLib/Id3v2/FrameHeader.cs: Add version 2 mapping for TCMP so IsComposer is saved in Id3v2.2. * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: If the frame is a User*, create a User* when cloning. * src/TagLib/Id3v2/ExtendedHeader.cs: Make cloneable. * src/TagLib/Id3v2/FrameTypes.cs: * src/TagLib/Mpeg4/BoxTypes.cs: Add description of why these classes exist, why they are internal, and why they aren't necessary for third party programmers. * src/taglib-sharp.mdp: * taglib-sharp.csproj: Add VBRIHeader.cs svn path=/trunk/taglib-sharp/; revision=92024 commit e93bf6fdf5d818197cfdc7518e76f2bdfea4192d Author: Brian Nickel Date: Fri Dec 28 21:19:09 2007 +0000 2007-12-28 Brian Nickel This commit does the following: - Adds IsCompilation to Id3v2. - Adds support for deep CopyTo with Id3v2. - Fixes support for deep CopyTo with Ape. - Adds support for Fraunhofer VBRI headers in MPEG audio. - Fixes a bug in reading XiphComments. - Other trivial changes. * src/TagLib/Id3v2/Tag.cs: Added IsCompilation and CopyTo. * src/TagLib/Id3v2/FrameTypes.cs: Added TCMP. * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/PopularimeterFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: * src/TagLib/Id3v2/Frame.cs: Made clonable. * src/TagLib/TagLib.sources: * src/TagLib/Mpeg/VBRIHeader.cs: * src/TagLib/Mpeg/AudioHeader.cs: Added support for Fraunhofer VBRI header. This improves coverage of VBR files. (Thanks to hwahrmann for proposing and authoring the changes.) * src/TagLib/Ape/Tag.cs: Fixed CopyTo to actually override TagLib.Tag.CopyTo. * src/TagLib/Ape/Item.cs: Trivial formatting. * src/TagLib/Picture.cs: Try to make ObsoleteAttributes a bit clearer. * src/TagLib/Debugger.cs: Much nicer DumpHex. * src/TagLib/Ogg/XiphComment.cs: Don't fail when a bad comment (one without a = is encountered, just ignore that field. (Thanks to hwahrmann for the bug report and authoring the changes.) * examples/BatchSet.cs: Allow setting pictures. * configure.ac: Now 2.0.2.20. svn path=/trunk/taglib-sharp/; revision=92001 commit bc9aa22b56ec39127f7ff7ae9e5954d948462f42 Author: Brian Nickel Date: Thu Dec 27 07:11:19 2007 +0000 2007-12-27 Brian Nickel This commit does the following: - Adds support for .divx extension. (Just an AVI) - Adds Tag.CopyTo to obsolete Tag.Duplicate. The difference is that Tag.CopyTo is overridable, so tags and implement their own, better, copying. - Several small bugfixes correcting Mpeg4.Tag.IsCompilation, GIF images, reading Mpeg4 pictures without flags, and NonContainer.EndTag reading small files. - COMPLETE REWORK of OGG pagination to handle multipage comments and saving that results in the creation of new pages. This fixes a bug posted by kurros on the forum and Banshee bug #502628. * src/TagLib/Riff/File.cs: Recognize the .divx extension. (Thanks to sukhjinder for the feature request and jocker for confirming the fix.) Use Tag.CopyTo instead of Tag.Duplicate. * src/TagLib/Flac/File.cs: Use Tag.CopyTo instead of Tag.Duplicate. * src/TagLib/Ape/Tag.cs: Add first real implementation of Tag.CopyTo. * src/TagLib/Ape/Item.cs: Make clonable. * src/TagLib/Mpeg4/AppleTag.cs: Don't check for image format flags, just use data to identify the image type. iTunes apparently doesn't use the flags anymore. (Thanks to DavidT@Imerge for the bug report.) Use 1 byte rather than 4 to store the compilation setting. (Thanks to DavidT@Imerge for the fix.) * src/TagLib/Picture.cs: Was setting mime-type to "image/png" for GIF. * src/TagLib/Tag.cs: Mark Tag.Duplicate as obsolete and replace with overridable Tag.CopyTo. This will provide the option for better copying from one tag to another if their types match rather than just doing the simply copy available in Tag.Duplicate. See Ape.Tag for an implemenation. More coming soon. * src/TagLib/NonContainer/File.cs: Don't read tags at the end of the file if the tags at the start of the file are the entire file. (No double dipping.) * src/TagLib/NonContainer/EndTag.cs: Don't crash if start < 128 when reading. (Thanks to jonx for the bug report.) Use Tag.CopyTo instead of Tag.Duplicate. * src/TagLib/NonContainer/StartTag.cs: Use Tag.CopyTo instead of Tag.Duplicate. * src/TagLib/Ogg/File.cs: Use changes in Page and Paginator classes to handle situations where the number of pages in the stream changes. * src/TagLib/Ogg/Page.cs: Add method for updating all Ogg pages after a certain position with new page numbers. This is necessary if new pages are inserted to avoid corrupting the file. Part of sweeping changes to Ogg support. * src/TagLib/Ogg/Paginator.cs: Instead of just saving a single page, properly paginate using a single page for the first packet in the file. Optimally, produce the same number of pages as were in the file before, but allow for creating more pages if the situation warrents it. * src/TagLib/Ogg/PageHeader.cs: Add a constructor which clones a header but offsets page sequence by a specified number. * src/TagLib/Ogg/Bitstream.cs: Fix typo that was preventing multi-page packets from reading correctly. What a difference a negation makes. * configure.ac: Now 2.0.2.19. svn path=/trunk/taglib-sharp/; revision=91915 commit 9f3974dc78e45cf027155302c8496535ea6e4feb Author: Brian Nickel Date: Tue Dec 25 12:12:52 2007 +0000 2007-12-25 Brian Nickel * src/TagLib/Riff/File.cs: * src/TagLib/Flac/File.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/NonContainer/File.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Ogg/File.cs: Wrap constructors and save operations in try/finally to ensure the streams get closed. (Thanks to oliphant for the bug report.) svn path=/trunk/taglib-sharp/; revision=91875 commit 250683919fee9b9dcc82825aba075215ed22df9a Author: Brian Nickel Date: Tue Dec 25 10:09:22 2007 +0000 2007-12-25 Brian Nickel * src/TagLib/Id3v1/Tag.cs: Added constructor to create from data. Added documentation. Fixed properties to produce correct output when empty. Removed broken IsEmpty property. * src/TagLib/Riff/List.cs: Make sure fields are cleared when SetValue is called with any type of empty result. * src/TagLib/Riff/DivXTag.cs: Added constructor to create from data. Added documentation. Fixed properties to produce correct output when empty. Make Clear() clear `title'. Resize fields after encoding rather than before to avoid possible sizing problems. * src/TagLib/Riff/MovieIdTag.cs: Read genre from correct position. * src/TagLib/Riff/WaveFormatEx.cs: Reformat and complete codec descriptions. * src/TagLib/Id3v2/Tag.cs: Add constructor to create from data. Fixed properties to produce correct output when empty. * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: Correct file header. * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: Use alignment when searching for delimiter to avoid breakage with UTF16BE. * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: Tidy up a bit. Add constructor with only owner as argument. * src/TagLib/Id3v2/Frames/PrivateFrame.cs: Throw NotImplementedException when version is less than 3, rather than just outputting an empty tag. * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: Add size of delimiter rather than 1 to avoid breakage with UTF16. * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Use delimiter rather than single byte in a rejection method to avoid breakage. Have genres produce "/" separated values after first non-indexable value is encountered. eg. {"Blues", "Country", "Foobar", "Jazz"} becomes "(0)(2)Foobar/Jazz". This format is completely recoverable. Add constructor for User* which accepts just a description. * src/TagLib/Mpeg/AudioHeader.cs: Correct some documentation. * src/TagLib/ByteVector.cs: Pass generated BOM to StringTypeToEncoding to make sure the correct encoding is used. * src/TagLib/Flac/File.cs: Correct documentation typo. * src/TagLib/Ape/Tag.cs: Add support for one of each type of picture rather than just one front cover. Allow parsing of years not 4 digits in length. * src/TagLib/Mpeg4/FileParser.cs: Prevent a crash if there isn't sufficient data for reading the first block in parsers. Fix typo which caused UtdaTree to not be filled, resulting in written tags not being readable. * src/TagLib/Mpeg4/AppleTag.cs: Allow parsing of years not 4 digits in length. Correctly clear zeroed values. * src/TagLib/Tag.cs: Use semicolons, rather than commas in Joined* to reflect behavior of WMP. * src/TagLib/Picture.cs: Fix documentation typo. * src/TagLib/WavPack/StreamHeader.cs: Add some docs. * src/TagLib/Asf/Tag.cs: Remove "WM/GenreID" when a new genre is stored. * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: Loop through names rather than descriptors first when getting descriptors. That way the first matching name is chosen rather than the first descriptor of any name. * src/TagLib/Asf/ContentDescriptor.cs: Fix rendering bug that broke storing values. * configure.ac: Now 2.0.2.18. svn path=/trunk/taglib-sharp/; revision=91872 commit 38c6838456f6ca92a292f90d2cf763914a8857f0 Author: Brian Nickel Date: Tue Oct 2 18:27:31 2007 +0000 2007-10-02 Brian Nickel * src/TagLib/Riff/List.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Flac/Picture.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Item.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Ogg/XiphComment.cs: Use ToString (StringType,int,int) instead of ToString(StringType) * src/TagLib/Mpeg/AudioHeader.cs: Remove AudioHeader.position as it is no longer needed. * src/TagLib/ByteVector.cs: Use ToString(StringType,int,int) in ToStrings, mark ToString(StringType,int) as obsolete, add ToString(StringType,int,int), add documentation. Relax exception exception checking in ToString as it was causing unnecessary exceptions when reading some zero byte strings. (Thanks to sambeckett for the bug report.) * src/TagLib/Asf/Tag.cs: Use ContentDescriptionObject.Copyright instead of an extended content descriptor. (Thanks to Dakuja for the bug report.) * src/TagLib/Id3v2/Frames/PopularimeterFrame.cs: Add nil separator when rendering. Was causing tag to be unreadable. (Thanks to cody for the bug report.) * configure.ac: Now 2.0.2.17. svn path=/trunk/taglib-sharp/; revision=86763 commit 900eee2508821d22f9627ef7b1ad11b8468a6d6c Author: Brian Nickel Date: Thu Sep 20 20:54:40 2007 +0000 2007-09-20 Brian Nickel * src/TagLib/ByteVector.cs: Fix overflow problem introduced last release. (Thanks to hwahrmann for the bug report.) * src/TagLib/Asf/HeaderObject.cs: Switch the order of play_duration and send_duration. Standard implementation is backwards from the specification. (Thanks to hwahrmann for the bug report.) * src/TagLib/Asf/FilePropertiesObject.cs: Subtract preroll from duration. (Thanks to hwahrmann for the bug report.) * configure.ac: Now 2.0.2.16. svn path=/trunk/taglib-sharp/; revision=86112 commit 3d7097038b0aefac9481f4c18a7528050b4830b8 Author: Brian Nickel Date: Tue Sep 18 20:07:18 2007 +0000 2007-09-18 Brian Nickel * src/TagLib/Riff/BitmapInfoHeader.cs: Reformat. * src/TagLib/Id3v2/FrameHeader.cs: Remove 'using System.Collections' * src/TagLib/Mpeg/AudioHeader.cs: Don't double-count position when counting frames. (Thanks to hwahrmann for the bug report.) * src/TagLib/ByteVector.cs: Add UseBrokenLatin1Behavior to emulate bad behavior of many taggers. When true, TagLib# will read Latin1 strings as the system default encoding. * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Ape/Tag.cs: Documented. * src/TagLib/Riff/File.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Asf/DescriptionRecord.cs: * src/TagLib/Asf/ContentDescriptor.cs: * src/TagLib/ReadOnlyByteVector.cs: Use ToString(StringType). * configure.ac: Now 2.0.2.15. svn path=/trunk/taglib-sharp/; revision=85987 commit 80926fc841ac9bf4df8ff726a5c33dcc37488b39 Author: Brian Nickel Date: Mon Sep 17 06:44:06 2007 +0000 2007-09-17 Brian Nickel * src/TagLib/Id3v2/Tag.cs: New logic for SetFrameText was backwards, causing frames to disappear. (Thanks to hwahrmann for the bug report.) * src/TagLib/Id3v2/FrameHeader.cs: Fix the reading of version 2 and 3 headers. They weren't being converted to the new headers. Add FrameFlags.None. * src/TagLib/Id3v2/Header.cs: Add HeaderFlags.None. * configure.ac: Now 2.0.2.14. svn path=/trunk/taglib-sharp/; revision=85861 commit fb12bfc4ca89e46a1b3024170f3e436a4a6b28ec Author: Brian Nickel Date: Sun Sep 16 22:23:22 2007 +0000 2007-09-16 Brian Nickel * src/TagLib/Id3v2/SynchData.cs: * src/TagLib/Id3v2/FrameTypes.cs: * src/TagLib/Id3v2/FrameHeader.cs: * src/TagLib/Id3v2/Header.cs: * src/TagLib/ByteVector.cs: * src/TagLib/Ape/StreamHeader.cs: Documentation. svn path=/trunk/taglib-sharp/; revision=85860 commit c172f173c6f06518c7323c14d43bd273b58e1392 Author: Brian Nickel Date: Thu Sep 6 00:25:26 2007 +0000 2007-09-05 Brian Nickel * src/TagLib/Flac/Block.cs: Completed docs. * src/TagLib/Id3v2/Tag.cs: GetItemAsUInt32 was fubar and always returning zero. (Thanks to renzska for the bug report.) Always set the encoding to the default when setting the contents of a frame. This should hopefully prevent bad encoding. (Thanks to evgeni for the bug report.) * src/TagLib/Ape/Tag.cs: GetItemAsUInt32 was fubar and always returning zero. * configure.ac: Now 2.0.2.13. svn path=/trunk/taglib-sharp/; revision=85387 commit 7073f245a80d975f37c51d0d21b3f5da68dd6057 Author: Brian Nickel Date: Tue Sep 4 07:17:55 2007 +0000 2007-09-04 Brian Nickel Only 713 public members away from doing away with MonoDoc. * src/TagLib/Flac/File.cs: Completed docs. * src/TagLib/ByteVectorList.cs: * src/TagLib/Id3v1/Tag.cs: * src/TagLib/Id3v1/StringHandler.cs: * src/TagLib/Riff/List.cs: * src/TagLib/Riff/AviStream.cs: * src/TagLib/Riff/File.cs: * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/AviHeaderList.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/Genres.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Footer.cs: * src/TagLib/Id3v2/SynchData.cs: * src/TagLib/Id3v2/FrameTypes.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/FrameHeader.cs: * src/TagLib/Id3v2/Header.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/UnknownFrame.cs: * src/TagLib/Id3v2/ExtendedHeader.cs: * src/TagLib/Id3v2/Frame.cs: * src/TagLib/ByteVector.cs: * src/TagLib/Properties.cs: * src/TagLib/SupportedMimeType.cs: * src/TagLib/Flac/Picture.cs: * src/TagLib/Flac/BlockHeader.cs: * src/TagLib/Flac/StreamHeader.cs: * src/TagLib/Flac/Block.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Footer.cs: * src/TagLib/StringList.cs: * src/TagLib/FileTypes.cs: * src/TagLib/ListBase.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleTableBox.cs: * src/TagLib/Mpeg4/Boxes/AppleItemListBox.cs: * src/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/AppleAnnotationBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMetaBox.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/Box.cs: * src/TagLib/Picture.cs: * src/TagLib/Tag.cs: * src/TagLib/File.cs: * src/TagLib/Debugger.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/HeaderExtensionObject.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: * src/TagLib/Asf/Guid.cs: * src/TagLib/Asf/MetadataLibraryObject.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/Page.cs: * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/Codecs/Vorbis.cs: * src/TagLib/Ogg/Codec.cs: * src/TagLib/Ogg/File.cs: * src/TagLib/Ogg/Paginator.cs: * src/TagLib/Ogg/PageHeader.cs: * src/TagLib/Ogg/GroupedComment.cs: * src/TagLib/Ogg/Bitstream.cs: * src/AssemblyInfo.cs.in: Replaced headers and use cref="T:...`1" instead of "...{T}" until gmcs is fixed. This reduces warnings to strictly CS1591. svn path=/trunk/taglib-sharp/; revision=85255 commit 4721677e816f851bc30009cd35145ad4c3610c9a Author: Brian Nickel Date: Mon Sep 3 20:57:36 2007 +0000 2007-09-03 Brian Nickel * src/TagLib/Id3v2/Tag.cs: Renamed private method. Tidied up Read. * src/TagLib/Ape/Item.cs: Fixed some documentation. * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Footer.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/HeaderExtensionObject.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/DescriptionRecord.cs: * src/TagLib/Asf/FilePropertiesObject.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: * src/TagLib/Asf/UnknownObject.cs: * src/TagLib/Asf/Guid.cs: * src/TagLib/Asf/MetadataLibraryObject.cs: * src/TagLib/Asf/PaddingObject.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Asf/Object.cs: * src/TagLib/Asf/ContentDescriptor.cs: Completed docs. svn path=/trunk/taglib-sharp/; revision=85245 commit e99b1e6e4727bfe7babe83c31a0a21686e356d22 Author: Brian Nickel Date: Fri Aug 31 17:05:20 2007 +0000 2007-08-31 Brian Nickel * src/TagLib/Ape/File.cs: * src/TagLib/Ape/StreamHeader.cs: * src/TagLib/FileTypes.cs: Added support for reading APE files. (Thanks to hwahrmann for authoring the classes.) * src/TagLib/Id3v2/Tag.cs: Fixed docs. * src/TagLib/Ape/Item.cs: Completed docs. * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: Prevent ArgumentOutOfRangeException when a corrupt frame is encountered. (Thanks to jms for the bug report.) * src/TagLib/Id3v1/Tag.cs: * src/TagLib/Riff/List.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: * src/TagLib/ByteVector.cs: * src/TagLib/Properties.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Tag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Ogg/XiphComment.cs: Removed StringCollection usage (and replaced some collections with arrays. * src/TagLib/TagLib.sources: * src/taglib-sharp.mdp: * taglib-sharp.csproj: Added files. * configure.ac: Now 2.0.2.12. svn path=/trunk/taglib-sharp/; revision=85146 commit aa88901e9133c8632e00673af9f1d784ea41fdb0 Author: Brian Nickel Date: Wed Aug 29 00:36:24 2007 +0000 2007-08-28 Brian Nickel * src/TagLib/Ape/Tag.cs: Stop parsing when a corrupt item is detected. * src/TagLib/Ape/Item.cs: UTF-8 encoded length != string.Length. Was messing up with Chinese titles. (Thanks to jms for the bug report.) * src/TagLib/CombinedTag.cs: Fix header. * src/TagLib/Id3v2/Tag.cs: Document, add generic GetFrames() * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frame.cs: * src/TagLib/Mpeg/File.cs: Document. * src/TagLib/Mpeg/VideoHeader.cs: Fix copyright info. * src/TagLib/Mpeg/AudioFile.cs: Fix some typos. * src/TagLib/Properties.cs: * src/TagLib/SupportedMimeType.cs: * src/TagLib/StringList.cs: * src/TagLib/FileTypes.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleTableBox.cs: * src/TagLib/Mpeg4/Boxes/AppleItemListBox.cs: * src/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/AppleAnnotationBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMetaBox.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/Box.cs: Fixed generics documentation. * src/TagLib/Mpeg4/File.cs: Accidentally marked constructors as protected when copy/pasting code from NonContainer.File. (Thanks to hwahrmann for the bug report.) * configure.ac: Now 2.0.2.11. svn path=/trunk/taglib-sharp/; revision=84985 commit 51805c32c8855c0c1d1b8f2feaba2d96cc066b24 Author: Brian Nickel Date: Sat Aug 25 00:19:12 2007 +0000 2007-08-24 Brian Nickel * src/TagLib/Mpeg/AudioHeader.cs: Restore copyright notice. * src/TagLib/ICodec.cs: Wording Change. * src/TagLib/Mpeg/XingHeader.cs: * src/TagLib/Mpeg/VideoHeader.cs: * src/TagLib/Mpeg/AudioFile.cs: * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleTableBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/AppleAdditionalInfoBox.cs: * src/TagLib/Mpeg4/Boxes/IsoFreeSpaceBox.cs: * src/TagLib/Mpeg4/Boxes/AppleItemListBox.cs: * src/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs: * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/AppleDataBox.cs: * src/TagLib/Mpeg4/Boxes/AppleAnnotationBox.cs: * src/TagLib/Mpeg4/Boxes/UnknownBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMetaBox.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxFactory.cs: * src/TagLib/Mpeg4/BoxHeader.cs: * src/TagLib/Mpeg4/Box.cs: Document completely. svn path=/trunk/taglib-sharp/; revision=84838 commit dec5cc67b4341608e15eb276a5c42c27c9277f15 Author: Brian Nickel Date: Mon Aug 20 07:08:28 2007 +0000 2007-08-19 Brian Nickel * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/UnknownBox.cs: Document completely. * src/TagLib/Mpeg4/AppleTag.cs: Committed too soon. File didn't compile. * src/TagLib/Mpeg4/BoxFactory.cs: Forgot a bunch of end tags. * src/TagLib/Mpeg4/Box.cs: Fix doc typo. * src/TagLib/Mpc/StreamHeader.cs: * src/TagLib/WavPack/StreamHeader.cs: Slight change in wording. svn path=/trunk/taglib-sharp/; revision=84428 commit 858f6cfd4adbf14589d3e125b65b61196160a47e Author: Brian Nickel Date: Mon Aug 20 05:40:31 2007 +0000 2007-08-19 Brian Nickel * src/TagLib/Id3v2/Frames/PopularimeterFrame.cs: Fix an exception when saving a PopularimeterFrame with a play count of 0. * src/taglib-sharp.mdp: Remove BoxList.cs. It hasn't been used in forever and is an empty file. * src/TagLib/Mpeg4/FileParser.cs: Started documentation. * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxFactory.cs: * src/TagLib/Mpeg4/BoxHeader.cs: * src/TagLib/Mpeg4/BoxList.cs: * src/TagLib/Mpeg4/Box.cs: * src/TagLib/Mpc/File.cs: * src/TagLib/WavPack/File.cs: Completed documentation. * src/TagLib/Mpc/StreamHeader.cs: * src/TagLib/WavPack/StreamHeader.cs: Completed documentation, except for IEquitable overrides. * src/TagLib/Mpeg4/AppleTag.cs: Completed documentation, except for IEnumerable overrides. * configure.ac: Now 2.0.2.10. svn path=/trunk/taglib-sharp/; revision=84426 commit 9bc89ce4e9eee861e891e30621b3e74f6f9d85f5 Author: Brian Nickel Date: Sun Aug 19 19:07:59 2007 +0000 2007-08-19 Brian Nickel * src/TagLib/File.cs: Fix some typos in documentation. * src/TagLib/NonContainer/Tag.cs: * src/TagLib/NonContainer/File.cs: * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: Document completely. svn path=/trunk/taglib-sharp/; revision=84408 commit 72482ecc56ce43af5ec646017224da66006a30bb Author: Brian Nickel Date: Fri Aug 17 23:37:31 2007 +0000 2007-08-17 Brian Nickel * src/TagLib/Mpeg/AudioHeader.cs: Go back to setting XingHeader early, there are just too many things that depend on `this'. (Thanks to jmurphy for the bug report.) * src/TagLib/Ape/Tag.cs: Support APEv2 cover pictures. (Thanks to renzska for the feature request.) * src/TagLib/Picture.cs: Add new constructors, obsolete CreateFromFile and CreateFromPath, detect GIF and BMP files. * src/TagLib/NonContainer/EndTag.cs: Check that the footer contains sane values. * configure.ac: Now 2.0.2.9. Remove pkgconfig check for Mono. It isn't really needed. 2007-08-16 Brian Nickel * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/DescriptionRecord.cs: * src/TagLib/Asf/MetadataLibraryObject.cs: * src/TagLib/Asf/ContentDescriptor.cs: Added support for the ASF Metadata Library Object. This object supports content descriptors as big as uint.MaxValue as opposed to ushort.MaxValue. Tag.Pictures now reads from this source as well, and large pictures are now written to it. They were previously ignored. (Thanks to renzska for the bug report.) * src/TagLib/TagLib.sources: * src/taglib-sharp.mdp: * taglib-sharp.csproj: Added new files. * configure.ac: Now 2.0.2.8 svn path=/trunk/taglib-sharp/; revision=84339 commit e924fe536ed5c029be3103f25fd0434ed9282635 Author: Brian Nickel Date: Thu Aug 16 21:28:34 2007 +0000 2007-08-16 Brian Nickel * src/TagLib/Mpeg/AudioHeader.cs: Use non-property checks in public constructor, assigning the XingHeader after sanity tests was causing compiler problems on MS .NET. (Thanks to jmurphy for the bug report.) * configure.ac: Now 2.0.2.7 svn path=/trunk/taglib-sharp/; revision=84242 commit a2bb91062fccaf01b72f333aa5317b1291b233b2 Author: Brian Nickel Date: Tue Aug 14 21:50:47 2007 +0000 2007-08-14 Brian Nickel * src/TagLib/Mpeg/XingHeader.cs: Add XingHeader.FileIdentifier to speed things up. * src/TagLib/Mpeg/AudioHeader.cs: Fully document, reformat and add a check for the Xing identifier before calling the constructor to avoid an unnecessary exception/try/catch. * src/TagLib/ICodec.cs: Correct some documentation. * src/TagLib/Properties.cs: * src/TagLib/SupportedMimeType.cs: * src/TagLib/StringList.cs: * src/TagLib/FileTypes.cs: Correct for documentation compiler warning. * taglib-sharp.csproj: Added PopularimeterFrame.cs svn path=/trunk/taglib-sharp/; revision=84123 commit 39f560e77794ae82c5662b9be3efec137793e1a1 Author: Brian Nickel Date: Mon Aug 13 02:54:49 2007 +0000 2007-08-12 Brian Nickel * src/TagLib/Id3v2/FrameTypes.cs: Added POPM * src/TagLib/Id3v2/FrameFactory.cs: Added PopularimeterFrame * src/TagLib/Id3v2/Frames/PopularimeterFrame.cs: NEW. Supports ID3v2 POPM (4.17) frame. (Thanks to renzska for the feature request.) * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: Removed 'using System.Collections; * src/TagLib/TagLib.sources: * src/taglib-sharp.mdp: Added PopularimeterFrame.cs * configure.ac: Now 2.0.2.5 svn path=/trunk/taglib-sharp/; revision=83929 commit b73f68526f3f4b6387b2374a5859d0ab08f284e3 Author: Brian Nickel Date: Mon Aug 13 02:03:16 2007 +0000 2007-08-12 Brian Nickel * src/TagLib/Riff/List.cs: Reordered operations. Was incrementing a value after it would have made a difference. * src/TagLib/Id3v2/Tag.cs: Added static UseNumericGenres which can be set to false to prevent genres from being stored as ID3v1 indices. (Thanks to craig for the feature request.) * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Use a StringBuilder instead of + operations when formatting genres. * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: Check that a negative length is not being passed to Mid if '\0' is not found. * src/TagLib/Mpeg4/BoxTypes.cs: Add Mdat. * src/TagLib/Riff/File.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/NonContainer/File.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Ogg/File.cs: * src/TagLib/File.cs: Added InvariantStartPosition and InvariantEndPosition describing the invariant/media section of the file that should be uneffected by TagLib# write operations. (Thanks to AgentS and kajic for their feature requests.) * configure.ac: Now 2.0.2.4 svn path=/trunk/taglib-sharp/; revision=83928 commit 2a9900eb9e53f4981e69d7539ad9676e97337ecd Author: Brian Nickel Date: Thu Aug 2 19:11:17 2007 +0000 2007-08-02 Brian Nickel * src/TagLib/Id3v2/Frame.cs: Files were throwing ArgumentOutOfRange exceptions after the changes on 2007-07-29. It now checks that the ByteVector contains enough bytes and if not throws a CorruptFileException. (Caught in TagLib.Id3v2.Tag) * src/TagLib/Mpeg/AudioFile.cs: Limit scanning to only the first 0x4000 bytes of the audio stream to avoid reading bad files forever. I got no false negatives at 0x1000 so I'm hoping this is enough. If not, I can throttle it up more. (Thanks to its-me for the bug report.) * configure.ac: Now 2.0.2.3 svn path=/trunk/taglib-sharp/; revision=83326 commit 10e4154a026075bd5d71bd037f420a29632fad42 Author: Brian Nickel Date: Mon Jul 30 00:13:12 2007 +0000 2007-07-29 Brian Nickel * src/TagLib/CombinedTag.cs: Fully documented and replaced the protected constructor with a public one, as it wasn't protecting anything and causing a compiler error in Orcas. (Thanks to jmurphy for the bug report.) * src/TagLib/ByteVectorList.cs: Reformatted code. I had beautiful documentation, but MonoDevelop crashed. :( * src/TagLib/ByteVector.cs: Started documenting and adding some exceptions rather than letting them occur in the underlying methods. * src/TagLib/ListBase.cs: Reformatted code. * src/TagLib/File.cs: Added total documentation. * src/TagLib/Debugger.cs: Reformatted code. * src/Makefile.am: * Makefile.am: Added MonoDevelop files to EXTRA_DIST. (Thanks to jopsen for pointing this out.) * configure.ac: Now 2.0.2.2 svn path=/trunk/taglib-sharp/; revision=82949 commit a97b7b6cb35ddf46e50ecd2f9b780ef884cb79f7 Author: Brian Nickel Date: Mon Jul 23 03:10:16 2007 +0000 2007-07-22 Brian Nickel * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Ogg/XiphComment.cs: Parse beats per minute as floating point numbers, round them, and then convert them to uints. Values were showing up as 0 if a decimal point was present. (Thanks to nokturnal for the bug report.) * src/TagLib/ByteVector.cs: Switch back from "_data" to "data" * src/TagLib/ICodec.cs: Minor reorganization. * src/TagLib/Genres.cs: * src/TagLib/Properties.cs: * src/TagLib/SupportedMimeType.cs: * src/TagLib/StringList.cs: * src/TagLib/FileTypes.cs: * src/TagLib/Tag.cs: * src/TagLib/Picture.cs: * src/TagLib/File.cs: * src/TagLib/ReadOnlyByteVector.cs: Documentation. * configure.ac: Now 2.0.2.1 svn path=/trunk/taglib-sharp/; revision=82456 commit 0e14c9adc24e5ac99750969221919deb9bf8e3c5 Author: Brian Nickel Date: Tue Jul 3 21:55:49 2007 +0000 2007-07-03 Brian Nickel +-------------+ | VERSON BUMP | | 2.0.2 | +-------------+ * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs: Fix docs. * src/TagLib/File.cs: Some doc work. * src/AssemblyInfo.cs.in: Conditionally sign the assembly. * src/AssemblyInfo-windows.cs: DELETED. AssemblyInfo.cs.in is all that's necessary. * src/Makefile.am: Add distwin target * windows-files/TagLibSharpDocs.chm: Added. * configure.ac: Don't use svn revision because it is greater than ushort.MaxValue. * Makefile.am: Add distwin target. * NEWS: Updated for new release. * src/taglib-sharp.mdp: * taglib-sharp.csproj: Use AssemblyInfo.cs. svn path=/trunk/taglib-sharp/; revision=81300 commit 79cfd2193845680ba33239ed8caebcc557baadc4 Author: Brian Nickel Date: Wed Jun 27 19:24:22 2007 +0000 2007-06-27 Brian Nickel * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: Fixed reading problem with UTF-16 encoded descriptions. (Thanks to renzska for the bug report.) * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: Use Mono coding guidelines. * src/TagLib/Asf/File.cs: Added ReadObject and detection of HeaderExtensionObject. * src/TagLib/TagLib.sources: Added HeaderExtensionObject.cs * src/TagLib/Asf/HeaderExtensionObject.cs: ADDED. This will be used to store large objects in the future (pictures bigger than 64k). * src/TagLib/Asf/Guid.cs: Added GUID's for HeaderExtensionObject. * src/AssemblyInfo.cs.in: Cleaned up. * src/AssemblyInfo-windows.cs: Cleaned up. * src/taglib-sharp.mdp: Added HeaderExtensionObject.cs * configure.ac: Removed extra line. * taglib-sharp.csproj: Added HeaderExtensionObject.cs svn path=/trunk/taglib-sharp/; revision=80908 commit d64cabf8b151ede0344b16993c3193bdf4a03faa Author: Brian Nickel Date: Tue Jun 26 22:18:51 2007 +0000 2007-06-26 Brian Nickel * src/TagLib/Id3v2/Frames/CommentsFrame.cs: Readd ToString. * src/TagLib/Mpeg/XingHeader.cs: Don't throw an exception just because the header doesn't contain everything we want. * src/TagLib/Mpeg/AudioHeader.cs: Prevent infinite loop. (Thanks to sambeckett for the bug report.) Add "VBR" to the description if a Xing header is present. * tests/fixtures/TagLib.FormatTests/FlacFormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3V1FormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3V2FormatTest.cs: * tests/fixtures/TagLib.FormatTests/AsfFormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3BothFormatTest.cs: * tests/fixtures/TagLib.FormatTests/OggFormatTest.cs: * tests/fixtures/TagLib.FormatTests/MpcFormatTest.cs: * tests/fixtures/TagLib.FormatTests/M4aFormatTest.cs: Use Performers instead of Artists. svn path=/trunk/taglib-sharp/; revision=80824 commit 57a64ea15651bdff2590e848019b5a5756ee620a Author: Brian Nickel Date: Tue Jun 26 20:03:02 2007 +0000 2007-06-26 Brian Nickel * src/TagLib/CorruptFileException.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: * src/TagLib/UnsupportedFormatException.cs: Added XML documentation. * src/TagLib/Tag.cs: Started XML documentation. Artists was pointing nowhere. Pointed at Performers. * src/TagLib/ByteVector.cs: ByteVector.Find was not returning -1 if searching at (data.Count == pattern.Count + offset). Caused extra '\0' to appear in comment frames. (Thanks to gozza11 for the bug report.) * src/taglib-sharp.mdp: * configure.ac: Work with "make distcheck" * Makefile.am: Include "svn-version" in dist. svn path=/trunk/taglib-sharp/; revision=80813 commit 3d8229605f78912b8bc388caead7477d10a79075 Author: Brian Nickel Date: Mon Jun 25 09:14:11 2007 +0000 2007-06-25 Brian Nickel * src/TagLib/Id3v2/Frames/PrivateFrame.cs: Set to this.data instead of data in constructor. Thanks to pipes for the bug report.) * configure.ac: Make the fourth part of the assembly version equal to the SVN revision. svn path=/trunk/taglib-sharp/; revision=80676 commit 47b75955913dfaf484f41a67cc5e4e884c6acd23 Author: Brian Nickel Date: Mon Jun 25 05:00:24 2007 +0000 2007-06-24 Brian Nickel +-------------+ | VERSON BUMP | | 2.0.1 | +-------------+ * src/AssemblyInfo.cs.in: * configure.ac: * src/Makefile.am: * src/policy.2.0.taglib-sharp.config.in: Install a policy in GAC so assemblies compiled against older versions use 2.0.1.0. * src/AssemblyInfo-windows.cs: Version bump. * NEWS: Information on new release. svn path=/trunk/taglib-sharp/; revision=80664 commit 9a88cb7cb9b4eae8420bdd20027d897b2d9e0a33 Author: Brian Nickel Date: Sun Jun 24 18:25:16 2007 +0000 2007-06-24 Brian Nickel * src/TagLib/Id3v2/Tag.cs: Fixed bug in commit from 2007-06-20. TPE2 and TPE1 were being swapped when they were stored. (Thanks to jmurphy for the but report.) svn path=/trunk/taglib-sharp/; revision=80640 commit 6d4d454d1c8b261e5727f76ef8ccdb5c2f63b194 Author: Brian Nickel Date: Sun Jun 24 18:09:19 2007 +0000 2007-06-24 Brian Nickel * src/TagLib/Id3v2/Frames/CommentsFrame.cs: Split the string into 3 pieces instead of 2. This way nil delimiters and badly formatted strings don't mess up the value. (Thanks to gozza11 for the but report.) svn path=/trunk/taglib-sharp/; revision=80639 commit 9822af3a64b57f64c4371657a27a7d9aac65182d Author: Brian Nickel Date: Fri Jun 22 18:55:23 2007 +0000 2007-06-22 Brian Nickel * src/TagLib/Id3v2/Tag.cs: Remove picture frames if Picture is set to null or an empty array. (Thanks to wilson for the but report.) svn path=/trunk/taglib-sharp/; revision=80569 commit c93afd260939a6fd9616e7ba22a186c0e13e3514 Author: Brian Nickel Date: Wed Jun 20 21:12:06 2007 +0000 2007-06-20 Brian Nickel * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Asf/Tag.cs: Don't return Performers if AlbumArtists is not found. This, provided with the second to last commit should resolve inconsistancies in the behaviour. (Thanks to JustinC for the bug report, otherwise that travesty that is the previous implementation may have gone on forever.) * src/TagLib/Tag.cs: Fix typos. svn path=/trunk/taglib-sharp/; revision=80366 commit aebd6b8ec644a70946a1d880ffc2cd16f0752004 Author: Brian Nickel Date: Wed Jun 20 20:49:35 2007 +0000 2007-06-20 Brian Nickel * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Use ByteVector.TextDelimiter instead of Frame.TextDelimiter. * src/TagLib/Id3v2/Frame.cs: Mark TextDelimiter as obsolete. * src/TagLib/ByteVector.cs: Add TextDelimiter method. * src/TagLib/Asf/Tag.cs: Discard new pictures if their rendered size is greater than 64KB to avoid corrupting files. (Thanks to renzska for the bug report.) svn path=/trunk/taglib-sharp/; revision=80364 commit 0825a9eff914087b1140c62510af9d5e52233ad6 Author: Brian Nickel Date: Wed Jun 20 18:53:22 2007 +0000 2007-06-20 Brian Nickel * src/TagLib/Id3v1/Tag.cs: Rework to match Picard specs. * src/TagLib/Riff/DivXTag.cs: Rework to match Picard specs. * src/TagLib/Riff/MovieIdTag.cs: Rework to match Picard specs. * src/TagLib/Id3v2/Tag.cs: Rework to match Picard specs. * src/TagLib/Ape/Tag.cs: Rework to match Picard specs. * src/TagLib/Ogg/XiphComment.cs: Rework to match Picard specs. * src/TagLib/Tag.cs: Added JoinedAlbumArtists and FirstAlbumArtist. Changed JoinedArtists and FirstArtist to point to Performers (marked as obsolete), and added Artists which points to Performers (also obsolete). This should aleviate confusion. svn path=/trunk/taglib-sharp/; revision=80346 commit 53d5e285be01c51179b2efdd3043c096d5b7aa12 Author: Brian Nickel Date: Wed Jun 13 03:06:22 2007 +0000 2007-06-12 Brian Nickel * src/TagLib/Mpeg4/File.cs: Fix support for writing files that don't have UTDA tags. (Thanks to renzska for the bug report.) * src/TagLib/Mpeg4/Box.cs: Fix support for clearing boxes. (Thanks to maciej for the bug report.) Calculate padding size based on DataSize rather than header.DataSize. Fixes problem where 4 bytes are added on every save. (Discovered in bug report by lindea.) * src/TagLib/Riff/WaveFormatEx.cs: Recognize WMA Lossless. (Thanks to JustinC for the patch.) * ALSO: Thanks to JustinC for reminding me to credit people for their contributions. With the countless audio and video files in existence, TagLib# would be far less complete and considerably buggier if not for everyone's contributions. Thank you! svn path=/trunk/taglib-sharp/; revision=79373 commit ade972de4e7356cdc8cf795f7ba53e50362cc556 Author: Brian Nickel Date: Mon Jun 11 16:25:26 2007 +0000 2007-06-11 Brian Nickel * src/TagLib/Ogg/Paginator.cs: Fix save support in OGG. Thanks to maciej for pointing this out. * NEWS: Added NEWS file. svn path=/trunk/taglib-sharp/; revision=79189 commit c0ddc28818c88bf1233c08f5b3eec7636b457fcb Author: Brian Nickel Date: Mon Jun 11 04:17:48 2007 +0000 This one got away. svn path=/trunk/taglib-sharp/; revision=79141 commit 2d1b94fdcae2bb96ae99b8d92ede76785be36a16 Author: Brian Nickel Date: Mon Jun 11 04:16:26 2007 +0000 2007-06-10 Brian Nickel +-------------+ | VERSON BUMP | | 2.0.0 | +-------------+ The official announcement, tarballs, and excessive drinking will come tomorrow after I get Windows documentation in order. In the mean time I'll tidy up the site a bit. * src/TagLib/Id3v2/Tag.cs: Combine TYER, TDAT, and TIME into a single TDRC, rather than discarding TDAT and TIME. * src/TagLib/Id3v2/FrameTypes.cs: Add some more types. * src/TagLib/Id3v2/FrameFactory.cs: Change for renamed frames. * src/TagLib/Id3v2/FrameHeader.cs: Don't discard TIME and TDAT. * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: Remove SetText. It is redundant and identical to set_Text. * src/TagLib/Id3v2/Frames/CommentsFrame.cs: Remove SetText. It is redundant and identical to set_Text. * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs: Rename MusicCdIdentifier to MusicCdIdentiferFrame. I don't know how I made that mistake. * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: Remove SetText. It is redundant and identical to set_Text. * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Rename to TextInformationFrame to better reflect specification. (Text Identification frame is a subset of Text Information Frame). Split TDRC into TYER, TDAT, and TIME if saving as version 2.3. * src/TagLib/Id3v2/Frame.cs: Make Render virtual to allow for more robust features. (Applied in TextInformationFrame.) * src/TagLib/ByteVector.cs: Fix typo. * src/TagLib/Ape/Tag.cs: Make enumerable. * src/TagLib/Mpeg4/Box.cs: Remove GetChild(System.Type), as all other System.Type based functionality has been removed. * src/AssemblyInfo-windows.cs: Version bump. * configure.ac: Version bump. Remove unit tests to shrink tarball. * Makefile.am: Remove unit tests to shrink tarball. svn path=/trunk/taglib-sharp/; revision=79140 commit 431bae630b26d16cf932513a1ecb6363c13ee3d8 Author: Brian Nickel Date: Mon Jun 11 04:03:03 2007 +0000 2007-06-10 Brian Nickel * docs/*: Get 100% caught up. svn path=/trunk/taglib-sharp/; revision=79138 commit c64d9fe099276baf58844658bf55b24cf00d39a9 Author: Brian Nickel Date: Thu Jun 7 21:35:01 2007 +0000 2007-06-07 Brian Nickel * src/TagLib/CombinedTag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Id3v1/Tag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Riff/File.cs: Use ReadOnlyByteVector. * src/TagLib/Riff/DivXTag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Riff/ListTag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Footer.cs: * src/TagLib/Id3v2/FrameTypes.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/FrameHeader.cs: * src/TagLib/Id3v2/Header.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: * src/TagLib/Id3v2/Frame.cs: Use TagLib.Id3v2.FrameType instead of hard- coding. Cuts out a lot of read time. * src/TagLib/Flac/File.cs: Use ReadOnlyByteVector. * src/TagLib/Flac/Block.cs: BlockSize instead of Size. * src/TagLib/Ape/Tag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Ape/Footer.cs: Use ReadOnlyByteVector. * src/TagLib/Ape/Item.cs: Use ReadOnlyByteVector. * src/TagLib/Mpeg4/Boxes/AppleAdditionalInfoBox.cs:Don't parse text before its needed. * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: Don't do extra seeks. * src/TagLib/Mpeg4/FileParser.cs: Use do/while instead of for. Was doing extra reading. * src/TagLib/Mpeg4/AppleTag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Mpeg4/BoxTypes.cs: Make internal. * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxFactory.cs: * src/TagLib/Mpeg4/BoxHeader.cs: * src/TagLib/Mpeg4/Box.cs: Rename "BoxTypes" to "BoxType" * src/TagLib/Mpc/StreamHeader.cs: Use ReadOnlyByteVector * src/TagLib/Tag.cs: Add Tag.Clear * src/TagLib/File.cs: Do away with ReadBlock(uint) * src/TagLib/WavPack/StreamHeader.cs: Use ReadOnlyByteVector. * src/TagLib/Asf/Tag.cs: Add Tag.Clear, Tag.IsEmpty * src/TagLib/Asf/ContentDescriptionObject.cs: Add IsEmpty * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: Add IsEmpty * src/TagLib/Ogg/XiphComment.cs: Add Tag.Clear * src/TagLib/Ogg/PageHeader.cs: Use ReadBlock(int) * src/TagLib/Ogg/GroupedComment.cs: Add Tag.Clear * docs/en/TagLib.Riff/DivXTag.xml * docs/en/TagLib.Riff/File.xml * docs/en/TagLib.Id3v1/Tag.xml * docs/en/TagLib.Id3v2/Header.xml * docs/en/TagLib.Id3v2/Frame.xml * docs/en/TagLib.Id3v2/Footer.xml * docs/en/TagLib.Id3v2/FrameHeader.xml * docs/en/TagLib.Mpeg/AudioFile.xml * docs/en/TagLib.Mpeg/File.xml * docs/en/TagLib.WavPack/StreamHeader.xml * docs/en/TagLib.WavPack/File.xml * docs/en/TagLib/Tag.xml * docs/en/TagLib/File.xml * docs/en/index.xml * docs/en/TagLib.Flac/Metadata.xml * docs/en/TagLib.Flac/Block.xml * docs/en/TagLib.Flac/File.xml * docs/en/TagLib.Ape/Tag.xml * docs/en/TagLib.Ape/Footer.xml * docs/en/TagLib.MusePack/StreamHeader.xml * docs/en/TagLib.MusePack/File.xml * docs/en/TagLib.Asf/ContentDescriptionObject.xml * docs/en/TagLib.Asf/ExtendedContentDescriptionObject.xml * docs/en/TagLib.Asf/Tag.xml * docs/en/TagLib.Asf/File.xml * docs/en/TagLib.Ogg/GroupedComment.xml * docs/en/TagLib.Ogg/XiphComment.xml * docs/en/TagLib.Ogg/File.xml * docs/en/TagLib.Mpeg4/Box.xml * docs/en/TagLib.Mpeg4/AppleTag.xml * docs/en/TagLib.Mpeg4/BoxTypes.xml * docs/en/TagLib.Mpeg4/File.xml: Synched docs. svn path=/trunk/taglib-sharp/; revision=78896 commit 781f167791ed0fcb5ebae418ca57b1721b66a847 Author: Brian Nickel Date: Mon Jun 4 18:12:47 2007 +0000 2007-06-04 Brian Nickel * src/TagLib/Mpeg/File.cs: Prevent overflow. * src/TagLib/Mpc/File.cs: Add support for "mpp" extention. svn path=/trunk/taglib-sharp/; revision=78577 commit f912417fdc8ba070b5ab92bf17e7432cf3140fd9 Author: Brian Nickel Date: Sat Jun 2 00:32:07 2007 +0000 2007-06-01 Brian Nickel +-------------+ | VERSON BUMP | | 1.9.99995 | +-------------+ * examples/SetPictures.cs: Fix for API changes. * src/TagLib/ByteVector.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/TagLib.sources: * src/TagLib/ReadOnlyByteVector.cs: * src/taglib-sharp.mdp: * docs/en/TagLib/ReadOnlyByteVector.xml: * docs/en/TagLib/ByteVector.xml: * docs/en/index.xml: * docs/en/TagLib.Mpeg4/BoxTypes.xml: * taglib-sharp.csproj: Add immutable ReadOnlyByteVector. svn path=/trunk/taglib-sharp/; revision=78468 commit 080958d362c0a7da9fe1dea205f7d38a5e87bf34 Author: Brian Nickel Date: Thu May 31 04:38:18 2007 +0000 2007-05-30 Brian Nickel Redid a lot of the internals of FLAC to make them cleaner. Reverted the change to TagLib.Mpeg4.BoxTypes. The change was safer but slowed things down by 1.7329ms. Perhaps the addition of a superclass, ImmutableByteVector, would help. * src/TagLib/Flac/Picture.cs * src/TagLib/Flac/File.cs * src/TagLib/Flac/BlockHeader.cs * src/TagLib/Flac/Block.cs * src/TagLib/Mpeg4/BoxTypes.cs * docs/en/index.xml * docs/en/TagLib.Flac/Metadata.xml * docs/en/TagLib.Flac/BlockHeader.xml * docs/en/TagLib.Flac/Block.xml * docs/en/TagLib.Mpeg4/BoxTypes.xml: svn path=/trunk/taglib-sharp/; revision=78296 commit 0f13f9425a1cbb030e8bdf295fe4c580adb71eee Merge: 9bb2e24 ca311e4 Author: Brian Nickel Date: Wed May 30 23:47:16 2007 +0000 2007-05-30 Brian Nickel Major API changes. The API has been changed a bunch to accommodate Microsoft naming rules, globalization rules, etc. Hundreds of issues brought to light by FxCop. Nothing like throwing a hundred ArgumentNullExceptions, changing "h" to "Header", "last_absolute_granular_position" to "lastAbsoluteGranularPosition", "StringList" to "StringCollection", etc. Another major change is the dropping of TagLib.File.{Push|Pop|Set|Default}FileAbstractionCreator. Now if you want to create a local file, use TagLib.File.Create (string) and if you want to use a stream, or a VFS, or whatever, use TagLib.File.Create(File.IFileAbstraction). This should save a lot of headache and make things a lot safer and cleaner. Sorry to those of you who were using the old API. I've got a few hundred docs to fill in, but then it's 2.0 RC2. * src/TagLib/Mpc/File.cs * src/TagLib/Mpc/StreamHeader.cs * src/TagLib/Tag.cs * src/TagLib/Picture.cs * src/TagLib/CombinedTag.cs * src/TagLib/CorruptFileException.cs * src/TagLib/File.cs * src/TagLib/UnsupportedFormatException.cs * src/TagLib/TagLib.sources * src/TagLib/ByteVectorList.cs * src/TagLib/Id3v1/Tag.cs * src/TagLib/Id3v1/StringHandler.cs * src/TagLib/Riff/List.cs * src/TagLib/Riff/AviStream.cs * src/TagLib/Riff/File.cs * src/TagLib/Riff/BitmapInfoHeader.cs * src/TagLib/Riff/AviHeaderList.cs * src/TagLib/Riff/DivXTag.cs * src/TagLib/Riff/ListTag.cs * src/TagLib/Riff/InfoTag.cs * src/TagLib/Riff/MovieIdTag.cs * src/TagLib/Riff/WaveFormatEx.cs * src/TagLib/Genres.cs * src/TagLib/Id3v2/Tag.cs * src/TagLib/Id3v2/Footer.cs * src/TagLib/Id3v2/SynchData.cs * src/TagLib/Id3v2/FrameFactory.cs * src/TagLib/Id3v2/FrameHeader.cs * src/TagLib/Id3v2/Header.cs * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs * src/TagLib/Id3v2/Frames/CommentsFrame.cs * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs * src/TagLib/Id3v2/Frames/PrivateFrame.cs * src/TagLib/Id3v2/Frames/MusicCdIdentifierFrame.cs * src/TagLib/Id3v2/Frames/TermsOfUseFrame.cs * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs * src/TagLib/Id3v2/Frames/PlayCountFrame.cs * src/TagLib/Id3v2/Frames/UnknownFrame.cs * src/TagLib/Id3v2/ExtendedHeader.cs * src/TagLib/Id3v2/Frame.cs * src/TagLib/Debugger.cs * src/TagLib/Mpeg/XingHeader.cs * src/TagLib/Mpeg/File.cs * src/TagLib/Mpeg/VideoHeader.cs * src/TagLib/Mpeg/AudioFile.cs * src/TagLib/Mpeg/AudioHeader.cs * src/TagLib/ByteVector.cs * src/TagLib/IntList.cs * src/TagLib/ICodec.cs * src/TagLib/WavPack/File.cs * src/TagLib/WavPack/StreamHeader.cs * src/TagLib/NonContainer/File.cs * src/TagLib/NonContainer/EndTag.cs * src/TagLib/NonContainer/StartTag.cs * src/TagLib/Properties.cs * src/TagLib/SupportedMimeType.cs * src/TagLib/Ape/Tag.cs * src/TagLib/Ape/Footer.cs * src/TagLib/Ape/Item.cs * src/TagLib/Flac/Picture.cs * src/TagLib/Flac/File.cs * src/TagLib/Flac/BlockHeader.cs * src/TagLib/Flac/StreamHeader.cs * src/TagLib/Flac/Block.cs * src/TagLib/StringList.cs * src/TagLib/Asf/Tag.cs * src/TagLib/Asf/File.cs * src/TagLib/Asf/HeaderObject.cs * src/TagLib/Asf/StreamPropertiesObject.cs * src/TagLib/Asf/FilePropertiesObject.cs * src/TagLib/Asf/ContentDescriptionObject.cs * src/TagLib/Asf/Object.cs * src/TagLib/Asf/UnknownObject.cs * src/TagLib/Asf/ContentDescriptor.cs * src/TagLib/ListBase.cs * src/TagLib/Mpeg4/Boxes/FullBox.cs * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs * src/TagLib/Mpeg4/Boxes/IsoSampleTableBox.cs * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs * src/TagLib/Mpeg4/Boxes/AppleAdditionalInfoBox.cs * src/TagLib/Mpeg4/Boxes/IsoFreeSpaceBox.cs * src/TagLib/Mpeg4/Boxes/AppleItemListBox.cs * src/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs * src/TagLib/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs * src/TagLib/Mpeg4/Boxes/AppleDataBox.cs * src/TagLib/Mpeg4/Boxes/AppleAnnotationBox.cs * src/TagLib/Mpeg4/Boxes/UnknownBox.cs * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs * src/TagLib/Mpeg4/Boxes/IsoMetaBox.cs * src/TagLib/Mpeg4/FileParser.cs * src/TagLib/Mpeg4/AppleTag.cs * src/TagLib/Mpeg4/BoxTypes.cs * src/TagLib/Mpeg4/File.cs * src/TagLib/Mpeg4/BoxFactory.cs * src/TagLib/Mpeg4/BoxHeader.cs * src/TagLib/Mpeg4/BoxList.cs * src/TagLib/Mpeg4/Box.cs * src/TagLib/Ogg/XiphComment.cs * src/TagLib/Ogg/Page.cs * src/TagLib/Ogg/Codecs/Theora.cs * src/TagLib/Ogg/Codecs/Vorbis.cs * src/TagLib/Ogg/Codec.cs * src/TagLib/Ogg/File.cs * src/TagLib/Ogg/Paginator.cs * src/TagLib/Ogg/PageHeader.cs * src/TagLib/Ogg/GroupedComment.cs * src/TagLib/Ogg/Bitstream.cs * src/AssemblyInfo.cs.in * src/AssemblyInfo-windows.cs * src/taglib-sharp.mdp * docs/en/TagLib.Riff/BitmapInfoHeader.xml * docs/en/TagLib.Riff/AviHeaderList.xml * docs/en/TagLib.Riff/DivXTag.xml * docs/en/TagLib.Riff/ListTag.xml * docs/en/TagLib.Riff/WaveFormatEx.xml * docs/en/TagLib.Riff/AviStream.xml * docs/en/TagLib.Riff/List.xml * docs/en/TagLib.Riff/File.xml * docs/en/TagLib.Id3v1/StringHandler.xml * docs/en/TagLib.Id3v1/Tag.xml * docs/en/TagLib.Id3v2/UniqueFileIdentifierFrame.xml * docs/en/TagLib.Id3v2/AttachedPictureFrame.xml * docs/en/TagLib.Id3v2/PrivateFrame.xml * docs/en/TagLib.Id3v2/Header.xml * docs/en/TagLib.Id3v2/PlayCountFrame.xml * docs/en/TagLib.Id3v2/Frame.xml * docs/en/TagLib.Id3v2/MusicCdIdentifier.xml * docs/en/TagLib.Id3v2/Footer.xml * docs/en/TagLib.Id3v2/CommentsFrame.xml * docs/en/TagLib.Id3v2/TermsOfUseFrame.xml * docs/en/TagLib.Id3v2/GeneralEncapsulatedObjectFrame.xml * docs/en/TagLib.Id3v2/UserTextIdentificationFrame.xml * docs/en/TagLib.Id3v2/SynchronisedLyricsFrame.xml * docs/en/TagLib.Id3v2/TextIdentificationFrame.xml * docs/en/TagLib.Id3v2/UnknownFrame.xml * docs/en/TagLib.Id3v2/Tag.xml * docs/en/TagLib.Id3v2/UnsynchronisedLyricsFrame.xml * docs/en/TagLib.Id3v2/RelativeVolumeFrame.xml * docs/en/TagLib.Mpeg/Marker.xml * docs/en/TagLib.Mpeg/AudioFile.xml * docs/en/TagLib.Mpeg/Version.xml * docs/en/TagLib.Mpeg/AudioHeader.xml * docs/en/TagLib.Mpeg/XingHeader.xml * docs/en/TagLib.Mpeg/VideoHeader.xml * docs/en/TagLib.Mpeg/File.xml * docs/en/TagLib.WavPack/StreamHeader.xml * docs/en/TagLib.WavPack/File.xml * docs/en/TagLib.NonContainer/File.xml * docs/en/TagLib/UnsupportedFormatException.xml * docs/en/TagLib/Genres.xml * docs/en/TagLib/IntList.xml * docs/en/TagLib/ListBase`1.xml * docs/en/TagLib/SupportedMimeType.xml * docs/en/TagLib/File+LocalFileAbstraction.xml * docs/en/TagLib/ByteVectorCollection.xml * docs/en/TagLib/MediaTypes.xml * docs/en/TagLib/Picture.xml * docs/en/TagLib/File.xml * docs/en/TagLib/ByteVectorList.xml * docs/en/TagLib/StringCollection.xml * docs/en/TagLib/ByteVector.xml * docs/en/TagLib/TagTypes.xml * docs/en/TagLib/StringList.xml * docs/en/TagLib/PictureType.xml * docs/en/TagLib/CorruptFileException.xml * docs/en/TagLib/File+FileTypeResolver.xml * docs/en/index.xml * docs/en/TagLib.Flac/BlockHeader.xml * docs/en/TagLib.Flac/StreamHeader.xml * docs/en/TagLib.Flac/Block.xml * docs/en/TagLib.Flac/BlockType.xml * docs/en/TagLib.Flac/File.xml * docs/en/TagLib.Ape/Tag.xml * docs/en/TagLib.Ape/FooterFlags.xml * docs/en/TagLib.Ape/Footer.xml * docs/en/TagLib.Ape/Item.xml * docs/en/TagLib.MusePack/StreamHeader.xml * docs/en/TagLib.MusePack/File.xml * docs/en/TagLib.Asf/Object.xml * docs/en/TagLib.Asf/ContentDescriptor.xml * docs/en/TagLib.Asf/StreamPropertiesObject.xml * docs/en/TagLib.Asf/HeaderObject.xml * docs/en/TagLib.Asf/File.xml * docs/en/TagLib.Ogg/PageHeader.xml * docs/en/TagLib.Ogg/GroupedComment.xml * docs/en/TagLib.Ogg/Bitstream.xml * docs/en/TagLib.Ogg/XiphComment.xml * docs/en/TagLib.Ogg/Page.xml * docs/en/TagLib.Ogg/Codec.xml * docs/en/TagLib.Ogg/File.xml * docs/en/TagLib.Mpeg4/BoxFactory.xml * docs/en/TagLib.Mpeg4/IsoFreeSpaceBox.xml * docs/en/TagLib.Mpeg4/BoxList.xml * docs/en/TagLib.Mpeg4/AppleItemListBox.xml * docs/en/TagLib.Mpeg4/Box.xml * docs/en/TagLib.Mpeg4/IsoUserDataBox.xml * docs/en/TagLib.Mpeg4/FileParser.xml * docs/en/TagLib.Mpeg4/AppleTag.xml * docs/en/TagLib.Mpeg4/AppleDataBox+FlagTypes.xml * docs/en/TagLib.Mpeg4/IsoAudioSampleEntry.xml * docs/en/TagLib.Mpeg4/BoxHeader.xml * docs/en/TagLib.Mpeg4/IsoHandlerBox.xml * docs/en/TagLib.Mpeg4/IsoVisualSampleEntry.xml * docs/en/TagLib.Mpeg4/AppleElementaryStreamDescriptor.xml * docs/en/TagLib.Mpeg4/IsoChunkOffsetBox.xml * docs/en/TagLib.Mpeg4/AppleDataBox.xml * docs/en/TagLib.Mpeg4/AppleAnnotationBox.xml * docs/en/TagLib.Mpeg4/UnknownBox.xml * docs/en/TagLib.Mpeg4/IsoSampleDescriptionBox.xml * docs/en/TagLib.Mpeg4/IsoMetaBox.xml * docs/en/TagLib.Mpeg4/FullBox.xml * docs/en/TagLib.Mpeg4/AppleDataBox+FlagType.xml * docs/en/TagLib.Mpeg4/IsoMovieHeaderBox.xml * docs/en/TagLib.Mpeg4/IsoSampleTableBox.xml * docs/en/TagLib.Mpeg4/BoxTypes.xml * docs/en/TagLib.Mpeg4/IsoChunkLargeOffsetBox.xml * docs/en/TagLib.Mpeg4/IsoSampleEntry.xml * docs/en/TagLib.Mpeg4/AppleAdditionalInfoBox.xml * docs/en/TagLib.Mpeg4/File.xml * tests/tests.mdp * tests/fixtures/TagLib.CollectionTests/ByteVectorListTest.cs * tests/fixtures/TagLib.CollectionTests/StringListTest.cs * tests/fixtures/TagLib.CollectionTests/ByteVectorCollectionTest.cs * tests/fixtures/TagLib.CollectionTests/StringCollectionTest.cs * tests/fixtures/TagLib.CollectionTests/ByteVectorTest.cs * configure.ac * taglib-sharp.csproj * examples/ReadFromUri.cs * examples/muine-use-taglibsharp.patch: Aye Aye Aye! svn path=/trunk/taglib-sharp/; revision=78279 commit 9bb2e24e3d665c8bb5e258104148765603f650fd Author: Brian Nickel Date: Fri May 25 20:20:09 2007 +0000 2007-05-25 Brian Nickel +-------------+ | VERSON BUMP | | 1.9.99994 | +-------------+ * src/TagLib/TagLib.sources: Remove debugger. * src/TagLib/Mpeg/AudioHeader.cs: Compile on Windows. * docs/en/TagLib.Riff/File.xml: * docs/en/TagLib.Mpeg/AudioFile.xml: * docs/en/TagLib.Mpeg/File.xml: * docs/en/TagLib.WavPack/File.xml: * docs/en/index.xml: * docs/en/TagLib.Flac/File.xml: * docs/en/TagLib.MusePack/File.xml: * docs/en/TagLib.Asf/File.xml: * docs/en/TagLib.Ogg/File.xml: * docs/en/TagLib.Mpeg4/File.xml: Fixed tpos. * docs/Makefile.am: Change target. * configure.ac: Version bump. * taglib-sharp.csproj: Add missing files. svn path=/trunk/taglib-sharp/; revision=77970 commit 0a1d5a196b71588470cc829bd8d91ceae7b35c63 Author: Brian Nickel Date: Fri May 25 11:03:46 2007 +0000 2007-05-25 Brian Nickel There were changes to 153 files in the last three days. I can't vouch for everything that happened, as I may have blacked out for some portions, but tags now have an abstract Tag.TagTypes property, Everything that should be a struct is, there were a bunch of tiny cleanups, "private Flac.File+PictureTag" is now "public Flac.Metadata"... And as of 3:55 AM (Arizona Time), THERE IS NOT ONE FREAKIN' INSTANCE OF "To be added." IN THE ENTIRE docs/en DIRECTORY. I really must love you guys, 'cause that was really, really painful. * src/TagLib/Tag.cs: * src/TagLib/CombinedTag.cs: * src/TagLib/File.cs: * src/TagLib/Id3v1/Tag.cs: * src/TagLib/Riff/AviStream.cs: * src/TagLib/Riff/File.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: * src/TagLib/Id3v2/ExtendedHeader.cs: * src/TagLib/Mpeg/XingHeader.cs: * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/AudioFile.cs: * src/TagLib/Mpeg/AudioHeader.cs: * src/TagLib/NonContainer/Tag.cs: * src/TagLib/NonContainer/File.cs: * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Flac/Picture.cs: * src/TagLib/Flac/File.cs: * src/TagLib/Flac/StreamHeader.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/AppleDataBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxFactory.cs: * src/TagLib/Mpeg4/BoxHeader.cs: * src/TagLib/Mpeg4/BoxList.cs: * src/TagLib/Mpeg4/Box.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/Page.cs: * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/Codecs/Vorbis.cs: * src/TagLib/Ogg/Codec.cs: * src/TagLib/Ogg/File.cs: * src/TagLib/Ogg/Paginator.cs: * src/TagLib/Ogg/GroupedComment.cs: * src/TagLib/Ogg/Bitstream.cs: * src/taglib-sharp.mdp: 53 C# files changed. * docs/en/*: 100 XML files filled in. svn path=/trunk/taglib-sharp/; revision=77938 commit ac6636ace1213b12802e5e72f1ccf16024712c11 Author: Brian Nickel Date: Tue May 22 23:54:32 2007 +0000 2007-05-22 Brian Nickel * src/TagLib/Tag.cs: Make abstract. * src/TagLib/Mpc/File.cs: Make namespace "MusePack". * src/TagLib/Mpc/StreamHeader.cs: Convert to struct. * src/TagLib/File.cs: Store TagTypes as uint. Remove unused read styles. Add File.TagTypes and File.TagTypesOnDisk. Add CloseStream to IFileAbstraction for SilverLight support. * src/TagLib/Riff/File.cs: Add TagTypes. * src/TagLib/ByteVectorList.cs: Remove ToByteVector() * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Footer.cs: * src/TagLib/Id3v2/SynchData.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/FrameHeader.cs: * src/TagLib/Id3v2/Header.cs: * src/TagLib/Id3v2/Frames/PlayCountFrame.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/UnknownFrame.cs: * src/TagLib/Id3v2/Frame.cs: Significant refactoring. Use byte for version. Use enums for header and frame flags. Use string for language. Unsupported frames and frame properties throw NotImplementedException. Added PlayCountFrame. * src/TagLib/Mpeg/XingHeader.cs: Make struct. * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/VideoHeader.cs: Make struct. * src/TagLib/Mpeg/AudioFile.cs: * src/TagLib/Mpeg/AudioHeader.cs: Make struct. * src/TagLib/Debugger.cs: Make internal. * src/TagLib/ByteVector.cs: Clean up constructors. * src/TagLib/IntList.cs: Clean up constructors. * src/TagLib/WavPack/StreamHeader.cs: Convert to struct. * src/TagLib/NonContainer/Tag.cs: Add TagTypes. * src/TagLib/NonContainer/File.cs: Add TagTypes. * src/TagLib/NonContainer/EndTag.cs: Add TagTypes. * src/TagLib/NonContainer/StartTag.cs: Add TagTypes. * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Footer.cs: Make struct. Use enum for flags. * src/TagLib/Flac/File.cs: * src/TagLib/Flac/BlockHeader.cs: Make struct. * src/TagLib/Flac/StreamHeader.cs: Make struct. * src/TagLib/StringList.cs: Clean up constructors. * src/TagLib/FileTypes.cs: Add support for registering types. * src/TagLib/Asf/File.cs: Add TagTypes. * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: * src/TagLib/Asf/FilePropertiesObject.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Asf/Object.cs: * src/TagLib/Asf/Guid.cs: Use System.Guid. * src/TagLib/Asf/ContentDescriptor.cs: Use unsigned types. * src/TagLib/ListBase.cs: Clean up constructors. * src/TagLib/Mpeg4/File.cs: Add TagTypes. * src/TagLib/Ogg/GroupedComment.cs: Add IsEmpty. * src/TagLib/Ogg/File.cs: Add TagTypes. * src/TagLib/Ogg/Page.cs: * src/TagLib/Ogg/Paginator.cs: * src/TagLib/Ogg/Bitstream.cs: * src/TagLib/Ogg/PageHeader.cs: Make PageHeader a struct and add PageFlags. * docs/en/*: Thousands more docs filled out. svn path=/trunk/taglib-sharp/; revision=77818 commit ca311e4c9a676b7e8169eb9f831acfe2eff3ef05 Author: Brian Nickel Date: Sun May 20 10:38:01 2007 +0000 2007-05-20 Brian Nickel * src/TagLib/ByteVector.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: Remove accidental System.Console.WriteLine lines. * src/TagLib/File.cs: Make constructor protected. * src/TagLib/Ogg/File.cs: * src/TagLib/Riff/File.cs: Add File(string) constructor. * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/WaveFormatEx.cs: Tidy up. * src/TagLib/Id3v2/Frame.cs: Parse was redundant. * src/TagLib/Mpeg/AudioHeader.cs: Make stream_length private. * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/Codecs/Vorbis.cs: Make constructors private. * docs/en/TagLib.Mpc/StreamHeader.xml: * docs/en/TagLib.Mpc/File.xml: * docs/en/TagLib.Riff.xml: * docs/en/TagLib.Riff/BitmapInfoHeader.xml: * docs/en/TagLib.Riff/InfoTag.xml: * docs/en/TagLib.Riff/ListTag.xml: * docs/en/TagLib.Riff/AviHeader.xml: * docs/en/TagLib.Riff/MovieIdTag.xml: * docs/en/TagLib.Riff/WaveFormatEx.xml: * docs/en/TagLib.Riff/List.xml: * docs/en/TagLib.Riff/File.xml: * docs/en/TagLib.Id3v2/UniqueFileIdentifierFrame.xml: * docs/en/TagLib.Id3v2/AttachedPictureFrame.xml: * docs/en/TagLib.Id3v2/PrivateFrame.xml: * docs/en/TagLib.Id3v2/Frame.xml: * docs/en/TagLib.Id3v2/CommentsFrame.xml: * docs/en/TagLib.Id3v2/UserTextIdentificationFrame.xml: * docs/en/TagLib.Id3v2/GeneralEncapsulatedObjectFrame.xml: * docs/en/TagLib.Id3v2/SynchronisedLyricsFrame.xml: * docs/en/TagLib.Id3v2/TextIdentificationFrame.xml: * docs/en/TagLib.Id3v2/UnknownFrame.xml: * docs/en/TagLib.Id3v2/UnsynchronisedLyricsFrame.xml: * docs/en/TagLib.Id3v2/RelativeVolumeFrame.xml: * docs/en/TagLib.Mpeg/AudioFile.xml: * docs/en/TagLib.Mpeg/AudioHeader.xml: * docs/en/TagLib.Mpeg/VideoHeader.xml: * docs/en/TagLib.Mpeg/File.xml: * docs/en/TagLib.WavPack/StreamHeader.xml: * docs/en/TagLib.WavPack/File.xml: * docs/en/TagLib.NonContainer/File.xml: * docs/en/TagLib/ICodec.xml: * docs/en/TagLib/Properties.xml: * docs/en/TagLib/IAudioCodec.xml: * docs/en/TagLib/IVideoCodec.xml: * docs/en/TagLib/File.xml: * docs/en/TagLib.Flac/StreamHeader.xml: * docs/en/TagLib.Flac/File.xml: * docs/en/TagLib.Asf/File.xml: * docs/en/TagLib.Ogg.Codecs/Theora.xml: * docs/en/TagLib.Ogg.Codecs/Vorbis.xml: * docs/en/TagLib.Ogg/Codec.xml: * docs/en/TagLib.Ogg/File.xml: * docs/en/TagLib.Mpeg4/IsoAudioSampleEntry.xml: * docs/en/TagLib.Mpeg4/IsoVisualSampleEntry.xml: * docs/en/TagLib.Mpeg4/IsoMovieHeaderBox.xml: * docs/en/TagLib.Mpeg4/File.xml: Filled out some docs, baby. svn path=/trunk/taglib-sharp/; revision=77712 commit 8006975cc50d25c3e256d64b9778c6eb76840231 Author: Brian Nickel Date: Sat May 19 06:39:32 2007 +0000 2007-05-18 Brian Nickel +-------------+ | VERSON BUMP | | 1.9.99993 | +-------------+ * src/TagLib/TagLib.sources: Fixed typo. * src/TagLib/ByteVector.cs: Fix for reading nil-separated UTF-16 strings. Now StringTypeToEncoding assumes the previously used UTF-16 endianness if a BOM is not found. Additionally, Find and RFind now base byte align on distance from the original offset, not offset from start. * src/TagLib/WavPack/File.cs: * src/TagLib/WavPack/StreamHeader.cs: Reformat code. * src/TagLib/NonContainer/StartTag.cs: Make sure APE tags have headers when placed at the front of a file. * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Footer.cs: * src/TagLib/Ape/Item.cs: API changes to improve clarity and functionality. * docs/en/TagLib.Riff/WaveFormatEx.xml: * docs/en/TagLib.WavPack/StreamHeader.xml: * docs/en/TagLib.WavPack/File.xml: * docs/en/TagLib.Ape.xml: * docs/en/TagLib.Ape/ItemType.xml: * docs/en/TagLib.Ape/Tag.xml: * docs/en/TagLib.Ape/Footer.xml: * docs/en/TagLib.Ape/Item.xml: * docs/en/TagLib.Ogg.Codecs/Vorbis.xml: Some solid documentation. TagLib.Ape and TagLib.WavPack namespaces are 100% documented. * docs/Makefile.am: docdir is a bad name, using monodocdir. * configure.ac: Version bump. * taglib-sharp.csproj: Fixed typos. svn path=/trunk/taglib-sharp/; revision=77682 commit 211aa93107e3e49839e40f49a648a696e922107b Author: Brian Nickel Date: Fri May 18 21:52:18 2007 +0000 2007-05-18 Brian Nickel * src/TagLib/File.cs: Reprivatize file_stream. * src/TagLib/Id3v2/Footer.cs: Remove SetData. * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: Don't load compressed or encrypted frames rather than corrupting them. * src/TagLib/Id3v2/FrameHeader.cs: Handle flags properly. * src/TagLib/Id3v2/Header.cs: Remove SetData. * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/UnknownFrame.cs: Tidy up source. * src/TagLib/Id3v2/ExtendedHeader.cs: Replace SetData with constructor. * src/TagLib/Id3v2/Frame.cs: Improve support for frame flags. * src/TagLib/ByteVector.cs: Privitize SetData. * src/TagLib/Asf/Tag.cs: Provide easy access to multi-string descriptors. * src/TagLib/Mpeg4/AppleTag.cs: If AlbumArtists is empty, use Performers. (The aART data box is pretty new and underused.) * docs/en/*: Updated docs. Stripped duplicates. Filled some out. svn path=/trunk/taglib-sharp/; revision=77671 commit 1801717875bb1f8ac8610324224c0c8a121085cb Author: Aaron Bockover Date: Wed May 16 00:28:35 2007 +0000 Fix filename spelling error svn path=/trunk/taglib-sharp/; revision=77447 commit e3e4085b2579a64f68112bc86c125307151cd7c3 Author: Brian Nickel Date: Tue May 15 21:19:18 2007 +0000 2007-05-15 Brian Nickel * src/TagLib/Id3v2/Tag.cs: Fix BPM storage. * src/TagLib/Tag.cs: * src/TagLib/CombinedTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/GroupedComment.cs: Rename BPM to BeatsPerMinute. * examples/ReadFromUri.cs: Push/Pop abstractor. Add new tags to output. svn path=/trunk/taglib-sharp/; revision=77441 commit f8bd361bf79fc32e15fb624881e909121ffd96e0 Author: Brian Nickel Date: Tue May 15 07:46:59 2007 +0000 2007-05-15 Brian Nickel * src/TagLib/Tag.cs: * src/TagLib/CombinedTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Id3v2/Tag.cs * src/TagLib/Ape/Tag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/GroupedComment.cs: Added support for Copyright, BPM, Composer, and Grouping. svn path=/trunk/taglib-sharp/; revision=77393 commit 1621bd2f4bcb7886eea116cfeb273b7ae7c3cd8b Author: Brian Nickel Date: Tue May 15 05:50:19 2007 +0000 2007-05-14 Brian Nickel * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: Include TextType in Get, GetPreferred, and constructors. svn path=/trunk/taglib-sharp/; revision=77389 commit 11d59b0b728dcbc78088cebc0808582bc2f133d2 Author: Brian Nickel Date: Tue May 15 05:25:31 2007 +0000 2007-05-14 Brian Nickel Feature Request: http://forum.taglib-sharp.com/viewtopic.php?f=4&t=12 * src/TagLib/File.cs: Support pushing and poping file abstractors. * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Tag.cs: Be a little bit smarter when storing lyrics and comments. GetPreferred shouldn't be used for storing, because we want to store in exactly what we want, not a best guess. * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/Frames/SynchronizedLyricsFrame.cs: Support synchronized lyrics. * src/TagLib/TagLib.sources: * src/taglib-sharp.mdp: * taglib-sharp.csproj: Added file. svn path=/trunk/taglib-sharp/; revision=77388 commit 1c35339ce18bfe692bd084957935d727456ccfd2 Author: Brian Nickel Date: Thu May 10 21:51:32 2007 +0000 2007-05-10 Brian Nickel * src/TagLib/Mpeg/Properties.cs: * src/TagLib/Asf/Properties.cs: * src/TagLib/Ogg/Properties.cs: * src/TagLib/Ogg/Vorbis/File.cs: * src/TagLib/Ogg/Flac/File.cs: * src/TagLib/Mpeg4/Properties.cs: Deleted. I thought MonoDevelop did this automatically. My bad. svn path=/trunk/taglib-sharp/; revision=77167 commit 8231c1b7d8f99e3b19ff8ecd820f5ad9e8668b19 Author: Brian Nickel Date: Thu May 10 03:21:15 2007 +0000 2007-05-09 Brian Nickel * src/TagLib/Mpeg/AudioFile.cs: Throw a proper CorruptFileException if AudioHeader isn't found. * src/TagLib/File.cs: * src/TagLib/ICodec.cs: Use FlagsAttribute for sexy output. * docs/taglib-sharp-docs.source: * docs/Makefile.am: * docs/MonodocNodeConfig.cs: Doc stuff mysteriously vanished from SVN a while back. Returning. * examples/ReadFromUri.cs: Cleaned up a bit. * examples/ReadFromUri.boo: First boo example. Would have an IronPython one, but I'm having some issues with inheritance. svn path=/trunk/taglib-sharp/; revision=77104 commit dec6901184e786c5e50fb1f350cce4eedfee404c Author: Brian Nickel Date: Wed May 9 17:58:56 2007 +0000 2007-05-09 Brian Nickel +-------------+ | VERSON BUMP | | 1.9.99992 | +-------------+ * src/TagLib/Id3v2/Tag.cs: Use new TextIdentificationFrame.Get * configure.ac: Version bump. svn path=/trunk/taglib-sharp/; revision=77072 commit eb8e3555c05797ad4330e7e348cff509f941ca8f Author: Aaron Bockover Date: Tue May 8 18:17:50 2007 +0000 Removed svn path=/trunk/taglib-sharp/; revision=76955 commit 22ef266a4a8fc1d98e54da8be504cb89afaf68c0 Author: Aaron Bockover Date: Tue May 8 18:16:30 2007 +0000 2007-05-07 Aaron Bockover * src/TagLib/TagLib.sources: Added a separate file to define what sources to build so that applications bundling TagLib don't have to worry about keeping the list in sync - they can just include the file in their build * src/Makefile.am: Include TagLib/TagLib.sources * docs/Makefile.am: Added an empty/stub file to fix the build for now svn path=/trunk/taglib-sharp/; revision=76954 commit dfe9c553fe1bb09b1410b9b30c595e8c33fb3a5b Author: Brian Nickel Date: Mon May 7 09:11:30 2007 +0000 2007-05-07 Brian Nickel * src/TagLib/Riff/File.cs: Add support for WAVE files. Better improve "Read ()" to handle other extensions. (Still pretty ugly.) * src/TagLib/Riff/AviStream.cs: * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/AviHeaderList.cs: * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: De-stupidify. Make WaveFormatEx and BitmapInfoHeader inheric I*Codec and remove excess formats. svn path=/trunk/taglib-sharp/; revision=76811 commit 5d72c831f294e17dfd10747dca4380b97ce4a562 Author: Brian Nickel Date: Mon May 7 03:25:10 2007 +0000 2007-05-04 Brian Nickel * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Added better type checking in "Get" * src/TagLib/ByteVector.cs: Fixed ToStrings align problem from previous revision. * docs/en/*/*.xml: Updated. svn path=/trunk/taglib-sharp/; revision=76805 commit 35595c85aac187b4fd0e3663d4ad4e6316fb0059 Author: Brian Nickel Date: Fri May 4 09:28:34 2007 +0000 2007-05-04 Brian Nickel * src/TagLib/Riff/AviStream.cs: * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/VideoHeader.cs: * src/TagLib/ByteVector.cs: * src/TagLib/WavPack/StreamHeader.cs: * src/TagLib/Ape/Footer.cs: * src/TagLib/Asf/PaddingObject.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: * src/TagLib/Asf/FilePropertiesObject.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: * src/TagLib/Asf/Object.cs: * src/TagLib/Asf/Guid.cs: * src/TagLib/Asf/ContentDescriptor.cs: * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs: * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxHeader.cs: * src/TagLib/Mpeg4/Box.cs: * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/PageHeader.cs: Goodbye, short and long, hello ushort and ulong. This should avoid those pesky OverflowExceptions. svn path=/trunk/taglib-sharp/; revision=76662 commit efa333489ab79f3ca9d5057fdafde428c97d7c5e Merge: ef7278e 50c43d0 Author: Brian Nickel Date: Thu May 3 19:16:40 2007 +0000 2007-05-03 Brian Nickel Revamped TagLib.Properties by making it non-overridable and having it read ICodec, IAudioCodec, and IVideoCodec items. This provides support for reading information strictly from an audio or video stream property, decreasing the abstraction. * src/TagLib/Mpc/File.cs: * src/TagLib/Mpc/StreamHeader.cs: * src/TagLib/File.cs: * src/TagLib/ByteVectorList.cs: * src/TagLib/Riff/List.cs: * src/TagLib/Riff/AviStream.cs: * src/TagLib/Riff/File.cs: * src/TagLib/Riff/BitmapInfoHeader.cs: * src/TagLib/Riff/AviHeaderList.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: * src/TagLib/Riff/WaveFormatEx.cs: * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/VideoHeader.cs: * src/TagLib/Mpeg/AudioFile.cs: * src/TagLib/Mpeg/AudioHeader.cs: * src/TagLib/ICodec.cs: * src/TagLib/WavPack/File.cs: * src/TagLib/WavPack/StreamHeader.cs: * src/TagLib/Properties.cs: * src/TagLib/Flac/File.cs: * src/TagLib/Flac/StreamHeader.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: * src/TagLib/ListBase.cs: * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/Codecs/Vorbis.cs: * src/TagLib/Ogg/Codec.cs: * src/TagLib/Ogg/File.cs: * examples/ReadFromUri.cs: Add support for new ICodec derivatives. * src/TagLib/ByteVector.cs: Fix reading of UTF16 in certain cases. * src/taglib-sharp.mdp: * src/Makefile.am: * taglib-sharp.csproj: New files. * docs/en/*/*.xml: Updated docs. svn path=/trunk/taglib-sharp/; revision=76641 commit ef7278e7ac8544619e423fa14cea88ebe8eb3f6e Author: Brian Nickel Date: Thu Apr 26 09:41:21 2007 +0000 2007-04-26 Brian Nickel * docs/en/*/*.xml: Updated docs. Removed bad files. svn path=/trunk/taglib-sharp/; revision=76304 commit f965e2da293e9d5b756aed6bbe798f6bd4f39fab Author: Brian Nickel Date: Thu Apr 26 09:34:56 2007 +0000 Removing docs temporarily. svn path=/trunk/taglib-sharp/; revision=76302 commit b5eca1f4a46f1a198e7108d14b998413f6228c1d Author: Brian Nickel Date: Wed Apr 25 23:25:33 2007 +0000 2007-04-25 Brian Nickel taglib-sharp-1.9.99991 (2.0 beta 1) * src/TagLib/Riff/List.cs: * src/TagLib/Riff/File.cs: RIFF abhors odd byte counts. * src/TagLib/Asf/Tag.cs: Removed random extra Console.WriteLine. * docs/en/*/*.xml: Synced * configure.ac: Version bump svn path=/trunk/taglib-sharp/; revision=76294 commit 50c43d0fc876694dfc582d3e8b835d6fe7e088b4 Author: Brian Nickel Date: Tue Apr 24 06:54:01 2007 +0000 2007-04-23 Brian Nickel Added support for AVI video files! Revamped the GenreList for video genres. * src/TagLib/File.cs: New tag types. * src/TagLib/Id3v1/Tag.cs: Clean up. * src/TagLib/Riff/List.cs: * src/TagLib/Riff/AviProperties.cs: * src/TagLib/Riff/File.cs: * src/TagLib/Riff/DivXTag.cs: * src/TagLib/Riff/ListTag.cs: * src/TagLib/Riff/InfoTag.cs: * src/TagLib/Riff/MovieIdTag.cs: AVI support! * src/TagLib/Genres.cs: Refactored GenreList. * src/TagLib/Id3v2/Tag.cs: Clean up rendering. * src/TagLib/Id3v2/Frames/UnknownFrame.cs: Expand support. * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: Id3v2 changes. * src/TagLib/FileTypes.cs: Added Riff type. * src/TagLib/Asf/File.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: IEnumerable. * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/AppleTag.cs: Use BoxList and IEnumerable. * src/TagLib/Ogg/File.cs: AccessMode should be Write, not read. * src/taglib-sharp.mdp: * src/Makefile.am: * taglib-sharp.csproj: New files. svn path=/trunk/taglib-sharp/; revision=76161 commit 1a6210a60dbf350488095ea0a234ba9ee808e133 Merge: 545c1a4 e89151f Author: Brian Nickel Date: Wed Apr 18 01:57:51 2007 +0000 2007-04-17 Brian Nickel Added support for MPEG-1/2 video files! Major API changes in TagLib.Mpeg namespace. * src/TagLib/File.cs: Make BufferSize public. * src/TagLib/Id3v2/Tag.cs: Accidentally accounted for footer twice. * src/TagLib/Mpeg/Properties.cs: Support video, refractor code. * src/TagLib/Mpeg/File.cs: Support complete MPEG-1/2 file. * src/TagLib/Mpeg/VideoHeader.cs: Parses the content of a mpeg box. * src/TagLib/Mpeg/AudioFile.cs: Renamed from File.cs as it is simply an implementation of the audio stream rather than a complete file. * src/TagLib/Mpeg/AudioHeader.cs: Renamed from Header.cs * src/TagLib/NonContainer/EndTag.cs: Fix rendering of Id3v1 tags. Fix prioritizing of tags. * src/TagLib/FileTypes.cs: New file type Mpeg.AudioFile * src/Makefile.am: * src/taglib-sharp.mdp: * taglib-sharp.csproj: New files. svn path=/trunk/taglib-sharp/; revision=75856 commit 545c1a48a735d8baf7650e6bc92a469d988aef55 Author: Brian Nickel Date: Mon Apr 16 02:16:12 2007 +0000 2007-04-15 Brian Nickel Added support for MPEG-4 video! * src/TagLib/Tag.cs: * src/TagLib/File.cs: * src/TagLib/Mpeg/XingHeader.cs: * src/TagLib/Properties.cs: Removed obsolete properties and methods. * src/TagLib/Ape/Tag.cs: * src/TagLib/Ape/Footer.cs: * src/TagLib/Ape/Item.cs: Cleaned up formatting a bit. * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoAudioSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/IsoVisualSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/Properties.cs: * src/TagLib/Mpeg4/FileParser.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxFactory.cs: Added visual support. * src/Makefile.am * src/taglib-sharp.mdp * taglib-sharp.csproj: Added new files. * tests/fixtures/TagLib.FormatTests/AsfFormatTest.cs: The test did not represent the field interpretation. svn path=/trunk/taglib-sharp/; revision=75741 commit 7f1c6a59af367729df95412be794af386878db94 Author: Brian Nickel Date: Sun Apr 15 20:57:03 2007 +0000 2007-04-15 Brian Nickel * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: Removed DefaultEncoding stuff from FrameFactory and put it in Tag. Additionally, instead of enforcing the default encoding at read time, it is enforced at render time. It has also been changed so the tags save in the same version they were read in by default. This should avoid the greatest number of problems without the need for developer intervention. * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Replace Find with Get (Tag tag, ..., bool create). This new method will find a specified frame if it exists, and can create it and append it if it doesn't. * src/TagLib/Id3v2/Frame.cs: Enforce ForceDefaultEncoding. * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: All generic. * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/Box.cs: AppleTag wasn't getting attached to .Tag * tests/tests.mdp: Removed ApeFormatTest as it was unsupported. * tests/fixtures/TagLib.FormatTests/FlacFormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3V1FormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3V2FormatTest.cs: * tests/fixtures/TagLib.FormatTests/AsfFormatTest.cs: * tests/fixtures/TagLib.FormatTests/Id3BothFormatTest.cs: * tests/fixtures/TagLib.FormatTests/OggFormatTest.cs: * tests/fixtures/TagLib.FormatTests/MpcFormatTest.cs: * tests/fixtures/TagLib.FormatTests/M4aFormatTest.cs: Updated for new API. * configure.ac: Version bump. svn path=/trunk/taglib-sharp/; revision=75736 commit e89151f9fab8c2b1d1f2160c708319025dc91757 Author: Brian Nickel Date: Mon Apr 9 23:11:58 2007 +0000 2007-04-09 Brian Nickel * src/AssemblyInfo-windows.cs: * configure.ac: * taglib-sharp.csproj: Apply version bump. Now 1.9.* svn path=/trunk/taglib-sharp/; revision=75556 commit 6728903ef66fa53592b1cb9f993fd97cc66217a6 Merge: 4183fba e7de1a7 Author: Brian Nickel Date: Fri Apr 6 09:54:26 2007 +0000 2007-04-06 Brian Nickel MAJOR API CHANGES! COMPLETE NEW OGG BACKEND! VIDEO SUPPORT IN OGG AND ASF! * src/TagLib/Mpc/Properties.cs: * src/TagLib/Mpc/File.cs: Support new "Properties". * src/TagLib/File.cs: Support new "Properties". * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: Better error handling. * src/TagLib/Mpeg/Properties.cs: Support new "Properties". * src/TagLib/Mpeg/XingHeader.cs: Mark IsValid as obsolete. * src/TagLib/Mpeg/File.cs: * src/TagLib/WavPack/Properties.cs: * src/TagLib/WavPack/File.cs: Support new "Properties". * src/TagLib/NonContainer/File.cs: Support new "Properties". * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: Better error handling. * src/TagLib/Properties.cs: Abolish overly specific "AudioProperties" * src/TagLib/Ape/Item.cs: Replace Debugger with Exception * src/TagLib/Flac/Properties.cs: * src/TagLib/Flac/File.cs: Support new "Properties". * src/TagLib/FileTypes.cs: Remove dead file types. * src/TagLib/Asf/Tag.cs: Allow tag clearing. * src/TagLib/Asf/Properties.cs: * src/TagLib/Asf/File.cs: Support new "Properties". Support video. * src/TagLib/Asf/Guid.cs: Fix typo in GUID plain text. * src/TagLib/Mpeg4/Properties.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/File.cs: Move saving out of the AppleTag. Will allow future implimentation of ID3v2 boxes. * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/Page.cs: * src/TagLib/Ogg/Codecs/Theora.cs: * src/TagLib/Ogg/Codecs/Vorbis.cs: * src/TagLib/Ogg/Properties.cs: * src/TagLib/Ogg/Codec.cs: * src/TagLib/Ogg/File.cs: * src/TagLib/Ogg/Paginator.cs: * src/TagLib/Ogg/PageHeader.cs: * src/TagLib/Ogg/GroupedComment.cs: * src/TagLib/Ogg/Bitstream.cs: Recoded for multistream files. * src/Makefile.am: * src/taglib-sharp.mdp: Updated for new files. * docs/en/*: Updated docs to new API. * examples/ReadFromUri.cs: Added video support. svn path=/trunk/taglib-sharp/; revision=75474 commit 4183fbac47082a49488a4d24369525b27c631fb9 Author: Brian Nickel Date: Fri Mar 23 21:56:30 2007 +0000 2007-03-23 Brian Nickel * src/TagLib/File.cs: Don't catch exceptions on mode change. * src/TagLib/Id3v1/Tag.cs: Use TryParse rather than try{Parse}. * src/TagLib/Id3v2/Tag.cs: Remove "0" values rather than storing "0". Use TryParse rather than try{Parse}. * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Use TryParse rather than try{Parse}. * src/TagLib/Ape/Tag.cs: Remove "0" values rather than storing "0". Use TryParse rather than try{Parse}. * src/TagLib/Asf/Tag.cs: Remove "0" values rather than storing "0". Use TryParse rather than try{Parse}. * src/TagLib/Asf/ContentDescriptor.cs: Use TryParse rather than try{Parse}. * src/TagLib/Mpeg4/AppleTag.cs: Use TryParse rather than try{Parse}. * src/TagLib/Ogg/XiphComment.cs: Remove "0" values rather than storing "0". Use TryParse rather than try{Parse}. * src/TagLib/Ogg/Vorbis/File.cs: Don't catch exceptions on mode change. svn path=/trunk/taglib-sharp/; revision=74925 commit 2fa8af7af3c6de35cb9e1ce913bbf326bdaecedb Author: Brian Nickel Date: Fri Mar 23 00:12:55 2007 +0000 2007-03-22 Brian Nickel * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Remove null termination in ID3v2.3 and below. * src/TagLib/WavPack/File.cs: * src/TagLib/Mpc/File.cs: * src/TagLib/Mpeg/File.cs: Include sane default tags. * docs/en/*: Synched docs. svn path=/trunk/taglib-sharp/; revision=74861 commit a19253ce77d06f7a4681faf5cefa16d6b7b02e45 Author: Brian Nickel Date: Wed Mar 14 21:23:42 2007 +0000 2007-03-14 Brian Nickel * docs/en/*: Synced docs. svn path=/trunk/taglib-sharp/; revision=74308 commit e7de1a714ef4336295c85bb0ca0e73b96c4a6b47 Author: Brian Nickel Date: Wed Mar 14 07:15:31 2007 +0000 2007-03-13 Brian Nickel Lyrics support! Fixed write support in MPEG-4 and ASF. * src/TagLib/Tag.cs: * src/TagLib/CombinedTag.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/Frames/UnsynchronisedLyricsFrame.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxTypes.cs: * src/TagLib/Mpeg4/Box.cs: * src/TagLib/Ogg/XiphComment.cs: Lyrics support. Special thanks to Patrick Laplante. * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/ByteVector.cs: Fix up UTF16 handling. * src/TagLib/Asf/HeaderObject.cs: Fix writing. Wasn't writing header GUID! * src/Makefile.am: * src/taglib-sharp.mdp: * taglib-sharp.csproj: Update project files. * examples/BatchSet.cs: * examples/ReadFromUri.cs: Support lyrics. svn path=/trunk/taglib-sharp/; revision=74237 commit f294436840eb53c3d2b28b7d62373af83cba478b Merge: 720db6c 50d6746 Author: Brian Nickel Date: Wed Mar 14 02:13:29 2007 +0000 2007-03-13 Brian Nickel Performance enhancement for MPEG-4 files. Stole an idea from Entagged#. * src/TagLib/Mpeg4/FileParser.cs: ADDED * src/TagLib/Mpeg4/BoxTypes.cs: ADDED * src/TagLib/Mpeg4/BoxFactory.cs: ADDED * src/TagLib/Mpeg4/BoxList.cs: ADDED * src/TagLib/Mpeg4/Box.cs: ADDED * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleTableBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/AppleAdditionalInfoBox.cs: * src/TagLib/Mpeg4/Boxes/IsoFreeSpaceBox.cs: * src/TagLib/Mpeg4/Boxes/AppleItemListBox.cs: * src/TagLib/Mpeg4/Boxes/IsoUserDataBox.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Mpeg4/Boxes/AppleElementaryStreamDescriptor.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/AppleDataBox.cs: * src/TagLib/Mpeg4/Boxes/AppleAnnotationBox.cs: * src/TagLib/Mpeg4/Boxes/UnknownBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMetaBox.cs: * src/TagLib/Mpeg4/Properties.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Mpeg4/BoxHeader.cs: Adapted to new parser. * src/TagLib/Mpeg4/Boxes/IsoTrackBox.cs: DELETED * src/TagLib/Mpeg4/Boxes/Box.cs: DELETED * src/TagLib/Mpeg4/Boxes/FileBox.cs: DELETED * src/TagLib/Mpeg4/Boxes/IsoMovieBox.cs: DELETED * src/TagLib/Mpeg4/Boxes/IsoMediaBox.cs: DELETED * src/TagLib/Mpeg4/Boxes/IsoMediaInformationBox.cs: DELETED * src/TagLib/File.cs: Make ReadBlock make a a little more sense. * src/TagLib/Id3v2/Tag.cs: Support tag-wide unsynchronization. * src/TagLib/Id3v2/SynchData.cs: Add support for unsynching a bytevector. * src/TagLib/Id3v2/FrameHeader.cs: We don't actually support frame tags. Don't pretend that we do. * src/TagLib/Debugger.cs: Fix typo and crasher in code timer. * src/TagLib/ByteVector.cs: Make Mid a little faster. * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: End tags should be at least version 4 * src/Makefile.am: * src/taglib-sharp.mdp: * taglib-sharp.csproj: Update for new files. svn path=/trunk/taglib-sharp/; revision=74224 commit 720db6c2ce8a78239a0bb0733d8506106ba3b097 Author: Brian Nickel Date: Fri Mar 9 18:13:38 2007 +0000 2007-03-09 Brian Nickel * configure.ac: Fixed version information. svn path=/trunk/taglib-sharp/; revision=74020 commit 5e0401e40accf5da245ce7f8359f2ad05b00016b Author: Brian Nickel Date: Fri Mar 9 11:29:53 2007 +0000 2007-03-09 Brian Nickel "I do not regret the things I've done, but those I did not do." * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/FrameHeader.cs: * src/TagLib/Id3v2/Header.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/UnknownFrame.cs: * src/TagLib/Id3v2/Frame.cs: Reworked reading/writing code to better support writing Id3v2.2 and Id2v2.3. This is the first go at it, and there is room for cleanup in the code, but it works, and it works and it works well. svn path=/trunk/taglib-sharp/; revision=73998 commit 50d67469ce05d4ce7d17fce881439cc02508f0e8 Author: Brian Nickel Date: Fri Mar 9 01:54:47 2007 +0000 2007-03-08 Brian Nickel * src/TagLib/Mpc/File.cs: Inherit NonContainer.File * src/TagLib/CombinedTag.cs: Add some useful features for NonContainer.* * src/TagLib/Id3v1/Tag.cs: Add Tag.Size instead of repeated hardcoding of 128. * src/TagLib/Id3v2/Footer.cs: * src/TagLib/Id3v2/Header.cs: Throw proper CorruptFileExceptions * src/TagLib/Mpeg/File.cs: Inherit NonContainer.File * src/TagLib/WavPack/File.cs: Inherit NonContainer.File * src/TagLib/NonContainer: * src/TagLib/NonContainer/Tag.cs: * src/TagLib/NonContainer/File.cs: * src/TagLib/NonContainer/EndTag.cs: * src/TagLib/NonContainer/StartTag.cs: New generic abstracts for files that can start/end with an assortment of tags. (FLAC, WV, MPC, MP3) * src/TagLib/Ape/Tag.cs: Read backwards if a footer is found and forwards if a header is found. * src/TagLib/Ape/Footer.cs: FooterPresent and IsHeader were read incorrectly. Also throw proper exceptions while reading. * src/TagLib/Flac/File.cs: Inherit NonContainer.File * src/TagLib/Flac/BlockHeader.cs: * src/TagLib/Flac/Block.cs: Removed from Flac.File, made public. * src/TagLib/Mpeg4/File.cs: Remove old commented code. * src/Makefile.am: * src/taglib-sharp.csproj: * src/taglib-sharp.mdp: * taglib-sharp.mds: * tests/tests.mdp: * examples/SetPictures.mdp: * examples/ReadFromUri.mdp: Updates. svn path=/trunk/taglib-sharp/; revision=73980 commit 638a8773ef6babb4207fc17129b95da3c27d9c89 Author: Brian Nickel Date: Mon Mar 5 00:59:31 2007 +0000 2007-03-04 Brian Nickel * src/TagLib/File.cs: We don't use file.file_types. Comment it out to avoid the warning. * src/TagLib/Tag.cs: * src/TagLib/Id3v1/Tag.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Debugger.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Ogg/XiphComment.cs: * docs/MonodocNodeConfig.cs: * tests/fixtures/TagLib.CollectionTests/StringListTest.cs: * tests/fixtures/TagLib.CollectionTests/IntListTest.cs: * examples/ReadFromUri.cs: Use string.Empty instead of "". * src/TagLib/Id3v2/Frames/CommentsFrame.cs: Support broken COMM frames that don't contain a comment description string. svn path=/trunk/taglib-sharp/; revision=73697 commit 7edb701b614ced81d2cee17180197efb2e88c32c Author: Brian Nickel Date: Wed Feb 21 20:17:39 2007 +0000 2007-02-12 Brian Nickel * src/TagLib/File.cs: Added support for read sharing in ReadStream. This should eliminate a problem in Windows where files couldn't be read while they were playing. Solution by Ion Todirel. * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: Strip all empty strings from the end of the FieldList. This should fix strings that were badly tagged, with either a nil character or the sum total of the ID3v1 string attached. May fix banshee bug #410116. * tests/Makefile.am: Removed line blocking distcheck svn path=/trunk/taglib-sharp/; revision=73276 commit 815bd6d7ac68b1629fd0be0b86194205fe2ef1cb Author: Brian Nickel Date: Tue Feb 13 03:56:10 2007 +0000 2007-02-12 Brian Nickel * src/TagLib/ByteVector.cs: Fix support for Latin1. * taglib-sharp.csproj: Work on Windows. svn path=/trunk/taglib-sharp/; revision=72728 commit 8756a473fa6c667fc55bfdf56b9eacab54c39b99 Author: Brian Nickel Date: Mon Feb 12 20:07:50 2007 +0000 2007-02-12 Brian Nickel * src/TagLib/File.cs: Remove ReadOnly checking. This is to add compatability with the .NET Compact Framework and to remove some ugly code. Libraries using TagLib# should check file writability for themselves if they want the writable status before Save() is called. Also use more compatable Array.Copy(). * src/TagLib/Mpeg/File.cs: Comment out unused method. * src/TagLib/ByteVector.cs: Use more compatable Array.Copy() * src/TagLib/ReadOnlyException.cs: Removed because unused. * src/AssemblyInfo.cs.in: Update copyright. * src/AssemblyInfo-windows.cs: Update version and copyright. * src/Makefile.am: * src/taglib-sharp.mdp: * taglib-sharp.csproj: Update files. svn path=/trunk/taglib-sharp/; revision=72686 commit 3d0a431324e1913d77e79835a120b7f35b7b2b18 Author: Brian Nickel Date: Mon Feb 12 01:10:41 2007 +0000 2007-02-10 Brian Nickel * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Id3v2/Frames/CommentsFrame.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/Id3v2/Frames/UniqueFileIdentifierFrame.cs: * src/TagLib/Id3v2/Frames/PrivateFrame.cs: * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Id3v2/Frames/UnknownFrame.cs: * src/TagLib/Id3v2/Frame.cs: * src/TagLib/ByteVector.cs: VASTLY improved the loading of ID3v2 tags by breaking API compatability. (This isn't a major concern at the moment.) Removed a major piece of code which was causing about 80% of the read time. * src/TagLib/Debugger.cs: Added new way to test for slow code blocks. svn path=/trunk/taglib-sharp/; revision=72636 commit 316a7c6ca649172d5c4056462b57b0de5f0ddb0e Author: Brian Nickel Date: Sat Feb 10 19:09:52 2007 +0000 2007-02-10 Brian Nickel * src/TagLib/Mpeg/File.cs: Fix bug introduced on 2007-01-26. If a file lacked an Id3v2 tag, TagLib read the whole file. Initial analysis shows this being marginally faster than the even older version. * src/TagLib/Id3v2/Frames/RelativeVolumeFrame.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Ogg/XiphComment.cs: * src/TagLib/Ogg/File.cs: Abolish Hashtable. ArrayList is next. svn path=/trunk/taglib-sharp/; revision=72582 commit 46b8662f783314ca5821473484137f04eb93c6cc Author: Brian Nickel Date: Mon Jan 29 19:41:33 2007 +0000 2007-01-29 Brian Nickel * examples/ReadFromUri.cs: Remove accidental commenting out. svn path=/trunk/taglib-sharp/; revision=71907 commit 745e88d2b9f894d23ef22f285fafe10c285c9f42 Author: Brian Nickel Date: Sat Jan 27 06:11:01 2007 +0000 2007-01-26 Brian Nickel CLEANUPS! For the most part, internal code has been cleaned up to be less hackish. One major feature is the obsoleting of SetValid and IsValid. If a file is invalid, it will now throw a CorruptFileException. * src/TagLib/Mpc/Properties.cs: * src/TagLib/Mpc/File.cs: Better search functions. * src/TagLib/File.cs: Clean out and Obsolete bad code. * src/TagLib/Id3v1/Tag.cs: Cleaner functions. * src/TagLib/Mpeg/Properties.cs: * src/TagLib/Mpeg/XingHeader.cs: * src/TagLib/Mpeg/File.cs: * src/TagLib/Mpeg/Header.cs: Better search functions, calculations, and exceptions. * src/TagLib/WavPack/Properties.cs: * src/TagLib/WavPack/File.cs: Use better search functions. * src/TagLib/Ape/Footer.cs: Throw better exception. * src/TagLib/Flac/File.cs: Fix padding calculation. * src/TagLib/Asf/PaddingObject.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/FilePropertiesObject.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: Throw better exceptions. * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/Boxes/IsoMovieHeaderBox.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleEntry.cs: * src/TagLib/Mpeg4/Boxes/FileBox.cs: * src/TagLib/Mpeg4/Boxes/Box.cs: * src/TagLib/Mpeg4/Boxes/IsoSampleDescriptionBox.cs: * src/TagLib/Mpeg4/File.cs: Read bigger blocks and less often. * src/TagLib/Ogg/XiphComment.cs: Support "XX/XX" values in Track and Disc. * src/TagLib/Ogg/File.cs: * src/TagLib/Ogg/Vorbis/Properties.cs: * src/TagLib/Ogg/Vorbis/File.cs: * src/TagLib/Ogg/Flac/File.cs: Obsolete Set/IsValid and throw useful exceptions. * docs/en/TagLib.Id3v1/Tag.xml: * docs/en/TagLib.Id3v2/FrameFactory.xml: * docs/en/TagLib.Mpeg/Header.xml: * docs/en/TagLib.Mpeg/Properties.xml: * docs/en/TagLib.Mpeg/File.xml: * docs/en/TagLib/UnsupportedFormatException.xml: * docs/en/TagLib/ByteVector.xml: * docs/en/TagLib/ReadOnlyException.xml: * docs/en/TagLib/SupportedMimeType.xml: * docs/en/TagLib/AudioProperties.xml: * docs/en/TagLib/File.xml: * docs/en/index.xml: * docs/en/TagLib.Asf/FilePropertiesObject.xml: * docs/en/TagLib.Asf/StreamPropertiesObject.xml: * docs/en/TagLib.Mpeg4/Box.xml: * docs/en/TagLib.Mpeg4/Properties.xml: * docs/en/TagLib.Mpeg4/IsoMovieHeaderBox.xml: * docs/en/TagLib.Mpeg4/File.xml: Doc updates. * examples/ReadFromUri.cs: Add timer, clean output, and avoid crash. svn path=/trunk/taglib-sharp/; revision=71776 commit 3d6a2ae571c6d109d0e9ee1815cb5adddac694c6 Author: Brian Nickel Date: Mon Jan 8 06:10:51 2007 +0000 2007-01-07 Brian Nickel * src/TagLib/File.cs: Throw ReadOnlyException when it makes sense. * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: Fix for UTF16. * src/TagLib/Id3v2/Frames/GeneralEncapsulatedObjectFrame.cs: * src/TagLib/Id3v2/FrameFactory.cs: * src/TagLib/Id3v1/Tag.cs: * src/TagLib/Id3v2/Frames/TextIdentificationFrame.cs: * src/TagLib/Mpeg/XingHeader.cs: * src/TagLib/Mpeg/Header.cs: Improvements from TagLib. * src/TagLib/Flac/Picture.cs: * src/TagLib/Flac/File.cs: Massive code rewrite. Added support for Picture Block. * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: Fix typo. * src/Makefile.am: Add new files. * examples/ReadFromUri.cs: Update for changes in TagLib.Tag svn path=/trunk/taglib-sharp/; revision=70624 commit ec64c4c5a5d703015c47f374e8fa07de824ca1ab Author: Miguel de Icaza Date: Sun Dec 31 21:21:07 2006 +0000 Ran through the Monodoc updater, and exclude compiler generated types svn path=/trunk/taglib-sharp/; revision=70295 commit 40e8172b550e081a5279855a26a3caa8a6d88f06 Author: Aaron Bockover Date: Tue Dec 26 23:28:45 2006 +0000 2006-12-26 Aaron Bockover * src/TagLib/CorruptFileException.cs: Added new exception * src/TagLib/Mpeg4/File.cs: * src/TagLib/Ogg/Vorbis/File.cs: Guard against nullrefs, if necessary parts are null, throw a CorruptFileException instead to avoid seg violation * tests/fixtures/TagLib.FormatTests/IFormatTest.cs: Added interface for the format test * tests/fixtures/TagLib.FormatTests/*.cs: Implement IFormatTest, added TestCorruptionResistance * tests/samples/corrupt/*: Added some 'corrupt' samples svn path=/trunk/taglib-sharp/; revision=70098 commit 47a28d7d84a4a070ff8f52a66de345927d5de489 Author: Brian Nickel Date: Fri Dec 15 16:51:10 2006 +0000 2006-12-15 Brian Nickel * src/TagLib/Mpeg/Properties.cs: * src/TagLib/Mpeg/Header.cs: Made some changes based on KDE bug 135459, which should hopefully improve the accuracy of length reporting. svn path=/trunk/taglib-sharp/; revision=69535 commit 37f793eeeec12ac5c8f75bcd370bac0a7a1e9804 Author: Brian Nickel Date: Thu Dec 14 20:44:42 2006 +0000 2006-12-14 Brian Nickel * src/TagLib/Mpeg/Header.cs: Fixed typo causing MP3 channels to always equal 1. svn path=/trunk/taglib-sharp/; revision=69510 commit b684f5efafcc62372b175ff517d50c278ca9dbe1 Author: Aaron Bockover Date: Tue Nov 14 05:04:04 2006 +0000 2006-11-13 Aaron Bockover * src/TagLib/SupportedMimeType.cs: Load mime types in static constructor * src/TagLib/FileTypes.cs: File type loader that initializes the SupportedMimeType support * src/TagLib/File.cs: Use FileTypes.AvailableTypes * src/Makefile.am: Added src/TagLib/FileTypes.cs svn path=/trunk/taglib-sharp/; revision=67813 commit b4024f8550657e7dffbac1b9a736b7b76c086228 Author: Brian Nickel Date: Mon Nov 6 20:15:19 2006 +0000 2006-11-06 Brian Nickel * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/FrameHeader.cs: * src/TagLib/Id3v2/Frame.cs: * src/TagLib/ByteVector.cs: * src/TagLib/Ape/Tag.cs: * src/TagLib/Flac/File.cs: * src/TagLib/Asf/Tag.cs: * src/TagLib/Asf/HeaderObject.cs: * src/TagLib/Asf/StreamPropertiesObject.cs: * src/TagLib/Asf/FilePropertiesObject.cs: * src/TagLib/Asf/ContentDescriptionObject.cs: * src/TagLib/Asf/ExtendedContentDescriptionObject.cs: * src/TagLib/Asf/Object.cs: * src/TagLib/Asf/Guid.cs: * src/TagLib/Asf/ContentDescriptor.cs: * src/TagLib/Mpeg4/Boxes/FullBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/Box.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/BoxHeader.cs: Improve performance by not using plus operator so much. Less allocations. * tests/fixtures/TagLib.FormatTests/Id3BothFormatTest.cs: Fixed multiformat tests. Removed Tag Count test. svn path=/trunk/taglib-sharp/; revision=67413 commit 34d49ce11c840b8b90abcd73b424943b17e47baa Author: Brian Nickel Date: Sat Nov 4 00:21:47 2006 +0000 2006-11-03 Brian Nickel * src/TagLib/ByteVector.cs: Use Boyer-Moore String Searching Algorithm to speed things up a little. (Very little.) svn path=/trunk/taglib-sharp/; revision=67335 commit 503227407e544c3d58c5ffb4afa88ad73f026fbe Author: Aaron Bockover Date: Tue Oct 31 02:17:59 2006 +0000 2006-10-30 Aaron Bockover * src/TagLib/IntList.cs: * src/TagLib/ByteVector.cs: * src/TagLib/StringList.cs: * src/TagLib/ByteVectorList.cs: Use generics, refactored code, massive optimizations; all collections except ByteVector derives new ListBase * src/TagLib/ListBase.cs: New generic base collection * src/Makefile.am: Updated * tests/fixtures/PerformanceTest.cs: Updated svn path=/trunk/taglib-sharp/; revision=67170 commit 342ba48b943df40d1fdbacb6f0e9388cb0d33e8e Author: Brian Nickel Date: Tue Oct 31 00:04:23 2006 +0000 2006-10-20 Brian Nickel * src/TagLib/Mpc/Properties.cs: Fix property reading. * src/TagLib/Mpc/File.cs: Fix total brokenness. * src/TagLib/Mpeg/File.cs: Fix reading with no ID3v2 Tag. * src/TagLib/Mpeg4/AppleTag.cs: Fix reading of ID3v1 Genres. * tests/fixtures/TagLib.FormatTests/MpcFormatTest.cs: Fixed test. (I think.) svn path=/trunk/taglib-sharp/; revision=67165 commit 63599534be2ed6e644bea1706c887c660e19a718 Author: Aaron Bockover Date: Sun Oct 29 20:33:01 2006 +0000 Updated svn path=/trunk/taglib-sharp/; revision=67109 commit 764ea91e974856e2c8661019df9ee7ed7c8695d2 Author: Aaron Bockover Date: Sun Oct 29 20:31:02 2006 +0000 2006-10-29 Aaron Bockover * tests/: Added more tests (IntList, StringList), restructured layout svn path=/trunk/taglib-sharp/; revision=67108 commit fb2068e7b1366a1bd18fb47ed2ec8535a5f79b6d Author: Aaron Bockover Date: Sun Oct 29 20:13:34 2006 +0000 Updated header svn path=/trunk/taglib-sharp/; revision=67104 commit 64de9fb6c4ad4d1603d6ae357e69e59a1e5c79d7 Author: Aaron Bockover Date: Sun Oct 29 16:52:30 2006 +0000 2006-10-29 Aaron Bockover * src/TagLib/File.cs: Do not use reflection (Assembly.GetTypes) to find file formats, instead use a static type table. Assembly.GetTypes leaks types on the heap that will never be GCed (saves about 200KB of heap); this means that if a new type is added, it must be entered in the static type table for it to be available. Also this improves startup time. * src/TagLib/Asf/Properties.cs: Suppress unused variable warning svn path=/trunk/taglib-sharp/; revision=67099 commit 63e440b62f8d11a35d2323de13c563793869828b Author: Aaron Bockover Date: Sun Oct 29 16:46:18 2006 +0000 2006-10-29 Aaron Bockover * tests/samples: Organized into supported and unsupported formats, added vector.bin as data for a checksum test of ByteVector * tests/Makefile.am: Set up NUnit console test driver, can be run with 'make run-test' * tests/AssemblyInfo.cs: * tests/ConsoleUi.cs: NUnit console test driver * tests/CodeTimer.cs: Timing utility * tests/fixtures/*FormatTest.cs: File format reading test fixtures * tests/fixtures/ByteVectorTests.cs: Extensive tests for ByteVector * tests/tests.mdp: MonoDevelop project for tests that allows running NUnit tests with in the IDE for graphical results, recommended for running tests as history is logged here (preferred over 'make run-test') * configure.ac: NUnit detection, optional * examples/tangerine-use-taglibsharp.patch: Removed, tangerine now uses taglib-sharp instead of entagged-sharp * examples/Makefile.am: * examples/ListSupportedMimeTypes.cs: New example * taglib-sharp.mds: Restored MonoDevelop solution svn path=/trunk/taglib-sharp/; revision=67098 commit a387cfa83f5b0122408d9e77df076c5712d333b1 Author: Brian Nickel Date: Fri Oct 20 22:08:05 2006 +0000 2006-10-20 Brian Nickel * src/TagLib/File.cs: Include the name of the file throwing the exception in LocalFileAbstraction. * src/TagLib/Mpeg/Header.cs: Make frame length logic match Lame (from TagLib Devel List). * examples/ReadFromUri.cs: Read multiple files. svn path=/trunk/taglib-sharp/; revision=66851 commit 7c65b1e3359c80ae3e00f165a9457c7fa3725b42 Author: Brian Nickel Date: Thu Oct 12 19:45:23 2006 +0000 2006-10-12 Brian Nickel * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: * src/TagLib/Mpeg4/AppleTag.cs: Fixed a bug where changing tag size would devalidate offsets for data before the tag. * examples/BatchSet.cs: * examples/Makefile.am: Add a simple program to update tags on multiple files. svn path=/trunk/taglib-sharp/; revision=66637 commit 4968b78314405e4b878faf0a9d5b47a771714e48 Author: Aaron Bockover Date: Sun Oct 8 16:32:19 2006 +0000 Marked as static, whoops svn path=/trunk/taglib-sharp/; revision=66417 commit 026beee347579dc34c26e516125f96ff052e01f5 Author: Aaron Bockover Date: Sun Oct 8 16:31:27 2006 +0000 Marked as static, whoops svn path=/trunk/taglib-sharp/; revision=66416 commit 127da072a6b41f50bb93fdddbbab6ba20bd1c4fa Author: Aaron Bockover Date: Sun Oct 8 16:30:59 2006 +0000 Marked as static, whoops svn path=/trunk/taglib-sharp/; revision=66415 commit 7f2a0783af2cbec5e268214e61ee64c59734da68 Author: Aaron Bockover Date: Sun Oct 8 16:12:14 2006 +0000 2006-10-08 Aaron Bockover * src/TagLib/SupportedMimeType.cs: Added extension support svn path=/trunk/taglib-sharp/; revision=66413 commit 6b20faff04a2c0689dc5ac4c7b0b2c8bcc46f263 Author: Aaron Bockover Date: Sun Oct 8 15:54:08 2006 +0000 2006-10-08 Aaron Bockover * src/TagLib/SupportedMimeType.cs: Added AllMimeTypes static enumerator svn path=/trunk/taglib-sharp/; revision=66411 commit 987e2f6423e6299e3f99a7ba2385f7d7889faec5 Author: Brian Nickel Date: Mon Sep 25 19:38:15 2006 +0000 2006-09-25 Brian Nickel * src/TagLib/CombinedTag.cs: Fixed a bug in CombinedTag.get_Pictures * configure.ac: Don't break the gac on binary compatable versions. svn path=/trunk/taglib-sharp/; revision=65890 commit 38c1059d8556f642d33c5f90726b6d062a4efdaf Author: Brian Nickel Date: Wed Sep 20 19:49:25 2006 +0000 2006-09-20 Brian Nickel * src/TagLib/Mpc/File.cs: Added mime types. * src/TagLib/Wavpack/File.cs: Added mime types. svn path=/trunk/taglib-sharp/; revision=65739 commit 32df28a7eb4dd136b60ec5f1e0289eca88a9bde8 Author: Brian Nickel Date: Wed Sep 20 19:23:29 2006 +0000 2006-09-20 Brian Nickel * src/TagLib/ByteVector.cs: Fixed big endian StringType.UTF16 not to fail on big endian. (Confusing naming scheme by Microsoft.) svn path=/trunk/taglib-sharp/; revision=65737 commit dfc58a4e6b53aca6e7b4c6b000f53703bf9d10e4 Author: Brian Nickel Date: Sun Sep 17 23:51:09 2006 +0000 2006-09-17 Brian Nickel * src/TagLib/Asf/Tag.cs: Added generic picture support. * docs/en/*: Updated docs. svn path=/trunk/taglib-sharp/; revision=65556 commit 41b7226a730f12a5852ca0507ab4e7dcff1fcc23 Author: Brian Nickel Date: Fri Sep 15 09:15:08 2006 +0000 2006-09-15 Brian Nickel * src/TagLib/Picture.cs: * src/TagLib/Tag.cs: * src/TagLib/CombinedTag.cs: * src/TagLib/File.cs: * src/TagLib/Id3v2/Tag.cs: * src/TagLib/Id3v2/Frames/AttachedPictureFrame.cs: * src/TagLib/ByteVector.cs: * src/TagLib/Mpeg4/Boxes/Box.cs: * src/TagLib/Mpeg4/Boxes/IsoHandlerBox.cs: * src/TagLib/Mpeg4/Boxes/AppleDataBox.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Ogg/XiphComment.cs: Add generic picture support to TagLib#. This currently supports MP3 and M4A tags although support can and will be added for other tag types in the future. * src/Makefile.am: * taglib-sharp.mds: * taglib-sharp.csproj: * examples/ReadFromUri.cs: * examples/Makefile.am: * examples/SetPictures.mdp: * examples/SetPictures.cs: * examples/ReadFromUri.mdp: New examples from Aaron Bockover. * src/TagLib/Mpeg4/Boxes/IsoChunkLargeOffsetBox.cs: * src/TagLib/Mpeg4/Boxes/IsoChunkOffsetBox.cs: Eliminate a nasty bug where changes to 'mdat' offsets, ie. any file size change, broke MP4 files. svn path=/trunk/taglib-sharp/; revision=65440 commit 958b10a1f238c8dc931f236a708178d5eb9b3e34 Author: Brian Nickel Date: Mon Sep 11 22:45:30 2006 +0000 2006-09-11 Brian Nickel * src/TagLib/Mpeg4/File.cs: Added "audio/mp4" to types. svn path=/trunk/taglib-sharp/; revision=65256 commit eb2bb5eb1d9a79c3e8939509b854bac2fb9ebc9e Author: Aaron Bockover Date: Sat Sep 2 03:27:10 2006 +0000 2006-09-01 Aaron Bockover * examples/covers/: Added sample cover art files svn path=/trunk/taglib-sharp/; revision=64751 commit f4b2d423ddd4a78e991606b7d557003fb9df7fa7 Author: Aaron Bockover Date: Sat Sep 2 03:25:24 2006 +0000 2006-09-01 Aaron Bockover * tests/: Added test sample audio files svn path=/trunk/taglib-sharp/; revision=64750 commit f61e41ec8ef34c86017b2a51acdde203769c3cc3 Author: Aaron Bockover Date: Fri Sep 1 17:56:56 2006 +0000 2006-09-01 Aaron Bockover * configure.ac: Added ASM_VERSION; added DISTCHECK_CONFIGURE_FLAGS so distcheck target works properly as user (--disable-docs is passed on distcheck now) * src/AssemblyInfo.cs.in: Use ASM_VERSION instead of VERSION to get build revisions in version string * examples/Makefile.am: Added EXTRA_DIST, fixed distcheck build bug svn path=/trunk/taglib-sharp/; revision=64730 commit e1eba14cc33103bbe9e7a2710355b3a02ab3b3a7 Author: Brian Nickel Date: Thu Aug 31 22:22:26 2006 +0000 Corrected an invalid frame conversion and attempting a better method for populating ByteVectors. svn path=/trunk/taglib-sharp/; revision=64669 commit 9126fb7e24dabaabdf2b86bdb8a8d0ba50b75594 Author: Brian Nickel Date: Tue Aug 29 02:48:25 2006 +0000 Fixed up the reading of WM/PartOfSet to avoid crashes. svn path=/trunk/taglib-sharp/; revision=64505 commit cc7f29b882471f8c31bb430af7b95f61b28cd2c9 Author: Aaron Bockover Date: Mon Aug 28 02:12:07 2006 +0000 2006-08-27 Aaron Bockover * src/TagLib/ReadOnlyException.cs: New exception * src/TagLib/File.cs: * src/TagLib/Mpc/File.cs: * src/TagLib/Mpeg/File.cs: * src/TagLib/WavPack/File.cs: * src/TagLib/Flac/File.cs: * src/TagLib/Asf/File.cs: * src/TagLib/Mpeg4/AppleTag.cs: * src/TagLib/Mpeg4/File.cs: * src/TagLib/Ogg/File.cs: * src/TagLib/Ogg/Vorbis/File.cs: * src/TagLib/Ogg/Flac/File.cs: Save is now void, throws exceptions when a problem has arisen instead of eventually returning false, masking the source of the problem * taglib-sharp.csproj: * src/Makefile.am: Updated svn path=/trunk/taglib-sharp/; revision=64456 commit 42bdfaa70eeca125a269416619dd8d6f7ebe0b92 Author: Aaron Bockover Date: Sat Aug 26 00:33:46 2006 +0000 2006-08-25 Aaron Bockover * examples/Makefile.am: Added Makefile.am, was missing from forge repository svn path=/trunk/taglib-sharp/; revision=64396 commit ed83b1cacfd4339faaeb9bba0a7052695708d38b Author: Aaron Bockover Date: Sat Aug 26 00:25:52 2006 +0000 Initial import of taglib-sharp; moved from forge svn path=/trunk/taglib-sharp/; revision=64394 taglib-sharp-2.1.0.0/missing0000755000175000017500000002415211762620517015603 0ustar00alexalex00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: taglib-sharp-2.1.0.0/INSTALL0000644000175000017500000003660011762620517015236 0ustar00alexalex00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. taglib-sharp-2.1.0.0/README0000644000175000017500000000200011552201076015040 0ustar00alexalex00000000000000TagLib# (aka taglib-sharp) is a library for reading and writing metadata in media files, including video, audio, and photo formats. It is API stable, with only API additions (not changes or removals) occuring in the 2.0 series. * Bugs: http://bugzilla.gnome.org/browse.cgi?product=taglib-sharp * Tarballs: http://download.banshee.fm/taglib-sharp/ * IRC: Several TagLib# developers are often in #banshee on irc.gnome.org * Git: http://github.com/mono/taglib-sharp git://github.com/mono/taglib-sharp.git TagLib# is free/open source software, released under the LGPL. We welcome contributions! Please try to match our coding style, and include unit tests with any patches. Patches can be submitted by filing a bug and attaching the diff to it. To Build From Git: git clone git://github.com/mono/taglib-sharp.git cd taglib-sharp ./autogen.sh && make To Build From Tarball: ./configure && make You can also build from MonoDevelop or Visual Studio using taglib-sharp.sln To Test: make test taglib-sharp-2.1.0.0/configure0000755000175000017500000040552211774620100016106 0ustar00alexalex00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for taglib-sharp 2.1.0.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='taglib-sharp' PACKAGE_TARNAME='taglib-sharp' PACKAGE_VERSION='2.1.0.0' PACKAGE_STRING='taglib-sharp 2.1.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS IN_DIST_FALSE IN_DIST_TRUE ENABLE_RAW_TESTS_FALSE ENABLE_RAW_TESTS_TRUE NUNIT_CMD ENABLE_TESTS_FALSE ENABLE_TESTS_TRUE MONO_NUNIT_LIBS MONO_NUNIT_CFLAGS HAVE_EXIV2_FALSE HAVE_EXIV2_TRUE EXIV2_LIBS EXIV2_CFLAGS HAVE_GNOME_SHARP_FALSE HAVE_GNOME_SHARP_TRUE GNOME_SHARP_LIBS GNOME_SHARP_CFLAGS HAVE_SHARPZIPLIB_FALSE HAVE_SHARPZIPLIB_TRUE BUILD_DOCS_FALSE BUILD_DOCS_TRUE DOCDIR MDASSEMBLER MONODOCER PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG GACUTIL_POLICY_FLAGS GACUTIL_FLAGS GACUTIL AL MONO_FLAGS MCS_FLAGS MONO MCS DISTCHECK_CONFIGURE_FLAGS WINDIR GREP ASSEMBLY_NAME ASSEMBLY_VERSION POLICY_2_0_VERSIONS MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_docs enable_raw_tests ' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GNOME_SHARP_CFLAGS GNOME_SHARP_LIBS EXIV2_CFLAGS EXIV2_LIBS MONO_NUNIT_CFLAGS MONO_NUNIT_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures taglib-sharp 2.1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/taglib-sharp] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of taglib-sharp 2.1.0.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-docs Do not build documentation --enable-raw-tests Enable RAW image files NUnit tests Some influential environment variables: PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GNOME_SHARP_CFLAGS C compiler flags for GNOME_SHARP, overriding pkg-config GNOME_SHARP_LIBS linker flags for GNOME_SHARP, overriding pkg-config EXIV2_CFLAGS C compiler flags for EXIV2, overriding pkg-config EXIV2_LIBS linker flags for EXIV2, overriding pkg-config MONO_NUNIT_CFLAGS C compiler flags for MONO_NUNIT, overriding pkg-config MONO_NUNIT_LIBS linker flags for MONO_NUNIT, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF taglib-sharp configure 2.1.0.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by taglib-sharp $as_me 2.1.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='taglib-sharp' VERSION='2.1.0.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ASSEMBLY_NAME="$PACKAGE" ASSEMBLY_VERSION="$VERSION" POLICY_2_0_VERSIONS="2.0.0.0-$ASSEMBLY_VERSION" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" MONODOC_REQUIRED=1.1.9 WINDIR="$ASSEMBLY_NAME-$VERSION-windows" DISTCHECK_CONFIGURE_FLAGS="--disable-docs" # Extract the first word of "gmcs", so it can be a program name with args. set dummy gmcs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else case $MCS in [\\/]* | ?:[\\/]*) ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MCS=$ac_cv_path_MCS if test -n "$MCS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 $as_echo "$MCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$MCS = x; then as_fn_error $? "You need mcs" "$LINENO" 5 fi # Extract the first word of "mono", so it can be a program name with args. set dummy mono; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MONO+:} false; then : $as_echo_n "(cached) " >&6 else case $MONO in [\\/]* | ?:[\\/]*) ac_cv_path_MONO="$MONO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MONO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MONO=$ac_cv_path_MONO if test -n "$MONO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MONO" >&5 $as_echo "$MONO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$MONO = x; then as_fn_error $? "You need mono" "$LINENO" 5 fi MCS_FLAGS="-codepage:utf8 -debug" MONO_FLAGS= if test $USE_MAINTAINER_MODE = yes; then MONO_FLAGS="$MONO_FLAGS --debug" fi # Extract the first word of "al", so it can be a program name with args. set dummy al; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_AL+:} false; then : $as_echo_n "(cached) " >&6 else case $AL in [\\/]* | ?:[\\/]*) ac_cv_path_AL="$AL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi AL=$ac_cv_path_AL if test -n "$AL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AL" >&5 $as_echo "$AL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$AL" = "x"; then as_fn_error $? "No al tool found. You need to install mono" "$LINENO" 5 fi # Extract the first word of "gacutil", so it can be a program name with args. set dummy gacutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GACUTIL+:} false; then : $as_echo_n "(cached) " >&6 else case $GACUTIL in [\\/]* | ?:[\\/]*) ac_cv_path_GACUTIL="$GACUTIL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GACUTIL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GACUTIL=$ac_cv_path_GACUTIL if test -n "$GACUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GACUTIL" >&5 $as_echo "$GACUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$GACUTIL = x; then as_fn_error $? "You need gacutil" "$LINENO" 5 fi GACUTIL_FLAGS='/package $(ASSEMBLY_NAME) /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib' GACUTIL_POLICY_FLAGS='/gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib' # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then : enableval=$enable_docs; with_docs=no else with_docs=yes fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test "x$with_docs" = "xyes"; then # Extract the first word of "monodocer", so it can be a program name with args. set dummy monodocer; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MONODOCER+:} false; then : $as_echo_n "(cached) " >&6 else case $MONODOCER in [\\/]* | ?:[\\/]*) ac_cv_path_MONODOCER="$MONODOCER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MONODOCER="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MONODOCER" && ac_cv_path_MONODOCER="no" ;; esac fi MONODOCER=$ac_cv_path_MONODOCER if test -n "$MONODOCER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MONODOCER" >&5 $as_echo "$MONODOCER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$MONODOCER" = "xno"; then as_fn_error $? "You need to install monodoc, or pass --disable-docs to configure to skip documentation installation" "$LINENO" 5 fi # Extract the first word of "mdassembler", so it can be a program name with args. set dummy mdassembler; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MDASSEMBLER+:} false; then : $as_echo_n "(cached) " >&6 else case $MDASSEMBLER in [\\/]* | ?:[\\/]*) ac_cv_path_MDASSEMBLER="$MDASSEMBLER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MDASSEMBLER="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MDASSEMBLER" && ac_cv_path_MDASSEMBLER="no" ;; esac fi MDASSEMBLER=$ac_cv_path_MDASSEMBLER if test -n "$MDASSEMBLER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MDASSEMBLER" >&5 $as_echo "$MDASSEMBLER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$MDASSEMBLER" = "xno"; then as_fn_error $? "You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation" "$LINENO" 5 fi DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir` if true; then BUILD_DOCS_TRUE= BUILD_DOCS_FALSE='#' else BUILD_DOCS_TRUE='#' BUILD_DOCS_FALSE= fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not building Banshee API documentation" >&5 $as_echo "$as_me: not building Banshee API documentation" >&6;} if false; then BUILD_DOCS_TRUE= BUILD_DOCS_FALSE='#' else BUILD_DOCS_TRUE='#' BUILD_DOCS_FALSE= fi fi # checking for ICSharpCode.SharpZipLib.dll { $as_echo "$as_me:${as_lineno-$LINENO}: checking Mono GAC for ICSharpCode.SharpZipLib.dll" >&5 $as_echo_n "checking Mono GAC for ICSharpCode.SharpZipLib.dll... " >&6; } if $GACUTIL -l | $GREP -q ICSharpCode.SharpZipLib; \ then \ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } if true; then HAVE_SHARPZIPLIB_TRUE= HAVE_SHARPZIPLIB_FALSE='#' else HAVE_SHARPZIPLIB_TRUE='#' HAVE_SHARPZIPLIB_FALSE= fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } if false; then HAVE_SHARPZIPLIB_TRUE= HAVE_SHARPZIPLIB_FALSE='#' else HAVE_SHARPZIPLIB_TRUE='#' HAVE_SHARPZIPLIB_FALSE= fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNOME_SHARP" >&5 $as_echo_n "checking for GNOME_SHARP... " >&6; } if test -n "$GNOME_SHARP_CFLAGS"; then pkg_cv_GNOME_SHARP_CFLAGS="$GNOME_SHARP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnome-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GNOME_SHARP_CFLAGS=`$PKG_CONFIG --cflags "gnome-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GNOME_SHARP_LIBS"; then pkg_cv_GNOME_SHARP_LIBS="$GNOME_SHARP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-sharp-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gnome-sharp-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GNOME_SHARP_LIBS=`$PKG_CONFIG --libs "gnome-sharp-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GNOME_SHARP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnome-sharp-2.0" 2>&1` else GNOME_SHARP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnome-sharp-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GNOME_SHARP_PKG_ERRORS" >&5 have_gnome_sharp=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gnome_sharp=no else GNOME_SHARP_CFLAGS=$pkg_cv_GNOME_SHARP_CFLAGS GNOME_SHARP_LIBS=$pkg_cv_GNOME_SHARP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gnome_sharp=yes fi if test "x$have_gnome_sharp" = "xyes"; then if true; then HAVE_GNOME_SHARP_TRUE= HAVE_GNOME_SHARP_FALSE='#' else HAVE_GNOME_SHARP_TRUE='#' HAVE_GNOME_SHARP_FALSE= fi else if false; then HAVE_GNOME_SHARP_TRUE= HAVE_GNOME_SHARP_FALSE='#' else HAVE_GNOME_SHARP_TRUE='#' HAVE_GNOME_SHARP_FALSE= fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXIV2" >&5 $as_echo_n "checking for EXIV2... " >&6; } if test -n "$EXIV2_CFLAGS"; then pkg_cv_EXIV2_CFLAGS="$EXIV2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"exiv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "exiv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EXIV2_CFLAGS=`$PKG_CONFIG --cflags "exiv2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$EXIV2_LIBS"; then pkg_cv_EXIV2_LIBS="$EXIV2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"exiv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "exiv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EXIV2_LIBS=`$PKG_CONFIG --libs "exiv2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then EXIV2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "exiv2" 2>&1` else EXIV2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "exiv2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EXIV2_PKG_ERRORS" >&5 have_exiv2=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_exiv2=no else EXIV2_CFLAGS=$pkg_cv_EXIV2_CFLAGS EXIV2_LIBS=$pkg_cv_EXIV2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_exiv2=yes fi if test "x$have_exiv2" = "xyes"; then if true; then HAVE_EXIV2_TRUE= HAVE_EXIV2_FALSE='#' else HAVE_EXIV2_TRUE='#' HAVE_EXIV2_FALSE= fi else if false; then HAVE_EXIV2_TRUE= HAVE_EXIV2_FALSE='#' else HAVE_EXIV2_TRUE='#' HAVE_EXIV2_FALSE= fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MONO_NUNIT" >&5 $as_echo_n "checking for MONO_NUNIT... " >&6; } if test -n "$MONO_NUNIT_CFLAGS"; then pkg_cv_MONO_NUNIT_CFLAGS="$MONO_NUNIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mono-nunit >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "mono-nunit >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MONO_NUNIT_CFLAGS=`$PKG_CONFIG --cflags "mono-nunit >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MONO_NUNIT_LIBS"; then pkg_cv_MONO_NUNIT_LIBS="$MONO_NUNIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mono-nunit >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "mono-nunit >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MONO_NUNIT_LIBS=`$PKG_CONFIG --libs "mono-nunit >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MONO_NUNIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mono-nunit >= 1.0" 2>&1` else MONO_NUNIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mono-nunit >= 1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MONO_NUNIT_PKG_ERRORS" >&5 do_tests="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } do_tests="no" else MONO_NUNIT_CFLAGS=$pkg_cv_MONO_NUNIT_CFLAGS MONO_NUNIT_LIBS=$pkg_cv_MONO_NUNIT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } do_tests="yes" fi if test "x$do_tests" = "xyes"; then ENABLE_TESTS_TRUE= ENABLE_TESTS_FALSE='#' else ENABLE_TESTS_TRUE='#' ENABLE_TESTS_FALSE= fi if test "x$do_tests" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find mono-nunit: tests will not be available." >&5 $as_echo "$as_me: WARNING: Could not find mono-nunit: tests will not be available." >&2;} else # Extract the first word of "nunit-console2", so it can be a program name with args. set dummy nunit-console2; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_NUNIT_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $NUNIT_CMD in [\\/]* | ?:[\\/]*) ac_cv_path_NUNIT_CMD="$NUNIT_CMD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_NUNIT_CMD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_NUNIT_CMD" && ac_cv_path_NUNIT_CMD="nunit-console" ;; esac fi NUNIT_CMD=$ac_cv_path_NUNIT_CMD if test -n "$NUNIT_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUNIT_CMD" >&5 $as_echo "$NUNIT_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Check whether --enable-raw-tests was given. if test "${enable_raw_tests+set}" = set; then : enableval=$enable_raw_tests; enable_raw_tests=$enableval else enable_raw_tests="no" fi if test "x$enable_raw_tests" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: RAW image file tests disabled." >&5 $as_echo "$as_me: WARNING: RAW image file tests disabled." >&2;} if false; then ENABLE_RAW_TESTS_TRUE= ENABLE_RAW_TESTS_FALSE='#' else ENABLE_RAW_TESTS_TRUE='#' ENABLE_RAW_TESTS_FALSE= fi else if true; then ENABLE_RAW_TESTS_TRUE= ENABLE_RAW_TESTS_FALSE='#' else ENABLE_RAW_TESTS_TRUE='#' ENABLE_RAW_TESTS_FALSE= fi fi ac_config_files="$ac_config_files Makefile taglib-sharp.pc src/Makefile src/AssemblyInfo.cs src/policy.2.0.taglib-sharp.config examples/Makefile docs/Makefile docs/Package.en.xml" # Test suite is not shipped, only builds from git. if test -d tests; then ac_config_files="$ac_config_files tests/Makefile" if false; then IN_DIST_TRUE= IN_DIST_FALSE='#' else IN_DIST_TRUE='#' IN_DIST_FALSE= fi else if true; then IN_DIST_TRUE= IN_DIST_FALSE='#' else IN_DIST_TRUE='#' IN_DIST_FALSE= fi fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then as_fn_error $? "conditional \"BUILD_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then as_fn_error $? "conditional \"BUILD_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SHARPZIPLIB_TRUE}" && test -z "${HAVE_SHARPZIPLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_SHARPZIPLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SHARPZIPLIB_TRUE}" && test -z "${HAVE_SHARPZIPLIB_FALSE}"; then as_fn_error $? "conditional \"HAVE_SHARPZIPLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GNOME_SHARP_TRUE}" && test -z "${HAVE_GNOME_SHARP_FALSE}"; then as_fn_error $? "conditional \"HAVE_GNOME_SHARP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GNOME_SHARP_TRUE}" && test -z "${HAVE_GNOME_SHARP_FALSE}"; then as_fn_error $? "conditional \"HAVE_GNOME_SHARP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_EXIV2_TRUE}" && test -z "${HAVE_EXIV2_FALSE}"; then as_fn_error $? "conditional \"HAVE_EXIV2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_EXIV2_TRUE}" && test -z "${HAVE_EXIV2_FALSE}"; then as_fn_error $? "conditional \"HAVE_EXIV2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RAW_TESTS_TRUE}" && test -z "${ENABLE_RAW_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RAW_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RAW_TESTS_TRUE}" && test -z "${ENABLE_RAW_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RAW_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${IN_DIST_TRUE}" && test -z "${IN_DIST_FALSE}"; then as_fn_error $? "conditional \"IN_DIST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${IN_DIST_TRUE}" && test -z "${IN_DIST_FALSE}"; then as_fn_error $? "conditional \"IN_DIST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by taglib-sharp $as_me 2.1.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ taglib-sharp config.status 2.1.0.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "taglib-sharp.pc") CONFIG_FILES="$CONFIG_FILES taglib-sharp.pc" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/AssemblyInfo.cs") CONFIG_FILES="$CONFIG_FILES src/AssemblyInfo.cs" ;; "src/policy.2.0.taglib-sharp.config") CONFIG_FILES="$CONFIG_FILES src/policy.2.0.taglib-sharp.config" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/Package.en.xml") CONFIG_FILES="$CONFIG_FILES docs/Package.en.xml" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "TagLib# ($ASSEMBLY_NAME-$ASSEMBLY_VERSION) is ready to be compiled." taglib-sharp-2.1.0.0/configure.ac0000644000175000017500000000760211774617103016473 0ustar00alexalex00000000000000AC_INIT([taglib-sharp], [2.1.0.0]) AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar]) AM_MAINTAINER_MODE ASSEMBLY_NAME="$PACKAGE" ASSEMBLY_VERSION="$VERSION" POLICY_2_0_VERSIONS="2.0.0.0-$ASSEMBLY_VERSION" AC_SUBST(POLICY_2_0_VERSIONS) AC_SUBST(VERSION) AC_SUBST(ASSEMBLY_VERSION) AC_SUBST(ASSEMBLY_NAME) AC_PROG_INSTALL AC_PROG_GREP MONODOC_REQUIRED=1.1.9 WINDIR="$ASSEMBLY_NAME-$VERSION-windows" AC_SUBST(WINDIR) DISTCHECK_CONFIGURE_FLAGS="--disable-docs" AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) dnl Check for Mono AC_PATH_PROG(MCS, gmcs) if test x$MCS = x; then AC_MSG_ERROR(You need mcs) fi AC_PATH_PROG(MONO, mono) if test x$MONO = x; then AC_MSG_ERROR(You need mono) fi MCS_FLAGS="-codepage:utf8 -debug" MONO_FLAGS= if test $USE_MAINTAINER_MODE = yes; then MONO_FLAGS="$MONO_FLAGS --debug" fi AC_SUBST(MCS_FLAGS) AC_SUBST(MONO_FLAGS) AC_PATH_PROG(AL, al) if test "x$AL" = "x"; then AC_MSG_ERROR([No al tool found. You need to install mono]) fi dnl GAC AC_PATH_PROG(GACUTIL, gacutil) if test x$GACUTIL = x; then AC_MSG_ERROR(You need gacutil) fi GACUTIL_FLAGS='/package $(ASSEMBLY_NAME) /gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib' AC_SUBST(GACUTIL_FLAGS) GACUTIL_POLICY_FLAGS='/gacdir $(prefix)/lib /root $(DESTDIR)$(prefix)/lib' AC_SUBST(GACUTIL_POLICY_FLAGS) AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs], [Do not build documentation]), with_docs=no, with_docs=yes) PKG_PROG_PKG_CONFIG dnl Monodoc if test "x$with_docs" = "xyes"; then AC_PATH_PROG(MONODOCER, monodocer, no) if test "x$MONODOCER" = "xno"; then AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation]) fi AC_PATH_PROG(MDASSEMBLER, mdassembler, no) if test "x$MDASSEMBLER" = "xno"; then AC_MSG_ERROR([You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation]) fi DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir` AC_SUBST(DOCDIR) AM_CONDITIONAL(BUILD_DOCS, true) else AC_MSG_NOTICE([not building Banshee API documentation]) AM_CONDITIONAL(BUILD_DOCS, false) fi # checking for ICSharpCode.SharpZipLib.dll AC_MSG_CHECKING([Mono GAC for ICSharpCode.SharpZipLib.dll]) if $GACUTIL -l | $GREP -q ICSharpCode.SharpZipLib; \ then \ AC_MSG_RESULT([found]) AM_CONDITIONAL(HAVE_SHARPZIPLIB, true) else AC_MSG_RESULT([not found]) AM_CONDITIONAL(HAVE_SHARPZIPLIB, false) fi PKG_CHECK_MODULES(GNOME_SHARP, gnome-sharp-2.0, have_gnome_sharp=yes, have_gnome_sharp=no) if test "x$have_gnome_sharp" = "xyes"; then AC_SUBST(GNOME_SHARP_LIBS) AM_CONDITIONAL(HAVE_GNOME_SHARP, true) else AM_CONDITIONAL(HAVE_GNOME_SHARP, false) fi PKG_CHECK_MODULES(EXIV2, exiv2, have_exiv2=yes, have_exiv2=no) if test "x$have_exiv2" = "xyes"; then AC_SUBST(EXIV2_LIBS) AM_CONDITIONAL(HAVE_EXIV2, true) else AM_CONDITIONAL(HAVE_EXIV2, false) fi PKG_CHECK_MODULES(MONO_NUNIT, mono-nunit >= 1.0, do_tests="yes", do_tests="no") AC_SUBST(MONO_NUNIT_LIBS) AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes") if test "x$do_tests" = "xno"; then AC_MSG_WARN([Could not find mono-nunit: tests will not be available.]) else AC_PATH_PROG(NUNIT_CMD, nunit-console2, nunit-console) AC_SUBST(NUNIT_CMD) fi AC_ARG_ENABLE(raw-tests, AC_HELP_STRING([--enable-raw-tests], [Enable RAW image files NUnit tests]), enable_raw_tests=$enableval, enable_raw_tests="no") if test "x$enable_raw_tests" = "xno"; then AC_MSG_WARN([RAW image file tests disabled.]) AM_CONDITIONAL(ENABLE_RAW_TESTS, false) else AM_CONDITIONAL(ENABLE_RAW_TESTS, true) fi AC_CONFIG_FILES([ Makefile taglib-sharp.pc src/Makefile src/AssemblyInfo.cs src/policy.2.0.taglib-sharp.config examples/Makefile docs/Makefile docs/Package.en.xml ]) # Test suite is not shipped, only builds from git. if test -d tests; then AC_CONFIG_FILES([tests/Makefile]) AM_CONDITIONAL(IN_DIST, false) else AM_CONDITIONAL(IN_DIST, true) fi AC_OUTPUT echo "TagLib# ($ASSEMBLY_NAME-$ASSEMBLY_VERSION) is ready to be compiled." taglib-sharp-2.1.0.0/taglib-sharp.sln0000644000175000017500000000554511773627722017313 0ustar00alexalex00000000000000 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "taglib-sharp", "src\taglib-sharp.csproj", "{6B143A39-C7B2-4743-9917-92262C60E9A6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{4D1C6110-D6F2-496E-BD7E-E45B7217D458}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Debug|Any CPU.Build.0 = Debug|Any CPU {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Release|Any CPU.ActiveCfg = Release|Any CPU {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Release|Any CPU.Build.0 = Release|Any CPU {6B143A39-C7B2-4743-9917-92262C60E9A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6B143A39-C7B2-4743-9917-92262C60E9A6}.Debug|Any CPU.Build.0 = Debug|Any CPU {6B143A39-C7B2-4743-9917-92262C60E9A6}.Release|Any CPU.ActiveCfg = Release|Any CPU {6B143A39-C7B2-4743-9917-92262C60E9A6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = tests\tests.csproj Policies = $0 $0.TextStylePolicy = $1 $1.inheritsSet = null $1.scope = application/x-mdp $0.StandardHeader = $2 $2.Text = @\n ${FileName}\n \n Author:\n ${AuthorName} <${AuthorEmail}>\n\n Copyright (c) ${Year} ${CopyrightHolder}\n\n This library is free software; you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of the\n License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful, but\n WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $2.IncludeInNewFiles = True $0.DotNetNamingPolicy = $3 $3.DirectoryNamespaceAssociation = None $3.ResourceNamePolicy = FileFormatDefault $0.TextStylePolicy = $4 $4.inheritsSet = null $4.scope = text/x-csharp $0.CSharpFormattingPolicy = $5 $5.inheritsSet = Mono $5.inheritsScope = text/x-csharp $5.scope = text/x-csharp $0.TextStylePolicy = $6 $6.FileWidth = 120 $6.TabWidth = 4 $6.inheritsSet = Mono $6.inheritsScope = text/plain $6.scope = text/plain version = 2.0.4.0 outputpath = build EndGlobalSection EndGlobal taglib-sharp-2.1.0.0/src/0000755000175000017500000000000011774620112014761 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/Makefile.in0000644000175000017500000003162611774620077017050 0ustar00alexalex00000000000000# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : DIST_COMMON = $(srcdir)/AssemblyInfo.cs.in $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/TagLib/TagLib.sources \ $(srcdir)/policy.2.0.taglib-sharp.config.in subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyInfo.cs policy.2.0.taglib-sharp.config CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AL = @AL@ AMTAR = @AMTAR@ ASSEMBLY_NAME = @ASSEMBLY_NAME@ ASSEMBLY_VERSION = @ASSEMBLY_VERSION@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ DOCDIR = @DOCDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXIV2_CFLAGS = @EXIV2_CFLAGS@ EXIV2_LIBS = @EXIV2_LIBS@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GACUTIL_POLICY_FLAGS = @GACUTIL_POLICY_FLAGS@ GNOME_SHARP_CFLAGS = @GNOME_SHARP_CFLAGS@ GNOME_SHARP_LIBS = @GNOME_SHARP_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MDASSEMBLER = @MDASSEMBLER@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONODOCER = @MONODOCER@ MONO_FLAGS = @MONO_FLAGS@ MONO_NUNIT_CFLAGS = @MONO_NUNIT_CFLAGS@ MONO_NUNIT_LIBS = @MONO_NUNIT_LIBS@ NUNIT_CMD = @NUNIT_CMD@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POLICY_2_0_VERSIONS = @POLICY_2_0_VERSIONS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDIR = @WINDIR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ POLICIES = policy.2.0.$(ASSEMBLY_NAME).dll ASSEMBLY = $(ASSEMBLY_NAME).dll TARGET = $(ASSEMBLY) @BUILD_DOCS_FALSE@DOCFILE = @BUILD_DOCS_TRUE@DOCFILE = $(ASSEMBLY).xml @BUILD_DOCS_FALSE@DOCFLAGS = @BUILD_DOCS_TRUE@DOCFLAGS = /doc:$(DOCFILE) /warn:4 @HAVE_SHARPZIPLIB_TRUE@SHARPZIPLIB_FLAGS = -r:ICSharpCode.SharpZipLib.dll -define:HAVE_SHARPZIPLIB CSC = $(MCS) $(MCS_FLAGS) $(CSFLAGS) TAGLIB_CSFILES = \ $(wildcard *.cs) \ $(wildcard */*.cs) \ $(wildcard */*/*.cs) \ $(wildcard */*/*/*.cs) taglib_sources_in = AssemblyInfo.cs.in taglib_generated_sources = $(taglib_sources_in:.in=) taglib_policy_names = $(POLICIES:.dll=) taglib_policy_configs = $(POLICIES:.dll=.config) taglib_policy_configs_in = $(POLICIES:.dll=.config.in) EXTRA_DIST = $(TAGLIB_CSFILES) $(taglib_sources_in) $(taglib_policy_configs_in) taglib-sharp.csproj DISTCLEANFILES = *.pidb CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb $(POLICIES) taglib-sharp.snk $(DOCFILE) MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/TagLib/TagLib.sources $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/TagLib/TagLib.sources: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ policy.2.0.taglib-sharp.config: $(top_builddir)/config.status $(srcdir)/policy.2.0.taglib-sharp.config.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-local taglib-sharp.snk: $(top_srcdir)/taglib-sharp.snk cp $(top_srcdir)/taglib-sharp.snk . $(ASSEMBLY): $(TAGLIB_CSFILES) $(taglib_generated_sources) taglib-sharp.snk $(CSC) /target:library $(LIBFLAGS) $(SHARPZIPLIB_FLAGS) $(DOCFLAGS) /define:SIGN /out:$@ $(TAGLIB_CSFILES) $(taglib_generated_sources) policy.%.$(ASSEMBLY_NAME).dll: policy.%.$(ASSEMBLY_NAME).config $(AL) /link:$< /out:$@ /keyfile:taglib-sharp.snk all: $(ASSEMBLY) $(POLICIES) install-data-local: @if test -n '$(TARGET)'; then \ echo "$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS)"; \ $(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS) || exit 1; \ for POLICY in $(POLICIES); \ do echo "$(GACUTIL) /i $$POLICY /f $(GACUTIL_POLICY_FLAGS)"; \ $(GACUTIL) /i $$POLICY /f $(GACUTIL_POLICY_FLAGS) || exit 1; \ done \ fi uninstall-local: @if test -n '$(TARGET)'; then \ echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \ $(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; \ for POLICY in $(taglib_policy_names); \ do echo "$(GACUTIL) /u $$POLICY /f $(GACUTIL_POLICY_FLAGS)"; \ $(GACUTIL) /u $$POLICY /f $(GACUTIL_POLICY_FLAGS) || exit 1; \ done \ fi distwin: mkdir -p $(srcdir)/../$(WINDIR)/Libraries cp $(srcdir)/*.dll $(srcdir)/*.config $(srcdir)/../$(WINDIR)/Libraries for FILE in $(TAGLIB_CSFILES) $(taglib_generated_sources); \ do mkdir -p $(srcdir)/../$(WINDIR)/src/`dirname $$FILE`; \ cp $$FILE $(srcdir)/../$(WINDIR)/src/`dirname $$FILE`; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: taglib-sharp-2.1.0.0/src/taglib-sharp.csproj0000644000175000017500000003665711774615741020615 0ustar00alexalex00000000000000 Debug AnyCPU 9.0.21022 2.0 {6B143A39-C7B2-4743-9917-92262C60E9A6} Library TagLib . taglib-sharp 2.0.4.0 v3.5 True full True . prompt 4 True True . HAVE_SHARPZIPLIB none True . prompt 4 True True taglib-sharp-2.1.0.0/src/AssemblyInfo.cs.in0000644000175000017500000000256511442021373020314 0ustar00alexalex00000000000000// // AssemblyInfo.cs.in: Contains flags to use for the assembly. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly:AssemblyVersion("@ASSEMBLY_VERSION@")] [assembly:AssemblyTitle ("TagLib#")] [assembly:AssemblyDescription ("A library for reading and writing audio metatags.")] [assembly:AssemblyCopyright ("Copyright (c) 2006-2007 Brian Nickel. Copyright (c) 2009-2010 Other contributors")] [assembly:AssemblyCompany ("")] [assembly:AssemblyDelaySign(false)] [assembly:AssemblyKeyFile("taglib-sharp.snk")] [assembly:CLSCompliant(false)] taglib-sharp-2.1.0.0/src/AssemblyInfo.cs0000644000175000017500000000255211774620103017707 0ustar00alexalex00000000000000// // AssemblyInfo.cs.in: Contains flags to use for the assembly. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly:AssemblyVersion("2.1.0.0")] [assembly:AssemblyTitle ("TagLib#")] [assembly:AssemblyDescription ("A library for reading and writing audio metatags.")] [assembly:AssemblyCopyright ("Copyright (c) 2006-2007 Brian Nickel. Copyright (c) 2009-2010 Other contributors")] [assembly:AssemblyCompany ("")] [assembly:AssemblyDelaySign(false)] [assembly:AssemblyKeyFile("taglib-sharp.snk")] [assembly:CLSCompliant(false)] taglib-sharp-2.1.0.0/src/policy.2.0.taglib-sharp.config.in0000644000175000017500000000060311442021373022721 0ustar00alexalex00000000000000 taglib-sharp-2.1.0.0/src/Makefile.am0000644000175000017500000000453611521241310017012 0ustar00alexalex00000000000000POLICIES = policy.2.0.$(ASSEMBLY_NAME).dll ASSEMBLY = $(ASSEMBLY_NAME).dll TARGET = $(ASSEMBLY) if BUILD_DOCS DOCFILE = $(ASSEMBLY).xml DOCFLAGS = /doc:$(DOCFILE) /warn:4 else DOCFILE = DOCFLAGS = endif if HAVE_SHARPZIPLIB SHARPZIPLIB_FLAGS = -r:ICSharpCode.SharpZipLib.dll -define:HAVE_SHARPZIPLIB endif CSC = $(MCS) $(MCS_FLAGS) $(CSFLAGS) include $(srcdir)/TagLib/TagLib.sources taglib-sharp.snk: $(top_srcdir)/taglib-sharp.snk cp $(top_srcdir)/taglib-sharp.snk . taglib_sources_in = AssemblyInfo.cs.in taglib_generated_sources = $(taglib_sources_in:.in=) taglib_policy_names = $(POLICIES:.dll=) taglib_policy_configs = $(POLICIES:.dll=.config) taglib_policy_configs_in = $(POLICIES:.dll=.config.in) $(ASSEMBLY): $(TAGLIB_CSFILES) $(taglib_generated_sources) taglib-sharp.snk $(CSC) /target:library $(LIBFLAGS) $(SHARPZIPLIB_FLAGS) $(DOCFLAGS) /define:SIGN /out:$@ $(TAGLIB_CSFILES) $(taglib_generated_sources) policy.%.$(ASSEMBLY_NAME).dll: policy.%.$(ASSEMBLY_NAME).config $(AL) /link:$< /out:$@ /keyfile:taglib-sharp.snk all: $(ASSEMBLY) $(POLICIES) EXTRA_DIST = $(TAGLIB_CSFILES) $(taglib_sources_in) $(taglib_policy_configs_in) taglib-sharp.csproj DISTCLEANFILES = *.pidb CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb $(POLICIES) taglib-sharp.snk $(DOCFILE) MAINTAINERCLEANFILES = Makefile.in install-data-local: @if test -n '$(TARGET)'; then \ echo "$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS)"; \ $(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS) || exit 1; \ for POLICY in $(POLICIES); \ do echo "$(GACUTIL) /i $$POLICY /f $(GACUTIL_POLICY_FLAGS)"; \ $(GACUTIL) /i $$POLICY /f $(GACUTIL_POLICY_FLAGS) || exit 1; \ done \ fi uninstall-local: @if test -n '$(TARGET)'; then \ echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \ $(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; \ for POLICY in $(taglib_policy_names); \ do echo "$(GACUTIL) /u $$POLICY /f $(GACUTIL_POLICY_FLAGS)"; \ $(GACUTIL) /u $$POLICY /f $(GACUTIL_POLICY_FLAGS) || exit 1; \ done \ fi distwin: mkdir -p $(srcdir)/../$(WINDIR)/Libraries cp $(srcdir)/*.dll $(srcdir)/*.config $(srcdir)/../$(WINDIR)/Libraries for FILE in $(TAGLIB_CSFILES) $(taglib_generated_sources); \ do mkdir -p $(srcdir)/../$(WINDIR)/src/`dirname $$FILE`; \ cp $$FILE $(srcdir)/../$(WINDIR)/src/`dirname $$FILE`; \ done taglib-sharp-2.1.0.0/src/TagLib/0000755000175000017500000000000011774620111016122 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/IFD/0000755000175000017500000000000011774620111016524 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/0000755000175000017500000000000011774620112017423 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/GPSEntryTag.cs0000644000175000017500000002243511521241310022054 0ustar00alexalex00000000000000// // GPSEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009-2010 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Entry tags occuring in the GPS IFD /// The complete overview can be obtained at: /// http://www.awaresystems.be/imaging/tiff.html /// public enum GPSEntryTag : ushort { /// /// Indicates the version of GPSInfoIFD. (Hex: 0x0000) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsversionid.html /// GPSVersionID = 0, /// /// Indicates whether the latitude is north or south latitude. (Hex: 0x0001) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslatituderef.html /// GPSLatitudeRef = 1, /// /// Indicates the latitude. (Hex: 0x0002) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslatitude.html /// GPSLatitude = 2, /// /// Indicates whether the longitude is east or west longitude. (Hex: 0x0003) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslongituderef.html /// GPSLongitudeRef = 3, /// /// Indicates the longitude. (Hex: 0x0004) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpslongitude.html /// GPSLongitude = 4, /// /// Indicates the altitude used as the reference altitude. (Hex: 0x0005) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsaltituderef.html /// GPSAltitudeRef = 5, /// /// Indicates the altitude based on the reference in GPSAltitudeRef. (Hex: 0x0006) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsaltitude.html /// GPSAltitude = 6, /// /// Indicates the time as UTC (Coordinated Universal Time). (Hex: 0x0007) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpstimestamp.html /// GPSTimeStamp = 7, /// /// Indicates the GPS satellites used for measurements. (Hex: 0x0008) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpssatellites.html /// GPSSatellites = 8, /// /// Indicates the status of the GPS receiver when the image is recorded. (Hex: 0x0009) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsstatus.html /// GPSStatus = 9, /// /// Indicates the GPS measurement mode. (Hex: 0x000A) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsmeasuremode.html /// GPSMeasureMode = 10, /// /// Indicates the GPS DOP (data degree of precision). (Hex: 0x000B) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdop.html /// GPSDOP = 11, /// /// Indicates the unit used to express the GPS receiver speed of movement. (Hex: 0x000C) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsspeedref.html /// GPSSpeedRef = 12, /// /// Indicates the speed of GPS receiver movement. (Hex: 0x000D) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsspeed.html /// GPSSpeed = 13, /// /// Indicates the reference for giving the direction of GPS receiver movement. (Hex: 0x000E) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpstrackref.html /// GPSTrackRef = 14, /// /// Indicates the direction of GPS receiver movement. (Hex: 0x000F) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpstrack.html /// GPSTrack = 15, /// /// Indicates the reference for giving the direction of the image when it is captured. (Hex: 0x0010) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsimgdirectionref.html /// GPSImgDirectionRef = 16, /// /// Indicates the direction of the image when it was captured. (Hex: 0x0011) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsimgdirection.html /// GPSImgDirection = 17, /// /// Indicates the geodetic survey data used by the GPS receiver. (Hex: 0x0012) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsmapdatum.html /// GPSMapDatum = 18, /// /// Indicates whether the latitude of the destination point is north or south latitude. (Hex: 0x0013) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlatituderef.html /// GPSDestLatitudeRef = 19, /// /// Indicates the latitude of the destination point. (Hex: 0x0014) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlatitude.html /// GPSDestLatitude = 20, /// /// Indicates whether the longitude of the destination point is east or west longitude. (Hex: 0x0015) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlongituderef.html /// GPSDestLongitudeRef = 21, /// /// Indicates the longitude of the destination point. (Hex: 0x0016) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestlongitude.html /// GPSDestLongitude = 22, /// /// Indicates the reference used for giving the bearing to the destination point. (Hex: 0x0017) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestbearingref.html /// GPSDestBearingRef = 23, /// /// Indicates the bearing to the destination point. (Hex: 0x0018) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestbearing.html /// GPSDestBearing = 24, /// /// Indicates the unit used to express the distance to the destination point. (Hex: 0x0019) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestdistanceref.html /// GPSDestDistanceRef = 25, /// /// Indicates the distance to the destination point. (Hex: 0x001A) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdestdistance.html /// GPSDestDistance = 26, /// /// A character string recording the name of the method used for location finding. (Hex: 0x001B) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsprocessingmethod.html /// GPSProcessingMethod = 27, /// /// A character string recording the name of the GPS area. (Hex: 0x001C) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsareainformation.html /// GPSAreaInformation = 28, /// /// A character string recording date and time information relative to UTC (Coordinated Universal Time). (Hex: 0x001D) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdatestamp.html /// GPSDateStamp = 29, /// /// Indicates whether differential correction is applied to the GPS receiver. (Hex: 0x001E) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/gps/gpsdifferential.html /// GPSDifferential = 30, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/PentaxMakerNoteEntryTag.cs0000644000175000017500000002743111521241310024471 0ustar00alexalex00000000000000// // PentaxMakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Pentax makernote tags. /// Based on http://www.exiv2.org/tags-pentax.html /// public enum PentaxMakerNoteEntryTag : ushort { /// /// Pentax Makernote version. (Hex: 0X0000) /// Version = 0, /// /// Camera shooting mode. (Hex: 0X0001) /// Mode = 1, /// /// Resolution of a preview image. (Hex: 0X0002) /// PreviewResolution = 2, /// /// Size of an IFD containing a preview image. (Hex: 0X0003) /// PreviewLength = 3, /// /// Offset to an IFD containing a preview image. (Hex: 0X0004) /// PreviewOffset = 4, /// /// Pentax model idenfication. (Hex: 0X0005) /// ModelID = 5, /// /// Date. (Hex: 0X0006) /// Date = 6, /// /// Time. (Hex: 0X0007) /// Time = 7, /// /// Image quality settings. (Hex: 0X0008) /// Quality = 8, /// /// Image size settings. (Hex: 0X0009) /// Size = 9, /// /// Flash mode settings. (Hex: 0X000C) /// Flash = 12, /// /// Focus mode settings. (Hex: 0X000D) /// Focus = 13, /// /// Selected AF point. (Hex: 0X000E) /// AFPoint = 14, /// /// AF point in focus. (Hex: 0X000F) /// AFPointInFocus = 15, /// /// Exposure time. (Hex: 0X0012) /// ExposureTime = 18, /// /// F-Number. (Hex: 0X0013) /// FNumber = 19, /// /// ISO sensitivity settings. (Hex: 0X0014) /// ISO = 20, /// /// Exposure compensation. (Hex: 0X0016) /// ExposureCompensation = 22, /// /// MeteringMode. (Hex: 0X0017) /// MeteringMode = 23, /// /// AutoBracketing. (Hex: 0X0018) /// AutoBracketing = 24, /// /// White ballance. (Hex: 0X0019) /// WhiteBallance = 25, /// /// White ballance mode. (Hex: 0X001A) /// WhiteBallanceMode = 26, /// /// Blue color balance. (Hex: 0X001B) /// BlueBalance = 27, /// /// Red color balance. (Hex: 0X001C) /// RedBalance = 28, /// /// FocalLength. (Hex: 0X001D) /// FocalLength = 29, /// /// Digital zoom. (Hex: 0X001E) /// DigitalZoom = 30, /// /// Saturation. (Hex: 0X001F) /// Saturation = 31, /// /// Contrast. (Hex: 0X0020) /// Contrast = 32, /// /// Sharpness. (Hex: 0X0021) /// Sharpness = 33, /// /// Location. (Hex: 0X0022) /// Location = 34, /// /// Home town. (Hex: 0X0023) /// Hometown = 35, /// /// Destination. (Hex: 0X0024) /// Destination = 36, /// /// Whether day saving time is active in home town. (Hex: 0X0025) /// HometownDST = 37, /// /// Whether day saving time is active in destination. (Hex: 0X0026) /// DestinationDST = 38, /// /// DSPFirmwareVersion. (Hex: 0X0027) /// DSPFirmwareVersion = 39, /// /// CPUFirmwareVersion. (Hex: 0X0028) /// CPUFirmwareVersion = 40, /// /// Frame number. (Hex: 0X0029) /// FrameNumber = 41, /// /// Camera calculated light value, includes exposure compensation. (Hex: 0X002D) /// EffectiveLV = 45, /// /// Image processing. (Hex: 0X0032) /// ImageProcessing = 50, /// /// Picture mode. (Hex: 0X0033) /// PictureMode = 51, /// /// Drive mode. (Hex: 0X0034) /// DriveMode = 52, /// /// Color space. (Hex: 0X0037) /// ColorSpace = 55, /// /// Image area offset. (Hex: 0X0038) /// ImageAreaOffset = 56, /// /// Raw image size. (Hex: 0X0039) /// RawImageSize = 57, /// /// Preview image borders. (Hex: 0X003E) /// PreviewImageBorders = 62, /// /// Lens type. (Hex: 0X003F) /// LensType = 63, /// /// Sensitivity adjust. (Hex: 0X0040) /// SensitivityAdjust = 64, /// /// Digital filter. (Hex: 0X0041) /// DigitalFilter = 65, /// /// Camera temperature. (Hex: 0X0047) /// Temperature = 71, /// /// AE lock. (Hex: 0X0048) /// AELock = 72, /// /// Noise reduction. (Hex: 0X0049) /// NoiseReduction = 73, /// /// Flash exposure compensation. (Hex: 0X004D) /// FlashExposureCompensation = 77, /// /// Image tone. (Hex: 0X004F) /// ImageTone = 79, /// /// Colort temperature. (Hex: 0X0050) /// ColorTemperature = 80, /// /// Shake reduction information. (Hex: 0X005C) /// ShakeReduction = 92, /// /// Shutter count. (Hex: 0X005D) /// ShutterCount = 93, /// /// Dynamic range expansion. (Hex: 0X0069) /// DynamicRangeExpansion = 105, /// /// High ISO noise reduction. (Hex: 0X0071) /// HighISONoiseReduction = 113, /// /// AF Adjustment. (Hex: 0X0072) /// AFAdjustment = 114, /// /// Black point. (Hex: 0X0200) /// BlackPoint = 512, /// /// White point. (Hex: 0X0201) /// WhitePoint = 513, /// /// ShotInfo. (Hex: 0X0205) /// ShotInfo = 517, /// /// AEInfo. (Hex: 0X0206) /// AEInfo = 518, /// /// LensInfo. (Hex: 0X0207) /// LensInfo = 519, /// /// FlashInfo. (Hex: 0X0208) /// FlashInfo = 520, /// /// AEMeteringSegments. (Hex: 0X0209) /// AEMeteringSegments = 521, /// /// FlashADump. (Hex: 0X020A) /// FlashADump = 522, /// /// FlashBDump. (Hex: 0X020B) /// FlashBDump = 523, /// /// WB_RGGBLevelsDaylight. (Hex: 0X020D) /// WB_RGGBLevelsDaylight = 525, /// /// WB_RGGBLevelsShade. (Hex: 0X020E) /// WB_RGGBLevelsShade = 526, /// /// WB_RGGBLevelsCloudy. (Hex: 0X020F) /// WB_RGGBLevelsCloudy = 527, /// /// WB_RGGBLevelsTungsten. (Hex: 0X0210) /// WB_RGGBLevelsTungsten = 528, /// /// WB_RGGBLevelsFluorescentD. (Hex: 0X0211) /// WB_RGGBLevelsFluorescentD = 529, /// /// WB_RGGBLevelsFluorescentN. (Hex: 0X0212) /// WB_RGGBLevelsFluorescentN = 530, /// /// WB_RGGBLevelsFluorescentW. (Hex: 0X0213) /// WB_RGGBLevelsFluorescentW = 531, /// /// WB_RGGBLevelsFlash. (Hex: 0X0214) /// WB_RGGBLevelsFlash = 532, /// /// CameraInfo. (Hex: 0X0215) /// CameraInfo = 533, /// /// BatteryInfo. (Hex: 0X0216) /// BatteryInfo = 534, /// /// AFInfo. (Hex: 0X021F) /// AFInfo = 543, /// /// ColorInfo. (Hex: 0X0222) /// ColorInfo = 546, /// /// Serial Number. (Hex: 0X0229) /// SerialNumber = 553, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonIsoInfoEntryTag.cs0000644000175000017500000000276311521241310023772 0ustar00alexalex00000000000000// // NikonIsoInfoEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon Iso Info entry tags. /// Based on: /// http://exiv2.org/tags-nikon.html /// public enum NikonIsoInfoEntryTag : ushort { /// /// ISO. (Hex: 0X0000) /// ISO = 0, /// /// ISO expansion. (Hex: 0X0004) /// ISOExpansion = 4, /// /// ISO 2. (Hex: 0X0006) /// ISO2 = 6, /// /// ISO expansion 2. (Hex: 0X000A) /// ISOExpansion2 = 10, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonLensData3EntryTag.cs0000644000175000017500000000554111521241310024177 0ustar00alexalex00000000000000// // NikonLensData3EntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon lens data entry tags. /// Based on: /// http://exiv2.org/tags-nikon.html /// public enum NikonLensData3EntryTag : ushort { /// /// Version. (Hex: 0X0000) /// Version = 0, /// /// Exit pupil position. (Hex: 0X0004) /// ExitPupilPosition = 4, /// /// AF aperture. (Hex: 0X0005) /// AFAperture = 5, /// /// Focus position. (Hex: 0X0008) /// FocusPosition = 8, /// /// Focus distance. (Hex: 0X000A) /// FocusDistance = 10, /// /// Focal length. (Hex: 0X000B) /// FocalLength = 11, /// /// Lens ID number. (Hex: 0X000C) /// LensIDNumber = 12, /// /// Lens F-stops. (Hex: 0X000D) /// LensFStops = 13, /// /// Min focal length. (Hex: 0X000E) /// MinFocalLength = 14, /// /// Max focal length. (Hex: 0X000F) /// MaxFocalLength = 15, /// /// Max aperture at min focal length. (Hex: 0X0010) /// MaxApertureAtMinFocal = 16, /// /// Max aperture at max focal length. (Hex: 0X0011) /// MaxApertureAtMaxFocal = 17, /// /// MCU version. (Hex: 0X0012) /// MCUVersion = 18, /// /// Effective max aperture. (Hex: 0X0013) /// EffectiveMaxAperture = 19, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/IFDEntryTag.cs0000644000175000017500000012656311521241310022034 0ustar00alexalex00000000000000// // IFDEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009-2010 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Entry tags occuring in a Tiff IFD, or IFD0 for Jpegs. They are mostly /// defined by the TIFF specification: /// http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf /// The complete overview can be obtained at: /// http://www.awaresystems.be/imaging/tiff.html /// public enum IFDEntryTag : ushort { /// /// A general indication of the kind of data contained in this subfile. (Hex: 0x00FE) /// http://www.awaresystems.be/imaging/tiff/tifftags/newsubfiletype.html /// NewSubfileType = 254, /// /// A general indication of the kind of data contained in this subfile. (Hex: 0x00FF) /// http://www.awaresystems.be/imaging/tiff/tifftags/subfiletype.html /// SubfileType = 255, /// /// The number of columns in the image, i.e., the number of pixels per row. (Hex: 0x0100) /// http://www.awaresystems.be/imaging/tiff/tifftags/imagewidth.html /// ImageWidth = 256, /// /// The number of rows of pixels in the image. (Hex: 0x0101) /// http://www.awaresystems.be/imaging/tiff/tifftags/imagelength.html /// ImageLength = 257, /// /// Number of bits per component. (Hex: 0x0102) /// http://www.awaresystems.be/imaging/tiff/tifftags/bitspersample.html /// BitsPerSample = 258, /// /// Compression scheme used on the image data. (Hex: 0x0103) /// http://www.awaresystems.be/imaging/tiff/tifftags/compression.html /// Compression = 259, /// /// The color space of the image data. (Hex: 0x0106) /// http://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html /// PhotometricInterpretation = 262, /// /// For black and white TIFF files that represent shades of gray, the technique used to convert from gray to black and white pixels. (Hex: 0x0107) /// http://www.awaresystems.be/imaging/tiff/tifftags/threshholding.html /// Threshholding = 263, /// /// The width of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. (Hex: 0x0108) /// http://www.awaresystems.be/imaging/tiff/tifftags/cellwidth.html /// CellWidth = 264, /// /// The length of the dithering or halftoning matrix used to create a dithered or halftoned bilevel file. (Hex: 0x0109) /// http://www.awaresystems.be/imaging/tiff/tifftags/celllength.html /// CellLength = 265, /// /// The logical order of bits within a byte. (Hex: 0x010A) /// http://www.awaresystems.be/imaging/tiff/tifftags/fillorder.html /// FillOrder = 266, /// /// The name of the document from which this image was scanned. (Hex: 0x010D) /// http://www.awaresystems.be/imaging/tiff/tifftags/documentname.html /// DocumentName = 269, /// /// A string that describes the subject of the image. (Hex: 0x010E) /// http://www.awaresystems.be/imaging/tiff/tifftags/imagedescription.html /// ImageDescription = 270, /// /// The scanner manufacturer. (Hex: 0x010F) /// http://www.awaresystems.be/imaging/tiff/tifftags/make.html /// Make = 271, /// /// The scanner model name or number. (Hex: 0x0110) /// http://www.awaresystems.be/imaging/tiff/tifftags/model.html /// Model = 272, /// /// For each strip, the byte offset of that strip. (Hex: 0x0111) /// http://www.awaresystems.be/imaging/tiff/tifftags/stripoffsets.html /// StripOffsets = 273, /// /// The orientation of the image with respect to the rows and columns. (Hex: 0x0112) /// http://www.awaresystems.be/imaging/tiff/tifftags/orientation.html /// Orientation = 274, /// /// The number of components per pixel. (Hex: 0x0115) /// http://www.awaresystems.be/imaging/tiff/tifftags/samplesperpixel.html /// SamplesPerPixel = 277, /// /// The number of rows per strip. (Hex: 0x0116) /// http://www.awaresystems.be/imaging/tiff/tifftags/rowsperstrip.html /// RowsPerStrip = 278, /// /// For each strip, the number of bytes in the strip after compression. (Hex: 0x0117) /// http://www.awaresystems.be/imaging/tiff/tifftags/stripbytecounts.html /// StripByteCounts = 279, /// /// The minimum component value used. (Hex: 0x0118) /// http://www.awaresystems.be/imaging/tiff/tifftags/minsamplevalue.html /// MinSampleValue = 280, /// /// The maximum component value used. (Hex: 0x0119) /// http://www.awaresystems.be/imaging/tiff/tifftags/maxsamplevalue.html /// MaxSampleValue = 281, /// /// The number of pixels per ResolutionUnit in the ImageWidth direction. (Hex: 0x011A) /// http://www.awaresystems.be/imaging/tiff/tifftags/xresolution.html /// XResolution = 282, /// /// The number of pixels per ResolutionUnit in the ImageLength direction. (Hex: 0x011B) /// http://www.awaresystems.be/imaging/tiff/tifftags/yresolution.html /// YResolution = 283, /// /// How the components of each pixel are stored. (Hex: 0x011C) /// http://www.awaresystems.be/imaging/tiff/tifftags/planarconfiguration.html /// PlanarConfiguration = 284, /// /// The name of the page from which this image was scanned. (Hex: 0x011D) /// http://www.awaresystems.be/imaging/tiff/tifftags/pagename.html /// PageName = 285, /// /// X position of the image. (Hex: 0x011E) /// http://www.awaresystems.be/imaging/tiff/tifftags/xposition.html /// XPosition = 286, /// /// Y position of the image. (Hex: 0x011F) /// http://www.awaresystems.be/imaging/tiff/tifftags/yposition.html /// YPosition = 287, /// /// For each string of contiguous unused bytes in a TIFF file, the byte offset of the string. (Hex: 0x0120) /// http://www.awaresystems.be/imaging/tiff/tifftags/freeoffsets.html /// FreeOffsets = 288, /// /// For each string of contiguous unused bytes in a TIFF file, the number of bytes in the string. (Hex: 0x0121) /// http://www.awaresystems.be/imaging/tiff/tifftags/freebytecounts.html /// FreeByteCounts = 289, /// /// The precision of the information contained in the GrayResponseCurve. (Hex: 0x0122) /// http://www.awaresystems.be/imaging/tiff/tifftags/grayresponseunit.html /// GrayResponseUnit = 290, /// /// For grayscale data, the optical density of each possible pixel value. (Hex: 0x0123) /// http://www.awaresystems.be/imaging/tiff/tifftags/grayresponsecurve.html /// GrayResponseCurve = 291, /// /// Options for Group 3 Fax compression (Hex: 0x0124) /// http://www.awaresystems.be/imaging/tiff/tifftags/t4options.html /// T4Options = 292, /// /// Options for Group 4 Fax compression (Hex: 0x0125) /// http://www.awaresystems.be/imaging/tiff/tifftags/t6options.html /// T6Options = 293, /// /// The unit of measurement for XResolution and YResolution. (Hex: 0x0128) /// http://www.awaresystems.be/imaging/tiff/tifftags/resolutionunit.html /// ResolutionUnit = 296, /// /// The page number of the page from which this image was scanned. (Hex: 0x0129) /// http://www.awaresystems.be/imaging/tiff/tifftags/pagenumber.html /// PageNumber = 297, /// /// Describes a transfer function for the image in tabular style. (Hex: 0x012D) /// http://www.awaresystems.be/imaging/tiff/tifftags/transferfunction.html /// TransferFunction = 301, /// /// Name and version number of the software package(s) used to create the image. (Hex: 0x0131) /// http://www.awaresystems.be/imaging/tiff/tifftags/software.html /// Software = 305, /// /// Date and time of image creation. (Hex: 0x0132) /// http://www.awaresystems.be/imaging/tiff/tifftags/datetime.html /// DateTime = 306, /// /// Person who created the image. (Hex: 0x013B) /// http://www.awaresystems.be/imaging/tiff/tifftags/artist.html /// Artist = 315, /// /// The computer and/or operating system in use at the time of image creation. (Hex: 0x013C) /// http://www.awaresystems.be/imaging/tiff/tifftags/hostcomputer.html /// HostComputer = 316, /// /// A mathematical operator that is applied to the image data before an encoding scheme is applied. (Hex: 0x013D) /// http://www.awaresystems.be/imaging/tiff/tifftags/predictor.html /// Predictor = 317, /// /// The chromaticity of the white point of the image. (Hex: 0x013E) /// http://www.awaresystems.be/imaging/tiff/tifftags/whitepoint.html /// WhitePoint = 318, /// /// The chromaticities of the primaries of the image. (Hex: 0x013F) /// http://www.awaresystems.be/imaging/tiff/tifftags/primarychromaticities.html /// PrimaryChromaticities = 319, /// /// A color map for palette color images. (Hex: 0x0140) /// http://www.awaresystems.be/imaging/tiff/tifftags/colormap.html /// ColorMap = 320, /// /// Conveys to the halftone function the range of gray levels within a colorimetrically-specified image that should retain tonal detail. (Hex: 0x0141) /// http://www.awaresystems.be/imaging/tiff/tifftags/halftonehints.html /// HalftoneHints = 321, /// /// The tile width in pixels. This is the number of columns in each tile. (Hex: 0x0142) /// http://www.awaresystems.be/imaging/tiff/tifftags/tilewidth.html /// TileWidth = 322, /// /// The tile length (height) in pixels. This is the number of rows in each tile. (Hex: 0x0143) /// http://www.awaresystems.be/imaging/tiff/tifftags/tilelength.html /// TileLength = 323, /// /// For each tile, the byte offset of that tile, as compressed and stored on disk. (Hex: 0x0144) /// http://www.awaresystems.be/imaging/tiff/tifftags/tileoffsets.html /// TileOffsets = 324, /// /// For each tile, the number of (compressed) bytes in that tile. (Hex: 0x0145) /// http://www.awaresystems.be/imaging/tiff/tifftags/tilebytecounts.html /// TileByteCounts = 325, /// /// Used in the TIFF-F standard, denotes the number of 'bad' scan lines encountered by the facsimile device. (Hex: 0x0146) /// http://www.awaresystems.be/imaging/tiff/tifftags/badfaxlines.html /// BadFaxLines = 326, /// /// Used in the TIFF-F standard, indicates if 'bad' lines encountered during reception are stored in the data, or if 'bad' lines have been replaced by the receiver. (Hex: 0x0147) /// http://www.awaresystems.be/imaging/tiff/tifftags/cleanfaxdata.html /// CleanFaxData = 327, /// /// Used in the TIFF-F standard, denotes the maximum number of consecutive 'bad' scanlines received. (Hex: 0x0148) /// http://www.awaresystems.be/imaging/tiff/tifftags/consecutivebadfaxlines.html /// ConsecutiveBadFaxLines = 328, /// /// Offset to child IFDs. (Hex: 0x014A) /// http://www.awaresystems.be/imaging/tiff/tifftags/subifds.html /// SubIFDs = 330, /// /// The set of inks used in a separated (PhotometricInterpretation=5) image. (Hex: 0x014C) /// http://www.awaresystems.be/imaging/tiff/tifftags/inkset.html /// InkSet = 332, /// /// The name of each ink used in a separated image. (Hex: 0x014D) /// http://www.awaresystems.be/imaging/tiff/tifftags/inknames.html /// InkNames = 333, /// /// The number of inks. (Hex: 0x014E) /// http://www.awaresystems.be/imaging/tiff/tifftags/numberofinks.html /// NumberOfInks = 334, /// /// The component values that correspond to a 0% dot and 100% dot. (Hex: 0x0150) /// http://www.awaresystems.be/imaging/tiff/tifftags/dotrange.html /// DotRange = 336, /// /// A description of the printing environment for which this separation is intended. (Hex: 0x0151) /// http://www.awaresystems.be/imaging/tiff/tifftags/targetprinter.html /// TargetPrinter = 337, /// /// Description of extra components. (Hex: 0x0152) /// http://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html /// ExtraSamples = 338, /// /// Specifies how to interpret each data sample in a pixel. (Hex: 0x0153) /// http://www.awaresystems.be/imaging/tiff/tifftags/sampleformat.html /// SampleFormat = 339, /// /// Specifies the minimum sample value. (Hex: 0x0154) /// http://www.awaresystems.be/imaging/tiff/tifftags/sminsamplevalue.html /// SMinSampleValue = 340, /// /// Specifies the maximum sample value. (Hex: 0x0155) /// http://www.awaresystems.be/imaging/tiff/tifftags/smaxsamplevalue.html /// SMaxSampleValue = 341, /// /// Expands the range of the TransferFunction. (Hex: 0x0156) /// http://www.awaresystems.be/imaging/tiff/tifftags/transferrange.html /// TransferRange = 342, /// /// Mirrors the essentials of PostScript's path creation functionality. (Hex: 0x0157) /// http://www.awaresystems.be/imaging/tiff/tifftags/clippath.html /// ClipPath = 343, /// /// The number of units that span the width of the image, in terms of integer ClipPath coordinates. (Hex: 0x0158) /// http://www.awaresystems.be/imaging/tiff/tifftags/xclippathunits.html /// XClipPathUnits = 344, /// /// The number of units that span the height of the image, in terms of integer ClipPath coordinates. (Hex: 0x0159) /// http://www.awaresystems.be/imaging/tiff/tifftags/yclippathunits.html /// YClipPathUnits = 345, /// /// Aims to broaden the support for indexed images to include support for any color space. (Hex: 0x015A) /// http://www.awaresystems.be/imaging/tiff/tifftags/indexed.html /// Indexed = 346, /// /// JPEG quantization and/or Huffman tables. (Hex: 0x015B) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegtables.html /// JPEGTables = 347, /// /// OPI-related. (Hex: 0x015F) /// http://www.awaresystems.be/imaging/tiff/tifftags/opiproxy.html /// OPIProxy = 351, /// /// Used in the TIFF-FX standard to point to an IFD containing tags that are globally applicable to the complete TIFF file. (Hex: 0x0190) /// http://www.awaresystems.be/imaging/tiff/tifftags/globalparametersifd.html /// GlobalParametersIFD = 400, /// /// Used in the TIFF-FX standard, denotes the type of data stored in this file or IFD. (Hex: 0x0191) /// http://www.awaresystems.be/imaging/tiff/tifftags/profiletype.html /// ProfileType = 401, /// /// Used in the TIFF-FX standard, denotes the 'profile' that applies to this file. (Hex: 0x0192) /// http://www.awaresystems.be/imaging/tiff/tifftags/faxprofile.html /// FaxProfile = 402, /// /// Used in the TIFF-FX standard, indicates which coding methods are used in the file. (Hex: 0x0193) /// http://www.awaresystems.be/imaging/tiff/tifftags/codingmethods.html /// CodingMethods = 403, /// /// Used in the TIFF-FX standard, denotes the year of the standard specified by the FaxProfile field. (Hex: 0x0194) /// http://www.awaresystems.be/imaging/tiff/tifftags/versionyear.html /// VersionYear = 404, /// /// Used in the TIFF-FX standard, denotes the mode of the standard specified by the FaxProfile field. (Hex: 0x0195) /// http://www.awaresystems.be/imaging/tiff/tifftags/modenumber.html /// ModeNumber = 405, /// /// Used in the TIFF-F and TIFF-FX standards, holds information about the ITULAB (PhotometricInterpretation = 10) encoding. (Hex: 0x01B1) /// http://www.awaresystems.be/imaging/tiff/tifftags/decode.html /// Decode = 433, /// /// Defined in the Mixed Raster Content part of RFC 2301, is the default color needed in areas where no image is available. (Hex: 0x01B2) /// http://www.awaresystems.be/imaging/tiff/tifftags/defaultimagecolor.html /// DefaultImageColor = 434, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0200) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegproc.html /// JPEGProc = 512, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0201) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpeginterchangeformat.html /// JPEGInterchangeFormat = 513, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0202) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpeginterchangeformatlength.html /// JPEGInterchangeFormatLength = 514, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0203) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegrestartinterval.html /// JPEGRestartInterval = 515, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0205) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpeglosslesspredictors.html /// JPEGLosslessPredictors = 517, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0206) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegpointtransforms.html /// JPEGPointTransforms = 518, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0207) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegqtables.html /// JPEGQTables = 519, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0208) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegdctables.html /// JPEGDCTables = 520, /// /// Old-style JPEG compression field. TechNote2 invalidates this part of the specification. (Hex: 0x0209) /// http://www.awaresystems.be/imaging/tiff/tifftags/jpegactables.html /// JPEGACTables = 521, /// /// The transformation from RGB to YCbCr image data. (Hex: 0x0211) /// http://www.awaresystems.be/imaging/tiff/tifftags/ycbcrcoefficients.html /// YCbCrCoefficients = 529, /// /// Specifies the subsampling factors used for the chrominance components of a YCbCr image. (Hex: 0x0212) /// http://www.awaresystems.be/imaging/tiff/tifftags/ycbcrsubsampling.html /// YCbCrSubSampling = 530, /// /// Specifies the positioning of subsampled chrominance components relative to luminance samples. (Hex: 0x0213) /// http://www.awaresystems.be/imaging/tiff/tifftags/ycbcrpositioning.html /// YCbCrPositioning = 531, /// /// Specifies a pair of headroom and footroom image data values (codes) for each pixel component. (Hex: 0x0214) /// http://www.awaresystems.be/imaging/tiff/tifftags/referenceblackwhite.html /// ReferenceBlackWhite = 532, /// /// Defined in the Mixed Raster Content part of RFC 2301, used to replace RowsPerStrip for IFDs with variable-sized strips. (Hex: 0x022F) /// http://www.awaresystems.be/imaging/tiff/tifftags/striprowcounts.html /// StripRowCounts = 559, /// /// XML packet containing XMP metadata (Hex: 0x02BC) /// http://www.awaresystems.be/imaging/tiff/tifftags/xmp.html /// XMP = 700, /// /// Rating tag used by Windows (Hex: 0x4746) /// Rating = 18246, /// /// Rating tag used by Windows, value in percent (Hex: 0x4749) /// RatingPercent = 18249, /// /// OPI-related. (Hex: 0x800D) /// http://www.awaresystems.be/imaging/tiff/tifftags/imageid.html /// ImageID = 32781, /// /// Annotation data, as used in 'Imaging for Windows'. (Hex: 0x80A4) /// http://www.awaresystems.be/imaging/tiff/tifftags/wangannotation.html /// WangAnnotation = 32932, /// /// Copyright notice. (Hex: 0x8298) /// http://www.awaresystems.be/imaging/tiff/tifftags/copyright.html /// Copyright = 33432, /// /// Specifies the pixel data format encoding in the Molecular Dynamics GEL file format. (Hex: 0x82A5) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdfiletag.html /// MDFileTag = 33445, /// /// Specifies a scale factor in the Molecular Dynamics GEL file format. (Hex: 0x82A6) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdscalepixel.html /// MDScalePixel = 33446, /// /// Used to specify the conversion from 16bit to 8bit in the Molecular Dynamics GEL file format. (Hex: 0x82A7) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdcolortable.html /// MDColorTable = 33447, /// /// Name of the lab that scanned this file, as used in the Molecular Dynamics GEL file format. (Hex: 0x82A8) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdlabname.html /// MDLabName = 33448, /// /// Information about the sample, as used in the Molecular Dynamics GEL file format. (Hex: 0x82A9) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdsampleinfo.html /// MDSampleInfo = 33449, /// /// Date the sample was prepared, as used in the Molecular Dynamics GEL file format. (Hex: 0x82AA) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdprepdate.html /// MDPrepDate = 33450, /// /// Time the sample was prepared, as used in the Molecular Dynamics GEL file format. (Hex: 0x82AB) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdpreptime.html /// MDPrepTime = 33451, /// /// Units for data in this file, as used in the Molecular Dynamics GEL file format. (Hex: 0x82AC) /// http://www.awaresystems.be/imaging/tiff/tifftags/mdfileunits.html /// MDFileUnits = 33452, /// /// Used in interchangeable GeoTIFF files. (Hex: 0x830E) /// http://www.awaresystems.be/imaging/tiff/tifftags/modelpixelscaletag.html /// ModelPixelScaleTag = 33550, /// /// IPTC (International Press Telecommunications Council) metadata. (Hex: 0x83BB) /// http://www.awaresystems.be/imaging/tiff/tifftags/iptc.html /// IPTC = 33723, /// /// Intergraph Application specific storage. (Hex: 0x847E) /// http://www.awaresystems.be/imaging/tiff/tifftags/ingrpacketdatatag.html /// INGRPacketDataTag = 33918, /// /// Intergraph Application specific flags. (Hex: 0x847F) /// http://www.awaresystems.be/imaging/tiff/tifftags/ingrflagregisters.html /// INGRFlagRegisters = 33919, /// /// Originally part of Intergraph's GeoTIFF tags, but likely understood by IrasB only. (Hex: 0x8480) /// http://www.awaresystems.be/imaging/tiff/tifftags/irasbtransformationmatrix.html /// IrasBTransformationMatrix = 33920, /// /// Originally part of Intergraph's GeoTIFF tags, but now used in interchangeable GeoTIFF files. (Hex: 0x8482) /// http://www.awaresystems.be/imaging/tiff/tifftags/modeltiepointtag.html /// ModelTiepointTag = 33922, /// /// Used in interchangeable GeoTIFF files. (Hex: 0x85D8) /// http://www.awaresystems.be/imaging/tiff/tifftags/modeltransformationtag.html /// ModelTransformationTag = 34264, /// /// Collection of Photoshop 'Image Resource Blocks'. (Hex: 0x8649) /// http://www.awaresystems.be/imaging/tiff/tifftags/photoshop.html /// Photoshop = 34377, /// /// A pointer to the Exif IFD. (Hex: 0x8769) /// http://www.awaresystems.be/imaging/tiff/tifftags/exififd.html /// ExifIFD = 34665, /// /// ICC profile data. (Hex: 0x8773) /// http://www.awaresystems.be/imaging/tiff/tifftags/iccprofile.html /// ICCProfile = 34675, /// /// Defined in the Mixed Raster Content part of RFC 2301, used to denote the particular function of this Image in the mixed raster scheme. (Hex: 0x87AC) /// http://www.awaresystems.be/imaging/tiff/tifftags/imagelayer.html /// ImageLayer = 34732, /// /// Used in interchangeable GeoTIFF files. (Hex: 0x87AF) /// http://www.awaresystems.be/imaging/tiff/tifftags/geokeydirectorytag.html /// GeoKeyDirectoryTag = 34735, /// /// Used in interchangeable GeoTIFF files. (Hex: 0x87B0) /// http://www.awaresystems.be/imaging/tiff/tifftags/geodoubleparamstag.html /// GeoDoubleParamsTag = 34736, /// /// Used in interchangeable GeoTIFF files. (Hex: 0x87B1) /// http://www.awaresystems.be/imaging/tiff/tifftags/geoasciiparamstag.html /// GeoAsciiParamsTag = 34737, /// /// A pointer to the Exif-related GPS Info IFD. (Hex: 0x8825) /// http://www.awaresystems.be/imaging/tiff/tifftags/gpsifd.html /// GPSIFD = 34853, /// /// Used by HylaFAX. (Hex: 0x885C) /// http://www.awaresystems.be/imaging/tiff/tifftags/hylafaxfaxrecvparams.html /// HylaFAXFaxRecvParams = 34908, /// /// Used by HylaFAX. (Hex: 0x885D) /// http://www.awaresystems.be/imaging/tiff/tifftags/hylafaxfaxsubaddress.html /// HylaFAXFaxSubAddress = 34909, /// /// Used by HylaFAX. (Hex: 0x885E) /// http://www.awaresystems.be/imaging/tiff/tifftags/hylafaxfaxrecvtime.html /// HylaFAXFaxRecvTime = 34910, /// /// Used by Adobe Photoshop. (Hex: 0x935C) /// http://www.awaresystems.be/imaging/tiff/tifftags/imagesourcedata.html /// ImageSourceData = 37724, /// /// A pointer to the Exif-related Interoperability IFD. (Hex: 0xA005) /// http://www.awaresystems.be/imaging/tiff/tifftags/interoperabilityifd.html /// InteroperabilityIFD = 40965, /// /// Used by the GDAL library, holds an XML list of name=value 'metadata' values about the image as a whole, and about specific samples. (Hex: 0xA480) /// http://www.awaresystems.be/imaging/tiff/tifftags/gdal_metadata.html /// GDAL_METADATA = 42112, /// /// Used by the GDAL library, contains an ASCII encoded nodata or background pixel value. (Hex: 0xA481) /// http://www.awaresystems.be/imaging/tiff/tifftags/gdal_nodata.html /// GDAL_NODATA = 42113, /// /// Used in the Oce scanning process. (Hex: 0xC427) /// http://www.awaresystems.be/imaging/tiff/tifftags/ocescanjobdescription.html /// OceScanjobDescription = 50215, /// /// Used in the Oce scanning process. (Hex: 0xC428) /// http://www.awaresystems.be/imaging/tiff/tifftags/oceapplicationselector.html /// OceApplicationSelector = 50216, /// /// Used in the Oce scanning process. (Hex: 0xC429) /// http://www.awaresystems.be/imaging/tiff/tifftags/oceidentificationnumber.html /// OceIdentificationNumber = 50217, /// /// Used in the Oce scanning process. (Hex: 0xC42A) /// http://www.awaresystems.be/imaging/tiff/tifftags/oceimagelogiccharacteristics.html /// OceImageLogicCharacteristics = 50218, /// /// Used in IFD 0 of DNG files. (Hex: 0xC612) /// http://www.awaresystems.be/imaging/tiff/tifftags/dngversion.html /// DNGVersion = 50706, /// /// Used in IFD 0 of DNG files. (Hex: 0xC613) /// http://www.awaresystems.be/imaging/tiff/tifftags/dngbackwardversion.html /// DNGBackwardVersion = 50707, /// /// Used in IFD 0 of DNG files. (Hex: 0xC614) /// http://www.awaresystems.be/imaging/tiff/tifftags/uniquecameramodel.html /// UniqueCameraModel = 50708, /// /// Used in IFD 0 of DNG files. (Hex: 0xC615) /// http://www.awaresystems.be/imaging/tiff/tifftags/localizedcameramodel.html /// LocalizedCameraModel = 50709, /// /// Used in Raw IFD of DNG files. (Hex: 0xC616) /// http://www.awaresystems.be/imaging/tiff/tifftags/cfaplanecolor.html /// CFAPlaneColor = 50710, /// /// Used in Raw IFD of DNG files. (Hex: 0xC617) /// http://www.awaresystems.be/imaging/tiff/tifftags/cfalayout.html /// CFALayout = 50711, /// /// Used in Raw IFD of DNG files. (Hex: 0xC618) /// http://www.awaresystems.be/imaging/tiff/tifftags/linearizationtable.html /// LinearizationTable = 50712, /// /// Used in Raw IFD of DNG files. (Hex: 0xC619) /// http://www.awaresystems.be/imaging/tiff/tifftags/blacklevelrepeatdim.html /// BlackLevelRepeatDim = 50713, /// /// Used in Raw IFD of DNG files. (Hex: 0xC61A) /// http://www.awaresystems.be/imaging/tiff/tifftags/blacklevel.html /// BlackLevel = 50714, /// /// Used in Raw IFD of DNG files. (Hex: 0xC61B) /// http://www.awaresystems.be/imaging/tiff/tifftags/blackleveldeltah.html /// BlackLevelDeltaH = 50715, /// /// Used in Raw IFD of DNG files. (Hex: 0xC61C) /// http://www.awaresystems.be/imaging/tiff/tifftags/blackleveldeltav.html /// BlackLevelDeltaV = 50716, /// /// Used in Raw IFD of DNG files. (Hex: 0xC61D) /// http://www.awaresystems.be/imaging/tiff/tifftags/whitelevel.html /// WhiteLevel = 50717, /// /// Used in Raw IFD of DNG files. (Hex: 0xC61E) /// http://www.awaresystems.be/imaging/tiff/tifftags/defaultscale.html /// DefaultScale = 50718, /// /// Used in Raw IFD of DNG files. (Hex: 0xC61F) /// http://www.awaresystems.be/imaging/tiff/tifftags/defaultcroporigin.html /// DefaultCropOrigin = 50719, /// /// Used in Raw IFD of DNG files. (Hex: 0xC620) /// http://www.awaresystems.be/imaging/tiff/tifftags/defaultcropsize.html /// DefaultCropSize = 50720, /// /// Used in IFD 0 of DNG files. (Hex: 0xC621) /// http://www.awaresystems.be/imaging/tiff/tifftags/colormatrix1.html /// ColorMatrix1 = 50721, /// /// Used in IFD 0 of DNG files. (Hex: 0xC622) /// http://www.awaresystems.be/imaging/tiff/tifftags/colormatrix2.html /// ColorMatrix2 = 50722, /// /// Used in IFD 0 of DNG files. (Hex: 0xC623) /// http://www.awaresystems.be/imaging/tiff/tifftags/cameracalibration1.html /// CameraCalibration1 = 50723, /// /// Used in IFD 0 of DNG files. (Hex: 0xC624) /// http://www.awaresystems.be/imaging/tiff/tifftags/cameracalibration2.html /// CameraCalibration2 = 50724, /// /// Used in IFD 0 of DNG files. (Hex: 0xC625) /// http://www.awaresystems.be/imaging/tiff/tifftags/reductionmatrix1.html /// ReductionMatrix1 = 50725, /// /// Used in IFD 0 of DNG files. (Hex: 0xC626) /// http://www.awaresystems.be/imaging/tiff/tifftags/reductionmatrix2.html /// ReductionMatrix2 = 50726, /// /// Used in IFD 0 of DNG files. (Hex: 0xC627) /// http://www.awaresystems.be/imaging/tiff/tifftags/analogbalance.html /// AnalogBalance = 50727, /// /// Used in IFD 0 of DNG files. (Hex: 0xC628) /// http://www.awaresystems.be/imaging/tiff/tifftags/asshotneutral.html /// AsShotNeutral = 50728, /// /// Used in IFD 0 of DNG files. (Hex: 0xC629) /// http://www.awaresystems.be/imaging/tiff/tifftags/asshotwhitexy.html /// AsShotWhiteXY = 50729, /// /// Used in IFD 0 of DNG files. (Hex: 0xC62A) /// http://www.awaresystems.be/imaging/tiff/tifftags/baselineexposure.html /// BaselineExposure = 50730, /// /// Used in IFD 0 of DNG files. (Hex: 0xC62B) /// http://www.awaresystems.be/imaging/tiff/tifftags/baselinenoise.html /// BaselineNoise = 50731, /// /// Used in IFD 0 of DNG files. (Hex: 0xC62C) /// http://www.awaresystems.be/imaging/tiff/tifftags/baselinesharpness.html /// BaselineSharpness = 50732, /// /// Used in Raw IFD of DNG files. (Hex: 0xC62D) /// http://www.awaresystems.be/imaging/tiff/tifftags/bayergreensplit.html /// BayerGreenSplit = 50733, /// /// Used in IFD 0 of DNG files. (Hex: 0xC62E) /// http://www.awaresystems.be/imaging/tiff/tifftags/linearresponselimit.html /// LinearResponseLimit = 50734, /// /// Used in IFD 0 of DNG files. (Hex: 0xC62F) /// http://www.awaresystems.be/imaging/tiff/tifftags/cameraserialnumber.html /// CameraSerialNumber = 50735, /// /// Used in IFD 0 of DNG files. (Hex: 0xC630) /// http://www.awaresystems.be/imaging/tiff/tifftags/lensinfo.html /// LensInfo = 50736, /// /// Used in Raw IFD of DNG files. (Hex: 0xC631) /// http://www.awaresystems.be/imaging/tiff/tifftags/chromablurradius.html /// ChromaBlurRadius = 50737, /// /// Used in Raw IFD of DNG files. (Hex: 0xC632) /// http://www.awaresystems.be/imaging/tiff/tifftags/antialiasstrength.html /// AntiAliasStrength = 50738, /// /// Used in IFD 0 of DNG files. (Hex: 0xC634) /// http://www.awaresystems.be/imaging/tiff/tifftags/dngprivatedata.html /// DNGPrivateData = 50740, /// /// Used in IFD 0 of DNG files. (Hex: 0xC635) /// http://www.awaresystems.be/imaging/tiff/tifftags/makernotesafety.html /// MakerNoteSafety = 50741, /// /// Used in IFD 0 of DNG files. (Hex: 0xC65A) /// http://www.awaresystems.be/imaging/tiff/tifftags/calibrationilluminant1.html /// CalibrationIlluminant1 = 50778, /// /// Used in IFD 0 of DNG files. (Hex: 0xC65B) /// http://www.awaresystems.be/imaging/tiff/tifftags/calibrationilluminant2.html /// CalibrationIlluminant2 = 50779, /// /// Used in Raw IFD of DNG files. (Hex: 0xC65C) /// http://www.awaresystems.be/imaging/tiff/tifftags/bestqualityscale.html /// BestQualityScale = 50780, /// /// Alias Sketchbook Pro layer usage description. (Hex: 0xC660) /// http://www.awaresystems.be/imaging/tiff/tifftags/aliaslayermetadata.html /// AliasLayerMetadata = 50784, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonVibrationReductionEntryTag.cs0000644000175000017500000000243511521241310026232 0ustar00alexalex00000000000000// // NikonVibrationReductionEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon vibration reduction entry tags. /// Based on: /// http://exiv2.org/tags-nikon.html /// public enum NikonVibrationReductionEntryTag : ushort { /// /// Version. (Hex: 0X0000) /// Version = 0, /// /// Vibration reduction. (Hex: 0X0004) /// VibrationReduction = 4, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/ExifEntryTag.cs0000644000175000017500000004172111521241310022315 0ustar00alexalex00000000000000// // ExifEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009-2010 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Entry tags occuring in the Exif IFD /// The complete overview can be obtained at: /// http://www.awaresystems.be/imaging/tiff.html /// public enum ExifEntryTag : ushort { /// /// Contains two values representing the minimum rows and columns /// to define the repeating patterns of the color filter array. /// (Hex: 0x828D) /// CFARepeatPatternDim = 33421, /// /// Contains two values representing the minimum rows and columns /// to define the repeating patterns of the color filter array. /// (Hex: 0x828E) /// CFAPattern = 33422, /// /// Exposure time, given in seconds. (Hex: 0x829A) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposuretime.html /// ExposureTime = 33434, /// /// The F number. (Hex: 0x829D) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/fnumber.html /// FNumber = 33437, /// /// The class of the program used by the camera to set exposure when the picture is taken. (Hex: 0x8822) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposureprogram.html /// ExposureProgram = 34850, /// /// Indicates the spectral sensitivity of each channel of the camera used. (Hex: 0x8824) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/spectralsensitivity.html /// SpectralSensitivity = 34852, /// /// Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. (Hex: 0x8827) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/isospeedratings.html /// ISOSpeedRatings = 34855, /// /// Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. (Hex: 0x8828) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/oecf.html /// OECF = 34856, /// /// The version of the supported Exif standard. (Hex: 0x9000) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exifversion.html /// ExifVersion = 36864, /// /// The date and time when the original image data was generated. (Hex: 0x9003) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/datetimeoriginal.html /// DateTimeOriginal = 36867, /// /// The date and time when the image was stored as digital data. (Hex: 0x9004) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/datetimedigitized.html /// DateTimeDigitized = 36868, /// /// Specific to compressed data; specifies the channels and complements PhotometricInterpretation (Hex: 0x9101) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/componentsconfiguration.html /// ComponentsConfiguration = 37121, /// /// Specific to compressed data; states the compressed bits per pixel. (Hex: 0x9102) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/compressedbitsperpixel.html /// CompressedBitsPerPixel = 37122, /// /// Shutter speed. (Hex: 0x9201) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/shutterspeedvalue.html /// ShutterSpeedValue = 37377, /// /// The lens aperture. (Hex: 0x9202) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/aperturevalue.html /// ApertureValue = 37378, /// /// The value of brightness. (Hex: 0x9203) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/brightnessvalue.html /// BrightnessValue = 37379, /// /// The exposure bias. (Hex: 0x9204) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposurebiasvalue.html /// ExposureBiasValue = 37380, /// /// The smallest F number of the lens. (Hex: 0x9205) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/maxaperturevalue.html /// MaxApertureValue = 37381, /// /// The distance to the subject, given in meters. (Hex: 0x9206) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectdistance.html /// SubjectDistance = 37382, /// /// The metering mode. (Hex: 0x9207) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/meteringmode.html /// MeteringMode = 37383, /// /// The kind of light source. (Hex: 0x9208) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/lightsource.html /// LightSource = 37384, /// /// Indicates the status of flash when the image was shot. (Hex: 0x9209) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/flash.html /// Flash = 37385, /// /// The actual focal length of the lens, in mm. (Hex: 0x920A) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focallength.html /// FocalLength = 37386, /// /// Indicates the location and area of the main subject in the overall scene. (Hex: 0x9214) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectarea.html /// SubjectArea = 37396, /// /// Manufacturer specific information. (Hex: 0x927C) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/makernote.html /// MakerNote = 37500, /// /// Keywords or comments on the image; complements ImageDescription. (Hex: 0x9286) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/usercomment.html /// UserComment = 37510, /// /// A tag used to record fractions of seconds for the DateTime tag. (Hex: 0x9290) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subsectime.html /// SubsecTime = 37520, /// /// A tag used to record fractions of seconds for the DateTimeOriginal tag. (Hex: 0x9291) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subsectimeoriginal.html /// SubsecTimeOriginal = 37521, /// /// A tag used to record fractions of seconds for the DateTimeDigitized tag. (Hex: 0x9292) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subsectimedigitized.html /// SubsecTimeDigitized = 37522, /// /// The Flashpix format version supported by a FPXR file. (Hex: 0xA000) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/flashpixversion.html /// FlashpixVersion = 40960, /// /// The color space information tag is always recorded as the color space specifier. (Hex: 0xA001) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/colorspace.html /// ColorSpace = 40961, /// /// Specific to compressed data; the valid width of the meaningful image. (Hex: 0xA002) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/pixelxdimension.html /// PixelXDimension = 40962, /// /// Specific to compressed data; the valid height of the meaningful image. (Hex: 0xA003) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/pixelydimension.html /// PixelYDimension = 40963, /// /// Used to record the name of an audio file related to the image data. (Hex: 0xA004) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/relatedsoundfile.html /// RelatedSoundFile = 40964, /// /// Indicates the strobe energy at the time the image is captured, as measured in Beam Candle Power Seconds (Hex: 0xA20B) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/flashenergy.html /// FlashEnergy = 41483, /// /// Records the camera or input device spatial frequency table and SFR values in the direction of image width, image height, and diagonal direction, as specified in ISO 12233. (Hex: 0xA20C) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/spatialfrequencyresponse.html /// SpatialFrequencyResponse = 41484, /// /// Indicates the number of pixels in the image width (X) direction per FocalPlaneResolutionUnit on the camera focal plane. (Hex: 0xA20E) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focalplanexresolution.html /// FocalPlaneXResolution = 41486, /// /// Indicates the number of pixels in the image height (Y) direction per FocalPlaneResolutionUnit on the camera focal plane. (Hex: 0xA20F) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focalplaneyresolution.html /// FocalPlaneYResolution = 41487, /// /// Indicates the unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. (Hex: 0xA210) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focalplaneresolutionunit.html /// FocalPlaneResolutionUnit = 41488, /// /// Indicates the location of the main subject in the scene. (Hex: 0xA214) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectlocation.html /// SubjectLocation = 41492, /// /// Indicates the exposure index selected on the camera or input device at the time the image is captured. (Hex: 0xA215) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposureindex.html /// ExposureIndex = 41493, /// /// Indicates the image sensor type on the camera or input device. (Hex: 0xA217) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/sensingmethod.html /// SensingMethod = 41495, /// /// Indicates the image source. (Hex: 0xA300) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/filesource.html /// FileSource = 41728, /// /// Indicates the type of scene. (Hex: 0xA301) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/scenetype.html /// SceneType = 41729, /// /// Indicates the color filter array (CFA) geometric pattern of the image sensor when a one-chip color area sensor is used. (Hex: 0xA302) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/cfapattern.html /// CFAPattern2 = 41730, /// /// Indicates the use of special processing on image data, such as rendering geared to output. (Hex: 0xA401) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/customrendered.html /// CustomRendered = 41985, /// /// Indicates the exposure mode set when the image was shot. (Hex: 0xA402) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/exposuremode.html /// ExposureMode = 41986, /// /// Indicates the white balance mode set when the image was shot. (Hex: 0xA403) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/whitebalance.html /// WhiteBalance = 41987, /// /// Indicates the digital zoom ratio when the image was shot. (Hex: 0xA404) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/digitalzoomratio.html /// DigitalZoomRatio = 41988, /// /// Indicates the equivalent focal length assuming a 35mm film camera, in mm. (Hex: 0xA405) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/focallengthin35mmfilm.html /// FocalLengthIn35mmFilm = 41989, /// /// Indicates the type of scene that was shot. (Hex: 0xA406) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/scenecapturetype.html /// SceneCaptureType = 41990, /// /// Indicates the degree of overall image gain adjustment. (Hex: 0xA407) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/gaincontrol.html /// GainControl = 41991, /// /// Indicates the direction of contrast processing applied by the camera when the image was shot. (Hex: 0xA408) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/contrast.html /// Contrast = 41992, /// /// Indicates the direction of saturation processing applied by the camera when the image was shot. (Hex: 0xA409) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/saturation.html /// Saturation = 41993, /// /// Indicates the direction of sharpness processing applied by the camera when the image was shot. (Hex: 0xA40A) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/sharpness.html /// Sharpness = 41994, /// /// This tag indicates information on the picture-taking conditions of a particular camera model. (Hex: 0xA40B) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/devicesettingdescription.html /// DeviceSettingDescription = 41995, /// /// Indicates the distance to the subject. (Hex: 0xA40C) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/subjectdistancerange.html /// SubjectDistanceRange = 41996, /// /// Indicates an identifier assigned uniquely to each image. (Hex: 0xA420) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif/imageuniqueid.html /// ImageUniqueID = 42016, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonPictureControlEntryTag.cs0000644000175000017500000000522311521241310025372 0ustar00alexalex00000000000000// // NikonPictureControlEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon picture control entry tags. /// Based on: /// http://exiv2.org/tags-nikon.html /// public enum NikonPictureControlEntryTag : ushort { /// /// Version. (Hex: 0X0000) /// Version = 0, /// /// Name. (Hex: 0X0004) /// Name = 4, /// /// Base. (Hex: 0X0018) /// Base = 24, /// /// Adjust. (Hex: 0X0030) /// Adjust = 48, /// /// Quick adjust. (Hex: 0X0031) /// QuickAdjust = 49, /// /// Sharpness. (Hex: 0X0032) /// Sharpness = 50, /// /// Contrast. (Hex: 0X0033) /// Contrast = 51, /// /// Brightness. (Hex: 0X0034) /// Brightness = 52, /// /// Saturation. (Hex: 0X0035) /// Saturation = 53, /// /// Hue adjustment. (Hex: 0X0036) /// HueAdjustment = 54, /// /// Filter effect. (Hex: 0X0037) /// FilterEffect = 55, /// /// Toning effect. (Hex: 0X0038) /// ToningEffect = 56, /// /// Toning saturation. (Hex: 0X0039) /// ToningSaturation = 57, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/CanonPictureInfoEntryTag.cs0000644000175000017500000000345111521241310024626 0ustar00alexalex00000000000000// // CanonPictureInfoEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Label tags for Canon Picture Info. /// Based on http://www.exiv2.org/tags-canon.html /// public enum CanonPictureInfoEntryTag : ushort { /// /// Image width. (Hex: 0X0002) /// ImageWidth = 2, /// /// Image height. (Hex: 0X0003) /// ImageHeight = 3, /// /// Image width (as shot). (Hex: 0X0004) /// ImageWidthAsShot = 4, /// /// Image height (as shot). (Hex: 0X0005) /// ImageHeightAsShot = 5, /// /// AF points used. (Hex: 0X0016) /// AFPointsUsed = 22, /// /// AF points used (20D). (Hex: 0X001A) /// AFPointsUsed20D = 26, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/OlympusMakerNoteEntryTag.cs0000644000175000017500000002324711521241310024703 0ustar00alexalex00000000000000// // OlympusMakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Olympus makernote tags. /// Based on http://www.exiv2.org/tags-olympus.html /// public enum OlympusMakerNoteEntryTag : ushort { /// /// Thumbnail image. (Hex: 0X0100) /// ThumbnailImage = 256, /// /// Picture taking mode. (Hex: 0X0200) /// SpecialMode = 512, /// /// Image quality setting. (Hex: 0X0201) /// Quality = 513, /// /// Macro mode. (Hex: 0X0202) /// Macro = 514, /// /// Black and white mode. (Hex: 0X0203) /// BWMode = 515, /// /// Digital zoom ratio. (Hex: 0X0204) /// DigitalZoom = 516, /// /// Focal plane diagonal. (Hex: 0X0205) /// FocalPlaneDiagonal = 517, /// /// Lens distortion parameters. (Hex: 0X0206) /// LensDistortionParams = 518, /// /// Software firmware version. (Hex: 0X0207) /// FirmwareVersion = 519, /// /// ASCII format data such as [PictureInfo]. (Hex: 0X0208) /// PictureInfo = 520, /// /// Camera ID data. (Hex: 0X0209) /// CameraID = 521, /// /// Pre-capture frames. (Hex: 0X0300) /// PreCaptureFrames = 768, /// /// One touch white balance. (Hex: 0X0302) /// OneTouchWB = 770, /// /// Serial number. (Hex: 0X0404) /// SerialNumber = 1028, /// /// PrintIM information. (Hex: 0X0E00) /// PrintIM = 3584, /// /// Various camera settings 1. (Hex: 0X0F00) /// DataDump1 = 3840, /// /// Various camera settings 2. (Hex: 0X0F01) /// DataDump2 = 3841, /// /// Shutter speed value. (Hex: 0X1000) /// ShutterSpeed = 4096, /// /// ISO speed value. (Hex: 0X1001) /// ISOSpeed = 4097, /// /// Aperture value. (Hex: 0X1002) /// ApertureValue = 4098, /// /// Brightness value. (Hex: 0X1003) /// Brightness = 4099, /// /// Flash mode. (Hex: 0X1004) /// FlashMode = 4100, /// /// Flash device. (Hex: 0X1005) /// FlashDevice = 4101, /// /// Exposure compensation value. (Hex: 0X1006) /// Bracket = 4102, /// /// Sensor temperature. (Hex: 0X1007) /// SensorTemperature = 4103, /// /// Lens temperature. (Hex: 0X1008) /// LensTemperature = 4104, /// /// Focus mode. (Hex: 0X100B) /// FocusMode = 4107, /// /// Manual focus distance. (Hex: 0X100C) /// FocusDistance = 4108, /// /// Zoom step count. (Hex: 0X100D) /// Zoom = 4109, /// /// Macro focus step count. (Hex: 0X100E) /// MacroFocus = 4110, /// /// Sharpness factor. (Hex: 0X100F) /// SharpnessFactor = 4111, /// /// Flash charge level. (Hex: 0X1010) /// FlashChargeLevel = 4112, /// /// Color matrix. (Hex: 0X1011) /// ColorMatrix = 4113, /// /// Black level. (Hex: 0X1012) /// BlackLevel = 4114, /// /// White balance mode. (Hex: 0X1015) /// WhiteBalance = 4117, /// /// Red balance. (Hex: 0X1017) /// RedBalance = 4119, /// /// Blue balance. (Hex: 0X1018) /// BlueBalance = 4120, /// /// Serial number 2. (Hex: 0X101A) /// SerialNumber2 = 4122, /// /// Flash exposure compensation. (Hex: 0X1023) /// FlashBias = 4131, /// /// External flash bounce. (Hex: 0X1026) /// ExternalFlashBounce = 4134, /// /// External flash zoom. (Hex: 0X1027) /// ExternalFlashZoom = 4135, /// /// External flash mode. (Hex: 0X1028) /// ExternalFlashMode = 4136, /// /// Contrast setting. (Hex: 0X1029) /// Contrast = 4137, /// /// Sharpness factor. (Hex: 0X102A) /// SharpnessFactor2 = 4138, /// /// Color control. (Hex: 0X102B) /// ColorControl = 4139, /// /// Valid bits. (Hex: 0X102C) /// ValidBits = 4140, /// /// Coring filter. (Hex: 0X102D) /// CoringFilter = 4141, /// /// Image width. (Hex: 0X102E) /// ImageWidth = 4142, /// /// Image height. (Hex: 0X102F) /// ImageHeight = 4143, /// /// Compression ratio. (Hex: 0X1034) /// CompressionRatio = 4148, /// /// Preview image embedded. (Hex: 0X1035) /// Thumbnail = 4149, /// /// Offset of the preview image. (Hex: 0X1036) /// ThumbnailOffset = 4150, /// /// Size of the preview image. (Hex: 0X1037) /// ThumbnailLength = 4151, /// /// CCD scan mode. (Hex: 0X1039) /// CCDScanMode = 4153, /// /// Noise reduction. (Hex: 0X103A) /// NoiseReduction = 4154, /// /// Infinity lens step. (Hex: 0X103B) /// InfinityLensStep = 4155, /// /// Near lens step. (Hex: 0X103C) /// NearLensStep = 4156, /// /// Camera equipment sub-IFD. (Hex: 0X2010) /// Equipment = 8208, /// /// Camera Settings sub-IFD. (Hex: 0X2020) /// CameraSettings = 8224, /// /// Raw development sub-IFD. (Hex: 0X2030) /// RawDevelopment = 8240, /// /// Raw development 2 sub-IFD. (Hex: 0X2031) /// RawDevelopment2 = 8241, /// /// Image processing sub-IFD. (Hex: 0X2040) /// ImageProcessing = 8256, /// /// Focus sub-IFD. (Hex: 0X2050) /// FocusInfo = 8272, /// /// Raw sub-IFD. (Hex: 0X3000) /// RawInfo = 12288, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/PanasonicMakerNoteEntryTag.cs0000644000175000017500000001771711521241310025153 0ustar00alexalex00000000000000// // PanasonicMakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Panasonic makernote tags. /// Based on http://www.exiv2.org/tags-panasonic.html /// public enum PanasonicMakerNoteEntryTag : ushort { /// /// Image Quality. (Hex: 0x0001) /// Quality = 1, /// /// Firmware version. (Hex: 0X0002) /// FirmwareVersion = 2, /// /// White balance setting. (Hex: 0X0003) /// WhiteBalance = 3, /// /// Unknown. (Hex: 0X0004) /// Unknown4 = 4, /// /// Focus mode. (Hex: 0X0007) /// FocusMode = 7, /// /// AF mode. (Hex: 0X000F) /// AFMode = 15, /// /// ISO Speed. (Hex: 0X0017) /// ISO = 23, /// /// Image stabilization. (Hex: 0X001A) /// ImageStabilization = 26, /// /// Macro mode. (Hex: 0X001C) /// Macro = 28, /// /// Shooting mode. (Hex: 0X001F) /// ShootingMode = 31, /// /// Audio. (Hex: 0X0020) /// Audio = 32, /// /// Data dump. (Hex: 0X0021) /// DataDump = 33, /// /// Unknown. (Hex: 0X0022) /// Unknown34 = 34, /// /// White balance adjustment. (Hex: 0X0023) /// WhiteBalanceBias = 35, /// /// Flash bias. (Hex: 0X0024) /// FlashBias = 36, /// /// This number is unique, and contains the date of manufacture, but /// is not the same as the number printed on the camera body. /// (Hex: 0X0025) /// InternalSerialNumber = 37, /// /// Exif version. (Hex: 0X0026) /// ExifVersion = 38, /// /// Unknown. (Hex: 0X0027) /// Unknown39 = 39, /// /// Color effect. (Hex: 0X0028) /// ColorEffect = 40, /// /// Time in 1/100s from when the camera was powered on to when the /// image is written to memory card. (Hex: 0X0029) /// TimeSincePowerOn = 41, /// /// Burst mode. (Hex: 0X002A) /// BurstMode = 42, /// /// Sequence number. (Hex: 0X002B) /// SequenceNumber = 43, /// /// Contrast setting. (Hex: 0X002C) /// Contrast = 44, /// /// Noise reduction. (Hex: 0X002D) /// NoiseReduction = 45, /// /// Self timer. (Hex: 0X002E) /// SelfTimer = 46, /// /// Unknown. (Hex: 0X002F) /// Unknown47 = 47, /// /// Rotation. (Hex: 0X0030) /// Rotation = 48, /// /// Unknown. (Hex: 0X0031) /// Unknown49 = 49, /// /// Color mode. (Hex: 0X0032) /// ColorMode = 50, /// /// Baby (or pet) age. (Hex: 0X0033) /// BabyAge = 51, /// /// Optical zoom mode. (Hex: 0X0034) /// OpticalZoomMode = 52, /// /// Conversion lens. (Hex: 0X0035) /// ConversionLens = 53, /// /// Travel day. (Hex: 0X0036) /// TravelDay = 54, /// /// Contrast. (Hex: 0X0039) /// Contrast2 = 57, /// /// World time location. (Hex: 0X003A) /// WorldTimeLocation = 58, /// /// Program ISO. (Hex: 0X003C) /// ProgramISO = 60, /// /// Saturation. (Hex: 0X0040) /// Saturation = 64, /// /// Sharpness. (Hex: 0X0041) /// Sharpness = 65, /// /// Film mode. (Hex: 0X0042) /// FilmMode = 66, /// /// WB adjust AB. Positive is a shift toward blue. (Hex: 0X0046) /// WBAdjustAB = 70, /// /// WBAdjustGM. Positive is a shift toward green. (Hex: 0X0047) /// WBAdjustGM = 71, /// /// Lens type. (Hex: 0X0051) /// LensType = 81, /// /// Lens serial number. (Hex: 0X0052) /// LensSerialNumber = 82, /// /// Accessory type. (Hex: 0X0053) /// AccessoryType = 83, /// /// PrintIM information. (Hex: 0X0E00) /// PrintIM = 3584, /// /// Unknown. (Hex: 0X4449) /// Unknown17481 = 17481, /// /// MakerNote version. (Hex: 0X8000) /// MakerNoteVersion = 32768, /// /// Scene mode. (Hex: 0X8001) /// SceneMode = 32769, /// /// WB red level. (Hex: 0X8004) /// WBRedLevel = 32772, /// /// WB green level. (Hex: 0X8005) /// WBGreenLevel = 32773, /// /// WB blue level. (Hex: 0X8006) /// WBBlueLevel = 32774, /// /// Baby (or pet) age. (Hex: 0X8010) /// BabyAge2 = 32784, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/SonyMakerNoteEntryTag.cs0000644000175000017500000001530411521241310024156 0ustar00alexalex00000000000000// // SonyMakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Label tags for Sony Makernote. /// Based on http://www.exiv2.org/tags-sony.html /// public enum SonyMakerNoteEntryTag : ushort { /// /// Image quality. (Hex: 0X0102) /// Quality = 258, /// /// Flash exposure compensation in EV. (Hex: 0X0104) /// FlashExposureComp = 260, /// /// Teleconverter Model. (Hex: 0X0105) /// Teleconverter = 261, /// /// White Balance Fine Tune Value. (Hex: 0X0112) /// WhiteBalanceFineTune = 274, /// /// Camera Settings. (Hex: 0X0114) /// CameraSettings = 276, /// /// White balance. (Hex: 0X0115) /// WhiteBalance = 277, /// /// PrintIM information. (Hex: 0X0E00) /// PrintIM = 3584, /// /// Multi Burst Mode. (Hex: 0X1000) /// MultiBurstMode = 4096, /// /// Multi Burst Image Width. (Hex: 0X1001) /// MultiBurstImageWidth = 4097, /// /// Multi Burst Image Height. (Hex: 0X1002) /// MultiBurstImageHeight = 4098, /// /// Panorama. (Hex: 0X1003) /// Panorama = 4099, /// /// Preview Image. (Hex: 0X2001) /// PreviewImage = 8193, /// /// Auto High Definition Range. (Hex: 0X200A) /// AutoHDR = 8202, /// /// Shot Information. (Hex: 0X3000) /// ShotInfo = 12288, /// /// File Format. (Hex: 0XB000) /// FileFormat = 45056, /// /// Sony Model ID. (Hex: 0XB001) /// SonyModelID = 45057, /// /// Color Reproduction. (Hex: 0XB020) /// ColorReproduction = 45088, /// /// Color Temperature. (Hex: 0XB021) /// ColorTemperature = 45089, /// /// Color Compensation Filter: negative is green, positive is magenta. (Hex: 0XB022) /// ColorCompensationFilter = 45090, /// /// Scene Mode. (Hex: 0XB023) /// SceneMode = 45091, /// /// Zone Matching. (Hex: 0XB024) /// ZoneMatching = 45092, /// /// Dynamic Range Optimizer. (Hex: 0XB025) /// DynamicRangeOptimizer = 45093, /// /// Image stabilization. (Hex: 0XB026) /// ImageStabilization = 45094, /// /// Lens identifier. (Hex: 0XB027) /// LensID = 45095, /// /// Minolta MakerNote. (Hex: 0XB028) /// MinoltaMakerNote = 45096, /// /// Color Mode. (Hex: 0XB029) /// ColorMode = 45097, /// /// Full Image Size. (Hex: 0XB02B) /// FullImageSize = 45099, /// /// Preview Image Size. (Hex: 0XB02C) /// PreviewImageSize = 45100, /// /// Macro. (Hex: 0XB040) /// Macro = 45120, /// /// Exposure Mode. (Hex: 0XB041) /// ExposureMode = 45121, /// /// Focus mode. (Hex: 0XB042) /// FocusMode = 45122, /// /// AF Mode. (Hex: 0XB043) /// AFMode = 45123, /// /// AF Illuminator. (Hex: 0XB044) /// AFIlluminator = 45124, /// /// Quality. (Hex: 0XB047) /// Quality2 = 45127, /// /// Flash Level. (Hex: 0XB048) /// FlashLevel = 45128, /// /// Release Mode. (Hex: 0XB049) /// ReleaseMode = 45129, /// /// Shot number in continous burst mode. (Hex: 0XB04A) /// SequenceNumber = 45130, /// /// Anti-Blur. (Hex: 0XB04B) /// AntiBlur = 45131, /// /// Long Exposure Noise Reduction. (Hex: 0XB04E) /// LongExposureNoiseReduction = 45134, /// /// Dynamic Range Optimizer. (Hex: 0XB04F) /// DynamicRangeOptimizer2 = 45135, /// /// Intelligent Auto. (Hex: 0XB052) /// IntelligentAuto = 45138, /// /// White Balance. (Hex: 0XB054) /// WhiteBalance2 = 45140, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/CanonFileInfoEntryTag.cs0000644000175000017500000000506211521241310024072 0ustar00alexalex00000000000000// // CanonFileInfoEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Label tags for Canon File Info. /// Based on http://www.exiv2.org/tags-canon.html /// public enum CanonFileInfoEntryTag : ushort { /// /// File Number. (Hex: 0X0001) /// FileNumber = 1, /// /// Bracket Mode. (Hex: 0X0003) /// BracketMode = 3, /// /// Bracket Value. (Hex: 0X0004) /// BracketValue = 4, /// /// Bracket Shot Number. (Hex: 0X0005) /// BracketShotNumber = 5, /// /// Raw Jpg Quality. (Hex: 0X0006) /// RawJpgQuality = 6, /// /// Raw Jpg Size. (Hex: 0X0007) /// RawJpgSize = 7, /// /// Noise Reduction. (Hex: 0X0008) /// NoiseReduction = 8, /// /// WB Bracket Mode. (Hex: 0X0009) /// WBBracketMode = 9, /// /// WB Bracket Value AB. (Hex: 0X000C) /// WBBracketValueAB = 12, /// /// WB Bracket Value GM. (Hex: 0X000D) /// WBBracketValueGM = 13, /// /// Filter Effect. (Hex: 0X000E) /// FilterEffect = 14, /// /// Toning Effect. (Hex: 0X000F) /// ToningEffect = 15, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/Nikon3MakerNoteEntryTag.cs0000644000175000017500000003123511521241310024370 0ustar00alexalex00000000000000// // Nikon3MakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon format 3 makernote tags. /// Based on http://www.exiv2.org/tags-nikon.html and /// http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html /// public enum Nikon3MakerNoteEntryTag : ushort { /// /// Makernote version. (Hex: 0x0001) /// Version = 1, /// /// ISO speed setting. (Hex: 0X0002) /// ISOSpeed = 2, /// /// Color mode. (Hex: 0X0003) /// ColorMode = 3, /// /// Image quality setting. (Hex: 0X0004) /// Quality = 4, /// /// White balance. (Hex: 0X0005) /// WhiteBalance = 5, /// /// Image sharpening setting. (Hex: 0X0006) /// Sharpening = 6, /// /// Focus mode. (Hex: 0X0007) /// Focus = 7, /// /// Flash setting. (Hex: 0X0008) /// FlashSetting = 8, /// /// Flash device. (Hex: 0X0009) /// FlashDevice = 9, /// /// Unknown. (Hex: 0X000A) /// Unknown10 = 10, /// /// White balance bias. (Hex: 0X000B) /// WhiteBalanceBias = 11, /// /// WB RB levels. (Hex: 0X000C) /// WB_RBLevels = 12, /// /// Program shift. (Hex: 0X000D) /// ProgramShift = 13, /// /// Exposure difference. (Hex: 0X000E) /// ExposureDiff = 14, /// /// ISO selection. (Hex: 0X000F) /// ISOSelection = 15, /// /// Data dump. (Hex: 0X0010) /// DataDump = 16, /// /// Offset to an IFD containing a preview image. (Hex: 0x0011) /// Preview = 17, /// /// Flash compensation setting. (Hex: 0X0012) /// FlashComp = 18, /// /// ISO setting. (Hex: 0X0013) /// ISOSettings = 19, /// /// Image boundary. (Hex: 0X0016) /// ImageBoundary = 22, /// /// Unknown. (Hex: 0X0017) /// Unknown23 = 23, /// /// Flash bracket compensation applied. (Hex: 0X0018) /// FlashBracketComp = 24, /// /// AE bracket compensation applied. (Hex: 0X0019) /// ExposureBracketComp = 25, /// /// Image processing. (Hex: 0X001A) /// ImageProcessing = 26, /// /// Crop high speed. (Hex: 0X001B) /// CropHiSpeed = 27, /// /// Serial Number. (Hex: 0X001D) /// SerialNumber = 29, /// /// Color space. (Hex: 0X001E) /// ColorSpace = 30, /// /// VR info. (Hex: 0X001F) /// VRInfo = 31, /// /// Image authentication. (Hex: 0X0020) /// ImageAuthentication = 32, /// /// ActiveD-lighting. (Hex: 0X0022) /// ActiveDLighting = 34, /// /// Picture control. (Hex: 0X0023) /// PictureControl = 35, /// /// World time. (Hex: 0X0024) /// WorldTime = 36, /// /// ISO info. (Hex: 0X0025) /// ISOInfo = 37, /// /// Vignette control. (Hex: 0X002A) /// VignetteControl = 42, /// /// Image adjustment setting. (Hex: 0X0080) /// ImageAdjustment = 128, /// /// Tone compensation. (Hex: 0X0081) /// ToneComp = 129, /// /// Auxiliary lens (adapter). (Hex: 0X0082) /// AuxiliaryLens = 130, /// /// Lens type. (Hex: 0X0083) /// LensType = 131, /// /// Lens. (Hex: 0X0084) /// Lens = 132, /// /// Manual focus distance. (Hex: 0X0085) /// FocusDistance = 133, /// /// Digital zoom setting. (Hex: 0X0086) /// DigitalZoom = 134, /// /// Mode of flash used. (Hex: 0X0087) /// FlashMode = 135, /// /// AF info. (Hex: 0X0088) /// AFInfo = 136, /// /// Shooting mode. (Hex: 0X0089) /// ShootingMode = 137, /// /// Auto bracket release. (Hex: 0X008A) /// AutoBracketRelease = 138, /// /// Lens FStops. (Hex: 0X008B) /// LensFStops = 139, /// /// Contrast curve. (Hex: 0X008C) /// ContrastCurve = 140, /// /// Color hue. (Hex: 0X008D) /// ColorHue = 141, /// /// Scene mode. (Hex: 0X008F) /// SceneMode = 143, /// /// Light source. (Hex: 0X0090) /// LightSource = 144, /// /// Shot info. (Hex: 0X0091) /// ShotInfo = 145, /// /// Hue adjustment. (Hex: 0X0092) /// HueAdjustment = 146, /// /// NEF compression. (Hex: 0X0093) /// NEFCompression = 147, /// /// Saturation. (Hex: 0X0094) /// Saturation = 148, /// /// Noise reduction. (Hex: 0X0095) /// NoiseReduction = 149, /// /// Linearization table. (Hex: 0X0096) /// LinearizationTable = 150, /// /// Color balance. (Hex: 0X0097) /// ColorBalance = 151, /// /// Lens data settings. (Hex: 0X0098) /// LensData = 152, /// /// Raw image center. (Hex: 0X0099) /// RawImageCenter = 153, /// /// Sensor pixel size. (Hex: 0X009A) /// SensorPixelSize = 154, /// /// Unknown. (Hex: 0X009B) /// Unknown155 = 155, /// /// Scene assist. (Hex: 0X009C) /// SceneAssist = 156, /// /// Retouch history. (Hex: 0X009E) /// RetouchHistory = 158, /// /// Unknown. (Hex: 0X009F) /// Unknown159 = 159, /// /// Camera serial number, usually starts with "NO= ". (Hex: 0X00A0) /// SerialNO = 160, /// /// Image data size. (Hex: 0X00A2) /// ImageDataSize = 162, /// /// Unknown. (Hex: 0X00A3) /// Unknown163 = 163, /// /// Image count. (Hex: 0X00A5) /// ImageCount = 165, /// /// Deleted image count. (Hex: 0X00A6) /// DeletedImageCount = 166, /// /// Number of shots taken by camera. (Hex: 0X00A7) /// ShutterCount = 167, /// /// Flash info. (Hex: 0X00A8) /// FlashInfo = 168, /// /// Image optimization. (Hex: 0X00A9) /// ImageOptimization = 169, /// /// Saturation. (Hex: 0X00AA) /// Saturation2 = 170, /// /// Program variation. (Hex: 0X00AB) /// VariProgram = 171, /// /// Image stabilization. (Hex: 0X00AC) /// ImageStabilization = 172, /// /// AF response. (Hex: 0X00AD) /// AFResponse = 173, /// /// Multi exposure. (Hex: 0X00B0) /// MultiExposure = 176, /// /// High ISO Noise Reduction. (Hex: 0X00B1) /// HighISONoiseReduction = 177, /// /// Toning effect. (Hex: 0X00B3) /// ToningEffect = 179, /// /// AF info 2. (Hex: 0X00B7) /// AFInfo2 = 183, /// /// File info. (Hex: 0X00B8) /// FileInfo = 184, /// /// PrintIM information. (Hex: 0X0E00) /// PrintIM = 3584, /// /// Capture data. (Hex: 0X0E01) /// CaptureData = 3585, /// /// Capture version. (Hex: 0X0E09) /// CaptureVersion = 3593, /// /// Capture offsets. (Hex: 0X0E0E) /// CaptureOffsets = 3598, /// /// Scan IFD. (Hex: 0X0E10) /// ScanIFD = 3600, /// /// ICC profile. (Hex: 0X0E1D) /// ICCProfile = 3613, /// /// Capture output. (Hex: 0X0E1E) /// CaptureOutput = 3614, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/CanonMakerNoteEntryTag.cs0000644000175000017500000001057611521241310024272 0ustar00alexalex00000000000000// // CanonMakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009-2010 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Label tags for Canon Makernote. /// Based on http://www.burren.cx/david/canon.html and http://www.exiv2.org/tags-canon.html /// public enum CanonMakerNoteEntryTag : ushort { /// /// Unknown field at tag 0x0000. (Hex: 0x0000) /// Unknown0 = 0, /// /// Camera Settings. (Hex: 0x0001) /// CameraSettings = 1, /// /// Focal Length. (Hex: 0x0002) /// FocalLength = 2, /// /// Unknown field at tag 0x0000. (Hex: 0x0003) /// Unknown3 = 3, /// /// Shot Information. (Hex: 0x0004) /// ShotInfo = 4, /// /// Panorama. (Hex: 0x0005) /// Panorama = 5, /// /// Image Type. (Hex: 0x0006) /// ImageType = 6, /// /// Firmware Version. (Hex: 0x0007) /// FirmwareVersion = 7, /// /// Image Number. (Hex: 0x0008) /// ImageNumber = 8, /// /// Owner Name. (Hex: 0x0009) /// OwnerName = 9, /// /// Serial Number. (Hex: 0x000C) /// SerialNumber = 12, /// /// Unknown field at tag 0x0000. (Hex: 0x000D) /// Unknown13 = 13, /// /// Custom Functions. (Hex: 0x000F) /// CustomFunctions = 15, /// /// Model ID. (Hex: 0x0010) /// ModelID = 16, /// /// Picture Info. (Hex: 0x0012) /// PictureInfo = 18, /// /// Serial Number Format. (Hex: 0x0015) /// SerialNumberFormat = 21, /// /// Canon File Info. (Hex: 0x0093) /// CanonFileInfo = 147, /// /// Lens Model. (Hex: 0x0095) /// LensModel = 149, /// /// Serial Info. (Hex: 0x0096) /// SerialInfo = 150, /// /// Processing Info. (Hex: 0x00A0) /// ProcessingInfo = 160, /// /// White Balance Table. (Hex: 0x00A9) /// WhiteBalanceTable = 169, /// /// Measured Color. (Hex: 0x00AA) /// MeasuredColor = 170, /// /// Color Space. (Hex: 0x00B4) /// ColorSpace = 180, /// /// Sensor Info. (Hex: 0x00E0) /// SensorInfo = 224, /// /// Black Level. (Hex: 0x4008) /// BlackLevel = 16392, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonPreviewMakerNoteEntryTag.cs0000644000175000017500000000576711521241310025662 0ustar00alexalex00000000000000// // NikonPreviewMakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009-2010 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon makernote preview image tags /// The preview image is contained in a sub-IFD stored by the tag /// Nikon3MakerNoteEntryTag.Preview. /// Based on: /// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage /// public enum NikonPreviewMakerNoteEntryTag : ushort { /// /// Compression scheme used on the image data. (Hex: 0x0103) /// http://www.awaresystems.be/imaging/tiff/tifftags/compression.html /// Compression = 259, /// /// The number of pixels per ResolutionUnit in the ImageWidth direction. (Hex: 0x011A) /// http://www.awaresystems.be/imaging/tiff/tifftags/xresolution.html /// XResolution = 282, /// /// The number of pixels per ResolutionUnit in the ImageLength direction. (Hex: 0x011B) /// http://www.awaresystems.be/imaging/tiff/tifftags/yresolution.html /// YResolution = 283, /// /// The unit of measurement for XResolution and YResolution. (Hex: 0x0128) /// http://www.awaresystems.be/imaging/tiff/tifftags/resolutionunit.html /// ResolutionUnit = 296, /// /// Start of the preview image data. (Hex: 0x0201) /// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage /// PreviewImageStart = 513, /// /// Length of the preview image data. (Hex: 0x0202) /// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#PreviewImage /// PreviewImageLength = 514, /// /// Specifies the positioning of subsampled chrominance components relative to luminance samples. (Hex: 0x0213) /// http://www.awaresystems.be/imaging/tiff/tifftags/ycbcrpositioning.html /// YCbCrPositioning = 531 } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/IOPEntryTag.cs0000644000175000017500000000367411521241310022056 0ustar00alexalex00000000000000// // IOPEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009-2010 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Entry tags occuring in the Interoperability IFD /// The complete overview can be obtained at: /// http://www.awaresystems.be/imaging/tiff.html /// public enum IOPEntryTag : ushort { /// /// Indicates the identification of the Interoperability rule. (Hex: 0x0001) /// http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/interoperability/interoperabilityindex.html /// InteroperabilityIndex = 1, /// /// Interoperability version. (Hex: 0x0002) /// InteroperabilityVersion = 2, /// /// File format of image file. (Hex: 0x1000) /// RelatedImageFileFormat = 4096, /// /// Image Width. (Hex: 0x1001) /// RelatedImageWidth = 4097, /// /// Image Height. (Hex: 0x1002) /// RelatedImageLength = 4098, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonShotInfoEntryTag.cs0000644000175000017500000000423711521241310024153 0ustar00alexalex00000000000000// // NikonShotInfoEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon shot info entry tags. /// Based on: /// http://exiv2.org/tags-nikon.html /// public enum NikonShotInfoEntryTag : ushort { /// /// Version. (Hex: 0X0000) /// Version = 0, /// /// Shutter count 1. (Hex: 0X006A) /// ShutterCount1 = 106, /// /// Deleted image count. (Hex: 0X006E) /// DeletedImageCount = 110, /// /// Vibration reduction. (Hex: 0X0075) /// VibrationReduction = 117, /// /// . (Hex: 0X0082) /// VibrationReduction1 = 130, /// /// Shutter count 2. (Hex: 0X0157) /// ShutterCount2 = 343, /// /// Vibration reduction 2. (Hex: 0X01AE) /// VibrationReduction2 = 430, /// /// ISO. (Hex: 0X0256) /// ISO = 598, /// /// Shutter count. (Hex: 0X0276) /// ShutterCount = 630, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Tags/NikonWorldTimeEntryTag.cs0000644000175000017500000000261111521241310024322 0ustar00alexalex00000000000000// // NikonWorldTimeEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// /// Nikon world time entry tags. /// Based on: /// http://exiv2.org/tags-nikon.html /// public enum NikonWorldTimeEntryTag : ushort { /// /// Timezone. (Hex: 0X0000) /// Timezone = 0, /// /// Daylight savings. (Hex: 0X0002) /// DaylightSavings = 2, /// /// Date display format. (Hex: 0X0003) /// DateDisplayFormat = 3, } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/0000755000175000017500000000000011774620112020136 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/ThumbnailDataIFDEntry.cs0000644000175000017500000000606411521241310024542 0ustar00alexalex00000000000000// // ThumbnailDataIFDEntry.cs: // // Author: // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains the data of a Thumbnail. Since the thumbnail is /// referenced by two long entries (offset to the data and length) /// we need to take care of this special case. /// This entry acts as the offset-entry but holds also the /// thumbail data. When rendering the entry, we have to render the /// data but write a long entry. /// public class ThumbnailDataIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The data of the thumbnail which is stored by the current instance /// public ByteVector Data { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A with the thumbnail data to be stored /// public ThumbnailDataIFDEntry (ushort tag, ByteVector data) { Tag = tag; Data = data; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { // the entry is a single long entry where the value is an offset to the data // the offset is automatically updated by the renderer. type = (ushort) IFDEntryType.Long; count = 1; return Data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/LongArrayIFDEntry.cs0000644000175000017500000000476011521241310023724 0ustar00alexalex00000000000000// // LongArrayIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a LONG value with a count > 1 /// public class LongArrayIFDEntry : ArrayIFDEntry { #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public LongArrayIFDEntry (ushort tag, uint [] values) : base (tag) { Values = values; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Long; count = (uint) Values.Length; ByteVector data = new ByteVector (); foreach (uint value in Values) data.Add (ByteVector.FromUInt (value, is_bigendian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/UserCommentIFDEntry.cs0000644000175000017500000001403111521241310024257 0ustar00alexalex00000000000000// // UserCommentIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.IFD.Entries { /// /// Contains an ASCII STRING value. /// public class UserCommentIFDEntry : IFDEntry { #region Constant Values /// /// Marker for an ASCII-encoded UserComment tag. /// public static readonly ByteVector COMMENT_ASCII_CODE = new byte[] {0x41, 0x53, 0x43, 0x49, 0x49, 0x00, 0x00, 0x00}; /// /// Marker for a JIS-encoded UserComment tag. /// public static readonly ByteVector COMMENT_JIS_CODE = new byte[] {0x4A, 0x49, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00}; /// /// Marker for a UNICODE-encoded UserComment tag. /// public static readonly ByteVector COMMENT_UNICODE_CODE = new byte[] {0x55, 0x4E, 0x49, 0x43, 0x4F, 0x44, 0x45, 0x00}; /// /// Corrupt marker that seems to be resembling unicode. /// public static readonly ByteVector COMMENT_BAD_UNICODE_CODE = new byte[] {0x55, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0x00}; /// /// Marker for a UserComment tag with undefined encoding. /// public static readonly ByteVector COMMENT_UNDEFINED_CODE = new byte[] {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #endregion #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public string Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public UserCommentIFDEntry (ushort tag, string value) { Tag = tag; Value = value; } /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// /// /// The file that's currently being parsed, used for reporting corruptions. /// public UserCommentIFDEntry (ushort tag, ByteVector data, TagLib.File file) { Tag = tag; if (data.StartsWith (COMMENT_ASCII_CODE)) { Value = TrimNull (data.ToString (StringType.Latin1, COMMENT_ASCII_CODE.Count, data.Count - COMMENT_ASCII_CODE.Count)); return; } if (data.StartsWith (COMMENT_UNICODE_CODE)) { Value = TrimNull (data.ToString (StringType.UTF8, COMMENT_UNICODE_CODE.Count, data.Count - COMMENT_UNICODE_CODE.Count)); return; } var trimmed = data.ToString ().Trim (); if (trimmed.Length == 0 || trimmed == "\0") { Value = String.Empty; return; } // Some programs like e.g. CanonZoomBrowser inserts just the first 0x00-byte // followed by 7-bytes of trash. if (data.StartsWith ((byte) 0x00) && data.Count >= 8) { // And CanonZoomBrowser fills some trailing bytes of the comment field // with '\0'. So we return only the characters before the first '\0'. int term = data.Find ("\0", 8); if (term != -1) { Value = data.ToString (StringType.Latin1, 8, term - 8); } else { Value = data.ToString (StringType.Latin1, 8, data.Count - 8); } return; } if (data.Data.Length == 0) { Value = String.Empty; return; } // Try to parse anyway int offset = 0; int length = data.Count - offset; // Corruption that starts with a Unicode header and a count byte. if (data.StartsWith (COMMENT_BAD_UNICODE_CODE)) { offset = COMMENT_BAD_UNICODE_CODE.Count; length = data.Count - offset; } file.MarkAsCorrupt ("UserComment with other encoding than Latin1 or Unicode"); Value = TrimNull (data.ToString (StringType.UTF8, offset, length)); } private string TrimNull (string value) { int term = value.IndexOf ('\0'); if (term > -1) value = value.Substring (0, term); return value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Undefined; ByteVector data = new ByteVector (); data.Add (COMMENT_UNICODE_CODE); data.Add (ByteVector.FromString (Value, StringType.UTF8)); count = (uint) data.Count; return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/LongIFDEntry.cs0000644000175000017500000000515111521241310022720 0ustar00alexalex00000000000000// // LongIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a LONG value. /// public class LongIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public uint Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public LongIFDEntry (ushort tag, uint value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Long; count = 1; return ByteVector.FromUInt (Value, is_bigendian); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/RationalArrayIFDEntry.cs0000644000175000017500000000516111521241310024572 0ustar00alexalex00000000000000// // RationalArrayIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a RATIONAL value with a count > 1 /// public class RationalArrayIFDEntry : ArrayIFDEntry { #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public RationalArrayIFDEntry (ushort tag, Rational [] entries) : base (tag) { Values = entries; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Rational; count = (uint) Values.Length; ByteVector data = new ByteVector (); foreach (Rational rational in Values) { data.Add (ByteVector.FromUInt (rational.Numerator, is_bigendian)); data.Add (ByteVector.FromUInt (rational.Denominator, is_bigendian)); } return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/ShortIFDEntry.cs0000644000175000017500000000516411521241310023124 0ustar00alexalex00000000000000// // ShortIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a SHORT value. /// public class ShortIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public ushort Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public ShortIFDEntry (ushort tag, ushort value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Short; count = 1; return ByteVector.FromUShort (Value, is_bigendian); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SRational.cs0000644000175000017500000001040111521241310022342 0ustar00alexalex00000000000000// // SRational.cs: A structure to represent signed rational values by a // numerator and a denominator. // // Author: // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.IFD.Entries { /// /// Representation of a signed rational value /// public struct SRational : IFormattable { #region Private Fields /// /// The numerator of the rational value /// private int numerator; /// /// The denominator of the rational value /// private int denominator; #endregion #region Constructor /// /// Creates a new Rational value /// /// /// A with the numerator of the /// rational value /// /// /// A with the denominator of the /// rational value. It must be not 0. /// public SRational (int numerator, int denominator) { if (denominator == 0) throw new ArgumentException ("denominator"); this.numerator = numerator; this.denominator = denominator; } #endregion #region Public Methods /// /// Returns a rational value with reduced nominator and denominator /// /// /// A /// public SRational Reduce () { int den_sign = Math.Sign (Denominator); int gcd = Math.Abs (Denominator); int b = Math.Abs (Numerator); while (b != 0) { int tmp = gcd % b; gcd = b; b = tmp; } return new SRational (den_sign * (Numerator / gcd), Math.Abs (Denominator) / gcd); } /// /// Formatprovider to allow formatting of a value. /// /// /// A . /// /// /// A . /// /// /// A formated according to the given parameter /// public string ToString (string format, IFormatProvider provider) { SRational reduced = Reduce (); return String.Format ("{0}/{1}", reduced.Numerator, reduced.Denominator); } /// /// Converts the value to a . /// /// /// A with the current value. /// public override string ToString () { return String.Format ("{0}", this); } #endregion #region Public Properties /// /// The numerator of the rational value /// public int Numerator { get { return numerator; } set { numerator = value; } } /// /// The denominator of the rational value /// /// /// Cannot be 0. /// public int Denominator { get { return denominator; } set { if (value == 0) throw new ArgumentException ("denominator"); denominator = value; } } #endregion #region Public Static Methods /// /// Cast the value to a . /// /// /// A with the value to cast. /// /// /// A with the double. /// public static implicit operator double (SRational rat) { return (double) rat.Numerator / (double) rat.Denominator; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SRationalIFDEntry.cs0000644000175000017500000000542211521241310023716 0ustar00alexalex00000000000000// // SRationalIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a SRATIONAL value. /// public class SRationalIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public SRational Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SRationalIFDEntry (ushort tag, SRational value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.SRational; count = 1; ByteVector data = new ByteVector (); data.Add (ByteVector.FromInt (Value.Numerator, is_bigendian)); data.Add (ByteVector.FromInt (Value.Denominator, is_bigendian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SubIFDEntry.cs0000644000175000017500000000657511521241310022565 0ustar00alexalex00000000000000// // SubIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a Sub IFD. /// public class SubIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The type of the IFD entry. /// public ushort Type { get; private set; } /// /// The count of the IFD entry. /// public uint Count { get; private set; } /// /// The structure of the sub-ifd which is stored by the current /// instance /// public IFDStructure Structure { get; private set; } /// /// The number of entries in the entire IFD. /// public int ChildCount { get { int sum = 0; foreach (var directory in Structure.Directories) sum += directory.Count; return sum; } } /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A with the type of the IFD entry. /// /// /// A with the count of the IFD entry. /// /// /// A to be stored /// public SubIFDEntry (ushort tag, ushort type, uint count, IFDStructure structure) { Tag = tag; Type = type; Count = count; Structure = structure; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) Type; count = 1; count = Count; return new IFDRenderer (is_bigendian, Structure, offset).Render (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/StripOffsetsIFDEntry.cs0000644000175000017500000001135411521241310024456 0ustar00alexalex00000000000000// // StripOffsetsIFDEntry.cs: // // Author: // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.IO; namespace TagLib.IFD.Entries { /// /// Contains the offsets to the image data strips. /// public class StripOffsetsIFDEntry : ArrayIFDEntry { #region Private Fields /// /// Store the strip length to read them before writing. /// private uint[] byte_counts; /// /// The file the offsets belong to /// private File file; #endregion #region Constructors /// /// Constructor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A with the strip offsets. /// /// /// The length of the strips. /// /// /// The file from which the strips will be read. /// public StripOffsetsIFDEntry (ushort tag, uint[] values, uint[] byte_counts, File file) : base (tag) { Values = values; this.byte_counts = byte_counts; this.file = file; if (values.Length != byte_counts.Length) throw new Exception ("strip offsets and strip byte counts do not have the same length"); } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { // The StripOffsets are an array of offsets, where the image data can be found. // We store the offsets and behind the offsets the image data is stored. Therfore, // the ByteVector data first collects the image data and the offsets itself are // collected by offset_data. Then both are concatenated. ByteVector data = new ByteVector (); ByteVector offset_data = new ByteVector (); // every offset needs 4 byte, we need to reserve the bytes. uint data_offset = offset + (uint) (4 * Values.Length); for (int i = 0; i < Values.Length; i++) { uint new_offset = (uint) (data_offset + data.Count); file.Seek (Values[i], SeekOrigin.Begin); data.Add (file.ReadBlock ((int) byte_counts[i])); // update strip offset data to new offset Values[i] = new_offset; offset_data.Add (ByteVector.FromUInt (new_offset, is_bigendian)); } // If the StripOffsets only consists of one offset, this doesn't work, because this offset // should be stored inside the IFD as a value. But, because of the additional image data, // it is not stored there. We need to fix this, that the offset is adjusted correctly. // Therefore, the offset_data is only added if it contains more than one value. // Then, the offset is set correctly. (However, we need to ensure, that the image data // consists at least of 4 bytes, which is probably the case every time, but to be sure ...) // However, the strip offset in the array must also be adjusted, if the offset_data is ignored. if (Values.Length > 1) data.Insert (0, offset_data); else Values[0] = offset; while (data.Count < 4) data.Add (0x00); // the entry is a single long entry where the value is an offset to the data // the offset is automatically updated by the renderer. type = (ushort) IFDEntryType.Long; count = (uint) Values.Length; return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SLongArrayIFDEntry.cs0000644000175000017500000000475711521241310024055 0ustar00alexalex00000000000000// // SLongArrayIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a SLONG value with a count > 1 /// public class SLongArrayIFDEntry : ArrayIFDEntry { #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SLongArrayIFDEntry (ushort tag, int [] values) : base (tag) { Values = values; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Long; count = (uint) Values.Length; ByteVector data = new ByteVector (); foreach (int value in Values) data.Add (ByteVector.FromInt (value, is_bigendian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/ShortArrayIFDEntry.cs0000644000175000017500000000477511521241310024132 0ustar00alexalex00000000000000// // ShortArrayIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a SHORT value with a count > 1 /// public class ShortArrayIFDEntry : ArrayIFDEntry { #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public ShortArrayIFDEntry (ushort tag, ushort [] values) : base (tag) { Values = values; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Short; count = (uint) Values.Length; ByteVector data = new ByteVector (); foreach (ushort value in Values) data.Add (ByteVector.FromUShort (value, is_bigendian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SLongIFDEntry.cs0000644000175000017500000000516011521241310023043 0ustar00alexalex00000000000000// // SLongIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a signed LONG value. /// public class SLongIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public int Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SLongIFDEntry (ushort tag, int value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.SLong; count = 1; return ByteVector.FromInt (Value, is_bigendian); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/UndefinedIFDEntry.cs0000644000175000017500000000522311521241310023722 0ustar00alexalex00000000000000// // UndefinedIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (miek@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains an Undefined value type, represented by a byte vector /// public class UndefinedIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The data which is stored by the current instance /// public ByteVector Data { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public UndefinedIFDEntry (ushort tag, ByteVector data) { Tag = tag; Data = data; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Undefined; count = (uint) Data.Count; return Data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/MakernoteIFDEntry.cs0000644000175000017500000002045311521241310023750 0ustar00alexalex00000000000000// // MakernoteIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// An enum to represent the manufactor of the makernote /// The information of the makernote types is from: /// http://exiv2.org/makernote.html /// public enum MakernoteType { /// /// The manufactor could not be determined /// Unknown, /// /// Canon makernote. /// Standard IFD without a special prefix. /// Canon, /// /// Panasonic makernote. /// "Panasonic\0\0\0" prefix and IFD starting at offset 12. /// The next-IFD pointer is missing /// Panasonic, /// /// Leica makernote. /// "LEICA\0\0\0" prefix and IFD starting at offset 10. /// Leica, /// /// Pentax makernote. /// "AOC\0" + 2 unknown bytes as prefix. The IFD starts at /// offset 6. /// Pentax, /// /// Nikon makernote (type 1). /// Standard IFD without a special prefix. /// Nikon1, /// /// Nikon makernote (type 2). /// "Nikon\0" + 2 unknown bytes prefix. The IFD starts at /// offset 8. /// Nikon2, /// /// Nikon makernote (type 3). /// "Nikon\0" + 4 bytes with verison code + Tiff header. /// The IFD starts usually at offset 18. The offsets of the IFD /// are relative to start of the Tiff header (byte 10) /// Nikon3, /// /// Olympus makernote (type 1). /// "OLYMP\0" + 2 unknown bytes as prefix. The IFD starts at /// offset 8. /// Olympus1, /// /// Olympus makernote (type 2) /// "OLYMPUS\0II" + 2 unknown bytes as prefix. The IFD starts at /// offset 12. The offsets of the IFD are relative to the /// beginning of the makernote. /// Olympus2, /// /// Sony makernote (type 1). /// "SONY DSC \0\0\0" as prefix. The IFD starts at offset 12. A /// next-IFD pointer is missing. /// Sony } /// /// Contains a Makernote IFD. /// /// /// Makernote IFDs are mostly of the same form. They start with and /// Manufactor specific prefix indicating the type and contain then /// a IFD structure. /// It must be distinguished, where the offsets in the IFD belongs to. /// For some makernotes the offset refers to the beginning of the /// surrounding metadata IFD structure, for others they refer to the /// start of the makernote. /// In addition the endianess of the makernote can be different to the /// endianess of the surrounding metadata. /// This class takes care about all those things. /// public class MakernoteIFDEntry : IFDEntry { #region Private Fields /// /// Stores the prefix of the makernote /// private ByteVector prefix; /// /// Stores the offset of the IFD contained in makernote /// private uint ifd_offset; /// /// Indicates, if the offsets are relative to the current makernote /// or absolut to the base_offset of the surrounding IFD. /// private bool absolute_offset; /// /// Stores, if the makernote is encoded in big- or little endian. /// If the field is , the endianess of the /// surrounding IFD is used. /// private bool? is_bigendian; #endregion #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The type of the makernote the current instance represents /// public MakernoteType MakernoteType { get; private set; } /// /// The pure which is stored by the /// makernote. /// public IFDStructure Structure { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A with the IFD structure, which is stored by this /// instance /// /// /// A with the type of the makernote. /// /// /// A containing the prefix, which should be rendered /// before the real IFD. /// /// /// A with the offset in addition to the relative /// offsets in the IFD /// /// /// A indicating if the offsets of the IFD are relative /// to the , or absolut to the base offset of the /// surrounding IFD. /// /// /// A indicating if the current IFD is encoded in /// big- or little endian. It it is , the endianess of the /// surrounding IFD is used. /// public MakernoteIFDEntry (ushort tag, IFDStructure structure, MakernoteType makernote_type, ByteVector prefix, uint ifd_offset, bool absolute_offset, bool? is_bigendian) { Tag = tag; Structure = structure; MakernoteType = makernote_type; this.prefix = prefix; this.ifd_offset = ifd_offset; this.absolute_offset = absolute_offset; this.is_bigendian = is_bigendian; } /// /// Constructor. Creates a makernote instance just containing an IFD and /// without any special prefix or offset behavior. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A with the IFD structure, which is stored by this /// instance /// /// /// A with the type of the makernote. /// public MakernoteIFDEntry (ushort tag, IFDStructure structure, MakernoteType makernote_type) : this (tag, structure, makernote_type, null, 0, true, null) {} #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Undefined; var renderer = new IFDRenderer (this.is_bigendian ?? is_bigendian, Structure, absolute_offset ? offset + ifd_offset : ifd_offset); ByteVector data = renderer.Render (); data.Insert (0, prefix); count = (uint) data.Count; return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/ByteIFDEntry.cs0000644000175000017500000000510211521241310022720 0ustar00alexalex00000000000000// // ByteIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a byte value /// public class ByteIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public byte Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public ByteIFDEntry (ushort tag, byte value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Byte; count = 1; return Value; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SShortArrayIFDEntry.cs0000644000175000017500000000501011521241310024234 0ustar00alexalex00000000000000// // SShortArrayIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a SSHORT value with a count > 1 /// public class SShortArrayIFDEntry : ArrayIFDEntry { #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SShortArrayIFDEntry (ushort tag, short [] values) : base (tag) { Values = values; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.SShort; count = (uint) Values.Length; ByteVector data = new ByteVector (); foreach (ushort value in Values) data.Add (ByteVector.FromUShort ((ushort) value, is_bigendian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/RationalIFDEntry.cs0000644000175000017500000000537411521241310023601 0ustar00alexalex00000000000000// // RationalIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a RATIONAL value. /// public class RationalIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public Rational Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A /// public RationalIFDEntry (ushort tag, Rational value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Rational; count = 1; ByteVector data = new ByteVector (); data.Add (ByteVector.FromUInt (Value.Numerator, is_bigendian)); data.Add (ByteVector.FromUInt (Value.Denominator, is_bigendian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SRationalArrayIFDEntry.cs0000644000175000017500000000517011521241310024715 0ustar00alexalex00000000000000// // SRationalArrayIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a SRATIONAL value with a count > 1 /// public class SRationalArrayIFDEntry : ArrayIFDEntry { #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SRationalArrayIFDEntry (ushort tag, SRational [] entries) : base (tag) { Values = entries; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public override ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.SRational; count = (uint) Values.Length; ByteVector data = new ByteVector (); foreach (SRational rational in Values) { data.Add (ByteVector.FromInt (rational.Numerator, is_bigendian)); data.Add (ByteVector.FromInt (rational.Denominator, is_bigendian)); } return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/Rational.cs0000644000175000017500000001024411521241310022224 0ustar00alexalex00000000000000// // Rational.cs: A structure to represent rational values by a numerator and // a denominator. // // Author: // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.IFD.Entries { /// /// Representation of an unsigned rational value /// public struct Rational : IFormattable { #region Private Fields /// /// The numerator of the rational value /// private uint numerator; /// /// The denominator of the rational value /// private uint denominator; #endregion #region Constructor /// /// Creates a new Rational value /// /// /// A with the numerator of the /// rational value /// /// /// A with the denominator of the /// rational value. It must be not 0. /// public Rational (uint numerator, uint denominator) { if (denominator == 0) throw new ArgumentException ("denominator"); this.numerator = numerator; this.denominator = denominator; } #endregion #region Public Methods /// /// Returns a rational value with reduced nominator and denominator /// /// /// A /// public Rational Reduce () { uint gcd = Denominator; uint b = Numerator; while (b != 0) { uint tmp = gcd % b; gcd = b; b = tmp; } return new Rational (Numerator / gcd, Denominator / gcd); } /// /// Formatprovider to allow formatting of a value. /// /// /// A . /// /// /// A . /// /// /// A formated according to the given parameter /// public string ToString (string format, IFormatProvider provider) { Rational reduced = Reduce (); return String.Format ("{0}/{1}", reduced.Numerator, reduced.Denominator); } /// /// Converts the value to a . /// /// /// A with the current value. /// public override string ToString () { return String.Format ("{0}", this); } #endregion #region Public Properties /// /// The numerator of the rational value /// public uint Numerator { get { return numerator; } set { numerator = value; } } /// /// The denominator of the rational value /// /// /// Cannot be 0. /// public uint Denominator { get { return denominator; } set { if (value == 0) throw new ArgumentException ("denominator"); denominator = value; } } #endregion #region Public Static Methods /// /// Cast the value to a . /// /// /// A with the value to cast. /// /// /// A with the double. /// public static implicit operator double (Rational rat) { return (double) rat.Numerator / (double) rat.Denominator; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/StringIFDEntry.cs0000644000175000017500000000523211521241310023267 0ustar00alexalex00000000000000// // StringIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains an ASCII STRING value. /// public class StringIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public string Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public StringIFDEntry (ushort tag, string value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Ascii; ByteVector data = Value; data.Add ("\0"); count = (uint) data.Count; return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SubIFDArrayEntry.cs0000644000175000017500000000507411521241310023555 0ustar00alexalex00000000000000// // SubIFDArrayEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.IFD.Entries { /// /// Contains the SubIFDs IFD entry. /// public class SubIFDArrayEntry : IFDEntry { /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; set; } /// /// The structures of the IFDs to which this entry points. /// public IFDStructure [] Entries { get; private set; } #region Constructors /// /// Constructor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A set of ifd structures. /// public SubIFDArrayEntry (ushort tag, List entries) { Tag = tag; Entries = entries.ToArray (); } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { throw new NotImplementedException ("Not implemented yet!"); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/ByteVectorIFDEntry.cs0000644000175000017500000000521311521241310024106 0ustar00alexalex00000000000000// // ByteVectorIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains an BYTE value with a count > 1 (byte sequence). /// public class ByteVectorIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The data which is stored by the current instance /// public ByteVector Data { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public ByteVectorIFDEntry (ushort tag, ByteVector data) { Tag = tag; Data = data; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.Byte; count = (uint) Data.Count; return Data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SShortIFDEntry.cs0000644000175000017500000000520511521241310023243 0ustar00alexalex00000000000000// // SShortIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a Signed SHORT value. /// public class SShortIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public short Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SShortIFDEntry (ushort tag, short value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.SShort; count = 1; return ByteVector.FromUShort ((ushort) Value, is_bigendian); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Entries/SByteIFDEntry.cs0000644000175000017500000000512711521241310023052 0ustar00alexalex00000000000000// // SByteIFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Entries { /// /// Contains a signed byte value /// public class SByteIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The value which is stored by the current instance /// public sbyte Value { get; private set; } #endregion #region Constructors /// /// Construcor. /// /// /// A with the tag ID of the entry this instance /// represents /// /// /// A to be stored /// public SByteIFDEntry (ushort tag, sbyte value) { Tag = tag; Value = value; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count) { type = (ushort) IFDEntryType.SByte; count = 1; return (byte) Value; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDRenderer.cs0000644000175000017500000002140211521241310021131 0ustar00alexalex00000000000000// // IFDRenderer.cs: Outputs an IFD structure into TIFF IFD bytes. // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib.IFD.Entries; namespace TagLib.IFD { /// /// This class contains all the IFD rendering code. /// public class IFDRenderer { #region Private Fields /// /// The IFD structure that will be rendered. /// private readonly IFDStructure structure; /// /// If IFD should be encoded in BigEndian or not. /// private readonly bool is_bigendian; /// /// A value with the offset of the /// current IFD. All offsets inside the IFD must be adjusted /// according to this given offset. /// private readonly uint ifd_offset; #endregion #region Constructors /// /// Constructor. Will render the given IFD structure. /// /// /// If IFD should be encoded in BigEndian or not. /// /// /// The IFD structure that will be rendered. /// /// /// A value with the offset of the /// current IFD. All offsets inside the IFD must be adjusted /// according to this given offset. /// public IFDRenderer (bool is_bigendian, IFDStructure structure, uint ifd_offset) { this.is_bigendian = is_bigendian; this.structure = structure; this.ifd_offset = ifd_offset; } #endregion #region Public Methods /// /// Renders the current instance to a . /// /// /// A containing the rendered IFD. /// public ByteVector Render () { ByteVector ifd_data = new ByteVector (); uint current_offset = ifd_offset; var directories = structure.directories; for (int index = 0; index < directories.Count; index++) { ByteVector data = RenderIFD (directories [index], current_offset, index == directories.Count - 1); current_offset += (uint) data.Count; ifd_data.Add (data); } return ifd_data; } #endregion #region Private Methods /// /// Renders the IFD to an ByteVector where the offset of the IFD /// itself is and all offsets /// contained in the IFD are adjusted accroding it. /// /// /// A with the directory to render. /// /// /// A with the offset of the IFD /// /// /// A which is true, if the IFD is /// the last one, i.e. the offset to the next IFD, which is /// stored inside the IFD, is 0. If the value is false, the /// offset to the next IFD is set that it starts directly after /// the current one. /// /// /// A with the rendered IFD. /// private ByteVector RenderIFD (IFDDirectory directory, uint ifd_offset, bool last) { if (directory.Count > (int)UInt16.MaxValue) throw new Exception (String.Format ("Directory has too much entries: {0}", directory.Count)); // Remove empty SUB ifds. var tags = new List (directory.Keys); foreach (var tag in tags) { var entry = directory [tag]; if (entry is SubIFDEntry && (entry as SubIFDEntry).ChildCount == 0) { directory.Remove (tag); } } ushort entry_count = (ushort) directory.Count; // ifd_offset + size of entry_count + entries + next ifd offset uint data_offset = ifd_offset + 2 + 12 * (uint) entry_count + 4; // store the entries itself ByteVector entry_data = new ByteVector (); // store the data referenced by the entries ByteVector offset_data = new ByteVector (); entry_data.Add (ByteVector.FromUShort (entry_count, is_bigendian)); foreach (IFDEntry entry in directory.Values) RenderEntryData (entry, entry_data, offset_data, data_offset); if (last) entry_data.Add ("\0\0\0\0"); else entry_data.Add (ByteVector.FromUInt ((uint) (data_offset + offset_data.Count), is_bigendian)); if (data_offset - ifd_offset != entry_data.Count) throw new Exception (String.Format ("Expected IFD data size was {0} but is {1}", data_offset - ifd_offset, entry_data.Count)); entry_data.Add (offset_data); return entry_data; } #endregion #region Protected Methods /// /// Adds the data of a single entry to . /// /// /// A to add the entry to. /// /// /// A with the tag of the entry. /// /// /// A with the type of the entry. /// /// /// A with the data count of the entry, /// /// /// A with the offset field of the entry. /// protected void RenderEntry (ByteVector entry_data, ushort tag, ushort type, uint count, uint offset) { entry_data.Add (ByteVector.FromUShort (tag, is_bigendian)); entry_data.Add (ByteVector.FromUShort (type, is_bigendian)); entry_data.Add (ByteVector.FromUInt (count, is_bigendian)); entry_data.Add (ByteVector.FromUInt (offset, is_bigendian)); } /// /// Renders a complete entry together with the data. The entry itself /// is stored in and the data of the /// entry is stored in if it cannot be /// stored in the offset. This method is called for every of this IFD and can be overwritten in subclasses /// to provide special behavior. /// /// /// A with the entry to render. /// /// /// A to add the entry to. /// /// /// A to add the entry data to if it cannot be /// stored in the offset field. /// /// /// A with the offset, were the data of the /// entries starts. It is needed to adjust the offsets of the entries /// itself. /// protected virtual void RenderEntryData (IFDEntry entry, ByteVector entry_data, ByteVector offset_data, uint data_offset) { ushort tag = (ushort) entry.Tag; uint offset = (uint) (data_offset + offset_data.Count); ushort type; uint count; ByteVector data = entry.Render (is_bigendian, offset, out type, out count); // store data in offset, if it is smaller than 4 byte if (data.Count <= 4) { while (data.Count < 4) data.Add ("\0"); offset = data.ToUInt (is_bigendian); data = null; } // preserve word boundary of offsets if (data != null && data.Count % 2 != 0) data.Add ("\0"); RenderEntry (entry_data, tag, type, count, offset); offset_data.Add (data); } /// /// Constructs a new IFD Renderer used to render a . /// /// /// If IFD should be encoded in BigEndian or not. /// /// /// The IFD structure that will be rendered. /// /// /// A value with the offset of the /// current IFD. All offsets inside the IFD must be adjusted /// according to this given offset. /// protected virtual IFDRenderer CreateSubRenderer (bool is_bigendian, IFDStructure structure, uint ifd_offset) { return new IFDRenderer (is_bigendian, structure, ifd_offset); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDReader.cs0000644000175000017500000007732111773657505020632 0ustar00alexalex00000000000000// // IFDReader.cs: Parses TIFF IFDs and populates an IFD structure. // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.IO; using System.Collections.Generic; using TagLib.IFD.Entries; using TagLib.IFD.Makernotes; using TagLib.IFD.Tags; namespace TagLib.IFD { /// /// This class contains all the IFD reading and parsing code. /// public class IFDReader { #region Private Constants private static readonly string PANASONIC_HEADER = "Panasonic\0\0\0"; private static readonly string PENTAX_HEADER = "AOC\0"; private static readonly string NIKON_HEADER = "Nikon\0"; private static readonly string OLYMPUS1_HEADER = "OLYMP\0"; private static readonly string OLYMPUS2_HEADER = "OLYMPUS\0"; private static readonly string SONY_HEADER = "SONY DSC \0\0\0"; private static readonly string LEICA_HEADER = "LEICA\0\0\0"; #endregion #region Protected Fields /// /// The where this IFD is found in. /// protected readonly File file; /// /// If IFD is encoded in BigEndian or not /// protected readonly bool is_bigendian; /// /// The IFD structure that will be populated /// protected readonly IFDStructure structure; /// /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So base_offset must /// contain the beginning of the segment. /// protected readonly long base_offset; /// /// A value with the beginning of the IFD relative to /// base_offset. /// protected readonly uint ifd_offset; /// /// A with the maximal offset, which should occur in the /// IFD. Greater offsets, would reference beyond the considered data. /// protected readonly uint max_offset; /// /// Whether or not the makernote should be parsed. /// protected bool parse_makernote = true; #endregion /// /// Whether or not the makernote should be parsed. /// internal bool ShouldParseMakernote { get { return parse_makernote; } set { parse_makernote = value; } } #region Constructors /// /// Constructor. Reads an IFD from given file, using the given endianness. /// /// /// A to read from. /// /// /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. /// /// /// A that will be populated. /// /// /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So must contain the beginning of the segment. /// /// /// A value with the beginning of the IFD relative to /// . /// /// /// A value with maximal possible offset. This is to limit /// the size of the possible data; /// public IFDReader (File file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset) { this.file = file; this.is_bigendian = is_bigendian; this.structure = structure; this.base_offset = base_offset; this.ifd_offset = ifd_offset; this.max_offset = max_offset; } #endregion #region Public Methods /// /// Read all IFD segments from the file. /// public void Read () { Read (-1); } /// /// Read IFD segments from the file. /// /// /// The number of IFDs that may be read can be restricted using the count /// parameter. This might be needed for fiels that have invalid next-ifd /// pointers (such as some IFDs in the Nikon Makernote). This condition is /// tested in the Nikon2 unit test, which contains such a file. /// /// /// A with the maximal number of IFDs to read. /// Passing -1 means unlimited. /// public void Read (int count) { if (count == 0) return; uint next_offset = ifd_offset; int i = 0; lock (file) { StartIFDLoopDetect (); do { if (DetectIFDLoop (base_offset + next_offset)) { file.MarkAsCorrupt ("IFD loop detected"); break; } next_offset = ReadIFD (base_offset, next_offset, max_offset); } while (next_offset > 0 && (count == -1 || ++i < count)); StopIFDLoopDetect (); } } #endregion #region Private Methods /// /// Add to the reference count for the IFD loop detection. /// private void StartIFDLoopDetect () { if (!ifd_offsets.ContainsKey (file)) { ifd_offsets[file] = new List (); ifd_loopdetect_refs[file] = 1; } else { ifd_loopdetect_refs[file]++; } } /// /// Attempts to detect whether or not this file has an endless IFD loop. /// /// /// A with the offset at which the next IFD /// can be found. /// /// /// True if we have gone into a loop, false otherwise. /// private bool DetectIFDLoop (long offset) { if (offset == 0) return false; if (ifd_offsets[file].Contains (offset)) return true; ifd_offsets[file].Add (offset); return false; } /// /// End the IFD loop detection, cleanup if we're the last. /// private void StopIFDLoopDetect () { ifd_loopdetect_refs[file]--; if (ifd_loopdetect_refs[file] == 0) { ifd_offsets.Remove (file); ifd_loopdetect_refs.Remove (file); } } private static Dictionary> ifd_offsets = new Dictionary> (); private static Dictionary ifd_loopdetect_refs = new Dictionary (); /// /// Reads an IFD from file at position relative /// to . /// /// /// A with the base offset which every offset /// in IFD is relative to. /// /// /// A with the offset of the IFD relative to /// /// /// /// A with the maximal offset to consider for /// the IFD. /// /// /// A with the offset of the next IFD, the /// offset is also relative to /// private uint ReadIFD (long base_offset, uint offset, uint max_offset) { long length = 0; try { length = file.Length; } catch (Exception) { // Use a safety-value of 4 gigabyte. length = 1073741824L * 4; } if (base_offset + offset > length) { file.MarkAsCorrupt ("Invalid IFD offset"); return 0; } var directory = new IFDDirectory (); file.Seek (base_offset + offset, SeekOrigin.Begin); ushort entry_count = ReadUShort (); if (file.Tell + 12 * entry_count > base_offset + max_offset) { file.MarkAsCorrupt ("Size of entries exceeds possible data size"); return 0; } ByteVector entry_datas = file.ReadBlock (12 * entry_count); uint next_offset = ReadUInt (); for (int i = 0; i < entry_count; i++) { ByteVector entry_data = entry_datas.Mid (i * 12, 12); ushort entry_tag = entry_data.Mid (0, 2).ToUShort (is_bigendian); ushort type = entry_data.Mid (2, 2).ToUShort (is_bigendian); uint value_count = entry_data.Mid (4, 4).ToUInt (is_bigendian); ByteVector offset_data = entry_data.Mid (8, 4); IFDEntry entry = CreateIFDEntry (entry_tag, type, value_count, base_offset, offset_data, max_offset); if (entry == null) continue; if (directory.ContainsKey (entry.Tag)) directory.Remove (entry.Tag); directory.Add (entry.Tag, entry); } FixupDirectory (base_offset, directory); structure.directories.Add (directory); return next_offset; } /// /// Creates an IFDEntry from the given values. This method is used for /// every entry. Custom parsing can be hooked in by overriding the /// method. /// /// /// A with the tag of the entry. /// /// /// A with the type of the entry. /// /// /// A with the data count of the entry. /// /// /// A with the base offset which every /// offsets in the IFD are relative to. /// /// /// A containing exactly 4 byte with the data /// of the offset of the entry. Since this field isn't interpreted as /// an offset if the data can be directly stored in the 4 byte, we /// pass the to easier interpret it. /// /// /// A with the maximal offset to consider for /// the IFD. /// /// /// A with the given parameter. /// private IFDEntry CreateIFDEntry (ushort tag, ushort type, uint count, long base_offset, ByteVector offset_data, uint max_offset) { uint offset = offset_data.ToUInt (is_bigendian); // Fix the type for the IPTC tag. // From http://www.awaresystems.be/imaging/tiff/tifftags/iptc.html // "Often times, the datatype is incorrectly specified as LONG. " if (tag == (ushort) IFDEntryTag.IPTC && type == (ushort) IFDEntryType.Long) { type = (ushort) IFDEntryType.Byte; } var ifd_entry = ParseIFDEntry (tag, type, count, base_offset, offset); if (ifd_entry != null) return ifd_entry; if (count > 0x10000000) { // Some Nikon files are known to exhibit this corruption (or "feature"). file.MarkAsCorrupt ("Impossibly large item count"); return null; } // then handle the values stored in the offset data itself if (count == 1) { if (type == (ushort) IFDEntryType.Byte) return new ByteIFDEntry (tag, offset_data[0]); if (type == (ushort) IFDEntryType.SByte) return new SByteIFDEntry (tag, (sbyte)offset_data[0]); if (type == (ushort) IFDEntryType.Short) return new ShortIFDEntry (tag, offset_data.Mid (0, 2).ToUShort (is_bigendian)); if (type == (ushort) IFDEntryType.SShort) return new SShortIFDEntry (tag, (short) offset_data.Mid (0, 2).ToUShort (is_bigendian)); if (type == (ushort) IFDEntryType.Long) return new LongIFDEntry (tag, offset_data.ToUInt (is_bigendian)); if (type == (ushort) IFDEntryType.SLong) return new SLongIFDEntry (tag, offset_data.ToInt (is_bigendian)); } if (count == 2) { if (type == (ushort) IFDEntryType.Short) { ushort [] data = new ushort [] { offset_data.Mid (0, 2).ToUShort (is_bigendian), offset_data.Mid (2, 2).ToUShort (is_bigendian) }; return new ShortArrayIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.SShort) { short [] data = new short [] { (short) offset_data.Mid (0, 2).ToUShort (is_bigendian), (short) offset_data.Mid (2, 2).ToUShort (is_bigendian) }; return new SShortArrayIFDEntry (tag, data); } } if (count <= 4) { if (type == (ushort) IFDEntryType.Undefined) return new UndefinedIFDEntry (tag, offset_data.Mid (0, (int)count)); if (type == (ushort) IFDEntryType.Ascii) { string data = offset_data.Mid (0, (int)count).ToString (); int term = data.IndexOf ('\0'); if (term > -1) data = data.Substring (0, term); return new StringIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.Byte) return new ByteVectorIFDEntry (tag, offset_data.Mid (0, (int)count)); } // FIXME: create correct type. if (offset > max_offset) return new UndefinedIFDEntry (tag, new ByteVector ()); // then handle data referenced by the offset file.Seek (base_offset + offset, SeekOrigin.Begin); if (count == 1) { if (type == (ushort) IFDEntryType.Rational) return new RationalIFDEntry (tag, ReadRational ()); if (type == (ushort) IFDEntryType.SRational) return new SRationalIFDEntry (tag, ReadSRational ()); } if (count > 1) { if (type == (ushort) IFDEntryType.Long) { uint [] data = ReadUIntArray (count); return new LongArrayIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.SLong) { int [] data = ReadIntArray (count); return new SLongArrayIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.Rational) { Rational[] entries = new Rational [count]; for (int i = 0; i < count; i++) entries[i] = ReadRational (); return new RationalArrayIFDEntry (tag, entries); } if (type == (ushort) IFDEntryType.SRational) { SRational[] entries = new SRational [count]; for (int i = 0; i < count; i++) entries[i] = ReadSRational (); return new SRationalArrayIFDEntry (tag, entries); } } if (count > 2) { if (type == (ushort) IFDEntryType.Short) { ushort [] data = ReadUShortArray (count); return new ShortArrayIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.SShort) { short [] data = ReadShortArray (count); return new SShortArrayIFDEntry (tag, data); } } if (count > 4) { if (type == (ushort) IFDEntryType.Long) { uint [] data = ReadUIntArray (count); return new LongArrayIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.Byte) { ByteVector data = file.ReadBlock ((int) count); return new ByteVectorIFDEntry (tag, data); } if (type == (ushort) IFDEntryType.Ascii) { string data = ReadAsciiString ((int) count); return new StringIFDEntry (tag, data); } if (tag == (ushort) ExifEntryTag.UserComment) { ByteVector data = file.ReadBlock ((int) count); return new UserCommentIFDEntry (tag, data, file); } if (type == (ushort) IFDEntryType.Undefined) { ByteVector data = file.ReadBlock ((int) count); return new UndefinedIFDEntry (tag, data); } } if (type == (ushort) IFDEntryType.Float) return null; if (type == 0 || type > 12) { // Invalid type file.MarkAsCorrupt ("Invalid item type"); return null; } // TODO: We should ignore unreadable values, erroring for now until we have sufficient coverage. throw new NotImplementedException (String.Format ("Unknown type/count {0}/{1} ({2})", type, count, offset)); } /// /// Reads a 2-byte signed short from the current file. /// /// /// A value containing the short read /// from the current instance. /// private short ReadShort () { return (short) file.ReadBlock (2).ToUShort (is_bigendian); } /// /// Reads a 2-byte unsigned short from the current file. /// /// /// A value containing the short read /// from the current instance. /// private ushort ReadUShort () { return file.ReadBlock (2).ToUShort (is_bigendian); } /// /// Reads a 4-byte int from the current file. /// /// /// A value containing the int read /// from the current instance. /// private int ReadInt () { return file.ReadBlock (4).ToInt (is_bigendian); } /// /// Reads a 4-byte unsigned int from the current file. /// /// /// A value containing the int read /// from the current instance. /// private uint ReadUInt () { return file.ReadBlock (4).ToUInt (is_bigendian); } /// /// Reads a by two following unsigned /// int from the current file. /// /// /// A value created by the read values. /// private Rational ReadRational () { uint numerator = ReadUInt (); uint denominator = ReadUInt (); // correct illegal value if (denominator == 0) { numerator = 0; denominator = 1; } return new Rational (numerator, denominator); } /// /// Reads a by two following unsigned /// int from the current file. /// /// /// A value created by the read values. /// private SRational ReadSRational () { int numerator = ReadInt (); int denominator = ReadInt (); // correct illegal value if (denominator == 0) { numerator = 0; denominator = 1; } return new SRational (numerator, denominator); } /// /// Reads an array of 2-byte shorts from the current file. /// /// /// An array of values containing the /// shorts read from the current instance. /// private ushort [] ReadUShortArray (uint count) { ushort [] data = new ushort [count]; for (int i = 0; i < count; i++) data [i] = ReadUShort (); return data; } /// /// Reads an array of 2-byte signed shorts from the current file. /// /// /// An array of values containing the /// shorts read from the current instance. /// private short [] ReadShortArray (uint count) { short [] data = new short [count]; for (int i = 0; i < count; i++) data [i] = ReadShort (); return data; } /// /// Reads an array of 4-byte int from the current file. /// /// /// An array of values containing the /// shorts read from the current instance. /// private int [] ReadIntArray (uint count) { int [] data = new int [count]; for (int i = 0; i < count; i++) data [i] = ReadInt (); return data; } /// /// Reads an array of 4-byte unsigned int from the current file. /// /// /// An array of values containing the /// shorts read from the current instance. /// private uint [] ReadUIntArray (uint count) { uint [] data = new uint [count]; for (int i = 0; i < count; i++) data [i] = ReadUInt (); return data; } /// /// Reads an ASCII string from the current file. /// /// /// A read from the current instance. /// /// /// The exif standard allows to store multiple string separated /// by '\0' in one ASCII-field. On the other hand some programs /// (e.g. CanonZoomBrowser) fill some ASCII fields by trailing /// '\0's. /// We follow the Adobe practice as described in XMP Specification /// Part 3 (Storeage in Files), and process the ASCII string only /// to the first '\0'. /// private string ReadAsciiString (int count) { string str = file.ReadBlock (count).ToString (); int term = str.IndexOf ('\0'); if (term > -1) str = str.Substring (0, term); return str; } /// /// Performs some fixups to a read . For some /// special cases multiple instances contained /// in the directory are needed. Therfore, we do the fixups after reading the /// whole directory to be sure, all entries are present. /// /// /// A value with the base offset, all offsets in the /// directory refers to. /// /// /// A instance which was read and needs fixes. /// private void FixupDirectory (long base_offset, IFDDirectory directory) { // The following two entries refer to thumbnail data, where one is the offset // to the data and the other is the length. Unnaturally both are used to describe // the data. So it is needed to keep both entries in sync and keep the thumbnail data // for writing it back. // We determine the position of the data, read it and store it in an ThumbnailDataIFDEntry // which replaces the offset-entry to thumbnail data. ushort offset_tag = (ushort) IFDEntryTag.JPEGInterchangeFormat; ushort length_tag = (ushort) IFDEntryTag.JPEGInterchangeFormatLength; if (directory.ContainsKey (offset_tag) && directory.ContainsKey (length_tag)) { var offset_entry = directory [offset_tag] as LongIFDEntry; var length_entry = directory [length_tag] as LongIFDEntry; if (offset_entry != null && length_entry != null) { uint offset = offset_entry.Value; uint length = length_entry.Value; file.Seek (base_offset + offset, SeekOrigin.Begin); ByteVector data = file.ReadBlock ((int) length); directory.Remove (offset_tag); directory.Add (offset_tag, new ThumbnailDataIFDEntry (offset_tag, data)); } } // create a StripOffsetIFDEntry if necessary ushort strip_offsets_tag = (ushort) IFDEntryTag.StripOffsets; ushort strip_byte_counts_tag = (ushort) IFDEntryTag.StripByteCounts; if (directory.ContainsKey (strip_offsets_tag) && directory.ContainsKey (strip_byte_counts_tag)) { uint [] strip_offsets = null; uint [] strip_byte_counts = null; var strip_offsets_entry = directory [strip_offsets_tag]; var strip_byte_counts_entry = directory [strip_byte_counts_tag]; if (strip_offsets_entry is LongIFDEntry) strip_offsets = new uint[] {(strip_offsets_entry as LongIFDEntry).Value}; else if (strip_offsets_entry is LongArrayIFDEntry) strip_offsets = (strip_offsets_entry as LongArrayIFDEntry).Values; if (strip_offsets == null) return; if (strip_byte_counts_entry is LongIFDEntry) strip_byte_counts = new uint[] {(strip_byte_counts_entry as LongIFDEntry).Value}; else if (strip_byte_counts_entry is LongArrayIFDEntry) strip_byte_counts = (strip_byte_counts_entry as LongArrayIFDEntry).Values; if (strip_byte_counts == null) return; directory.Remove (strip_offsets_tag); directory.Add (strip_offsets_tag, new StripOffsetsIFDEntry (strip_offsets_tag, strip_offsets, strip_byte_counts, file)); } } private IFDEntry ParseMakernote (ushort tag, ushort type, uint count, long base_offset, uint offset) { long makernote_offset = base_offset + offset; IFDStructure ifd_structure = new IFDStructure (); // This is the minimum size a makernote should have // The shortest header is PENTAX_HEADER (4) // + IFD entry count (2) // + at least one IFD etry (12) // + next IFD pointer (4) // = 22 .... // we use this number to read a header which is big used // to identify the makernote types int header_size = 18; long length = 0; try { length = file.Length; } catch (Exception) { // Use a safety-value of 4 gigabyte. length = 1073741824L * 4; } if (makernote_offset > length) { file.MarkAsCorrupt ("offset to makernote is beyond file size"); return null; } if (makernote_offset + header_size > length) { file.MarkAsCorrupt ("data is to short to contain a maker note ifd"); return null; } // read header file.Seek (makernote_offset, SeekOrigin.Begin); ByteVector header = file.ReadBlock (header_size); if (header.StartsWith (PANASONIC_HEADER)) { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, base_offset, offset + 12, max_offset); reader.ReadIFD (base_offset, offset + 12, max_offset); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Panasonic, PANASONIC_HEADER, 12, true, null); } if (header.StartsWith (PENTAX_HEADER)) { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, base_offset, offset + 6, max_offset); reader.ReadIFD (base_offset, offset + 6, max_offset); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Pentax, header.Mid (0, 6), 6, true, null); } if (header.StartsWith (OLYMPUS1_HEADER)) { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, base_offset, offset + 8, max_offset); reader.Read (); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Olympus1, header.Mid (0, 8), 8, true, null); } if (header.StartsWith (OLYMPUS2_HEADER)) { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, makernote_offset, 12, count); reader.Read (); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Olympus2, header.Mid (0, 12), 12, false, null); } if (header.StartsWith (SONY_HEADER)) { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, base_offset, offset + 12, max_offset); reader.ReadIFD (base_offset, offset + 12, max_offset); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Sony, SONY_HEADER, 12, true, null); } if (header.StartsWith (NIKON_HEADER)) { ByteVector endian_bytes = header.Mid (10, 2); if (endian_bytes.ToString () == "II" || endian_bytes.ToString () == "MM") { bool makernote_endian = endian_bytes.ToString ().Equals ("MM"); ushort magic = header.Mid (12, 2).ToUShort (is_bigendian); if (magic == 42) { // TODO: the max_offset value is not correct here. However, some nikon files have offsets to a sub-ifd // (preview image) which are not stored with the other makernote data. Therfore, we keep the max_offset // for now. (It is just an upper bound for some checks. So if it is too big, it doesn't matter) var reader = new Nikon3MakernoteReader (file, makernote_endian, ifd_structure, makernote_offset + 10, 8, max_offset - offset - 10); reader.Read (); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Nikon3, header.Mid (0, 18), 8, false, makernote_endian); } } } if (header.StartsWith (LEICA_HEADER)) { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, makernote_offset, 8, count); reader.Read (); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Leica, header.Mid (0, 8), 10, false, null); } try { IFDReader reader = new IFDReader (file, is_bigendian, ifd_structure, base_offset, offset, max_offset); reader.Read (); return new MakernoteIFDEntry (tag, ifd_structure, MakernoteType.Canon); } catch { return null; } } #endregion #region Protected Methods /// /// Try to parse the given IFD entry, used to discover format-specific entries. /// /// /// A with the tag of the entry. /// /// /// A with the type of the entry. /// /// /// A with the data count of the entry. /// /// /// A with the base offset which every offsets in the /// IFD are relative to. /// /// /// A with the offset of the entry. /// /// /// A with the given parameters, or null if none was parsed, after /// which the normal TIFF parsing is used. /// protected virtual IFDEntry ParseIFDEntry (ushort tag, ushort type, uint count, long base_offset, uint offset) { if (tag == (ushort) ExifEntryTag.MakerNote && parse_makernote) return ParseMakernote (tag, type, count, base_offset, offset); if (tag == (ushort) IFDEntryTag.SubIFDs) { var entries = new List (); uint [] data; if (count >= 2) { // This is impossible right? if (base_offset + offset > file.Length) { file.MarkAsCorrupt ("Length of SubIFD is too long"); return null; } file.Seek (base_offset + offset, SeekOrigin.Begin); data = ReadUIntArray (count); } else { data = new uint [] { offset }; } foreach (var sub_offset in data) { var sub_structure = new IFDStructure (); var sub_reader = CreateSubIFDReader (file, is_bigendian, sub_structure, base_offset, sub_offset, max_offset); sub_reader.Read (); entries.Add (sub_structure); } return new SubIFDArrayEntry (tag, entries); } IFDStructure ifd_structure = new IFDStructure (); IFDReader reader = CreateSubIFDReader (file, is_bigendian, ifd_structure, base_offset, offset, max_offset); // Sub IFDs are either identified by the IFD-type ... if (type == (ushort) IFDEntryType.IFD) { reader.Read (); return new SubIFDEntry (tag, type, (uint) ifd_structure.Directories.Length, ifd_structure); } // ... or by one of the following tags switch (tag) { case (ushort) IFDEntryTag.ExifIFD: case (ushort) IFDEntryTag.InteroperabilityIFD: case (ushort) IFDEntryTag.GPSIFD: reader.Read (); return new SubIFDEntry (tag, (ushort) IFDEntryType.Long, 1, ifd_structure); default: return null; } } /// /// Create a reader for Sub IFD entries. /// /// /// A to read from. /// /// /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. /// /// /// A that will be populated. /// /// /// A with the base offset which every offsets in the /// IFD are relative to. /// /// /// A with the offset of the entry. /// /// /// A with the maximal offset to consider for /// the IFD. /// /// /// A which can be used to read the specified sub IFD. /// protected virtual IFDReader CreateSubIFDReader (File file, bool is_bigendian, IFDStructure structure, long base_offset, uint offset, uint max_offset) { return new IFDReader (file, is_bigendian, structure, base_offset, offset, max_offset); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDEntryType.cs0000644000175000017500000000506411521241310021334 0ustar00alexalex00000000000000// // IFDEntryType.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD { /// /// A type indicator, which identifies how the corresponding value /// field should be interpreted. /// public enum IFDEntryType : ushort { /// /// Unknown (shouldn't occur) /// Unknown = 0, /// /// 8-bit unsigned integer. /// Byte = 1, /// /// 8-bit byte that contains a 7-bit ASCII code; the last byte /// must be NUL (binary zero). /// Ascii = 2, /// /// 16-bit (2-byte) unsigned integer. /// Short = 3, /// /// 32-bit (4-byte) unsigned integer. /// Long = 4, /// /// Two LONGs: the first represents the numerator of a /// fraction; the second, the denominator. /// Rational = 5, /// /// An 8-bit signed (twos-complement) integer. /// SByte = 6, /// /// An 8-bit byte that may contain anything, depending on /// the definition of the field. /// Undefined = 7, /// /// A 16-bit (2-byte) signed (twos-complement) integer. /// SShort = 8, /// /// A 32-bit (4-byte) signed (twos-complement) integer. /// SLong = 9, /// /// Two SLONG’s: the first represents the numerator of a /// fraction, the second the denominator. /// SRational = 10, /// /// Single precision (4-byte) IEEE format. /// Float = 11, /// /// Double precision (8-byte) IEEE format. /// Double = 12, /// /// IFD /// IFD = 13 } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDEntry.cs0000644000175000017500000000675411521241310020501 0ustar00alexalex00000000000000// // IFDEntry.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD { /// /// An IFD entry, which is a key/value pair inside an IFD. /// public interface IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// ushort Tag { get; } #endregion #region Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count); #endregion } /// /// This class abstracts common stuff for array IFD entries /// public abstract class ArrayIFDEntry : IFDEntry { #region Properties /// /// The ID of the tag, the current instance belongs to /// public ushort Tag { get; private set; } /// /// The values stored by the current instance. /// public T [] Values { get; protected set; } #endregion #region Constructors /// /// Constructor. /// /// /// A with the tag ID of the entry this instance /// represents /// public ArrayIFDEntry (ushort tag) { Tag = tag; } #endregion #region Public Methods /// /// Renders the current instance to a /// /// /// A indicating the endianess for rendering. /// /// /// A with the offset, the data is stored. /// /// /// A the ID of the type, which is rendered /// /// /// A with the count of the values which are /// rendered. /// /// /// A with the rendered data. /// public abstract ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count); #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDDirectory.cs0000644000175000017500000000201111521241310021322 0ustar00alexalex00000000000000// // IFDDirectory.cs: A dictionary grouping IFDEntries. // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2009 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; namespace TagLib.IFD { /// /// Contains the entries in this IFD. /// public class IFDDirectory : Dictionary { } } taglib-sharp-2.1.0.0/src/TagLib/IFD/Makernotes/0000755000175000017500000000000011774620112020635 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/IFD/Makernotes/Nikon3MakernoteReader.cs0000644000175000017500000001101611521241310025302 0ustar00alexalex00000000000000// // Nikon3MakernoteReader.cs: Reads Nikon Makernotes. // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using TagLib.IFD.Entries; using TagLib.IFD.Tags; namespace TagLib.IFD.Makernotes { /// /// This class contains Nikon3 makernote specific reading logic. /// public class Nikon3MakernoteReader : IFDReader { #region Constructors /// /// Constructor. Reads an IFD from given file, using the given endianness. /// /// /// A to read from. /// /// /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. /// /// /// A that will be populated. /// /// /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So must contain the beginning of the segment. /// /// /// A value with the beginning of the IFD relative to /// . /// /// /// A value with maximal possible offset. This is to limit /// the size of the possible data; /// public Nikon3MakernoteReader (File file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset) : base (file, is_bigendian, structure, base_offset, ifd_offset, max_offset) { } #endregion #region Protected Methods /// /// Try to parse the given IFD entry, used to discover format-specific entries. /// /// /// A with the tag of the entry. /// /// /// A with the type of the entry. /// /// /// A with the data count of the entry. /// /// /// A with the base offset which every offsets in the /// IFD are relative to. /// /// /// A with the offset of the entry. /// /// /// A with the given parameters, or null if none was parsed, after /// which the normal TIFF parsing is used. /// protected override IFDEntry ParseIFDEntry (ushort tag, ushort type, uint count, long base_offset, uint offset) { if (tag == (ushort) Nikon3MakerNoteEntryTag.Preview) { // SubIFD with Preview Image // The entry itself is usually a long // TODO: handle JPEGInterchangeFormat and JPEGInterchangeFormatLength correctly // The preview field contains a long with an offset to an IFD // that contains the preview image. We need to be careful // though: this IFD does not contain a valid next-offset // pointer. For this reason, we only read the first IFD and // ignore the rest (which is preview image data, directly // starting after the IFD entries). type = (ushort) IFDEntryType.IFD; IFDStructure ifd_structure = new IFDStructure (); IFDReader reader = CreateSubIFDReader (file, is_bigendian, ifd_structure, base_offset, offset, max_offset); reader.Read (1); return new SubIFDEntry (tag, type, (uint) ifd_structure.Directories.Length, ifd_structure); } return base.ParseIFDEntry (tag, type, count, base_offset, offset); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDTag.cs0000644000175000017500000004315011521241310020102 0ustar00alexalex00000000000000// // IFDTag.cs: Basic Tag-class to handle an IFD (Image File Directory) with // its image-tags. // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // Paul Lange (palango@gmx.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using System.IO; using TagLib.Image; using TagLib.IFD.Entries; using TagLib.IFD.Tags; namespace TagLib.IFD { /// /// Contains the metadata for one IFD (Image File Directory). /// public class IFDTag : ImageTag { #region Private Fields /// /// A reference to the Exif IFD (which can be found by following the /// pointer in IFD0, ExifIFD tag). This variable should not be used /// directly, use the property instead. /// private IFDStructure exif_ifd = null; /// /// A reference to the GPS IFD (which can be found by following the /// pointer in IFD0, GPSIFD tag). This variable should not be used /// directly, use the property instead. /// private IFDStructure gps_ifd = null; #endregion #region Public Properties /// /// The IFD structure referenced by the current instance /// public IFDStructure Structure { get; private set; } /// /// The Exif IFD. Will create one if the file doesn't alread have it. /// /// /// Note how this also creates an empty IFD for exif, even if /// you don't set a value. That's okay, empty nested IFDs get ignored /// when rendering. /// public IFDStructure ExifIFD { get { if (exif_ifd == null) { var entry = Structure.GetEntry (0, IFDEntryTag.ExifIFD) as SubIFDEntry; if (entry == null) { exif_ifd = new IFDStructure (); entry = new SubIFDEntry ((ushort) IFDEntryTag.ExifIFD, (ushort) IFDEntryType.Long, 1, exif_ifd); Structure.SetEntry (0, entry); } exif_ifd = entry.Structure; } return exif_ifd; } } /// /// The GPS IFD. Will create one if the file doesn't alread have it. /// /// /// Note how this also creates an empty IFD for GPS, even if /// you don't set a value. That's okay, empty nested IFDs get ignored /// when rendering. /// public IFDStructure GPSIFD { get { if (gps_ifd == null) { var entry = Structure.GetEntry (0, IFDEntryTag.GPSIFD) as SubIFDEntry; if (entry == null) { gps_ifd = new IFDStructure (); entry = new SubIFDEntry ((ushort) IFDEntryTag.GPSIFD, (ushort) IFDEntryType.Long, 1, gps_ifd); Structure.SetEntry (0, entry); } gps_ifd = entry.Structure; } return gps_ifd; } } /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get { return TagTypes.TiffIFD; } } #endregion #region Constructors /// /// Constructor. Creates an empty IFD tag. Can be populated manually, or via /// . /// public IFDTag () { Structure = new IFDStructure (); } #endregion #region Public Methods /// /// Clears the values stored in the current instance. /// public override void Clear () { throw new NotImplementedException (); } #endregion #region Metadata fields /// /// Gets or sets the comment for the image described /// by the current instance. /// /// /// A containing the comment of the /// current instace. /// public override string Comment { get { var comment_entry = ExifIFD.GetEntry (0, (ushort) ExifEntryTag.UserComment) as UserCommentIFDEntry; if (comment_entry == null) { var description = Structure.GetEntry (0, IFDEntryTag.ImageDescription) as StringIFDEntry; return description == null ? null : description.Value; } return comment_entry.Value; } set { if (value == null) { ExifIFD.RemoveTag (0, (ushort) ExifEntryTag.UserComment); Structure.RemoveTag (0, (ushort) IFDEntryTag.ImageDescription); return; } ExifIFD.SetEntry (0, new UserCommentIFDEntry ((ushort) ExifEntryTag.UserComment, value)); Structure.SetEntry (0, new StringIFDEntry ((ushort) IFDEntryTag.ImageDescription, value)); } } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// public override string Copyright { get { return Structure.GetStringValue (0, (ushort) IFDEntryTag.Copyright); } set { if (value == null) { Structure.RemoveTag (0, (ushort) IFDEntryTag.Copyright); return; } Structure.SetEntry (0, new StringIFDEntry ((ushort) IFDEntryTag.Copyright, value)); } } /// /// Gets or sets the creator of the image. /// /// /// A with the name of the creator. /// public override string Creator { get { return Structure.GetStringValue (0, (ushort) IFDEntryTag.Artist); } set { Structure.SetStringValue (0, (ushort) IFDEntryTag.Artist, value); } } /// /// Gets or sets the software the image, the current instance /// belongs to, was created with. /// /// /// A containing the name of the /// software the current instace was created with. /// public override string Software { get { return Structure.GetStringValue (0, (ushort) IFDEntryTag.Software); } set { Structure.SetStringValue (0, (ushort) IFDEntryTag.Software, value); } } /// /// Gets or sets the time when the image, the current instance /// belongs to, was taken. /// /// /// A with the time the image was taken. /// public override DateTime? DateTime { get { return DateTimeOriginal; } set { DateTimeOriginal = value; } } /// /// The time of capturing. /// /// /// A with the time of capturing. /// public DateTime? DateTimeOriginal { get { return ExifIFD.GetDateTimeValue (0, (ushort) ExifEntryTag.DateTimeOriginal); } set { if (value == null) { ExifIFD.RemoveTag (0, (ushort) ExifEntryTag.DateTimeOriginal); return; } ExifIFD.SetDateTimeValue (0, (ushort) ExifEntryTag.DateTimeOriginal, value.Value); } } /// /// The time of digitization. /// /// /// A with the time of digitization. /// public DateTime? DateTimeDigitized { get { return ExifIFD.GetDateTimeValue (0, (ushort) ExifEntryTag.DateTimeDigitized); } set { if (value == null) { ExifIFD.RemoveTag (0, (ushort) ExifEntryTag.DateTimeDigitized); return; } ExifIFD.SetDateTimeValue (0, (ushort) ExifEntryTag.DateTimeDigitized, value.Value); } } /// /// Gets or sets the latitude of the GPS coordinate the current /// image was taken. /// /// /// A with the latitude ranging from -90.0 /// to +90.0 degrees. /// public override double? Latitude { get { var gps_ifd = GPSIFD; var degree_entry = gps_ifd.GetEntry (0, (ushort) GPSEntryTag.GPSLatitude) as RationalArrayIFDEntry; var degree_ref = gps_ifd.GetStringValue (0, (ushort) GPSEntryTag.GPSLatitudeRef); if (degree_entry == null || degree_ref == null) return null; Rational [] values = degree_entry.Values; if (values.Length != 3) return null; double deg = values[0] + values[1] / 60.0d + values[2] / 3600.0d; if (degree_ref == "S") deg *= -1.0d; return Math.Max (Math.Min (deg, 90.0d), -90.0d); } set { var gps_ifd = GPSIFD; if (value == null) { gps_ifd.RemoveTag (0, (ushort) GPSEntryTag.GPSLatitudeRef); gps_ifd.RemoveTag (0, (ushort) GPSEntryTag.GPSLatitude); return; } double angle = value.Value; if (angle < -90.0d || angle > 90.0d) throw new ArgumentException ("value"); InitGpsDirectory (); gps_ifd.SetStringValue (0, (ushort) GPSEntryTag.GPSLatitudeRef, angle < 0 ? "S" : "N"); var entry = new RationalArrayIFDEntry ((ushort) GPSEntryTag.GPSLatitude, DegreeToRationals (Math.Abs (angle))); gps_ifd.SetEntry (0, entry); } } /// /// Gets or sets the longitude of the GPS coordinate the current /// image was taken. /// /// /// A with the longitude ranging from -180.0 /// to +180.0 degrees. /// public override double? Longitude { get { var gps_ifd = GPSIFD; var degree_entry = gps_ifd.GetEntry (0, (ushort) GPSEntryTag.GPSLongitude) as RationalArrayIFDEntry; var degree_ref = gps_ifd.GetStringValue (0, (ushort) GPSEntryTag.GPSLongitudeRef); if (degree_entry == null || degree_ref == null) return null; Rational [] values = degree_entry.Values; if (values.Length != 3) return null; double deg = values[0] + values[1] / 60.0d + values[2] / 3600.0d; if (degree_ref == "W") deg *= -1.0d; return Math.Max (Math.Min (deg, 180.0d), -180.0d); } set { var gps_ifd = GPSIFD; if (value == null) { gps_ifd.RemoveTag (0, (ushort) GPSEntryTag.GPSLongitudeRef); gps_ifd.RemoveTag (0, (ushort) GPSEntryTag.GPSLongitude); return; } double angle = value.Value; if (angle < -180.0d || angle > 180.0d) throw new ArgumentException ("value"); InitGpsDirectory (); gps_ifd.SetStringValue (0, (ushort) GPSEntryTag.GPSLongitudeRef, angle < 0 ? "W" : "E"); var entry = new RationalArrayIFDEntry ((ushort) GPSEntryTag.GPSLongitude, DegreeToRationals (Math.Abs (angle))); gps_ifd.SetEntry (0, entry); } } /// /// Gets or sets the altitude of the GPS coordinate the current /// image was taken. The unit is meter. /// /// /// A with the altitude. A positive value /// is above sea level, a negative one below sea level. The unit is meter. /// public override double? Altitude { get { var gps_ifd = GPSIFD; var altitude = gps_ifd.GetRationalValue (0, (ushort) GPSEntryTag.GPSAltitude); var ref_entry = gps_ifd.GetByteValue (0, (ushort) GPSEntryTag.GPSAltitudeRef); if (altitude == null || ref_entry == null) return null; if (ref_entry.Value == 1) altitude *= -1.0d; return altitude; } set { var gps_ifd = GPSIFD; if (value == null) { gps_ifd.RemoveTag (0, (ushort) GPSEntryTag.GPSAltitudeRef); gps_ifd.RemoveTag (0, (ushort) GPSEntryTag.GPSAltitude); return; } double altitude = value.Value; InitGpsDirectory (); gps_ifd.SetByteValue (0, (ushort) GPSEntryTag.GPSAltitudeRef, (byte)(altitude < 0 ? 1 : 0)); gps_ifd.SetRationalValue (0, (ushort) GPSEntryTag.GPSAltitude, Math.Abs (altitude)); } } /// /// Gets the exposure time the image, the current instance belongs /// to, was taken with. /// /// /// A with the exposure time in seconds. /// public override double? ExposureTime { get { return ExifIFD.GetRationalValue (0, (ushort) ExifEntryTag.ExposureTime); } set { ExifIFD.SetRationalValue (0, (ushort) ExifEntryTag.ExposureTime, value.HasValue ? (double) value : 0); } } /// /// Gets the FNumber the image, the current instance belongs /// to, was taken with. /// /// /// A with the FNumber. /// public override double? FNumber { get { return ExifIFD.GetRationalValue (0, (ushort) ExifEntryTag.FNumber); } set { ExifIFD.SetRationalValue (0, (ushort) ExifEntryTag.FNumber, value.HasValue ? (double) value : 0); } } /// /// Gets the ISO speed the image, the current instance belongs /// to, was taken with. /// /// /// A with the ISO speed as defined in ISO 12232. /// public override uint? ISOSpeedRatings { get { return ExifIFD.GetLongValue (0, (ushort) ExifEntryTag.ISOSpeedRatings); } set { ExifIFD.SetLongValue (0, (ushort) ExifEntryTag.ISOSpeedRatings, value.HasValue ? (uint) value : 0); } } /// /// Gets the focal length the image, the current instance belongs /// to, was taken with. /// /// /// A with the focal length in millimeters. /// public override double? FocalLength { get { return ExifIFD.GetRationalValue (0, (ushort) ExifEntryTag.FocalLength); } set { ExifIFD.SetRationalValue (0, (ushort) ExifEntryTag.FocalLength, value.HasValue ? (double) value : 0); } } /// /// Gets the focal length the image, the current instance belongs /// to, was taken with, assuming a 35mm film camera. /// /// /// A with the focal length in 35mm equivalent in millimeters. /// public override uint? FocalLengthIn35mmFilm { get { return ExifIFD.GetLongValue (0, (ushort) ExifEntryTag.FocalLengthIn35mmFilm); } set { if (value.HasValue) { ExifIFD.SetLongValue (0, (ushort) ExifEntryTag.FocalLengthIn35mmFilm, (uint) value); } else { ExifIFD.RemoveTag (0, (ushort) ExifEntryTag.FocalLengthIn35mmFilm); } } } /// /// Gets or sets the orientation of the image described /// by the current instance. /// /// /// A containing the orientation of the /// image /// public override ImageOrientation Orientation { get { var orientation = Structure.GetLongValue (0, (ushort) IFDEntryTag.Orientation); if (orientation.HasValue) return (ImageOrientation) orientation; return ImageOrientation.None; } set { if ((uint) value < 1U || (uint) value > 8U) { Structure.RemoveTag (0, (ushort) IFDEntryTag.Orientation); return; } Structure.SetLongValue (0, (ushort) IFDEntryTag.Orientation, (uint) value); } } /// /// Gets the manufacture of the recording equipment the image, the /// current instance belongs to, was taken with. /// /// /// A with the manufacture name. /// public override string Make { get { return Structure.GetStringValue (0, (ushort) IFDEntryTag.Make); } set { Structure.SetStringValue (0, (ushort) IFDEntryTag.Make, value); } } /// /// Gets the model name of the recording equipment the image, the /// current instance belongs to, was taken with. /// /// /// A with the model name. /// public override string Model { get { return Structure.GetStringValue (0, (ushort) IFDEntryTag.Model); } set { Structure.SetStringValue (0, (ushort) IFDEntryTag.Model, value); } } #endregion #region Private Methods /// /// Initilazies the GPS IFD with some basic entries. /// private void InitGpsDirectory () { GPSIFD.SetStringValue (0, (ushort) GPSEntryTag.GPSVersionID, "2 0 0 0"); GPSIFD.SetStringValue (0, (ushort) GPSEntryTag.GPSMapDatum, "WGS-84"); } /// /// Converts a given (positive) angle value to three rationals like they /// are used to store an angle for GPS data. /// /// /// A between 0.0d and 180.0d with the angle /// in degrees /// /// /// A representing the same angle by degree, minutes /// and seconds of the angle. /// private Rational[] DegreeToRationals (double angle) { if (angle < 0.0 || angle > 180.0) throw new ArgumentException ("angle"); uint deg = (uint) Math.Floor (angle); uint min = (uint) ((angle - Math.Floor (angle)) * 60.0); uint sec = (uint) ((angle - Math.Floor (angle) - (min / 60.0)) * 360000000.0); Rational[] rationals = new Rational [] { new Rational (deg, 1), new Rational (min, 1), new Rational (sec, 100000) }; return rationals; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IFD/IFDStructure.cs0000644000175000017500000003623711521241310021377 0ustar00alexalex00000000000000// // IFDStructure.cs: A structure resembling the logical structure of a TIFF IFD // file. This is the same structure as used by Exif. // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // Paul Lange (palango@gmx.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib.IFD.Entries; using TagLib.IFD.Tags; namespace TagLib.IFD { /// /// This class resembles the structure of a TIFF file. It can either be a /// top-level IFD, or a nested IFD (in the case of Exif). /// public class IFDStructure { #region Private Fields private static readonly string DATETIME_FORMAT = "yyyy:MM:dd HH:mm:ss"; /// /// Contains the IFD directories in this tag. /// internal readonly List directories = new List (); #endregion #region Public Properties /// /// Gets the IFD directories contained in the current instance. /// /// /// An array of instances. /// public IFDDirectory [] Directories { get { return directories.ToArray (); } } #endregion #region Public Methods /// /// Checks, if a value for the given tag is contained in the IFD. /// /// /// A value with the directory index that /// contains the tag. /// /// /// A value with the tag. /// /// /// A , which is true, if the tag is already /// contained in the IFD, otherwise false. /// public bool ContainsTag (int directory, ushort tag) { if (directory >= directories.Count) return false; return directories [directory].ContainsKey (tag); } /// /// Removes a given tag from the IFD. /// /// /// A value with the directory index that /// contains the tag to remove. /// /// /// A value with the tag to remove. /// public void RemoveTag (int directory, ushort tag) { if (ContainsTag (directory, tag)) { directories [directory].Remove (tag); } } /// /// Removes a given tag from the IFD. /// /// /// A value with the directory index that /// contains the tag to remove. /// /// /// A value with the tag to remove. /// public void RemoveTag (int directory, IFDEntryTag entry_tag) { RemoveTag (directory, (ushort) entry_tag); } /// /// Adds an to the IFD, if it is not already /// contained in, it fails otherwise. /// /// /// A value with the directory index that /// should contain the tag that will be added. /// /// /// A to add to the IFD. /// public void AddEntry (int directory, IFDEntry entry) { while (directory >= directories.Count) directories.Add (new IFDDirectory ()); directories [directory].Add (entry.Tag, entry); } /// /// Adds an to the IFD. If it is already contained /// in the IFD, it is overwritten. /// /// /// A value with the directory index that /// contains the tag that will be set. /// /// /// A to add to the IFD. /// public void SetEntry (int directory, IFDEntry entry) { if (ContainsTag (directory, entry.Tag)) RemoveTag (directory, entry.Tag); AddEntry (directory, entry); } /// /// Returns the belonging to the given tag. /// /// /// A with the directory that contains /// the wanted tag. /// /// /// A with the tag to get. /// /// /// A belonging to the given tag, or /// null, if no such tag is contained in the IFD. /// public IFDEntry GetEntry (int directory, ushort tag) { if (!ContainsTag (directory, tag)) return null; return directories [directory] [tag]; } /// /// Returns the belonging to the given tag. /// /// /// A with the directory that contains /// the wanted tag. /// /// /// A with the tag to get. /// /// /// A belonging to the given tag, or /// null, if no such tag is contained in the IFD. /// public IFDEntry GetEntry (int directory, IFDEntryTag entry_tag) { return GetEntry (directory, (ushort) entry_tag); } /// /// Returns the stored in the /// entry defined by . /// /// /// A with the number of the directory /// to search for the entry. /// /// /// A with the tag of the entry /// /// /// A with the value stored in the entry /// or if no such entry is contained or it /// does not contain a value. /// public string GetStringValue (int directory, ushort entry_tag) { var entry = GetEntry (directory, entry_tag); if (entry != null && entry is StringIFDEntry) return (entry as StringIFDEntry).Value; return null; } /// /// Returns a containing the /// stored in the entry defined /// by . /// /// /// A with the number of the directory /// to search for the entry. /// /// /// A with the tag of the entry /// /// /// A containing the /// stored in the entry, or /// if no such entry is contained or it /// does not contain a value. /// public byte? GetByteValue (int directory, ushort entry_tag) { var entry = GetEntry (directory, entry_tag); if (entry != null && entry is ByteIFDEntry) return (entry as ByteIFDEntry).Value; return null; } /// /// Returns a containing the /// stored in the entry defined /// by . /// /// /// A with the number of the directory /// to search for the entry. /// /// /// A with the tag of the entry /// /// /// A containing the /// stored in the entry, or /// if no such entry is contained or it /// does not contain a value. /// public uint? GetLongValue (int directory, ushort entry_tag) { var entry = GetEntry (directory, entry_tag); if (entry is LongIFDEntry) return (entry as LongIFDEntry).Value; if (entry is ShortIFDEntry) return (entry as ShortIFDEntry).Value; return null; } /// /// Returns a containing the /// stored in the entry defined /// by . The entry can be of type /// or /// /// /// /// A with the number of the directory /// to search for the entry. /// /// /// A with the tag of the entry /// /// /// A containing the /// stored in the entry, or /// if no such entry is contained. /// public double? GetRationalValue (int directory, ushort entry_tag) { var entry = GetEntry (directory, entry_tag); if (entry is RationalIFDEntry) return (entry as RationalIFDEntry).Value; if (entry is SRationalIFDEntry) return (entry as SRationalIFDEntry).Value; return null; } /// /// Returns a containing the /// stored in the entry defined /// by . The entry must be of type /// and contain an datestring /// according to the Exif specification. /// /// /// A with the number of the directory /// to search for the entry. /// /// /// A with the tag of the entry /// /// /// A containing the /// stored in the entry, or /// if no such entry is contained or it /// does not contain a valid value. /// public DateTime? GetDateTimeValue (int directory, ushort entry_tag) { string date_string = GetStringValue (directory, entry_tag); try { DateTime date_time = DateTime.ParseExact (date_string, DATETIME_FORMAT, System.Globalization.CultureInfo.InvariantCulture); return date_time; } catch {} return null; } /// /// Adds a to the directory with tag /// given by and value given by /// /// /// A with the number of the directory /// to add the entry to. /// /// /// A with the tag of the entry /// /// /// A with the value to add. If it is /// an possibly already contained entry is removed for given tag. /// public void SetStringValue (int directory, ushort entry_tag, string value) { if (value == null) { RemoveTag (directory, entry_tag); return; } SetEntry (directory, new StringIFDEntry (entry_tag, value)); } /// /// Adds a to the directory with tag /// given by and value given by /// /// /// A with the number of the directory /// to add the entry to. /// /// /// A with the tag of the entry /// /// /// A with the value to add. /// public void SetByteValue (int directory, ushort entry_tag, byte value) { SetEntry (directory, new ByteIFDEntry (entry_tag, value)); } /// /// Adds a to the directory with tag /// given by and value given by /// /// /// A with the number of the directory /// to add the entry to. /// /// /// A with the tag of the entry /// /// /// A with the value to add. /// public void SetLongValue (int directory, ushort entry_tag, uint value) { SetEntry (directory, new LongIFDEntry (entry_tag, value)); } /// /// Adds a to the directory with tag /// given by and value given by /// /// /// A with the number of the directory /// to add the entry to. /// /// /// A with the tag of the entry /// /// /// A with the value to add. It must be possible to /// represent the value by a . /// public void SetRationalValue (int directory, ushort entry_tag, double value) { if (value < 0.0d || value > (double)UInt32.MaxValue) throw new ArgumentException ("value"); uint scale = (value >= 1.0d) ? 1 : UInt32.MaxValue; Rational rational = new Rational ((uint) (scale * value), scale); SetEntry (directory, new RationalIFDEntry (entry_tag, rational)); } /// /// Adds a to the directory with tag /// given by and value given by . /// The value is stored as a date string according to the Exif specification. /// /// /// A with the number of the directory /// to add the entry to. /// /// /// A with the tag of the entry /// /// /// A with the value to add. /// public void SetDateTimeValue (int directory, ushort entry_tag, DateTime value) { string date_string = value.ToString (DATETIME_FORMAT); SetStringValue (directory, entry_tag, date_string); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/UnsupportedFormatException.cs0000644000175000017500000001174711442021373024040 0ustar00alexalex00000000000000// // UnsupportedFormatException.cs: // // Author: // Aaron Bockover (abockover@novell.com) // // Original Source: // Entagged# // // Copyright (C) 2005-2006 Novell, Inc. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Runtime.Serialization; namespace TagLib { /// /// This class extends and is used to /// indicate that a file or tag is stored in an unsupported format /// and cannot be read or written by the current implementation. /// /// /// Catching an exception when creating a . /// /// using System; /// using TagLib; /// /// public class ExceptionTest /// { /// public static void Main () /// { /// try { /// File file = File.Create ("myfile.flv"); // Not supported, YET! /// } catch (UnsupportedFormatException e) { /// Console.WriteLine ("That file format is not supported: {0}", e.ToString ()); /// } /// } /// } /// /// /// #using <System.dll> /// #using <taglib-sharp.dll> /// /// using System; /// using TagLib; /// /// void main () /// { /// try { /// File file = File::Create ("myfile.flv"); // Not supported, YET! /// } catch (UnsupportedFormatException^ e) { /// Console::WriteLine ("That file format is not supported: {0}", e); /// } /// } /// /// /// Imports System /// Imports TagLib /// /// Public Class ExceptionTest /// Public Shared Sub Main () /// Try /// file As File = File.Create ("myfile.flv") ' Not supported, YET! /// Catch e As UnsupportedFormatException /// Console.WriteLine ("That file format is not supported: {0}", e.ToString ()); /// End Try /// End Sub /// End Class /// /// /// import System /// import TagLib /// /// try: /// file As File = File.Create ("myfile.flv") # Not supported, YET! /// catch e as UnsupportedFormatException: /// Console.WriteLine ("That file format is not supported: {0}", e.ToString ()); /// /// [Serializable] public class UnsupportedFormatException : Exception { /// /// Constructs and initializes a new instance of with a specified /// message. /// /// /// A containing a message explaining /// the reason for the exception. /// public UnsupportedFormatException (string message) : base(message) { } /// /// Constructs and initializes a new instance of with the default /// values. /// public UnsupportedFormatException () : base() { } /// /// Constructs and initializes a new instance of with a specified /// message containing a specified exception. /// /// /// A containing a message explaining /// the reason for the exception. /// /// /// A object to be contained in the /// new exception. For example, previously caught exception. /// public UnsupportedFormatException (string message, Exception innerException) : base (message, innerException) { } /// /// Constructs and initializes a new instance of from a specified /// serialization info and streaming context. /// /// /// A object containing the /// serialized data to be used for the new instance. /// /// /// A object containing the /// streaming context information for the new instance. /// /// /// This constructor is implemented because implements the interface. /// protected UnsupportedFormatException (SerializationInfo info, StreamingContext context) : base(info, context) { } } }taglib-sharp-2.1.0.0/src/TagLib/Png/0000755000175000017500000000000011774620112016647 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Png/File.cs0000644000175000017500000006133511521241310020052 0ustar00alexalex00000000000000// // File.cs: Provides tagging for PNG files // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.Xmp; namespace TagLib.Png { /// /// This class extends to provide tagging /// for PNG image files. /// /// /// This implementation is based on http://www.w3.org/TR/PNG /// [SupportedMimeType("taglib/png", "png")] [SupportedMimeType("image/png")] public class File : TagLib.Image.ImageBlockFile { #region GIF specific constants /// /// The PNG Header every png file starts with. /// private readonly byte [] HEADER = new byte [] {137, 80, 78, 71, 13, 10, 26, 10}; /// /// byte sequence to indicate a IHDR Chunk /// private readonly byte [] IHDR_CHUNK_TYPE = new byte [] {73, 72, 68, 82}; /// /// byte sequence to indicate a IEND Chunk /// private readonly byte [] IEND_CHUNK_TYPE = new byte [] {73, 69, 78, 68}; /// /// byte sequence to indicate a iTXt Chunk /// private readonly byte [] iTXt_CHUNK_TYPE = new byte [] {105, 84, 88, 116}; /// /// byte sequence to indicate a tEXt Chunk /// private readonly byte [] tEXt_CHUNK_TYPE = new byte [] {116, 69, 88, 116}; /// /// byte sequence to indicate a zTXt Chunk /// private readonly byte [] zTXt_CHUNK_TYPE = new byte [] {122, 84, 88, 116}; /// /// header of a iTXt which contains XMP data. /// private readonly byte [] XMP_CHUNK_HEADER = new byte [] { // Keyword ("XML:com.adobe.xmp") 0x58, 0x4D, 0x4C, 0x3A, 0x63, 0x6F, 0x6D, 0x2E, 0x61, 0x64, 0x6F, 0x62, 0x65, 0x2E, 0x78, 0x6D, 0x70, // Null Separator 0x00, // Compression Flag 0x00, // Compression Method 0x00, // Language Tag Null Separator 0x00, // Translated Keyword Null Separator 0x00 }; #endregion #region private fields /// /// The height of the image /// private int height; /// /// The width of the image /// private int width; /// /// The Properties of the image /// private Properties properties; #endregion #region public Properties /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { SaveMetadata (); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } #endregion #region private methods /// /// Reads the information from file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { ImageTag = new CombinedImageTag (TagTypes.XMP | TagTypes.Png); ValidateHeader (); ReadMetadata (); TagTypesOnDisk = TagTypes; if (propertiesStyle != ReadStyle.None) properties = ExtractProperties (); } finally { Mode = AccessMode.Closed; } } /// /// Validates the header of a PNG file. Therfore, the current position to /// read must be the start of the file. /// private void ValidateHeader () { ByteVector data = ReadBlock (8); if (data.Count != 8) throw new CorruptFileException ("Unexpected end of header"); if (! data.Equals (new ByteVector (HEADER))) throw new CorruptFileException ("PNG Header was expected"); } /// /// Reads the length of data of a chunk from the current position /// /// /// A with the length of data. /// /// /// The length is stored in a 4-byte unsigned integer in the file, /// but due to the PNG specification this value does not exceed /// 2^31-1 and can therfore be safely returned as an signed integer. /// This prevents unsafe casts for using the length as parameter /// for other methods. /// private int ReadChunkLength () { ByteVector data = ReadBlock (4); if (data.Count != 4) throw new CorruptFileException ("Unexpected end of Chunk Length"); uint length = data.ToUInt (true); if (length > Int32.MaxValue) throw new CorruptFileException ("PNG limits the Chunk Length to 2^31-1"); return (int) length; } /// /// Reads the type of a chunk from the current position. /// /// /// A with 4 bytes containing the type of /// the Chunk. /// private ByteVector ReadChunkType () { ByteVector data = ReadBlock (4); if (data.Count != 4) throw new CorruptFileException ("Unexpected end of Chunk Type"); return data; } /// /// Reads the CRC value for a chunk from the current position. /// /// /// A with 4 bytes with the CRC value. /// private ByteVector ReadCRC () { ByteVector data = ReadBlock (4); if (data.Count != 4) throw new CorruptFileException ("Unexpected end of CRC"); return data; } /// /// Reads the whole Chunk data starting from the current position. /// /// /// A with the length of the Chunk Data. /// /// /// A with the Chunk Data which is read. /// private ByteVector ReadChunkData (int data_length) { ByteVector data = ReadBlock (data_length); if (data.Count != data_length) throw new CorruptFileException (String.Format ("Chunk Data of Length {0} expected", data_length)); return data; } /// /// Reads a null terminated string from the given data from given position. /// /// /// A with teh data to read the string from /// /// /// A with the index to start reading /// /// /// A with the index of the null byte /// /// /// A with the read string. The null byte /// is not included. /// private string ReadTerminatedString (ByteVector data, int start_index, out int terminator_index) { if (start_index >= data.Count) throw new CorruptFileException ("Unexpected End of Data"); terminator_index = data.Find ("\0", start_index); if (terminator_index < 0) throw new CorruptFileException ("Cannot find string terminator"); return data.Mid (start_index, terminator_index - start_index).ToString (); } /// /// Reads a null terminated keyword from he given data from given position. /// /// /// A with teh data to read the string from /// /// /// A with the index to start reading /// /// /// A with the index of the null byte /// /// /// A with the read keyword. The null byte /// is not included. /// private string ReadKeyword (ByteVector data, int start_index, out int terminator_index) { string keyword = ReadTerminatedString (data, start_index, out terminator_index); if (String.IsNullOrEmpty (keyword)) throw new CorruptFileException ("Keyword cannot be empty"); return keyword; } /// /// Skips the Chunk Data and CRC Data. The read position must be at the /// beginning of the Chunk data. /// /// /// A with the length of the chunk data read /// before. /// private void SkipChunkData (int data_size) { long position = Tell; if (position + data_size >= Length) throw new CorruptFileException (String.Format ("Chunk Data of Length {0} expected", data_size)); Seek (Tell + data_size); ReadCRC (); } /// /// Reads the whole metadata from file. The current position must be set to /// the first Chunk which is contained in the file. /// private void ReadMetadata () { int data_length = ReadChunkLength (); ByteVector type = ReadChunkType (); // File should start with a header chunk if (! type.StartsWith (IHDR_CHUNK_TYPE)) throw new CorruptFileException ( String.Format ("IHDR Chunk was expected, but Chunk {0} was found", type.ToString ())); ReadIHDRChunk (data_length); // Read all following chunks while (true) { data_length = ReadChunkLength (); type = ReadChunkType (); if (type.StartsWith (IEND_CHUNK_TYPE)) return; else if (type.StartsWith (iTXt_CHUNK_TYPE)) ReadiTXtChunk (data_length); else if (type.StartsWith (tEXt_CHUNK_TYPE)) ReadtEXtChunk (data_length); else if (type.StartsWith (zTXt_CHUNK_TYPE)) ReadzTXtChunk (data_length); else SkipChunkData (data_length); } } /// /// Reads the IHDR Chunk from file and extracts some image information /// like width and height. The current position must be set to the start /// of the Chunk Data. /// /// /// A with the length of the Chunk Data. /// private void ReadIHDRChunk (int data_length) { // IHDR Chunk // // 4 Bytes Width // 4 Bytes Height // 1 Byte Bit depth // 1 Byte Colour type // 1 Byte Compression method // 1 Byte Filter method // 1 Byte Interlace method // // Followed by 4 Bytes CRC data if (data_length != 13) throw new CorruptFileException ("IHDR chunk data length must be 13"); ByteVector data = ReadChunkData (data_length); CheckCRC (IHDR_CHUNK_TYPE, data, ReadCRC ()); // The PNG specification limits the size of 4-byte unsigned integers to 2^31-1. // That allows us to safely cast them to an signed integer. uint width = data.Mid (0, 4).ToUInt (true); uint height = data.Mid (4, 4).ToUInt (true); if (width > Int32.MaxValue || height > Int32.MaxValue) throw new CorruptFileException ("PNG limits width and heigth to 2^31-1"); this.width = (int) width; this.height = (int) height; } /// /// Reads an iTXt Chunk from file. The current position must be set /// to the start of the Chunk Data. Such a Chunk may contain XMP data /// or translated keywords. /// /// /// A with the length of the Chunk Data. /// private void ReadiTXtChunk (int data_length) { long position = Tell; // iTXt Chunk // // N Bytes Keyword // 1 Byte Null Separator // 1 Byte Compression Flag (0 for uncompressed data) // 1 Byte Compression Method // N Bytes Language Tag // 1 Byte Null Separator // N Bytes Translated Keyword // 1 Byte Null Terminator // N Bytes Txt // // Followed by 4 Bytes CRC data ByteVector data = ReadChunkData (data_length); CheckCRC (iTXt_CHUNK_TYPE, data, ReadCRC ()); // handle XMP, which has a fixed header if (data.StartsWith (XMP_CHUNK_HEADER)) { ImageTag.AddTag (new XmpTag (data.Mid (XMP_CHUNK_HEADER.Length).ToString (StringType.UTF8), this)); AddMetadataBlock (position - 8, data_length + 8 + 4); return; } int terminator_index; string keyword = ReadKeyword (data, 0, out terminator_index); if (terminator_index + 2 >= data_length) throw new CorruptFileException ("Compression Flag and Compression Method byte expected"); byte compression_flag = data[terminator_index + 1]; byte compression_method = data[terminator_index + 2]; //string language = ReadTerminatedString (data, terminator_index + 3, out terminator_index); //string translated_keyword = ReadTerminatedString (data, terminator_index + 1, out terminator_index); ByteVector txt_data = data.Mid (terminator_index + 1); if (compression_flag != 0x00) { txt_data = Decompress (compression_method, txt_data); // ignore unknown compression methods if (txt_data == null) return; } string value = txt_data.ToString (); PngTag png_tag = GetTag (TagTypes.Png, true) as PngTag; if (png_tag.GetKeyword (keyword) == null) png_tag.SetKeyword (keyword, value); AddMetadataBlock (position - 8, data_length + 8 + 4); } /// /// Reads an tEXt Chunk from file. The current position must be set /// to the start of the Chunk Data. Such a Chunk contains plain /// keywords. /// /// /// A with the length of the Chunk Data. /// private void ReadtEXtChunk (int data_length) { long position = Tell; // tEXt Chunk // // N Bytes Keyword // 1 Byte Null Separator // N Bytes Txt // // Followed by 4 Bytes CRC data ByteVector data = ReadChunkData (data_length); CheckCRC (tEXt_CHUNK_TYPE, data, ReadCRC ()); int keyword_terminator; string keyword = ReadKeyword (data, 0, out keyword_terminator); string value = data.Mid (keyword_terminator + 1).ToString (); PngTag png_tag = GetTag (TagTypes.Png, true) as PngTag; if (png_tag.GetKeyword (keyword) == null) png_tag.SetKeyword (keyword, value); AddMetadataBlock (position - 8, data_length + 8 + 4); } /// /// Reads an zTXt Chunk from file. The current position must be set /// to the start of the Chunk Data. Such a Chunk contains compressed /// keywords. /// /// /// A with the length of the Chunk Data. /// /// /// The Chunk may also contain compressed Exif data which is written /// by other tools. But, since the PNG specification does not support /// Exif data, we ignore it here. /// private void ReadzTXtChunk (int data_length) { long position = Tell; // zTXt Chunk // // N Bytes Keyword // 1 Byte Null Separator // 1 Byte Compression Method // N Bytes Txt // // Followed by 4 Bytes CRC data ByteVector data = ReadChunkData (data_length); CheckCRC (zTXt_CHUNK_TYPE, data, ReadCRC ()); int terminator_index; string keyword = ReadKeyword (data, 0, out terminator_index); if (terminator_index + 1 >= data_length) throw new CorruptFileException ("Compression Method byte expected"); byte compression_method = data[terminator_index + 1]; ByteVector plain_data = Decompress (compression_method, data.Mid (terminator_index + 2)); // ignore unknown compression methods if (plain_data == null) return; string value = plain_data.ToString (); PngTag png_tag = GetTag (TagTypes.Png, true) as PngTag; if (png_tag.GetKeyword (keyword) == null) png_tag.SetKeyword (keyword, value); AddMetadataBlock (position - 8, data_length + 8 + 4); } /// /// Save the metadata to file. /// private void SaveMetadata () { ByteVector metadata_chunks = new ByteVector (); metadata_chunks.Add (RenderXMPChunk ()); metadata_chunks.Add (RenderKeywordChunks ()); // Metadata is stored after the PNG header and the IDHR chunk. SaveMetadata (metadata_chunks, HEADER.Length + 13 + 4 + 4 + 4); } /// /// Creates a Chunk containing the XMP data. /// /// /// A with the XMP data chunk /// or if no XMP data is contained. /// private ByteVector RenderXMPChunk () { // Check, if XmpTag is contained XmpTag xmp = ImageTag.Xmp; if (xmp == null) return null; ByteVector chunk = new ByteVector (); // render the XMP data itself ByteVector xmp_data = xmp.Render (); // TODO check uint size. chunk.Add (ByteVector.FromUInt ((uint) xmp_data.Count + (uint) XMP_CHUNK_HEADER.Length)); chunk.Add (iTXt_CHUNK_TYPE); chunk.Add (XMP_CHUNK_HEADER); chunk.Add (xmp_data); chunk.Add (ComputeCRC (iTXt_CHUNK_TYPE, XMP_CHUNK_HEADER, xmp_data)); return chunk; } /// /// Creates a list of Chunks containing the PNG keywords /// /// /// A with the list of chunks, or /// or if no PNG Keywords are contained. /// private ByteVector RenderKeywordChunks () { // Check, if PngTag is contained PngTag png_tag = GetTag (TagTypes.Png, true) as PngTag; if (png_tag == null) return null; ByteVector chunks = new ByteVector (); foreach (KeyValuePair keyword in png_tag) { ByteVector data = new ByteVector (); data.Add (keyword.Key); data.Add ("\0"); data.Add (keyword.Value); chunks.Add (ByteVector.FromUInt ((uint) data.Count)); chunks.Add (tEXt_CHUNK_TYPE); chunks.Add (data); chunks.Add (ComputeCRC (tEXt_CHUNK_TYPE, data)); } return chunks; } /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// private Properties ExtractProperties () { if (width > 0 && height > 0) return new Properties (TimeSpan.Zero, new Codec (width, height)); return null; } #endregion #region Utility Stuff /// /// Checks the CRC for a Chunk. /// /// /// A whith the Chunk type /// /// /// A with the Chunk data. /// /// /// A with the read CRC data. /// private static void CheckCRC (ByteVector chunk_type, ByteVector chunk_data, ByteVector crc_data) { ByteVector computed_crc = ComputeCRC (chunk_type, chunk_data); if (computed_crc != crc_data) throw new CorruptFileException ( String.Format ("CRC check failed for {0} Chunk (expected: 0x{1:X4}, read: 0x{2:X4}", chunk_type.ToString (), computed_crc.ToUInt (), crc_data.ToUInt ())); } /// /// Computes a 32bit CRC for the given data. /// /// /// A with data to compute /// the CRC for. /// /// /// A with 4 bytes (32bit) containing the CRC. /// private static ByteVector ComputeCRC (params ByteVector [] datas) { uint crc = 0xFFFFFFFF; if (crc_table == null) BuildCRCTable (); foreach (var data in datas) { foreach (byte b in data) { crc = crc_table[(crc ^ b) & 0xFF] ^ (crc >> 8); } } // Invert return ByteVector.FromUInt (crc ^ 0xFFFFFFFF); } /// /// Table for faster computation of CRC. /// private static uint[] crc_table; /// /// Initializes the CRC Table. /// private static void BuildCRCTable () { uint polynom = 0xEDB88320; crc_table = new uint [256]; for (int i = 0; i < 256; i++) { uint c = (uint) i; for (int k = 0; k < 8; k++) { if ((c & 0x00000001) != 0x00) c = polynom ^ (c >> 1); else c = c >> 1; } crc_table[i] = c; } } private static ByteVector Inflate (ByteVector data) { #if HAVE_SHARPZIPLIB using (System.IO.MemoryStream out_stream = new System.IO.MemoryStream ()) { ICSharpCode.SharpZipLib.Zip.Compression.Inflater inflater = new ICSharpCode.SharpZipLib.Zip.Compression.Inflater (); inflater.SetInput (data.Data); byte [] buffer = new byte [1024]; int written_bytes; while ((written_bytes = inflater.Inflate (buffer)) > 0) out_stream.Write (buffer, 0, written_bytes); return new ByteVector (out_stream.ToArray ()); } #else return null; #endif } private static ByteVector Decompress (byte compression_method, ByteVector compressed_data) { // there is currently just one compression method specified // for PNG. switch (compression_method) { case 0: return Inflate (compressed_data); default: return null; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Png/Codec.cs0000644000175000017500000000327711521241310020211 0ustar00alexalex00000000000000// // Codec.cs: // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Png { /// /// A Png photo codec. Contains basic photo details. /// public class Codec : Image.Codec { /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public override string Description { get { return "PNG File"; } } /// /// Constructs a new with the given width /// and height. /// /// /// The width of the photo. /// /// /// The height of the photo. /// /// /// A new instance. /// public Codec (int width, int height) : base (width, height) {} } } taglib-sharp-2.1.0.0/src/TagLib/Png/PngTag.cs0000644000175000017500000001644011521241310020350 0ustar00alexalex00000000000000// // PngTag.cs: // // Author: // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections; using System.Collections.Generic; using TagLib.Image; namespace TagLib.Png { /// /// Native Png Keywords /// public class PngTag : ImageTag, IEnumerable { #region defined PNG keywords /// /// Short (one line) title or caption for image /// public static readonly string TITLE = "Title"; /// /// Name of image's creator /// public static readonly string AUTHOR = "Author"; /// /// Description of image (possibly long) /// public static readonly string DESCRIPTION = "Description"; /// /// Copyright notice /// public static readonly string COPYRIGHT = "Copyright"; /// /// Time of original image creation /// public static readonly string CREATION_TIME = "Creation Time"; /// /// Software used to create the image /// public static readonly string SOFTWARE = "Software"; /// /// Legal disclaimer /// public static readonly string DISCLAIMER = "Disclaimer"; /// /// Warning of nature of content /// public static readonly string WARNING = "Warning"; /// /// Device used to create the image /// public static readonly string SOURCE = "Source"; /// /// Miscellaneous comment /// public static readonly string COMMENT = "Comment"; #endregion #region Private Fieds /// /// Store the keywords with their values /// private Dictionary keyword_store = new Dictionary (); #endregion #region Constructors /// /// Constructor. /// public PngTag () { } #endregion #region Public Properties /// /// Gets or sets the comment for the image described /// by the current instance. /// /// /// A containing the comment of the /// current instace. /// /// /// We use here both keywords Description and Comment of the /// PNG specification to store the comment. /// public override string Comment { get { string description = GetKeyword (DESCRIPTION); if (! String.IsNullOrEmpty (description)) return description; return GetKeyword (COMMENT); } set { SetKeyword (DESCRIPTION, value); SetKeyword (COMMENT, value); } } /// /// Gets and sets the title for the media described by the /// current instance. /// /// /// A object containing the title for /// the media described by the current instance or if no value is present. /// public override string Title { get { return GetKeyword (TITLE); } set { SetKeyword (TITLE, value); } } /// /// Gets or sets the creator of the image. /// /// /// A with the name of the creator. /// public override string Creator { get { return GetKeyword (AUTHOR); } set { SetKeyword (AUTHOR, value); } } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// public override string Copyright { get { return GetKeyword (COPYRIGHT); } set { SetKeyword (COPYRIGHT, value); } } /// /// Gets or sets the software the image, the current instance /// belongs to, was created with. /// /// /// A containing the name of the /// software the current instace was created with. /// public override string Software { get { return GetKeyword (SOFTWARE); } set { SetKeyword (SOFTWARE, value); } } /// /// Gets or sets the time when the image, the current instance /// belongs to, was taken. /// /// /// A with the time the image was taken. /// public override DateTime? DateTime { get { DateTime ret; string date = GetKeyword (CREATION_TIME); if (System.DateTime.TryParse (date, out ret)) return ret; return null; } set { string date = null; if (value != null) { // Creation Date is stored in RFC 822 for PNG date = value.Value.ToString ("R"); } SetKeyword (CREATION_TIME, date); } } #endregion #region Public Methods /// /// Sets a keyword of to the given value. /// /// /// A with the keyword to set. /// /// /// A with the value. /// public void SetKeyword (string keyword, string value) { if (String.IsNullOrEmpty (keyword)) throw new ArgumentException ("keyword is null or empty"); keyword_store.Remove (keyword); if (value != null) { keyword_store.Add (keyword, value); } } /// /// Gets a value of a keyword. /// /// /// A with the keyword to get the value for. /// /// /// A with the value or /// if the keyword is not contained. /// public string GetKeyword (string keyword) { string ret = null; keyword_store.TryGetValue (keyword, out ret); return ret; } /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get { return TagTypes.Png; } } /// /// Clears the values stored in the current instance. /// public override void Clear () { keyword_store.Clear (); } /// /// Returns an enumerator to enumerate all keywords. /// /// /// A to enumerate /// the keywords. /// public IEnumerator GetEnumerator () { return keyword_store.GetEnumerator (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/0000755000175000017500000000000011774620112017013 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Dng/0000755000175000017500000000000011774620112017523 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Dng/File.cs0000644000175000017500000001430411521241310020720 0ustar00alexalex00000000000000// // File.cs: Provides tagging for DNG files // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Tags; using TagLib.IFD.Entries; namespace TagLib.Tiff.Dng { /// /// This class extends to provide tagging /// for DNG image files. /// [SupportedMimeType("taglib/dng", "dng")] [SupportedMimeType("image/dng")] [SupportedMimeType("image/x-adobe-dng")] public class File : TagLib.Tiff.File { #region public Properties /// /// Indicates if tags can be written back to the current file or not /// /// /// A which is true if tags can be written to the /// current file, otherwise false. /// public override bool Writeable { get { return false; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction, propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { throw new NotSupportedException (); } #endregion /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// protected override Properties ExtractProperties () { int width = 0, height = 0; IFDTag tag = GetTag (TagTypes.TiffIFD) as IFDTag; IFDStructure structure = tag.Structure; // DNG uses SubIFDs for images, the one with SubfileType = 0 is the RAW data. var sub_ifds = structure.GetEntry (0, (ushort) IFDEntryTag.SubIFDs) as SubIFDArrayEntry; if (sub_ifds == null) { return base.ExtractProperties (); } foreach (var entry in sub_ifds.Entries) { var type = entry.GetLongValue (0, (ushort) IFDEntryTag.NewSubfileType); if (type == 0) { width = (int) (entry.GetLongValue (0, (ushort) IFDEntryTag.ImageWidth) ?? 0); height = (int) (entry.GetLongValue (0, (ushort) IFDEntryTag.ImageLength) ?? 0); break; // No need to iterate the other SubIFDs } } if (width > 0 && height > 0) { return new Properties (TimeSpan.Zero, CreateCodec (width, height)); } // Fall back to normal detection. return base.ExtractProperties (); } /// /// Create a codec that describes the photo properties. /// /// /// A object. /// protected override Codec CreateCodec (int width, int height) { return new Codec (width, height, "Adobe Digital Negative File"); } } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Rw2/0000755000175000017500000000000011774620112017465 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Rw2/IFDReader.cs0000644000175000017500000001060711521241310021532 0ustar00alexalex00000000000000// // IFDReader.cs: Panasonic Rw2-specific IFD reader // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.IO; using TagLib.IFD; namespace TagLib.Tiff.Rw2 { /// /// Panasonic Rw2-specific IFD reader /// public class IFDReader : TagLib.IFD.IFDReader { #region Constructors /// /// Constructor. Reads an IFD from given file, using the given endianness. /// /// /// A to read from. /// /// /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. /// /// /// A that will be populated. /// /// /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So must contain the beginning of the segment. /// /// /// A value with the beginning of the IFD relative to /// . /// /// /// A value with maximal possible offset. This is to limit /// the size of the possible data; /// public IFDReader (BaseTiffFile file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset) : base (file, is_bigendian, structure, base_offset, ifd_offset, max_offset) { } #endregion /// /// Try to parse the given IFD entry, used to discover format-specific entries. /// /// /// A with the tag of the entry. /// /// /// A with the type of the entry. /// /// /// A with the data count of the entry. /// /// /// A with the base offset which every offsets in the /// IFD are relative to. /// /// /// A with the offset of the entry. /// /// /// A with the given parameters, or null if none was parsed, after /// which the normal TIFF parsing is used. /// protected override IFDEntry ParseIFDEntry (ushort tag, ushort type, uint count, long base_offset, uint offset) { if (tag == 0x002e && !seen_jpgfromraw) { // FIXME: JpgFromRaw file.Seek (base_offset + offset, SeekOrigin.Begin); var data = file.ReadBlock ((int) count); var mem_stream = new MemoryStream (data.Data); var res = new StreamJPGAbstraction (mem_stream); (file as Rw2.File).JpgFromRaw = new Jpeg.File (res, ReadStyle.Average); seen_jpgfromraw = true; return null; } return base.ParseIFDEntry (tag, type, count, base_offset, offset); } private bool seen_jpgfromraw = false; } class StreamJPGAbstraction : File.IFileAbstraction { readonly Stream stream; public StreamJPGAbstraction (Stream stream) { this.stream = stream; } public string Name { get { return "JpgFromRaw.jpg"; } } public void CloseStream (System.IO.Stream stream) { stream.Close (); } public System.IO.Stream ReadStream { get { return stream; } } public System.IO.Stream WriteStream { get { return stream; } } } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Rw2/File.cs0000644000175000017500000002460011521241310020662 0ustar00alexalex00000000000000// // File.cs: Provides tagging for Panasonic Rw2 files // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Tags; namespace TagLib.Tiff.Rw2 { /// /// This class extends to provide tagging /// for RW2 image files. /// [SupportedMimeType("taglib/rw2", "rw2")] [SupportedMimeType("image/rw2")] [SupportedMimeType("taglib/raw", "raw")] [SupportedMimeType("image/raw")] [SupportedMimeType("image/x-raw")] [SupportedMimeType("image/x-panasonic-raw")] public class File : TagLib.Tiff.BaseTiffFile { #region private fields /// /// The Properties of the image /// private Properties properties; #endregion #region public Properties /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } /// /// Indicates if tags can be written back to the current file or not /// /// /// A which is true if tags can be written to the /// current file, otherwise false. /// public override bool Writeable { get { return false; } } /// /// The JPEG file that's embedded in the RAW file. /// public Jpeg.File JpgFromRaw { get; internal set; } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Magic = 85; // Panasonic uses 0x55 Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { throw new NotSupportedException (); } /// /// Gets a tag of a specified type from the current instance, /// optionally creating a new tag if possible. /// /// /// A value indicating the /// type of tag to read. /// /// /// A value specifying whether or not to /// try and create the tag if one is not found. /// /// /// A object containing the tag that was /// found in or added to the current instance. If no /// matching tag was found and none was created, is returned. /// public override TagLib.Tag GetTag (TagLib.TagTypes type, bool create) { TagLib.Tag tag = base.GetTag (type, false); if (tag != null) { return tag; } if (!create || (type & ImageTag.AllowedTypes) == 0) return null; if (type != TagTypes.TiffIFD) return base.GetTag (type, create); ImageTag new_tag = new IFDTag (this); ImageTag.AddTag (new_tag); return new_tag; } #endregion #region private methods /// /// Reads the information from file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { ImageTag = new CombinedImageTag (TagTypes.TiffIFD); ReadFile (); TagTypesOnDisk = TagTypes; if (propertiesStyle != ReadStyle.None) properties = ExtractProperties (); } finally { Mode = AccessMode.Closed; } } /// /// Parses the RW2 file /// private void ReadFile () { // A RW2 file starts with a Tiff header followed by a RW2 header uint first_ifd_offset = ReadHeader (); uint raw_ifd_offset = ReadAdditionalRW2Header (); ReadIFD (first_ifd_offset, 3); ReadIFD (raw_ifd_offset, 1); } /// /// Reads and validates the RW2 header started at the current position. /// /// /// A with the offset to the IFD with the RAW data. /// private uint ReadAdditionalRW2Header () { // RW2 Header // // Seems to be 16 bytes, no idea on the meaning of these. ByteVector header = ReadBlock (16); if (header.Count != 16) throw new CorruptFileException ("Unexpected end of RW2 header"); return (uint) Tell; } /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// private Properties ExtractProperties () { int width = 0, height = 0; IFDTag tag = GetTag (TagTypes.TiffIFD) as IFDTag; IFDStructure structure = tag.Structure; width = (int) (structure.GetLongValue (0, 0x07) ?? 0); height = (int) (structure.GetLongValue (0, 0x06) ?? 0); var vendor = ImageTag.Make; if (vendor == "LEICA") vendor = "Leica"; var desc = String.Format ("{0} RAW File", vendor); if (width > 0 && height > 0) { return new Properties (TimeSpan.Zero, new Codec (width, height, desc)); } return null; } /// /// Creates an IFD reader to parse the file. /// /// /// A to read from. /// /// /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. /// /// /// A that will be populated. /// /// /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So must contain the beginning of the segment. /// /// /// A value with the beginning of the IFD relative to /// . /// /// /// A value with maximal possible offset. This is to limit /// the size of the possible data; /// protected override TagLib.IFD.IFDReader CreateIFDReader (BaseTiffFile file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset) { return new IFDReader (file, is_bigendian, structure, base_offset, ifd_offset, max_offset); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Rw2/IFDTag.cs0000644000175000017500000000517711521241310021051 0ustar00alexalex00000000000000// // IFDTag.cs: Handles Panasonics weird metadata structure. // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using TagLib.IFD.Tags; namespace TagLib.Tiff.Rw2 { /// /// Handles the weird structure of Panasonic metadata. /// public class IFDTag : TagLib.IFD.IFDTag { private File file; internal IFDTag (File file) : base () { this.file = file; } /// /// Gets the ISO speed the image, the current instance belongs /// to, was taken with. /// /// /// A with the ISO speed as defined in ISO 12232. /// /// /// Panasonic stores these in a somewhat unstandard location. /// public override uint? ISOSpeedRatings { // TODO: The value in JPGFromRAW should probably be used as well. get { return Structure.GetLongValue (0, (ushort) PanasonicMakerNoteEntryTag.ISO); } set { Structure.SetLongValue (0, (ushort) PanasonicMakerNoteEntryTag.ISO, value.HasValue ? (uint) value : 0); } } /// /// Gets the focal length the image, the current instance belongs /// to, was taken with, assuming a 35mm film camera. /// /// /// A with the focal length in 35mm equivalent in millimeters. /// /// /// Panasonic stores these in a somewhat unstandard location. /// public override uint? FocalLengthIn35mmFilm { get { var jpg = file.JpgFromRaw; if (jpg == null) return base.FocalLengthIn35mmFilm; var tag = jpg.GetTag (TagTypes.TiffIFD, true) as Image.ImageTag; if (tag == null) return base.FocalLengthIn35mmFilm; return tag.FocalLengthIn35mmFilm ?? base.FocalLengthIn35mmFilm; } set { (file.JpgFromRaw.GetTag (TagTypes.TiffIFD, true) as Image.ImageTag).FocalLengthIn35mmFilm = value; } } } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Arw/0000755000175000017500000000000011774620112017544 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Arw/File.cs0000644000175000017500000001157511521241310020750 0ustar00alexalex00000000000000// // File.cs: Provides tagging for Sony ARW files // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Tags; namespace TagLib.Tiff.Arw { /// /// This class extends to provide tagging /// for ARW image files. /// [SupportedMimeType("taglib/arw", "arw")] [SupportedMimeType("image/arw")] [SupportedMimeType("image/x-sony-arw")] public class File : TagLib.Tiff.File { #region public Properties /// /// Indicates if tags can be written back to the current file or not /// /// /// A which is true if tags can be written to the /// current file, otherwise false. /// public override bool Writeable { get { return false; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction, propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { throw new NotSupportedException (); } #endregion /// /// Create a codec that describes the photo properties. /// /// /// A object. /// protected override Codec CreateCodec (int width, int height) { return new Codec (width, height, "Sony Raw File"); } } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Cr2/0000755000175000017500000000000011774620112017441 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Cr2/File.cs0000644000175000017500000001772111521241310020644 0ustar00alexalex00000000000000// // File.cs: Provides tagging for Canon CR2 files // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Tags; namespace TagLib.Tiff.Cr2 { /// /// This class extends to provide tagging /// for CR2 image files. /// [SupportedMimeType("taglib/cr2", "cr2")] [SupportedMimeType("image/cr2")] [SupportedMimeType("image/x-canon-cr2")] public class File : TagLib.Tiff.BaseTiffFile { #region private fields /// /// The Properties of the image /// private Properties properties; #endregion #region public Properties /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } /// /// Indicates if tags can be written back to the current file or not /// /// /// A which is true if tags can be written to the /// current file, otherwise false. /// public override bool Writeable { get { return false; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { throw new NotSupportedException (); } #endregion #region private methods /// /// Reads the information from file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { ImageTag = new CombinedImageTag (TagTypes.TiffIFD); ReadFile (); TagTypesOnDisk = TagTypes; if (propertiesStyle != ReadStyle.None) properties = ExtractProperties (); } finally { Mode = AccessMode.Closed; } } /// /// Parses the CR2 file /// private void ReadFile () { // A CR2 file starts with a Tiff header followed by a CR2 header uint first_ifd_offset = ReadHeader (); uint raw_ifd_offset = ReadAdditionalCR2Header (); ReadIFD (first_ifd_offset, 3); ReadIFD (raw_ifd_offset, 1); } /// /// Reads and validates the CR2 header started at the current position. /// /// /// A with the offset to the IFD with the RAW data. /// private uint ReadAdditionalCR2Header () { // CR2 Header // // CR2 Information: // // 2 bytes CR2 Magic word (CR) // 1 byte CR2 major version (2) // 1 byte CR2 minor version (0) // 4 bytes Offset to RAW IFD // ByteVector header = ReadBlock (8); if (header.Count != 8) throw new CorruptFileException ("Unexpected end of CR2 header"); if (header.Mid (0, 2).ToString () != "CR") throw new CorruptFileException("CR2 Magic (CR) expected"); byte major_version = header [2]; byte minor_version = header [3]; if (major_version != 2 || minor_version != 0) throw new UnsupportedFormatException ("Only major version 2 and minor version 0 are supported"); uint raw_ifd_offset = header.Mid (4, 4).ToUInt (IsBigEndian); return raw_ifd_offset; } /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// private Properties ExtractProperties () { int width = 0, height = 0; IFDTag tag = GetTag (TagTypes.TiffIFD) as IFDTag; width = (int) (tag.ExifIFD.GetLongValue (0, (ushort) ExifEntryTag.PixelXDimension) ?? 0); height = (int) (tag.ExifIFD.GetLongValue (0, (ushort) ExifEntryTag.PixelYDimension) ?? 0); if (width > 0 && height > 0) { return new Properties (TimeSpan.Zero, new Codec (width, height, "Canon RAW File")); } return null; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/BaseTiffFile.cs0000644000175000017500000001616111521241310021617 0ustar00alexalex00000000000000// // BaseTiffFile.cs: // // Author: // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using TagLib.Image; using TagLib.IFD; namespace TagLib.Tiff { /// /// This class extends to provide some basic behavior /// for Tiff based file formats. /// public abstract class BaseTiffFile : TagLib.Image.File { #region Public Properties /// /// Indicates if the current file is in big endian or little endian format. /// /// /// The method must be called from a subclass to /// properly initialize this property. /// public bool IsBigEndian { get; private set; } #endregion #region Protected Properties /// /// The identifier used to recognize the file. This is 42 for most TIFF files. /// protected ushort Magic { get; set; } #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// protected BaseTiffFile (string path) : base (path) { Magic = 42; } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected BaseTiffFile (IFileAbstraction abstraction) : base (abstraction) { Magic = 42; } #endregion #region Protected Methods /// /// Reads and validates the TIFF header at the current position. /// /// /// A with the offset value to the first /// IFD contained in the file. /// /// /// This method should only be called, when the current read position is /// the beginning of the file. /// protected uint ReadHeader () { // TIFF header: // // 2 bytes Indicating the endianess (II or MM) // 2 bytes Tiff Magic word (usually 42) // 4 bytes Offset to first IFD ByteVector header = ReadBlock (8); if (header.Count != 8) throw new CorruptFileException ("Unexpected end of header"); string order = header.Mid (0, 2).ToString (); if (order == "II") { IsBigEndian = false; } else if (order == "MM") { IsBigEndian = true; } else { throw new CorruptFileException ("Unknown Byte Order"); } if (header.Mid (2, 2).ToUShort (IsBigEndian) != Magic) throw new CorruptFileException (String.Format ("TIFF Magic ({0}) expected", Magic)); uint first_ifd_offset = header.Mid (4, 4).ToUInt (IsBigEndian); return first_ifd_offset; } /// /// Reads IFDs starting from the given offset. /// /// /// A with the IFD offset to start /// reading from. /// protected void ReadIFD (uint offset) { ReadIFD (offset, -1); } /// /// Reads a certain number of IFDs starting from the given offset. /// /// /// A with the IFD offset to start /// reading from. /// /// /// A with the number of IFDs to read. /// protected void ReadIFD (uint offset, int ifd_count) { long length = 0; try { length = Length; } catch (Exception) { // Use a safety-value of 4 gigabyte. length = 1073741824L * 4; } var ifd_tag = GetTag (TagTypes.TiffIFD, true) as IFDTag; var reader = CreateIFDReader (this, IsBigEndian, ifd_tag.Structure, 0, offset, (uint) length); reader.Read (ifd_count); } /// /// Creates an IFD reader to parse the file. /// /// /// A to read from. /// /// /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. /// /// /// A that will be populated. /// /// /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So must contain the beginning of the segment. /// /// /// A value with the beginning of the IFD relative to /// . /// /// /// A value with maximal possible offset. This is to limit /// the size of the possible data; /// protected virtual IFDReader CreateIFDReader (BaseTiffFile file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset) { return new IFDReader (file, is_bigendian, structure, base_offset, ifd_offset, max_offset); } /// /// Renders a TIFF header with the given offset to the first IFD. /// The returned data has length 8. /// /// /// A with the offset to the first IFD /// to be included in the header. /// /// /// A with the rendered header of length 8. /// protected ByteVector RenderHeader (uint first_ifd_offset) { ByteVector data = new ByteVector (); if (IsBigEndian) data.Add ("MM"); else data.Add ("II"); data.Add (ByteVector.FromUShort (Magic, IsBigEndian)); data.Add (ByteVector.FromUInt (first_ifd_offset, IsBigEndian)); return data; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Nef/0000755000175000017500000000000011774620112017523 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Nef/File.cs0000644000175000017500000001157711521241310020731 0ustar00alexalex00000000000000// // File.cs: Provides tagging for Nikon NEF files // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Tags; namespace TagLib.Tiff.Nef { /// /// This class extends to provide tagging /// for NEF image files. /// [SupportedMimeType("taglib/nef", "nef")] [SupportedMimeType("image/nef")] [SupportedMimeType("image/x-nikon-nef")] public class File : TagLib.Tiff.File { #region public Properties /// /// Indicates if tags can be written back to the current file or not /// /// /// A which is true if tags can be written to the /// current file, otherwise false. /// public override bool Writeable { get { return false; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction, propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { throw new NotSupportedException (); } #endregion /// /// Create a codec that describes the photo properties. /// /// /// A object. /// protected override Codec CreateCodec (int width, int height) { return new Codec (width, height, "Nikon Raw File"); } } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/File.cs0000644000175000017500000002002411521241310020204 0ustar00alexalex00000000000000// // File.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2009 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using System.IO; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Entries; using TagLib.IFD.Tags; using TagLib.Xmp; namespace TagLib.Tiff { /// /// This class extends to provide tagging /// and properties support for Tiff files. /// [SupportedMimeType("taglib/tiff", "tiff")] [SupportedMimeType("taglib/tif", "tif")] [SupportedMimeType("image/tiff")] public class File : BaseTiffFile { #region Private Fields /// /// Contains the media properties. /// private Properties properties; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : base (path) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { ImageTag = new CombinedImageTag (TagTypes.TiffIFD | TagTypes.XMP); Mode = AccessMode.Read; try { Read (propertiesStyle); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : base (abstraction) { } #endregion #region Public Properties /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { WriteFile (); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } #endregion #region Private Methods /// /// Render the whole file and write it back. /// private void WriteFile () { // Check, if IFD0 is contained IFDTag exif = ImageTag.Exif; if (exif == null) throw new Exception ("Tiff file without tags"); UpdateTags (exif); // first IFD starts at 8 uint first_ifd_offset = 8; ByteVector data = RenderHeader (first_ifd_offset); var renderer = new IFDRenderer (IsBigEndian, exif.Structure, first_ifd_offset); data.Add (renderer.Render ()); Insert (data, 0, Length); } /// /// Update the XMP stored in the Tiff IFD /// /// /// A The Tiff IFD to update the entries /// private void UpdateTags (IFDTag exif) { // update the XMP entry exif.Structure.RemoveTag (0, (ushort) IFDEntryTag.XMP); XmpTag xmp = ImageTag.Xmp; if (xmp != null) exif.Structure.AddEntry (0, new ByteVectorIFDEntry ((ushort) IFDEntryTag.XMP, xmp.Render ())); } /// /// Reads the file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// protected void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { uint first_ifd_offset = ReadHeader (); ReadIFD (first_ifd_offset); // Find XMP data var xmp_entry = ImageTag.Exif.Structure.GetEntry (0, (ushort) IFDEntryTag.XMP) as ByteVectorIFDEntry; if (xmp_entry != null) { ImageTag.AddTag (new XmpTag (xmp_entry.Data.ToString (), this)); } if (propertiesStyle == ReadStyle.None) return; properties = ExtractProperties (); } finally { Mode = AccessMode.Closed; } } /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// protected virtual Properties ExtractProperties () { int width = 0, height = 0; IFDTag tag = GetTag (TagTypes.TiffIFD) as IFDTag; IFDStructure structure = tag.Structure; width = (int) (structure.GetLongValue (0, (ushort) IFDEntryTag.ImageWidth) ?? 0); height = (int) (structure.GetLongValue (0, (ushort) IFDEntryTag.ImageLength) ?? 0); if (width > 0 && height > 0) { return new Properties (TimeSpan.Zero, CreateCodec (width, height)); } return null; } /// /// Create a codec that describes the photo properties. /// /// /// A object. /// protected virtual Codec CreateCodec (int width, int height) { return new Codec (width, height); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Codec.cs0000644000175000017500000000445711521241310020356 0ustar00alexalex00000000000000// // Codec.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2009 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Tiff { /// /// A TIFF photo codec. Contains basic photo details. /// public class Codec : Image.Codec { private string description = "TIFF File"; /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public override string Description { get { return description; } } /// /// Constructs a new with the given width /// and height. /// /// /// The width of the photo. /// /// /// The height of the photo. /// /// /// A new instance. /// public Codec (int width, int height) : base (width, height) {} /// /// Constructs a new with the given width /// and height. /// /// /// The width of the photo. /// /// /// The height of the photo. /// /// /// The description of the photo type. /// /// /// A new instance. /// public Codec (int width, int height, string description) : base (width, height) { this.description = description; } } } taglib-sharp-2.1.0.0/src/TagLib/Tiff/Pef/0000755000175000017500000000000011774620112017525 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Tiff/Pef/File.cs0000644000175000017500000001161211521241310020721 0ustar00alexalex00000000000000// // File.cs: Provides tagging for Pentax CR2 files // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using TagLib; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Tags; namespace TagLib.Tiff.Pef { /// /// This class extends to provide tagging /// for PEF image files. /// [SupportedMimeType("taglib/pef", "pef")] [SupportedMimeType("image/pef")] [SupportedMimeType("image/x-pentax-pef")] public class File : TagLib.Tiff.File { #region public Properties /// /// Indicates if tags can be written back to the current file or not /// /// /// A which is true if tags can be written to the /// current file, otherwise false. /// public override bool Writeable { get { return false; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction, propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { throw new NotSupportedException (); } #endregion /// /// Create a codec that describes the photo properties. /// /// /// A object. /// protected override Codec CreateCodec (int width, int height) { return new Codec (width, height, "Pentax Raw File"); } } } taglib-sharp-2.1.0.0/src/TagLib/NonContainer/0000755000175000017500000000000011774620112020520 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/NonContainer/Tag.cs0000644000175000017500000001741411442021373021565 0ustar00alexalex00000000000000// // Tag.cs: Combines StartTag and EndTag in such a way as their children appear // as its children. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; namespace TagLib.NonContainer { /// /// This class extends , combining and in such a way as /// their children appear as its children. /// public class Tag : CombinedTag { #region Private Fields /// /// Contains the tags appearing at the start of the file. /// private StartTag start_tag; /// /// Contains the tags appearing at the end of the file. /// private EndTag end_tag; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified . /// /// /// A object on which the new /// instance will perform its operations. /// /// /// Constructing a new instance does not automatically read /// the contents from the disk. must be /// called to read the tags. /// public Tag (File file) : base () { start_tag = new StartTag (file); end_tag = new EndTag (file); AddTag (start_tag); AddTag (end_tag); } #endregion #region Public Properties /// /// Gets the collection of tags appearing at the start of the /// file. /// /// /// A storing the /// tags for the start of the file. /// public StartTag StartTag { get {return start_tag;} } /// /// Gets the collection of tags appearing at the end of the /// file. /// /// /// A storing the /// tags for the end of the file. /// public EndTag EndTag { get {return end_tag;} } /// /// Gets the tag types contained in the current instance. /// /// /// A bitwise combined /// containing the tag types contained in the current /// instance. /// public override TagTypes TagTypes { get {return start_tag.TagTypes | end_tag.TagTypes;} } /// /// Gets the tags combined in the current instance. /// /// /// A containing the tags combined in /// the current instance. /// /// /// This contains the combined children of and . /// public override TagLib.Tag [] Tags { get { List tags = new List (); tags.AddRange (start_tag.Tags); tags.AddRange (end_tag.Tags); return tags.ToArray (); } } #endregion #region Public Methods /// /// Gets a tag of a specified type from the current instance. /// /// /// A value indicating the /// type of tag to read. /// /// /// A object containing the tag that was /// found in the current instance. If no /// matching tag was found and none was created, is returned. /// public TagLib.Tag GetTag (TagTypes type) { foreach (TagLib.Tag t in Tags) { if (type == TagTypes.Id3v1 && t is TagLib.Id3v1.Tag) return t; if (type == TagTypes.Id3v2 && t is TagLib.Id3v2.Tag) return t; if (type == TagTypes.Ape && t is TagLib.Ape.Tag) return t; } return null; } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public void RemoveTags (TagTypes types) { start_tag.RemoveTags (types); end_tag.RemoveTags (types); } /// /// Reads the tags at the start and end of the file. /// /// /// A value reference which will be set /// to contain the seek position in the file at which the /// tags at the start end. This also marks the seek position /// at which the media begins. /// /// /// A value reference which will be set /// to contain the seek position in the file at which the /// tags at the end begin. This also marks the seek position /// at which the media ends. /// public void Read (out long start, out long end) { start = ReadStart (); end = ReadEnd (); } /// /// Reads the tags stored at the start of the file into the /// current instance. /// /// /// A value indicating the seek position /// in the file at which the read tags end. This also /// marks the seek position at which the media begins. /// public long ReadStart () { return start_tag.Read (); } /// /// Reads the tags stored at the end of the file into the /// current instance. /// /// /// A value indicating the seek position /// in the file at which the read tags begin. This also /// marks the seek position at which the media ends. /// public long ReadEnd () { return end_tag.Read (); } /// /// Writes the tags to the start and end of the file. /// /// /// A value reference which will be set /// to contain the new seek position in the file at which the /// tags at the start end. This also marks the seek position /// at which the media begins. /// /// /// A value reference which will be set /// to contain the new seek position in the file at which the /// tags at the end begin. This also marks the seek position /// at which the media ends. /// public void Write (out long start, out long end) { start = start_tag.Write (); end = end_tag.Write (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/NonContainer/File.cs0000644000175000017500000003142111442021373021723 0ustar00alexalex00000000000000// // File.cs: Provides tagging and properties for files that contain an // indeterminite number of tags at their beginning or end. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace TagLib.NonContainer { /// /// This abstract class extends to provide /// tagging and properties for files that contain an indeterminite /// number of tags at their beginning or end. /// /// /// When extending this class, , , and should be /// overrided methods that read the format specific information from /// the file. /// The file is read upon construction in the following /// manner: /// /// The file is opened for reading. /// The tags at the start of the file are /// read. /// is called. /// The tags at the end of the file are /// read. /// is called. /// If reading with a style other than , is /// called. /// The file is closed. /// /// public abstract class File : TagLib.File { #region Private Fields /// /// Contains the tags. /// private TagLib.NonContainer.Tag tag; /// /// Contains the media properties. /// private Properties properties; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// protected File (string path, ReadStyle propertiesStyle) : base (path) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system with an average read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// protected File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// protected File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction with an /// average read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (File.IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Properties /// /// Gets a abstract representation of all tags stored in the /// current instance. /// /// /// A object representing all tags /// stored in the current instance. /// public override TagLib.Tag Tag { get {return tag;} } /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get {return properties;} } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { long start, end; Mode = AccessMode.Write; try { tag.Write (out start, out end); InvariantStartPosition = start; InvariantEndPosition = end; TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public override void RemoveTags (TagTypes types) { tag.RemoveTags (types); } #endregion #region Protected Properties /// /// Gets the collection of tags appearing at the start of the /// file. /// /// /// A storing the /// tags for the start of the file. /// protected StartTag StartTag { get {return tag.StartTag;} } /// /// Gets the collection of tags appearing at the end of the /// file. /// /// /// A storing the /// tags for the end of the file. /// protected EndTag EndTag { get {return tag.EndTag;} } #endregion #region Protected Methods /// /// Reads format specific information at the start of the /// file. /// /// /// A value containing the seek position /// at which the tags end and the media data begins. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// This method is called by the constructor immediately /// after the tags at the start of the file have been read /// and as such (so the internal seek mechanism is close to /// the start). It should be used for reading any content /// specific information, such as an audio header from the /// start of the file. /// protected virtual void ReadStart (long start, ReadStyle propertiesStyle) { } /// /// Reads format specific information at the end of the /// file. /// /// /// A value containing the seek position /// at which the media data ends and the tags begin. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// This method is called by the constructor immediately /// after the tags at the end of the file have been read /// and as such (so the internal seek mechanism is close to /// the end). It should be used for reading any content /// specific information, such as an audio header from the /// end of the file. /// protected virtual void ReadEnd (long end, ReadStyle propertiesStyle) { } /// /// Reads the audio properties from the file represented by /// the current instance. /// /// /// A value containing the seek position /// at which the tags end and the media data begins. /// /// /// A value containing the seek position /// at which the media data ends and the tags begin. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// A object describing the /// media properties of the file represented by the current /// instance. /// /// /// This method is called ONLY IF the file is constructed /// with a read style other than , and as such MUST NOT return . /// It is guaranteed that and will have been called first and this /// method should be strictly used to perform final /// processing on already read data. /// protected abstract Properties ReadProperties (long start, long end, ReadStyle propertiesStyle); #endregion #region Private Methods /// /// Reads the file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { tag = new Tag (this); // Read the tags and property data at the beginning of // the file. InvariantStartPosition = tag.ReadStart (); TagTypesOnDisk |= StartTag.TagTypes; ReadStart (InvariantStartPosition, propertiesStyle); // Read the tags and property data at the end of the // file. InvariantEndPosition = (InvariantStartPosition == Length) ? Length : tag.ReadEnd (); TagTypesOnDisk |= EndTag.TagTypes; ReadEnd (InvariantEndPosition, propertiesStyle); // Read the audio properties. properties = (propertiesStyle != ReadStyle.None) ? ReadProperties (InvariantStartPosition, InvariantEndPosition, propertiesStyle) : null; } finally { Mode = AccessMode.Closed; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/NonContainer/StartTag.cs0000644000175000017500000002224411773660430022612 0ustar00alexalex00000000000000// // StartTag.cs: Provides support for accessing and modifying a collection of // tags appearing at the start of a file. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace TagLib.NonContainer { /// /// This class extends , providing support /// for accessing and modifying a collection of tags appearing at the /// start of a file. /// /// /// This class is used by to read all the tags appearing at the start of the file but /// could be used by other classes. It currently supports ID3v2 /// and APE tags. /// public class StartTag : CombinedTag { #region Private Fields /// /// Contains the file to operate on. /// private TagLib.File file; /// /// Contains the number of bytes that must be read to /// hold all applicable indicators. /// int read_size = (int) Math.Max (TagLib.Ape.Footer.Size, TagLib.Id3v2.Header.Size); #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified . /// /// /// A object on which the new /// instance will perform its operations. /// /// /// Constructing a new instance does not automatically read /// the contents from the disk. must be /// called to read the tags. /// public StartTag (TagLib.File file) : base () { this.file = file; } #endregion #region Public Properties /// /// Gets the total size of the tags located at the end of the /// file by reading from the file. /// public long TotalSize { get { long size = 0; while (ReadTagInfo (ref size) != TagTypes.None) ; return size; } } #endregion #region Public Methods /// /// Reads the tags stored at the start of the file into the /// current instance. /// /// /// A value indicating the seek position /// in the file at which the read tags end. This also /// marks the seek position at which the media begins. /// public long Read () { TagLib.Tag tag; ClearTags (); long end = 0; while ((tag = ReadTag (ref end)) != null) AddTag (tag); return end; } /// /// Renders the tags contained in the current instance. /// /// /// A object containing the /// physical representation of the tags stored in the current /// instance. /// /// /// The tags are rendered in the order that they are stored /// in the current instance. /// public ByteVector Render () { ByteVector data = new ByteVector (); foreach (TagLib.Tag t in Tags) { if (t is TagLib.Ape.Tag) data.Add ((t as TagLib.Ape.Tag).Render ()); else if (t is TagLib.Id3v2.Tag) data.Add ((t as TagLib.Id3v2.Tag).Render ()); } return data; } /// /// Writes the tags contained in the current instance to the /// beginning of the file that created it, overwriting the /// existing tags. /// /// /// A value indicating the seek position /// in the file at which the written tags end. This also /// marks the seek position at which the media begins. /// public long Write () { ByteVector data = Render (); file.Insert (data, 0, TotalSize); return data.Count; } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public void RemoveTags (TagTypes types) { for (int i = Tags.Length - 1; i >= 0; i--) { var tag = Tags[i]; if (types == TagTypes.AllTags || (tag.TagTypes & types) == tag.TagTypes) { RemoveTag (tag); } } } /// /// Adds a tag of a specified type to the current instance, /// optionally copying values from an existing type. /// /// /// A value specifying the type of /// tag to add to the current instance. At the time of this /// writing, this is limited to /// and . /// /// /// A to copy values from using /// , or if no tag is to be copied. /// /// /// The object added to the current /// instance, or if it couldn't be /// created. /// /// /// ID3v2 tags are added at the end of the current instance, /// while other tags are added to the beginning. /// public TagLib.Tag AddTag (TagTypes type, TagLib.Tag copy) { TagLib.Tag tag = null; if (type == TagTypes.Id3v2) { tag = new TagLib.Id3v2.Tag (); } else if (type == TagTypes.Ape) { tag = new TagLib.Ape.Tag (); (tag as Ape.Tag).HeaderPresent = true; } if (tag != null) { if (copy != null) copy.CopyTo (tag, true); AddTag (tag); } return tag; } #endregion #region Private Methods /// /// Reads a tag starting at a specified position and moves the /// cursor to its start position. /// /// /// A value reference specifying at what /// position the potential tag starts. If a tag is found, /// this value will be updated to the position at which the /// found tag ends. /// /// /// A object representing the tag /// found at the specified position, or if no tag was found. /// private TagLib.Tag ReadTag (ref long start) { long end = start; TagTypes type = ReadTagInfo (ref end); TagLib.Tag tag = null; switch (type) { case TagTypes.Ape: tag = new TagLib.Ape.Tag (file, start); break; case TagTypes.Id3v2: tag = new TagLib.Id3v2.Tag (file, start); break; } start = end; return tag; } /// /// Looks for a tag starting at a specified position and moves /// the cursor to its start position. /// /// /// A value reference specifying at what /// position the potential tag starts. If a tag is found, /// this value will be updated to the position at which the /// found tag ends. /// /// /// A value specifying the /// type of tag found at the specified position, or if no tag was found. /// private TagTypes ReadTagInfo (ref long position) { file.Seek (position); ByteVector data = file.ReadBlock (read_size); try { if (data.StartsWith (TagLib.Ape.Footer.FileIdentifier)) { TagLib.Ape.Footer footer = new TagLib.Ape.Footer (data); position += footer.CompleteTagSize; return TagTypes.Ape; } if (data.StartsWith (TagLib.Id3v2.Header.FileIdentifier)) { TagLib.Id3v2.Header header = new TagLib.Id3v2.Header (data); position += header.CompleteTagSize; return TagTypes.Id3v2; } } catch (CorruptFileException) { } return TagTypes.None; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/NonContainer/EndTag.cs0000644000175000017500000002472011442021373022212 0ustar00alexalex00000000000000// // EndTag.cs: Provides support for accessing and modifying a collection of tags // appearing at the end of a file. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace TagLib.NonContainer { /// /// This class extends , providing support /// for accessing and modifying a collection of tags appearing at the /// end of a file. /// /// /// This class is used by to read all the tags appearing at the end of the file but /// could be used by other classes. It currently supports ID3v1, /// ID3v2, and APE tags. /// public class EndTag : CombinedTag { #region Private Fields /// /// Contains the file to operate on. /// private TagLib.File file; /// /// Contains the number of bytes that must be read to /// hold all applicable indicators. /// private static int read_size = (int) Math.Max (Math.Max ( TagLib.Ape.Footer.Size, TagLib.Id3v2.Footer.Size), TagLib.Id3v1.Tag.Size); #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified . /// /// /// A object on which the new /// instance will perform its operations. /// /// /// Constructing a new instance does not automatically read /// the contents from the disk. must be /// called to read the tags. /// public EndTag (TagLib.File file) : base () { this.file = file; } #endregion #region Public Properties /// /// Gets the total size of the tags located at the end of the /// file by reading from the file. /// public long TotalSize { get { long start = file.Length; while (ReadTagInfo (ref start) != TagTypes.None) ; return file.Length - start; } } #endregion #region Public Methods /// /// Reads the tags stored at the end of the file into the /// current instance. /// /// /// A value indicating the seek position /// in the file at which the read tags begin. This also /// marks the seek position at which the media ends. /// public long Read () { TagLib.Tag tag; ClearTags (); long start = file.Length; while ((tag = ReadTag (ref start)) != null) InsertTag (0, tag); return start; } /// /// Renders the tags contained in the current instance. /// /// /// A object containing the /// physical representation of the tags stored in the current /// instance. /// /// /// The tags are rendered in the order that they are stored /// in the current instance. /// public ByteVector Render () { ByteVector data = new ByteVector (); foreach (TagLib.Tag t in Tags) { if (t is TagLib.Ape.Tag) data.Add ((t as TagLib.Ape.Tag).Render ()); else if (t is TagLib.Id3v2.Tag) data.Add ((t as TagLib.Id3v2.Tag).Render ()); else if (t is TagLib.Id3v1.Tag) data.Add ((t as TagLib.Id3v1.Tag).Render ()); } return data; } /// /// Writes the tags contained in the current instance to the /// end of the file that created it, overwriting the existing /// tags. /// /// /// A value indicating the seek position /// in the file at which the written tags begin. This also /// marks the seek position at which the media ends. /// public long Write () { long total_size = TotalSize; ByteVector data = Render (); file.Insert (data, file.Length - total_size, total_size); return file.Length - data.Count; } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public void RemoveTags (TagTypes types) { for (int i = Tags.Length - 1; i >= 0; i--) { var tag = Tags[i]; if (types == TagTypes.AllTags || (tag.TagTypes & types) == tag.TagTypes) { RemoveTag (tag); } } } /// /// Adds a tag of a specified type to the current instance, /// optionally copying values from an existing type. /// /// /// A value specifying the type of /// tag to add to the current instance. At the time of this /// writing, this is limited to , /// , and . /// /// /// A to copy values from using /// , or if no tag is to be copied. /// /// /// The object added to the current /// instance, or if it couldn't be /// created. /// /// /// ID3v2 tags are added at the end of the current instance, /// while other tags are added to the beginning. /// public TagLib.Tag AddTag (TagTypes type, TagLib.Tag copy) { TagLib.Tag tag = null; if (type == TagTypes.Id3v1) { tag = new TagLib.Id3v1.Tag (); } else if (type == TagTypes.Id3v2) { Id3v2.Tag tag32 = new Id3v2.Tag (); tag32.Version = 4; tag32.Flags |= Id3v2.HeaderFlags.FooterPresent; tag = tag32; } else if (type == TagTypes.Ape) { tag = new TagLib.Ape.Tag (); } if (tag != null) { if (copy != null) copy.CopyTo (tag, true); if (type == TagTypes.Id3v1) AddTag (tag); else InsertTag (0, tag); } return tag; } #endregion #region Private Methods /// /// Reads a tag ending at a specified position and moves the /// cursor to its start position. /// /// /// A value reference specifying at what /// position the potential tag ends at. If a tag is found, /// this value will be updated to the position at which the /// found tag starts. /// /// /// A object representing the tag /// found at the specified position, or if no tag was found. /// private TagLib.Tag ReadTag (ref long end) { long start = end; TagTypes type = ReadTagInfo (ref start); TagLib.Tag tag = null; try { switch (type) { case TagTypes.Ape: tag = new TagLib.Ape.Tag (file, end - TagLib.Ape.Footer.Size); break; case TagTypes.Id3v2: tag = new TagLib.Id3v2.Tag (file, start); break; case TagTypes.Id3v1: tag = new TagLib.Id3v1.Tag (file, start); break; } end = start; } catch (CorruptFileException) { } return tag; } /// /// Looks for a tag ending at a specified position and moves /// the cursor to its start position. /// /// /// A value reference specifying at what /// position the potential tag ends. If a tag is found, /// this value will be updated to the position at which the /// found tag starts. /// /// /// A value specifying the /// type of tag found at the specified position, or if no tag was found. /// private TagTypes ReadTagInfo (ref long position) { if (position - read_size < 0) return TagTypes.None; file.Seek (position - read_size); ByteVector data = file.ReadBlock (read_size); try { int offset = (int) (data.Count - TagLib.Ape.Footer.Size); if (data.ContainsAt (TagLib.Ape.Footer.FileIdentifier, offset)) { TagLib.Ape.Footer footer = new TagLib.Ape.Footer ( data.Mid (offset)); // If the complete tag size is zero or // the tag is a header, this indicates // some sort of corruption. if (footer.CompleteTagSize == 0 || (footer.Flags & TagLib.Ape.FooterFlags.IsHeader) != 0) return TagTypes.None; position -= footer.CompleteTagSize; return TagTypes.Ape; } offset = (int) (data.Count - TagLib.Id3v2.Footer.Size); if (data.ContainsAt (TagLib.Id3v2.Footer.FileIdentifier, offset)) { TagLib.Id3v2.Footer footer = new TagLib.Id3v2.Footer ( data.Mid (offset)); position -= footer.CompleteTagSize; return TagTypes.Id3v2; } if (data.StartsWith ( TagLib.Id3v1.Tag.FileIdentifier)) { position -= TagLib.Id3v1.Tag.Size; return TagTypes.Id3v1; } } catch (CorruptFileException) { } return TagTypes.None; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/IIM/0000755000175000017500000000000011774620111016540 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/IIM/IIMReader.cs0000644000175000017500000000477711773631265020662 0ustar00alexalex00000000000000// // IIMReader.cs // // Author: // Eberhard Beilharz // // Copyright (c) 2012 Eberhard Beilharz // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; namespace TagLib.IIM { /// /// Processes all IPTC-IIM segments /// public class IIMReader { /// /// The magic bytes that start a new IPTC-IIM segment /// private static readonly byte[] IPTC_IIM_SEGMENT = new byte[] { 0x1C, 0x02}; private IIMTag Tag { get; set; } private ByteVector Data { get; set; } public IIMReader (ByteVector data) { Data = data; Tag = new IIMTag (); } public IIMTag Process () { // now process the IIM segments which all start with 0x1C 0x02 followed by the type // of the IIM segment int findOffset = 0; int count = 0; for (int i = Data.Find (IPTC_IIM_SEGMENT, findOffset); i >= findOffset; i = Data.Find (IPTC_IIM_SEGMENT, findOffset)) { count++; // skip over segment marker i += IPTC_IIM_SEGMENT.Length; int len = Data.Mid (i + 1).ToUShort (); // ENHANCE: enhance encoding used for string conversion. Unfortunately this is // not detectable from IIM data. switch (Data [i]) { case 5: // Object Name Tag.Title = Data.ToString (StringType.Latin1, i + 3, len); break; case 25: // Keywords Tag.AddKeyword (Data.ToString (StringType.Latin1, i + 3, len)); break; case 80: // By-line Tag.Creator = Data.ToString (StringType.Latin1, i + 3, len); break; case 116: // Copyright notice Tag.Copyright = Data.ToString (StringType.Latin1, i + 3, len); break; case 120: // Caption/Abstract Tag.Comment = Data.ToString (StringType.Latin1, i + 3, len); break; } findOffset = i + 3 + len; } if (count == 0) return null; return Tag; } } } taglib-sharp-2.1.0.0/src/TagLib/IIM/IIMTag.cs0000644000175000017500000000341611773631230020150 0ustar00alexalex00000000000000// // IIMTag.cs // // Author: // Eberhard Beilharz // // Copyright (c) 2012 Eberhard Beilharz // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Collections.Generic; using TagLib.Image; using TagLib.IFD.Entries; namespace TagLib.IIM { public class IIMTag: Xmp.XmpTag { private List m_Keywords; public IIMTag () { } public override TagLib.TagTypes TagTypes { get { return TagLib.TagTypes.IPTCIIM; } } public override void Clear () { Title = null; m_Keywords = null; Creator = null; Copyright = null; Comment = null; } public override string Title { get; set; } public override string Creator { get; set; } public override string Copyright { get; set; } public override string Comment { get; set; } public override string[] Keywords { get { if (m_Keywords == null) return null; return m_Keywords.ToArray (); } } internal void AddKeyword (string keyword) { if (m_Keywords == null) m_Keywords = new List (); m_Keywords.Add (keyword); } } } taglib-sharp-2.1.0.0/src/TagLib/Asf/0000755000175000017500000000000011774620111016633 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Asf/Object.cs0000644000175000017500000001500211442021373020363 0ustar00alexalex00000000000000// // Object.cs: Provides a basic representation of an ASF object which can be read // from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This abstract class provides a basic representation of an ASF /// object which can be read from and written to disk. /// public abstract class Object { #region Private Fields /// /// Contains the GUID of the object. /// private System.Guid id; /// /// Contains the size of the object on disk. /// private ulong size; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents from a /// specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// protected Object (Asf.File file, long position) { if (file == null) throw new ArgumentNullException ("file"); if (position < 0 || position > file.Length - 24) throw new ArgumentOutOfRangeException ( "position"); file.Seek (position); id = file.ReadGuid (); size = file.ReadQWord (); } /// /// Constructs and initializes a new instance of with a specified GUID. /// /// /// A value containing the GUID to /// use for the new instance. /// protected Object (System.Guid guid) { id = guid; } #endregion #region Public Properties /// /// Gets the GUID for the current instance. /// /// /// A object containing the GUID /// of the current instance. /// public System.Guid Guid { get {return id;} } /// /// Gets the original size of the current instance. /// /// /// A value containing the size of the /// current instance as it originally appeared on disk. /// public ulong OriginalSize { get {return size;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// /// public abstract ByteVector Render (); #endregion #region Public Static Methods /// /// Renders a Unicode (wide) string. /// /// /// A object containing the text to /// render. /// /// /// A object containing the /// rendered value. /// public static ByteVector RenderUnicode (string value) { ByteVector v = ByteVector.FromString (value, StringType.UTF16LE); v.Add (RenderWord (0)); return v; } /// /// Renders a 4-byte DWORD. /// /// /// A value containing the DWORD to /// render. /// /// /// A object containing the /// rendered value. /// public static ByteVector RenderDWord (uint value) { return ByteVector.FromUInt (value, false); } /// /// Renders a 8-byte QWORD. /// /// /// A value containing the QWORD to /// render. /// /// /// A object containing the /// rendered value. /// public static ByteVector RenderQWord (ulong value) { return ByteVector.FromULong (value, false); } /// /// Renders a 2-byte WORD. /// /// /// A value containing the WORD to /// render. /// /// /// A object containing the /// rendered value. /// public static ByteVector RenderWord (ushort value) { return ByteVector.FromUShort (value, false); } #endregion #region Protected Methods /// /// Renders the current instance as a raw ASF object /// containing specified data. /// /// /// A object containing the data to /// contained in the rendered version of the current /// instance. /// /// /// A object containing the /// rendered version of the current instance. /// /// /// Child classes implementing should /// render their contents and then send the data through this /// method to produce the final output. /// protected ByteVector Render (ByteVector data) { ulong length = (ulong) ((data != null ? data.Count : 0) + 24); ByteVector v = id.ToByteArray (); v.Add (RenderQWord (length)); v.Add (data); return v; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/DescriptionRecord.cs0000644000175000017500000004244211442021373022607 0ustar00alexalex00000000000000// // DescriptionRecord.cs: Provides a representation of an ASF Description Record // to be used in combination with MetadataLibaryObject. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This class provides a representation of an ASF Description Record /// to be used in combination with . /// public class DescriptionRecord { #region Private Fields /// /// Contains the data type. /// private DataType type = DataType.Unicode; /// /// Contains the language list index. /// private ushort lang_list_index = 0; /// /// Contains the stream number. /// private ushort stream_number = 0; /// /// Contains the record name. /// private string name = null; /// /// Contains the string value. /// private string strValue = null; /// /// Contains the byte value. /// private ByteVector byteValue = null; /// /// Contains the long value. /// private ulong longValue = 0; /// /// Contains the GUID value. /// private System.Guid guidValue = System.Guid.Empty; #endregion #region Constructors /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A object containing the value for /// the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, string value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.strValue = value; } /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A object containing the value /// for the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, ByteVector value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.type = DataType.Bytes; this.byteValue = new ByteVector (value); } /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, uint value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.type = DataType.DWord; this.longValue = value; } /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, ulong value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.type = DataType.QWord; this.longValue = value; } /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, ushort value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.type = DataType.Word; this.longValue = value; } /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, bool value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.type = DataType.Bool; this.longValue = value ? 1uL : 0; } /// /// Constructs and initializes a new instance of with a specified language, /// stream, name, and value. /// /// /// A value containing the language /// list index of the new instance. /// /// /// A value containing the stream /// number of the new instance. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public DescriptionRecord (ushort languageListIndex, ushort streamNumber, string name, System.Guid value) { this.lang_list_index = languageListIndex; this.stream_number = streamNumber; this.name = name; this.type = DataType.Guid; this.guidValue = value; } /// /// Constructs and initializes a new instance of by reading its contents from /// a file. /// /// /// A object to read the raw ASF /// Description Record from. /// /// /// is . /// /// /// A valid record could not be read. /// /// /// must be at a seek position at /// which the record can be read. /// protected internal DescriptionRecord (Asf.File file) { if (file == null) throw new ArgumentNullException ("file"); if (!Parse (file)) throw new CorruptFileException ( "Failed to parse description record."); } #endregion #region Public Properties /// /// Gets the index of the language associated with the /// current instance. /// /// /// A value containing the index of the /// language associated with the current instance. /// public ushort LanguageListIndex { get {return lang_list_index;} } /// /// Gets the index of the stream associated with the current /// instance. /// /// /// A value containing the index of the /// stream associated with the current instance. /// public ushort StreamNumber { get {return stream_number;} } /// /// Gets the name of the current instance. /// /// /// A object containing the name of the /// current instance. /// public string Name { get {return name;} } /// /// Gets the type of data contained in the current instance. /// /// /// A value indicating type of data /// contained in the current instance. /// public DataType Type { get {return type;} } #endregion #region Public Methods /// /// Gets a string representation of the current instance. /// /// /// A object containing the value of /// the current instance. /// public override string ToString () { if (type == DataType.Unicode) return strValue; if (type == DataType.Bytes) return byteValue.ToString (StringType.UTF16LE); return longValue.ToString (); } /// /// Gets the binary contents of the current instance. /// /// /// A object containing the /// contents of the current instance, or if is unequal to . /// public ByteVector ToByteVector () { return byteValue; } /// /// Gets the boolean value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public bool ToBool () { return longValue != 0; } /// /// Gets the DWORD value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public uint ToDWord () { uint value; if (type == DataType.Unicode && strValue != null && uint.TryParse (strValue, out value)) return value; return (uint) longValue; } /// /// Gets the QWORD value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public ulong ToQWord () { ulong value; if (type == DataType.Unicode && strValue != null && ulong.TryParse (strValue, out value)) return value; return longValue; } /// /// Gets the WORD value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public ushort ToWord () { ushort value; if (type == DataType.Unicode && strValue != null && ushort.TryParse (strValue, out value)) return value; return (ushort) longValue; } /// /// Gets the GUID value contained in the current instance. /// /// /// A value containing the value /// of the current instance. /// public System.Guid ToGuid () { return guidValue; } /// /// Renders the current instance as a raw ASF Description /// Record. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render () { ByteVector value = null; switch (type) { case DataType.Unicode: value = Object.RenderUnicode (strValue); break; case DataType.Bytes: value = byteValue; break; case DataType.Bool: case DataType.DWord: value = Object.RenderDWord ((uint) longValue); break; case DataType.QWord: value = Object.RenderQWord (longValue); break; case DataType.Word: value = Object.RenderWord ((ushort) longValue); break; case DataType.Guid: value = guidValue.ToByteArray (); break; default: return null; } ByteVector name = Object.RenderUnicode (this.name); ByteVector output = new ByteVector (); output.Add (Object.RenderWord (lang_list_index)); output.Add (Object.RenderWord (stream_number)); output.Add (Object.RenderWord ((ushort) name.Count)); output.Add (Object.RenderWord ((ushort) type)); output.Add (Object.RenderDWord ((uint) value.Count)); output.Add (name); output.Add (value); return output; } #endregion #region Protected Methods /// /// Populates the current instance by reading in the contents /// from a file. /// /// /// A object to read the raw ASF /// Description Record from. /// /// /// if the data was read correctly. /// Otherwise . /// protected bool Parse (Asf.File file) { // Field name Field type Size (bits) // Language List Index WORD 16 // Stream Number WORD 16 // Name Length WORD 16 // Data Type WORD 16 // Data Length DWORD 32 // Name WCHAR varies // Data See below varies lang_list_index = file.ReadWord (); stream_number = file.ReadWord (); ushort name_length = file.ReadWord (); type = (DataType) file.ReadWord (); int data_length = (int) file.ReadDWord (); name = file.ReadUnicode (name_length); switch (type) { case DataType.Word: longValue = file.ReadWord (); break; case DataType.Bool: case DataType.DWord: longValue = file.ReadDWord (); break; case DataType.QWord: longValue = file.ReadQWord (); break; case DataType.Unicode: strValue = file.ReadUnicode (data_length); break; case DataType.Bytes: byteValue = file.ReadBlock (data_length); break; case DataType.Guid: guidValue = file.ReadGuid (); break; default: return false; } return true; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/StreamPropertiesObject.cs0000644000175000017500000001710711442021373023624 0ustar00alexalex00000000000000// // StreamPropertiesObject.cs: Provides a representation of an ASF Stream // Properties object which can be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Text; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Stream Properties object which can be /// read from and written to disk. /// public class StreamPropertiesObject : Object { #region Private Fields /// /// Contains the stream type GUID. /// private System.Guid stream_type; /// /// Contains the error correction type GUID. /// private System.Guid error_correction_type; /// /// Contains the time offset of the stream. /// private ulong time_offset; /// /// Contains the stream flags. /// private ushort flags; /// /// Contains the reserved data. /// private uint reserved; /// /// Contains the type specific data. /// private ByteVector type_specific_data; /// /// Contains the error correction data. /// private ByteVector error_correction_data; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents from a /// specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public StreamPropertiesObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals (Asf.Guid.AsfStreamPropertiesObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 78) throw new CorruptFileException ( "Object size too small."); stream_type = file.ReadGuid (); error_correction_type = file.ReadGuid (); time_offset = file.ReadQWord (); int type_specific_data_length = (int) file.ReadDWord (); int error_correction_data_length = (int) file.ReadDWord (); flags = file.ReadWord (); reserved = file.ReadDWord (); type_specific_data = file.ReadBlock (type_specific_data_length); error_correction_data = file.ReadBlock (error_correction_data_length); } #endregion #region Public Properties /// /// Gets the codec information contained in the current /// instance. /// /// /// A object containing the codec /// information read from or /// if the data could not be decoded. /// public ICodec Codec { get { if (stream_type == Asf.Guid.AsfAudioMedia) return new Riff.WaveFormatEx ( type_specific_data, 0); if (stream_type == Asf.Guid.AsfVideoMedia) return new TagLib.Riff.BitmapInfoHeader ( type_specific_data, 11); return null; } } /// /// Gets the stream type GUID of the current instance. /// /// /// A object containing the stream /// type GUID of the current instance. /// public System.Guid StreamType { get {return stream_type;} } /// /// Gets the error correction type GUID of the current /// instance. /// /// /// A object containing the error /// correction type GUID of the current instance. /// public System.Guid ErrorCorrectionType { get {return error_correction_type;} } /// /// Gets the time offset at which the stream described by the /// current instance begins. /// /// /// A value containing the time /// offset at which the stream described by the current /// instance begins. /// public TimeSpan TimeOffset { get {return new TimeSpan ((long)time_offset);} } /// /// Gets the flags that apply to the current instance. /// /// /// A value containing the flags that /// apply to the current instance. /// public ushort Flags { get {return flags;} } /// /// Gets the type specific data contained in the current /// instance. /// /// /// A object containing the type /// specific data contained in the current instance. /// /// /// The contents of this value are dependant on the type /// contained in . /// public ByteVector TypeSpecificData { get {return type_specific_data;} } /// /// Gets the error correction data contained in the current /// instance. /// /// /// A object containing the error /// correction data contained in the current instance. /// /// /// The contents of this value are dependant on the type /// contained in . /// public ByteVector ErrorCorrectionData { get {return error_correction_data;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector output = stream_type.ToByteArray (); output.Add (error_correction_type.ToByteArray ()); output.Add (RenderQWord (time_offset)); output.Add (RenderDWord ((uint) type_specific_data.Count)); output.Add (RenderDWord ((uint) error_correction_data.Count)); output.Add (RenderWord (flags)); output.Add (RenderDWord (reserved)); output.Add (type_specific_data); output.Add (error_correction_data); return Render (output); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/Guid.cs0000644000175000017500000000731511442021373020055 0ustar00alexalex00000000000000// // Guid.cs: Provides common GUID values used by ASF Objects. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This static class contains common /// values used by ASF Objects. /// public static class Guid { /// /// Indicates that an object is a . /// public static readonly System.Guid AsfContentDescriptionObject = new System.Guid ("75B22633-668E-11CF-A6D9-00AA0062CE6C"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfExtendedContentDescriptionObject = new System.Guid ("D2D0A440-E307-11D2-97F0-00A0C95EA850"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfFilePropertiesObject = new System.Guid ("8CABDCA1-A947-11CF-8EE4-00C00C205365"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfHeaderExtensionObject = new System.Guid ("5FBF03B5-A92E-11CF-8EE3-00C00C205365"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfHeaderObject = new System.Guid ("75B22630-668E-11CF-A6D9-00AA0062CE6C"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfMetadataLibraryObject = new System.Guid ("44231C94-9498-49D1-A141-1D134E457054"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfPaddingObject = new System.Guid ("1806D474-CADF-4509-A4BA-9AABCB96AAE8"); /// /// Indicates that an object is a . /// public static readonly System.Guid AsfStreamPropertiesObject = new System.Guid ("B7DC0791-A9B7-11CF-8EE6-00C00C205365"); /// /// Indicates that a /// contains information about an audio stream. /// public static readonly System.Guid AsfAudioMedia = new System.Guid ("F8699E40-5B4D-11CF-A8FD-00805F5C442B"); /// /// Indicates that a /// contains information about an video stream. /// public static readonly System.Guid AsfVideoMedia = new System.Guid ("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B"); /// /// Indicates a placeholder portion of a file is correctly /// encoded. /// public static readonly System.Guid AsfReserved1 = new System.Guid ("ABD3D211-A9BA-11cf-8EE6-00C00C205365"); } } taglib-sharp-2.1.0.0/src/TagLib/Asf/ContentDescriptionObject.cs0000644000175000017500000001734111442021373024132 0ustar00alexalex00000000000000// // ContentDescriptionObject.cs: Provides a representation of an ASF Content // Description object which can be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Content Description object which can be /// read from and written to disk. /// public class ContentDescriptionObject : Object { #region Private Fields /// /// Contains the media title. /// private string title = string.Empty; /// /// Contains the author/performer. /// private string author = string.Empty; /// /// Contains the copyright information. /// private string copyright = string.Empty; /// /// Contains the description of the media. /// private string description = string.Empty; /// /// Contains the rating of the media. /// private string rating = string.Empty; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the /// contents from a specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public ContentDescriptionObject (Asf.File file, long position) : base (file, position) { if (Guid != Asf.Guid.AsfContentDescriptionObject) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 34) throw new CorruptFileException ( "Object size too small."); ushort title_length = file.ReadWord (); ushort author_length = file.ReadWord (); ushort copyright_length = file.ReadWord (); ushort description_length = file.ReadWord (); ushort rating_length = file.ReadWord (); title = file.ReadUnicode (title_length); author = file.ReadUnicode (author_length); copyright = file.ReadUnicode (copyright_length); description = file.ReadUnicode (description_length); rating = file.ReadUnicode (rating_length); } /// /// Constructs and initializes a new instance of with no contents. /// public ContentDescriptionObject () : base (Asf.Guid.AsfContentDescriptionObject) { } #endregion #region Public Region /// /// Gets and sets the title of the media described by the /// current instance. /// /// /// A object containing the title of /// the media or if it is not set. /// public string Title { get {return title.Length == 0 ? null : title;} set { title = string.IsNullOrEmpty (value) ? string.Empty : value; } } /// /// Gets and sets the author or performer of the media /// described by the current instance. /// /// /// A object containing the author of /// the media or if it is not set. /// public string Author { get {return author.Length == 0 ? null : author;} set { author = string.IsNullOrEmpty (value) ? string.Empty : value; } } /// /// Gets and sets the copyright information for the media /// described by the current instance. /// /// /// A object containing the copyright /// information for the media or if /// it is not set. /// public string Copyright { get {return copyright.Length == 0 ? null : copyright;} set { copyright = string.IsNullOrEmpty (value) ? string.Empty : value; } } /// /// Gets and sets the description of the media described by /// the current instance. /// /// /// A object containing a description /// of the media or if it is not set. /// public string Description { get { return description.Length == 0 ? null : description; } set { description = string.IsNullOrEmpty (value) ? string.Empty : value; } } /// /// Gets and sets the rating of the media described by the /// current instance. /// /// /// A object containing a rating of the /// media or if it is not set. /// public string Rating { get {return rating.Length == 0 ? null : rating;} set { rating = string.IsNullOrEmpty (value) ? string.Empty : value; } } /// /// Gets whether or not the current instance is empty. /// /// /// if all the values are cleared. /// Otherwise . /// public bool IsEmpty { get { return title.Length == 0 && author.Length == 0 && copyright.Length == 0 && description.Length == 0 && rating.Length == 0; } } #endregion #region Public Region /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector title_bytes = RenderUnicode (title); ByteVector author_bytes = RenderUnicode (author); ByteVector copyright_bytes = RenderUnicode (copyright); ByteVector description_bytes = RenderUnicode (description); ByteVector rating_bytes = RenderUnicode (rating); ByteVector output = RenderWord ((ushort) title_bytes.Count); output.Add (RenderWord ((ushort) author_bytes.Count)); output.Add (RenderWord ((ushort) copyright_bytes.Count)); output.Add (RenderWord ((ushort) description_bytes.Count)); output.Add (RenderWord ((ushort) rating_bytes.Count)); output.Add (title_bytes); output.Add (author_bytes); output.Add (copyright_bytes); output.Add (description_bytes); output.Add (rating_bytes); return Render (output); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/PaddingObject.cs0000644000175000017500000000746211442021373021665 0ustar00alexalex00000000000000// // PaddingObject.cs: Provides a representation of an ASF Padding object which // can be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Padding object which can be read from /// and written to disk. /// public class PaddingObject : Object { #region Private Fields /// /// Contains the size of the current instance. /// private ulong size; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents from a /// specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public PaddingObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals (Asf.Guid.AsfPaddingObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 24) throw new CorruptFileException ( "Object size too small."); size = OriginalSize; } /// /// Constructs and initializes a new instance of of a specified size. /// /// /// A value specifying the number of /// bytes the new instance is to take up on disk. /// public PaddingObject (uint size) : base (Asf.Guid.AsfPaddingObject) { this.size = size; } #endregion #region Prublic Properties /// /// Gets and sets the number of bytes the current instance /// will take up on disk. /// /// /// A value containing the size of the /// current instance on disk. /// public ulong Size { get {return size;} set {size = value;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { return Render (new ByteVector ((int) (size - 24))); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/Tag.cs0000644000175000017500000012237311442021373017702 0ustar00alexalex00000000000000// // Tag.cs: Provides a representation of an ASF tag which can be read from and // written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2005-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using System.Globalization; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF tag which can be read from and written /// to disk. /// public class Tag : TagLib.Tag, IEnumerable { #region Private Fields /// /// Contains the content description object. /// private ContentDescriptionObject description = new ContentDescriptionObject (); /// /// Contains the extended content description object. /// private ExtendedContentDescriptionObject ext_description = new ExtendedContentDescriptionObject (); /// /// Contains the metadata library object. /// private MetadataLibraryObject metadata_library = new MetadataLibraryObject (); #endregion #region Constructors /// /// Constructs and initializes a new instance of with no contents. /// public Tag () { } /// /// Constructs and initializes a new instance of using the children of a object. /// /// /// A object whose children are /// are to be used by the new instance. /// /// /// is . /// public Tag (HeaderObject header) { if (header == null) throw new ArgumentNullException ("header"); foreach (Object child in header.Children) { if (child is ContentDescriptionObject) description = child as ContentDescriptionObject; if (child is ExtendedContentDescriptionObject) ext_description = child as ExtendedContentDescriptionObject; } foreach (Object child in header.Extension.Children) if (child is MetadataLibraryObject) metadata_library = child as MetadataLibraryObject; } #endregion #region Public Properties /// /// Gets the ASF Content Description object used by the /// current instance. /// /// /// A object /// containing the ASF Content Description object used by the /// current instance. /// public ContentDescriptionObject ContentDescriptionObject { get {return description;} } /// /// Gets the ASF Extended Content Description object used by /// the current instance. /// /// /// A object /// containing the ASF Extended Content Description object /// used by the current instance. /// public ExtendedContentDescriptionObject ExtendedContentDescriptionObject { get {return ext_description;} } /// /// Gets the ASF Metadata Library object used by the current /// instance. /// /// /// A object containing /// the ASF Metadata Library object used by the current /// instance. /// public MetadataLibraryObject MetadataLibraryObject { get {return metadata_library;} } #endregion #region Public Methods /// /// Gets the string contained in a specific descriptor in the /// current instance. /// /// /// A containing the names of the /// descriptors to look for the value in. /// /// /// is . /// /// /// A object containing the contents of /// the first descriptor found in the current instance. /// public string GetDescriptorString (params string [] names) { if (names == null) throw new ArgumentNullException ("names"); foreach (ContentDescriptor desc in GetDescriptors (names)) { if (desc == null || desc.Type != DataType.Unicode) continue; string value = desc.ToString (); if (value != null) return value; } return null; } /// /// Gets the strings contained in a specific descriptor in /// the current instance. /// /// /// A containing the names of the /// descriptors to look for the value in. /// /// /// is . /// /// /// A object containing the contents of /// the first descriptor found in the current instance as /// split by ';'. /// public string [] GetDescriptorStrings (params string [] names) { if (names == null) throw new ArgumentNullException ("names"); return SplitAndClean (GetDescriptorString (names)); } /// /// Sets the string for a collection of descriptors in the /// current instance. /// /// /// A object containing the value to /// store, or to clear the value. /// /// /// A containing the names in which /// the value would be expected. For example, "WM/AlbumTitle" /// and "Album". /// /// /// is . /// /// /// The value will be stored in the first value in and the rest will be cleared. /// public void SetDescriptorString (string value, params string [] names) { if (names == null) throw new ArgumentNullException ("names"); int index = 0; if (value != null && value.Trim ().Length != 0) { SetDescriptors (names [0], new ContentDescriptor (names [0], value)); index ++; } for (; index < names.Length; index ++) RemoveDescriptors (names [index]); } /// /// Sets the strings for a collection of descriptors in the /// current instance. /// /// /// A containing the value to store, /// or to clear the value. /// /// /// A containing the names in which /// the value would be expected. For example, "WM/AlbumTitle" /// and "Album". /// /// /// is . /// /// /// The value will be stored in the first value in and the rest will be cleared. /// public void SetDescriptorStrings (string [] value, params string [] names) { if (names == null) throw new ArgumentNullException ("names"); SetDescriptorString (String.Join ("; ", value), names); } /// /// Removes all descriptors with a specified name from the /// current instance. /// /// /// A object containing the name of the /// descriptor to remove from the current instance. /// /// /// is . /// public void RemoveDescriptors (string name) { if (name == null) throw new ArgumentNullException ("name"); ext_description.RemoveDescriptors (name); } /// /// Gets all descriptors with any of a collection of names /// from the current instance. /// /// /// A containing the names of the /// descriptors to be retrieved. /// /// /// is . /// /// /// A object enumerating /// through the objects /// retrieved from the current instance. /// public IEnumerable GetDescriptors (params string [] names) { if (names == null) throw new ArgumentNullException ("names"); return ext_description.GetDescriptors (names); } /// /// Sets the a collection of desciptors for a given name, /// removing the existing matching records. /// /// /// A object containing the name of the /// descriptors to be added. /// /// /// A containing /// descriptors to add to the new instance. /// /// /// is . /// /// /// All added entries in /// should match but it is not /// verified by the method. The descriptors will be added /// with their own names and not the one provided in this /// method, which are used for removing existing values and /// determining where to position the new objects. /// public void SetDescriptors (string name, params ContentDescriptor [] descriptors) { if (name == null) throw new ArgumentNullException ("name"); ext_description.SetDescriptors (name, descriptors); } /// /// Adds a descriptor to the current instance. /// /// /// A object to add to the /// current instance. /// /// /// is . /// public void AddDescriptor (ContentDescriptor descriptor) { if (descriptor == null) throw new ArgumentNullException ("descriptor"); ext_description.AddDescriptor (descriptor); } #endregion #region Private Static Methods /// /// Converts a raw ASF picture into an object. /// /// /// A object containing raw ASF /// picture data. /// /// /// A object to read from the raw /// data. /// private static IPicture PictureFromData (ByteVector data) { if (data.Count < 9) return null; int offset = 0; Picture p = new Picture (); // Get the picture type: p.Type = (PictureType) data [offset]; offset += 1; // Get the picture size: int size = (int) data.Mid (offset, 4).ToUInt (false); offset += 4; // Get the mime-type: int found = data.Find (ByteVector.TextDelimiter ( StringType.UTF16LE), offset, 2); if (found < 0) return null; p.MimeType = data.ToString (StringType.UTF16LE, offset, found - offset); offset = found + 2; // Get the description: found = data.Find (ByteVector.TextDelimiter ( StringType.UTF16LE), offset, 2); if (found < 0) return null; p.Description = data.ToString (StringType.UTF16LE, offset, found - offset); offset = found + 2; p.Data = data.Mid (offset, size); return p; } /// /// Converts a object into raw ASF /// picture data. /// /// /// A object to convert. /// /// /// A object containing raw ASF /// picture data. /// private static ByteVector PictureToData (IPicture picture) { ByteVector v = new ByteVector ((byte) picture.Type); v.Add (Object.RenderDWord ((uint) picture.Data.Count)); v.Add (Object.RenderUnicode (picture.MimeType)); v.Add (Object.RenderUnicode (picture.Description)); v.Add (picture.Data); return v; } /// /// Splits a string into a collection of strings by ';'. /// /// /// A object containing the text to /// split. /// /// /// A containing the split text. /// private static string [] SplitAndClean (string s) { if (s == null || s.Trim ().Length == 0) return new string [0]; string [] result = s.Split (';'); for (int i = 0; i < result.Length; i ++) result [i] = result [i].Trim (); return result; } #endregion #region IEnumerable /// /// Gets an enumerator for enumerating through the content /// descriptors. /// /// /// A for /// enumerating through the content descriptors. /// public IEnumerator GetEnumerator () { return ext_description.GetEnumerator (); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () { return ext_description.GetEnumerator (); } #endregion #region TagLib.Tag /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get {return TagTypes.Asf;} } /// /// Gets and sets the title for the media described by the /// current instance. /// /// /// A object containing the title for /// the media described by the current instance or if no value is present. /// /// /// This property is implemented using the title stored in /// the ASF Content Description Object. /// public override string Title { get {return description.Title;} set {description.Title = value;} } /// /// Gets and sets the sort names for the Track Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Track Title of the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "WM/TitleSortOrder" /// field. /// http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx /// public override string TitleSort { get { return GetDescriptorString ("WM/TitleSortOrder"); } set { SetDescriptorString (value, "WM/TitleSortOrder"); } } /// /// Gets and sets the performers or artists who performed in /// the media described by the current instance. /// /// /// A containing the performers or /// artists who performed in the media described by the /// current instance or an empty array if no value is /// present. /// /// /// This property is implemented using the author stored in /// the ASF Content Description Object. /// public override string [] Performers { get {return SplitAndClean (description.Author);} set {description.Author = string.Join ("; ", value);} } /// /// Gets and sets the sort names of the performers or artists /// who performed in the media described by the current instance. /// /// /// A containing the sort names for /// the performers or artists who performed in the media /// described by the current instance, or an empty array if /// no value is present. /// /// /// This property is implemented using the "WM/ArtistSortOrder" field. /// http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx /// public override string [] PerformersSort { get { return GetDescriptorStrings ("WM/ArtistSortOrder"); } set { SetDescriptorStrings (value, "WM/ArtistSortOrder"); } } /// /// Gets and sets the band or artist who is credited in the /// creation of the entire album or collection containing the /// media described by the current instance. /// /// /// A containing the band or artist /// who is credited in the creation of the entire album or /// collection containing the media described by the current /// instance or an empty array if no value is present. /// /// /// This property is implemented using the "WM/AlbumArtist" /// and "AlbumArtist" Content Descriptors. /// public override string [] AlbumArtists { get { return GetDescriptorStrings ("WM/AlbumArtist", "AlbumArtist"); } set { SetDescriptorStrings (value, "WM/AlbumArtist", "AlbumArtist"); } } /// /// Gets and sets the sort names for the band or artist who /// is credited in the creation of the entire album or /// collection containing the media described by the /// current instance. /// /// /// A containing the sort names /// for the band or artist who is credited in the creation /// of the entire album or collection containing the media /// described by the current instance or an empty array if /// no value is present. /// /// /// This property is implemented using the "WM/AlbumArtistSortOrder" /// field. /// http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx /// public override string [] AlbumArtistsSort { get { return GetDescriptorStrings ("WM/AlbumArtistSortOrder"); } set { SetDescriptorStrings (value, "WM/AlbumArtistSortOrder"); } } /// /// Gets and sets the composers of the media represented by /// the current instance. /// /// /// A containing the composers of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "WM/Composer" /// and "Composer" Content Descriptors. /// public override string [] Composers { get { return GetDescriptorStrings ("WM/Composer", "Composer"); } set { SetDescriptorStrings (value, "WM/Composer", "Composer"); } } /// /// Gets and sets the album of the media represented by the /// current instance. /// /// /// A object containing the album of /// the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "WM/AlbumTitle" /// and "Album" Content Descriptors. /// public override string Album { get { return GetDescriptorString ("WM/AlbumTitle", "Album"); } set { SetDescriptorString (value, "WM/AlbumTitle", "Album"); } } /// /// Gets and sets the sort names for the Album Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Album Title of the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "WM/AlbumSortOrder" /// field. /// http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx /// public override string AlbumSort { get { return GetDescriptorString ("WM/AlbumSortOrder"); } set { SetDescriptorString (value, "WM/AlbumSortOrder"); } } /// /// Gets and sets a user comment on the media represented by /// the current instance. /// /// /// A object containing user comments /// on the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the description stored /// in the ASF Content Description Object. /// public override string Comment { get {return description.Description;} set {description.Description = value;} } /// /// Gets and sets the genres of the media represented by the /// current instance. /// /// /// A containing the genres of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "WM/Genre", /// "WM/GenreID", and "Genre" Content Descriptors. /// public override string [] Genres { get { string value = GetDescriptorString ("WM/Genre", "WM/GenreID", "Genre"); if (value == null || value.Trim ().Length == 0) return new string [] {}; string [] result = value.Split (';'); for (int i = 0; i < result.Length; i ++) { string genre = result [i].Trim (); byte genre_id; int closing = genre.IndexOf (')'); if (closing > 0 && genre[0] == '(' && byte.TryParse (genre.Substring ( 1, closing - 1), out genre_id)) genre = TagLib.Genres .IndexToAudio (genre_id); result [i] = genre; } return result; } set { SetDescriptorString (String.Join ("; ", value), "WM/Genre", "Genre", "WM/GenreID"); } } /// /// Gets and sets the year that the media represented by the /// current instance was recorded. /// /// /// A containing the year that the media /// represented by the current instance was created or zero /// if no value is present. /// /// /// This property is implemented using the "WM/Year" Content /// Descriptor. /// public override uint Year { get { string text = GetDescriptorString ("WM/Year"); if (text == null || text.Length < 4) return 0; uint value; if (uint.TryParse (text.Substring (0, 4), NumberStyles.Integer, CultureInfo.InvariantCulture, out value)) return value; return 0; } set { if (value == 0) { RemoveDescriptors ("WM/Year"); return; } SetDescriptorString ( value.ToString ( CultureInfo.InvariantCulture), "WM/Year"); } } /// /// Gets and sets the position of the media represented by /// the current instance in its containing album. /// /// /// A containing the position of the /// media represented by the current instance in its /// containing album or zero if not specified. /// /// /// This property is implemented using the "WM/TrackNumber" /// Content Descriptor. /// public override uint Track { get { foreach (ContentDescriptor desc in GetDescriptors ("WM/TrackNumber")) { uint value = desc.ToDWord (); if (value != 0) return value; } return 0; } set { if (value == 0) RemoveDescriptors ("WM/TrackNumber"); else SetDescriptors ("WM/TrackNumber", new ContentDescriptor ( "WM/TrackNumber", value)); } } /// /// Gets and sets the number of tracks in the album /// containing the media represented by the current instance. /// /// /// A containing the number of tracks in /// the album containing the media represented by the current /// instance or zero if not specified. /// /// /// This property is implemented using the "TrackTotal" /// Content Descriptor. /// public override uint TrackCount { get { foreach (ContentDescriptor desc in GetDescriptors ("TrackTotal")) { uint value = desc.ToDWord (); if (value != 0) return value; } return 0; } set { if (value == 0) RemoveDescriptors ("TrackTotal"); else SetDescriptors ("TrackTotal", new ContentDescriptor ( "TrackTotal", value)); } } /// /// Gets and sets the number of the disc containing the media /// represented by the current instance in the boxed set. /// /// /// A containing the number of the disc /// containing the media represented by the current instance /// in the boxed set. /// /// /// This property is implemented using the "WM/PartOfSet" /// Content Descriptor. /// public override uint Disc { get { string text = GetDescriptorString ( "WM/PartOfSet"); if (text == null) return 0; string [] texts = text.Split ('/'); uint value; if (texts.Length < 1) return 0; return uint.TryParse (texts [0], NumberStyles.Integer, CultureInfo.InvariantCulture, out value) ? value : 0; } set { uint count = DiscCount; if (value == 0 && count == 0) { RemoveDescriptors ("WM/PartOfSet"); return; } if (count != 0) { SetDescriptorString (string.Format ( CultureInfo.InvariantCulture, "{0}/{1}", value, count), "WM/PartOfSet"); return; } SetDescriptorString (value.ToString ( CultureInfo.InvariantCulture), "WM/PartOfSet"); } } /// /// Gets and sets the number of discs in the boxed set /// containing the media represented by the current instance. /// /// /// A containing the number of discs in /// the boxed set containing the media represented by the /// current instance or zero if not specified. /// /// /// This property is implemented using the "WM/PartOfSet" /// Content Descriptor. /// public override uint DiscCount { get { string text = GetDescriptorString ( "WM/PartOfSet"); if (text == null) return 0; string [] texts = text.Split ('/'); uint value; if (texts.Length < 2) return 0; return uint.TryParse (texts [1], NumberStyles.Integer, CultureInfo.InvariantCulture, out value) ? value : 0; } set { uint disc = Disc; if (disc == 0 && value == 0) { RemoveDescriptors ("WM/PartOfSet"); return; } if (value != 0) { SetDescriptorString (string.Format ( CultureInfo.InvariantCulture, "{0}/{1}", disc, value), "WM/PartOfSet"); return; } SetDescriptorString (disc.ToString ( CultureInfo.InvariantCulture), "WM/PartOfSet"); } } /// /// Gets and sets the lyrics or script of the media /// represented by the current instance. /// /// /// A object containing the lyrics or /// script of the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "WM/Lyrics" /// Content Descriptor. /// public override string Lyrics { get {return GetDescriptorString ("WM/Lyrics");} set {SetDescriptorString (value, "WM/Lyrics");} } /// /// Gets and sets the grouping on the album which the media /// in the current instance belongs to. /// /// /// A object containing the grouping on /// the album which the media in the current instance belongs /// to or if no value is present. /// /// /// This property is implemented using the /// "WM/ContentGroupDescription" Content Descriptor. /// public override string Grouping { get { return GetDescriptorString ( "WM/ContentGroupDescription"); } set { SetDescriptorString (value, "WM/ContentGroupDescription"); } } /// /// Gets and sets the number of beats per minute in the audio /// of the media represented by the current instance. /// /// /// A containing the number of beats per /// minute in the audio of the media represented by the /// current instance, or zero if not specified. /// /// /// This property is implemented using the /// "WM/BeatsPerMinute" Content Descriptor. /// public override uint BeatsPerMinute { get { foreach (ContentDescriptor desc in GetDescriptors ("WM/BeatsPerMinute")) { uint value = desc.ToDWord (); if (value != 0) return value; } return 0; } set { if (value == 0) { RemoveDescriptors ("WM/BeatsPerMinute"); return; } SetDescriptors ("WM/BeatsPerMinute", new ContentDescriptor ( "WM/BeatsPerMinute", value)); } } /// /// Gets and sets the conductor or director of the media /// represented by the current instance. /// /// /// A object containing the conductor /// or director of the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "WM/Conductor" /// Content Descriptor. /// public override string Conductor { get {return GetDescriptorString ("WM/Conductor");} set {SetDescriptorString (value, "WM/Conductor");} } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the copyright stored /// in the ASF Content Description Object. /// public override string Copyright { get {return description.Copyright;} set {description.Copyright = value;} } /// /// Gets and sets the MusicBrainz Artist ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ArtistID for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Artist Id" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzArtistId { get {return GetDescriptorString ("MusicBrainz/Artist Id");} set {SetDescriptorString (value, "MusicBrainz/Artist Id");} } /// /// Gets and sets the MusicBrainz Release ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseID for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Album Id" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseId { get {return GetDescriptorString ("MusicBrainz/Album Id");} set {SetDescriptorString (value, "MusicBrainz/Album Id");} } /// /// Gets and sets the MusicBrainz Release Artist ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseArtistID for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Album Artist Id" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseArtistId { get {return GetDescriptorString ("MusicBrainz/Album Artist Id");} set {SetDescriptorString (value, "MusicBrainz/Album Artist Id");} } /// /// Gets and sets the MusicBrainz Track ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// TrackID for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Track Id" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzTrackId { get {return GetDescriptorString ("MusicBrainz/Track Id");} set {SetDescriptorString (value, "MusicBrainz/Track Id");} } /// /// Gets and sets the MusicBrainz Disc ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// DiscID for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Disc Id" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzDiscId { get {return GetDescriptorString ("MusicBrainz/Disc Id");} set {SetDescriptorString (value, "MusicBrainz/Disc Id");} } /// /// Gets and sets the MusicIP PUID of /// the media described by the current instance. /// /// /// A containing the MusicIPPUID /// for the media described by the current instance or /// null if no value is present. /// /// /// This property is implemented using the "MusicIP/PUID" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicIpId { get {return GetDescriptorString ("MusicIP/PUID");} set {SetDescriptorString (value, "MusicIP/PUID");} } // // Gets and sets the AmazonID of // the media described by the current instance. // // // A containing the AmazonID // for the media described by the current instance or // null if no value is present. // // // A definition on where to store the ASIN for // Windows Media is not currently defined // //public override string AmazonId { // get { return null; } // set {} //} /// /// Gets and sets the MusicBrainz Release Status of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseStatus for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Album Status" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseStatus { get {return GetDescriptorString ("MusicBrainz/Album Status");} set {SetDescriptorString (value, "MusicBrainz/Album Status");} } /// /// Gets and sets the MusicBrainz Release Type of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseType for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Album Type" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseType { get {return GetDescriptorString ("MusicBrainz/Album Type");} set {SetDescriptorString (value, "MusicBrainz/Album Type");} } /// /// Gets and sets the MusicBrainz Release Country of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseCountry for the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "MusicBrainz/Album Release Country" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseCountry { get {return GetDescriptorString ("MusicBrainz/Album Release Country");} set {SetDescriptorString (value, "MusicBrainz/Album Release Country");} } /// /// Gets and sets a collection of pictures associated with /// the media represented by the current instance. /// /// /// A containing a collection of /// pictures associated with the media represented by the /// current instance or an empty array if none are present. /// /// /// This property is implemented using the "WM/Picture" /// Content Descriptor and Description Record. /// public override IPicture [] Pictures { get { List l = new List (); foreach (ContentDescriptor descriptor in GetDescriptors ("WM/Picture")) { IPicture p = PictureFromData ( descriptor.ToByteVector ()); if (p != null) l.Add (p); } foreach (DescriptionRecord record in metadata_library.GetRecords (0, 0, "WM/Picture")) { IPicture p = PictureFromData ( record.ToByteVector ()); if (p != null) l.Add (p); } return l.ToArray (); } set { if (value == null || value.Length == 0) { RemoveDescriptors ("WM/Picture"); metadata_library.RemoveRecords (0, 0, "WM/Picture"); return; } List pics = new List (); bool big_pics = false; foreach (IPicture pic in value) { ByteVector data = PictureToData (pic); pics.Add (data); if (data.Count > 0xFFFF) big_pics = true; } if (big_pics) { DescriptionRecord [] records = new DescriptionRecord [pics.Count]; for (int i = 0; i < pics.Count; i ++) records [i] = new DescriptionRecord ( 0, 0, "WM/Picture", pics [i]); RemoveDescriptors ("WM/Picture"); metadata_library.SetRecords (0, 0, "WM/Picture", records); } else { ContentDescriptor [] descs = new ContentDescriptor [pics.Count]; for (int i = 0; i < pics.Count; i ++) descs [i] = new ContentDescriptor ( "WM/Picture", pics [i]); metadata_library.RemoveRecords (0, 0, "WM/Picture"); SetDescriptors ("WM/Picture", descs); } } } /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance does not /// any values. Otherwise . /// public override bool IsEmpty { get { return description.IsEmpty && ext_description.IsEmpty; } } /// /// Clears the values stored in the current instance. /// public override void Clear () { description = new ContentDescriptionObject (); ext_description = new ExtendedContentDescriptionObject (); metadata_library.RemoveRecords (0, 0, "WM/Picture"); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/HeaderExtensionObject.cs0000644000175000017500000001160311442021373023374 0ustar00alexalex00000000000000// // HeaderExtensionObject.cs: Provides a representation of an ASF Header // Extension object which can be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Header Extension object which can be /// read from and written to disk. /// public class HeaderExtensionObject : Object { #region Private Fields /// /// Contains the child objects. /// private List children = new List (); #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents /// from a specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or contents. /// public HeaderExtensionObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals (Asf.Guid.AsfHeaderExtensionObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (file.ReadGuid () != Asf.Guid.AsfReserved1) throw new CorruptFileException ( "Reserved1 GUID expected."); if (file.ReadWord () != 6) throw new CorruptFileException ( "Invalid reserved WORD. Expected '6'."); uint size_remaining = file.ReadDWord (); position += 0x170 / 8; while (size_remaining > 0) { Object obj = file.ReadObject (position); position += (long) obj.OriginalSize; size_remaining -= (uint) obj.OriginalSize; children.Add (obj); } } #endregion #region Public Properties /// /// Gets the child objects contained in the current instance. /// /// /// A object enumerating /// through the children of the current instance. /// public IEnumerable Children { get {return children;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector output = new ByteVector (); foreach (Object child in children) output.Add (child.Render ()); output.Insert (0, RenderDWord ((uint) output.Count)); output.Insert (0, RenderWord (6)); output.Insert (0, Asf.Guid.AsfReserved1.ToByteArray ()); return Render (output); } /// /// Adds a child object to the current instance. /// /// /// A object to add to the current /// instance. /// public void AddObject (Object obj) { children.Add (obj); } /// /// Adds a child unique child object to the current instance, /// replacing and existing child if present. /// /// /// A object to add to the current /// instance. /// public void AddUniqueObject (Object obj) { for (int i = 0; i < children.Count; i ++) if (((Object) children [i]).Guid == obj.Guid) { children [i] = obj; return; } children.Add (obj); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/ExtendedContentDescriptionObject.cs0000644000175000017500000002016511442021373025611 0ustar00alexalex00000000000000// // ExtendedContentDescriptionObject.cs: Provides a representation of an ASF // Extended Content Description object which can be read from and written to // disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Extended Content Description object /// which can be read from and written to disk. /// public class ExtendedContentDescriptionObject : Object, IEnumerable { #region Private Fields /// /// Contains the content descriptors. /// private List descriptors = new List (); #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the /// contents from a specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public ExtendedContentDescriptionObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals ( Asf.Guid.AsfExtendedContentDescriptionObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 26) throw new CorruptFileException ( "Object size too small."); ushort count = file.ReadWord (); for (ushort i = 0; i < count; i ++) AddDescriptor (new ContentDescriptor (file)); } /// /// Constructs and initializes a new instance of with no /// contents. /// public ExtendedContentDescriptionObject () : base (Asf.Guid.AsfExtendedContentDescriptionObject) { } #endregion #region Public Properties /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance doesn't /// contain any objects. /// Otherwise . /// public bool IsEmpty { get {return descriptors.Count == 0;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector output = new ByteVector (); ushort count = 0; foreach (ContentDescriptor desc in descriptors) { count ++; output.Add (desc.Render ()); } return Render (RenderWord (count) + output); } /// /// Removes all descriptors with a given name from the /// current instance. /// /// /// A object containing the name of the /// descriptors to be removed. /// public void RemoveDescriptors (string name) { for (int i = descriptors.Count - 1; i >= 0; i --) if (name == descriptors [i].Name) descriptors.RemoveAt (i); } /// /// Gets all descriptors with any of a collection of names /// from the current instance. /// /// /// A containing the names of the /// descriptors to be retrieved. /// /// /// is . /// /// /// A object enumerating /// through the objects /// retrieved from the current instance. /// public IEnumerable GetDescriptors (params string [] names) { if (names == null) throw new ArgumentNullException ("names"); foreach (string name in names) foreach (ContentDescriptor desc in descriptors) if (desc.Name == name) yield return desc; } /// /// Adds a descriptor to the current instance. /// /// /// A object to add to the /// current instance. /// /// /// is . /// public void AddDescriptor (ContentDescriptor descriptor) { if (descriptor == null) throw new ArgumentNullException ("descriptor"); descriptors.Add (descriptor); } /// /// Sets the a collection of desciptors for a given name, /// removing the existing matching records. /// /// /// A object containing the name of the /// descriptors to be added. /// /// /// A containing /// descriptors to add to the new instance. /// /// /// is . /// /// /// All added entries in /// should match but it is not /// verified by the method. The descriptors will be added /// with their own names and not the one provided in this /// method, which are used for removing existing values and /// determining where to position the new objects. /// public void SetDescriptors (string name, params ContentDescriptor [] descriptors) { if (name == null) throw new ArgumentNullException ("name"); int position = this.descriptors.Count; for (int i = this.descriptors.Count - 1; i >= 0; i --) { if (name == this.descriptors [i].Name) { this.descriptors.RemoveAt (i); position = i; } } this.descriptors.InsertRange (position, descriptors); } #endregion #region IEnumerable /// /// Gets an enumerator for enumerating through the content /// descriptors. /// /// /// A for /// enumerating through the content descriptors. /// public IEnumerator GetEnumerator () { return descriptors.GetEnumerator (); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () { return descriptors.GetEnumerator (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/ContentDescriptor.cs0000644000175000017500000003045711442021373022641 0ustar00alexalex00000000000000// // ContentDescriptor.cs: Provides a representation of an ASF Content Descriptor // to be used in combination with ExtendedContentDescriptionObject. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// Indicates the type of data stored in a or /// object. /// public enum DataType { /// /// The descriptor contains Unicode (UTF-16LE) text. /// Unicode = 0, /// /// The descriptor contains binary data. /// Bytes = 1, /// /// The descriptor contains a boolean value. /// Bool = 2, /// /// The descriptor contains a 4-byte DWORD value. /// DWord = 3, /// /// The descriptor contains a 8-byte QWORD value. /// QWord = 4, /// /// The descriptor contains a 2-byte WORD value. /// Word = 5, /// /// The descriptor contains a 16-byte GUID value. /// Guid = 6 } /// /// This class provides a representation of an ASF Content /// Descriptor to be used in combination with . /// public class ContentDescriptor { #region Private Fields /// /// Contains the data type. /// private DataType type = DataType.Unicode; /// /// Contains the descriptor name. /// private string name = null; /// /// Contains the string value. /// private string strValue = null; /// /// Contains the byte value. /// private ByteVector byteValue = null; /// /// Contains the long value. /// private ulong longValue = 0; #endregion #region Constructors /// /// Constructs and initializes a new instance of with a specified name and /// and value. /// /// /// A object containing the name of the /// new instance. /// /// /// A object containing the value for /// the new instance. /// public ContentDescriptor (string name, string value) { this.name = name; this.strValue = value; } /// /// Constructs and initializes a new instance of with a specified name and /// and value. /// /// /// A object containing the name of the /// new instance. /// /// /// A object containing the value /// for the new instance. /// public ContentDescriptor (string name, ByteVector value) { this.name = name; this.type = DataType.Bytes; this.byteValue = new ByteVector (value); } /// /// Constructs and initializes a new instance of with a specified name and /// and value. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public ContentDescriptor (string name, uint value) { this.name = name; this.type = DataType.DWord; this.longValue = value; } /// /// Constructs and initializes a new instance of with a specified name and /// and value. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public ContentDescriptor (string name, ulong value) { this.name = name; this.type = DataType.QWord; this.longValue = value; } /// /// Constructs and initializes a new instance of with a specified name and /// and value. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public ContentDescriptor (string name, ushort value) { this.name = name; this.type = DataType.Word; this.longValue = value; } /// /// Constructs and initializes a new instance of with a specified name and /// and value. /// /// /// A object containing the name of the /// new instance. /// /// /// A value containing the value /// for the new instance. /// public ContentDescriptor (string name, bool value) { this.name = name; this.type = DataType.Bool; this.longValue = value ? 1uL : 0; } /// /// Constructs and initializes a new instance of by reading its contents from /// a file. /// /// /// A object to read the raw ASF /// Description Record from. /// /// /// is . /// /// /// A valid descriptor could not be read. /// /// /// must be at a seek position at /// which the descriptor can be read. /// protected internal ContentDescriptor (Asf.File file) { if (file == null) throw new ArgumentNullException ("file"); if (!Parse (file)) throw new CorruptFileException ( "Failed to parse content descriptor."); } #endregion #region Public Properties /// /// Gets the name of the current instance. /// /// /// A object containing the name of the /// current instance. /// public string Name { get {return name;} } /// /// Gets the type of data contained in the current instance. /// /// /// A value indicating type of data /// contained in the current instance. /// public DataType Type { get {return type;} } #endregion #region Public Methods /// /// Gets a string representation of the current instance. /// /// /// A object containing the value of /// the current instance. /// public override string ToString () { if (type == DataType.Unicode) return strValue; if (type == DataType.Bytes) return byteValue.ToString (StringType.UTF16LE); return longValue.ToString (); } /// /// Gets the binary contents of the current instance. /// /// /// A object containing the /// contents of the current instance, or if is unequal to . /// public ByteVector ToByteVector () { return byteValue; } /// /// Gets the boolean value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public bool ToBool () { return longValue != 0; } /// /// Gets the DWORD value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public uint ToDWord () { uint value; if (type == DataType.Unicode && strValue != null && uint.TryParse (strValue, out value)) return value; return (uint) longValue; } /// /// Gets the QWORD value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public ulong ToQWord () { ulong value; if (type == DataType.Unicode && strValue != null && ulong.TryParse (strValue, out value)) return value; return longValue; } /// /// Gets the WORD value contained in the current instance. /// /// /// A value containing the value of the /// current instance. /// public ushort ToWord () { ushort value; if (type == DataType.Unicode && strValue != null && ushort.TryParse (strValue, out value)) return value; return (ushort) longValue; } /// /// Renders the current instance as a raw ASF Description /// Record. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render () { ByteVector value = null; switch (type) { case DataType.Unicode: value = Object.RenderUnicode (strValue); break; case DataType.Bytes: value = byteValue; break; case DataType.Bool: case DataType.DWord: value = Object.RenderDWord ((uint) longValue); break; case DataType.QWord: value = Object.RenderQWord (longValue); break; case DataType.Word: value = Object.RenderWord ((ushort) longValue); break; default: return null; } ByteVector name = Object.RenderUnicode (this.name); ByteVector output = new ByteVector (); output.Add (Object.RenderWord ((ushort) name.Count)); output.Add (name); output.Add (Object.RenderWord ((ushort) type)); output.Add (Object.RenderWord ((ushort) value.Count)); output.Add (value); return output; } #endregion #region Protected Methods /// /// Populates the current instance by reading in the contents /// from a file. /// /// /// A object to read the raw ASF /// Content Descriptor from. /// /// /// if the data was read correctly. /// Otherwise . /// protected bool Parse (Asf.File file) { int name_count = file.ReadWord (); name = file.ReadUnicode (name_count); type = (DataType) file.ReadWord (); int value_count = file.ReadWord (); switch (type) { case DataType.Word: longValue = file.ReadWord (); break; case DataType.Bool: longValue = file.ReadDWord (); break; case DataType.DWord: longValue = file.ReadDWord (); break; case DataType.QWord: longValue = file.ReadQWord (); break; case DataType.Unicode: strValue = file.ReadUnicode (value_count); break; case DataType.Bytes: byteValue = file.ReadBlock (value_count); break; default: return false; } return true; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/File.cs0000644000175000017500000003062411442021373020043 0ustar00alexalex00000000000000// // File.cs: Provides tagging and properties support for Microsoft's ASF files. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Asf { /// /// This class extends to provide tagging /// and properties support for Microsoft's ASF files. /// [SupportedMimeType("taglib/wma", "wma")] [SupportedMimeType("taglib/wmv", "wmv")] [SupportedMimeType("taglib/asf", "asf")] [SupportedMimeType("audio/x-ms-wma")] [SupportedMimeType("audio/x-ms-asf")] [SupportedMimeType("video/x-ms-asf")] public class File : TagLib.File { #region Private Fields /// /// Contains the file's tag. /// private Asf.Tag asf_tag = null; /// /// Contains the file's properties. /// private Properties properties = null; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : base (path) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system with an average read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction with an /// average read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// public File (File.IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Properties /// /// Gets a abstract representation of all tags stored in the /// current instance. /// /// /// A object representing all tags /// stored in the current instance. /// public override TagLib.Tag Tag { get {return asf_tag;} } /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get {return properties;} } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { HeaderObject header = new HeaderObject (this, 0); if (asf_tag == null) { header.RemoveContentDescriptors (); TagTypesOnDisk &= ~ TagTypes.Asf; } else { TagTypesOnDisk |= TagTypes.Asf; header.AddUniqueObject ( asf_tag.ContentDescriptionObject); header.AddUniqueObject ( asf_tag.ExtendedContentDescriptionObject); header.Extension.AddUniqueObject ( asf_tag.MetadataLibraryObject); } ByteVector output = header.Render (); long diff = output.Count - (long) header.OriginalSize; Insert (output, 0, (long) header.OriginalSize); InvariantStartPosition += diff; InvariantEndPosition += diff; } finally { Mode = AccessMode.Closed; } } /// /// Gets a tag of a specified type from the current instance, /// optionally creating a new tag if possible. /// /// /// A value indicating the /// type of tag to read. /// /// /// A value specifying whether or not to /// try and create the tag if one is not found. /// /// /// A object containing the tag that was /// found in or added to the current instance. If no /// matching tag was found and none was created, is returned. /// public override TagLib.Tag GetTag (TagTypes type, bool create) { if (type == TagTypes.Asf) return asf_tag; return null; } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public override void RemoveTags (TagTypes types) { if ((types & TagTypes.Asf) == TagTypes.Asf) asf_tag.Clear (); } /// /// Reads a 2-byte WORD from the current instance. /// /// /// A value containing the WORD read /// from the current instance. /// public ushort ReadWord () { return ReadBlock (2).ToUShort (false); } /// /// Reads a 4-byte DWORD from the current instance. /// /// /// A value containing the DWORD read /// from the current instance. /// public uint ReadDWord () { return ReadBlock (4).ToUInt (false); } /// /// Reads a 8-byte QWORD from the current instance. /// /// /// A value containing the QWORD read /// from the current instance. /// public ulong ReadQWord () { return ReadBlock (8).ToULong (false); } /// /// Reads a 16-byte GUID from the current instance. /// /// /// A value containing the GUID /// read from the current instance. /// public System.Guid ReadGuid () { return new System.Guid (ReadBlock (16).Data); } /// /// Reads a Unicode (UTF-16LE) string of specified length /// from the current instance. /// /// /// A value specifying the number of bytes /// to read. This should always be an even number. /// /// /// A object containing the Unicode /// string read from the current instance. /// public string ReadUnicode (int length) { ByteVector data = ReadBlock (length); string output = data.ToString (StringType.UTF16LE); int i = output.IndexOf ('\0'); return (i >= 0) ? output.Substring (0, i) : output; } /// /// Reads a collection of objects from the current instance. /// /// /// A value specifying the number of /// objects to read. /// /// /// A value specifying the seek position /// at which to start reading. /// /// /// A new object enumerating /// through the objects read from the /// current instance. /// public IEnumerable ReadObjects (uint count, long position) { for (int i = 0; i < (int) count; i ++) { Object obj = ReadObject (position); position += (long) obj.OriginalSize; yield return obj; } } /// /// Reads a from the current instance. /// /// /// A value specifying the seek position /// at which to start reading. /// /// /// A new object of appropriate type as /// read from the current instance. /// public Object ReadObject (long position) { Seek (position); System.Guid id = ReadGuid (); if (id.Equals (Guid.AsfFilePropertiesObject)) return new FilePropertiesObject (this, position); if (id.Equals (Guid.AsfStreamPropertiesObject)) return new StreamPropertiesObject (this, position); if (id.Equals (Guid.AsfContentDescriptionObject)) return new ContentDescriptionObject (this, position); if (id.Equals ( Guid.AsfExtendedContentDescriptionObject)) return new ExtendedContentDescriptionObject ( this, position); if (id.Equals (Guid.AsfPaddingObject)) return new PaddingObject (this, position); if (id.Equals (Guid.AsfHeaderExtensionObject)) return new HeaderExtensionObject (this, position); if (id.Equals (Guid.AsfMetadataLibraryObject)) return new MetadataLibraryObject (this, position); return new UnknownObject (this, position); } #endregion #region Private Methods /// /// Reads the contents of the current instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { HeaderObject header = new HeaderObject (this, 0); if (header.HasContentDescriptors) TagTypesOnDisk |= TagTypes.Asf; asf_tag = new Asf.Tag (header); InvariantStartPosition = (long) header.OriginalSize; InvariantEndPosition = Length; if (propertiesStyle != ReadStyle.None) properties = header.Properties; } finally { Mode = AccessMode.Closed; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/UnknownObject.cs0000644000175000017500000000570611442021373021755 0ustar00alexalex00000000000000// // UnknownObject.cs: Provides a simple and generic representation of an object // not identified by TagLib# so that its contents may be preserved. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an unknown object which can be read from and /// written to disk. /// public class UnknownObject : Object { #region Private Fields private ByteVector data; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents from a /// specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// public UnknownObject (Asf.File file, long position) : base (file, position) { data = file.ReadBlock ((int) (OriginalSize - 24)); } #endregion #region Public Properties /// /// Gets and sets the data contained in the current instance. /// /// /// A object containing the data /// contained in the current instance. /// public ByteVector Data { get {return data;} set {data = value;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { return Render (data); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/HeaderObject.cs0000644000175000017500000001646511442021373021512 0ustar00alexalex00000000000000// // HeaderObject.cs: Provides a representation of an ASF Header object which can // be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Header object which can be read from and /// written to disk. /// public class HeaderObject : Object { #region Private Fields /// /// Contains the reserved header data. /// private ByteVector reserved; /// /// Contains the child objects. /// private List children; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents from a /// specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public HeaderObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals (Asf.Guid.AsfHeaderObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 26) throw new CorruptFileException ( "Object size too small."); children = new List (); uint child_count = file.ReadDWord (); reserved = file.ReadBlock (2); children.AddRange (file.ReadObjects (child_count, file.Tell)); } #endregion #region Public Properties /// /// Gets the header extension object contained in the /// current instance. /// /// /// A object containing /// the header extension object. /// public HeaderExtensionObject Extension { get { foreach (Object child in children) if (child is HeaderExtensionObject) return child as HeaderExtensionObject; return null; } } /// /// Gets the child objects contained in the current instance. /// /// /// A object enumerating /// through the children of the current instance. /// public IEnumerable Children { get {return children;} } /// /// Gets the media properties contained within the current /// instance. /// /// /// A object containing the media /// properties of the current instance. /// public Properties Properties { get { TimeSpan duration = TimeSpan.Zero; List codecs = new List (); foreach (Object obj in Children) { FilePropertiesObject fpobj = obj as FilePropertiesObject; if (fpobj != null) { duration = fpobj.PlayDuration - new TimeSpan((long) fpobj.Preroll); continue; } StreamPropertiesObject spobj = obj as StreamPropertiesObject; if (spobj != null) { codecs.Add (spobj.Codec); continue; } } return new Properties (duration, codecs); } } /// /// Gets whether or not the current instance contains either /// type of content descriptiors. /// /// /// if the current instance contains /// a or a . Otherwise /// . /// public bool HasContentDescriptors { get { foreach (Asf.Object child in children) if (child.Guid == Asf.Guid.AsfContentDescriptionObject || child.Guid == Asf.Guid.AsfExtendedContentDescriptionObject) return true; return false; } } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector output = new ByteVector (); uint child_count = 0; foreach (Object child in children) if (child.Guid != Asf.Guid.AsfPaddingObject) { output.Add (child.Render ()); child_count ++; } long size_diff = (long) output.Count + 30 - (long) OriginalSize; if (size_diff != 0) { PaddingObject obj = new PaddingObject ((uint) (size_diff > 0 ? 4096 : - size_diff)); output.Add (obj.Render ()); child_count ++; } output.Insert (0, reserved); output.Insert (0, RenderDWord (child_count)); return Render (output); } /// /// Adds a child object to the current instance. /// /// /// A object to add to the current /// instance. /// public void AddObject (Object obj) { children.Add (obj); } /// /// Adds a child unique child object to the current instance, /// replacing and existing child if present. /// /// /// A object to add to the current /// instance. /// public void AddUniqueObject (Object obj) { for (int i = 0; i < children.Count; i ++) if (children [i].Guid == obj.Guid) { children [i] = obj; return; } children.Add (obj); } /// /// Removes the content description objects from the current /// instance. /// public void RemoveContentDescriptors () { for (int i = children.Count - 1; i >= 0; i --) if (children [i].Guid == Asf.Guid.AsfContentDescriptionObject || children [i].Guid == Asf.Guid.AsfExtendedContentDescriptionObject) children.RemoveAt (i); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/FilePropertiesObject.cs0000644000175000017500000002147111442021373023247 0ustar00alexalex00000000000000// // FilePropertiesObject.cs: Provides a representation of an ASF File Properties // object which can be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF File Properties object which can be read /// from and written to disk. /// public class FilePropertiesObject : Object { #region Private Fields /// /// Contains the GUID for the file. /// private System.Guid file_id; /// /// Contains the file size. /// private ulong file_size; /// /// Contains the creation date. /// private ulong creation_date; /// /// Contains the packet count. /// private ulong data_packets_count; /// /// Contains the play duration. /// private ulong play_duration; /// /// Contains the send duration. /// private ulong send_duration; /// /// Contains the preroll. /// private ulong preroll; /// /// Contains the file flags. /// private uint flags; /// /// Contains the minimum packet size. /// private uint minimum_data_packet_size; /// /// Contains the maxximum packet size. /// private uint maximum_data_packet_size; /// /// Contains the maximum bitrate of the file. /// private uint maximum_bitrate; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents /// from a specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public FilePropertiesObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals (Asf.Guid.AsfFilePropertiesObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 104) throw new CorruptFileException ( "Object size too small."); file_id = file.ReadGuid (); file_size = file.ReadQWord (); creation_date = file.ReadQWord (); data_packets_count = file.ReadQWord (); send_duration = file.ReadQWord (); play_duration = file.ReadQWord (); preroll = file.ReadQWord (); flags = file.ReadDWord (); minimum_data_packet_size = file.ReadDWord (); maximum_data_packet_size = file.ReadDWord (); maximum_bitrate = file.ReadDWord (); } #endregion #region Public Properties /// /// Gets the GUID for the file described by the current /// instance. /// /// /// A value containing the GUID /// for the file described by the current instance. /// public System.Guid FileId { get {return file_id;} } /// /// Gets the size of the file described by the current /// instance. /// /// /// A value containing the size of the /// file described by the current instance. /// public ulong FileSize { get {return file_size;} } /// /// Gets the creation date of the file described by the /// current instance. /// /// /// A value containing the creation /// date of the file described by the current instance. /// public DateTime CreationDate { get {return new DateTime ((long)creation_date);} } /// /// Gets the number of data packets in the file described by /// the current instance. /// /// /// A value containing the number of /// data packets in the file described by the current /// instance. /// public ulong DataPacketsCount { get {return data_packets_count;} } /// /// Gets the play duration of the file described by the /// current instance. /// /// /// A value containing the play /// duration of the file described by the current instance. /// public TimeSpan PlayDuration { get {return new TimeSpan ((long)play_duration);} } /// /// Gets the send duration of the file described by the /// current instance. /// /// /// A value containing the send /// duration of the file described by the current instance. /// public TimeSpan SendDuration { get {return new TimeSpan ((long)send_duration);} } /// /// Gets the pre-roll of the file described by the current /// instance. /// /// /// A value containing the pre-roll of /// the file described by the current instance. /// public ulong Preroll { get {return preroll;} } /// /// Gets the flags of the file described by the current /// instance. /// /// /// A value containing the flags of the /// file described by the current instance. /// public uint Flags { get {return flags;} } /// /// Gets the minimum data packet size of the file described /// by the current instance. /// /// /// A value containing the minimum data /// packet size of the file described by the current /// instance. /// public uint MinimumDataPacketSize { get {return minimum_data_packet_size;} } /// /// Gets the maximum data packet size of the file described /// by the current instance. /// /// /// A value containing the maximum data /// packet size of the file described by the current /// instance. /// public uint MaximumDataPacketSize { get {return maximum_data_packet_size;} } /// /// Gets the maximum bitrate of the file described by the /// current instance. /// /// /// A value containing the maximum /// bitrate of the file described by the current instance. /// public uint MaximumBitrate { get {return maximum_bitrate;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector output = file_id.ToByteArray (); output.Add (RenderQWord (file_size)); output.Add (RenderQWord (creation_date)); output.Add (RenderQWord (data_packets_count)); output.Add (RenderQWord (send_duration)); output.Add (RenderQWord (play_duration)); output.Add (RenderQWord (preroll)); output.Add (RenderDWord (flags)); output.Add (RenderDWord (minimum_data_packet_size)); output.Add (RenderDWord (maximum_data_packet_size)); output.Add (RenderDWord (maximum_bitrate)); return Render (output); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Asf/MetadataLibraryObject.cs0000644000175000017500000002202411442021373023353 0ustar00alexalex00000000000000// // MetadataLibraryObject.cs: Provides a representation of an ASF Metadata // Library object which can be read from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2006-2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Asf { /// /// This class extends to provide a /// representation of an ASF Metadata Library object which can be /// read from and written to disk. /// public class MetadataLibraryObject : Object, IEnumerable { #region Private Fields /// /// Contains the description records. /// private List records = new List (); #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents /// from a specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read the object. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The object read from disk does not have the correct GUID /// or smaller than the minimum size. /// public MetadataLibraryObject (Asf.File file, long position) : base (file, position) { if (!Guid.Equals (Asf.Guid.AsfMetadataLibraryObject)) throw new CorruptFileException ( "Object GUID incorrect."); if (OriginalSize < 26) throw new CorruptFileException ( "Object size too small."); ushort count = file.ReadWord (); for (ushort i = 0; i < count; i ++) { DescriptionRecord rec = new DescriptionRecord ( file); AddRecord (rec); } } /// /// Constructs and initializes a new instance of with no contents. /// public MetadataLibraryObject () : base (Asf.Guid.AsfMetadataLibraryObject) { } #endregion #region Public Properties /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance doesn't /// contain any objects. /// Otherwise . /// public bool IsEmpty { get {return records.Count == 0;} } #endregion #region Public Methods /// /// Renders the current instance as a raw ASF object. /// /// /// A object containing the /// rendered version of the current instance. /// public override ByteVector Render () { ByteVector output = new ByteVector (); ushort count = 0; foreach (DescriptionRecord rec in records) { count ++; output.Add (rec.Render ()); } return Render (RenderWord (count) + output); } /// /// Removes all records with a given language, stream, and /// name from the current instance. /// /// /// A value containing the language /// list index of the records to be removed. /// /// /// A value containing the stream /// number of the records to be removed. /// /// /// A object containing the name of the /// records to be removed. /// public void RemoveRecords (ushort languageListIndex, ushort streamNumber, string name) { for (int i = records.Count - 1; i >= 0; i --) { DescriptionRecord rec = records [i]; if (rec.LanguageListIndex == languageListIndex && rec.StreamNumber == streamNumber && rec.Name == name) records.RemoveAt (i); } } /// /// Gets all records with a given language, stream, and any /// of a collection of names from the current instance. /// /// /// A value containing the language /// list index of the records to be retrieved. /// /// /// A value containing the stream /// number of the records to be retrieved. /// /// /// A containing the names of the /// records to be retrieved. /// /// /// A object enumerating /// through the objects /// retrieved from the current instance. /// public IEnumerable GetRecords (ushort languageListIndex, ushort streamNumber, params string [] names) { foreach (DescriptionRecord rec in records) { if (rec.LanguageListIndex != languageListIndex || rec.StreamNumber != streamNumber) continue; foreach (string name in names) if (rec.Name == name) yield return rec; } } /// /// Adds a record to the current instance. /// /// /// A object to add to the /// current instance. /// public void AddRecord (DescriptionRecord record) { records.Add (record); } /// /// Sets the a collection of records for a given language, /// stream, and name, removing the existing matching records. /// /// /// A value containing the language /// list index of the records to be added. /// /// /// A value containing the stream /// number of the records to be added. /// /// /// A object containing the name of the /// records to be added. /// /// /// A containing records /// to add to the new instance. /// /// /// All added entries in should /// match , and but /// it is not verified by the method. The records will be /// added with their own values and not those provided in /// this method, which are used for removing existing values /// and determining where to position the new object. /// public void SetRecords (ushort languageListIndex, ushort streamNumber, string name, params DescriptionRecord [] records) { int position = this.records.Count; for (int i = this.records.Count - 1; i >= 0; i --) { DescriptionRecord rec = this.records [i]; if (rec.LanguageListIndex == languageListIndex && rec.StreamNumber == streamNumber && rec.Name == name) { this.records.RemoveAt (i); position = i; } } this.records.InsertRange (position, records); } #endregion #region IEnumerable /// /// Gets an enumerator for enumerating through the /// description records. /// /// /// A for /// enumerating through the description records. /// public IEnumerator GetEnumerator () { return records.GetEnumerator (); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () { return records.GetEnumerator (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Flac/0000755000175000017500000000000011774620111016767 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Flac/Block.cs0000644000175000017500000001266511442021373020357 0ustar00alexalex00000000000000// // Block.cs: Represents a Flac metadata block. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Flac { /// /// This class represents a Flac metadata block. /// public class Block { #region Private Fields /// /// Contains the block header. /// private BlockHeader header; /// /// Contains the block data. /// private ByteVector data; #endregion #region Constructors /// /// Constructs and initializes a new instance of with a specified header and internal /// data. /// /// /// A object containing the /// header to use for the new instance. /// /// /// A object containing the data /// to be contained in the new instance. /// /// /// is . /// /// /// The size of does not match the /// size specified in . /// public Block (BlockHeader header, ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); if (header.BlockSize != data.Count) throw new CorruptFileException ( "Data count not equal to block size."); this.header = header; this.data = data; } /// /// Constructs and initializes a new instance of with of a specified type and internal /// data. /// /// /// A value indicating the type of /// data stored in . /// /// /// A object containing the data /// to be contained in the new instance. /// /// /// is . /// public Block (BlockType type, ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); header = new BlockHeader (type, (uint) data.Count); this.data = data; } #endregion #region Public Properties /// /// Gets the type of data contained in the current instance. /// /// /// A value indicating the type of /// data contained in . /// public BlockType Type { get {return header.BlockType;} } /// /// Gets whether or not the block represented by the current /// instance is the last metadata block in the Flac stream. /// /// /// if the block represented by the /// current instance was the last one to appear in the file /// and is followed immediately by the audio data, or if another block appears after the /// current one or the block was not read from disk. /// public bool IsLastBlock { get {return header.IsLastBlock;} } /// /// Gets the size of the data contained in the current /// instance. /// public uint DataSize { get {return header.BlockSize;} } /// /// Gets the total size of the block represented by the /// current instance as it appears on disk. /// public uint TotalSize { get {return DataSize + BlockHeader.Size;} } /// /// Gets the data contained in the current instance. /// /// /// A object containing the data /// stored in the current instance. /// public ByteVector Data { get {return data;} } #endregion #region Public Methods /// /// Renders the current instance as a raw Flac metadata /// block. /// /// /// A value indicating whether or not the /// block is to be marked as the last metadata block. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render (bool isLastBlock) { if (this.data == null) throw new InvalidOperationException ( "Cannot render empty blocks."); ByteVector data = header.Render (isLastBlock); data.Add (this.data); return data; } #endregion } }taglib-sharp-2.1.0.0/src/TagLib/Flac/Picture.cs0000644000175000017500000002067211442021373020735 0ustar00alexalex00000000000000// // Picture.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Flac { /// /// This class implements to provide support /// for reading and writing Flac picture metadata. /// public class Picture : IPicture { #region Private Fields /// /// Contains the picture type. /// private PictureType type; /// /// Contains the mime-type. /// private string mime_type; /// /// Contains the description. /// private string description; /// /// Contains the width. /// private int width = 0; /// /// Contains the height. /// private int height = 0; /// /// Contains the color depth. /// private int color_depth = 0; /// /// Contains the number of indexed colors. /// private int indexed_colors = 0; /// /// Contains the picture data. /// private ByteVector picture_data; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading the contents of a raw Flac /// image structure. /// /// /// A object containing the raw /// Flac image. /// /// /// is . /// /// /// contains less than 32 bytes. /// public Picture (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); if (data.Count < 32) throw new CorruptFileException ( "Data must be at least 32 bytes long"); int pos = 0; type = (PictureType) data.Mid (pos, 4).ToUInt (); pos += 4; int mimetype_length = (int) data.Mid (pos, 4).ToUInt (); pos += 4; mime_type = data.ToString (StringType.Latin1, pos, mimetype_length); pos += mimetype_length; int description_length = (int) data.Mid (pos, 4) .ToUInt (); pos += 4; description = data.ToString (StringType.UTF8, pos, description_length); pos += description_length; width = (int) data.Mid (pos, 4).ToUInt (); pos += 4; height = (int) data.Mid (pos, 4).ToUInt (); pos += 4; color_depth = (int) data.Mid (pos, 4).ToUInt (); pos += 4; indexed_colors = (int) data.Mid (pos, 4).ToUInt (); pos += 4; int data_length = (int) data.Mid (pos, 4).ToUInt (); pos += 4; picture_data = data.Mid (pos, data_length); } /// /// Constructs and initializes a new instance of by copying the properties of a object. /// /// /// A object to use for the new /// instance. /// /// /// is . /// public Picture (IPicture picture) { if (picture == null) throw new ArgumentNullException ("picture"); type = picture.Type; mime_type = picture.MimeType; description = picture.Description; picture_data = picture.Data; TagLib.Flac.Picture flac_picture = picture as TagLib.Flac.Picture; if (flac_picture == null) return; width = flac_picture.Width; height = flac_picture.Height; color_depth = flac_picture.ColorDepth; indexed_colors = flac_picture.IndexedColors; } #endregion #region Public Methods /// /// Renders the current instance as a raw Flac picture. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render () { ByteVector data = new ByteVector (); data.Add (ByteVector.FromUInt ((uint) Type)); ByteVector mime_data = ByteVector.FromString (MimeType, StringType.Latin1); data.Add (ByteVector.FromUInt ((uint) mime_data.Count)); data.Add (mime_data); ByteVector decription_data = ByteVector.FromString ( Description, StringType.UTF8); data.Add (ByteVector.FromUInt ((uint) decription_data.Count)); data.Add (decription_data); data.Add (ByteVector.FromUInt ((uint) Width)); data.Add (ByteVector.FromUInt ((uint) Height)); data.Add (ByteVector.FromUInt ((uint) ColorDepth)); data.Add (ByteVector.FromUInt ((uint) IndexedColors)); data.Add (ByteVector.FromUInt ((uint) Data.Count)); data.Add (Data); return data; } #endregion #region Public Properties /// /// Gets and sets the mime-type of the picture data /// stored in the current instance. /// /// /// A object containing the mime-type /// of the picture data stored in the current instance. /// public string MimeType { get {return mime_type;} set {mime_type = value;} } /// /// Gets and sets the type of content visible in the picture /// stored in the current instance. /// /// /// A containing the type of /// content visible in the picture stored in the current /// instance. /// public PictureType Type { get {return type;} set {type = value;} } /// /// Gets and sets a description of the picture stored in the /// current instance. /// /// /// A object containing a description /// of the picture stored in the current instance. /// public string Description { get {return description;} set {description = value;} } /// /// Gets and sets the picture data stored in the current /// instance. /// /// /// A object containing the picture /// data stored in the current instance. /// public ByteVector Data { get {return picture_data;} set {picture_data = value;} } /// /// Gets and sets the width of the picture in the current /// instance. /// /// /// A value containing width of the /// picture stored in the current instance. /// public int Width { get {return width;} set {width = value;} } /// /// Gets and sets the height of the picture in the current /// instance. /// /// /// A value containing height of the /// picture stored in the current instance. /// public int Height { get {return height;} set {height = value;} } /// /// Gets and sets the color depth of the picture in the /// current instance. /// /// /// A value containing color depth of the /// picture stored in the current instance. /// public int ColorDepth { get {return color_depth;} set {color_depth = value;} } /// /// Gets and sets the number of indexed colors in the picture /// in the current instance. /// /// /// A value containing number of indexed /// colors in the picture, or zero if the picture is not /// stored in an indexed format. /// public int IndexedColors { get {return indexed_colors;} set {indexed_colors = value;} } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Flac/StreamHeader.cs0000644000175000017500000001444511442021373021667 0ustar00alexalex00000000000000// // StreamHeader.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // flagproperties.cpp from TagLib // // Copyright (C) 2006-2007 Brian Nickel // Copyright (C) 2003 Allan Sandfeld Jensen (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections; using System; namespace TagLib.Flac { /// /// This structure implements and provides /// information about a Flac audio stream. /// public struct StreamHeader : IAudioCodec, ILosslessAudioCodec { #region Private Properties /// /// Contains the flags. /// private uint flags; /// /// Contains the low portion of the length. /// private uint low_length; /// /// Contains the stream length. /// private long stream_length; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading a raw stream header /// structure and using the stream length. /// /// /// A object containing the raw /// stream header. /// /// /// A value containing the length of the /// stream. /// /// /// is . /// /// /// contains less than 18 bytes. /// public StreamHeader (ByteVector data, long streamLength) { if (data == null) throw new ArgumentNullException ("data"); if (data.Count < 18) throw new CorruptFileException ( "Not enough data in FLAC header."); this.stream_length = streamLength; this.flags = data.Mid (10, 4).ToUInt (true); low_length = data.Mid (14, 4).ToUInt (true); } #endregion #region Public Properties /// /// Gets the duration of the media represented by the current /// instance. /// /// /// A containing the duration of the /// media represented by the current instance. /// public TimeSpan Duration { get { return (AudioSampleRate > 0 && stream_length > 0) ? TimeSpan.FromSeconds ( (double) low_length / (double) AudioSampleRate + (double) HighLength) : TimeSpan.Zero; } } /// /// Gets the bitrate of the audio represented by the current /// instance. /// /// /// A value containing a bitrate of the /// audio represented by the current instance. /// public int AudioBitrate { get { return (int) (Duration > TimeSpan.Zero ? ((stream_length * 8L) / Duration.TotalSeconds) / 1000 : 0); } } /// /// Gets the sample rate of the audio represented by the /// current instance. /// /// /// A value containing the sample rate of /// the audio represented by the current instance. /// public int AudioSampleRate { get {return (int) (flags >> 12);} } /// /// Gets the number of channels in the audio represented by /// the current instance. /// /// /// A value containing the number of /// channels in the audio represented by the current /// instance. /// public int AudioChannels { get {return (int) (((flags >> 9) & 7) + 1);} } /// /// Gets the types of media represented by the current /// instance. /// /// /// Always . /// public MediaTypes MediaTypes { get {return MediaTypes.Audio;} } /// /// Gets the sample width of the audio represented by the /// current instance. /// /// /// A value containing the sample width of /// the audio represented by the current instance. /// [Obsolete ("This property is depreciated, use BitsPerSample instead")] public int AudioSampleWidth { get {return BitsPerSample;} } /// /// Gets the number of bits per sample in the audio /// represented by the current instance. /// /// /// A value containing the number of bits /// per sample in the audio represented by the current /// instance. /// public int BitsPerSample { get {return (int) (((flags >> 4) & 31) + 1);} } /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public string Description { get {return "Flac Audio";} } #endregion #region Private Properties /// /// Gets a high portion of the length of the audio /// represented by the current instance. /// /// /// A value containing the high portion /// of the length. /// private uint HighLength { get { // The last 4 bits are the most significant 4 // bits for the 36 bit stream length in samples. // (Audio files measured in days) return (uint) (AudioSampleRate > 0 ? (((flags & 0xf) << 28) / AudioSampleRate) << 4 : 0); } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Flac/BlockHeader.cs0000644000175000017500000001220311442021373021454 0ustar00alexalex00000000000000// // BlockHeader.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Flac { /// /// Specifies the contents of a Flac block in . /// public enum BlockType { /// /// The block contains stream information. /// StreamInfo = 0, /// /// The block contains padding. /// Padding, /// /// The block contains application data. /// Application, /// /// The block contains seek table. /// SeekTable, /// /// The block contains a Xipp comment. /// XiphComment, /// /// The block contains a cue sheet. /// CueSheet, /// /// The block contains a picture. /// Picture } /// /// This structure provides a representation of a Flac metadata block /// header structure. /// public struct BlockHeader { /// /// Contains the block type. /// private BlockType block_type; /// /// Indicates whether or not this is the last metadata block. /// private bool is_last_block; /// /// Contains the block size. /// private uint block_size; /// /// The size of a block header. /// public const uint Size = 4; /// /// Constructs and initializes a new instance of by reading a raw header from a object. /// /// /// A object containing a raw /// block header. /// /// /// is . /// /// /// contains less than 4 bytes. /// public BlockHeader (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); if (data.Count < Size) throw new CorruptFileException ( "Not enough data in Flac header."); block_type = (BlockType) (data[0] & 0x7f); is_last_block = (data[0] & 0x80) != 0; block_size = data.Mid (1,3).ToUInt (); } /// /// Constructs and initializes a new instance of for a specified block type and size. /// /// /// A value describing the contents /// of the block. /// /// /// A value containing the block data /// size minus the size of the header. /// public BlockHeader (BlockType type, uint blockSize) { block_type = type; is_last_block = false; block_size = blockSize; } /// /// Renderes the current instance as a raw Flac block header. /// /// /// A value specifying whether or not the /// header is the last header of the file. /// /// /// A object containing the /// rendered header. /// public ByteVector Render (bool isLastBlock) { ByteVector data = ByteVector.FromUInt (block_size); data [0] = (byte)(block_type + (isLastBlock ? 0x80 : 0)); return data; } /// /// Gets the type of block described by the current instance. /// /// /// A value describing the block /// type. /// public BlockType BlockType { get {return block_type;} } /// /// Gets whether or not the block is the last in the file. /// /// /// if the block is the last in the /// file; otherwise . /// public bool IsLastBlock { get {return is_last_block;} } /// /// Gets the size of the block described by the current /// instance, minus the block header. /// /// /// A value containing the size of the /// block, minus the header. /// public uint BlockSize { get {return block_size;} } } }taglib-sharp-2.1.0.0/src/TagLib/Flac/File.cs0000644000175000017500000004777311442021373020214 0ustar00alexalex00000000000000// // File.cs: Provides tagging and properties support for Xiph's Flac audio files. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // flacfile.cpp from TagLib // // Copyright (C) 2006-2007 Brian Nickel // Copyright (C) 2003-2004 Allan Sandfeld Jensen (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Flac { /// /// This class extends to /// provide tagging and properties support for Xiph's Flac audio /// files. /// /// /// A will be added /// automatically to any file that doesn't contain one. This change /// does not effect the physical file until is /// called and can be reversed using the following method: /// file.RemoveTags (file.TagTypes & ~file.TagTypesOnDisk); /// [SupportedMimeType("taglib/flac", "flac")] [SupportedMimeType("audio/x-flac")] [SupportedMimeType("application/x-flac")] [SupportedMimeType("audio/flac")] public class File : TagLib.NonContainer.File { #region Private Fields /// /// Contains the Flac metadata tag. /// private Metadata metadata = null; /// /// Contains the combination of all file tags. /// private CombinedTag tag = null; /// /// Contains the Flac header block. /// private ByteVector header_block = null; /// /// Contains the stream start position. /// private long stream_start = 0; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : base (path, propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system with an average read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : base (path) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction, propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified file abstraction with an /// average read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// public File (File.IFileAbstraction abstraction) : base (abstraction) { } #endregion #region Public Properties /// /// Gets a abstract representation of all tags stored in the /// current instance. /// /// /// A object representing all tags /// stored in the current instance. /// public override TagLib.Tag Tag { get {return tag;} } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { // Update the tags at the beginning of the file. long metadata_start = StartTag.Write (); long metadata_end; // Get all the blocks, but don't read the data for ones // we're filling with stored data. IList old_blocks = ReadBlocks (ref metadata_start, out metadata_end, BlockMode.Blacklist, BlockType.XiphComment, BlockType.Picture); // Create new vorbis comments is they don't exist. GetTag (TagTypes.Xiph, true); // Create new blocks and add the basics. List new_blocks = new List (); new_blocks.Add (old_blocks [0]); // Add blocks we don't deal with from the file. foreach (Block block in old_blocks) if (block.Type != BlockType.StreamInfo && block.Type != BlockType.XiphComment && block.Type != BlockType.Picture && block.Type != BlockType.Padding) new_blocks.Add (block); new_blocks.Add (new Block (BlockType.XiphComment, (GetTag (TagTypes.Xiph, true) as Ogg.XiphComment).Render (false))); foreach (IPicture picture in metadata.Pictures) { if (picture == null) continue; new_blocks.Add (new Block (BlockType.Picture, new Picture (picture).Render ())); } // Get the length of the blocks. long length = 0; foreach (Block block in new_blocks) length += block.TotalSize; // Find the padding size to avoid trouble. If that fails // make some. long padding_size = metadata_end - metadata_start - BlockHeader.Size - length; if (padding_size < 0) padding_size = 1024 * 4; // Add a padding block. if (padding_size != 0) new_blocks.Add (new Block (BlockType.Padding, new ByteVector ((int) padding_size))); // Render the blocks. ByteVector block_data = new ByteVector (); for (int i = 0; i < new_blocks.Count; i ++) block_data.Add (new_blocks [i].Render ( i == new_blocks.Count - 1)); // Update the blocks. Insert (block_data, metadata_start, metadata_end - metadata_start); // Update the tags at the end of the file. EndTag.Write (); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } /// /// Gets a tag of a specified type from the current instance, /// optionally creating a new tag if possible. /// /// /// A value indicating the /// type of tag to read. /// /// /// A value specifying whether or not to /// try and create the tag if one is not found. /// /// /// A object containing the tag that was /// found in or added to the current instance. If no /// matching tag was found and none was created, is returned. /// public override TagLib.Tag GetTag (TagTypes type, bool create) { switch (type) { case TagTypes.Xiph: return metadata.GetComment (create, tag); case TagTypes.FlacMetadata: return metadata; } Tag t = (base.Tag as TagLib.NonContainer.Tag).GetTag (type); if (t != null || !create) return t; switch (type) { case TagTypes.Id3v1: return EndTag.AddTag (type, Tag); case TagTypes.Id3v2: return StartTag.AddTag (type, Tag); case TagTypes.Ape: return EndTag.AddTag (type, Tag); default: return null; } } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public override void RemoveTags (TagTypes types) { if ((types & TagTypes.Xiph) != 0) metadata.RemoveComment (); if ((types & TagTypes.FlacMetadata) != 0) metadata.Clear (); base.RemoveTags (types); } #endregion #region Protected Methods /// /// Reads format specific information at the start of the /// file. /// /// /// A value containing the seek position /// at which the tags end and the media data begins. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// protected override void ReadStart (long start, ReadStyle propertiesStyle) { long end; IList blocks = ReadBlocks (ref start, out end, BlockMode.Whitelist, BlockType.StreamInfo, BlockType.XiphComment, BlockType.Picture); metadata = new Metadata (blocks); TagTypesOnDisk |= metadata.TagTypes; if (propertiesStyle != ReadStyle.None) { // Check that the first block is a // METADATA_BLOCK_STREAMINFO. if (blocks.Count == 0 || blocks [0].Type != BlockType.StreamInfo) throw new CorruptFileException ( "FLAC stream does not begin with StreamInfo."); // The stream exists from the end of the last // block to the end of the file. stream_start = end; header_block = blocks [0].Data; } } /// /// Reads format specific information at the end of the /// file. /// /// /// A value containing the seek position /// at which the media data ends and the tags begin. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// protected override void ReadEnd (long end, ReadStyle propertiesStyle) { tag = new CombinedTag (metadata, base.Tag); GetTag (TagTypes.Xiph, true); } /// /// Reads the audio properties from the file represented by /// the current instance. /// /// /// A value containing the seek position /// at which the tags end and the media data begins. /// /// /// A value containing the seek position /// at which the media data ends and the tags begin. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// A object describing the /// media properties of the file represented by the current /// instance. /// protected override Properties ReadProperties (long start, long end, ReadStyle propertiesStyle) { StreamHeader header = new StreamHeader (header_block, end - stream_start); return new Properties (TimeSpan.Zero, header); } #endregion #region Private Methods /// /// Indicates whether or not the block types passed into /// are to be white-listed or /// black-listed. /// private enum BlockMode { /// /// All block types except those provided are to be /// returned. /// Blacklist, /// /// Only those block types provides should be /// returned. /// Whitelist } /// /// Reads all metadata blocks starting from the current /// instance, starting at a specified position. /// /// /// A value reference specifying the /// position at which to start searching for the blocks. This /// will be updated to the position of the first block. /// /// /// A value reference updated to the /// position at which the last block ends. /// /// /// A value indicating whether to /// white-list or black-list the contents of . /// /// /// A containing the types to look /// for or not look for as specified by . /// /// /// A object containing the blocks /// read from the current instance. /// /// /// "fLaC" could not be found. /// private IList ReadBlocks (ref long start, out long end, BlockMode mode, params BlockType[] types) { List blocks = new List (); long start_position = Find ("fLaC", start); if (start_position < 0) throw new CorruptFileException ( "FLAC stream not found at starting position."); end = start = start_position + 4; Seek (start); BlockHeader header; do { header = new BlockHeader (ReadBlock ((int) BlockHeader.Size)); bool found = false; foreach (BlockType type in types) if (header.BlockType == type) { found = true; break; } if ((mode == BlockMode.Whitelist && found) || (mode == BlockMode.Blacklist && !found)) blocks.Add (new Block (header, ReadBlock ((int) header.BlockSize))); else Seek (header.BlockSize, System.IO.SeekOrigin.Current); end += header.BlockSize + BlockHeader.Size; } while (!header.IsLastBlock); return blocks; } #endregion } /// /// This class extends to provide support /// for reading and writing FLAC metadata boxes. /// /// /// At this point, only Xiph Comments and pictures are supported. /// public class Metadata : CombinedTag { /// /// Contains the pictures. /// private List pictures = new List(); /// /// Constructs and initializes a new instance of using a collection of blocks. /// /// /// A object containing objects to use in the new instance. /// /// /// is . /// [Obsolete("Use Metadata(IEnumerable)")] public Metadata (List blocks) : this (blocks as IEnumerable) { } /// /// Constructs and initializes a new instance of using a collection of blocks. /// /// /// A object enumerating objects to use in the new instance. /// /// /// is . /// public Metadata (IEnumerable blocks) { if (blocks == null) throw new ArgumentNullException ("blocks"); foreach (Block block in blocks) { if (block.Data.Count == 0) continue; if (block.Type == BlockType.XiphComment) AddTag (new Ogg.XiphComment (block.Data)); else if (block.Type == BlockType.Picture) pictures.Add (new Picture (block.Data)); } } /// /// Gets the first Xiph comment stored in the current /// instance, optionally creating one if necessary. /// /// /// A value indicating whether or not a /// comment should be added if one cannot be found. /// /// /// A object containing the source tag to /// copy the values from, or to not /// copy values. /// /// /// A object containing the /// tag that was found in or added to the current instance. /// If no matching tag was found and none was created, is returned. /// public Ogg.XiphComment GetComment (bool create, Tag copy) { foreach (Tag t in Tags) if (t is Ogg.XiphComment) return t as Ogg.XiphComment; if (!create) return null; Ogg.XiphComment c = new Ogg.XiphComment (); if (copy != null) copy.CopyTo (c, true); AddTag (c); return c; } /// /// Removes all child Xiph Comments from the current /// instance. /// public void RemoveComment () { Ogg.XiphComment c; while ((c = GetComment (false, null)) != null) RemoveTag (c); } /// /// Gets the tag types contained in the current instance. /// /// /// A bitwise combined value /// containing the tag types stored in the current instance. /// public override TagTypes TagTypes { get {return TagTypes.FlacMetadata | base.TagTypes;} } /// /// Gets and sets a collection of pictures associated with /// the media represented by the current instance. /// /// /// A containing a collection of /// pictures associated with the media represented by the /// current instance or an empty array if none are present. /// public override IPicture[] Pictures { get {return pictures.ToArray ();} set { pictures.Clear (); if (value != null) pictures.AddRange (value); } } /// /// Clears the values stored in the current instance. /// public override void Clear () { pictures.Clear (); } } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/0000755000175000017500000000000011774620112016637 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Ogg/Paginator.cs0000644000175000017500000001640011442021373021107 0ustar00alexalex00000000000000// // Paginator.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // oggpage.cpp from TagLib // // Copyright (C) 2006-2007 Brian Nickel // Copyright (C) 2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Ogg { /// /// This class accepts a sequence of pages for a single Ogg stream, /// accepts changes, and produces a new sequence of pages to write to /// disk. /// public class Paginator { #region Private Fields /// /// Contains the packets to paginate. /// private ByteVectorCollection packets = new ByteVectorCollection (); /// /// Contains the first page header. /// private PageHeader? first_page_header = null; /// /// Contains the codec to use. /// private Codec codec; /// /// contains the number of pages read. /// private int pages_read = 0; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a given /// object. /// /// /// A object to use when processing /// packets. /// public Paginator (Codec codec) { this.codec = codec; } #endregion #region Public Methods /// /// Adds the next page to the current instance. /// /// /// The next object found in the stream. /// public void AddPage (Page page) { pages_read ++; if (first_page_header == null) first_page_header = page.Header; if (page.Packets.Length == 0) return; ByteVector[] page_packets = page.Packets; for (int i = 0; i < page_packets.Length; i ++) { if ((page.Header.Flags & PageFlags .FirstPacketContinued) != 0 && i == 0 && packets.Count > 0) packets [packets.Count - 1].Add (page_packets [0]); else packets.Add (page_packets [i]); } } /// /// Stores a Xiph comment in the codec-specific comment /// packet. /// /// /// A object to store in the /// comment packet. /// public void SetComment (XiphComment comment) { codec.SetCommentPacket (packets, comment); } /// /// Repaginates the pages passed into the current instance to /// handle changes made to the Xiph comment. /// /// /// A containing the new page /// collection. /// [Obsolete("Use Paginator.Paginate(out int)")] public Page [] Paginate () { int dummy; return Paginate (out dummy); } /// /// Repaginates the pages passed into the current instance to /// handle changes made to the Xiph comment. /// /// /// A value reference containing the /// the difference between the number of pages returned and /// the number of pages that were added to the class. /// /// /// A containing the new page /// collection. /// public Page [] Paginate (out int change) { // Ogg Pagination: Welcome to sucksville! // If you don't understand this, you're not alone. // It is confusing as Hell. // TODO: Document this method, in the mean time, there // is always http://xiph.org/ogg/doc/framing.html if (pages_read == 0) { change = 0; return new Page [0]; } int count = pages_read; ByteVectorCollection packets = new ByteVectorCollection ( this.packets); PageHeader first_header = (PageHeader) first_page_header; List pages = new List (); uint index = 0; bool bos = first_header.PageSequenceNumber == 0; if (bos) { pages.Add (new Page (new ByteVectorCollection (packets [0]), first_header)); index ++; packets.RemoveAt (0); count --; } int lacing_per_page = 0xfc; if (count > 0) { int total_lacing_bytes = 0; for (int i = 0; i < packets.Count; i ++) total_lacing_bytes += GetLacingValueLength ( packets, i); lacing_per_page = Math.Min (total_lacing_bytes / count + 1, lacing_per_page); } int lacing_bytes_used = 0; ByteVectorCollection page_packets = new ByteVectorCollection (); bool first_packet_continued = false; while (packets.Count > 0) { int packet_bytes = GetLacingValueLength (packets, 0); int remaining = lacing_per_page - lacing_bytes_used; bool whole_packet = packet_bytes <= remaining; if (whole_packet) { page_packets.Add (packets [0]); lacing_bytes_used += packet_bytes; packets.RemoveAt (0); } else { page_packets.Add (packets [0].Mid (0, remaining * 0xff)); packets [0] = packets [0].Mid (remaining * 0xff); lacing_bytes_used += remaining; } if (lacing_bytes_used == lacing_per_page) { pages.Add (new Page (page_packets, new PageHeader (first_header, index, first_packet_continued ? PageFlags.FirstPacketContinued : PageFlags.None))); page_packets = new ByteVectorCollection (); lacing_bytes_used = 0; index ++; count --; first_packet_continued = !whole_packet; } } if (page_packets.Count > 0) { pages.Add (new Page (page_packets, new PageHeader ( first_header.StreamSerialNumber, index, first_packet_continued ? PageFlags.FirstPacketContinued : PageFlags.None))); index ++; count --; } change = -count; return pages.ToArray (); } #endregion #region Private Methods /// /// Gets the number of lacing value bytes that would be /// required for a given packet. /// /// /// A object containing /// the packet. /// /// /// A value containing the index of the /// packet to compute. /// /// /// A value containing the number of bytes /// needed to store the length. /// private static int GetLacingValueLength (ByteVectorCollection packets, int index) { int size = packets [index].Count; return size / 0xff + ((index + 1 < packets.Count || size % 0xff > 0) ? 1 : 0); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/Bitstream.cs0000644000175000017500000001417111442021373021120 0ustar00alexalex00000000000000// // Bitstream.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Ogg { /// /// This class accepts a sequence of pages belonging to a single /// logical bitstream, processes them, and extracts the tagging and /// media information. /// public class Bitstream { #region Private Fields /// /// Contains the last packet of the previous page in case it /// is continued in the next frame. /// private ByteVector previous_packet; /// /// Contains the index of the next packet to be processed. /// private int packet_index; /// /// Contains the codec object used to process pages. /// private Codec codec; /// /// Contains the absolute granular position of the first /// page. /// private long first_absolute_granular_position; #endregion #region Constructors /// /// Constructs and initializes a new instance of capable of processing a specified /// page. /// /// /// The first object of the stream to be /// processed by the new instance. /// /// /// The constructor only sets the new instance up to read the /// packet, but doesn't actually read it. /// /// /// is . /// /// /// No registered codec capable of processing could be found. /// public Bitstream (Page page) { if (page == null) throw new ArgumentNullException ("page"); // Assume that the first packet is completely enclosed. // This should be sufficient for codec recognition. codec = Codec.GetCodec (page.Packets [0]); first_absolute_granular_position = page.Header.AbsoluteGranularPosition; } #endregion #region Public Methods /// /// Reads the next logical page in the stream. /// /// /// The next logical object in the /// stream. /// /// /// if the codec has read all the /// necessary packets for the stream and does not need to be /// called again, typically once the Xiph comment has been /// found. Otherwise . /// /// /// is . /// public bool ReadPage (Page page) { if (page == null) throw new ArgumentNullException ("page"); ByteVector[] packets = page.Packets; for (int i = 0; i < packets.Length; i ++) { if ((page.Header.Flags & PageFlags.FirstPacketContinued) == 0 && previous_packet != null) { if (ReadPacket (previous_packet)) return true; previous_packet = null; } ByteVector packet = packets [i]; // If we're at the first packet of the page, and // we're continuing an old packet, combine the // old with the new. if (i == 0 && (page.Header.Flags & PageFlags.FirstPacketContinued) != 0 && previous_packet != null) { previous_packet.Add (packet); packet = previous_packet; } previous_packet = null; if (i == packets.Length - 1) { // If we're at the last packet of the // page, store it. previous_packet = new ByteVector (packet); } else if (ReadPacket (packet)) { // Otherwise, we need to process it. return true; } } return false; } /// /// Gets the duration of the stream represented by the /// current instance. /// /// /// A value containing the absolute /// granular position of the last page in the bitstream. /// /// /// A object containing the duration /// of the stream represented by the current instance. /// public TimeSpan GetDuration (long lastAbsoluteGranularPosition) { return codec.GetDuration ( first_absolute_granular_position, lastAbsoluteGranularPosition); } #endregion #region Public Properties /// /// Gets the codec object used to interpret the stream /// represented by the current instance. /// /// /// The object used by the current /// instance. /// public Codec Codec { get {return codec;} } #endregion #region Public Properties /// /// Sents a packet to the codec processor to read it. /// /// /// A object containing the next /// packet in the stream. /// /// /// if the codec has read all the /// necessary packets for the stream and does not need to be /// called again, typically once the Xiph comment has been /// found. Otherwise . /// private bool ReadPacket (ByteVector packet) { return codec.ReadPacket (packet, packet_index++); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/XiphComment.cs0000644000175000017500000010725211442021373021424 0ustar00alexalex00000000000000// // XiphComment.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // xiphcomment.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections; using System.Collections.Generic; using System.Globalization; namespace TagLib.Ogg { /// /// This class extends and implements to provide /// support for reading and writing Xiph comments. /// public class XiphComment : TagLib.Tag, IEnumerable { #region Private Fields /// /// Contains the comment fields. /// private Dictionary field_list = new Dictionary (); /// /// Contains the ventor ID. /// private string vendor_id; /// /// Contains the field identifier to use for . /// private string comment_field = "DESCRIPTION"; #endregion #region Constructors /// /// Constructs and initializes a new instance of with no contents. /// public XiphComment () { } /// /// Constructs and initializes a new instance of by reading the contents of a raw /// Xiph Comment from a object. /// /// /// A object containing a raw Xiph /// comment. /// /// /// is . /// public XiphComment (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); Parse (data); } #endregion #region Public Methods /// /// Gets the field data for a given field identifier. /// /// /// A object containing the field /// identifier. /// /// /// A containing the field data or an /// empty array if the field was not found. /// /// /// is . /// public string [] GetField (string key) { if (key == null) throw new ArgumentNullException ("key"); key = key.ToUpper (CultureInfo.InvariantCulture); if (!field_list.ContainsKey (key)) return new string [0]; return (string []) field_list [key].Clone (); } /// /// Gets the first field for a given field identifier. /// /// /// A object containing the field /// identifier. /// /// /// A containing the field data or if the field was not found. /// /// /// is . /// public string GetFirstField (string key) { if (key == null) throw new ArgumentNullException ("key"); string [] values = GetField (key); return (values.Length > 0) ? values [0] : null; } /// /// Sets the contents of a specified field to a number. /// /// /// A object containing the field /// identifier. /// /// /// A value to set the field to. /// /// /// is . /// public void SetField (string key, uint number) { if (key == null) throw new ArgumentNullException ("key"); if (number == 0) RemoveField (key); else SetField (key, number.ToString ( CultureInfo.InvariantCulture)); } /// /// Sets the contents of a specified field to the contents of /// a . /// /// /// A object containing the field /// identifier. /// /// /// A containing the values to store /// in the current instance. /// /// /// is . /// public void SetField (string key, params string [] values) { if (key == null) throw new ArgumentNullException ("key"); key = key.ToUpper (CultureInfo.InvariantCulture); if (values == null || values.Length == 0) { RemoveField (key); return; } List result = new List (); foreach (string text in values) if (text != null && text.Trim ().Length != 0) result.Add (text); if (result.Count == 0) RemoveField (key); else if (field_list.ContainsKey (key)) field_list [key] = result.ToArray (); else field_list.Add (key, result.ToArray ()); } /// /// Removes a field and all its values from the current /// instance. /// /// /// A object containing the field /// identifier. /// /// /// is . /// public void RemoveField (string key) { if (key == null) throw new ArgumentNullException ("key"); key = key.ToUpper (CultureInfo.InvariantCulture); field_list.Remove (key); } /// /// Renders the current instance as a raw Xiph comment, /// optionally adding a framing bit. /// /// /// If , a framing bit will be added to /// the end of the content. /// /// /// A object containing the rendered /// version of the current instance. /// public ByteVector Render (bool addFramingBit) { ByteVector data = new ByteVector (); // Add the vendor ID length and the vendor ID. It's // important to use the length of the data(String::UTF8) // rather than the lenght of the the string since this // is UTF8 text and there may be more characters in the // data than in the UTF16 string. ByteVector vendor_data = ByteVector.FromString ( vendor_id, StringType.UTF8); data.Add (ByteVector.FromUInt ((uint) vendor_data.Count, false)); data.Add (vendor_data); // Add the number of fields. data.Add (ByteVector.FromUInt (FieldCount, false)); foreach (KeyValuePair entry in field_list) { // And now iterate over the values of the // current list. foreach (string value in entry.Value) { ByteVector field_data = ByteVector.FromString ( entry.Key, StringType.UTF8); field_data.Add ((byte) '='); field_data.Add (ByteVector.FromString ( value, StringType.UTF8)); data.Add (ByteVector.FromUInt ((uint) field_data.Count, false)); data.Add (field_data); } } // Append the "framing bit". if (addFramingBit) data.Add ((byte) 1); return data; } #endregion #region Public Properties /// /// Gets the number of fields contained in the current /// instance. /// /// /// A value containing the number of /// fields in the current instance. /// public uint FieldCount { get { uint count = 0; foreach (string [] values in field_list.Values) count += (uint) values.Length; return count; } } /// /// Gets the vendor ID for the current instance. /// /// /// A object containing the vendor ID /// for current instance. /// public string VendorId { get {return vendor_id;} } #endregion #region Protected Methods /// /// Populates and initializes a new instance of by reading the contents of a raw /// Xiph Comment from a object. /// /// /// A object containing a raw Xiph /// comment. /// /// /// is . /// protected void Parse (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); // The first thing in the comment data is the vendor ID // length, followed by a UTF8 string with the vendor ID. int pos = 0; int vendor_length = (int) data.Mid (pos, 4) .ToUInt (false); pos += 4; vendor_id = data.ToString (StringType.UTF8, pos, vendor_length); pos += vendor_length; // Next the number of fields in the comment vector. int comment_fields = (int) data.Mid (pos, 4) .ToUInt (false); pos += 4; for(int i = 0; i < comment_fields; i++) { // Each comment field is in the format // "KEY=value" in a UTF8 string and has 4 bytes // before the text starts that gives the length. int comment_length = (int) data.Mid (pos, 4) .ToUInt (false); pos += 4; string comment = data.ToString (StringType.UTF8, pos, comment_length); pos += comment_length; int comment_separator_position = comment .IndexOf ('='); if (comment_separator_position < 0) continue; string key = comment.Substring (0, comment_separator_position) .ToUpper ( CultureInfo.InvariantCulture); string value = comment.Substring ( comment_separator_position + 1); string [] values; if (field_list.TryGetValue (key, out values)) { Array.Resize (ref values, values.Length + 1); values [values.Length - 1] = value; field_list [key] = values; } else { SetField (key, value); } } } #endregion #region IEnumerable /// /// Gets an enumerator for enumerating through the the field /// identifiers. /// /// /// A for /// enumerating through the field identifiers. /// public IEnumerator GetEnumerator () { return field_list.Keys.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return field_list.Keys.GetEnumerator(); } #endregion #region TagLib.Tag /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get {return TagTypes.Xiph;} } /// /// Gets and sets the title for the media described by the /// current instance. /// /// /// A object containing the title for /// the media described by the current instance or if no value is present. /// /// /// This property is implemented using the "TITLE" field. /// public override string Title { get {return GetFirstField ("TITLE");} set {SetField ("TITLE", value);} } /// /// Gets and sets the sort names for the Track Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Track Title of the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "TITLESORT" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string TitleSort { get {return GetFirstField ("TITLESORT");} set {SetField ("TITLESORT", value);} } /// /// Gets and sets the performers or artists who performed in /// the media described by the current instance. /// /// /// A containing the performers or /// artists who performed in the media described by the /// current instance or an empty array if no value is /// present. /// /// /// This property is implemented using the "ARTIST" field. /// public override string [] Performers { get {return GetField ("ARTIST");} set {SetField ("ARTIST", value);} } /// /// Gets and sets the sort names of the performers or artists /// who performed in the media described by the current instance. /// /// /// A containing the sort names for /// the performers or artists who performed in the media /// described by the current instance, or an empty array if /// no value is present. /// /// /// This property is implemented using the "ARTISTSORT" field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string [] PerformersSort { get {return GetField ("ARTISTSORT");} set {SetField ("ARTISTSORT", value);} } /// /// Gets and sets the band or artist who is credited in the /// creation of the entire album or collection containing the /// media described by the current instance. /// /// /// A containing the band or artist /// who is credited in the creation of the entire album or /// collection containing the media described by the current /// instance or an empty array if no value is present. /// /// /// This property is implemented using the "ALBUMARTIST" /// field. /// public override string [] AlbumArtists { get { // First try to get AlbumArtist, if that comment is not present try: // ENSEMBLE: set by TAG & RENAME // ALBUM ARTIST: set by The GodFather string[] value = GetField("ALBUMARTIST"); if (value != null && value.Length > 0) return value; value = GetField("ALBUM ARTIST"); if (value != null && value.Length > 0) return value; return GetField ("ENSEMBLE"); } set {SetField ("ALBUMARTIST", value);} } /// /// Gets and sets the sort names for the band or artist who /// is credited in the creation of the entire album or /// collection containing the media described by the /// current instance. /// /// /// A containing the sort names /// for the band or artist who is credited in the creation /// of the entire album or collection containing the media /// described by the current instance or an empty array if /// no value is present. /// /// /// This property is implemented using the "ALBUMARTISTSORT" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string [] AlbumArtistsSort { get {return GetField ("ALBUMARTISTSORT");} set {SetField ("ALBUMARTISTSORT", value);} } /// /// Gets and sets the composers of the media represented by /// the current instance. /// /// /// A containing the composers of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "COMPOSER" field. /// public override string [] Composers { get {return GetField ("COMPOSER");} set {SetField ("COMPOSER", value);} } /// /// Gets and sets the sort names for the composers of /// the media described by the current instance. /// /// /// A containing the sort names /// for the composer of the media described by the current /// instance or an empty array if no value is present. /// /// /// This property is implemented using the "COMPOSERSORT" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string [] ComposersSort { get {return GetField ("COMPOSERSORT");} set {SetField ("COMPOSERSORT", value);} } /// /// Gets and sets the album of the media represented by the /// current instance. /// /// /// A object containing the album of /// the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "ALBUM" field. /// public override string Album { get {return GetFirstField ("ALBUM");} set {SetField ("ALBUM", value);} } /// /// Gets and sets the sort names for the Album Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Album Title of the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "ALBUMSORT" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string AlbumSort { get {return GetFirstField ("ALBUMSORT");} set {SetField ("ALBUMSORT", value);} } /// /// Gets and sets a user comment on the media represented by /// the current instance. /// /// /// A object containing user comments /// on the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "COMMENT" or /// "DESCRIPTION" field, preferring "DESCRIPTION" but using /// "COMMENT" if that is the field used by the comment. /// public override string Comment { get { string value = GetFirstField (comment_field); if (value != null || comment_field == "COMMENT") return value; comment_field = "COMMENT"; return GetFirstField (comment_field); } set {SetField (comment_field, value);} } /// /// Gets and sets the genres of the media represented by the /// current instance. /// /// /// A containing the genres of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "GENRE" field. /// public override string [] Genres { get {return GetField ("GENRE");} set {SetField ("GENRE", value);} } /// /// Gets and sets the year that the media represented by the /// current instance was recorded. /// /// /// A containing the year that the media /// represented by the current instance was created or zero /// if no value is present. /// /// /// This property is implemented using the "DATE" field. If a /// value greater than 9999 is set, this property will be /// cleared. /// public override uint Year { get { string text = GetFirstField ("DATE"); uint value; return (text != null && uint.TryParse ( text.Length > 4 ? text.Substring (0, 4) : text, out value)) ? value : 0; } set {SetField ("DATE", value);} } /// /// Gets and sets the position of the media represented by /// the current instance in its containing album. /// /// /// A containing the position of the /// media represented by the current instance in its /// containing album or zero if not specified. /// /// /// This property is implemented using the "TRACKNUMER" /// field. /// public override uint Track { get { string text = GetFirstField ("TRACKNUMBER"); string [] values; uint value; if (text != null && (values = text.Split ('/')) .Length > 0 && uint.TryParse ( values [0], out value)) return value; return 0; } set { SetField ("TRACKTOTAL", TrackCount); SetField ("TRACKNUMBER", value); } } /// /// Gets and sets the number of tracks in the album /// containing the media represented by the current instance. /// /// /// A containing the number of tracks in /// the album containing the media represented by the current /// instance or zero if not specified. /// /// /// This property is implemented using the "TRACKTOTAL" field /// but is capable of reading from "TRACKNUMBER" if the total /// is stored in {track}/{count} format. /// public override uint TrackCount { get { string text; string [] values; uint value; if ((text = GetFirstField ("TRACKTOTAL")) != null && uint.TryParse (text, out value)) return value; if ((text = GetFirstField ("TRACKNUMBER")) != null && (values = text.Split ('/')) .Length > 1 && uint.TryParse ( values [1], out value)) return value; return 0; } set {SetField ("TRACKTOTAL", value);} } /// /// Gets and sets the number of the disc containing the media /// represented by the current instance in the boxed set. /// /// /// A containing the number of the disc /// containing the media represented by the current instance /// in the boxed set. /// /// /// This property is implemented using the "DISCNUMBER" /// field. /// public override uint Disc { get { string text = GetFirstField ("DISCNUMBER"); string [] values; uint value; if (text != null && (values = text.Split ('/')) .Length > 0 && uint.TryParse ( values [0], out value)) return value; return 0; } set { SetField ("DISCTOTAL", DiscCount); SetField ("DISCNUMBER", value); } } /// /// Gets and sets the number of discs in the boxed set /// containing the media represented by the current instance. /// /// /// A containing the number of discs in /// the boxed set containing the media represented by the /// current instance or zero if not specified. /// /// /// This property is implemented using the "DISCTOTAL" field /// but is capable of reading from "DISCNUMBER" if the total /// is stored in {disc}/{count} format. /// public override uint DiscCount { get { string text; string [] values; uint value; if ((text = GetFirstField ("DISCTOTAL")) != null && uint.TryParse (text, out value)) return value; if ((text = GetFirstField ("DISCNUMBER")) != null && (values = text.Split ('/')) .Length > 1 && uint.TryParse ( values [1], out value)) return value; return 0; } set {SetField ("DISCTOTAL", value);} } /// /// Gets and sets the lyrics or script of the media /// represented by the current instance. /// /// /// A object containing the lyrics or /// script of the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "LYRICS" field. /// public override string Lyrics { get {return GetFirstField ("LYRICS");} set {SetField ("LYRICS", value);} } /// /// Gets and sets the grouping on the album which the media /// in the current instance belongs to. /// /// /// A object containing the grouping on /// the album which the media in the current instance belongs /// to or if no value is present. /// /// /// This property is implemented using the "GROUPING" field. /// public override string Grouping { get {return GetFirstField ("GROUPING");} set {SetField ("GROUPING", value);} } /// /// Gets and sets the number of beats per minute in the audio /// of the media represented by the current instance. /// /// /// A containing the number of beats per /// minute in the audio of the media represented by the /// current instance, or zero if not specified. /// /// /// This property is implemented using the "TEMPO" field. /// public override uint BeatsPerMinute { get { string text = GetFirstField ("TEMPO"); double value; return (text != null && double.TryParse (text, out value) && value > 0) ? (uint) Math.Round (value) : 0; } set {SetField ("TEMPO", value);} } /// /// Gets and sets the conductor or director of the media /// represented by the current instance. /// /// /// A object containing the conductor /// or director of the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "CONDUCTOR" field. /// public override string Conductor { get {return GetFirstField ("CONDUCTOR");} set {SetField ("CONDUCTOR", value);} } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "COPYRIGHT" field. /// public override string Copyright { get {return GetFirstField ("COPYRIGHT");} set {SetField ("COPYRIGHT", value);} } /// /// Gets and sets the MusicBrainz Artist ID for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ArtistID for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_ARTISTID" field. /// public override string MusicBrainzArtistId { get {return GetFirstField ("MUSICBRAINZ_ARTISTID");} set {SetField ("MUSICBRAINZ_ARTISTID", value);} } /// /// Gets and sets the MusicBrainz Release ID for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseID for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMID" field. /// public override string MusicBrainzReleaseId { get {return GetFirstField ("MUSICBRAINZ_ALBUMID");} set {SetField ("MUSICBRAINZ_ALBUMID", value);} } /// /// Gets and sets the MusicBrainz Release Artist ID for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseArtistID for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMARTISTID" field. /// public override string MusicBrainzReleaseArtistId { get {return GetFirstField ("MUSICBRAINZ_ALBUMARTISTID");} set {SetField ("MUSICBRAINZ_ALBUMARTISTID", value);} } /// /// Gets and sets the MusicBrainz Track ID for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// TrackID for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_TRACKID" field. /// public override string MusicBrainzTrackId { get {return GetFirstField ("MUSICBRAINZ_TRACKID");} set {SetField ("MUSICBRAINZ_TRACKID", value);} } /// /// Gets and sets the MusicBrainz Disc ID for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// DiscID for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_DISCID" field. /// public override string MusicBrainzDiscId { get {return GetFirstField ("MUSICBRAINZ_DISCID");} set {SetField ("MUSICBRAINZ_DISCID", value);} } /// /// Gets and sets the MusicIP PUID for the media /// represented by the current instance. /// /// /// A object containing the MusicIP PUID /// for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICIP_PUID" field. /// public override string MusicIpId { get {return GetFirstField ("MUSICIP_PUID");} set {SetField ("MUSICIP_PUID", value);} } /// /// Gets and sets the Amazon ID for the media /// represented by the current instance. /// /// /// A object containing the AmazonID /// for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "ASIN" field. /// public override string AmazonId { get {return GetFirstField ("ASIN");} set {SetField ("ASIN", value);} } /// /// Gets and sets the MusicBrainz Release Status for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseStatus for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMSTATUS" field. /// public override string MusicBrainzReleaseStatus { get {return GetFirstField ("MUSICBRAINZ_ALBUMSTATUS");} set {SetField ("MUSICBRAINZ_ALBUMSTATUS", value);} } /// /// Gets and sets the MusicBrainz Release Type for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseType for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMTYPE" field. /// public override string MusicBrainzReleaseType { get {return GetFirstField ("MUSICBRAINZ_ALBUMTYPE");} set {SetField ("MUSICBRAINZ_ALBUMTYPE", value);} } /// /// Gets and sets the MusicBrainz Release Country for the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseCountry for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "RELEASECOUNTRY" field. /// public override string MusicBrainzReleaseCountry { get {return GetFirstField ("RELEASECOUNTRY");} set {SetField ("RELEASECOUNTRY", value);} } /// /// Gets and sets a collection of pictures associated with /// the media represented by the current instance. /// /// /// A containing a collection of /// pictures associated with the media represented by the /// current instance or an empty array if none are present. /// /// /// This property is implemented using the COVERART /// field. /// public override IPicture [] Pictures { get { string[] covers = GetField ("COVERART"); IPicture[] pictures = new Picture[covers.Length]; for (int ii = 0; ii < covers.Length; ii++) { ByteVector data = new ByteVector (Convert.FromBase64String (covers[ii])); pictures[ii] = new Picture (data); } return pictures; } set { string[] covers = new string[value.Length]; for (int ii = 0; ii < value.Length; ii++) { IPicture old = value[ii]; covers[ii] = Convert.ToBase64String (old.Data.Data); } SetField ("COVERART", covers); } } /// /// Gets and sets whether or not the album described by the /// current instance is a compilation. /// /// /// A value indicating whether or not the /// album described by the current instance is a compilation. /// /// /// This property is implemented using the "COMPILATION" field. /// public bool IsCompilation { get { string text; int value; if ((text = GetFirstField ("COMPILATION")) != null && int.TryParse (text, out value)) { return value == 1; } return false; } set { if (value) { SetField ("COMPILATION", "1"); } else { RemoveField ("COMPILATION"); } } } /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance does not /// any values. Otherwise . /// public override bool IsEmpty { get { foreach (string [] values in field_list.Values) if (values.Length != 0) return false; return true; } } /// /// Clears the values stored in the current instance. /// public override void Clear () { field_list.Clear (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/Codecs/0000755000175000017500000000000011774620112020037 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Ogg/Codecs/Vorbis.cs0000644000175000017500000002314011442021373021626 0ustar00alexalex00000000000000// // Vorbis.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Ogg.Codecs { /// /// This class extends and implements to provide support for processing Ogg /// Vorbis bitstreams. /// public class Vorbis : Codec, IAudioCodec { #region Private Static Fields /// /// Contains the file identifier. /// private static ByteVector id = "vorbis"; #endregion #region Private Fields /// /// Contains the header packet. /// private HeaderPacket header; /// /// Contains the comment data. /// private ByteVector comment_data; #endregion #region Constructors /// /// Constructs and initializes a new instance of . /// private Vorbis () { } #endregion #region Public Methods /// /// Reads a Ogg packet that has been encountered in the /// stream. /// /// /// A object containing a packet to /// be read by the current instance. /// /// /// A value containing the index of the /// packet in the stream. /// /// /// if the codec has read all the /// necessary packets for the stream and does not need to be /// called again, typically once the Xiph comment has been /// found. Otherwise . /// /// /// is . /// /// /// is less than zero. /// /// /// The data does not conform to the specificiation for the /// codec represented by the current instance. /// public override bool ReadPacket (ByteVector packet, int index) { if (packet == null) throw new ArgumentNullException ("packet"); if (index < 0) throw new ArgumentOutOfRangeException ("index", "index must be at least zero."); int type = PacketType (packet); if (type != 1 && index == 0) throw new CorruptFileException ( "Stream does not begin with vorbis header."); if (comment_data == null) { if (type == 1) header = new HeaderPacket (packet); else if (type == 3) comment_data = packet.Mid (7); else return true; } return comment_data != null; } /// /// Computes the duration of the stream using the first and /// last granular positions of the stream. /// /// /// A value containing the first granular /// position of the stream. /// /// /// A value containing the last granular /// position of the stream. /// /// /// A value containing the duration /// of the stream. /// public override TimeSpan GetDuration (long firstGranularPosition, long lastGranularPosition) { return header.sample_rate == 0 ? TimeSpan.Zero : TimeSpan.FromSeconds ((double) (lastGranularPosition - firstGranularPosition) / (double) header.sample_rate); } /// /// Replaces the comment packet in a collection of packets /// with the rendered version of a Xiph comment or inserts a /// comment packet if the stream lacks one. /// /// /// A object containing /// a collection of packets. /// /// /// A object to store the rendered /// version of in . /// /// /// or is . /// public override void SetCommentPacket (ByteVectorCollection packets, XiphComment comment) { if (packets == null) throw new ArgumentNullException ("packets"); if (comment == null) throw new ArgumentNullException ("comment"); ByteVector data = new ByteVector ((byte) 0x03); data.Add (id); data.Add (comment.Render (true)); if (packets.Count > 1 && PacketType (packets [1]) == 0x03) packets [1] = data; else packets.Insert (1, data); } #endregion #region Public Properties /// /// Gets the bitrate of the audio represented by the current /// instance. /// /// /// A value containing a bitrate of the /// audio represented by the current instance. /// public int AudioBitrate { get { return (int) ((float)header.bitrate_nominal / 1000f + 0.5); } } /// /// Gets the sample rate of the audio represented by the /// current instance. /// /// /// A value containing the sample rate of /// the audio represented by the current instance. /// public int AudioSampleRate { get {return (int) header.sample_rate;} } /// /// Gets the number of channels in the audio represented by /// the current instance. /// /// /// A value containing the number of /// channels in the audio represented by the current /// instance. /// public int AudioChannels { get {return (int) header.channels;} } /// /// Gets the types of media represented by the current /// instance. /// /// /// Always . /// public override MediaTypes MediaTypes { get {return MediaTypes.Audio;} } /// /// Gets the raw Xiph comment data contained in the codec. /// /// /// A object containing a raw Xiph /// comment or if none was found. /// public override ByteVector CommentData { get {return comment_data;} } /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public override string Description { get { return string.Format ( "Vorbis Version {0} Audio", header.vorbis_version); } } #endregion #region Public Static Methods /// /// Implements the delegate to /// provide support for recognizing a Vorbis stream from the /// header packet. /// /// /// A object containing the stream /// header packet. /// /// /// A object containing a codec capable /// of parsing the stream of if the /// stream is not a Vorbis stream. /// public static Codec FromPacket (ByteVector packet) { return (PacketType (packet) == 1) ? new Vorbis () : null; } #endregion #region Private Static Methods /// /// Gets the packet type for a specified Vorbis packet. /// /// /// A object containing a Vorbis /// packet. /// /// /// A value containing the packet type or /// -1 if the packet is invalid. /// private static int PacketType (ByteVector packet) { if (packet.Count <= id.Count) return -1; for (int i = 0; i < id.Count; i ++) if (packet [i + 1] != id [i]) return -1; return packet [0]; } #endregion /// /// This structure represents a Vorbis header packet. /// private struct HeaderPacket { public uint sample_rate; public uint channels; public uint vorbis_version; public uint bitrate_maximum; public uint bitrate_nominal; public uint bitrate_minimum; public HeaderPacket (ByteVector data) { vorbis_version = data.Mid(7, 4).ToUInt (false); channels = data [11]; sample_rate = data.Mid(12, 4).ToUInt (false); bitrate_maximum = data.Mid(16, 4).ToUInt (false); bitrate_nominal = data.Mid(20, 4).ToUInt (false); bitrate_minimum = data.Mid(24, 4).ToUInt (false); } } } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/Codecs/Theora.cs0000644000175000017500000002466711442021373021623 0ustar00alexalex00000000000000// // Theora.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Ogg.Codecs { /// /// This class extends and implements to provide support for processing Ogg /// Theora bitstreams. /// public class Theora : Codec, IVideoCodec { #region Private Static Fields /// /// Contains the file identifier. /// private static ByteVector id = "theora"; #endregion #region Private Fields /// /// Contains the header packet. /// private HeaderPacket header; /// /// Contains the comment data. /// private ByteVector comment_data; #endregion #region Constructors /// /// Constructs and initializes a new instance of . /// private Theora () { } #endregion #region Public Methods /// /// Reads a Ogg packet that has been encountered in the /// stream. /// /// /// A object containing a packet to /// be read by the current instance. /// /// /// A value containing the index of the /// packet in the stream. /// /// /// if the codec has read all the /// necessary packets for the stream and does not need to be /// called again, typically once the Xiph comment has been /// found. Otherwise . /// /// /// is . /// /// /// is less than zero. /// /// /// The data does not conform to the specificiation for the /// codec represented by the current instance. /// public override bool ReadPacket (ByteVector packet, int index) { if (packet == null) throw new ArgumentNullException ("packet"); if (index < 0) throw new ArgumentOutOfRangeException ("index", "index must be at least zero."); int type = PacketType (packet); if (type != 0x80 && index == 0) throw new CorruptFileException ( "Stream does not begin with theora header."); if (comment_data == null) { if (type == 0x80) header = new HeaderPacket (packet); else if (type == 0x81) comment_data = packet.Mid (7); else return true; } return comment_data != null; } /// /// Computes the duration of the stream using the first and /// last granular positions of the stream. /// /// /// A value containing the first granular /// position of the stream. /// /// /// A value containing the last granular /// position of the stream. /// /// /// A value containing the duration /// of the stream. /// public override TimeSpan GetDuration (long firstGranularPosition, long lastGranularPosition) { return TimeSpan.FromSeconds ( header.GranuleTime (lastGranularPosition) - header.GranuleTime (firstGranularPosition)); } /// /// Replaces the comment packet in a collection of packets /// with the rendered version of a Xiph comment or inserts a /// comment packet if the stream lacks one. /// /// /// A object containing /// a collection of packets. /// /// /// A object to store the rendered /// version of in . /// /// /// or is . /// public override void SetCommentPacket (ByteVectorCollection packets, XiphComment comment) { if (packets == null) throw new ArgumentNullException ("packets"); if (comment == null) throw new ArgumentNullException ("comment"); ByteVector data = new ByteVector ((byte) 0x81); data.Add (id); data.Add (comment.Render (true)); if (packets.Count > 1 && PacketType (packets [1]) == 0x81) packets [1] = data; else packets.Insert (1, data); } #endregion #region Public Properties /// /// Gets the width of the video represented by the current /// instance. /// /// /// A value containing the width of the /// video represented by the current instance. /// public int VideoWidth { get {return header.width;} } /// /// Gets the height of the video represented by the current /// instance. /// /// /// A value containing the height of the /// video represented by the current instance. /// public int VideoHeight { get {return header.height;} } /// /// Gets the types of media represented by the current /// instance. /// /// /// Always . /// public override MediaTypes MediaTypes { get {return MediaTypes.Video;} } /// /// Gets the raw Xiph comment data contained in the codec. /// /// /// A object containing a raw Xiph /// comment or if none was found. /// public override ByteVector CommentData { get {return comment_data;} } /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public override string Description { get { return string.Format ( "Theora Version {0}.{1} Video", header.major_version, header.minor_version); } } #endregion #region Public Static Methods /// /// Implements the delegate to /// provide support for recognizing a Theora stream from the /// header packet. /// /// /// A object containing the stream /// header packet. /// /// /// A object containing a codec capable /// of parsing the stream of if the /// stream is not a Theora stream. /// public static Codec FromPacket (ByteVector packet) { return (PacketType (packet) == 0x80) ? new Theora () : null; } #endregion #region Private Static Methods /// /// Gets the packet type for a specified Theora packet. /// /// /// A object containing a Theora /// packet. /// /// /// A value containing the packet type or /// -1 if the packet is invalid. /// private static int PacketType (ByteVector packet) { if (packet.Count <= id.Count || packet [0] < 0x80) return -1; for (int i = 0; i < id.Count; i ++) if (packet [i + 1] != id [i]) return -1; return packet [0]; } #endregion /// /// This structure represents a Theora header packet. /// private struct HeaderPacket { public byte major_version; public byte minor_version; public byte revision_version; public int width; public int height; public int fps_numerator; public int fps_denominator; public int keyframe_granule_shift; public HeaderPacket (ByteVector data) { major_version = data [7]; minor_version = data [8]; revision_version = data [9]; // width = data.Mid (10, 2).ToShort () << 4; // height = data.Mid (12, 2).ToShort () << 4; width = (int) data.Mid (14, 3).ToUInt (); // Frame Width. height = (int) data.Mid (17, 3).ToUInt (); // Frame Height. // Offset X. // Offset Y. fps_numerator = (int) data.Mid (22, 4).ToUInt (); fps_denominator = (int) data.Mid (26, 4).ToUInt (); // Aspect Numerator. // Aspect Denominator. // Colorspace. // Target bitrate. ushort last_bits = data.Mid (40, 2).ToUShort (); keyframe_granule_shift = (last_bits >> 5) & 0x1F; } /// /// Converts an absolute granular position into a /// seconds. /// /// /// A value containing the /// absolute granular position. /// /// /// A value containing the time /// at in /// seconds. /// /// Many thanks to the good people at /// irc://irc.freenode.net#theora for making this /// code a reality. /// public double GranuleTime (long granularPosition) { long iframe = granularPosition >> keyframe_granule_shift; long pframe = granularPosition - (iframe << keyframe_granule_shift); return (iframe + pframe) * ((double) fps_denominator / (double) fps_numerator); } } } }taglib-sharp-2.1.0.0/src/TagLib/Ogg/Page.cs0000644000175000017500000002063211442021373020041 0ustar00alexalex00000000000000// // PageHeader.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // oggpage.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Ogg { /// /// This class provides a representation of an Ogg page. /// public class Page { #region Private Properties /// /// Contains the page header. /// private PageHeader header; /// /// Contains the packets. /// private ByteVectorCollection packets; #endregion #region Constructors /// /// Constructs and intializes a new instance of with a specified header and no packets. /// /// /// A object to use as the header of /// the new instance. /// protected Page (PageHeader header) { this.header = header; packets = new ByteVectorCollection (); } /// /// Constructs and initializes a new instance of by reading a raw Ogg page from a specified /// position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The Ogg identifier could not be found at the correct /// location. /// public Page (File file, long position) : this (new PageHeader (file, position)) { file.Seek (position + header.Size); foreach (int packet_size in header.PacketSizes) packets.Add (file.ReadBlock (packet_size)); } /// /// Constructs and initializes a new instance of with a specified header and packets. /// /// /// A object containing /// packets to use for the new instance. /// /// /// A object to use as the header of /// the new instance. /// /// /// is . /// public Page (ByteVectorCollection packets, PageHeader header) : this (header) { if (packets == null) throw new ArgumentNullException ("packets"); this.packets = new ByteVectorCollection (packets); List packet_sizes = new List (); // Build a page from the list of packets. foreach (ByteVector v in packets) packet_sizes.Add (v.Count); header.PacketSizes = packet_sizes.ToArray (); } #endregion #region Public Methods /// /// Renders the current instance as a raw Ogg page. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render () { ByteVector data = header.Render (); foreach (ByteVector v in packets) data.Add (v); // Compute and set the checksum for the Ogg page. The // checksum is taken over the entire page with the 4 // bytes reserved for the checksum zeroed and then // inserted in bytes 22-25 of the page header. ByteVector checksum = ByteVector.FromUInt ( data.Checksum, false); for (int i = 0; i < 4; i++) data [i + 22] = checksum [i]; return data; } #endregion #region Public Properties /// /// Gets the header of the current instance. /// /// /// A object that applies to the /// current instance. /// public PageHeader Header { get {return header;} } /// /// Gets the packets contained in the current instance. /// /// /// A containing the packets /// contained in the current instance. /// public ByteVector[] Packets { get {return packets.ToArray ();} } /// /// Gets the total size of the current instance as it /// appeared on disk. /// /// /// A value containing the size of the /// page, including the header, as it appeared on disk. /// public uint Size { get {return header.Size + header.DataSize;} } #endregion #region Public Static Methods /// /// Overwrites all page headers in a file starting at a /// specified position, shifting the page sequence numbers /// a set amount. /// /// /// A object containing the file to /// update. /// /// /// A value specify at what position to /// start updating. /// /// /// A object where the key is the serial number of the /// stream to update and the value is the amount to offset /// the page sequence numbers in the stream. /// /// /// or is . /// /// /// When the number of pages in a stream changes, all /// subsequent pages in the stream need to have their page /// sequence number update in order to remain valid. /// Additionally, when the page sequence number changes, the /// page needs to have its checksum recomputed. This makes /// for a costly recalculation if large comment data is /// added. /// public static void OverwriteSequenceNumbers (File file, long position, IDictionary shiftTable) { if (file == null) throw new ArgumentNullException ("file"); if (shiftTable == null) throw new ArgumentNullException ("shiftTable"); // Check to see if there are no changes to be made. bool done = true; foreach (KeyValuePair pair in shiftTable) if (pair.Value != 0) { done = false; break; } // If the file is fine, quit. if (done) return; while (position < file.Length - 27) { PageHeader header = new PageHeader (file, position); int size = (int) (header.Size + header.DataSize); if (shiftTable.ContainsKey (header.StreamSerialNumber) && shiftTable [header.StreamSerialNumber] != 0) { file.Seek (position); ByteVector page_data = file.ReadBlock (size); ByteVector new_data = ByteVector.FromUInt ( (uint)(header.PageSequenceNumber + shiftTable [header.StreamSerialNumber]), false); for (int i = 18; i < 22; i ++) page_data [i] = new_data [i - 18]; for (int i = 22; i < 26; i++) page_data [i] = 0; new_data.Add (ByteVector.FromUInt ( page_data.Checksum, false)); file.Seek (position + 18); file.WriteBlock (new_data); } position += size; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/GroupedComment.cs0000644000175000017500000011255211442021373022120 0ustar00alexalex00000000000000// // GroupedComment.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; namespace TagLib.Ogg { /// /// This class combines a collection of /// objects so that properties can be read from each but are only set /// to the first comment of the file. /// public class GroupedComment : Tag { #region Private Fields /// /// Contains a mapping between stream serial numbers and /// comments. /// private Dictionary comment_hash; /// /// Contains comments in the order they are added. /// private List tags; #endregion #region Constructors /// /// Constructs and initializes a new instance of with now contents. /// public GroupedComment () : base () { comment_hash = new Dictionary (); tags = new List (); } /// /// Gets an enumeration of the comments in the current /// instance, in the order they were added. /// /// /// A object enumerating through the objects contained in the current instance. /// public IEnumerable Comments { get {return tags;} } /// /// Gets a comment in the current instance for a specified /// stream. /// /// /// A value containing the serial number /// of the stream of the comment to get. /// /// /// A with the matching serial /// number. /// public XiphComment GetComment (uint streamSerialNumber) { return comment_hash [streamSerialNumber]; } /// /// Adds a Xiph comment to the current instance. /// /// /// A value containing the serial number /// of the stream containing the comment. /// /// /// A object to add to the current /// instance. /// public void AddComment (uint streamSerialNumber, XiphComment comment) { comment_hash.Add (streamSerialNumber, comment); tags.Add (comment); } /// /// Adds a Xiph comment to the current instance. /// /// /// A value containing the serial number /// of the stream containing the comment. /// /// /// A object containing the raw Xiph /// comment to add to the current instance. /// public void AddComment (uint streamSerialNumber, ByteVector data) { AddComment (streamSerialNumber, new XiphComment (data)); } #endregion #region TagLib.Tag /// /// Gets the tag types contained in the current instance. /// /// /// A bitwise combined /// containing the tag types contained in the current /// instance. /// /// /// This value contains a bitwise combined value from all the /// child tags. /// /// public override TagTypes TagTypes { get { TagTypes types = TagTypes.None; foreach (XiphComment tag in tags) if (tag != null) types |= tag.TagTypes; return types; } } /// /// Gets and sets the title for the media described by the /// current instance. /// /// /// A object containing the title for /// the media described by the current instance or if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Title { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Title; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Title = value; } } /// /// Gets and sets the sort names for the individual track title of /// the media described by the current instance. /// /// /// A containing the sort name /// for the track title of the media described by the current /// instance or null if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string TitleSort { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.TitleSort; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].TitleSort = value;} } /// /// Gets and sets the performers or artists who performed in /// the media described by the current instance. /// /// /// A array containing the performers or /// artists who performed in the media described by the /// current instance or an empty array if no value is /// present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string[] Performers { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.Performers; if (value != null && value.Length > 0) return value; } return new string[] { }; } set { if (tags.Count > 0) tags[0].Performers = value; } } /// /// Gets and sets the sort names of the performers or artists /// who performed in the media described by the current instance. /// /// /// A containing the sort names for /// the performers or artists who performed in the media /// described by the current instance, or an empty array if /// no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string [] PerformersSort { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.PerformersSort; if (value != null && value.Length > 0) return value; } return new string[] { }; } set {if (tags.Count > 0) tags [0].PerformersSort = value;} } /// /// Gets and sets the band or artist who is credited in the /// creation of the entire album or collection containing the /// media described by the current instance. /// /// /// A array containing the band or artist /// who is credited in the creation of the entire album or /// collection containing the media described by the current /// instance or an empty array if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string[] AlbumArtists { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.AlbumArtists; if (value != null && value.Length > 0) return value; } return new string[] { }; } set { if (tags.Count > 0) tags[0].AlbumArtists = value; } } /// /// Gets and sets the sort names for the band or artist who /// is credited in the creation of the entire album or /// collection containing the media described by the /// current instance. /// /// /// A containing the sort names /// for the band or artist who is credited in the creation /// of the entire album or collection containing the media /// described by the current instance or an empty array if /// no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string[] AlbumArtistsSort { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.AlbumArtistsSort; if (value != null && value.Length > 0) return value; } return new string[] { }; } set {if (tags.Count > 0) tags [0].AlbumArtistsSort = value;} } /// /// Gets and sets the composers of the media represented by /// the current instance. /// /// /// A array containing the composers of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string[] Composers { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.Composers; if (value != null && value.Length > 0) return value; } return new string[] { }; } set { if (tags.Count > 0) tags[0].Composers = value; } } /// /// Gets and sets the sort names for the composer of /// the media described by the current instance. /// /// /// A containing the sort names /// for the composer of the media described by the current /// instance or an empty array if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string [] ComposersSort { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.ComposersSort; if (value != null && value.Length > 0) return value; } return new string[] { }; } set {if (tags.Count > 0) tags [0].ComposersSort = value;} } /// /// Gets and sets the album of the media represented by the /// current instance. /// /// /// A object containing the album of /// the media represented by the current instance or if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Album { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Album; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Album = value; } } /// /// Gets and sets the sort names for the album title of /// the media described by the current instance. /// /// /// A containing the sort names /// for the album title of the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string AlbumSort { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.AlbumSort; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].AlbumSort = value;} } /// /// Gets and sets a user comment on the media represented by /// the current instance. /// /// /// A object containing user comments /// on the media represented by the current instance or if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Comment { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Comment; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Comment = value; } } /// /// Gets and sets the genres of the media represented by the /// current instance. /// /// /// A array containing the genres of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string[] Genres { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string[] value = tag.Genres; if (value != null && value.Length > 0) return value; } return new string[] { }; } set { if (tags.Count > 0) tags[0].Genres = value; } } /// /// Gets and sets the year that the media represented by the /// current instance was recorded. /// /// /// A containing the year that the media /// represented by the current instance was created or zero /// if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override uint Year { get { foreach (XiphComment tag in tags) if (tag != null && tag.Year != 0) return tag.Year; return 0; } set { if (tags.Count > 0) tags[0].Year = value; } } /// /// Gets and sets the position of the media represented by /// the current instance in its containing album. /// /// /// A containing the position of the /// media represented by the current instance in its /// containing album or zero if not specified. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-zero value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override uint Track { get { foreach (XiphComment tag in tags) if (tag != null && tag.Track != 0) return tag.Track; return 0; } set { if (tags.Count > 0) tags[0].Track = value; } } /// /// Gets and sets the number of tracks in the album /// containing the media represented by the current instance. /// /// /// A containing the number of tracks in /// the album containing the media represented by the current /// instance or zero if not specified. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-zero value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override uint TrackCount { get { foreach (XiphComment tag in tags) if (tag != null && tag.TrackCount != 0) return tag.TrackCount; return 0; } set { if (tags.Count > 0) tags[0].TrackCount = value; } } /// /// Gets and sets the number of the disc containing the media /// represented by the current instance in the boxed set. /// /// /// A containing the number of the disc /// containing the media represented by the current instance /// in the boxed set. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-zero value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override uint Disc { get { foreach (XiphComment tag in tags) if (tag != null && tag.Disc != 0) return tag.Disc; return 0; } set { if (tags.Count > 0) tags[0].Disc = value; } } /// /// Gets and sets the number of discs in the boxed set /// containing the media represented by the current instance. /// /// /// A containing the number of discs in /// the boxed set containing the media represented by the /// current instance or zero if not specified. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-zero value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override uint DiscCount { get { foreach (XiphComment tag in tags) if (tag != null && tag.DiscCount != 0) return tag.DiscCount; return 0; } set { if (tags.Count > 0) tags[0].DiscCount = value; } } /// /// Gets and sets the lyrics or script of the media /// represented by the current instance. /// /// /// A object containing the lyrics or /// script of the media represented by the current instance /// or if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Lyrics { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Lyrics; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Lyrics = value; } } /// /// Gets and sets the grouping on the album which the media /// in the current instance belongs to. /// /// /// A object containing the grouping on /// the album which the media in the current instance belongs /// to or if no value is present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Grouping { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Grouping; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Grouping = value; } } /// /// Gets and sets the number of beats per minute in the audio /// of the media represented by the current instance. /// /// /// A containing the number of beats per /// minute in the audio of the media represented by the /// current instance, or zero if not specified. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-zero value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override uint BeatsPerMinute { get { foreach (XiphComment tag in tags) if (tag != null && tag.BeatsPerMinute != 0) return tag.BeatsPerMinute; return 0; } set { if (tags.Count > 0) tags[0].BeatsPerMinute = value; } } /// /// Gets and sets the conductor or director of the media /// represented by the current instance. /// /// /// A object containing the conductor /// or director of the media represented by the current /// instance or if no value present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Conductor { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Conductor; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Conductor = value; } } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non- value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string Copyright { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.Copyright; if (value != null && value.Length > 0) return value; } return null; } set { if (tags.Count > 0) tags[0].Copyright = value; } } /// /// Gets and sets the MusicBrainz Artist ID. /// /// /// A containing the MusicBrainz /// ArtistID for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzArtistId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzArtistId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzArtistId = value;} } /// /// Gets and sets the MusicBrainz Release ID. /// /// /// A containing the MusicBrainz /// ReleaseID for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzReleaseId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzReleaseId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzReleaseId = value;} } /// /// Gets and sets the MusicBrainz Release Artist ID. /// /// /// A containing the MusicBrainz /// ReleaseArtistID for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzReleaseArtistId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzReleaseArtistId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzReleaseArtistId = value;} } /// /// Gets and sets the MusicBrainz Track ID. /// /// /// A containing the MusicBrainz /// TrackID for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzTrackId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzTrackId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzTrackId = value;} } /// /// Gets and sets the MusicBrainz Disc ID. /// /// /// A containing the MusicBrainz /// DiscID for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzDiscId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzDiscId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzDiscId = value;} } /// /// Gets and sets the MusicIP PUID. /// /// /// A containing the MusicIP PUID /// for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicIpId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicIpId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicIpId = value;} } /// /// Gets and sets the Amazon ID. /// /// /// A containing the Amazon ID /// for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string AmazonId { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.AmazonId; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].AmazonId = value;} } /// /// Gets and sets the MusicBrainz Release Status. /// /// /// A containing the MusicBrainz /// Release Status for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzReleaseStatus { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzReleaseStatus; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzReleaseStatus = value;} } /// /// Gets and sets the MusicBrainz Release Type. /// /// /// A containing the MusicBrainz /// Release Type for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzReleaseType { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzReleaseType; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzReleaseType = value;} } /// /// Gets and sets the MusicBrainz Release Country. /// /// /// A containing the MusicBrainz /// Release Country for the media described by the /// current instance or null if no value is present. /// /// /// When getting the value, the child comments are looped /// through in order and the first non- /// and non-empty value is returned. /// When setting the value, it is stored in the first /// comment. /// /// public override string MusicBrainzReleaseCountry { get { foreach (XiphComment tag in tags) { if (tag == null) continue; string value = tag.MusicBrainzReleaseCountry; if (value != null && value.Length > 0) return value; } return null; } set {if (tags.Count > 0) tags [0].MusicBrainzReleaseCountry = value;} } /// /// Gets and sets a collection of pictures associated with /// the media represented by the current instance. /// /// /// A containing a collection of /// pictures associated with the media represented by the /// current instance or an empty array if none are present. /// /// /// When getting the value, the child comments are /// looped through in order and the first non-empty value is /// returned. /// When setting the value, it is stored in the first /// comment. /// /// public override IPicture [] Pictures { get { IPicture [] output = new IPicture [0]; foreach (XiphComment tag in tags) if (tag != null && output.Length == 0) output = tag.Pictures; return output; } set {if (tags.Count > 0) tags [0].Pictures = value;} } /// /// Gets whether or not the current instance is empty. /// /// /// if all the comments tags are /// empty; otherwise . /// /// public override bool IsEmpty { get { foreach (XiphComment tag in tags) if (!tag.IsEmpty) return false; return true; } } /// /// Clears all of the child tags. /// public override void Clear () { foreach (XiphComment tag in tags) tag.Clear (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/PageHeader.cs0000644000175000017500000003642011442021373021154 0ustar00alexalex00000000000000// // PageHeader.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // oggpageheader.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Ogg { /// /// Indicates the special properties of a . /// [Flags] public enum PageFlags : byte { /// /// The page is a normal page. /// None = 0, /// /// The first packet of the page is continued from the /// previous page. /// FirstPacketContinued = 1, /// /// The page is the first page of the stream. /// FirstPageOfStream = 2, /// /// The page is the last page of the stream. /// LastPageOfStream = 4 } /// /// This structure provides a representation of an Ogg page header. /// public struct PageHeader { #region Private Propertis /// /// Contains the sizes of the packets contained in the /// current instance. /// private List packet_sizes; /// /// Contains the OGG version. /// private byte version; /// /// Contains the page flags. /// private PageFlags flags; /// /// Contains the page absolute granular postion. /// private ulong absolute_granular_position; /// /// Contains the stream serial number of the page. /// private uint stream_serial_number; /// /// Contains the page sequence number. /// private uint page_sequence_number; /// /// Contains the header size on disk. /// private uint size; /// /// Contains the data size on disk. /// private uint data_size; #endregion #region Constructors /// /// Constructs and initializes a new instance of with a given serial number, page /// number, and flags. /// /// /// A value containing the serial number /// for the stream containing the page described by the new /// instance. /// /// /// A value containing the index of the /// page described by the new instance in the stream. /// /// /// A object containing the flags /// that apply to the page described by the new instance. /// public PageHeader (uint streamSerialNumber, uint pageNumber, PageFlags flags) { version = 0; this.flags = flags; absolute_granular_position = 0; stream_serial_number = streamSerialNumber; page_sequence_number = pageNumber; size = 0; data_size = 0; packet_sizes = new List (); if (pageNumber == 0 && (flags & PageFlags.FirstPacketContinued) == 0) this.flags |= PageFlags.FirstPageOfStream; } /// /// Constructs and initializes a new instance of by reading a raw Ogg page header /// from a specified position in a specified file. /// /// /// A object containing the file from /// which the contents of the new instance are to be read. /// /// /// A value specify at what position to /// read. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// /// /// The Ogg identifier could not be found at the correct /// location. /// public PageHeader (File file, long position) { if (file == null) throw new ArgumentNullException ("file"); if (position < 0 || position > file.Length - 27) throw new ArgumentOutOfRangeException ( "position"); file.Seek (position); // An Ogg page header is at least 27 bytes, so we'll go // ahead and read that much and then get the rest when // we're ready for it. ByteVector data = file.ReadBlock (27); if (data.Count < 27 || !data.StartsWith ("OggS")) throw new CorruptFileException ( "Error reading page header"); version = data [4]; this.flags = (PageFlags) data [5]; absolute_granular_position = data.Mid(6, 8).ToULong ( false); stream_serial_number = data.Mid(14, 4).ToUInt (false); page_sequence_number = data.Mid(18, 4).ToUInt (false); // Byte number 27 is the number of page segments, which // is the only variable length portion of the page // header. After reading the number of page segments // we'll then read in the coresponding data for this // count. int page_segment_count = data [26]; ByteVector page_segments = file.ReadBlock (page_segment_count); // Another sanity check. if (page_segment_count < 1 || page_segments.Count != page_segment_count) throw new CorruptFileException ( "Incorrect number of page segments"); // The base size of an Ogg page 27 bytes plus the number // of lacing values. size = (uint)(27 + page_segment_count); packet_sizes = new List (); int packet_size = 0; data_size = 0; for (int i = 0; i < page_segment_count; i++) { data_size += page_segments [i]; packet_size += page_segments [i]; if (page_segments [i] < 255) { packet_sizes.Add (packet_size); packet_size = 0; } } if (packet_size > 0) packet_sizes.Add (packet_size); } /// /// Constructs and initializes a new instance of by copying the values from another /// instance, offsetting the page number and applying new /// flags. /// /// /// A object to copy the values /// from. /// /// /// A value specifying how much to offset /// the page sequence number in the new instance. /// /// /// A value specifying the flags to /// use in the new instance. /// public PageHeader (PageHeader original, uint offset, PageFlags flags) { version = original.version; this.flags = flags; absolute_granular_position = original.absolute_granular_position; stream_serial_number = original.stream_serial_number; page_sequence_number = original.page_sequence_number + offset; size = original.size; data_size = original.data_size; packet_sizes = new List (); if (page_sequence_number == 0 && (flags & PageFlags.FirstPacketContinued) == 0) this.flags |= PageFlags.FirstPageOfStream; } #endregion #region Public Properties /// /// Gets and sets the sizes for the packets in the page /// described by the current instance. /// /// /// A containing the packet sizes. /// public int [] PacketSizes { get {return packet_sizes.ToArray ();} set { packet_sizes.Clear (); packet_sizes.AddRange (value); } } /// /// Gets the flags for the page described by the current /// instance. /// /// /// A value containing the page /// flags. /// public PageFlags Flags { get {return flags;} } /// /// Gets the absolute granular position of the page described /// by the current instance. /// /// /// A value containing the absolute /// granular position of the page. /// public long AbsoluteGranularPosition { get {return (long) absolute_granular_position;} } /// /// Gets the sequence number of the page described by the /// current instance. /// /// /// A value containing the sequence /// number of the page. /// public uint PageSequenceNumber { get {return page_sequence_number;} } /// /// Gets the serial number of stream that the page described /// by the current instance belongs to. /// /// /// A value containing the stream serial /// number. /// public uint StreamSerialNumber { get {return stream_serial_number;} } /// /// Gets the size of the header as it appeared on disk. /// /// /// A value containing the header size. /// public uint Size { get {return size;} } /// /// Gets the size of the data portion of the page described /// by the current instance as it appeared on disk. /// /// /// A value containing the data size. /// public uint DataSize { get {return data_size;} } #endregion #region Public Methods /// /// Renders the current instance as a raw Ogg page header. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render () { ByteVector data = new ByteVector (); data.Add ("OggS"); data.Add (version); // stream structure version data.Add ((byte) flags); data.Add (ByteVector.FromULong ( absolute_granular_position, false)); data.Add (ByteVector.FromUInt ( stream_serial_number, false)); data.Add (ByteVector.FromUInt ( (uint) page_sequence_number, false)); data.Add (new ByteVector (4, 0)); // checksum, to be filled in later. ByteVector page_segments = LacingValues; data.Add ((byte) page_segments.Count); data.Add (page_segments); return data; } #endregion #region Private Properties /// /// Gets the rendered lacing values for the current instance. /// /// /// A object containing the /// rendered lacing values. /// private ByteVector LacingValues { get { ByteVector data = new ByteVector (); int [] sizes = PacketSizes; for (int i = 0; i < sizes.Length; i ++) { // The size of a packet in an Ogg page // is indicated by a series of "lacing // values" where the sum of the values // is the packet size in bytes. Each of // these values is a byte. A value of // less than 255 (0xff) indicates the // end of the packet. int quot = sizes [i] / 255; int rem = sizes [i] % 255; for (int j = 0; j < quot; j++) data.Add ((byte) 255); if (i < sizes.Length - 1 || (packet_sizes [i] % 255) != 0) data.Add ((byte) rem); } return data; } } #endregion #region IEquatable /// /// Generates a hash code for the current instance. /// /// /// A value containing the hash code for /// the current instance. /// public override int GetHashCode () { unchecked { return (int) (LacingValues.GetHashCode () ^ version ^ (int) flags ^ (int) absolute_granular_position ^ stream_serial_number ^ page_sequence_number ^ size ^ data_size); } } /// /// Checks whether or not the current instance is equal to /// another object. /// /// /// A to compare to the current /// instance. /// /// /// A value indicating whether or not the /// current instance is equal to . /// /// public override bool Equals (object other) { if (!(other is PageHeader)) return false; return Equals ((PageHeader) other); } /// /// Checks whether or not the current instance is equal to /// another instance of . /// /// /// A object to compare to the /// current instance. /// /// /// A value indicating whether or not the /// current instance is equal to . /// /// public bool Equals (PageHeader other) { return packet_sizes == other.packet_sizes && version == other.version && flags == other.flags && absolute_granular_position == other.absolute_granular_position && stream_serial_number == other.stream_serial_number && page_sequence_number == other.page_sequence_number && size == other.size && data_size == other.data_size; } /// /// Gets whether or not two instances of are equal to eachother. /// /// /// A object to compare. /// /// /// A object to compare. /// /// /// if is /// equal to . Otherwise, . /// public static bool operator == (PageHeader first, PageHeader second) { return first.Equals (second); } /// /// Gets whether or not two instances of differ. /// /// /// A object to compare. /// /// /// A object to compare. /// /// /// if is /// unequal to . Otherwise, . /// public static bool operator != (PageHeader first, PageHeader second) { return !first.Equals (second); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/File.cs0000644000175000017500000003056511442021373020052 0ustar00alexalex00000000000000// // File.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // oggfile.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Ogg { /// /// This class extends to provide tagging /// and properties support for Ogg files. /// [SupportedMimeType("taglib/ogg", "ogg")] [SupportedMimeType("taglib/oga", "oga")] [SupportedMimeType("taglib/ogv", "ogv")] [SupportedMimeType("application/ogg")] [SupportedMimeType("application/x-ogg")] [SupportedMimeType("audio/vorbis")] [SupportedMimeType("audio/x-vorbis")] [SupportedMimeType("audio/x-vorbis+ogg")] [SupportedMimeType("audio/ogg")] [SupportedMimeType("audio/x-ogg")] [SupportedMimeType("video/ogg")] [SupportedMimeType("video/x-ogm+ogg")] [SupportedMimeType("video/x-theora+ogg")] [SupportedMimeType("video/x-theora")] public class File : TagLib.File { #region Private Fields /// /// Contains the tags for the file. /// private GroupedComment tag; /// /// Contains the media properties. /// private Properties properties; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system with an average read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Mode = AccessMode.Read; try { tag = new GroupedComment (); Read (propertiesStyle); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } /// /// Constructs and initializes a new instance of for a specified file abstraction with an /// average read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// public File (File.IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { long end; List pages = new List (); Dictionary streams = ReadStreams (pages, out end); Dictionary paginators = new Dictionary (); List> new_pages = new List> (); Dictionary shifts = new Dictionary (); foreach (Page page in pages) { uint id = page.Header.StreamSerialNumber; if (!paginators.ContainsKey (id)) paginators.Add (id, new Paginator ( streams [id].Codec)); paginators [id].AddPage (page); } foreach (uint id in paginators.Keys) { paginators [id].SetComment ( tag.GetComment (id)); int shift; new_pages.Add (new List ( paginators [id] .Paginate (out shift))); shifts.Add (id, shift); } ByteVector output = new ByteVector (); bool empty; do { empty = true; foreach (List stream_pages in new_pages) { if (stream_pages.Count == 0) continue; output.Add (stream_pages [0].Render ()); stream_pages.RemoveAt (0); if (stream_pages.Count != 0) empty = false; } } while (!empty); Insert (output, 0, end); InvariantStartPosition = output.Count; InvariantEndPosition = Length; TagTypesOnDisk = TagTypes; Page.OverwriteSequenceNumbers (this, output.Count, shifts); } finally { Mode = AccessMode.Closed; } } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public override void RemoveTags (TagLib.TagTypes types) { if ((types & TagLib.TagTypes.Xiph) != TagLib.TagTypes.None) tag.Clear (); } /// /// Gets a tag of a specified type from the current instance, /// optionally creating a new tag if possible. /// /// /// A value indicating the /// type of tag to read. /// /// /// A value specifying whether or not to /// try and create the tag if one is not found. /// /// /// A object containing the tag that was /// found in or added to the current instance. If no /// matching tag was found and none was created, is returned. /// public override TagLib.Tag GetTag (TagLib.TagTypes type, bool create) { if (type == TagLib.TagTypes.Xiph) foreach (XiphComment comment in tag.Comments) return comment; return null; } #endregion #region Public Properties /// /// Gets a abstract representation of all tags stored in the /// current instance. /// /// /// A object representing all tags /// stored in the current instance. /// public override Tag Tag { get {return tag;} } /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get {return properties;} } #endregion #region Private Methods /// /// Reads the file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { long end; Dictionary streams = ReadStreams (null, out end); List codecs = new List (); InvariantStartPosition = end; InvariantEndPosition = Length; foreach (uint id in streams.Keys) { tag.AddComment (id, streams [id].Codec.CommentData); codecs.Add (streams [id].Codec); } if (propertiesStyle == ReadStyle.None) return; PageHeader last_header = LastPageHeader; TimeSpan duration = streams [last_header .StreamSerialNumber].GetDuration ( last_header.AbsoluteGranularPosition); properties = new Properties (duration, codecs); } /// /// Reads the file until all streams have finished their /// property and tagging data. /// /// /// A /// object to be filled with objects as /// they are read, or if the pages /// are not to be stored. /// /// /// A value reference to be updated to /// the postion of the first page not read by the current /// instance. /// /// /// A object containing stream serial numbers as the keys /// objects as the values. /// private Dictionary ReadStreams (List pages, out long end) { Dictionary streams = new Dictionary (); List active_streams = new List (); long position = 0; do { Bitstream stream = null; Page page = new Page (this, position); if ((page.Header.Flags & PageFlags.FirstPageOfStream) != 0) { stream = new Bitstream (page); streams.Add (page.Header .StreamSerialNumber, stream); active_streams.Add (stream); } if (stream == null) stream = streams [ page.Header.StreamSerialNumber]; if (active_streams.Contains (stream) && stream.ReadPage (page)) active_streams.Remove (stream); if (pages != null) pages.Add (page); position += page.Size; } while (active_streams.Count > 0); end = position; return streams; } #endregion #region Private Properties /// /// Gets the last page header in the file. /// /// /// A object containing the last /// page header in the file. /// /// /// The last page header is used to determine the last /// absolute granular position of a stream so the duration /// can be calculated. /// private PageHeader LastPageHeader { get { long last_page_header_offset = RFind ("OggS"); if (last_page_header_offset < 0) throw new CorruptFileException ( "Could not find last header."); return new PageHeader (this, last_page_header_offset); } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ogg/Codec.cs0000644000175000017500000002211711442021373020202 0ustar00alexalex00000000000000// // Codec.cs: // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; namespace TagLib.Ogg { /// /// This abstract class implements to provide /// support for processing packets from an Ogg logical bitstream. /// /// /// Unsupported Ogg codecs can be added by creating child classes and /// registering them using . /// /// /// public abstract class Codec : ICodec { #region Public Delegates /// /// Represents a method capable of checking an Ogg header /// packet to see it is matches a given codec. /// /// /// A object containing an Ogg /// header packet. /// /// /// A object capable of processing the /// stream from which the packet was generated; otherwise /// . /// /// /// In order to add support for a new Ogg codec in /// TagLib#, a derivative class of needs /// to be created. The class then needs to be added to the /// codec detection system by creating a and registering it with . /// A method implementing /// should read to determine if /// it's subclass can handle the data. If it can, it should /// return a new instance of that class, but in no way act /// upon the data. If the class cannot be used to read the /// packet, indicates to the system /// that it needs to try anther codec provider. /// /// /// The following example would check for a Speex /// packet and return a Speex codec: /// /// Codec.AddCodecProvider (delegate (ByteVector packet) { /// return packet.StartsWith ("Speex ") ? new MySpeexCodec () : null; /// }); /// /// public delegate Codec CodecProvider (ByteVector packet); #endregion #region Private Static Fields /// /// Contains registered codec providers. /// private static List providers = new List (); #endregion #region Private Static Methods /// /// Determines the correct codec to use for a stream header /// packet. /// /// /// A object containing the first /// packet of an Ogg logical bitstream. /// /// /// A object capable of handling /// and subsequent packets from /// the same stream. /// /// /// No registered codec capable of processing could be found. /// /// /// This method will first use /// delegates registered with /// and then attempt to use the built-in codecs. /// public static Codec GetCodec (ByteVector packet) { Codec c = null; foreach (CodecProvider p in providers) { c = p (packet); if (c != null) return c; } c = Codecs.Vorbis.FromPacket (packet); if (c != null) return c; c = Codecs.Theora.FromPacket (packet); if (c != null) return c; throw new UnsupportedFormatException ("Unknown codec."); } /// /// Adds a codec /// /// /// A /// /// /// A delegate is used to add /// support for new subclasses in . /// /// public static void AddCodecProvider (CodecProvider provider) { providers.Insert (0, provider); } #endregion #region Private Properties /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public abstract string Description {get;} /// /// Gets the types of media represented by the current /// instance. /// /// /// A bitwise combined containing /// the types of media represented by the current instance. /// public abstract MediaTypes MediaTypes {get;} /// /// Gets the raw Xiph comment data contained in the codec. /// /// /// A object containing a raw Xiph /// comment or if none was found. /// public abstract ByteVector CommentData {get;} /// /// Gets the duration of the media represented by the current /// instance. /// /// /// Always . /// /// /// In order to determine the duration of an Ogg stream, the /// first and last granular positions will be passed to . /// public TimeSpan Duration { get {return TimeSpan.Zero;} } #endregion #region Private Methods /// /// Reads a Ogg packet that has been encountered in the /// stream. /// /// /// A object containing a packet to /// be read by the current instance. /// /// /// A value containing the index of the /// packet in the stream. /// /// /// if the codec has read all the /// necessary packets for the stream and does not need to be /// called again, typically once the Xiph comment has been /// found. Otherwise . /// /// /// is . /// /// /// is less than zero. /// /// /// The data does not conform to the specificiation for the /// codec represented by the current instance. /// public abstract bool ReadPacket (ByteVector packet, int index); /// /// Computes the duration of the stream using the first and /// last granular positions of the stream. /// /// /// A value containing the first granular /// position of the stream. /// /// /// A value containing the last granular /// position of the stream. /// /// /// A value containing the duration /// of the stream. /// public abstract TimeSpan GetDuration (long firstGranularPosition, long lastGranularPosition); /// /// Replaces the comment packet in a collection of packets /// with the rendered version of a Xiph comment or inserts a /// comment packet if the stream lacks one. /// /// /// A object containing /// a collection of packets. /// /// /// A object to store the rendered /// version of in . /// /// /// or is . /// public abstract void SetCommentPacket (ByteVectorCollection packets, XiphComment comment); #endregion } } taglib-sharp-2.1.0.0/src/TagLib/ListBase.cs0000644000175000017500000002640111442021373020157 0ustar00alexalex00000000000000// // ListBase.cs: // // Author: // Aaron Bockover (abockover@novell.com) // // Original Source: // tbytevectorlist.cpp from TagLib // // Copyright (C) 2006 Novell, Inc. // Copyright (C) 2002,2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Text; using System.Collections; using System.Collections.Generic; namespace TagLib { /// /// This class implements /// for objects that implement , /// providing extra features used in lists in TagLib#. /// public class ListBase : IList where T : IComparable { /// /// Contains the internal list. /// private List data = new List (); #region Constructors /// /// Constructs and initializes a new instance of with no contents. /// public ListBase () { } /// /// Constructs and initializes a new instance of with specified contents. /// /// /// A containing objects to add to the current instance. /// public ListBase(ListBase list) { if (list != null) Add (list); } /// /// Constructs and initializes a new instance of with specified contents. /// /// /// A containing objects to add to /// the current instance. /// public ListBase (params T [] list) { if (list != null) Add (list); } #endregion #region Properties /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance is empty; /// otherwise . /// public bool IsEmpty { get {return Count == 0;} } #endregion #region Methods /// /// Adds a collection of elements to the current instance. /// /// /// A object containing /// elements to add to the current instance. /// public void Add(ListBase list) { if(list != null) { data.AddRange(list); } } /// /// Adds a collection of elements to the current instance. /// /// /// A object containing /// elements to add to the current instance. /// public void Add(IEnumerable list) { if(list != null) { data.AddRange(list); } } /// /// Adds a collection of elements to the current instance. /// /// /// An array containing elements to add to the current /// instance. /// public void Add(T [] list) { if(list != null) { data.AddRange(list); } } /// /// Performs a sorted insert of an object into the current /// instance, optionally only adding if the item is unique. /// /// /// An object to add to the current instance. /// /// /// If , the object will only be added /// if an identical value is not already contained in the /// current instance. /// /// /// is . /// public virtual void SortedInsert (T item, bool unique) { if (item == null) throw new ArgumentNullException ("item"); int i = 0; for(; i < data.Count; i++) { if(item.CompareTo(data[i]) == 0 && unique) { return; } if(item.CompareTo(data[i]) <= 0) { break; } } Insert(i, item); } /// /// Performs a sorted insert of an object into the current /// instance. /// /// /// An object to add to the current instance. /// /// /// is . /// public void SortedInsert (T item) { if (item == null) throw new ArgumentNullException ("item"); SortedInsert(item, false); } /// /// Converts the current instance to an array. /// /// /// A containing the contents of /// the current instance. /// public T [] ToArray () { return data.ToArray(); } #endregion #region IList /// /// Gets whether or not the current instance is read-only. /// /// /// Always . /// public bool IsReadOnly { get { return false; } } /// /// Gets whether or not the current instance has a fixed /// size. /// /// /// Always . /// public bool IsFixedSize { get { return false; } } /// /// Gets and sets the value as a specified index. /// public T this [int index] { get { return data[index]; } set { data[index] = value; } } /// /// Adds a single item to end of the current instance. /// /// /// An object to add to the end of the current instance. /// public void Add (T item) { data.Add (item); } /// /// Clears the contents of the current instance. /// public void Clear () { data.Clear (); } /// /// Gets whether or not the current instance contains a /// specified object. /// /// /// An object to look for in the current instance. /// /// /// if the item could be found; /// otherwise . /// public bool Contains (T item) { return data.Contains (item); } /// /// Gets the index of the first occurance of a value. /// /// /// A object to find in the current instance. /// /// /// A value containing the first index /// at which the value was found, or -1 if it was not found. /// public int IndexOf (T item) { return data.IndexOf (item); } /// /// Inserts a single value into the current instance at a // specified index. /// /// /// A value specifying the position at /// which to insert the value. /// /// /// An object to insert into the current instance. /// public void Insert (int index, T item) { data.Insert (index, item); } /// /// Removes the first occurance of an object from the current /// instance. /// /// /// An object to remove from the current instance. /// /// /// if the value was removed; /// otherwise the value did not appear in the current /// instance and is returned. /// public bool Remove (T item) { return data.Remove (item); } /// /// Removes the item at the specified index. /// /// /// A value specifying the position at /// which to remove an item. /// public void RemoveAt (int index) { data.RemoveAt (index); } /// /// Gets a string representation of the contents of the /// current instance, joined by a separator. /// /// /// A object to separate the items /// with. /// /// /// A object containing the contents /// of the current instance. /// public string ToString (string separator) { StringBuilder builder = new StringBuilder(); for(int i = 0; i < Count; i++) { if(i != 0) { builder.Append(separator); } builder.Append(this[i].ToString()); } return builder.ToString (); } /// /// Gets a string representation of the contents of the /// current instance, joined by commas. /// /// /// A object containing the contents /// of the current instance. /// public override string ToString () { return ToString(", "); } #endregion #region ICollection /// /// Gets the number of elements in the current instance. /// /// /// A value containing the number of /// elements in the current instance. /// public int Count { get {return data.Count;} } /// /// Gets whether or not the current instance is synchronized. /// /// /// Always . /// public bool IsSynchronized { get {return false;} } /// /// Gets the object that can be used to synchronize the /// current instance. /// /// /// A that can be used to synchronize /// the current instance. /// public object SyncRoot { get {return this;} } /// /// Copies the current instance to an array, starting at a /// specified index. /// /// /// An array to copy to. /// /// /// A value indicating the index in /// at which to start copying. /// public void CopyTo (T [] array, int arrayIndex) { data.CopyTo (array, arrayIndex); } #endregion #region IEnumerable /// /// Gets an enumerator for enumerating through the elements /// in the current instance. /// /// /// A for /// enumerating through the tag's data boxes. /// public IEnumerator GetEnumerator() { return data.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return data.GetEnumerator(); } #endregion } }taglib-sharp-2.1.0.0/src/TagLib/Gif/0000755000175000017500000000000011774620111016627 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Gif/GifCommentTag.cs0000644000175000017500000000450211521241310021631 0ustar00alexalex00000000000000// // GifCommentTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using TagLib.Image; namespace TagLib.Gif { /// /// Contains the Gif comment. /// public class GifCommentTag : ImageTag { #region Constructors /// /// Constructor. /// /// /// The value of the comment. /// public GifCommentTag (string value) { Value = value; } /// /// Constructor. Creates a new empty comment. /// public GifCommentTag () { Value = null; } #endregion #region Public Properties /// /// The value of the comment represented by the current instance. /// public string Value { get; set; } /// /// Gets or sets the comment for the image described /// by the current instance. /// /// /// A containing the comment of the /// current instace. /// public override string Comment { get { return Value; } set { Value = value; } } #endregion #region Public Methods /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get { return TagTypes.GifComment; } } /// /// Clears the values stored in the current instance. /// public override void Clear () { Value = null; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Gif/File.cs0000644000175000017500000006061211521241310020030 0ustar00alexalex00000000000000// // File.cs: Provides tagging for GIF files // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.IO; using TagLib; using TagLib.Image; using TagLib.Xmp; namespace TagLib.Gif { /// /// This class extends to provide tagging /// and property support for Gif files. /// [SupportedMimeType("taglib/gif", "gif")] [SupportedMimeType("image/gif")] public class File : TagLib.Image.ImageBlockFile { #region GIF specific constants /// /// Gif file signature which occurs at the begin of the file /// protected static readonly string SIGNATURE = "GIF"; /// /// String which is used to indicate version the gif file format version 87a /// protected static readonly string VERSION_87A = "87a"; /// /// String which is used to indicate version the gif file format version 89a /// protected static readonly string VERSION_89A = "89a"; /// /// Application Extension Identifier for an XMP Block /// private static readonly string XMP_IDENTIFIER = "XMP Data"; /// /// Application Authentication Extension Code for an XMP Block /// private static readonly string XMP_AUTH_CODE = "XMP"; /// /// The Magic Trailer for XMP Data /// /// /// The storage of XMP data in GIF does not follow the GIF specification. According to the /// specification, extension data is stored in so-called sub-blocks, which start with a length /// byte which specifies the number of data bytes contained in the sub block. So a block can at /// most contain 256 data bytes. After a sub-block, the next sub-block begins. The sequence ends, /// when a sub-block starts with 0. So readers, which are not aware of the XMP data not following /// this scheme, will get confused by the XMP data. To fix this, this trailer is added to the end. /// It has a length of 258 bytes, so that it is ensured that a reader which tries to skip the /// XMP data reads one of this bytes as length of a sub-block. But, each byte points with its length /// to the last one. Therefoe, independent of the byte, the reader reads as sub-block length, it is /// redirected to the last byte of the trailer and therfore to the end of the XMP data. /// private static readonly byte [] XMP_MAGIC_TRAILER = new byte [] { 0x01, 0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8, 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0, 0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8, 0xE7, 0xE6, 0xE5, 0xE4, 0xE3, 0xE2, 0xE1, 0xE0, 0xDF, 0xDE, 0xDD, 0xDC, 0xDB, 0xDA, 0xD9, 0xD8, 0xD7, 0xD6, 0xD5, 0xD4, 0xD3, 0xD2, 0xD1, 0xD0, 0xCF, 0xCE, 0xCD, 0xCC, 0xCB, 0xCA, 0xC9, 0xC8, 0xC7, 0xC6, 0xC5, 0xC4, 0xC3, 0xC2, 0xC1, 0xC0, 0xBF, 0xBE, 0xBD, 0xBC, 0xBB, 0xBA, 0xB9, 0xB8, 0xB7, 0xB6, 0xB5, 0xB4, 0xB3, 0xB2, 0xB1, 0xB0, 0xAF, 0xAE, 0xAD, 0xAC, 0xAB, 0xAA, 0xA9, 0xA8, 0xA7, 0xA6, 0xA5, 0xA4, 0xA3, 0xA2, 0xA1, 0xA0, 0x9F, 0x9E, 0x9D, 0x9C, 0x9B, 0x9A, 0x99, 0x98, 0x97, 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8F, 0x8E, 0x8D, 0x8C, 0x8B, 0x8A, 0x89, 0x88, 0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80, 0x7F, 0x7E, 0x7D, 0x7C, 0x7B, 0x7A, 0x79, 0x78, 0x77, 0x76, 0x75, 0x74, 0x73, 0x72, 0x71, 0x70, 0x6F, 0x6E, 0x6D, 0x6C, 0x6B, 0x6A, 0x69, 0x68, 0x67, 0x66, 0x65, 0x64, 0x63, 0x62, 0x61, 0x60, 0x5F, 0x5E, 0x5D, 0x5C, 0x5B, 0x5A, 0x59, 0x58, 0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51, 0x50, 0x4F, 0x4E, 0x4D, 0x4C, 0x4B, 0x4A, 0x49, 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, 0x40, 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30, 0x2F, 0x2E, 0x2D, 0x2C, 0x2B, 0x2A, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00 }; #endregion #region private fields /// /// The width of the image /// private int width; /// /// The height of the image /// private int height; /// /// The Properties of the image /// private Properties properties; /// /// The version of the file format /// private string version; /// /// The start of the first block in file after the header. /// private long start_of_blocks = -1; #endregion #region public Properties /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } #endregion #region constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { SaveMetadata (); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } #endregion #region Private Methods /// /// Reads the information from file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { ImageTag = new CombinedImageTag (TagTypes.XMP | TagTypes.GifComment); ReadHeader (); ReadMetadata (); TagTypesOnDisk = TagTypes; if (propertiesStyle != ReadStyle.None) properties = ExtractProperties (); } finally { Mode = AccessMode.Closed; } } /// /// Reads a single byte form file. This is needed often for Gif files. /// /// /// A with the read data. /// private byte ReadByte () { ByteVector data = ReadBlock (1); if (data.Count != 1) throw new CorruptFileException ("Unexpected end of file"); return data[0]; } /// /// Reads the Header and the Logical Screen Descriptor of the GIF file and, /// if there is one, skips the global color table. It also extracts the /// image width and height from it. /// private void ReadHeader () { // The header consists of: // // 3 Bytes Signature // 3 Bytes Version // // The Logical Screen Descriptor of: // // 2 Bytes Width (little endian) // 2 Bytes Height (little endian) // 1 Byte Screen and Color Map (packed field) // 1 Byte Background Color // 1 Byte Aspect Ratio // // Whereas the bits of the packed field contains some special information. ByteVector data = ReadBlock (13); if (data.Count != 13) throw new CorruptFileException ("Unexpected end of Header"); if (data.Mid (0, 3).ToString () != SIGNATURE) throw new CorruptFileException (String.Format ("Expected a GIF signature at start of file, but found: {0}", data.Mid (0, 3).ToString ())); // We do not care about the version here, because we can read both versions in the same way. // We just care when writing metadata, that, if necessary, the version is increased to 89a. var read_version = data.Mid (3, 3).ToString (); if (read_version == VERSION_87A || read_version == VERSION_89A) version = read_version; else throw new UnsupportedFormatException ( String.Format ("Only GIF versions 87a and 89a are currently supported, but not: {0}", read_version)); // Read Image Size (little endian) width = data.Mid (6, 2).ToUShort (false); height = data.Mid (8, 2).ToUShort (false); // Skip optional global color table SkipColorTable (data [10]); } /// /// Reads the metadata from file. The current position must point to the /// start of the first block after the Header and Logical Screen /// Descriptor (and, if there is one, the Global Color Table) /// private void ReadMetadata () { start_of_blocks = Tell; // Read Blocks until end of file is reached. while (true) { byte identifier = ReadByte (); switch (identifier) { case 0x2c: SkipImage (); break; case 0x21: ReadExtensionBlock (); break; case 0x3B: return; default: throw new CorruptFileException ( String.Format ("Do not know what to do with byte 0x{0:X2} at the beginning of a block ({1}).", identifier, Tell - 1)); } } } /// /// Reads an Extension Block at the current position. The current position must /// point to the 2nd byte of the comment block. (The other byte is usually /// read before to identify the comment block) /// private void ReadExtensionBlock () { // Extension Block // // 1 Byte Extension Introducer (0x21) // 1 Byte Extension Identifier // .... // // Note, the Extension Introducer was read before to // identify the Extension Block. Therefore, it has not // to be handled here. byte identifier = ReadByte (); switch (identifier) { case 0xFE: ReadCommentBlock (); break; case 0xFF: ReadApplicationExtensionBlock (); break; // Control Extension Block, ... case 0xF9: // ... Plain Text Extension ... case 0x01: // ... and all other unknown blocks can be skipped by just // reading sub-blocks. default: SkipSubBlocks (); break; } } /// /// Reads an Application Extension Block at the current position. The current /// position must point to the 3rd byte of the comment block. (The other 2 bytes /// are usually read before to identify the comment block) /// private void ReadApplicationExtensionBlock () { // Application Extension Block // // 1 Byte Extension Introducer (0x21) // 1 Byte Application Extension Label (0xFF) // 1 Byte Block Size (0x0B - 11) // 8 Bytes Application Identifier // 3 Bytes Application Auth. Code // N Bytes Application Data (sub blocks) // 1 Byte Block Terminator (0x00) // // Note, the first 2 bytes are still read to identify the Comment Block. // Therefore, we only need to read the sub blocks and extract the data. long position = Tell; ByteVector data = ReadBlock (12); if (data.Count != 12) throw new CorruptFileException (""); // Contains XMP data if (data.Mid (1, 8) == XMP_IDENTIFIER && data.Mid (9, 3) == XMP_AUTH_CODE) { // XMP Data is not organized in sub-blocks // start of xmp data long data_start = Tell; // start of trailer start // FIXME: Since File.Find is still buggy, the following call does not work to find the end of the // XMP data. Therfore, we use here a different way for now. //long xmp_trailer_start = Find (new ByteVector (0x00), data_start); // Since searching just one byte is save, we search for the end of the xmp trailer which // consists of two 0x00 bytes and compute the expected start. long xmp_trailer_start = Find (new byte [] {0x00}, data_start) - XMP_MAGIC_TRAILER.Length + 2; Seek (data_start, SeekOrigin.Begin); if (xmp_trailer_start <= data_start) throw new CorruptFileException ("No End of XMP data found"); // length of xmp data int data_length = (int) (xmp_trailer_start - data_start); ByteVector xmp_data = ReadBlock (data_length); ImageTag.AddTag (new XmpTag (xmp_data.ToString (StringType.UTF8), this)); // 2 bytes where read before AddMetadataBlock (position - 2, 14 + data_length + XMP_MAGIC_TRAILER.Length); // set position behind the XMP block Seek (xmp_trailer_start + XMP_MAGIC_TRAILER.Length, SeekOrigin.Begin); } else { SkipSubBlocks (); } } /// /// Reads a Comment Block at the current position. The current position must /// point to the 3rd byte of the comment block. (The other 2 bytes are usually /// read before to identify the comment block) /// private void ReadCommentBlock () { long position = Tell; // Comment Extension // // 1 Byte Extension Introducer (0x21) // 1 Byte Comment Label (0xFE) // N Bytes Comment Data (Sub Blocks) // 1 Byte Block Terminator (0x00) // // Note, the first 2 bytes are still read to identify the Comment Block. // Therefore, we only need to read the sub blocks and extract the data. string comment = ReadSubBlocks (); // Only add the tag, if no one is still contained. if ((TagTypes & TagTypes.GifComment) == 0x00) { ImageTag.AddTag (new GifCommentTag (comment)); // 2 bytes where read before AddMetadataBlock (position - 2, Tell - position + 2); } } /// /// Skips the color table if there is one /// /// /// A with the packed data which is /// contained Logical Screen Descriptor or in the Image Descriptor. /// /// /// The data contained in the packed data is different for the Logical /// Screen Descriptor and for the Image Descriptor. But fortunately, /// the bits which are used do identifying the exitstance and the size /// of the color table are at the same position. /// private void SkipColorTable (byte packed_data) { // Packed Field (Information with Bit 0 is LSB) // // Bit 0-2 Size of Color Table // Bit 3-6 Other stuff // Bit 7 (Local|Global) Color Table Flag // // We are interested in Bit 7 which indicates if a global color table is // present or not and the Bits 0-2 which indicate the size of the color // table. if ((packed_data & 0x80) == 0x80) { // 2^(size + 1) for each color. int table_size = 3 * (1 << ((packed_data & 0x07) + 1)); // and simply skip the color table ByteVector color_table = ReadBlock (table_size); if (color_table.Count != table_size) throw new CorruptFileException ("Unexpected end of Color Table"); } } /// /// Skip over the image data at the current position. The current position must /// point to 2nd byte of the Image Descriptor. (First byte is usually read before /// to identify the image descriptor.) /// private void SkipImage () { // Image Descriptor // // 1 Byte Separator (0x2C) // 2 Bytes Image Left Position (little endian) // 2 Bytes Image Right Position (little endian) // 2 Bytes Image Witdh (little endian) // 2 Bytes Image Height (little endian) // 1 Byte Packed Data // // Note, the Separator was read before to identify the Image Block // Therefore, we only need to read 9 bytes here. ByteVector data = ReadBlock (9); if (data.Count != 9) throw new CorruptFileException ("Unexpected end of Image Descriptor"); // Skip an optional local color table SkipColorTable (data [8]); // Image Data // // 1 Byte LZW Minimum Code Size // N Bytes Image Data (Sub-Blocks) // // Before the image data, one byte for LZW encoding information is used. // This byte is read first, then the sub-blocks are skipped. ReadBlock (1); SkipSubBlocks (); } /// /// Reads a sequence of sub-blocks from the current position and concatenates the data /// from the sub-blocks to a string. The current position must point to the size-byte /// of the first subblock to skip. /// /// /// A with the data contained in the sub-blocks. /// private string ReadSubBlocks () { // Sub Block // Starts with one byte with the number of data bytes // following. The last sub block is terminated by length 0 System.Text.StringBuilder builder = new System.Text.StringBuilder (); byte length = 0; do { if (length >= 0) builder.Append (ReadBlock (length).ToString ()); // read new length byte length = ReadByte (); // The sub-blocks are terminated with 0 } while (length != 0); return builder.ToString (); } /// /// Skips over a sequence of sub-blocks from the current position in the file. /// The current position must point to the size-byte of the first subblock to skip. /// private void SkipSubBlocks () { // Sub Block // Starts with one byte with the number of data bytes // following. The last sub block is terminated by length 0 byte length = 0; do { if (Tell + length >= Length) throw new CorruptFileException ("Unexpected end of Sub-Block"); // Seek to end of sub-block and update the position Seek (Tell + length, SeekOrigin.Begin); // read new length byte length = ReadByte (); // The sub-blocks are terminated with 0 } while (length != 0); } /// /// Save the metadata to file. /// private void SaveMetadata () { ByteVector comment_block = RenderGifCommentBlock (); ByteVector xmp_block = RenderXMPBlock (); // If we write metadata and the version is not 89a, bump the format version // because application extension blocks and comment extension blocks are // specified in 89a. // If we do not write metadata or if metadata is deleted, we do not care // about the version, because it may be wrong before. if (comment_block != null && xmp_block != null && version != VERSION_89A) { Insert (VERSION_89A, 3, VERSION_89A.Length); } // now, only metadata is stored at the beginning of the file, and we can overwrite it. ByteVector metadata_blocks = new ByteVector (); metadata_blocks.Add (comment_block); metadata_blocks.Add (xmp_block); SaveMetadata (metadata_blocks, start_of_blocks); } /// /// Renders the XMP data to a Application Extension Block which can be /// embedded in a Gif file. /// /// /// A with the Application Extension Block for the /// XMP data, or if the file does not have XMP data. /// private ByteVector RenderXMPBlock () { // Check, if XmpTag is contained XmpTag xmp = ImageTag.Xmp; if (xmp == null) return null; ByteVector xmp_data = new ByteVector (); // Add Extension Introducer (0x21), Application Extension Label (0xFF) and // the Block Size (0x0B xmp_data.Add (new byte [] {0x21, 0xFF, 0x0B}); // Application Identifier and Appl. Auth. Code xmp_data.Add (XMP_IDENTIFIER); xmp_data.Add (XMP_AUTH_CODE); // Add XMP data and Magic Trailer // For XMP, we do not need to store the data in sub-blocks, therfore we // can just add the whole rendered data. (The trailer fixes this) xmp_data.Add (xmp.Render ()); xmp_data.Add (XMP_MAGIC_TRAILER); return xmp_data; } /// /// Renders the Gif Comment to a Comment Extension Block which can be /// embedded in a Gif file. /// /// /// A with the Comment Extension Block for the /// Gif Comment, or if the file does not have /// a Gif Comment. /// private ByteVector RenderGifCommentBlock () { // Check, if GifCommentTag is contained GifCommentTag comment_tag = GetTag (TagTypes.GifComment) as GifCommentTag; if (comment_tag == null) return null; string comment = comment_tag.Comment; if (comment == null) return null; ByteVector comment_data = new ByteVector (); // Add Extension Introducer (0x21) and Comment Label (0xFE) comment_data.Add (new byte [] {0x21, 0xFE}); // Add data of comment in sub-blocks of max length 256. ByteVector comment_bytes = new ByteVector (comment); byte block_max = 255; for (int start = 0; start < comment_bytes.Count; start += block_max) { byte block_length = (byte) Math.Min (comment_bytes.Count - start, block_max); comment_data.Add (block_length); comment_data.Add (comment_bytes.Mid (start, block_length)); } comment_data.Add (new byte [] {0x00}); return comment_data; } /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// private Properties ExtractProperties () { if (width > 0 && height > 0) return new Properties (TimeSpan.Zero, new Codec (width, height)); return null; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Gif/Codec.cs0000644000175000017500000000327711521241310020172 0ustar00alexalex00000000000000// // Codec.cs: // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Gif { /// /// A Gif photo codec. Contains basic photo details. /// public class Codec : Image.Codec { /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public override string Description { get { return "GIF File"; } } /// /// Constructs a new with the given width /// and height. /// /// /// The width of the photo. /// /// /// The height of the photo. /// /// /// A new instance. /// public Codec (int width, int height) : base (width, height) {} } } taglib-sharp-2.1.0.0/src/TagLib/Jpeg/0000755000175000017500000000000011774620112017010 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Jpeg/JpegCommentTag.cs0000644000175000017500000000440011521241310022166 0ustar00alexalex00000000000000// // JpegCommentTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2009 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using TagLib.Image; namespace TagLib.Jpeg { /// /// Contains the JPEG comment. /// public class JpegCommentTag : ImageTag { #region Constructors /// /// Constructor. /// /// /// The value of the comment. /// public JpegCommentTag (string value) { Value = value; } /// /// Constructor. Creates a new empty comment. /// public JpegCommentTag () { Value = null; } #endregion #region Public Properties /// /// The value of the comment represented by the current instance. /// public string Value { get; set; } /// /// Gets or sets the comment for the image described /// by the current instance. /// /// /// A containing the comment of the /// current instace. /// public override string Comment { get { return Value; } set { Value = value; } } #endregion #region Public Methods /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get { return TagTypes.JpegComment; } } /// /// Clears the values stored in the current instance. /// public override void Clear () { Value = null; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Jpeg/Table.cs0000644000175000017500000000400011521241310020345 0ustar00alexalex00000000000000// // TagLib.Jpeg.Table.cs: // // Author: // Stephane Delcroix (stephane@delcroix.org) // // Copyright (c) 2009 Stephane Delcroix // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.Jpeg { /// /// Contains static predefined tables and helpers /// public static class Table { /// /// Standard Luminance Quantization table /// /// See CCIT Rec. T.81 (1992 E), K.1 (p143) /// public static int [] StandardLuminanceQuantization = new int [] { 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40, 26, 24, 22, 22, 24, 49, 35, 37, 29, 40, 58, 51, 61, 60, 57, 51, 56, 55, 64, 72, 92, 78, 64, 68, 87, 69, 55, 56, 80, 109, 81, 87, 95, 98, 103, 104, 103, 62, 77, 113, 121, 112, 100, 120, 92, 101, 103, 99 }; /// /// Standard Chrominance Quantization table /// /// See CCIT Rec. T.81 (1992 E), K.1 (p143) /// public static int [] StandardChrominanceQuantization = new int [] { 17, 18, 18, 24, 21, 24, 47, 26, 26, 47, 99, 66, 56, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 }; } } taglib-sharp-2.1.0.0/src/TagLib/Jpeg/Marker.cs0000644000175000017500000001515111521241310020550 0ustar00alexalex00000000000000// // Marker.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Stephane Delcroix (stephane@delcroix.org) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (c) 2009 Stephane Delcroix // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.Jpeg { /// /// This enum defines the different markers used in JPEG segments. /// /// See CCITT Rec. T.81 (1992 E), Table B.1 (p.32) /// public enum Marker : byte { /// /// Start Of Frame marker, non-differential, Huffman coding, Baseline DCT /// SOF0 = 0xc0, /// /// Start Of Frame marker, non-differential, Huffman coding, Extended Sequential DCT /// SOF1, /// /// Start Of Frame marker, non-differential, Huffman coding, Progressive DCT /// SOF2, /// /// Start Of Frame marker, non-differential, Huffman coding, Lossless (sequential) /// SOF3, /// /// Start Of Frame marker, differential, Huffman coding, Differential Sequential DCT /// SOF5 = 0xc5, /// /// Start Of Frame marker, differential, Huffman coding, Differential Progressive DCT /// SOF6, /// /// Start Of Frame marker, differential, Huffman coding, Differential Lossless (sequential) /// SOF7, /// /// Reserved for JPG extensions /// JPG, /// /// Start Of Frame marker, non-differential, arithmetic coding, Extended Sequential DCT /// SOF9, /// /// Start Of Frame marker, non-differential, arithmetic coding, Progressive DCT /// SOF10, /// /// Start Of Frame marker, non-differential, arithmetic coding, Lossless (sequential) /// SOF11, /// /// Start Of Frame marker, differential, arithmetic coding, Differential Sequential DCT /// SOF13 = 0xcd, /// /// Start Of Frame marker, differential, arithmetic coding, Differential Progressive DCT /// SOF14, /// /// Start Of Frame marker, differential, arithmetic coding, Differential Lossless (sequential) /// SOF15, /// /// Define Huffman table(s) /// DHT = 0xc4, /// /// Define arithmetic coding conditioning(s) /// DAC = 0xcc, //Restart interval termination with modulo 8 count "m" /// /// Restart /// RST0 = 0xd0, /// /// Restart /// RST1, /// /// Restart /// RST2, /// /// Restart /// RST3, /// /// Restart /// RST4, /// /// Restart /// RST5, /// /// Restart /// RST6, /// /// Restart /// RST7, /// /// Start of Image /// SOI = 0xd8, /// /// End of Image /// EOI, /// /// Start of scan /// SOS, /// /// Define quantization table (s) /// DQT, /// /// Define number of lines /// DNL, /// /// Define restart interval /// DRI, /// /// Define hierarchical progression /// DHP, /// /// Define reference component /// EXP, /// /// Reserved for application segment /// APP0 = 0xe0, /// /// Reserved for application segment /// APP1, /// /// Reserved for application segment /// APP2, /// /// Reserved for application segment /// APP3, /// /// Reserved for application segment /// APP4, /// /// Reserved for application segment /// APP5, /// /// Reserved for application segment /// APP6, /// /// Reserved for application segment /// APP7, /// /// Reserved for application segment /// APP8, /// /// Reserved for application segment /// APP9, /// /// Reserved for application segment /// APP10, /// /// Reserved for application segment /// APP11, /// /// Reserved for application segment /// APP12, /// /// Reserved for application segment /// APP13, /// /// Reserved for application segment /// APP14, /// /// Reserved for application segment /// APP15, /// /// Reserved for JPEG extension /// JPG0 = 0xf0, /// /// Reserved for JPEG extension /// JPG1, /// /// Reserved for JPEG extension /// JPG2, /// /// Reserved for JPEG extension /// JPG3, /// /// Reserved for JPEG extension /// JPG4, /// /// Reserved for JPEG extension /// JPG5, /// /// Reserved for JPEG extension /// JPG6, /// /// Reserved for JPEG extension /// JPG7, /// /// Reserved for JPEG extension /// JPG8, /// /// Reserved for JPEG extension /// JPG9, /// /// Reserved for JPEG extension /// JPG10, /// /// Reserved for JPEG extension /// JPG11, /// /// Reserved for JPEG extension /// JPG12, /// /// Reserved for JPEG extension /// JPG13, /// /// Comment /// COM = 0xfe, } } taglib-sharp-2.1.0.0/src/TagLib/Jpeg/File.cs0000644000175000017500000005726311773625020020235 0ustar00alexalex00000000000000// // File.cs: Provides tagging for Jpeg files // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // Stephane Delcroix (stephane@delcroix.org) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // Copyright (c) 2009 Stephane Delcroix // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using System.IO; using TagLib.Image; using TagLib.IFD; using TagLib.IFD.Entries; using TagLib.Xmp; namespace TagLib.Jpeg { /// /// This class extends to provide tagging /// and properties support for Jpeg files. /// [SupportedMimeType("taglib/jpg", "jpg")] [SupportedMimeType("taglib/jpeg", "jpeg")] [SupportedMimeType("taglib/jpe", "jpe")] [SupportedMimeType("taglib/jif", "jif")] [SupportedMimeType("taglib/jfif", "jfif")] [SupportedMimeType("taglib/jfi", "jfi")] [SupportedMimeType("image/jpeg")] public class File : TagLib.Image.ImageBlockFile { /// /// The magic bits used to recognize an Exif segment /// private static readonly string EXIF_IDENTIFIER = "Exif\0\0"; /// /// The magic strings used to identifiy an IPTC-IIM section /// private static readonly string IPTC_IIM_IDENTIFIER = "Photoshop 3.0\u00008BIM\u0004\u0004"; /// /// Standard (empty) JFIF header to add, if no one is contained /// private static readonly byte [] BASIC_JFIF_HEADER = new byte [] { // segment maker 0xFF, (byte) Marker.APP0, // segment size 0x00, 0x10, // segment data 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00 }; #region Private Fields /// /// Contains the media properties. /// private Properties properties; /// /// For now, we do not allow to change the jfif header. As long as this is /// the case, the header is kept as it is. /// private ByteVector jfif_header = null; /// /// The image width, as parsed from the Frame /// ushort width; /// /// The image height, as parsed from the Frame /// ushort height; /// /// Quality of the image, stored as we parse the file /// int quality; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Read (propertiesStyle); } /// /// Constructs and initializes a new instance of for a specified file abstraction. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// protected File (IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Properties /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } #endregion #region Public Methods /// /// Gets a tag of a specified type from the current instance, optionally creating a /// new tag if possible. /// public override TagLib.Tag GetTag (TagLib.TagTypes type, bool create) { if (type == TagTypes.XMP) { foreach (Tag tag in ImageTag.AllTags) { if ((tag.TagTypes & type) == type || (tag.TagTypes & TagTypes.IPTCIIM) != 0) return tag; } } return base.GetTag (type, create); } /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { if (!Writeable || PossiblyCorrupt) throw new InvalidOperationException ("File not writeable. Corrupt metadata?"); Mode = AccessMode.Write; try { WriteMetadata (); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } } #endregion #region Private Methods /// /// Reads the information from file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { Mode = AccessMode.Read; try { ImageTag = new CombinedImageTag (TagTypes.XMP | TagTypes.TiffIFD | TagTypes.JpegComment | TagTypes.IPTCIIM); ValidateHeader (); ReadMetadata (); TagTypesOnDisk = TagTypes; if (propertiesStyle != ReadStyle.None) properties = ExtractProperties (); } finally { Mode = AccessMode.Closed; } } /// /// Attempts to extract the media properties of the main /// photo. /// /// /// A object with a best effort guess /// at the right values. When no guess at all can be made, /// is returned. /// private Properties ExtractProperties () { if (width > 0 && height > 0) return new Properties (TimeSpan.Zero, new Codec (width, height, quality)); return null; } /// /// Validates if the opened file is actually a JPEG. /// private void ValidateHeader () { ByteVector segment = ReadBlock (2); if (segment.ToUShort () != 0xFFD8) throw new CorruptFileException ("Expected SOI marker at the start of the file."); } /// /// Reads a segment marker for a segment starting at current position. /// The second byte of the marker is returned, since the first is equal /// to 0xFF in every case. /// /// /// A with the second byte of the segment marker. /// private Marker ReadSegmentMarker () { ByteVector segment_header = ReadBlock (2); if (segment_header.Count != 2) throw new CorruptFileException ("Could not read enough bytes for segment maker"); if (segment_header[0] != 0xFF) throw new CorruptFileException ("Start of Segment expected at " + (Tell - 2)); return (Marker)segment_header[1]; } /// /// Reads the size of a segment at the current position. /// /// /// A with the size of the current segment. /// private ushort ReadSegmentSize () { long position = Tell; ByteVector segment_size_bytes = ReadBlock (2); if (segment_size_bytes.Count != 2) throw new CorruptFileException ("Could not read enough bytes to determine segment size"); ushort segment_size = segment_size_bytes.ToUShort (); // the size itself must be contained in the segment size // so the smallest (theoretically) possible number of bytes if 2 if (segment_size < 2) throw new CorruptFileException (String.Format ("Invalid segment size ({0} bytes)", segment_size)); long length = 0; try { length = Length; } catch (Exception) { // Probably not supported by stream. } if (length > 0 && position + segment_size >= length) throw new CorruptFileException ("Segment size exceeds file size"); return segment_size; } /// /// Extracts the metadata from the current file by reading every segment in file. /// Method should be called with read position at first segment marker. /// private void ReadMetadata () { // loop while marker is not EOI and not the data segment while (true) { Marker marker = ReadSegmentMarker (); // we stop parsing when the end of file (EOI) or the begin of the // data segment is reached (SOS) // the second case is a trade-off between tolerant and fast parsing if (marker == Marker.EOI || marker == Marker.SOS) break; long position = Tell; ushort segment_size = ReadSegmentSize (); // segment size contains 2 bytes of the size itself, so the // pure data size is this (and the cast is save) ushort data_size = (ushort) (segment_size - 2); switch (marker) { case Marker.APP0: // possibly JFIF header ReadJFIFHeader (data_size); break; case Marker.APP1: // possibly Exif or Xmp data found ReadAPP1Segment (data_size); break; case Marker.APP13: // possibly IPTC-IIM ReadAPP13Segment (data_size); break; case Marker.COM: // Comment segment found ReadCOMSegment (data_size); break; case Marker.SOF0: case Marker.SOF1: case Marker.SOF2: case Marker.SOF3: case Marker.SOF9: case Marker.SOF10: case Marker.SOF11: ReadSOFSegment (data_size, marker); break; case Marker.DQT: // Quantization table(s), use it to guess quality ReadDQTSegment (data_size); break; } // set position to next segment and start with next segment marker Seek (position + segment_size, SeekOrigin.Begin); } } /// /// Reads a JFIF header at current position /// private void ReadJFIFHeader (ushort length) { // JFIF header should be contained as first segment // SOI marker + APP0 Marker + segment size = 6 bytes if (Tell != 6) return; if (ReadBlock (5).ToString ().Equals ("JFIF\0")) { // store the JFIF header as it is Seek (2, SeekOrigin.Begin); jfif_header = ReadBlock (length + 2 + 2); AddMetadataBlock (2, length + 2 + 2); } } /// /// Reads an APP1 segment to find EXIF or XMP metadata. /// /// /// The length of the segment that will be read. /// private void ReadAPP1Segment (ushort length) { long position = Tell; ByteVector data = null; // for an Exif segment, the data block consists of 14 bytes of: // * 6 bytes Exif identifier string // * 2 bytes bigendian indication MM (or II) // * 2 bytes Tiff magic number (42) // * 4 bytes offset of the first IFD in this segment // // the last two points are alreay encoded according to // big- or littleendian int exif_header_length = 14; // could be an Exif segment if ((ImageTag.TagTypes & TagLib.TagTypes.TiffIFD) == 0x00 && length >= exif_header_length) { data = ReadBlock (exif_header_length); if (data.Count == exif_header_length && data.Mid (0, 6).ToString ().Equals (EXIF_IDENTIFIER)) { bool is_bigendian = data.Mid (6, 2).ToString ().Equals ("MM"); ushort magic = data.Mid (8, 2).ToUShort (is_bigendian); if (magic != 42) throw new Exception (String.Format ("Invalid TIFF magic: {0}", magic)); uint ifd_offset = data.Mid (10, 4).ToUInt (is_bigendian); var exif = new IFDTag (); var reader = new IFDReader (this, is_bigendian, exif.Structure, position + 6, ifd_offset, (uint) (length - 6)); reader.Read (); ImageTag.AddTag (exif); AddMetadataBlock (position - 4, length + 4); return; } } int xmp_header_length = XmpTag.XAP_NS.Length + 1; // could be an Xmp segment if ((ImageTag.TagTypes & TagLib.TagTypes.XMP) == 0x00 && length >= xmp_header_length) { // if already data is read for determining the Exif segment, // just read the remaining bytes. // NOTE: that (exif_header_length < xmp_header_length) holds if (data == null) data = ReadBlock (xmp_header_length); else data.Add (ReadBlock (xmp_header_length - exif_header_length)); if (data.ToString ().Equals (XmpTag.XAP_NS + "\0")) { ByteVector xmp_data = ReadBlock (length - xmp_header_length); ImageTag.AddTag (new XmpTag (xmp_data.ToString (), this)); AddMetadataBlock (position - 4, length + 4); } } } /// /// Reads an APP13 segment to find IPTC-IIM metadata. /// /// /// The length of the segment that will be read. /// /// More info and specs for IPTC-IIM: /// - Guidelines for Handling Image Metadata (http://www.metadataworkinggroup.org/specs/) /// - IPTC Standard Photo Metadata (July 2010) (http://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata-201007_1.pdf) /// - Extracting IPTC header information from JPEG images (http://www.codeproject.com/KB/graphics/iptc.aspx?fid=2301&df=90&mpp=25&noise=3&prof=False&sort=Position&view=Quick&fr=51#xx0xx) /// - Reading IPTC APP14 Segment Header Information from JPEG Images (http://www.codeproject.com/KB/graphics/ReadingIPTCAPP14.aspx?q=iptc) /// private void ReadAPP13Segment (ushort length) { // TODO: if both IPTC-IIM and XMP metadata is contained in a file, we should read // a IPTC-IIM checksum and compare that with the checksum built over the IIM block. // Depending on the result we should prefer the information from XMP or IIM. // Right now we always prefer XMP. var data = ReadBlock (length); // The APP13 segment consists of: // - the string "Photoshop 3.0\u0000" // - followed by "8BIM" // - and then the section type "\u0004\u0004". // There might be multiple 8BIM sections with different types, but we're following // YAGNI for now and only deal with the one we're interested in (and hope that it's // the first one). var iptc_iim_length = IPTC_IIM_IDENTIFIER.Length; if (length < iptc_iim_length || data.Mid (0, iptc_iim_length) != IPTC_IIM_IDENTIFIER) return; // PS6 introduced a new header with variable length text var headerInfoLen = data.Mid (iptc_iim_length, 1).ToUShort(); int lenToSkip; if (headerInfoLen > 0) { // PS6 header: 1 byte headerinfolen + headerinfo + 2 bytes 00 padding (?) + 2 bytes length lenToSkip = 1 + headerInfoLen + 4; } else { //old style: 4 bytes 00 padding (?) + 2 bytes length lenToSkip = 6; } data.RemoveRange (0, iptc_iim_length + lenToSkip); var reader = new IIM.IIMReader (data); var tag = reader.Process (); if (tag != null) ImageTag.AddTag (tag); } /// /// Writes the metadata back to file. All metadata is stored in the first segments /// of the file. /// private void WriteMetadata () { // first render all metadata segments to a ByteVector before the // file is touched ... ByteVector data = new ByteVector (); // existing jfif header is retained, otherwise a standard one // is created if (jfif_header != null) data.Add (jfif_header); else data.Add (BASIC_JFIF_HEADER); data.Add (RenderExifSegment ()); data.Add (RenderXMPSegment ()); data.Add (RenderCOMSegment ()); SaveMetadata (data, 2); } /// /// Creates a for the Exif segment of this file /// /// /// A with the whole Exif segment, if exif tags /// exists, otherwise null. /// private ByteVector RenderExifSegment () { // Check, if IFD0 is contained IFDTag exif = ImageTag.Exif; if (exif == null) return null; // first IFD starts at 8 uint first_ifd_offset = 8; // Render IFD0 // FIXME: store endianess and use it here var renderer = new IFDRenderer (true, exif.Structure, first_ifd_offset); ByteVector exif_data = renderer.Render (); uint segment_size = (uint) (first_ifd_offset + exif_data.Count + 2 + 6); // do not render data segments, which cannot fit into the possible segment size if (segment_size > ushort.MaxValue) throw new Exception ("Exif Segment is too big to render"); // Create whole segment ByteVector data = new ByteVector (new byte [] { 0xFF, (byte) Marker.APP1 }); data.Add (ByteVector.FromUShort ((ushort) segment_size)); data.Add ("Exif\0\0"); data.Add (ByteVector.FromString ("MM", StringType.Latin1)); data.Add (ByteVector.FromUShort (42)); data.Add (ByteVector.FromUInt (first_ifd_offset)); // Add ifd data itself data.Add (exif_data); return data; } /// /// Creates a for the Xmp segment of this file /// /// /// A with the whole Xmp segment, if xmp tags /// exists, otherwise null. /// private ByteVector RenderXMPSegment () { // Check, if XmpTag is contained XmpTag xmp = ImageTag.Xmp; if (xmp == null) return null; ByteVector xmp_data = XmpTag.XAP_NS + "\0"; xmp_data.Add (xmp.Render ()); uint segment_size = (uint) (2 + xmp_data.Count); // do not render data segments, which cannot fit into the possible segment size if (segment_size > ushort.MaxValue) throw new Exception ("XMP Segment is too big to render"); // Create whole segment ByteVector data = new ByteVector (new byte [] { 0xFF, (byte) Marker.APP1 }); data.Add (ByteVector.FromUShort ((ushort) segment_size)); data.Add (xmp_data); return data; } /// /// Reads a COM segment to find the JPEG comment. /// /// /// The length of the segment that will be read. /// private void ReadCOMSegment (int length) { if ((ImageTag.TagTypes & TagLib.TagTypes.JpegComment) != 0x00) return; long position = Tell; JpegCommentTag com_tag; if (length == 0) { com_tag = new JpegCommentTag (); } else { ByteVector data = ReadBlock (length); int terminator = data.Find ("\0", 0); if (terminator < 0) com_tag = new JpegCommentTag (data.ToString ()); else com_tag = new JpegCommentTag (data.Mid (0, terminator).ToString ()); } ImageTag.AddTag (com_tag); AddMetadataBlock (position - 4, length + 4); } /// /// Creates a for the comment segment of this file /// /// /// A with the whole comment segment, if a comment tag /// exists, otherwise null. /// private ByteVector RenderCOMSegment () { // check, if Comment is contained JpegCommentTag com_tag = GetTag (TagTypes.JpegComment) as JpegCommentTag; if (com_tag == null) return null; // create comment data ByteVector com_data = ByteVector.FromString (com_tag.Value + "\0", StringType.Latin1); uint segment_size = (uint) (2 + com_data.Count); // do not render data segments, which cannot fit into the possible segment size if (segment_size > ushort.MaxValue) throw new Exception ("Comment Segment is too big to render"); // create segment ByteVector data = new ByteVector (new byte [] { 0xFF, (byte) Marker.COM }); data.Add (ByteVector.FromUShort ((ushort) segment_size)); data.Add (com_data); return data; } /// /// Reads and parse a SOF segment /// /// /// The length of the segment that will be read. /// /// /// The SOFx marker. /// void ReadSOFSegment (int length, Marker marker) { #pragma warning disable 219 // Assigned, never read byte p = ReadBlock (1)[0]; //precision #pragma warning restore 219 //FIXME: according to specs, height could be 0 here, and should be retrieved from the DNL marker height = ReadBlock (2).ToUShort (); width = ReadBlock (2).ToUShort (); } /// /// Reads the DQT Segment, and Guesstimate the image quality from it /// /// /// The length of the segment that will be read /// void ReadDQTSegment (int length) { // See CCITT Rec. T.81 (1992 E), B.2.4.1 (p39) for DQT syntax while (length > 0) { byte pqtq = ReadBlock (1)[0]; length --; byte pq = (byte)(pqtq >> 4); //0 indicates 8-bit Qk, 1 indicates 16-bit Qk byte tq = (byte)(pqtq & 0x0f); //table index; int [] table = null; switch (tq) { case 0: table = Table.StandardLuminanceQuantization; break; case 1: table = Table.StandardChrominanceQuantization; break; } bool allones = true; //check for all-ones tables (q=100) double cumsf = 0.0; //double cumsf2 = 0.0; for (int row = 0; row < 8; row ++) { for (int col = 0; col < 8; col++) { ushort val = ReadBlock (pq == 1 ? 2 : 1).ToUShort (); length -= (pq + 1); if (table != null) { double x = 100.0 * (double)val / (double)table [row*8+col]; //Scaling factor in percent cumsf += x; //cumsf2 += x*x; allones = allones && (val == 1); } } } if (table != null) { double local_q; cumsf /= 64.0; // mean scale factor //cumfs2 /= 64.0; //double variance = cumsf2 - (cumsf * cumsf); if (allones) local_q = 100.0; else if (cumsf <= 100.0) local_q = (200.0 - cumsf) / 2.0; else local_q = 5000.0 / cumsf; quality = Math.Max (quality, (int)local_q); } } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Jpeg/Codec.cs0000644000175000017500000000356611521241310020353 0ustar00alexalex00000000000000// // Codec.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // Mike Gemuende (mike@gemuende.de) // // Copyright (C) 2009 Ruben Vermeersch // Copyright (C) 2009 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Jpeg { /// /// A Jpeg photo codec. Contains basic photo details. /// public class Codec : Image.Codec { /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public override string Description { get { return "JFIF File"; } } /// /// Constructs a new with the given width /// and height. /// /// /// The width of the photo. /// /// /// The height of the photo. /// /// /// The quality of the photo. /// /// /// A new instance. /// public Codec (int width, int height, int quality) : base (width, height, quality) {} } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/0000755000175000017500000000000011774620112017704 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Matroska/EBMLIDs.cs0000644000175000017500000000414011552201076021347 0ustar00alexalex00000000000000// // EBMLIDs.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.Matroska { /// /// Public enumeration listing the possible EBML element identifiers. /// public enum EBMLID { /// /// Indicates an EBML Header element. /// EBMLHeader = 0x1A45DFA3, /// /// Indicates an EBML Version element. /// EBMLVersion = 0x4286, /// /// Indicates an EBML Read Version element. /// EBMLReadVersion = 0x42F7, /// /// Indicates an EBML Max ID Length element. /// EBMLMaxIDLength = 0x42F2, /// /// Indicates an EBML Max Size Length element. /// EBMLMaxSizeLength = 0x42F3, /// /// Indicates an EBML Doc Type element. /// EBMLDocType = 0x4282, /// /// Indicates an EBML Doc Type Version element. /// EBMLDocTypeVersion = 0x4287, /// /// Indicates an EBML Doc Type Read Version element. /// EBMLDocTypeReadVersion = 0x4285, /// /// Indicates an EBML Void element. /// EBMLVoid = 0xEC } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/EBMLElement.cs0000644000175000017500000001636511552201076022275 0ustar00alexalex00000000000000// // EBMLElement.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Matroska { /// /// Describes a generic EBML Element. /// public class EBMLElement { #region Private Fields private ulong offset = 0; private ulong data_offset = 0; private uint ebml_id = 0; private ulong ebml_size = 0; private Matroska.File file = null; #endregion #region Constructors /// /// Constructs a parsing from provided /// file data. /// /// instance to read from. /// Position to start reading from. public EBMLElement (Matroska.File _file, ulong position) { if (_file == null) throw new ArgumentNullException ("file"); if (position > (ulong) (_file.Length - 4)) throw new ArgumentOutOfRangeException ("position"); // Keep a reference to the file file = _file; file.Seek ((long) position); // Get the header byte ByteVector vector = file.ReadBlock (1); Byte header_byte = vector [0]; // Define a mask Byte mask = 0x80, id_length = 1; // Figure out the size in bytes while (id_length <= 4 && (header_byte & mask) == 0) { id_length++; mask >>= 1; } if (id_length > 4) { throw new CorruptFileException ("invalid EBML id size"); } // Now read the rest of the EBML ID if (id_length > 1) { vector.Add (file.ReadBlock (id_length -1)); } ebml_id = vector.ToUInt (); vector.Clear (); // Get the size length vector = file.ReadBlock (1); header_byte = vector [0]; mask = 0x80; Byte size_length = 1; // Iterate through various possibilities while (size_length <= 8 && (header_byte & mask) == 0) { size_length++; mask >>= 1; } if (size_length > 8) { throw new CorruptFileException ("invalid EBML element size"); } // Clear the marker bit vector [0] &= (Byte) (mask - 1); // Now read the rest of the EBML element size if (size_length > 1) { vector.Add (file.ReadBlock (size_length - 1)); } ebml_size = vector.ToULong (); offset = position; data_offset = offset + id_length + size_length; } #endregion #region Public Properties /// /// EBML Element Identifier. /// public uint ID { get { return ebml_id; } } /// /// EBML Element size in bytes. /// public ulong Size { get { return (data_offset - offset) + ebml_size; } } /// /// EBML Element data size in bytes. /// public ulong DataSize { get { return ebml_size; } } /// /// EBML Element data offset in bytes. /// public ulong DataOffset { get { return data_offset; } } /// /// EBML Element offset in bytes. /// public ulong Offset { get { return offset; } } #endregion #region Public Methods /// /// Reads a string from EBML Element's data section. /// /// a string object containing the parsed value. public string ReadString () { if (file == null) { return null; } file.Seek ((long) data_offset); ByteVector vector = file.ReadBlock ((int) ebml_size); return vector.ToString (); } /// /// Reads a boolean from EBML Element's data section. /// /// a bool containing the parsed value. public bool ReadBool () { if (file == null) { return false; } file.Seek ((long) data_offset); ByteVector vector = file.ReadBlock ((int) ebml_size); if (vector.ToUInt () > 0) return true; else return false; } /// /// Reads a double from EBML Element's data section. /// /// a double containing the parsed value. public double ReadDouble () { if (file == null) { return 0; } if (ebml_size != 4 && ebml_size != 8) { throw new UnsupportedFormatException ("Can not read a Double with sizes differing from 4 or 8"); } file.Seek ((long) data_offset); ByteVector vector = file.ReadBlock ((int) ebml_size); double result = 0.0; if (ebml_size == 4) { result = (double) vector.ToFloat (); } else if (ebml_size == 8) { result = vector.ToDouble (); } return result; } /// /// Reads an unsigned 32 bits integer from EBML Element's data section. /// /// a uint containing the parsed value. public uint ReadUInt () { if (file == null) { return 0; } file.Seek ((long) data_offset); ByteVector vector = file.ReadBlock ((int) ebml_size); return vector.ToUInt (); } /// /// Reads a bytes vector from EBML Element's data section. /// /// a containing the parsed value. public ByteVector ReadBytes () { if (file == null) { return null; } file.Seek ((long) data_offset); ByteVector vector = file.ReadBlock ((int) ebml_size); return vector; } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/AudioTrack.cs0000644000175000017500000001064711552201076022267 0ustar00alexalex00000000000000// // AudioTrack.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Matroska { /// /// Describes a Matroska Audio track. /// public class AudioTrack : Track, IAudioCodec { #region Private fields #pragma warning disable 414 // Assigned, never used private double rate; private uint channels; private uint depth; #pragma warning restore 414 private List unknown_elems = new List (); #endregion #region Constructors /// /// Construct a reading information from /// provided file data. /// Parsing will be done reading from _file at position references by /// parent element's data section. /// /// instance to read from. /// Parent . public AudioTrack (File _file, EBMLElement element) : base (_file, element) { MatroskaID matroska_id; // Here we handle the unknown elements we know, and store the rest foreach (EBMLElement elem in base.UnknownElements) { matroska_id = (MatroskaID) elem.ID; if (matroska_id == MatroskaID.MatroskaTrackAudio) { ulong i = 0; while (i < elem.DataSize) { EBMLElement child = new EBMLElement (_file, elem.DataOffset + i); matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaAudioChannels: channels = child.ReadUInt (); break; case MatroskaID.MatroskaAudioBitDepth: depth = child.ReadUInt (); break; case MatroskaID.MatroskaAudioSamplingFreq: rate = child.ReadDouble (); break; default: unknown_elems.Add (child); break; } i += child.Size; } } else { unknown_elems.Add (elem); } } } #endregion #region Public fields /// /// List of unknown elements encountered while parsing. /// public new List UnknownElements { get { return unknown_elems; } } #endregion #region Public methods #endregion #region ICodec /// /// This type of track only has audio media type. /// public override MediaTypes MediaTypes { get { return MediaTypes.Audio; } } #endregion #region IAudioCodec /// /// Audio track bitrate. /// public int AudioBitrate { get { return 0; } } /// /// Audio track sampling rate. /// public int AudioSampleRate { get { return (int) rate; } } /// /// Number of audio channels in this track. /// public int AudioChannels { get { return (int) channels; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/Tag.cs0000644000175000017500000005324111552201076020751 0ustar00alexalex00000000000000// // Tag.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections.Generic; using System.Text; namespace TagLib.Matroska { /// /// Describes a Matroska Tag. /// public class Tag : TagLib.Tag { #region Private fields private string title; private string author; private string album; private string comments; private string genres; private string copyright; #endregion #region Constructors #endregion #region Taglib.Tag /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get { return TagTypes.Id3v2; } } /// /// Gets and sets the title for the media described by the /// current instance. /// /// /// A object containing the title for /// the media described by the current instance or if no value is present. /// /// /// This property is implemented using the title stored in /// the ASF Content Description Object. /// public override string Title { get { return title; } set { title = value; } } /// /// Gets and sets the sort names for the Track Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Track Title of the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "WM/TitleSortOrder" /// field. /// http://msdn.microsoft.com/en-us/library/aa386866(VS.85).aspx /// public override string TitleSort { get { return null; } set { } } /// /// Gets and sets the performers or artists who performed in /// the media described by the current instance. /// /// /// A containing the performers or /// artists who performed in the media described by the /// current instance or an empty array if no value is /// present. /// /// /// This property is implemented using the author stored in /// the MKV Tag element. /// public override string [] Performers { get { return new string [] { author }; } set { author = string.Join ("; ", value); } } /// /// Gets and sets the sort names of the performers or artists /// who performed in the media described by the current instance. /// /// /// A containing the sort names for /// the performers or artists who performed in the media /// described by the current instance, or an empty array if /// no value is present. /// public override string [] PerformersSort { get { return new string [] {}; } set { } } /// /// Gets and sets the band or artist who is credited in the /// creation of the entire album or collection containing the /// media described by the current instance. /// /// /// A containing the band or artist /// who is credited in the creation of the entire album or /// collection containing the media described by the current /// instance or an empty array if no value is present. /// public override string [] AlbumArtists { get { return new string [] {}; } set {} } /// /// Gets and sets the sort names for the band or artist who /// is credited in the creation of the entire album or /// collection containing the media described by the /// current instance. /// /// /// A containing the sort names /// for the band or artist who is credited in the creation /// of the entire album or collection containing the media /// described by the current instance or an empty array if /// no value is present. /// public override string [] AlbumArtistsSort { get { return new string [] { }; } set { } } /// /// Gets and sets the composers of the media represented by /// the current instance. /// /// /// A containing the composers of the /// media represented by the current instance or an empty /// array if no value is present. /// public override string [] Composers { get { return new string [] { }; } set { } } /// /// Gets and sets the album of the media represented by the /// current instance. /// /// /// A object containing the album of /// the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "ALBUM" Tag. /// public override string Album { get { return album; } set { album = value; } } /// /// Gets and sets the sort names for the Album Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Album Title of the media described by the current /// instance or null if no value is present. /// public override string AlbumSort { get { return null; } set { } } /// /// Gets and sets a user comment on the media represented by /// the current instance. /// /// /// A object containing user comments /// on the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "COMMENTS" Tag. /// public override string Comment { get { return comments; } set { comments = value; } } /// /// Gets and sets the genres of the media represented by the /// current instance. /// /// /// A containing the genres of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "GENRE" Tag. /// public override string [] Genres { get { string value = genres; if (value == null || value.Trim ().Length == 0) return new string [] { }; string [] result = value.Split (';'); for (int i = 0; i < result.Length; i++) { string genre = result [i].Trim (); byte genre_id; int closing = genre.IndexOf (')'); if (closing > 0 && genre [0] == '(' && byte.TryParse (genre.Substring ( 1, closing - 1), out genre_id)) genre = TagLib.Genres .IndexToAudio (genre_id); result [i] = genre; } return result; } set { genres = String.Join ("; ", value); } } /// /// Gets and sets the year that the media represented by the /// current instance was recorded. /// /// /// A containing the year that the media /// represented by the current instance was created or zero /// if no value is present. /// public override uint Year { get { return 0; } set { } } /// /// Gets and sets the position of the media represented by /// the current instance in its containing album. /// /// /// A containing the position of the /// media represented by the current instance in its /// containing album or zero if not specified. /// public override uint Track { get { return 0; } set { } } /// /// Gets and sets the number of tracks in the album /// containing the media represented by the current instance. /// /// /// A containing the number of tracks in /// the album containing the media represented by the current /// instance or zero if not specified. /// public override uint TrackCount { get { return 0; } set { } } /// /// Gets and sets the number of the disc containing the media /// represented by the current instance in the boxed set. /// /// /// A containing the number of the disc /// containing the media represented by the current instance /// in the boxed set. /// public override uint Disc { get { return 0; } set { } } /// /// Gets and sets the number of discs in the boxed set /// containing the media represented by the current instance. /// /// /// A containing the number of discs in /// the boxed set containing the media represented by the /// current instance or zero if not specified. /// public override uint DiscCount { get { return 0; } set { } } /// /// Gets and sets the lyrics or script of the media /// represented by the current instance. /// /// /// A object containing the lyrics or /// script of the media represented by the current instance /// or if no value is present. /// public override string Lyrics { get { return null; } set { } } /// /// Gets and sets the grouping on the album which the media /// in the current instance belongs to. /// /// /// A object containing the grouping on /// the album which the media in the current instance belongs /// to or if no value is present. /// public override string Grouping { get { return null; } set {} } /// /// Gets and sets the number of beats per minute in the audio /// of the media represented by the current instance. /// /// /// A containing the number of beats per /// minute in the audio of the media represented by the /// current instance, or zero if not specified. /// public override uint BeatsPerMinute { get { return 0; } set { } } /// /// Gets and sets the conductor or director of the media /// represented by the current instance. /// /// /// A object containing the conductor /// or director of the media represented by the current /// instance or if no value present. /// public override string Conductor { get { return null; } set { } } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "COPYRIGHT" Tag. /// public override string Copyright { get { return copyright; } set { copyright = value; } } /// /// Gets and sets the MusicBrainz Artist ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ArtistID for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzArtistId { get { return null; } set { } } /// /// Gets and sets the MusicBrainz Release ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseID for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzReleaseId { get { return null; } set { } } /// /// Gets and sets the MusicBrainz Release Artist ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseArtistID for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzReleaseArtistId { get { return null; } set { } } /// /// Gets and sets the MusicBrainz Track ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// TrackID for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzTrackId { get { return null; } set { } } /// /// Gets and sets the MusicBrainz Disc ID of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// DiscID for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzDiscId { get { return null; } set { } } /// /// Gets and sets the MusicIP PUID of /// the media described by the current instance. /// /// /// A containing the MusicIPPUID /// for the media described by the current instance or /// null if no value is present. /// public override string MusicIpId { get { return null; } set { } } // // Gets and sets the AmazonID of // the media described by the current instance. // // // A containing the AmazonID // for the media described by the current instance or // null if no value is present. // // // A definition on where to store the ASIN for // Windows Media is not currently defined // //public override string AmazonId { // get { return null; } // set {} //} /// /// Gets and sets the MusicBrainz Release Status of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseStatus for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzReleaseStatus { get { return null; } set { } } /// /// Gets and sets the MusicBrainz Release Type of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseType for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzReleaseType { get { return null; } set { } } /// /// Gets and sets the MusicBrainz Release Country of /// the media described by the current instance. /// /// /// A containing the MusicBrainz /// ReleaseCountry for the media described by the current /// instance or null if no value is present. /// public override string MusicBrainzReleaseCountry { get { return null; } set { } } /// /// Gets and sets a collection of pictures associated with /// the media represented by the current instance. /// /// /// A containing a collection of /// pictures associated with the media represented by the /// current instance or an empty array if none are present. /// public override IPicture [] Pictures { get { List l = new List (); return l.ToArray (); } set { } } /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance does not /// any values. Otherwise . /// public override bool IsEmpty { get { return false; } } /// /// Clears the values stored in the current instance. /// public override void Clear () { } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/SubtitleTrack.cs0000644000175000017500000000527611552201076023023 0ustar00alexalex00000000000000// // SubtitleTrack.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Matroska { /// /// Describes a Matroska Subtitle Track. /// public class SubtitleTrack : Track { #region Private fields private List unknown_elems = new List (); #endregion #region Constructors /// /// Constructs a parsing from provided /// file data. /// Parsing will be done reading from _file at position references by /// parent element's data section. /// /// instance to read from. /// Parent . public SubtitleTrack (File _file, EBMLElement element) : base (_file, element) { // Here we handle the unknown elements we know, and store the rest foreach (EBMLElement elem in base.UnknownElements) { MatroskaID matroska_id = (MatroskaID) elem.ID; switch (matroska_id) { default: unknown_elems.Add (elem); break; } } } #endregion #region Public fields /// /// List of unknown elements encountered while parsing. /// public new List UnknownElements { get { return unknown_elems; } } #endregion #region Public methods #endregion #region ICodec /// /// This type of track only has text media type. /// public override MediaTypes MediaTypes { get { return MediaTypes.Text; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/Track.cs0000644000175000017500000001132011552201076021272 0ustar00alexalex00000000000000// // Track.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Matroska { /// /// Describes a Matroska Track. /// public class Track : ICodec { #region Private fields #pragma warning disable 414 // Assigned, never used private uint track_number; private uint track_uid; private string track_codec_id; private string track_codec_name; private string track_name; private string track_language; private bool track_enabled; private bool track_default; private ByteVector codec_data; #pragma warning restore 414 private List unknown_elems = new List (); #endregion #region Constructors /// /// Constructs a parsing from provided /// file data. /// Parsing will be done reading from _file at position references by /// parent element's data section. /// /// instance to read from. /// Parent . public Track (File _file, EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (_file, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaTrackNumber: track_number = child.ReadUInt (); break; case MatroskaID.MatroskaTrackUID: track_uid = child.ReadUInt (); break; case MatroskaID.MatroskaCodecID: track_codec_id = child.ReadString (); break; case MatroskaID.MatroskaCodecName: track_codec_name = child.ReadString (); break; case MatroskaID.MatroskaTrackName: track_name = child.ReadString (); break; case MatroskaID.MatroskaTrackLanguage: track_language = child.ReadString (); break; case MatroskaID.MatroskaTrackFlagEnabled: track_enabled = child.ReadBool (); break; case MatroskaID.MatroskaTrackFlagDefault: track_default = child.ReadBool (); break; case MatroskaID.MatroskaCodecPrivate: codec_data = child.ReadBytes (); break; default: unknown_elems.Add (child); break; } i += child.Size; } } #endregion #region Public fields /// /// List of unknown elements encountered while parsing. /// public List UnknownElements { get { return unknown_elems; } } #endregion #region Public methods #endregion #region ICodec /// /// Describes track duration. /// public virtual TimeSpan Duration { get { return TimeSpan.Zero; } } /// /// Describes track media types. /// public virtual MediaTypes MediaTypes { get { return MediaTypes.None; } } /// /// Track description. /// public virtual string Description { get { return String.Format ("{0} {1}", track_codec_name, track_language); } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/File.cs0000644000175000017500000004474511552201076021126 0ustar00alexalex00000000000000// // File.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Matroska { /// /// Enumeration listing supported Matroska track types. /// public enum TrackType { /// /// Video track type. /// Video = 0x1, /// /// Audio track type. /// Audio = 0x2, /// /// Complex track type. /// Complex = 0x3, /// /// Logo track type. /// Logo = 0x10, /// /// Subtitle track type. /// Subtitle = 0x11, /// /// Buttons track type. /// Buttons = 0x12, /// /// Control track type. /// Control = 0x20 } /// /// This class extends to provide tagging /// and properties support for Matroska files. /// [SupportedMimeType ("taglib/mkv", "mkv")] [SupportedMimeType ("taglib/mka", "mka")] [SupportedMimeType ("taglib/mks", "mks")] [SupportedMimeType ("video/webm")] [SupportedMimeType ("video/x-matroska")] public class File : TagLib.File { #region Private Fields /// /// Contains the tags for the file. /// private Matroska.Tag tag = new Matroska.Tag (); /// /// Contains the media properties. /// private Properties properties; private UInt64 duration_unscaled; private uint time_scale; private TimeSpan duration; #pragma warning disable 414 // Assigned, never used private string title; #pragma warning restore 414 private List tracks = new List (); #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified path in the local file /// system and specified read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (string path, ReadStyle propertiesStyle) : this (new File.LocalFileAbstraction (path), propertiesStyle) { } /// /// Constructs and initializes a new instance of for a specified path in the local file /// system with an average read style. /// /// /// A object containing the path of the /// file to use in the new instance. /// /// /// is . /// public File (string path) : this (path, ReadStyle.Average) { } /// /// Constructs and initializes a new instance of for a specified file abstraction and /// specified read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// /// /// is . /// public File (File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base (abstraction) { Mode = AccessMode.Read; try { Read (propertiesStyle); TagTypesOnDisk = TagTypes; } finally { Mode = AccessMode.Closed; } List codecs = new List (); foreach (Track track in tracks) { codecs.Add (track); } properties = new Properties (duration, codecs); } /// /// Constructs and initializes a new instance of for a specified file abstraction with an /// average read style. /// /// /// A object to use when /// reading from and writing to the file. /// /// /// is . /// public File (File.IFileAbstraction abstraction) : this (abstraction, ReadStyle.Average) { } #endregion #region Public Methods /// /// Saves the changes made in the current instance to the /// file it represents. /// public override void Save () { Mode = AccessMode.Write; try { } finally { Mode = AccessMode.Closed; } } /// /// Removes a set of tag types from the current instance. /// /// /// A bitwise combined value /// containing tag types to be removed from the file. /// /// /// In order to remove all tags from a file, pass as . /// public override void RemoveTags (TagLib.TagTypes types) { } /// /// Gets a tag of a specified type from the current instance, /// optionally creating a new tag if possible. /// /// /// A value indicating the /// type of tag to read. /// /// /// A value specifying whether or not to /// try and create the tag if one is not found. /// /// /// A object containing the tag that was /// found in or added to the current instance. If no /// matching tag was found and none was created, is returned. /// public override TagLib.Tag GetTag (TagLib.TagTypes type, bool create) { return null; } #endregion #region Public Properties /// /// Gets a abstract representation of all tags stored in the /// current instance. /// /// /// A object representing all tags /// stored in the current instance. /// public override TagLib.Tag Tag { get { return tag; } } /// /// Gets the media properties of the file represented by the /// current instance. /// /// /// A object containing the /// media properties of the file represented by the current /// instance. /// public override TagLib.Properties Properties { get { return properties; } } #endregion #region Private Methods /// /// Reads the file with a specified read style. /// /// /// A value specifying at what level /// of accuracy to read the media properties, or to ignore the properties. /// private void Read (ReadStyle propertiesStyle) { ulong offset = 0; while (offset < (ulong) Length) { EBMLElement element = new EBMLElement (this, offset); EBMLID ebml_id = (EBMLID) element.ID; MatroskaID matroska_id = (MatroskaID) element.ID; switch (ebml_id) { case EBMLID.EBMLHeader: ReadHeader (element); break; default: break; } switch (matroska_id) { case MatroskaID.MatroskaSegment: ReadSegment (element); break; default: break; } offset += element.Size; } } private void ReadHeader (EBMLElement element) { string doctype = null; ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); EBMLID ebml_id = (EBMLID) child.ID; switch (ebml_id) { case EBMLID.EBMLDocType: doctype = child.ReadString (); break; default: break; } i += child.Size; } // Check DocType if (String.IsNullOrEmpty (doctype) || (doctype != "matroska" && doctype != "webm")) { throw new UnsupportedFormatException ("DocType is not matroska or webm"); } } private void ReadSegment (EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaTracks: ReadTracks (child); break; case MatroskaID.MatroskaSegmentInfo: ReadSegmentInfo (child); break; case MatroskaID.MatroskaTags: ReadTags (child); break; case MatroskaID.MatroskaCluster: // Get out of here when we reach the clusters for now. return; default: break; } i += child.Size; } } private void ReadTags (EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaTag: ReadTag (child); break; default: break; } i += child.Size; } } private void ReadTag (EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaSimpleTag: ReadSimpleTag (child); break; default: break; } i += child.Size; } } private void ReadSimpleTag (EBMLElement element) { ulong i = 0; #pragma warning disable 219 // Assigned, never read string tag_name = null, tag_language = null, tag_string = null; #pragma warning restore 219 while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaTagName: tag_name = child.ReadString (); break; case MatroskaID.MatroskaTagLanguage: tag_language = child.ReadString (); break; case MatroskaID.MatroskaTagString: tag_string = child.ReadString (); break; default: break; } i += child.Size; } if (tag_name == "AUTHOR") { tag.Performers = new string [] { tag_string }; } else if (tag_name == "TITLE") { tag.Title = tag_string; } else if (tag_name == "ALBUM") { tag.Album = tag_string; } else if (tag_name == "COMMENTS") { tag.Comment = tag_string; } } private void ReadSegmentInfo (EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaDuration: duration_unscaled = (UInt64) child.ReadDouble (); if (time_scale > 0) { duration = TimeSpan.FromSeconds (duration_unscaled * time_scale / 1000000000); } break; case MatroskaID.MatroskaTimeCodeScale: time_scale = child.ReadUInt (); if (duration_unscaled > 0) { duration = TimeSpan.FromSeconds (duration_unscaled * time_scale / 1000000000); } break; case MatroskaID.MatroskaTitle: title = child.ReadString (); break; default: break; } i += child.Size; } } private void ReadTracks (EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaTrackEntry: ReadTrackEntry (child); break; default: break; } i += child.Size; } } private void ReadTrackEntry (EBMLElement element) { ulong i = 0; while (i < element.DataSize) { EBMLElement child = new EBMLElement (this, element.DataOffset + i); MatroskaID matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaTrackType: { TrackType track_type = (TrackType) child.ReadUInt (); switch (track_type) { case TrackType.Video: { VideoTrack track = new VideoTrack (this, element); tracks.Add (track); break; } case TrackType.Audio: { AudioTrack track = new AudioTrack (this, element); tracks.Add (track); break; } case TrackType.Subtitle: { SubtitleTrack track = new SubtitleTrack (this, element); tracks.Add (track); break; } default: break; } break; } default: break; } i += child.Size; } } #endregion #region Private Properties #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/VideoTrack.cs0000644000175000017500000001376611552201076022301 0ustar00alexalex00000000000000// // VideoTrack.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System.Collections.Generic; using System; namespace TagLib.Matroska { /// /// Enumeration describing supported Video Aspect Ratio types. /// public enum VideoAspectRatioType { /// /// Free Aspect Ratio. /// AspectRatioModeFree = 0x0, /// /// Keep Aspect Ratio. /// AspectRatioModeKeep = 0x1, /// /// Fixed Aspect Ratio. /// AspectRatioModeFixed = 0x2 } /// /// Describes a Matroska Video Track. /// public class VideoTrack : Track, IVideoCodec { #region Private fields #pragma warning disable 414 // Assigned, never used private uint width; private uint height; private uint disp_width; private uint disp_height; private double framerate; private bool interlaced; private VideoAspectRatioType ratio_type; private ByteVector fourcc; #pragma warning restore 414 private List unknown_elems = new List (); #endregion #region Constructors /// /// Constructs a parsing from provided /// file data. /// Parsing will be done reading from _file at position references by /// parent element's data section. /// /// instance to read from. /// Parent . public VideoTrack (File _file, EBMLElement element) : base (_file, element) { MatroskaID matroska_id; // Here we handle the unknown elements we know, and store the rest foreach (EBMLElement elem in base.UnknownElements) { matroska_id = (MatroskaID) elem.ID; if (matroska_id == MatroskaID.MatroskaTrackVideo) { ulong i = 0; while (i < elem.DataSize) { EBMLElement child = new EBMLElement (_file, elem.DataOffset + i); matroska_id = (MatroskaID) child.ID; switch (matroska_id) { case MatroskaID.MatroskaVideoDisplayWidth: disp_width = child.ReadUInt (); break; case MatroskaID.MatroskaVideoDisplayHeight: disp_height = child.ReadUInt (); break; case MatroskaID.MatroskaVideoPixelWidth: width = child.ReadUInt (); break; case MatroskaID.MatroskaVideoPixelHeight: height = child.ReadUInt (); break; case MatroskaID.MatroskaVideoFrameRate: framerate = child.ReadDouble (); break; case MatroskaID.MatroskaVideoFlagInterlaced: interlaced = child.ReadBool (); break; case MatroskaID.MatroskaVideoAspectRatioType: ratio_type = (VideoAspectRatioType) child.ReadUInt (); break; case MatroskaID.MatroskaVideoColourSpace: fourcc = child.ReadBytes (); break; default: unknown_elems.Add (child); break; } i += child.Size; } } else if (matroska_id == MatroskaID.MatroskaTrackDefaultDuration) { uint tmp = elem.ReadUInt (); framerate = 1000000000.0 / (double) tmp; } else { unknown_elems.Add (elem); } } } #endregion #region Public fields /// /// List of unknown elements encountered while parsing. /// public new List UnknownElements { get { return unknown_elems; } } #endregion #region Public methods #endregion #region ICodec /// /// This type of track only has video media type. /// public override MediaTypes MediaTypes { get { return MediaTypes.Video; } } #endregion #region IVideoCodec /// /// Describes video track width in pixels. /// public int VideoWidth { get { return (int) width; } } /// /// Describes video track height in pixels. /// public int VideoHeight { get { return (int) height; } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Matroska/MatroskaIDs.cs0000644000175000017500000003152511552201076022420 0ustar00alexalex00000000000000// // MatroskaIDs.cs: // // Author: // Julien Moutte // // Copyright (C) 2011 FLUENDO S.A. // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.Matroska { /// /// Public enumeration listing Matroska specific EBML Identifiers. /// public enum MatroskaID { /// /// Indicates a Matroska Segment EBML element. /// MatroskaSegment = 0x18538067, /// /// Indicates a Matroska Segment Info EBML element. /// MatroskaSegmentInfo = 0x1549A966, /// /// Indicates a Matroska Tracks EBML Element. /// MatroskaTracks = 0x1654AE6B, /// /// Indicates a Matroska Cues EBML element. /// MatroskaCues = 0x1C53BB6B, /// /// Indicates a Matroska Tags EBML element. /// MatroskaTags = 0x1254C367, /// /// Indicates a Matroska Seek Head EBML element. /// MatroskaSeekHead = 0x114D9B74, /// /// Indicates a Matroska Cluster EBML element. /// MatroskaCluster = 0x1F43B675, /// /// Indicates a Matroska Attachments EBML element. /// MatroskaAttachments = 0x1941A469, /// /// Indicates a Matroska Chapters EBML element. /// MatroskaChapters = 0x1043A770, /* IDs in the SegmentInfo master */ /// /// Indicate a Matroska Code Scale EBML element. /// MatroskaTimeCodeScale = 0x2AD7B1, /// /// Indicates a Matroska Duration EBML element. /// MatroskaDuration = 0x4489, /// /// Indicates a Matroska Writing App EBML element. /// MatroskaWrittingApp = 0x5741, /// /// Indicates a Matroska Muxing App EBML element. /// MatroskaMuxingApp = 0x4D80, /// /// Indicate a Matroska Date UTC EBML element. /// MatroskaDateUTC = 0x4461, /// /// Indicate a Matroska Segment UID EBML element. /// MatroskaSegmentUID = 0x73A4, /// /// Indicate a Matroska Segment File Name EBML element. /// MatroskaSegmentFileName = 0x7384, /// /// Indicate a Matroska Prev UID EBML element. /// MatroskaPrevUID = 0x3CB923, /// /// Indicate a Matroska Prev File Name EBML element. /// MatroskaPrevFileName = 0x3C83AB, /// /// Indicate a Matroska Nex UID EBML element. /// MatroskaNexUID = 0x3EB923, /// /// Indicate a Matroska Nex File Name EBML element. /// MatroskaNexFileName = 0x3E83BB, /// /// Indicate a Matroska Title EBML element. /// MatroskaTitle = 0x7BA9, /// /// Indicate a Matroska Segment Family EBML element. /// MatroskaSegmentFamily = 0x4444, /// /// Indicate a Matroska Chapter Translate EBML element. /// MatroskaChapterTranslate = 0x6924, /* ID in the Tracks master */ /// /// Indicate a Matroska Track Entry EBML element. /// MatroskaTrackEntry = 0xAE, /* IDs in the TrackEntry master */ /// /// Indicate a Matroska Track Number EBML element. /// MatroskaTrackNumber = 0xD7, /// /// Indicate a Matroska Track UID EBML element. /// MatroskaTrackUID = 0x73C5, /// /// Indicate a Matroska Track Type EBML element. /// MatroskaTrackType = 0x83, /// /// Indicate a Matroska Track Audio EBML element. /// MatroskaTrackAudio = 0xE1, /// /// Indicate a Matroska Track Video EBML element. /// MatroskaTrackVideo = 0xE0, /// /// Indicate a Matroska Track Encoding EBML element. /// MatroskaContentEncodings = 0x6D80, /// /// Indicate a Matroska Codec ID EBML element. /// MatroskaCodecID = 0x86, /// /// Indicate a Matroska Codec Private EBML element. /// MatroskaCodecPrivate = 0x63A2, /// /// Indicate a Matroska Codec Name EBML element. /// MatroskaCodecName = 0x258688, /// /// Indicate a Matroska Track Name EBML element. /// MatroskaTrackName = 0x536E, /// /// Indicate a Matroska Track Language EBML element. /// MatroskaTrackLanguage = 0x22B59C, /// /// Indicate a Matroska Track Enabled EBML element. /// MatroskaTrackFlagEnabled = 0xB9, /// /// Indicate a Matroska Track Flag Default EBML element. /// MatroskaTrackFlagDefault = 0x88, /// /// Indicate a Matroska Track Flag Forced EBML element. /// MatroskaTrackFlagForced = 0x55AA, /// /// Indicate a Matroska Track Flag Lacing EBML element. /// MatroskaTrackFlagLacing = 0x9C, /// /// Indicate a Matroska Track Min Cache EBML element. /// MatroskaTrackMinCache = 0x6DE7, /// /// Indicate a Matroska Track Max Cache EBML element. /// MatroskaTrackMaxCache = 0x6DF8, /// /// Indicate a Matroska Track Default Duration EBML element. /// MatroskaTrackDefaultDuration = 0x23E383, /// /// Indicate a Matroska Track Time Code Scale EBML element. /// MatroskaTrackTimeCodeScale = 0x23314F, /// /// Indicate a Matroska Track Max Block Addition EBML element. /// MatroskaMaxBlockAdditionID = 0x55EE, /// /// Indicate a Matroska Track Attachment Link EBML element. /// MatroskaTrackAttachmentLink = 0x7446, /// /// Indicate a Matroska Track Overlay EBML element. /// MatroskaTrackOverlay = 0x6FAB, /// /// Indicate a Matroska Track Translate EBML element. /// MatroskaTrackTranslate = 0x6624, /// /// Indicate a Matroska Track Offset element. /// MatroskaTrackOffset = 0x537F, /// /// Indicate a Matroska Codec Settings EBML element. /// MatroskaCodecSettings = 0x3A9697, /// /// Indicate a Matroska Codec Info URL EBML element. /// MatroskaCodecInfoUrl = 0x3B4040, /// /// Indicate a Matroska Codec Download URL EBML element. /// MatroskaCodecDownloadUrl = 0x26B240, /// /// Indicate a Matroska Codec Decode All EBML element. /// MatroskaCodecDecodeAll = 0xAA, /* IDs in the TrackVideo master */ /* NOTE: This one is here only for backward compatibility. * Use _TRACKDEFAULDURATION */ /// /// Indicate a Matroska Video Frame Rate EBML element. /// MatroskaVideoFrameRate = 0x2383E3, /// /// Indicate a Matroska Video Display Width EBML element. /// MatroskaVideoDisplayWidth = 0x54B0, /// /// Indicate a Matroska Video Display Height EBML element. /// MatroskaVideoDisplayHeight = 0x54BA, /// /// Indicate a Matroska Video Display Unit EBML element. /// MatroskaVideoDisplayUnit = 0x54B2, /// /// Indicate a Matroska Video Pixel Width EBML element. /// MatroskaVideoPixelWidth = 0xB0, /// /// Indicate a Matroska Video Pixel Height EBML element. /// MatroskaVideoPixelHeight = 0xBA, /// /// Indicate a Matroska Video Pixel Crop Bottom EBML element. /// MatroskaVideoPixelCropBottom = 0x54AA, /// /// Indicate a Matroska Video Pixel Crop Top EBML element. /// MatroskaVideoPixelCropTop = 0x54BB, /// /// Indicate a Matroska Video Pixel Crop Left EBML element. /// MatroskaVideoPixelCropLeft = 0x54CC, /// /// Indicate a Matroska Video Pixel Crop Right EBML element. /// MatroskaVideoPixelCropRight = 0x54DD, /// /// Indicate a Matroska Video Flag Interlaced EBML element. /// MatroskaVideoFlagInterlaced = 0x9A, /// /// Indicate a Matroska Video Stereo Mode EBML element. /// MatroskaVideoStereoMode = 0x53B8, /// /// Indicate a Matroska Video Aspect Ratio Type EBML element. /// MatroskaVideoAspectRatioType = 0x54B3, /// /// Indicate a Matroska Video Colour Space EBML element. /// MatroskaVideoColourSpace = 0x2EB524, /// /// Indicate a Matroska Video Gamma Value EBML element. /// MatroskaVideoGammaValue = 0x2FB523, /* IDs in the TrackAudio master */ /// /// Indicate a Matroska Audio Sampling Freq EBML element. /// MatroskaAudioSamplingFreq = 0xB5, /// /// Indicate a Matroska Audio Bit Depth EBML element. /// MatroskaAudioBitDepth = 0x6264, /// /// Indicate a Matroska Audio Channels EBML element. /// MatroskaAudioChannels = 0x9F, /// /// Indicate a Matroska Audio Channels Position EBML element. /// MatroskaAudioChannelsPositions = 0x7D7B, /// /// Indicate a Matroska Audio Output Sampling Freq EBML element. /// MatroskaAudioOutputSamplingFreq = 0x78B5, /* IDs in the Tags master */ /// /// Indicate a Matroska Tag EBML element. /// MatroskaTag = 0x7373, /* in the Tag master */ /// /// Indicate a Matroska Simple Tag EBML element. /// MatroskaSimpleTag = 0x67C8, /// /// Indicate a Matroska Targets EBML element. /// MatroskaTargets = 0x63C0, /* in the SimpleTag master */ /// /// Indicate a Matroska Tag Name EBML element. /// MatroskaTagName = 0x45A3, /// /// Indicate a Matroska Tag String EBML element. /// MatroskaTagString = 0x4487, /// /// Indicate a Matroska Tag Language EBML element. /// MatroskaTagLanguage = 0x447A, /// /// Indicate a Matroska Tag Default EBML element. /// MatroskaTagDefault = 0x4484, /// /// Indicate a Matroska Tag Binary EBML element. /// MatroskaTagBinary = 0x4485 } } taglib-sharp-2.1.0.0/src/TagLib/Ape/0000755000175000017500000000000011774620111016627 5ustar00alexalex00000000000000taglib-sharp-2.1.0.0/src/TagLib/Ape/Item.cs0000644000175000017500000003441311442021373020056 0ustar00alexalex00000000000000// // Item.cs: Provides a representation of an APEv2 tag item which can be read // from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // apeitem.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2004 by Allan Sandfeld Jensen (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Ape { /// /// Indicates the type of data stored in a /// object. /// public enum ItemType { /// /// The item contains Unicode text. /// Text = 0, /// /// The item contains binary data. /// Binary = 1, /// /// The item contains a locator (file path/URL) for external /// information. /// Locator = 2 } /// /// This class provides a representation of an APEv2 tag item which /// can be read from and written to disk. /// public class Item : ICloneable { #region Private Fields /// /// Contains the type of data stored in the item. /// private ItemType type = ItemType.Text; /// /// Contains the item key. /// private string key = null; /// /// Contains the item value. /// private ReadOnlyByteVector data = null; /// /// Contains the item text. /// private string [] text = null; /// /// Indicates whether or not the item is read only. /// private bool read_only = false; /// /// Contains the size of the item on disk. /// private int size_on_disk; #endregion #region Constructors /// /// Constructs and initializes a new instance of by reading in a raw APEv2 item. /// /// /// A object containing the item to /// read. /// /// /// A value specifying the offset in /// at which the item data begins. /// /// /// is . /// /// /// is less than zero. /// /// /// A complete item could not be read. /// public Item (ByteVector data, int offset) { if (data == null) throw new ArgumentNullException ("data"); Parse (data, offset); } /// /// Constructs and initializes a new instance of with a specified key and value. /// /// /// A object containing the key to use /// for the current instance. /// /// /// A object containing the value to /// store in the new instance. /// /// /// or is /// . /// public Item (string key, string value) { if (key == null) throw new ArgumentNullException ("key"); if (value == null) throw new ArgumentNullException ("value"); this.key = key; this.text = new string [] {value}; } /// /// Constructs and initializes a new instance of with a specified key and collection of /// values. /// /// /// A object containing the key to use /// for the current instance. /// /// /// A containing the values to store /// in the new instance. /// /// /// or is /// . /// public Item (string key, params string [] value) { if (key == null) throw new ArgumentNullException ("key"); if (value == null) throw new ArgumentNullException ("value"); this.key = key; this.text = (string[]) value.Clone (); } /// /// Constructs and initializes a new instance of with a specified key and collection of /// values. /// /// /// A object containing the key to use /// for the current instance. /// /// /// A object containing the /// values to store in the new instance. /// /// /// or is /// . /// /// [Obsolete("Use Item(string,string[])")] public Item (string key, StringCollection value) { if (key == null) throw new ArgumentNullException ("key"); if (value == null) throw new ArgumentNullException ("value"); this.key = key; this.text = value.ToArray (); } /// /// Constructs and initializes a new instance of with a specified key and raw data. /// /// /// A object containing the key to use /// for the current instance. /// /// /// A object containing the /// values to store in the new instance. /// /// /// This constructor automatically marks the new instance as /// . /// /// /// or is /// . /// /// public Item (string key, ByteVector value) { this.key = key; this.type = ItemType.Binary; data = value as ReadOnlyByteVector; if (data == null) data = new ReadOnlyByteVector (value); } private Item (Item item) { type = item.type; key = item.key; if (item.data != null) data = new ReadOnlyByteVector (item.data); if (item.text != null) text = (string[]) item.text.Clone (); read_only = item.read_only; size_on_disk = item.size_on_disk; } #endregion #region Public Properties /// /// Gets the key used to identify the current instance. /// /// /// A object containing the key used to /// identify the current instance. /// /// /// This value is used for specifying the contents of the /// item in a common and consistant fashion. For example, /// "TITLE" specifies that the item contains the title /// of the track. /// public string Key { get {return key;} } /// /// Gets the binary value stored in the current instance. /// /// /// A object containing the binary /// value stored in the current instance, or if the item contains text. /// public ByteVector Value { get {return (type == ItemType.Binary) ? data : null;} } /// /// Gets the size of the current instance as it last appeared /// on disk. /// /// /// A value containing the size of the /// current instance as it last appeared on disk. /// public int Size { get {return size_on_disk;} } /// /// Gets and sets the type of value contained in the /// current instance. /// /// /// A value indicating the type of /// value contained in the current instance. /// public ItemType Type { get {return type;} set {type = value;} } /// /// Gets and sets whether or not the current instance is /// flagged as read-only on disk. /// /// /// A value indicating whether or not the /// current instance is flagged as read-only on disk. /// public bool ReadOnly { get {return read_only;} set {read_only = value;} } /// /// Gets whether or not the current instance is empty. /// /// /// A value indicating whether or not the /// current instance contains no value. /// public bool IsEmpty { get { if (type != ItemType.Binary) return text == null || text.Length == 0; else return data == null || data.IsEmpty; } } #endregion #region Public Methods /// /// Gets the contents of the current instance as a . /// /// /// A object containing the text /// stored in the current instance, or if the item is empty of contains binary data. /// If the current instance contains multiple string /// values, they will be returned as a comma separated /// value. /// public override string ToString () { if (type == ItemType.Binary || text == null) return null; else return string.Join (", ", text); } /// /// Gets the contents of the current instance as a array. /// /// /// A containing the text stored in /// the current instance, or an empty array if the item /// contains binary data. /// public string [] ToStringArray () { if (type == ItemType.Binary || text == null) return new string [0]; return text; } /// /// Renders the current instance as an APEv2 item. /// /// /// A object containing the /// rendered version of the current instance. /// public ByteVector Render () { uint flags = (uint) ((ReadOnly) ? 1 : 0) | ((uint) Type << 1); if (IsEmpty) return new ByteVector (); ByteVector result = null; if (type == ItemType.Binary) { if (text == null && data != null) result = data; } if (result == null && text != null) { result = new ByteVector (); for (int i = 0; i < text.Length; i ++) { if (i != 0) result.Add ((byte) 0); result.Add (ByteVector.FromString ( text [i], StringType.UTF8)); } } // If no data is stored, don't write the item. if (result == null || result.Count == 0) return new ByteVector (); ByteVector output = new ByteVector (); output.Add (ByteVector.FromUInt ((uint) result.Count, false)); output.Add (ByteVector.FromUInt (flags, false)); output.Add (ByteVector.FromString (key, StringType.UTF8)); output.Add ((byte) 0); output.Add (result); size_on_disk = output.Count; return output; } #endregion #region Protected Methods /// /// Populates the current instance by reading in a raw APEv2 /// item. /// /// /// A object containing the item to /// read. /// /// /// A value specifying the offset in /// at which the item data begins. /// /// /// is . /// /// /// is less than zero. /// /// /// A complete item could not be read. /// protected void Parse (ByteVector data, int offset) { if (data == null) throw new ArgumentNullException ("data"); if (offset < 0) throw new ArgumentOutOfRangeException ("offset"); // 11 bytes is the minimum size for an APE item if(data.Count < offset + 11) throw new CorruptFileException ( "Not enough data for APE Item"); uint value_length = data.Mid (offset, 4).ToUInt (false); uint flags = data.Mid (offset + 4, 4).ToUInt (false); ReadOnly = (flags & 1) == 1; Type = (ItemType) ((flags >> 1) & 3); int pos = data.Find (ByteVector.TextDelimiter ( StringType.UTF8), offset + 8); key = data.ToString (StringType.UTF8, offset + 8, pos - offset - 8); if (value_length > data.Count - pos - 1) throw new CorruptFileException ( "Invalid data length."); size_on_disk = pos + 1 + (int) value_length - offset; if (Type == ItemType.Binary) this.data = new ReadOnlyByteVector ( data.Mid (pos + 1, (int) value_length)); else this.text = data.Mid (pos + 1, (int) value_length).ToStrings ( StringType.UTF8, 0); } #endregion #region ICloneable /// /// Creates a deep copy of the current instance. /// /// /// A new object identical to the current /// instance. /// public Item Clone () { return new Item (this); } object ICloneable.Clone () { return Clone (); } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ape/StreamHeader.cs0000644000175000017500000002333611442021373021526 0ustar00alexalex00000000000000// // StreamHeader.cs: Provides support for reading Monkey's Audio APE stream // properties. // // Author: // Helmut Wahrmann // // Copyright (C) 2007 Helmut Wahrmann // Copyright (C) 2007 Brian Nickel // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Globalization; namespace TagLib.Ape { /// /// Indicates the compression level used when encoding a Monkey's /// Audio APE file. /// public enum CompressionLevel { /// /// The audio is not compressed. /// None = 0, /// /// The audio is mildly compressed. /// Fast = 1000, /// /// The audio is compressed at a normal level. /// Normal = 2000, /// /// The audio is highly compressed. /// High = 3000, /// /// The audio is extremely highly compressed. /// ExtraHigh = 4000, /// /// The audio is compressed to an insane level. /// Insane } /// /// This struct implements to provide /// support for reading Monkey's Audio APE stream properties. /// public struct StreamHeader : IAudioCodec, ILosslessAudioCodec { #region Private Fields /// /// Contains the APE version. /// /// /// This value is stored in bytes (4,5) of the file and is /// 1000 times the actual version number, so 3810 indicates /// version 3.81. /// private ushort version; // Ape Header (24 bytes) starting at Offest 52 into the file /// /// Contains the compression level. /// /// /// This value is stored in bytes (51,52). /// private CompressionLevel compression_level; /* /// /// Contains the format flags. /// /// /// This value is stored in bytes (53,54). /// private ushort format_flags; */ /// /// Contains the number of audio blocks in one frame. /// /// /// This value is stored in bytes (55-58). /// private uint blocks_per_frame; /// /// Contains the number of audio blocks in the final frame. /// /// /// This value is stored in bytes (59-62). /// private uint final_frame_blocks; /// /// Contains the total number of frames. /// /// /// This value is stored in bytes (63-66). /// private uint total_frames; /// /// Contains the number of bits per sample. /// /// /// This value is stored in bytes (67,68) and is typically /// 16. /// private ushort bits_per_sample; /// /// Contains the number of channels. /// /// /// This value is stored in bytes (69,70) and is typically /// 1 or 2. /// private ushort channels; /// /// Contains the sample rate. /// /// /// This value is stored in bytes (71-74) and is typically /// 44100. /// private uint sample_rate; /// /// Contains the length of the audio stream. /// /// /// This value is provided by the constructor. /// private long stream_length; #endregion #region Public Static Fields /// /// The size of a Monkey Audio header. /// public const uint Size = 76; /// /// The identifier used to recognize a WavPack file. /// /// /// "MAC " /// public static readonly ReadOnlyByteVector FileIdentifier = "MAC "; #endregion #region Constructors /// /// Constructs and initializes a new instance of for a specified header block and /// stream length. /// /// /// A object containing the stream /// header data. /// /// /// A value containing the length of the /// Monkey Audio stream in bytes. /// /// /// is . /// /// /// does not begin with or is less than bytes long. /// public StreamHeader(ByteVector data, long streamLength) { if (data == null) throw new ArgumentNullException("data"); if (!data.StartsWith(FileIdentifier)) throw new CorruptFileException( "Data does not begin with identifier."); if (data.Count < Size) throw new CorruptFileException( "Insufficient data in stream header"); stream_length = streamLength; version = data.Mid (4, 2).ToUShort(false); compression_level = (CompressionLevel) data.Mid(52, 2) .ToUShort(false); // format_flags = data.Mid(54, 2).ToUShort(false); blocks_per_frame = data.Mid(56, 4).ToUInt(false); final_frame_blocks = data.Mid(60, 4).ToUInt(false); total_frames = data.Mid(64, 4).ToUInt(false); bits_per_sample = data.Mid(68, 2).ToUShort(false); channels = data.Mid(70, 2).ToUShort(false); sample_rate = data.Mid(72, 4).ToUInt(false); } #endregion #region Public Properties /// /// Gets the duration of the media represented by the current /// instance. /// /// /// A containing the duration of the /// media represented by the current instance. /// public TimeSpan Duration { get { if (sample_rate <= 0 || total_frames <= 0) return TimeSpan.Zero; return TimeSpan.FromSeconds ( (double) ((total_frames - 1) * blocks_per_frame + final_frame_blocks) / (double) sample_rate); } } /// /// Gets the types of media represented by the current /// instance. /// /// /// Always . /// public MediaTypes MediaTypes { get {return MediaTypes.Audio;} } /// /// Gets a text description of the media represented by the /// current instance. /// /// /// A object containing a description /// of the media represented by the current instance. /// public string Description { get { return string.Format( CultureInfo.InvariantCulture, "Monkey's Audio APE Version {0:0.000}", Version); } } /// /// Gets the bitrate of the audio represented by the current /// instance. /// /// /// A value containing a bitrate of the /// audio represented by the current instance. /// public int AudioBitrate { get { TimeSpan d = Duration; if (d <= TimeSpan.Zero) return 0; return (int) ((stream_length * 8L) / d.TotalSeconds) / 1000; } } /// /// Gets the sample rate of the audio represented by the /// current instance. /// /// /// A value containing the sample rate of /// the audio represented by the current instance. /// public int AudioSampleRate { get {return (int)sample_rate;} } /// /// Gets the number of channels in the audio represented by /// the current instance. /// /// /// A value containing the number of /// channels in the audio represented by the current /// instance. /// public int AudioChannels { get {return channels;} } /// /// Gets the APE version of the audio represented by the /// current instance. /// /// /// A value containing the APE version /// of the audio represented by the current instance. /// public double Version { get {return (double) version / (double) 1000;} } /// /// Gets the number of bits per sample in the audio /// represented by the current instance. /// /// /// A value containing the number of bits /// per sample in the audio represented by the current /// instance. /// public int BitsPerSample { get {return bits_per_sample;} } /// /// Gets the level of compression used when encoding the /// audio represented by the current instance. /// /// /// A value indicating the /// level of compression used when encoding the audio /// represented by the current instance. /// public CompressionLevel Compression { get {return compression_level;} } #endregion } }taglib-sharp-2.1.0.0/src/TagLib/Ape/Tag.cs0000644000175000017500000013502411442021373017673 0ustar00alexalex00000000000000// // Tag.cs: Provides a representation of an APEv2 tag which can be read from and // written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // apetag.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2004 Allan Sandfeld Jensen (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; using System.Collections; using System.Collections.Generic; using System.Globalization; namespace TagLib.Ape { /// /// This class extends and implements to provide a representation of an APEv2 /// tag which can be read from and written to disk. /// public class Tag : TagLib.Tag, IEnumerable { #region Private Static Fields /// /// Contains names of picture fields, indexed to correspond /// to their picture item names. /// private static string [] picture_item_names = new string [] { "Cover Art (other)", "Cover Art (icon)", "Cover Art (other icon)", "Cover Art (front)", "Cover Art (back)", "Cover Art (leaflet)", "Cover Art (media)", "Cover Art (lead)", "Cover Art (artist)", "Cover Art (conductor)", "Cover Art (band)", "Cover Art (composer)", "Cover Art (lyricist)", "Cover Art (studio)", "Cover Art (recording)", "Cover Art (performance)", "Cover Art (movie scene)", "Cover Art (colored fish)", "Cover Art (illustration)", "Cover Art (band logo)", "Cover Art (publisher logo)" }; #endregion #region Private Fields /// /// Contains the tag footer. /// private Footer footer = new Footer (); /// /// Contains the items in the tag. /// private List items = new List (); #endregion #region Public Static Properties /// /// Specifies the identifier used find an APEv2 tag in a /// file. /// /// /// "APETAGEX" /// [Obsolete("Use Footer.FileIdentifer")] public static readonly ReadOnlyByteVector FileIdentifier = Footer.FileIdentifier; #endregion #region Constructors /// /// Constructs and initializes a new instance of with no contents. /// public Tag () { } /// /// Constructs and initializes a new instance of by reading the contents from a specified /// position in a specified file. /// /// /// A object containing the file /// from which the contents of the new instance is to be /// read. /// /// /// A value specify at what position to /// read the tag. /// /// /// is . /// /// /// is less than zero or greater /// than the size of the file. /// public Tag (TagLib.File file, long position) { if (file == null) throw new ArgumentNullException ("file"); if (position < 0 || position > file.Length - Footer.Size) throw new ArgumentOutOfRangeException ( "position"); Read (file, position); } /// /// Constructs and initializes a new instance of by reading the contents of a raw tag in a /// specified object. /// /// /// A object containing the raw /// tag. /// /// /// is . /// /// /// is too small to contain a tag, /// has a header where the footer should be, or is smaller /// than the tag it is supposed to contain. /// public Tag (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); if (data.Count < Footer.Size) throw new CorruptFileException ( "Does not contain enough footer data."); footer = new Footer ( data.Mid ((int) (data.Count - Footer.Size))); if (footer.TagSize == 0) throw new CorruptFileException ( "Tag size out of bounds."); // If we've read a header at the end of the block, the // block is invalid. if ((footer.Flags & FooterFlags.IsHeader) != 0) throw new CorruptFileException ( "Footer was actually header."); if (data.Count < footer.TagSize) throw new CorruptFileException ( "Does not contain enough tag data."); Parse (data.Mid ((int) (data.Count - footer.TagSize), (int) (footer.TagSize - Footer.Size))); } #endregion #region Public Properties /// /// Gets and sets whether or not the current instance has a /// header when rendered. /// /// /// A value indicating whether or not the /// current instance has a header when rendered. /// public bool HeaderPresent { get { return (footer.Flags & FooterFlags.HeaderPresent) != 0; } set { if (value) footer.Flags |= FooterFlags.HeaderPresent; else footer.Flags &= ~FooterFlags.HeaderPresent; } } #endregion #region Public Methods /// /// Adds a number to the value stored in a specified item. /// /// /// A object containing the key of the /// item to store the value in. /// /// /// A value containing the number to /// store. /// /// /// A value representing a total which /// is a part of, or zero if /// is not part of a set. /// /// /// If both and are equal to zero, the value will not be /// added. If is zero, by itself will be stored. Otherwise, the /// values will be stored as "/". /// /// /// is . /// public void AddValue (string key, uint number, uint count) { if (key == null) throw new ArgumentNullException ("key"); if (number == 0 && count == 0) return; else if (count != 0) AddValue (key, string.Format ( CultureInfo.InvariantCulture, "{0}/{1}", number, count)); else AddValue (key, number.ToString ( CultureInfo.InvariantCulture)); } /// /// Stores a number in a specified item. /// /// /// A object containing the key of the /// item to store the value in. /// /// /// A value containing the number to /// store. /// /// /// A value representing a total which /// is a part of, or zero if /// is not part of a set. /// /// /// If both and are equal to zero, the value will be /// cleared. If is zero, by itself will be stored. Otherwise, the /// values will be stored as "/". /// /// /// is . /// public void SetValue (string key, uint number, uint count) { if (key == null) throw new ArgumentNullException ("key"); if (number == 0 && count == 0) RemoveItem (key); else if (count != 0) SetValue (key, string.Format ( CultureInfo.InvariantCulture, "{0}/{1}", number, count)); else SetValue (key, number.ToString ( CultureInfo.InvariantCulture)); } /// /// Adds the contents of a to the value /// stored in a specified item. /// /// /// A object containing the key of the /// item to store the value in. /// /// /// A object containing the text to /// add. /// /// /// If is /// or empty, the value will not be added. /// /// /// is . /// public void AddValue (string key, string value) { if (key == null) throw new ArgumentNullException ("key"); if (string.IsNullOrEmpty (value)) return; AddValue (key, new string [] {value}); } /// /// Stores the contents of a in a /// specified item. /// /// /// A object containing the key of the /// item to store the value in. /// /// /// A object containing the text to /// store. /// /// /// If is /// or empty, the value will be cleared. /// /// /// is . /// public void SetValue (string key, string value) { if (key == null) throw new ArgumentNullException ("key"); if (string.IsNullOrEmpty (value)) RemoveItem (key); else SetValue (key, new string [] {value}); } /// /// Adds the contents of a to the /// value stored in a specified item. /// /// /// A object containing the key of the /// item to store the value in. /// /// /// A containing the text to add. /// /// /// If is /// or empty, the value will not be added. /// /// /// is . /// public void AddValue (string key, string [] value) { if (key == null) throw new ArgumentNullException ("key"); if (value == null || value.Length == 0) return; int index = GetItemIndex (key); List values = new List (); if (index >= 0) values.AddRange (items [index].ToStringArray ()); values.AddRange (value); Item item = new Item (key, values.ToArray ()); if (index >= 0) items [index] = item; else items.Add (item); } /// /// Stores the contents of a in a /// specified item. /// /// /// A object containing the key of the /// item to store the value in. /// /// /// A containing the text to store. /// /// /// If is /// or empty, the value will be cleared. /// /// /// is . /// public void SetValue (string key, string [] value) { if (key == null) throw new ArgumentNullException ("key"); if (value == null || value.Length == 0) { RemoveItem (key); return; } Item item = new Item (key, value); int index = GetItemIndex (key); if (index >= 0) items [index] = item; else items.Add (item); } /// /// Gets a specified item from the current instance. /// /// /// A object containing the key of the /// item to get from the current instance. /// /// /// The item with the matching name contained in the current /// instance, or if a matching object /// was not found. /// public Item GetItem (string key) { if (key == null) throw new ArgumentNullException ("key"); StringComparison comparison = StringComparison.InvariantCultureIgnoreCase; foreach (Item item in items) if (key.Equals (item.Key, comparison)) return item; return null; } /// /// Adds an item to the current instance, replacing the /// existing one of the same name. /// /// /// A object to add to the current /// instance. /// public void SetItem (Item item) { if (item == null) throw new ArgumentNullException ("item"); int index = GetItemIndex (item.Key); if (index >= 0) items [index] = item; else items.Add (item); } /// /// Removes the item with a specified key from the current /// instance. /// /// /// A object containing the key of the /// item to remove from the current instance. /// public void RemoveItem (string key) { if (key == null) throw new ArgumentNullException ("key"); StringComparison comparison = StringComparison.InvariantCultureIgnoreCase; for (int i = items.Count - 1; i >= 0; i --) if (key.Equals (items [i].Key, comparison)) items.RemoveAt (i); } /// /// Checks if an item exists. /// /// /// A object containing the key of the /// item to check. /// /// /// Returns if the /// exists - else is returned. /// /// /// is . /// public bool HasItem(string key) { if (key == null) throw new ArgumentNullException("key"); return GetItemIndex(key) >= 0; } /// /// Renders the current instance as a raw APEv2 tag. /// /// /// A object containing the /// rendered tag. /// public ByteVector Render () { ByteVector data = new ByteVector (); uint item_count = 0; foreach (Item item in items) { data.Add (item.Render ()); item_count ++; } footer.ItemCount = item_count; footer.TagSize = (uint) (data.Count + Footer.Size); HeaderPresent = true; data.Insert (0, footer.RenderHeader ()); data.Add (footer.RenderFooter ()); return data; } #endregion #region Protected Methods /// /// Populates the current instance be reading in a tag from /// a specified position in a specified file. /// /// /// A object to read the tag from. /// /// /// A value specifying the seek position /// at which to read the tag. /// /// /// is . /// /// /// is less than 0 or greater /// than the size of the file. /// protected void Read (TagLib.File file, long position) { if (file == null) throw new ArgumentNullException ("file"); file.Mode = File.AccessMode.Read; if (position < 0 || position > file.Length - Footer.Size) throw new ArgumentOutOfRangeException ( "position"); file.Seek (position); footer = new Footer (file.ReadBlock ((int)Footer.Size)); if (footer.TagSize == 0) throw new CorruptFileException ( "Tag size out of bounds."); // If we've read a header, we don't have to seek to read // the content. If we've read a footer, we need to move // back to the start of the tag. if ((footer.Flags & FooterFlags.IsHeader) == 0) file.Seek (position + Footer.Size - footer.TagSize); Parse (file.ReadBlock ((int)(footer.TagSize - Footer.Size))); } /// /// Populates the current instance by parsing the contents of /// a raw APEv2 tag, minus the header and footer. /// /// /// A object containing the content /// of an APEv2 tag, minus the header and footer. /// /// /// This method must only be called after the internal /// footer has been read from the file, otherwise the data /// cannot be parsed correctly. /// protected void Parse (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); int pos = 0; try { // 11 bytes is the minimum size for an APE item for (uint i = 0; i < footer.ItemCount && pos <= data.Count - 11; i++) { Item item = new Item (data, pos); SetItem (item); pos += item.Size; } } catch (CorruptFileException) { // A corrupt item was encountered, considered // the tag finished with what has been read. } } #endregion #region Private Methods /// /// Gets the index of an item in the current instance. /// /// /// A object containing the key to look /// for in the current instance. /// /// /// A value containing the index in at which the item appears, or -1 if the /// item was not found. /// /// /// Keys are compared in a case insensitive manner. /// private int GetItemIndex (string key) { StringComparison comparison = StringComparison.InvariantCultureIgnoreCase; for (int i = 0; i < items.Count; i ++) if (key.Equals (items [i].Key, comparison)) return i; return -1; } /// /// Gets the text value from a specified item. /// /// /// A object containing the key of the /// item to get the value from. /// /// /// A object containing the text of the /// specified frame, or if no value /// was found. /// private string GetItemAsString (string key) { Item item = GetItem (key); return item != null ? item.ToString () : null; } /// /// Gets the text values from a specified item. /// /// /// A object containing the key of the /// item to get the value from. /// /// /// A containing the text of the /// specified frame, or an empty array if no values were /// found. /// private string [] GetItemAsStrings (string key) { Item item = GetItem (key); return item != null ? item.ToStringArray () : new string [0]; } /// /// Gets an integer value from a "/" delimited list in a /// specified item. /// /// /// A object containing the key of the /// item to get the value from. /// /// /// A value specifying the index in the /// integer list of the value to return. /// /// /// A value read from the list in the /// frame, or 0 if the value wasn't found. /// private uint GetItemAsUInt32 (string key, int index) { string text = GetItemAsString (key); if (text == null) return 0; string [] values = text.Split (new char [] {'/'}, index + 2); if (values.Length < index + 1) return 0; uint result; if (uint.TryParse (values [index], out result)) return result; return 0; } #endregion #region IEnumerable /// /// Gets the enumerator for the current instance. /// /// /// A object enumerating through /// the item keys stored in the current instance. /// public IEnumerator GetEnumerator () { foreach (Item item in items) yield return item.Key; } /// /// Gets the enumerator for the current instance. /// /// /// A object enumerating through /// the item keys stored in the current instance. /// IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator (); } #endregion #region TagLib.Tag /// /// Gets the tag types contained in the current instance. /// /// /// Always . /// public override TagTypes TagTypes { get {return TagTypes.Ape;} } /// /// Gets and sets the title for the media described by the /// current instance. /// /// /// A object containing the title for /// the media described by the current instance or if no value is present. /// /// /// This property is implemented using the "Title" item. /// public override string Title { get { return GetItemAsString ("Title"); } set {SetValue ("Title", value);} } /// /// Gets and sets the sort names of the Title of the /// media represented by the current instance. /// /// /// A containing the sort names for /// the Title of the media described by the current instance, /// or null if no value is present. /// /// /// This property is implemented using the "TitleSort" item. /// public override string TitleSort { get { return GetItemAsString ("TitleSort"); } set { SetValue ("TitleSort", value); } } /// /// Gets and sets the performers or artists who performed in /// the media described by the current instance. /// /// /// A containing the performers or /// artists who performed in the media described by the /// current instance or an empty array if no value is /// present. /// /// /// This property is implemented using the "Artist" item. /// public override string [] Performers { get {return GetItemAsStrings ("Artist");} set {SetValue ("Artist", value);} } /// /// Gets and sets the sort names of the performers or artists /// who performed in the media described by the current instance. /// /// /// A array containing the sort names for /// the performers or artists who performed in the media /// described by the current instance, or an empty array if /// no value is present. /// /// /// This property is implemented using the "ArtistSort" field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string[] PerformersSort { get { return GetItemAsStrings ("ArtistSort"); } set { SetValue ("ArtistSort", value); } } /// /// Gets and sets the band or artist who is credited in the /// creation of the entire album or collection containing the /// media described by the current instance. /// /// /// A containing the band or artist /// who is credited in the creation of the entire album or /// collection containing the media described by the current /// instance or an empty array if no value is present. /// /// /// This property is implemented using the "Album Artist" /// item, and "AlbumArtist" as a backup property if it exists. /// public override string [] AlbumArtists { get { string[] list = GetItemAsStrings("Album Artist"); if (list.Length == 0) list = GetItemAsStrings("AlbumArtist"); return list; } set { SetValue("Album Artist", value); // compatibility if (HasItem("AlbumArtist")) SetValue("AlbumArtist", value); } } /// /// Gets and sets the sort names for the band or artist who /// is credited in the creation of the entire album or /// collection containing the media described by the /// current instance. /// /// /// A array containing the sort names /// for the band or artist who is credited in the creation /// of the entire album or collection containing the media /// described by the current instance or an empty array if /// no value is present. /// /// /// This property is implemented using the "AlbumArtistSort" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string[] AlbumArtistsSort { get { return GetItemAsStrings ("AlbumArtistSort"); } set { SetValue ("AlbumArtistSort", value); } } /// /// Gets and sets the composers of the media represented by /// the current instance. /// /// /// A containing the composers of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "Composer" item. /// public override string [] Composers { get {return GetItemAsStrings ("Composer");} set {SetValue ("Composer", value);} } /// /// Gets and sets the sort names for the composers of /// the media described by the current instance. /// /// /// A array containing the sort names /// for the composer of the media described by the current /// instance or an empty array if no value is present. /// /// /// This property is implemented using the "ComposerSort" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string[] ComposersSort { get { return GetItemAsStrings ("ComposerSort"); } set { SetValue ("ComposerSort", value); } } /// /// Gets and sets the album of the media represented by the /// current instance. /// /// /// A object containing the album of /// the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "Album" item. /// public override string Album { get {return GetItemAsString ("Album");} set {SetValue ("Album", value);} } /// /// Gets and sets the sort names for the Album Title of /// the media described by the current instance. /// /// /// A containing the sort name of /// the Album Title of the media described by the current /// instance or null if no value is present. /// /// /// This property is implemented using the "AlbumSort" /// field. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string AlbumSort { get { return GetItemAsString ("AlbumSort"); } set { SetValue ("AlbumSort", value); } } /// /// Gets and sets a user comment on the media represented by /// the current instance. /// /// /// A object containing user comments /// on the media represented by the current instance or if no value is present. /// /// /// This property is implemented using the "Comment" item. /// public override string Comment { get {return GetItemAsString ("Comment");} set {SetValue ("Comment", value);} } /// /// Gets and sets the genres of the media represented by the /// current instance. /// /// /// A containing the genres of the /// media represented by the current instance or an empty /// array if no value is present. /// /// /// This property is implemented using the "Genre" item. /// public override string [] Genres { get {return GetItemAsStrings ("Genre");} set {SetValue ("Genre", value);} } /// /// Gets and sets the year that the media represented by the /// current instance was recorded. /// /// /// A containing the year that the media /// represented by the current instance was created or zero /// if no value is present. /// /// /// This property is implemented using the "Year" item. /// public override uint Year { get { string text = GetItemAsString ("Year"); if (text == null || text.Length == 0) return 0; uint value; if (uint.TryParse (text, out value) || (text.Length >= 4 && uint.TryParse ( text.Substring (0, 4), out value))) return value; return 0; } set {SetValue ("Year", value, 0);} } /// /// Gets and sets the position of the media represented by /// the current instance in its containing album. /// /// /// A containing the position of the /// media represented by the current instance in its /// containing album or zero if not specified. /// /// /// This property is implemented using the "Track" item. /// public override uint Track { get {return GetItemAsUInt32 ("Track", 0);} set {SetValue ("Track", value, TrackCount);} } /// /// Gets and sets the number of tracks in the album /// containing the media represented by the current instance. /// /// /// A containing the number of tracks in /// the album containing the media represented by the current /// instance or zero if not specified. /// /// /// This property is implemented using the "Track" item. /// public override uint TrackCount { get {return GetItemAsUInt32 ("Track", 1);} set {SetValue ("Track", Track, value);} } /// /// Gets and sets the number of the disc containing the media /// represented by the current instance in the boxed set. /// /// /// A containing the number of the disc /// containing the media represented by the current instance /// in the boxed set. /// /// /// This property is implemented using the "Disc" item. /// public override uint Disc { get {return GetItemAsUInt32 ("Disc", 0);} set {SetValue ("Disc", value, DiscCount);} } /// /// Gets and sets the number of discs in the boxed set /// containing the media represented by the current instance. /// /// /// A containing the number of discs in /// the boxed set containing the media represented by the /// current instance or zero if not specified. /// /// /// This property is implemented using the "Disc" item. /// public override uint DiscCount { get {return GetItemAsUInt32 ("Disc", 1);} set {SetValue ("Disc", Disc, value);} } /// /// Gets and sets the lyrics or script of the media /// represented by the current instance. /// /// /// A object containing the lyrics or /// script of the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "Lyrics" item. /// public override string Lyrics { get {return GetItemAsString ("Lyrics");} set {SetValue ("Lyrics", value);} } /// /// Gets and sets the grouping on the album which the media /// in the current instance belongs to. /// /// /// A object containing the grouping on /// the album which the media in the current instance belongs /// to or if no value is present. /// /// /// This property is implemented using the "Grouping" item. /// public override string Grouping { get {return GetItemAsString ("Grouping");} set {SetValue ("Grouping", value);} } /// /// Gets and sets the number of beats per minute in the audio /// of the media represented by the current instance. /// /// /// A containing the number of beats per /// minute in the audio of the media represented by the /// current instance, or zero if not specified. /// /// /// This property is implemented using the "BPM" item. /// public override uint BeatsPerMinute { get { string text = GetItemAsString ("BPM"); if (text == null) return 0; double value; if (double.TryParse (text, out value)) return (uint) Math.Round (value); return 0; } set {SetValue ("BPM", value, 0);} } /// /// Gets and sets the conductor or director of the media /// represented by the current instance. /// /// /// A object containing the conductor /// or director of the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "Conductor" item. /// public override string Conductor { get {return GetItemAsString ("Conductor");} set {SetValue ("Conductor", value);} } /// /// Gets and sets the copyright information for the media /// represented by the current instance. /// /// /// A object containing the copyright /// information for the media represented by the current /// instance or if no value present. /// /// /// This property is implemented using the "Copyright" item. /// public override string Copyright { get {return GetItemAsString ("Copyright");} set {SetValue ("Copyright", value);} } /// /// Gets and sets the MusicBrainz Artist ID of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ArtistID for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_ARTISTID" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzArtistId { get {return GetItemAsString ("MUSICBRAINZ_ARTISTID");} set {SetValue ("MUSICBRAINZ_ARTISTID", value);} } /// /// Gets and sets the MusicBrainz Release ID of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseID for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMID" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseId { get {return GetItemAsString ("MUSICBRAINZ_ALBUMID");} set {SetValue ("MUSICBRAINZ_ALBUMID", value);} } /// /// Gets and sets the MusicBrainz Release Artist ID of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseArtistID for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMARTISTID" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseArtistId { get {return GetItemAsString ("MUSICBRAINZ_ALBUMARTISTID");} set {SetValue ("MUSICBRAINZ_ALBUMARTISTID", value);} } /// /// Gets and sets the MusicBrainz Track ID of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// TrackID for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_TRACKID" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzTrackId { get {return GetItemAsString ("MUSICBRAINZ_TRACKID");} set {SetValue ("MUSICBRAINZ_TRACKID", value);} } /// /// Gets and sets the MusicBrainz Disc ID of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// DiscID for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_DISCID" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzDiscId { get {return GetItemAsString ("MUSICBRAINZ_DISCID");} set {SetValue ("MUSICBRAINZ_DISCID", value);} } /// /// Gets and sets the MusicIP PUID of the media /// represented by the current instance. /// /// /// A object containing the MusicIPPUID /// for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICIP_PUID" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicIpId { get {return GetItemAsString ("MUSICIP_PUID");} set {SetValue ("MUSICIP_PUID", value);} } /// /// Gets and sets the Amazon ID of the media /// represented by the current instance. /// /// /// A object containing the AmazonID /// for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "ASIN" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string AmazonId { get {return GetItemAsString ("ASIN");} set {SetValue ("ASIN", value);} } /// /// Gets and sets the MusicBrainz Release Status of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseStatus for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMSTATUS" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseStatus { get {return GetItemAsString ("MUSICBRAINZ_ALBUMSTATUS");} set {SetValue ("MUSICBRAINZ_ALBUMSTATUS", value);} } /// /// Gets and sets the MusicBrainz Release Type of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseType for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "MUSICBRAINZ_ALBUMTYPE" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseType { get {return GetItemAsString ("MUSICBRAINZ_ALBUMTYPE");} set {SetValue ("MUSICBRAINZ_ALBUMTYPE", value);} } /// /// Gets and sets the MusicBrainz ReleaseCountry of the media /// represented by the current instance. /// /// /// A object containing the MusicBrainz /// ReleaseCountry for the media represented by the current instance /// or if no value is present. /// /// /// This property is implemented using the "RELEASECOUNTRY" item. /// http://musicbrainz.org/doc/PicardTagMapping /// public override string MusicBrainzReleaseCountry { get {return GetItemAsString ("RELEASECOUNTRY");} set {SetValue ("RELEASECOUNTRY", value);} } /// /// Gets and sets a collection of pictures associated with /// the media represented by the current instance. /// /// /// A containing a collection of /// pictures associated with the media represented by the /// current instance or an empty array if none are present. /// /// /// This property is implemented using the "Cover Art" items /// and supports only one picture per type. /// public override IPicture [] Pictures { get { List pictures = new List (); for (int i = 0; i < picture_item_names.Length; i++) { Item item = GetItem ( picture_item_names [i]); if (item == null || item.Type != ItemType.Binary) continue; int index = item.Value.Find ( ByteVector.TextDelimiter ( StringType.UTF8)); if (index < 0) continue; Picture pic = new Picture ( item.Value.Mid (index + 1)); pic.Description = item.Value .ToString (StringType.UTF8, 0, index); pic.Type = (PictureType) i; pictures.Add (pic); } return pictures.ToArray (); } set { foreach (string item_name in picture_item_names) RemoveItem (item_name); if (value == null || value.Length == 0) return; foreach (IPicture pic in value) { int type = (int) pic.Type; if (type >= picture_item_names.Length) type = 0; string name = picture_item_names [type]; if (GetItem (name) != null) continue; ByteVector data = ByteVector .FromString ( pic.Description, StringType.UTF8); data.Add (ByteVector.TextDelimiter ( StringType.UTF8)); data.Add (pic.Data); SetItem (new Item (name, data)); } } } /// /// Gets whether or not the current instance is empty. /// /// /// if the current instance does not /// any values. Otherwise . /// public override bool IsEmpty { get {return items.Count == 0;} } /// /// Clears the values stored in the current instance. /// public override void Clear () { items.Clear (); } /// /// Copies the values from the current instance to another /// , optionally overwriting /// existing values. /// /// /// A object containing the target /// tag to copy values to. /// /// /// A specifying whether or not to copy /// values over existing one. /// /// /// If is of type a complete copy of all values /// will be performed. Otherwise, only standard values will /// be copied. /// /// /// is . /// public override void CopyTo (TagLib.Tag target, bool overwrite) { if (target == null) throw new ArgumentNullException ("target"); TagLib.Ape.Tag match = target as TagLib.Ape.Tag; if (match == null) { base.CopyTo (target, overwrite); return; } foreach (Item item in items) { if (!overwrite && match.GetItem (item.Key) != null) continue; match.items.Add (item.Clone ()); } } #endregion } } taglib-sharp-2.1.0.0/src/TagLib/Ape/Footer.cs0000644000175000017500000002574311442021373020424 0ustar00alexalex00000000000000// // Footer.cs: Provides a representation of an APEv2 tag footer which can be read // from and written to disk. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Original Source: // apefooter.cpp from TagLib // // Copyright (C) 2005-2007 Brian Nickel // Copyright (C) 2004 Allan Sandfeld Jensen (Original Implementation) // copyright (C) 2002, 2003 Scott Wheeler (Original Implementation) // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Ape { #region Enums /// /// Indicates the flags applied to a object. /// [Flags] public enum FooterFlags : uint { /// /// The tag lacks a footer object. /// FooterAbsent = 0x40000000, /// /// The footer is actually a header. /// IsHeader = 0x20000000, /// /// The tag contains a header. /// HeaderPresent = 0x80000000 } #endregion /// /// This structure provides a representation of an APEv2 tag footer /// which can be read from and written to disk. /// public struct Footer : IEquatable