pax_global_header00006660000000000000000000000064134512577330014524gustar00rootroot0000000000000052 comment=ea3b2501271a530b05ce169d1824590011d93112 libltc-1.3.1/000077500000000000000000000000001345125773300127775ustar00rootroot00000000000000libltc-1.3.1/AUTHORS000066400000000000000000000000401345125773300140410ustar00rootroot00000000000000Robin Gareus libltc-1.3.1/COPYING000066400000000000000000000167271345125773300140470ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. libltc-1.3.1/ChangeLog000066400000000000000000000100731345125773300145520ustar00rootroot000000000000002019-04-04 (v1.3.1) Robin Gareus * Added methods to write and read numbers from user bytes * Fix compilation for Ardunio/AVR (missing rint) 2016-12-23 (v1.3.0) Robin Gareus * fix potential offset overflow (user provided relative position) * further improve MSVC compatibility (-infinity) * fix self-test for windows (binary file i/o) * add link examples and bindings/wrapper code to documentation * documentation spelling fixes 2015-11-26 (v1.2.0) Robin Gareus * support older MSVC without C99 * fix endianess detection (gcc-4.4 compat) * improve realtime safety, don't even print errors 2014-05-16 (v1.1.4) Robin Gareus * rework endianess detection * fix compile on systems w/o endian.h * remove obsolte autotools macros 2013-11-09 (v1.1.3) Robin Gareus * fixes for the release & test scripts (by Nils Philippsen) * update links to releases in doc. 2013-09-06 (v1.1.2) Robin Gareus * better BIG_ENDIAN detection (should fix mips, sparc, s390 builds) * fix decoder_write_u16() -- use unsigned short * allow to use buffersizes larger than 1024 samples with ltc_decoder_write_* 2012-11-18 (v1.1.1) Robin Gareus * start LTC frame with rising edge * fix typo in variable name and clarify documentation 2012-11-17 (v1.1.0) Robin Gareus * non-backwards compatible API update for 12M-1999 spec additions - rework encoder and frame inc/dec API. - add support for TV-standard offset and binary-group-flags * fix LTCFrame struct for big-endian architectures * fix volume db calculation * update default rise-time - 40us * fix timezone 0x0a -> -0030 2012-11-09 (v1.0.3) Robin Gareus * fix version-number in header (was stuck at 1.0.1) * fix internal buffer size of non-integer fps * add API call to reset encoder state * reset encoder-state when calling reinit() 2012-11-06 (v1.0.2) Robin Gareus * fix man-page doxygen minus vs hyphen issue * allow to reset date parameters when assigning timecode|frame * improve decoder audio-sample position accuracy: take difference of current biphase count to nominal period duration into account. (thanks to Chris Goddard for OSC sample-sync measurements) 2012-11-03 (v1.0.1) Robin Gareus * fix release tar-ball: remove cruft from test/ * fix typo in README and update description * no code changes. 2012-11-02 (v1.0.0) Robin Gareus * freeze interface defition - 1.0.0 * update doc * minor tweaks and typos (OSX build, printf size_t warning, LPGL boilerplate) 2012-10-25 (v0.8.1) Robin Gareus * add interface to decode 16bit and 32bit float data (wrappers around ltc_decoder_write() - internally 8 bit) 2012-10-24 (v0.8.0) Robin Gareus * add input signal level to data-structure * add interfaces to set encoder volume and filter * adjust decoder biphase tracking (allow rounding down to 1 sample) * use ltc_off_t for all (long long int) 2012-10-21 (v0.7.0) Robin Gareus * add support for reverse encoding * add interface to decrement encoder timecode * rename interface to increment encoder timecode 2012-10-21 (v0.6.2) Robin Gareus * fix ltc_encoder_encode_byte() return value 2012-10-21 (v0.6.1) Robin Gareus * add realtime safe interface to change fps * fix: set parity also when decrementing frame numbers * update documentation - fix typos, clarificaions 2012-10-13 (v0.6.0) Robin Gareus * set parity bit on encoding - keep polarity of the waveform constant 2012-10-09 (v0.5.3) Robin Gareus * add interface to decrement timecode 2012-10-04 (v0.5.2) Robin Gareus * expose detailed timing info in extended LTC Frame allow to re-construct the phase of the signal 2012-08-23 (v0.5.1) Robin Gareus * add ability to read reverse LTC * use 64bit values (long long) for position offset * minor fixes, typos, doc 2012-08-15 (v0.5.0) Robin Gareus * refactored libltcsmpte.sf.net into libltc libltc-1.3.1/Doxyfile.in000066400000000000000000002252171345125773300151230ustar00rootroot00000000000000# Doxyfile 1.8.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" "). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or sequence of words) that should # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. PROJECT_NAME = "libltc" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = "Linear/Logitudinal Time Code (LTC) Library" # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. PROJECT_LOGO = doc/libltc.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = src # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding # "class=itcl::class" will allow you to use the command class in the # itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this # tag. The format is ext=language, where ext is a file extension, and language # is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, # C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all # comments according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you # can mix doxygen, HTML, and XML commands with Markdown formatting. # Disable only in case of backward compatibilities issues. MARKDOWN_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also makes the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and # unions are shown inside the group in which they are included (e.g. using # @ingroup) instead of on a separate page (for HTML and Man pages) or # section (for LaTeX and RTF). INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and # unions with only public data fields will be shown inline in the documentation # of the scope in which they are defined (i.e. file, namespace, or group # documentation), provided this scope is documented. If set to NO (the default), # structs, classes, and unions are shown on a separate page (for HTML and Man # pages) or section (for LaTeX and RTF). INLINE_SIMPLE_STRUCTS = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penalty. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will roughly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. SYMBOL_CACHE_SIZE = 0 # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given # their name and scope. Since this can be an expensive process and often the # same symbol appear multiple times in the code, doxygen keeps a cache of # pre-resolved symbols. If the cache is too small doxygen will become slower. # If the cache is too large, memory is wasted. The cache size is given by this # formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespaces are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to # do proper type resolution of all parameters of a function it will reject a # match between the prototype and the implementation of a member function even # if there is only one candidate or it is obvious which candidate to choose # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or macro consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and macros in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. The create the layout file # that represents doxygen's defaults, run doxygen with the -l option. # You can optionally specify a file name after the option, if omitted # DoxygenLayout.xml will be used as the name of the layout file. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files # containing the references data. This must be a list of .bib files. The # .bib extension is automatically appended if omitted. Using this command # requires the bibtex tool to be installed. See also # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this # feature you need bibtex and perl available in the search path. CITE_BIB_FILES = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_NO_PARAMDOC option can be enabled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = src/ltc.h doc/mainpage.dox # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = tests # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = doc # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty or if # non of the patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) # and it is also possible to disable source filtering for a specific pattern # using *.ext= (so without naming a filter). This option only has effect when # FILTER_SOURCE_FILES is enabled. FILTER_SOURCE_PATTERNS = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. Note that when using a custom header you are responsible # for the proper inclusion of any scripts and style sheets that doxygen # needs, which is dependent on the configuration options used. # It is advised to generate a default header using "doxygen -w html # header.html footer.html stylesheet.css YourConfigFile" and then modify # that header. Note that the header is subject to change so you typically # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # style sheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images # according to this color. Hue is specified as an angle on a colorwheel, # see http://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of # the colors in the HTML output. For a value of 0 the output will use # grayscales only. A value of 255 will produce the most vivid colors. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to # the luminance component of the colors in the HTML output. Values below # 100 gradually make the output lighter, whereas values above 100 make # the output darker. The value divided by 100 is the actual gamma applied, # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, # and 100 does not change the gamma. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of # entries shown in the various tree structured indices initially; the user # can expand and collapse entries dynamically later on. Doxygen will expand # the tree to such a level that at most the specified number of entries are # visible (unless a fully collapsed tree already exceeds this amount). # So setting the number of entries 1 will produce a full collapsed tree by # default. 0 is a special value representing an infinite number of entries # and will result in a full expanded tree by default. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated # that can be used as input for Qt's qhelpgenerator to generate a # Qt Compressed Help (.qch) of the generated HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see # # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. # # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) # at top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. Since the tabs have the same information as the # navigation tree you can set this option to NO if you already set # GENERATE_TREEVIEW to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. # Since the tree basically has the same information as the tab index you # could consider to set DISABLE_INDEX to NO when enabling this option. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values # (range [0,1..20]) that doxygen will group on one line in the generated HTML # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open # links to external symbols imported via tag files in a separate window. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are # not supported properly for IE 6.0, but are supported on all modern browsers. # Note that when changing this option you need to delete any form_*.png files # in the HTML output before the changes have effect. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax # (see http://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you may also need to install MathJax separately and # configure the path to it using the MATHJAX_RELPATH option. USE_MATHJAX = NO # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to # the MathJax Content Delivery Network so you can quickly see the result without # installing MathJax. # However, it is strongly recommended to install a local # copy of MathJax from http://www.mathjax.org before deployment. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension # names that should be enabled during MathJax rendering. MATHJAX_EXTENSIONS = # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvantages are that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for # the generated latex document. The footer should contain everything after # the last chapter. If it is left blank doxygen will generate a # standard footer. Notice: only use this tag if you know what you are doing! LATEX_FOOTER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See # http://en.wikipedia.org/wiki/BibTeX for more info. LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load style sheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = YES # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = NO # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = DOXYGEN_IGNORE # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that # overrules the definition found in the source code. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros # that are alone on a line, have an all uppercase name, and do not end with a # semicolon, because these will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. For each # tag file the location of the external documentation should be added. The # format of a tag file without this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths # or URLs. Note that each tag file must have a unique name (where the name does # NOT include the path). If a tag file is not located in the directory in which # doxygen is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option also works with HAVE_DOT disabled, but it is recommended to # install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will # base this on the number of processors available in the system. You can set it # explicitly to a value larger than 0 to get control over the balance # between CPU load and processing speed. DOT_NUM_THREADS = 0 # By default doxygen will use the Helvetica font for all dot files that # doxygen generates. When you want a differently looking font you can specify # the font name using DOT_FONTNAME. You need to make sure dot is able to find # the font, which can be done by putting it in a standard location or by setting # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the # directory containing the font. DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the Helvetica font. # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to # set the path where dot can find it. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If the UML_LOOK tag is enabled, the fields and methods are shown inside # the class node. If there are many fields or methods and many nodes the # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS # threshold limits the number of items for each type to make the size more # managable. Set this to 0 for no limit. Note that the threshold may be # exceeded by 50% before the limit is enforced. UML_LIMIT_NUM_FIELDS = 10 # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will generate a graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = NO # If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. If you choose svg you need to set # HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible in IE 9+ (other browsers do not have this requirement). DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # Note that this requires a modern browser other than Internet Explorer. # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible. Older versions of IE do not have SVG support. INTERACTIVE_SVG = NO # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the # \mscfile command). MSCFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = YES # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES libltc-1.3.1/INSTALL000066400000000000000000000366001345125773300140350ustar00rootroot00000000000000Installation 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. libltc-1.3.1/Makefile.am000066400000000000000000000006711345125773300150370ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign SUBDIRS = @subdirs@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = ltc.pc EXTRA_DIST= \ ltc.pc.in Doxyfile.in \ README.md ChangeLog \ COPYING INSTALL AUTHORS CLEANFILES = stamp-doxygen stamp-doc dox: stamp-doxygen stamp-doxygen: src/ltc.h doc/mainpage.dox Doxyfile $(DOXYGEN) Doxyfile # fix doxygen man-page sed -i 's/\([( ]\)-\([0-9][0-9d) ]\)/\1\\-\2/g' doc/man/man3/ltc.h.3 touch stamp-doxygen libltc-1.3.1/README.md000066400000000000000000000012451345125773300142600ustar00rootroot00000000000000libLTC ------ Linear (or Longitudinal) Timecode (LTC) is an encoding of SMPTE timecode data as a Manchester-Biphase encoded audio signal. The audio signal is commonly recorded on a VTR track or other storage media. libltc provides functionality to encode and decode LTC audio from/to SMPTE or EBU timecode, including SMPTE date support. libltc is the successor of [libltcsmpte](https://sourceforge.net/projects/ltcsmpte/). For more information, please see the FAQ in the documentation. Documentation ------------- The API reference, examples, as well as introduction can be found at http://x42.github.com/libltc/ This site is part or the source-code in the doc/ folder. libltc-1.3.1/configure.ac000066400000000000000000000050001345125773300152600ustar00rootroot00000000000000AC_PREREQ(2.57) AC_INIT([libltc], [-], [robin@gareus.org], [], [http://x42.github.com/libltc/]) AC_PATH_PROG(SED, sed, "", $PATH:/bin:/usr/bin:/usr/local/bin) if test -z "$SED"; then AC_MSG_ERROR([sed was not found -- sed is requied to extract version information]) fi AC_MSG_CHECKING([libltc version]) VERSION=`$SED -ne 's/^#define LIBLTC_VERSION "\(.*\)"/\1/p' ${srcdir}/src/ltc.h 2>/dev/null` AC_MSG_RESULT($VERSION) if test -z "$VERSION"; then AC_MSG_ERROR([version number can not be retrieved from src/ltc.h]) fi VERSION_CUR=`$SED -ne 's/^#define LIBLTC_CUR *\([0-9]*\)/\1/p' ${srcdir}/src/ltc.h 2>/dev/null` VERSION_REV=`$SED -ne 's/^#define LIBLTC_REV *\([0-9]*\)/\1/p' ${srcdir}/src/ltc.h 2>/dev/null` VERSION_AGE=`$SED -ne 's/^#define LIBLTC_AGE *\([0-9]*\)/\1/p' ${srcdir}/src/ltc.h 2>/dev/null` VERSION_INFO=${VERSION_CUR}:${VERSION_REV}:${VERSION_AGE} AC_CONFIG_SRCDIR([src/ltc.c]) AC_CONFIG_TESTDIR([tests]) AC_CANONICAL_TARGET([]) AC_COPYRIGHT([Copyright (C) Robin Gareus 2006-2012]) AM_INIT_AUTOMAKE(libltc,$VERSION) AC_CONFIG_HEADERS([src/config.h]) AC_CANONICAL_HOST AC_PROG_INSTALL AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_LN_S AC_PROG_LIBTOOL AC_LIBTOOL_WIN32_DLL dnl *** misc complier/linker flags *** LIBLTC_CFLAGS="-Wall" LIBLTC_LDFLAGS="-export-symbols-regex '^(ltc_).*'" case $target_os in *mingw32*|*win*) LDFLAGS="-no-undefined" ;; *) AC_MSG_CHECKING([if -Wl,--as-needed works]) LDFLAGS_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--as-needed" AC_TRY_LINK([], [], [ AC_MSG_RESULT([yes]) LIBLTC_LDFLAGS="$LIBLTC_LDFLAGS -Wl,--as-needed" ], [AC_MSG_RESULT([no])]) LDFLAGS=$LDFLAGS_save ;; esac dnl *** check for dependencies *** AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h math.h stdint.h) dnl *** check for doxygen *** AC_ARG_VAR(DOXYGEN, Doxygen) AC_PATH_PROG(DOXYGEN, doxygen, no) if test "$DOXYGEN" != "no"; then DOXMAKE='run "make dox" to generate API html reference: doc/html/index.html' fi subdirs="src doc tests" AC_SUBST(subdirs) AC_SUBST(VERSION) AC_SUBST(VERSION_INFO) AC_SUBST(LIBLTC_CFLAGS) AC_SUBST(LIBLTC_LDFLAGS) AC_OUTPUT(Makefile src/Makefile doc/Makefile tests/Makefile ltc.pc Doxyfile) AC_MSG_NOTICE([ libltc configured: ----------------------- version: $VERSION interface revision: $VERSION_INFO doxygen: $DOXYGEN installation prefix: $prefix type "make" followed my "make install" as root. run "make check" to perform selftests. $DOXMAKE ]) libltc-1.3.1/doc/000077500000000000000000000000001345125773300135445ustar00rootroot00000000000000libltc-1.3.1/doc/Makefile.am000066400000000000000000000003641345125773300156030ustar00rootroot00000000000000clean-local: rm -f html/*.* rm -f man/man3/mainpage.dox.3 rm -f man/man3/*libltc_src_.3 # install the man pages man_MANS=man/man3/ltc.h.3 #include them in dist. EXTRA_DIST= \ mainpage.dox \ man/man3/ltc.h.3 \ libltc.png \ smptefmt.png libltc-1.3.1/doc/libltc.png000066400000000000000000000230031345125773300155210ustar00rootroot00000000000000PNG  IHDR>asRGBbKGD IDATx]iTTWnPU@Q  hF;$&M4&j:K;mǤ32Mb5I|!硠~l*P{-r9{>s9 Nsw 98e8 $Np ƏS:" w@y9ABCs&(7 ֭ԛT K@m-`2ׯVYYsn`@/F#dg3g )e4c5/9҂us`|z:Gɓ@]L< h@r2|*i>Ý3y246 |)T*Xx)`,@99t~_vLeC}MM@Z V zN\eebbCTVv ;Vº^jZ SDRv\SSd u?ߟ@PY mQp"h˗1.6x=`_~~CV@*~Kr~~hw <bu5y(@"< @}=F{Ȣn#ЯMA5G,VFL<ڤRizjX9@q(Yd@x8:y=xA؈`X`B ,s j>I[YcUY)C.'w}yDJH$%999HJ9C^&SQVL@k+PQdfTQQA~cۨqx<L&&MGyqvUy 7Յ(S`HP@RM&ETQ8, Xge3ijB}}=xZQ2f CBoDYc#F¯шL z=Νczw܉^/q0xg! ǏPTXp!sXw6L8}4_]#84"*0dx<||v0BPRw߁_S' zhhNKh*..@E_, CUL ڃ3izr>>  )(@@SL( Q,qHOOGqqqPPPg"))8& ɨA``ĉ(++#B"((W'*p>>׮]сqQQ`jjbx'ҴM yx6 P*'e f@cBA+WbjL$ݽgRY dg#\ 3!PYY̚1( ,[`gfƌC`'t:7 .%nxa !;wB˖BһiiБRHXe%ߟ|7PPDPcLj_b%"[ )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""B9ycfBhh(on9bTWWa̙Ȱ:___2bW t: ,/b1  FA(B @&!** 2 R ̃ QCڈJ,--VŴiI8w, $$qqq8y$^>= ii6-^bM0χBXFbb"6mш3gݼ`߿jm<F"Ze>裨wpqqѣ կ~SBg#-Tŋ[eHGmm-hYWWW|7&MBjj*qIsc(((mX|9 &L~kkD"̞=r/eeeFpp0LJ< 曯T*}vL<~!>#Z "6lL|V\L̛7uuuUAKؿ?JKK|rTWWcؼy3pIE|̜_%2/g`Æ hllիOիXf ?/>c+غu+F'U0PT@(`DCC$  rٳg[I7FffMvΜ9HMIEaQX,Vdz9r$*++-9RnBÐ'N p n۾:X,F@@{m<Ga~ 1*sCP@ ȑ# OOO( KR L`ڊD"\.wO> _ ,DNUٳsϡo6tR?~|>î] Je˖'v܉(^xw?"** ׯǘ1cw8p?`ĉسg{=F>L> rk0f={ΝCTT^x$Rl3lܸ3gċ/D'Nȑ<0deea۶mHHHs=vܹ@ll,,X 7-Y"shNң*++QSSGBo9Ͽ{wV8zvSVW ;Ͽ};a.hky;IENDB`libltc-1.3.1/doc/mainpage.dox000066400000000000000000000255741345125773300160560ustar00rootroot00000000000000/* * main page of the libLTC manual */ /** @mainpage POSIX-C Library for handling Linear/Logitudinal Time Code (LTC) @section intro Introduction Linear (or Longitudinal) Timecode (LTC) is an encoding of timecode data as a Manchester-Biphase encoded audio signal. The audio signal is commonly recorded on a VTR track or other storage media. libltc provides functionality to encode and decode LTC from/to timecode, including SMPTE date support. libltc is the successor of libltcsmpte. @section download Download @section installation Installation libltc uses GNU autotools and libtool. The default auto-* workflow applies: run ./configure and build libltc with make. See the INSTALL file for further instructions. The tar.gz package release includes the build-environment (configure script, etc), but if you get the source from the repository, you first need to generate the build environment with something alike: aclocal; autoheader; libtoolize --copy; autoconf; automake --gnu --add-missing --copy. (OSX users use glibtoolize). If Doxygen is available, the documentation can be [re-]generated from the source by calling make dox. Self-test scenarios and example code can be compiled and executed with make check. @section usage Usage Consult \ref ltc.h for a detailed reference of available functions. The documentation is also available as Unix manual pages. The self-test code lends itself as good examples on how to get started. See \ref ltcdecode.c, \ref ltcencode.c and \ref example_encode.c. Other good starting point include @section about Q&A
How can I get help?
The preferred way is to use the issue-tracker at https://github.com/x42/libltc/issues . You can also send a private-mail to the authors.
How good is the LTC-decoder? Will it decode my file?
It's doing very well, thanks. :) We did extensive testing using LTC samples from various sources and have not yet found one that libLTC can not decode. It may well be that there are edge-cases or degraded LTC waveforms that will not be reconstructed correctly. If you find such a sample, please contact us, we will look into ways to improve libLTC.
Does it support vari-speed LTC?
Yes. libltc tracks speed variations. Each decoded LTC-frame is tagged with the corresponding audio-sample number (start/end). The LTC encoder has a 'speed' parameter that can be set for each byte.
Does libltc support decoding backwards played LTC - reverse tape direction
Yes it does. See the documentation for \ref LTCFrameExt
Can I use libltc in a proprietary/closed-source project?
Yes, with some care. In a nutshell:
Create a dynamic library (.dll, ,dylib, .so) of libltc and link your program against it. Your project remains independent. You only need to be able to convey means to re-create this library (source-code, build-scripts) to anyone who asks. The easiest way to do this is to simply not modify libltc and refer to the upstream source (keep a copy just in case).
If you copy the library code directly into your project and statically link your application against it, your project will have to be licensed in terms of the LGPL or a compatible license. See the license text for details and consult with a person with expertise in licensing.
Is commercial licensing available?
No, libltc is only available in terms of the GNU Lesser General Public License: LGPLv3.
Is there [free] software is using libltc?
Yes, ltc-tools. It comprises JACK applications to generate and decode LTC from live sources and includes tools to read or write LTC from/to audio-files. xjadeo video-monitor has been updated to use libltc, and ardour3 DAW fully supports chasing and latency free [re]encoding of LTC since svn rev 13390. The library comes self-test code, which can en&decode LTC from raw audio-data. There are lots of apps (incl iOS applications, NLEs and hardware/firmware solutions) using libltcsmpte. We dare say that many - if not most - of them will be updated to libLTC in time. Mattijs Kneppers has written a MAX/MSP external smpte~ to encode LTC.
What is the difference between libltcsmpte and libltc?
Functionally, there is little difference, usage and work-flow are very similar. But, the API has changed almost completely. Yet the majority of these changes are only parameter and function names. libltc introduces support for encoding vari-speed LTC and reverse played LTC. The internal code-path was optimized and the phase-tracking was slightly improved. libltc drops support for operations on timecode such as converting video-timecode to real-time (seconds, audio-frames), etc. This functionality is now part of libtimcode. The reasoning behind this is that libltc operates on LTC-frames. It ought to be ignorant about timecode or framerate semantics and should not make assumptions about the data, which is application dependent. Some related inappropriate functionality of libltcsmpte was dropped, as well. e.g. The ability to detect timecode discontinuities. This is an application specific issue and not LTC related. libltc still includes some timecode operations directly related to LTC, i.e. incrementing/decrementing timecode for use in the encoder and functions to map the 80 LTC bits to HH:MM:SS:FF timecode. In general: the API was simplified and cleaned up.
Why not continue to develop libltcsmpte?
Mostly because of API and ABI compatibility issues. libltcsmpte was one of the first shared libraries that I have written. I've made mistakes: Naming conventions (functions, structure and variables) were chosen unwisely and can cause conflicts. Merging LTC date-support and making it compile-time optional was the next mistake: Versions compiled with-date do not allow using the user-bits of the LTC frame for anything else that date. Even worse is the compile-time option to change the sample-format and its encoding (signed/unsigned, 8/16bit or 32bit float). This really made the ABI incompatible between variants compiled with different options... Cleaning up this mess, while retaining compatibility with existing applications would probably have made things worse. libltcsmpte was the pilot system "built to be thrown away". That being said, "it works, NTL".
But you could still have called it libltcsmpte-2.0.0..
Yes, we could have done that. The SMPTE part in the name was not appropriate. libltc handles EBU timecode just as well as SMPTE timecode. As mentioned above libltc is not concerned with timecode or framerates semantics per se, only the encoding/decoding of it.
libltcsmpte supports a variety of audio-sample formats/encodings (float, 16bit,..). Why is libltc limited to 8bit unsigned?
Selecting the sample-format is a compile-time option in libltcsmpte. Changing it breaks the ABI (applications using the library will only work with the exact same variant of the libarary it has been compiled for - which makes a shared-lib useless.) 8bit samples are more than sufficient to carry LTC information. Changing the audio-sample type from one encoding to another is [mostly] trivial. There is no way that libLTC could include an interface for every possible way to represent audio-data. This is application specific. There are however wrappers to convert common formats (16bit signed/unsigned and 32bit float) on the fly to 8 bit unsigned samples. Yes, libltcsmpte is/was superior in the sense that it can detect, track and filter very low signals-levels. Due to the 8bit limitation, libltc requires a minimum amplitude of -36db. This is usually a non-issue in real-world applications, but yes, if you want to analyze very low signals, possibly with DC-offset, you must implement your own amp and high-pass filter. In any case the generic signal tracker in libltc (or libltcsmpte) will likely perform worse than your application specific one.
@section references References @section license License Copyright (C) 2003 by Maarten de Boer Copyright (C) 2006-2012 by Robin Gareus Copyright (C) 2008-2010 by Jan Weiß libltc 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 3 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 Lesser Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/ \example ltcdecode.c \example ltcencode.c \example example_encode.c */ /* vi:set ts=2 sts=2 sw=2 et: */ libltc-1.3.1/doc/man/000077500000000000000000000000001345125773300143175ustar00rootroot00000000000000libltc-1.3.1/doc/man/man3/000077500000000000000000000000001345125773300151555ustar00rootroot00000000000000libltc-1.3.1/doc/man/man3/ltc.h.3000066400000000000000000001131111345125773300162470ustar00rootroot00000000000000.TH "ltc.h" 3 "Thu Apr 4 2019" "Version 1.3.1" "libltc" \" -*- nroff -*- .ad l .nh .SH NAME ltc.h \- libltc - en+decode linear timecode .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBLTCFrame\fP" .br .ti -1c .RI "struct \fBLTCFrameExt\fP" .br .ti -1c .RI "struct \fBSMPTETimecode\fP" .br .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBLTC_FRAME_BIT_COUNT\fP 80" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef unsigned char \fBltcsnd_sample_t\fP" .br .ti -1c .RI "typedef long long int \fBltc_off_t\fP" .br .ti -1c .RI "typedef struct \fBLTCFrame\fP \fBLTCFrame\fP" .br .ti -1c .RI "typedef struct \fBLTCFrameExt\fP \fBLTCFrameExt\fP" .br .ti -1c .RI "typedef struct \fBSMPTETimecode\fP \fBSMPTETimecode\fP" .br .ti -1c .RI "typedef struct \fBLTCDecoder\fP \fBLTCDecoder\fP" .br .ti -1c .RI "typedef struct \fBLTCEncoder\fP \fBLTCEncoder\fP" .br .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBLTC_TV_STANDARD\fP { \fBLTC_TV_525_60\fP, \fBLTC_TV_625_50\fP, \fBLTC_TV_1125_60\fP, \fBLTC_TV_FILM_24\fP }" .br .ti -1c .RI "enum \fBLTC_BG_FLAGS\fP { \fBLTC_USE_DATE\fP = 1, \fBLTC_TC_CLOCK\fP = 2, \fBLTC_BGF_DONT_TOUCH\fP = 4, \fBLTC_NO_PARITY\fP = 8 }" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "void \fBltc_frame_to_time\fP (\fBSMPTETimecode\fP *stime, \fBLTCFrame\fP *frame, int flags)" .br .ti -1c .RI "void \fBltc_time_to_frame\fP (\fBLTCFrame\fP *frame, \fBSMPTETimecode\fP *stime, enum \fBLTC_TV_STANDARD\fP standard, int flags)" .br .ti -1c .RI "void \fBltc_frame_reset\fP (\fBLTCFrame\fP *frame)" .br .ti -1c .RI "int \fBltc_frame_increment\fP (\fBLTCFrame\fP *frame, int fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" .br .ti -1c .RI "int \fBltc_frame_decrement\fP (\fBLTCFrame\fP *frame, int fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" .br .ti -1c .RI "\fBLTCDecoder\fP * \fBltc_decoder_create\fP (int apv, int queue_size)" .br .ti -1c .RI "int \fBltc_decoder_free\fP (\fBLTCDecoder\fP *d)" .br .ti -1c .RI "void \fBltc_decoder_write\fP (\fBLTCDecoder\fP *d, \fBltcsnd_sample_t\fP *buf, size_t size, \fBltc_off_t\fP posinfo)" .br .ti -1c .RI "void \fBltc_decoder_write_float\fP (\fBLTCDecoder\fP *d, float *buf, size_t size, \fBltc_off_t\fP posinfo)" .br .ti -1c .RI "void \fBltc_decoder_write_s16\fP (\fBLTCDecoder\fP *d, short *buf, size_t size, \fBltc_off_t\fP posinfo)" .br .ti -1c .RI "void \fBltc_decoder_write_u16\fP (\fBLTCDecoder\fP *d, unsigned short *buf, size_t size, \fBltc_off_t\fP posinfo)" .br .ti -1c .RI "int \fBltc_decoder_read\fP (\fBLTCDecoder\fP *d, \fBLTCFrameExt\fP *frame)" .br .ti -1c .RI "void \fBltc_decoder_queue_flush\fP (\fBLTCDecoder\fP *d)" .br .ti -1c .RI "int \fBltc_decoder_queue_length\fP (\fBLTCDecoder\fP *d)" .br .ti -1c .RI "\fBLTCEncoder\fP * \fBltc_encoder_create\fP (double sample_rate, double fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" .br .ti -1c .RI "void \fBltc_encoder_free\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "void \fBltc_encoder_set_timecode\fP (\fBLTCEncoder\fP *e, \fBSMPTETimecode\fP *t)" .br .ti -1c .RI "void \fBltc_encoder_get_timecode\fP (\fBLTCEncoder\fP *e, \fBSMPTETimecode\fP *t)" .br .ti -1c .RI "void \fBltc_encoder_set_user_bits\fP (\fBLTCEncoder\fP *e, unsigned long data)" .br .ti -1c .RI "unsigned long \fBltc_frame_get_user_bits\fP (\fBLTCFrame\fP *f)" .br .ti -1c .RI "int \fBltc_encoder_inc_timecode\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "int \fBltc_encoder_dec_timecode\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "void \fBltc_encoder_set_frame\fP (\fBLTCEncoder\fP *e, \fBLTCFrame\fP *f)" .br .ti -1c .RI "void \fBltc_encoder_get_frame\fP (\fBLTCEncoder\fP *e, \fBLTCFrame\fP *f)" .br .ti -1c .RI "int \fBltc_encoder_get_buffer\fP (\fBLTCEncoder\fP *e, \fBltcsnd_sample_t\fP *buf)" .br .ti -1c .RI "\fBltcsnd_sample_t\fP * \fBltc_encoder_get_bufptr\fP (\fBLTCEncoder\fP *e, int *size, int flush)" .br .ti -1c .RI "void \fBltc_encoder_buffer_flush\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "size_t \fBltc_encoder_get_buffersize\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "int \fBltc_encoder_reinit\fP (\fBLTCEncoder\fP *e, double sample_rate, double fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" .br .ti -1c .RI "void \fBltc_encoder_reset\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "int \fBltc_encoder_set_bufsize\fP (\fBLTCEncoder\fP *e, double sample_rate, double fps)" .br .ti -1c .RI "int \fBltc_encoder_set_volume\fP (\fBLTCEncoder\fP *e, double dBFS)" .br .ti -1c .RI "void \fBltc_encoder_set_filter\fP (\fBLTCEncoder\fP *e, double rise_time)" .br .ti -1c .RI "int \fBltc_encoder_encode_byte\fP (\fBLTCEncoder\fP *e, int byte, double speed)" .br .ti -1c .RI "void \fBltc_encoder_encode_frame\fP (\fBLTCEncoder\fP *e)" .br .ti -1c .RI "void \fBltc_frame_set_parity\fP (\fBLTCFrame\fP *frame, enum \fBLTC_TV_STANDARD\fP standard)" .br .ti -1c .RI "int \fBparse_bcg_flags\fP (\fBLTCFrame\fP *f, enum \fBLTC_TV_STANDARD\fP standard)" .br .ti -1c .RI "\fBltc_off_t\fP \fBltc_frame_alignment\fP (double samples_per_frame, enum \fBLTC_TV_STANDARD\fP standard)" .br .in -1c .SH "Detailed Description" .PP libltc - en+decode linear timecode Linear (or Longitudinal) Timecode (LTC) is an encoding of timecode data as a Manchester-Biphase encoded audio signal\&. The audio signal is commonly recorded on a VTR track or other storage media\&. .PP libltc facilitates decoding and encoding of LTC from/to timecode, including SMPTE date support\&. .PP \fBAuthor:\fP .RS 4 Robin Gareus robin@gareus.org .RE .PP \fBCopyright:\fP .RS 4 .RE .PP Copyright (C) 2006-2014 Robin Gareus robin@gareus.org .PP Copyright (C) 2008-2009 Jan Weiß jan@geheimwerk.de .PP Inspired by SMPTE Decoder - Maarten de Boer mdeboer@iua.upf.es .PP This program 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 3 of the License, or (at your option) any later version\&. .PP 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 Lesser General Public License for more details\&. .PP You should have received a copy of the GNU Lesser General Public License along with this library\&. If not, see http://www.gnu.org/licenses/\&. .SH "Data Structure Documentation" .PP .SH "struct LTCFrame" .PP Raw 80 bit LTC frame .PP The datastream for each video frame of Longitudinal Timecode consists of eighty bit-periods\&. .PP At a frame-rate of 30 fps, the bit-rate corresponds to 30 [fps] * 80 [bits/f] = 2400 bits per second\&. The frequency for a stream of zeros would be 1\&.2 kHz and for a stream of ones it would be 2\&.4 kHz\&. With all commonly used video-frame-rates and audio-sample-rates, LTC timecode can be recorded easily into a audio-track\&. .PP In each frame, 26 of the eighty bits carry the SMPTE time in binary coded decimal (BCD)\&. .PP These Bits are FRAME-UNITS, FRAME-TENS, SECS-UNITS, SECS-TENS, MINS-UNITS, MINS-TENS, HOURS-UNITS and HOURS-TENS\&. The BCD digits are loaded 'least significant bit first' (libltc takes care of the architecture specific alignment)\&. .PP 32 bits are assigned as eight groups of four USER-BITS (also sometimes called the 'Binary Groups')\&. This capacity is generally used to carry extra info such as reel number and/or date\&. The User Bits may be allocated howsoever one wishes as long as both Binary Group Flag Bits are cleared\&. .PP The function \fBltc_frame_to_time\fP can interpret the user-bits as SMPTE Date+Timezone according to SMPTE 309M-1999\&. similarly \fBltc_time_to_frame\fP will do the reverse\&. .PP The last 16 Bits make up the SYNC WORD\&. These bits indicate the frame boundary, the tape direction, and the bit-rate of the sync tone\&. The values of these Bits are fixed as 0011 1111 1111 1101 .PP The Bi-Phase Mark Phase Correction Bit (Bit 27 or 59) may be set or cleared so that that every 80-bit word contains an even number of zeroes\&. This means that the phase of the pulse train in every Sync Word will be the same\&. .PP Bit 10 indicates drop-frame timecode\&. The Colour Frame Flag col\&.frm is Bit 11; if the timecode intentionally synchronized to a colour TV field sequence, this bit is set\&. .PP Bit 58 is not required for the BCD count for HOURS-TENS (which has a maximum value of two) and has not been given any other special purpose so remains unassigned\&. This Bit has been RESERVED for future assignment\&. .PP The Binary Group Flag Bits (bits 43 and 59) are two bits indicate the format of the User Bits data\&. SMPTE 12M-1999 defines the previously reserved bit 58 to signals that the time is locked to wall-clock within a tolerance of ± 0\&.5 seconds\&. .PP SMPTE 12M-1999 also changes the numbering schema of the BGF\&. (BGF1 was renamed to BGF2 and bit 58 becomes BGFB1) .PP To further complicate matters, the BGFB assignment as well as the biphase_mark_phase_correction (aka parity) bit depends on the timecode-format used\&. .PP .PP .nf 25 fps 24, 30 fps BGF0 27 43 BGF1 58 58 BGF2 43 59 Parity 59 27 .fi .PP .PP The variable naming chosen for the \fBLTCFrame\fP struct is based on the 24,30 fps standard\&. .PP The Binary Group Flag Bits should be used only as shown in the truth table below\&. The Unassigned entries in the table should not be used, as they may be allocated specific meanings in the future\&. .PP .PP .nf BGF0 BGF1 BGF2 user-bits timecode Bit 43 Bit 58 Bit 59 (30fps, 24 fps) | | Bit 27 Bit 58 Bit 43 (25fps) No User Bits format specified | ? | 0 0 0 Eight-bit character set (1) | ? | 1 0 0 Date and Timezone set | ? | 0 0 1 Page/Line multiplex (2) | ? | 1 0 1 Character set not specified | clk | 0 1 0 Reserved | ? | 1 1 0 Date and Timezone set | clk | 0 1 1 Page/Line multiplex (2) | clk | 1 1 1 .fi .PP .PP .PP .nf .fi .PP .PP (1) ISO/IEC 646 or ISO/IEC 2022 character set\&. If the seven-bit ISO codes are being used, they shall be converted to eight-bit codes by setting the eighth bit to zero\&. 4 ISO codes can be encoded, user7 and user8 are to be used for the first code with LSB 7 and MSB in 8\&. the remaining ISO codes are to be distributed in the same manner to user5/6 user3/4 and user1/2 accordingly\&. .PP (2) The Page/Line indicates ANSI/SMPTE-262M is used for the user-bits\&. It is multiplex system that can be used to encode large amounts of data in the binary groups through the use of time multiplexing\&. .PP libltc does not use any of the BGF - except for the Parity bit which can be calculated and set with \fBltc_frame_set_parity\fP\&. Setting and interpreting the BGF is left to the application using libltc\&. However libltc provides functionality to parse or set date and timezoe according to SMPTE 309M-1999\&. .PP further information: http://www.philrees.co.uk/articles/timecode.htm and http://www.barney-wol.net/time/timecode.html .PP \fBData Fields:\fP .RS 4 unsigned int \fIbinary_group_flag_bit0:1\fP indicate user-data char encoding, see table above - bit 43 .br .PP unsigned int \fIbinary_group_flag_bit1:1\fP indicate timecode is local time wall-clock, see table above - bit 58 .br .PP unsigned int \fIbinary_group_flag_bit2:1\fP indicate user-data char encoding (or parity with 25fps), see table above - bit 59 .br .PP unsigned int \fIbiphase_mark_phase_correction:1\fP see note on Bit 27 in description and \fBltc_frame_set_parity\fP \&. .br .PP unsigned int \fIcol_frame:1\fP colour-frame: timecode intentionally synchronized to a colour TV field sequence .br .PP unsigned int \fIdfbit:1\fP indicated drop-frame timecode .br .PP unsigned int \fIframe_tens:2\fP SMPTE framenumber BCD tens 0\&.\&.3\&. .br .PP unsigned int \fIframe_units:4\fP SMPTE framenumber BCD unit 0\&.\&.9\&. .br .PP unsigned int \fIhours_tens:2\fP SMPTE hours BCD tens 0\&.\&.2\&. .br .PP unsigned int \fIhours_units:4\fP SMPTE hours BCD unit 0\&.\&.9\&. .br .PP unsigned int \fImins_tens:3\fP SMPTE minutes BCD tens 0\&.\&.6\&. .br .PP unsigned int \fImins_units:4\fP SMPTE minutes BCD unit 0\&.\&.9\&. .br .PP unsigned int \fIsecs_tens:3\fP SMPTE seconds BCD tens 0\&.\&.6\&. .br .PP unsigned int \fIsecs_units:4\fP SMPTE seconds BCD unit 0\&.\&.9\&. .br .PP unsigned int \fIsync_word:16\fP .br .PP unsigned int \fIuser1:4\fP .br .PP unsigned int \fIuser2:4\fP .br .PP unsigned int \fIuser3:4\fP .br .PP unsigned int \fIuser4:4\fP .br .PP unsigned int \fIuser5:4\fP .br .PP unsigned int \fIuser6:4\fP .br .PP unsigned int \fIuser7:4\fP .br .PP unsigned int \fIuser8:4\fP .br .PP .RE .PP .SH "struct LTCFrameExt" .PP Extended LTC frame - includes audio-sample position offsets, volume, etc .PP Note: For TV systems, the sample in the LTC audio data stream where the LTC Frame starts is not necessarily at the same time as the video-frame which is described by the LTC Frame\&. .PP \fBoff_start\fP denotes the time of the first transition of bit 0 in the LTC frame\&. .PP For 525/60 Television systems, the first transition shall occur at the beginning of line 5 of the frame with which it is associated\&. The tolerance is ± 1\&.5 lines\&. .PP For 625/50 systems, the first transition shall occur at the beginning of line 2 ± 1\&.5 lines of the frame with which it is associated\&. .PP Only for 1125/60 systems, the first transition occurs exactly at the vertical sync timing reference of the frame\&. ± 1 line\&. .PP \fBExamples: \fP .in +1c \fBltcdecode\&.c\fP\&. .PP \fBData Fields:\fP .RS 4 float \fIbiphase_tics[\fBLTC_FRAME_BIT_COUNT\fP]\fP detailed timing info: phase of the LTC signal; the time between each bit in the LTC-frame in audio-frames\&. Summing all 80 values in the array will yield audio-frames/LTC-frame = (\fBoff_end\fP - \fBoff_start\fP + 1)\&. .br .PP \fBLTCFrame\fP \fIltc\fP the actual LTC frame\&. see \fBLTCFrame\fP .br .PP \fBltc_off_t\fP \fIoff_end\fP the sample in the stream corresponding to the end of the LTC frame\&. .br .PP \fBltc_off_t\fP \fIoff_start\fP the approximate sample in the stream corresponding to the start of the LTC frame\&. .br .PP int \fIreverse\fP if non-zero, a reverse played LTC frame was detected\&. Since the frame was reversed, it started at off_end and finishes as off_start (off_end > off_start)\&. (Note: in reverse playback the (reversed) sync-word of the next/previous frame is detected, this offset is corrected)\&. .br .PP \fBltcsnd_sample_t\fP \fIsample_max\fP the maximum input sample signal for this frame (0\&.\&.255) .br .PP \fBltcsnd_sample_t\fP \fIsample_min\fP the minimum input sample signal for this frame (0\&.\&.255) .br .PP double \fIvolume\fP the volume of the input signal in dbFS .br .PP .RE .PP .SH "struct SMPTETimecode" .PP Human readable time representation, decimal values\&. .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, \fBltcdecode\&.c\fP, and \fBltcencode\&.c\fP\&. .PP \fBData Fields:\fP .RS 4 unsigned char \fIdays\fP day of month 1\&.\&.31 .br .PP unsigned char \fIframe\fP sub-second frame 0\&.\&.(FPS - 1) .br .PP unsigned char \fIhours\fP hour 0\&.\&.23 .br .PP unsigned char \fImins\fP minute 0\&.\&.60 .br .PP unsigned char \fImonths\fP valid months are 1\&.\&.12 .br .PP unsigned char \fIsecs\fP second 0\&.\&.60 .br .PP char \fItimezone[6]\fP the timezone 6bytes: '+HHMM' textual representation .br .PP unsigned char \fIyears\fP LTC-date uses 2-digit year 00\&.99\&. .br .PP .RE .PP .SH "Macro Definition Documentation" .PP .SS "#define LTC_FRAME_BIT_COUNT 80" .SH "Typedef Documentation" .PP .SS "typedef long long int \fBltc_off_t\fP" sample-count offset - 64bit wide .SS "typedef struct \fBLTCDecoder\fP \fBLTCDecoder\fP" Opaque structure see: \fBltc_decoder_create\fP, \fBltc_decoder_free\fP .SS "typedef struct \fBLTCEncoder\fP \fBLTCEncoder\fP" Opaque structure see: \fBltc_encoder_create\fP, \fBltc_encoder_free\fP .SS "typedef struct \fBLTCFrame\fP \fBLTCFrame\fP" see \fBLTCFrame\fP .SS "typedef struct \fBLTCFrameExt\fP \fBLTCFrameExt\fP" see \fBLTCFrameExt\fP .SS "typedef unsigned char \fBltcsnd_sample_t\fP" default audio sample type: 8bit unsigned (mono) .SS "typedef struct \fBSMPTETimecode\fP \fBSMPTETimecode\fP" see \fBSMPTETimecode\fP .SH "Enumeration Type Documentation" .PP .SS "enum \fBLTC_BG_FLAGS\fP" encoder and LTCframe <> timecode operation flags .PP \fBEnumerator\fP .in +1c .TP \fB\fILTC_USE_DATE \fP\fP \fBLTCFrame\fP <> \fBSMPTETimecode\fP converter and \fBLTCFrame\fP increment/decrement use date, also set BGF2 to '1' when encoder is initialized or re-initialized (unless LTC_BGF_DONT_TOUCH is given) .TP \fB\fILTC_TC_CLOCK \fP\fP the Timecode is wall-clock aka freerun\&. This also sets BGF1 (unless LTC_BGF_DONT_TOUCH is given) .TP \fB\fILTC_BGF_DONT_TOUCH \fP\fP encoder init or re-init does not touch the BGF bits (initial values after initialization is zero) .TP \fB\fILTC_NO_PARITY \fP\fP parity bit is left untouched when setting or in/decrementing the encoder frame-number .SS "enum \fBLTC_TV_STANDARD\fP" the standard defines the assignment of the binary-group-flag bits basically only 25fps is different, but other standards defined in the SMPTE spec have been included for completeness\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fILTC_TV_525_60 \fP\fP 30fps .TP \fB\fILTC_TV_625_50 \fP\fP 25fps .TP \fB\fILTC_TV_1125_60 \fP\fP 30fps .TP \fB\fILTC_TV_FILM_24 \fP\fP 24fps .SH "Function Documentation" .PP .SS "\fBLTCDecoder\fP* ltc_decoder_create (int apv, int queue_size)" Create a new LTC decoder\&. .PP \fBParameters:\fP .RS 4 \fIapv\fP audio-frames per video frame\&. This is just used for initial settings, the speed is tracked dynamically\&. setting this in the right ballpark is needed to properly decode the first LTC frame in a sequence\&. .br \fIqueue_size\fP length of the internal queue to store decoded frames to SMPTEDecoderWrite\&. .RE .PP \fBReturns:\fP .RS 4 decoder handle or NULL if out-of-memory .RE .PP .PP \fBExamples: \fP .in +1c \fBltcdecode\&.c\fP\&. .SS "int ltc_decoder_free (\fBLTCDecoder\fP * d)" Release memory of decoder\&. .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .RE .PP .PP \fBExamples: \fP .in +1c \fBltcdecode\&.c\fP\&. .SS "void ltc_decoder_queue_flush (\fBLTCDecoder\fP * d)" Remove all LTC frames from the internal queue\&. .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .RE .PP .SS "int ltc_decoder_queue_length (\fBLTCDecoder\fP * d)" Count number of LTC frames currently in the queue\&. .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .RE .PP \fBReturns:\fP .RS 4 number of queued frames .RE .PP .SS "int ltc_decoder_read (\fBLTCDecoder\fP * d, \fBLTCFrameExt\fP * frame)" Decoded LTC frames are placed in a queue\&. This function retrieves a frame from the queue, and stores it at LTCFrameExt* .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .br \fIframe\fP the decoded LTC frame is copied there .RE .PP \fBReturns:\fP .RS 4 1 on success or 0 when no frames queued\&. .RE .PP .PP \fBExamples: \fP .in +1c \fBltcdecode\&.c\fP\&. .SS "void ltc_decoder_write (\fBLTCDecoder\fP * d, \fBltcsnd_sample_t\fP * buf, size_t size, \fBltc_off_t\fP posinfo)" Feed the LTC decoder with new audio samples\&. .PP Parse raw audio for LTC timestamps\&. Once a complete LTC frame has been decoded it is pushed into a queue (\fBltc_decoder_read\fP) .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .br \fIbuf\fP pointer to ltcsnd_sample_t - unsigned 8 bit mono audio data .br \fIsize\fP .RE .PP .PP \fBExamples: \fP .in +1c \fBltcdecode\&.c\fP\&. .SS "void ltc_decoder_write_float (\fBLTCDecoder\fP * d, float * buf, size_t size, \fBltc_off_t\fP posinfo)" Wrapper around \fBltc_decoder_write\fP that accepts floating point audio samples\&. Note: internally libltc uses 8 bit only\&. .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .br \fIbuf\fP pointer to audio sample data .br \fIsize\fP number of samples to parse .br \fIposinfo\fP (optional, recommended) sample-offset in the audio-stream\&. .RE .PP .SS "void ltc_decoder_write_s16 (\fBLTCDecoder\fP * d, short * buf, size_t size, \fBltc_off_t\fP posinfo)" Wrapper around \fBltc_decoder_write\fP that accepts signed 16 bit audio samples\&. Note: internally libltc uses 8 bit only\&. .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .br \fIbuf\fP pointer to audio sample data .br \fIsize\fP number of samples to parse .br \fIposinfo\fP (optional, recommended) sample-offset in the audio-stream\&. .RE .PP .SS "void ltc_decoder_write_u16 (\fBLTCDecoder\fP * d, unsigned short * buf, size_t size, \fBltc_off_t\fP posinfo)" Wrapper around \fBltc_decoder_write\fP that accepts unsigned 16 bit audio samples\&. Note: internally libltc uses 8 bit only\&. .PP \fBParameters:\fP .RS 4 \fId\fP decoder handle .br \fIbuf\fP pointer to audio sample data .br \fIsize\fP number of samples to parse .br \fIposinfo\fP (optional, recommended) sample-offset in the audio-stream\&. .RE .PP .SS "void ltc_encoder_buffer_flush (\fBLTCEncoder\fP * e)" reset the write-pointer of the encoder-buffer .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .RE .PP .SS "\fBLTCEncoder\fP* ltc_encoder_create (double sample_rate, double fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" Allocate and initialize LTC audio encoder\&. .PP calls \fBltc_encoder_reinit\fP internally see, see notes there\&. .PP \fBParameters:\fP .RS 4 \fIsample_rate\fP audio sample rate (eg\&. 48000) .br \fIfps\fP video-frames per second (e\&.g\&. 25\&.0) .br \fIstandard\fP the TV standard to use for Binary Group Flag bit position .br \fIflags\fP binary combination of \fBLTC_BG_FLAGS\fP .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, and \fBltcencode\&.c\fP\&. .SS "int ltc_encoder_dec_timecode (\fBLTCEncoder\fP * e)" Move the encoder to the previous timecode frame\&. This is useful for encoding reverse LTC\&. uses \fBltc_frame_decrement()\fP internally\&. .SS "int ltc_encoder_encode_byte (\fBLTCEncoder\fP * e, int byte, double speed)" Generate LTC audio for given byte of the LTC-frame and place it into the internal buffer\&. .PP see \fBltc_encoder_get_buffer\fP and \fBltc_encoder_get_bufptr\fP .PP LTC has 10 bytes per frame: 0 <= bytecnt < 10 use SMPTESetTime(\&.\&.) to set the current frame before Encoding\&. see tests/encoder\&.c for an example\&. .PP The default output signal is @ \-3dBFS (38\&.\&.218 at 8 bit unsigned)\&. see also \fBltc_encoder_set_volume\fP .PP if speed is < 0, the bits are encoded in reverse\&. slowdown > 10\&.0 requires custom buffer sizes; see \fBltc_encoder_set_bufsize\fP .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIbyte\fP byte of the LTC-frame to encode 0\&.\&.9 .br \fIspeed\fP vari-speed, < 1\&.0 faster, > 1\&.0 slower ; must be != 0 .RE .PP \fBReturns:\fP .RS 4 0 on success, \-1 if byte is invalid or buffer overflow (speed > 10\&.0) .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP\&. .SS "void ltc_encoder_encode_frame (\fBLTCEncoder\fP * e)" Encode a full LTC frame at fixed speed\&. This is equivalent to calling \fBltc_encoder_encode_byte\fP 10 times for bytes 0\&.\&.9 with speed 1\&.0\&. .PP Note: The internal buffer must be empty before calling this function\&. Otherwise it may overflow\&. This is usually the case if it is read with \fBltc_encoder_get_buffer\fP after calling this function\&. .PP The default internal buffersize is exactly one full LTC frame at speed 1\&.0\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, and \fBltcencode\&.c\fP\&. .SS "void ltc_encoder_free (\fBLTCEncoder\fP * e)" Release memory of the encoder\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, and \fBltcencode\&.c\fP\&. .SS "int ltc_encoder_get_buffer (\fBLTCEncoder\fP * e, \fBltcsnd_sample_t\fP * buf)" Copy the accumulated encoded audio to the given sample-buffer and flush the internal buffer\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIbuf\fP place to store the audio-samples, needs to be large enough to hold \fBltc_encoder_get_buffersize\fP bytes .RE .PP \fBReturns:\fP .RS 4 the number of bytes written to the memory area pointed to by buf\&. .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP\&. .SS "size_t ltc_encoder_get_buffersize (\fBLTCEncoder\fP * e)" Query the length of the internal buffer\&. It is allocated to hold audio-frames for exactly one LTC frame for the given sample-rate and frame-rate\&. ie\&. (1 + sample-rate / fps) bytes .PP Note this returns the total size of the buffer, not the used/free part\&. See also \fBltc_encoder_get_bufptr\fP .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .RE .PP \fBReturns:\fP .RS 4 size of the allocated internal buffer\&. .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP\&. .SS "\fBltcsnd_sample_t\fP* ltc_encoder_get_bufptr (\fBLTCEncoder\fP * e, int * size, int flush)" Retrieve a pointer to the accumulated encoded audio-data\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIsize\fP if set, the number of valid bytes in the buffer is stored there .br \fIflush\fP call \fBltc_encoder_buffer_flush\fP - reset the buffer write-pointer .RE .PP \fBReturns:\fP .RS 4 pointer to encoder-buffer .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, and \fBltcencode\&.c\fP\&. .SS "void ltc_encoder_get_frame (\fBLTCEncoder\fP * e, \fBLTCFrame\fP * f)" Low-level access to the encoder internal \fBLTCFrame\fP data .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIf\fP return LTC frame data .RE .PP .SS "void ltc_encoder_get_timecode (\fBLTCEncoder\fP * e, \fBSMPTETimecode\fP * t)" Query the current encoder timecode\&. .PP Note: the decoder stores its internal state in an LTC-frame, this function converts that LTC-Frame into \fBSMPTETimecode\fP on demand\&. see also \fBltc_encoder_get_frame\fP\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIt\fP is set to current timecode .RE .PP .SS "int ltc_encoder_inc_timecode (\fBLTCEncoder\fP * e)" Move the encoder to the next timecode frame\&. uses \fBltc_frame_increment()\fP internally\&. .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, and \fBltcencode\&.c\fP\&. .SS "int ltc_encoder_reinit (\fBLTCEncoder\fP * e, double sample_rate, double fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" Change the encoder settings without re-allocating any library internal data structure (realtime safe)\&. changing the fps and or sample-rate implies a buffer flush, and biphase state reset\&. .PP This call will fail if the internal buffer is too small to hold one full LTC frame\&. Use \fBltc_encoder_set_bufsize\fP to prepare an internal buffer large enough to accommodate all sample_rate, fps combinations that you would like to re-init to\&. .PP The LTC frame payload data is not modified by this call, however, the flag-bits of the LTC-Frame are updated: If fps equals to 29\&.97 or 30000\&.0/1001\&.0, the \fBLTCFrame\fP's 'dfbit' bit is set to 1 to indicate drop-frame timecode\&. .PP Unless the LTC_BGF_DONT_TOUCH flag is set the BGF1 is set or cleared depending on LTC_TC_CLOCK and BGF0,2 according to LTC_USE_DATE and the given standard\&. col_frame is cleared and the parity recomputed (unless LTC_NO_PARITY is given)\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIsample_rate\fP audio sample rate (eg\&. 48000) .br \fIfps\fP video-frames per second (e\&.g\&. 25\&.0) .br \fIstandard\fP the TV standard to use for Binary Group Flag bit position .br \fIflags\fP binary combination of \fBLTC_BG_FLAGS\fP .RE .PP .PP \fBExamples: \fP .in +1c \fBltcencode\&.c\fP\&. .SS "void ltc_encoder_reset (\fBLTCEncoder\fP * e)" reset ecoder state\&. flushes buffer, reset biphase state .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .RE .PP .SS "int ltc_encoder_set_bufsize (\fBLTCEncoder\fP * e, double sample_rate, double fps)" Configure a custom size for the internal buffer\&. .PP This is needed if you are planning to call \fBltc_encoder_reinit()\fP or if you want to keep more than one LTC frame's worth of data in the library's internal buffer\&. .PP The buffer-size is (1 + sample_rate / fps) bytes\&. resizing the internal buffer will flush all existing data in it - alike \fBltc_encoder_buffer_flush\fP\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIsample_rate\fP audio sample rate (eg\&. 48000) .br \fIfps\fP video-frames per second (e\&.g\&. 25\&.0) .RE .PP \fBReturns:\fP .RS 4 0 on success, \-1 if allocation fails (which makes the encoder unusable, call \fBltc_encoder_free\fP or realloc the buffer) .RE .PP .PP \fBExamples: \fP .in +1c \fBltcencode\&.c\fP\&. .SS "void ltc_encoder_set_filter (\fBLTCEncoder\fP * e, double rise_time)" Set encoder signal rise-time / signal filtering .PP LTC signal should have a rise time of 40us +/- 10 us\&. by default the encoder honors this and low-pass filters the output depending on the sample-rate\&. .PP If you want a perfect square wave, set 'rise_time' to 0\&. .PP Note \fBltc_encoder_reinit\fP resets the filter-time-constant to use the default 40us for the given sample-rate, overriding any value previously set with \fBltc_encoder_set_filter\fP .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIrise_time\fP the signal rise-time in us (10^(\-6) sec), set to 0 for perfect square wave, default 40\&.0 .RE .PP .PP \fBExamples: \fP .in +1c \fBltcencode\&.c\fP\&. .SS "void ltc_encoder_set_frame (\fBLTCEncoder\fP * e, \fBLTCFrame\fP * f)" Low-level access to the internal \fBLTCFrame\fP data\&. .PP Note: be careful to about f->dfbit, the encoder sets this [only] upon initialization\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIf\fP LTC frame data to use .RE .PP .SS "void ltc_encoder_set_timecode (\fBLTCEncoder\fP * e, \fBSMPTETimecode\fP * t)" Set the encoder LTC-frame to the given \fBSMPTETimecode\fP\&. The next call to \fBltc_encoder_encode_byte\fP or \fBltc_encoder_encode_frame\fP will encode this time to LTC audio-samples\&. .PP Internally this call uses \fBltc_time_to_frame\fP because the LTCEncoder operates on LTCframes only\&. see als \fBltc_encoder_set_frame\fP .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIt\fP timecode to set\&. .RE .PP .PP \fBExamples: \fP .in +1c \fBexample_encode\&.c\fP, and \fBltcencode\&.c\fP\&. .SS "void ltc_encoder_set_user_bits (\fBLTCEncoder\fP * e, unsigned long data)" Set the user-bits of the frame to the given data\&. .PP The data should be a 32-bits unsigned integer\&. It is written LSB first continiously int the eight user fields\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIdata\fP the data to write .RE .PP .SS "int ltc_encoder_set_volume (\fBLTCEncoder\fP * e, double dBFS)" Set the volume of the generated LTC signal .PP typically LTC is sent at 0dBu ; in EBU callibrated systems that corresponds to \-18dBFS\&. - by default libltc creates \-3dBFS .PP since libltc generated 8bit audio-data, the minimum dBFS is about \-42dB which corresponds to 1 bit\&. .PP 0dB corresponds to a signal range of 127 1\&.\&.255 with 128 at the center\&. .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .br \fIdBFS\fP the volume in dB full-scale (<= 0\&.0) .RE .PP \fBReturns:\fP .RS 4 0 on success, \-1 if the value was out of range .RE .PP .PP \fBExamples: \fP .in +1c \fBltcencode\&.c\fP\&. .SS "\fBltc_off_t\fP ltc_frame_alignment (double samples_per_frame, enum \fBLTC_TV_STANDARD\fP standard)" \fBLTCFrame\fP sample alignment offset\&. .PP There is a relative offset of the LTC-Frame start and the TV-frame\&. The first bit of a LTC frame corresponds to a specific line in the actual video frame\&. When decoding this offset needs to be subtracted from the LTC-frame's audio-sample-time to match the TV-frame's start position\&. .PP For film frames or HDV the offset is zero\&. .PP \fBParameters:\fP .RS 4 \fIsamples_per_frame\fP audio-samples per timecode-frame (eg\&. 1920 = 48000/25) .br \fIstandard\fP the TV standard .RE .PP \fBReturns:\fP .RS 4 offset in samples .RE .PP .SS "int ltc_frame_decrement (\fBLTCFrame\fP * frame, int fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" Decrement the timecode by one Frame (1/framerate seconds) and set the Frame's parity bit accordingly (see \fBltc_frame_set_parity\fP) .PP \fBParameters:\fP .RS 4 \fIframe\fP the LTC-timecode to decrement .br \fIfps\fP integer framerate (for drop-frame-timecode set frame->dfbit and round-up the fps)\&. .br \fIstandard\fP the TV standard to use for parity bit assignment if set to 1 the 25fps standard is enabled and LTC Frame bit 59 instead of 27 is used for the parity\&. It only has only has effect flag bit 4 (LTC_NO_PARITY) is cleared\&. .br \fIflags\fP binary combination of \fBLTC_BG_FLAGS\fP - here only LTC_USE_DATE and LTC_NO_PARITY are relevant\&. if the bit 0 is set (1) interpret user-data as date and decrement date if timecode wraps at 24h\&. (Note: leap-years are taken into account, but since the year is two-digit only, the 100,400yr rules are ignored\&. '00' is assumed to be year 2000 which was a leap year\&.) bit 3 (8) indicates that the parity bit should not be touched .RE .PP \fBReturns:\fP .RS 4 1 if timecode was wrapped around at 23:59:59:ff, 0 otherwise .RE .PP .SS "unsigned long ltc_frame_get_user_bits (\fBLTCFrame\fP * f)" Get a 32-bits unsigned integer from the user-data bits\&. The data should be written LSB first in the frame .PP \fBParameters:\fP .RS 4 \fIe\fP encoder handle .RE .PP .SS "int ltc_frame_increment (\fBLTCFrame\fP * frame, int fps, enum \fBLTC_TV_STANDARD\fP standard, int flags)" Increment the timecode by one Frame (1/framerate seconds) and set the Frame's parity bit accordingly (see \fBltc_frame_set_parity\fP) .PP \fBParameters:\fP .RS 4 \fIframe\fP the LTC-timecode to increment .br \fIfps\fP integer framerate (for drop-frame-timecode set frame->dfbit and round-up the fps)\&. .br \fIstandard\fP the TV standard to use for parity bit assignment if set to 1 the 25fps standard is enabled and LTC Frame bit 59 instead of 27 is used for the parity\&. It only has only has effect flag bit 4 (LTC_NO_PARITY) is cleared\&. .br \fIflags\fP binary combination of \fBLTC_BG_FLAGS\fP - here only LTC_USE_DATE and LTC_NO_PARITY are relevant\&. If the bit 0 (1) is set (1) interpret user-data as date and increment date if timecode wraps after 24h\&. (Note: leap-years are taken into account, but since the year is two-digit only, the 100,400yr rules are ignored\&. '00' is assumed to be year 2000 which was a leap year\&.) .RE .PP \fBReturns:\fP .RS 4 1 if timecode was wrapped around after 23:59:59:ff, 0 otherwise .RE .PP .SS "void ltc_frame_reset (\fBLTCFrame\fP * frame)" Reset all values of a LTC FRAME to zero, except for the sync-word (0x3FFD) at the end\&. The sync word is set according to architecture (big/little endian)\&. Also set the Frame's parity bit accordingly (see \fBltc_frame_set_parity\fP) .PP \fBParameters:\fP .RS 4 \fIframe\fP the \fBLTCFrame\fP to reset .RE .PP .SS "void ltc_frame_set_parity (\fBLTCFrame\fP * frame, enum \fBLTC_TV_STANDARD\fP standard)" Set the parity of the LTC frame\&. .PP Bi-Phase Mark Phase Correction bit (bit 27 - or 59) may be set or cleared so that that every 80-bit word contains an even number of zeroes\&. This means that the phase in every Sync Word will be the same\&. .PP This is merely cosmetic; the motivation to keep the polarity of the waveform constant is to make finding the Sync Word visibly (on a scope) easier\&. .PP There is usually no need to call this function directly\&. The encoder utility functions \fBltc_time_to_frame\fP, \fBltc_frame_increment\fP and \fBltc_frame_decrement\fP include a call to it\&. .PP \fBParameters:\fP .RS 4 \fIframe\fP the LTC to analyze and set or clear the biphase_mark_phase_correction bit\&. .br \fIstandard\fP If 1 (aka LTC_TV_625_50) , the 25fps mode (bit 59 - aka binary_group_flag_bit2) is used, otherwise the 30fps, 24fps mode (bit 27 -- biphase_mark_phase_correction) is set or cleared\&. .RE .PP .SS "void ltc_frame_to_time (\fBSMPTETimecode\fP * stime, \fBLTCFrame\fP * frame, int flags)" Convert binary \fBLTCFrame\fP into \fBSMPTETimecode\fP struct .PP \fBParameters:\fP .RS 4 \fIstime\fP output .br \fIframe\fP input .br \fIflags\fP binary combination of \fBLTC_BG_FLAGS\fP - here only LTC_USE_DATE is relevant\&. if LTC_USE_DATE is set, the user-fields in \fBLTCFrame\fP will be parsed into the date variable of \fBSMPTETimecode\fP\&. otherwise the date information in the \fBSMPTETimecode\fP is set to zero\&. .RE .PP .PP \fBExamples: \fP .in +1c \fBltcdecode\&.c\fP\&. .SS "void ltc_time_to_frame (\fBLTCFrame\fP * frame, \fBSMPTETimecode\fP * stime, enum \fBLTC_TV_STANDARD\fP standard, int flags)" Translate \fBSMPTETimecode\fP struct into its binary LTC representation and set the LTC frame's parity bit accordingly (see \fBltc_frame_set_parity\fP) .PP \fBParameters:\fP .RS 4 \fIframe\fP output - the frame to be set .br \fIstime\fP input - timecode input .br \fIstandard\fP the TV standard to use for parity bit assignment .br \fIflags\fP binary combination of \fBLTC_BG_FLAGS\fP - here only LTC_USE_DATE and LTC_NO_PARITY are relevant\&. if LTC_USE_DATE is given, user-fields in \fBLTCFrame\fP will be set from the date in \fBSMPTETimecode\fP, otherwise the user-bits are not modified\&. All non-timecode fields remain untouched - except for the parity bit unless LTC_NO_PARITY is given\&. .RE .PP .SS "int parse_bcg_flags (\fBLTCFrame\fP * f, enum \fBLTC_TV_STANDARD\fP standard)" Parse Binary Group Flags into standard independent format: bit 0 (1) - BGF 0, bit 1 (2) - BGF 1, bit 2 (4) - BGF 2 .PP \fBParameters:\fP .RS 4 \fIf\fP LTC frame data analyze .br \fIstandard\fP the TV standard to use -- see \fBLTCFrame\fP for BGF assignment .RE .PP \fBReturns:\fP .RS 4 LTC Binary Group Flags .RE .PP .SH "Author" .PP Generated automatically by Doxygen for libltc from the source code\&. libltc-1.3.1/doc/smptefmt.png000066400000000000000000000017601345125773300161150ustar00rootroot00000000000000PNG  IHDRX9sRGBPLTEٟbKGDHIDATXoHaכT$_Dc" AuH\AŜ:-jU^{ :#VqE贼{=s$TƏ}<{lWֱĐ OZIIʘ쎬#}"2HkťH4gŬcnL DOD#%u!>DK#-&Q< >GX C1F?Д|LOI0a(u8}ǟ+p.{z[[WB ^~fK/cE'Ul \ s@OXR2Υ~]&3 ppc^FONzȗ<YkyU`Y`gZWSzf>Г3f?(֔kB-7uU2k9ܢA>6&>}Vm/LJϷPO^i4VnxGuQw䚺^un r\ =_K\GaB$1#++!瘣Z~cc$#1~ԯƯe!iy/Fr ,< G5FAd2ss\\WdqK22uEHop~~:މ6_//yߣe*}1[:\Ro?5f>!FIENDB`libltc-1.3.1/ltc.pc.in000066400000000000000000000003661345125773300145170ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libltc Description: linear/longitudinal timecode library Requires: Version: @VERSION@ Libs: -L${libdir} -lltc -lm Libs.static: -lm Cflags: -I${includedir} libltc-1.3.1/src/000077500000000000000000000000001345125773300135665ustar00rootroot00000000000000libltc-1.3.1/src/Makefile.am000066400000000000000000000003771345125773300156310ustar00rootroot00000000000000lib_LTLIBRARIES = libltc.la include_HEADERS = ltc.h libltc_la_SOURCES=ltc.c config.h decoder.h decoder.c encoder.h encoder.c timecode.c libltc_la_LDFLAGS=@LIBLTC_LDFLAGS@ -version-info @VERSION_INFO@ libltc_la_LIBADD=-lm libltc_la_CFLAGS=@LIBLTC_CFLAGS@ libltc-1.3.1/src/decoder.c000066400000000000000000000262041345125773300153430ustar00rootroot00000000000000/* libltc - en+decode linear timecode Copyright (C) 2005 Maarten de Boer Copyright (C) 2006-2016 Robin Gareus Copyright (C) 2008-2009 Jan Binary constant generator macro for endianess conversion by Tom Torfs - donated to the public domain This program 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 3 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 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, see . */ /** turn a numeric literal into a hex constant * (avoids problems with leading zeroes) * 8-bit constants max value 0x11111111, always fits in unsigned long */ #define HEX__(n) 0x##n##LU /** * 8-bit conversion function */ #define B8__(x) ((x&0x0000000FLU)?1:0) \ +((x&0x000000F0LU)?2:0) \ +((x&0x00000F00LU)?4:0) \ +((x&0x0000F000LU)?8:0) \ +((x&0x000F0000LU)?16:0) \ +((x&0x00F00000LU)?32:0) \ +((x&0x0F000000LU)?64:0) \ +((x&0xF0000000LU)?128:0) /** for upto 8-bit binary constants */ #define B8(d) ((unsigned char)B8__(HEX__(d))) /** for upto 16-bit binary constants, MSB first */ #define B16(dmsb,dlsb) (((unsigned short)B8(dmsb)<<8) + B8(dlsb)) /** turn a numeric literal into a hex constant *(avoids problems with leading zeroes) * 8-bit constants max value 0x11111111, always fits in unsigned long */ #define HEX__(n) 0x##n##LU /** 8-bit conversion function */ #define B8__(x) ((x&0x0000000FLU)?1:0) \ +((x&0x000000F0LU)?2:0) \ +((x&0x00000F00LU)?4:0) \ +((x&0x0000F000LU)?8:0) \ +((x&0x000F0000LU)?16:0) \ +((x&0x00F00000LU)?32:0) \ +((x&0x0F000000LU)?64:0) \ +((x&0xF0000000LU)?128:0) /** for upto 8-bit binary constants */ #define B8(d) ((unsigned char)B8__(HEX__(d))) /** for upto 16-bit binary constants, MSB first */ #define B16(dmsb,dlsb) (((unsigned short)B8(dmsb)<<8) + B8(dlsb)) /* Example usage: * B8(01010101) = 85 * B16(10101010,01010101) = 43605 */ #include #include #include #include #include "decoder.h" #define DEBUG_DUMP(msg, f) \ { \ int _ii; \ printf("%s", msg); \ for (_ii=0; _ii < (LTC_FRAME_BIT_COUNT >> 3); _ii++) { \ const unsigned char _bit = ((unsigned char*)(f))[_ii]; \ printf("%c", (_bit & B8(10000000) ) ? '1' : '0'); \ printf("%c", (_bit & B8(01000000) ) ? '1' : '0'); \ printf("%c", (_bit & B8(00100000) ) ? '1' : '0'); \ printf("%c", (_bit & B8(00010000) ) ? '1' : '0'); \ printf("%c", (_bit & B8(00001000) ) ? '1' : '0'); \ printf("%c", (_bit & B8(00000100) ) ? '1' : '0'); \ printf("%c", (_bit & B8(00000010) ) ? '1' : '0'); \ printf("%c", (_bit & B8(00000001) ) ? '1' : '0'); \ printf(" "); \ }\ printf("\n"); \ } #if (defined _MSC_VER && _MSC_VER <= 1800) #define inline __inline #endif #if (!defined INFINITY && defined _MSC_VER) #define INFINITY std::numeric_limits::infinity() #endif #if (!defined INFINITY && defined HUGE_VAL) #define INFINITY HUGE_VAL #endif static double calc_volume_db(LTCDecoder *d) { if (d->snd_to_biphase_max <= d->snd_to_biphase_min) return -INFINITY; return (20.0 * log10((d->snd_to_biphase_max - d->snd_to_biphase_min) / 255.0)); } static void parse_ltc(LTCDecoder *d, unsigned char bit, ltc_off_t offset, ltc_off_t posinfo) { int bit_num, bit_set, byte_num; if (d->bit_cnt == 0) { memset(&d->ltc_frame, 0, sizeof(LTCFrame)); if (d->frame_start_prev < 0) { d->frame_start_off = posinfo - d->snd_to_biphase_period; } else { d->frame_start_off = d->frame_start_prev; } } d->frame_start_prev = offset + posinfo; if (d->bit_cnt >= LTC_FRAME_BIT_COUNT) { /* shift bits backwards */ int k = 0; const int byte_num_max = LTC_FRAME_BIT_COUNT >> 3; for (k=0; k< byte_num_max; k++) { const unsigned char bi = ((unsigned char*)&d->ltc_frame)[k]; unsigned char bo = 0; bo |= (bi & B8(10000000) ) ? B8(01000000) : 0; bo |= (bi & B8(01000000) ) ? B8(00100000) : 0; bo |= (bi & B8(00100000) ) ? B8(00010000) : 0; bo |= (bi & B8(00010000) ) ? B8(00001000) : 0; bo |= (bi & B8(00001000) ) ? B8(00000100) : 0; bo |= (bi & B8(00000100) ) ? B8(00000010) : 0; bo |= (bi & B8(00000010) ) ? B8(00000001) : 0; if (k+1 < byte_num_max) { bo |= ( (((unsigned char*)&d->ltc_frame)[k+1]) & B8(00000001) ) ? B8(10000000): B8(00000000); } ((unsigned char*)&d->ltc_frame)[k] = bo; } d->frame_start_off += ceil(d->snd_to_biphase_period); d->bit_cnt--; } d->decoder_sync_word <<= 1; if (bit) { d->decoder_sync_word |= B16(00000000,00000001); if (d->bit_cnt < LTC_FRAME_BIT_COUNT) { // Isolating the lowest three bits: the location of this bit in the current byte bit_num = (d->bit_cnt & B8(00000111)); // Using the bit number to define which of the eight bits to set bit_set = (B8(00000001) << bit_num); // Isolating the higher bits: the number of the byte/char the target bit is contained in byte_num = d->bit_cnt >> 3; (((unsigned char*)&d->ltc_frame)[byte_num]) |= bit_set; } } d->bit_cnt++; if (d->decoder_sync_word == B16(00111111,11111101) /*LTC Sync Word 0x3ffd*/) { if (d->bit_cnt == LTC_FRAME_BIT_COUNT) { int bc; memcpy( &d->queue[d->queue_write_off].ltc, &d->ltc_frame, sizeof(LTCFrame)); for(bc = 0; bc < LTC_FRAME_BIT_COUNT; ++bc) { const int btc = (d->biphase_tic + bc ) % LTC_FRAME_BIT_COUNT; d->queue[d->queue_write_off].biphase_tics[bc] = d->biphase_tics[btc]; } d->queue[d->queue_write_off].off_start = d->frame_start_off; d->queue[d->queue_write_off].off_end = posinfo + (ltc_off_t) offset - 1LL; d->queue[d->queue_write_off].reverse = 0; d->queue[d->queue_write_off].volume = calc_volume_db(d); d->queue[d->queue_write_off].sample_min = d->snd_to_biphase_min; d->queue[d->queue_write_off].sample_max = d->snd_to_biphase_max; d->queue_write_off++; if (d->queue_write_off == d->queue_len) d->queue_write_off = 0; } d->bit_cnt = 0; } if (d->decoder_sync_word == B16(10111111,11111100) /* reverse sync-word*/) { if (d->bit_cnt == LTC_FRAME_BIT_COUNT) { /* reverse frame */ int bc; int k = 0; int byte_num_max = LTC_FRAME_BIT_COUNT >> 3; /* swap bits */ for (k=0; k< byte_num_max; k++) { const unsigned char bi = ((unsigned char*)&d->ltc_frame)[k]; unsigned char bo = 0; bo |= (bi & B8(10000000) ) ? B8(00000001) : 0; bo |= (bi & B8(01000000) ) ? B8(00000010) : 0; bo |= (bi & B8(00100000) ) ? B8(00000100) : 0; bo |= (bi & B8(00010000) ) ? B8(00001000) : 0; bo |= (bi & B8(00001000) ) ? B8(00010000) : 0; bo |= (bi & B8(00000100) ) ? B8(00100000) : 0; bo |= (bi & B8(00000010) ) ? B8(01000000) : 0; bo |= (bi & B8(00000001) ) ? B8(10000000) : 0; ((unsigned char*)&d->ltc_frame)[k] = bo; } /* swap bytes */ byte_num_max-=2; // skip sync-word for (k=0; k< (byte_num_max)/2; k++) { const unsigned char bi = ((unsigned char*)&d->ltc_frame)[k]; ((unsigned char*)&d->ltc_frame)[k] = ((unsigned char*)&d->ltc_frame)[byte_num_max-1-k]; ((unsigned char*)&d->ltc_frame)[byte_num_max-1-k] = bi; } memcpy( &d->queue[d->queue_write_off].ltc, &d->ltc_frame, sizeof(LTCFrame)); for(bc = 0; bc < LTC_FRAME_BIT_COUNT; ++bc) { const int btc = (d->biphase_tic + bc ) % LTC_FRAME_BIT_COUNT; d->queue[d->queue_write_off].biphase_tics[bc] = d->biphase_tics[btc]; } d->queue[d->queue_write_off].off_start = d->frame_start_off - 16 * d->snd_to_biphase_period; d->queue[d->queue_write_off].off_end = posinfo + (ltc_off_t) offset - 1LL - 16 * d->snd_to_biphase_period; d->queue[d->queue_write_off].reverse = (LTC_FRAME_BIT_COUNT >> 3) * 8 * d->snd_to_biphase_period; d->queue[d->queue_write_off].volume = calc_volume_db(d); d->queue[d->queue_write_off].sample_min = d->snd_to_biphase_min; d->queue[d->queue_write_off].sample_max = d->snd_to_biphase_max; d->queue_write_off++; if (d->queue_write_off == d->queue_len) d->queue_write_off = 0; } d->bit_cnt = 0; } } static inline void biphase_decode2(LTCDecoder *d, ltc_off_t offset, ltc_off_t pos) { d->biphase_tics[d->biphase_tic] = d->snd_to_biphase_period; d->biphase_tic = (d->biphase_tic + 1) % LTC_FRAME_BIT_COUNT; if (d->snd_to_biphase_cnt <= 2 * d->snd_to_biphase_period) { pos -= (d->snd_to_biphase_period - d->snd_to_biphase_cnt); } if (d->snd_to_biphase_state == d->biphase_prev) { d->biphase_state = 1; parse_ltc(d, 0, offset, pos); } else { d->biphase_state = 1 - d->biphase_state; if (d->biphase_state == 1) { parse_ltc(d, 1, offset, pos); } } d->biphase_prev = d->snd_to_biphase_state; } void decode_ltc(LTCDecoder *d, ltcsnd_sample_t *sound, size_t size, ltc_off_t posinfo) { size_t i; for (i = 0 ; i < size ; i++) { ltcsnd_sample_t max_threshold, min_threshold; /* track minimum and maximum values */ d->snd_to_biphase_min = SAMPLE_CENTER - (((SAMPLE_CENTER - d->snd_to_biphase_min) * 15) / 16); d->snd_to_biphase_max = SAMPLE_CENTER + (((d->snd_to_biphase_max - SAMPLE_CENTER) * 15) / 16); if (sound[i] < d->snd_to_biphase_min) d->snd_to_biphase_min = sound[i]; if (sound[i] > d->snd_to_biphase_max) d->snd_to_biphase_max = sound[i]; /* set the thresholds for hi/lo state tracking */ min_threshold = SAMPLE_CENTER - (((SAMPLE_CENTER - d->snd_to_biphase_min) * 8) / 16); max_threshold = SAMPLE_CENTER + (((d->snd_to_biphase_max - SAMPLE_CENTER) * 8) / 16); if ( /* Check for a biphase state change */ ( d->snd_to_biphase_state && (sound[i] > max_threshold) ) || ( !d->snd_to_biphase_state && (sound[i] < min_threshold) ) ) { /* If the sample count has risen above the biphase length limit */ if (d->snd_to_biphase_cnt > d->snd_to_biphase_lmt) { /* single state change within a biphase priod. decode to a 0 */ biphase_decode2(d, i, posinfo); biphase_decode2(d, i, posinfo); } else { /* "short" state change covering half a period * together with the next or previous state change decode to a 1 */ d->snd_to_biphase_cnt *= 2; biphase_decode2(d, i, posinfo); } if (d->snd_to_biphase_cnt > (d->snd_to_biphase_period * 4)) { /* "long" silence in between * -> reset parser, don't use it for phase-tracking */ d->bit_cnt = 0; } else { /* track speed variations * As this is only executed at a state change, * d->snd_to_biphase_cnt is an accurate representation of the current period length. */ d->snd_to_biphase_period = (d->snd_to_biphase_period * 3.0 + d->snd_to_biphase_cnt) / 4.0; /* This limit specifies when a state-change is * considered biphase-clock or 2*biphase-clock. * The relation with period has been determined * empirically through trial-and-error */ d->snd_to_biphase_lmt = (d->snd_to_biphase_period * 3) / 4; } d->snd_to_biphase_cnt = 0; d->snd_to_biphase_state = !d->snd_to_biphase_state; } d->snd_to_biphase_cnt++; } } libltc-1.3.1/src/decoder.h000066400000000000000000000032701345125773300153460ustar00rootroot00000000000000/* libltc - en+decode linear timecode Copyright (C) 2006-2012 Robin Gareus This program 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 3 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 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, see . */ #include "ltc.h" #ifndef SAMPLE_CENTER // also defined in encoder.h #define SAMPLE_CENTER 128 // unsigned 8 bit. #endif struct LTCDecoder { LTCFrameExt* queue; int queue_len; int queue_read_off; int queue_write_off; unsigned char biphase_state; unsigned char biphase_prev; unsigned char snd_to_biphase_state; int snd_to_biphase_cnt; ///< counts the samples in the current period int snd_to_biphase_lmt; ///< specifies when a state-change is considered biphase-clock or 2*biphase-clock double snd_to_biphase_period; ///< track length of a period - used to set snd_to_biphase_lmt ltcsnd_sample_t snd_to_biphase_min; ltcsnd_sample_t snd_to_biphase_max; unsigned short decoder_sync_word; LTCFrame ltc_frame; int bit_cnt; ltc_off_t frame_start_off; ltc_off_t frame_start_prev; float biphase_tics[LTC_FRAME_BIT_COUNT]; int biphase_tic; }; void decode_ltc(LTCDecoder *d, ltcsnd_sample_t *sound, size_t size, ltc_off_t posinfo); libltc-1.3.1/src/encoder.c000066400000000000000000000056111345125773300153540ustar00rootroot00000000000000/* libltc - en+decode linear timecode Copyright (C) 2006-2012 Robin Gareus This program 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 3 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 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, see . */ #include #include #include #include #include "encoder.h" /** * add values to the output buffer */ static int addvalues(LTCEncoder *e, int n) { const ltcsnd_sample_t tgtval = e->state ? e->enc_hi : e->enc_lo; if (e->offset + n >= e->bufsize) { #if 0 fprintf(stderr, "libltc: buffer overflow: %d/%lu\n", (int) e->offset, (unsigned long) e->bufsize); #endif return 1; } ltcsnd_sample_t * const wave = &(e->buf[e->offset]); const double tcf = e->filter_const; if (tcf > 0) { /* low-pass-filter * LTC signal should have a rise time of 40 us +/- 10 us. * * rise-time means from <10% to >90% of the signal. * in each call to addvalues() we start at 50%, so * here we need half-of it. (0.000020 sec) * * e->cutoff = 1.0 -exp( -1.0 / (sample_rate * .000020 / exp(1.0)) ); */ int i; ltcsnd_sample_t val = SAMPLE_CENTER; int m = (n+1)>>1; for (i = 0 ; i < m ; i++) { val = val + tcf * (tgtval - val); wave[n-i-1] = wave[i] = val; } } else { /* perfect square wave */ memset(wave, tgtval, n); } e->offset += n; return 0; } int encode_byte(LTCEncoder *e, int byte, double speed) { if (byte < 0 || byte > 9) return -1; if (speed ==0) return -1; int err = 0; const unsigned char c = ((unsigned char*)&e->f)[byte]; unsigned char b = (speed < 0)?128:1; // bit const double spc = e->samples_per_clock * fabs(speed); const double sph = e->samples_per_clock_2 * fabs(speed); do { int n; if ((c & b) == 0) { n = (int)(spc + e->sample_remainder); e->sample_remainder = spc + e->sample_remainder - n; e->state = !e->state; err |= addvalues(e, n); } else { n = (int)(sph + e->sample_remainder); e->sample_remainder = sph + e->sample_remainder - n; e->state = !e->state; err |= addvalues(e, n); n = (int)(sph + e->sample_remainder); e->sample_remainder = sph + e->sample_remainder - n; e->state = !e->state; err |= addvalues(e, n); } /* this is based on the assumption that with every compiler * ((unsigned char) 128)<<1 == ((unsigned char 1)>>1) == 0 */ if (speed < 0) b >>= 1; else b <<= 1; } while (b); return err; } libltc-1.3.1/src/encoder.h000066400000000000000000000023711345125773300153610ustar00rootroot00000000000000/* libltc - en+decode linear timecode Copyright (C) 2006-2012 Robin Gareus This program 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 3 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 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, see . */ #include "ltc.h" #ifndef SAMPLE_CENTER // also defined in decoder.h #define SAMPLE_CENTER 128 // unsigned 8 bit. #endif struct LTCEncoder { double fps; double sample_rate; double filter_const; int flags; enum LTC_TV_STANDARD standard; ltcsnd_sample_t enc_lo, enc_hi; size_t offset; size_t bufsize; ltcsnd_sample_t *buf; char state; double samples_per_clock; double samples_per_clock_2; double sample_remainder; LTCFrame f; }; int encode_byte(LTCEncoder *e, int byte, double speed); libltc-1.3.1/src/ltc.c000066400000000000000000000227411345125773300145220ustar00rootroot00000000000000/* libltc - en+decode linear timecode Copyright (C) 2006-2015 Robin Gareus This program 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 3 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 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, see . */ #include #include #include #include #include "ltc.h" #include "decoder.h" #include "encoder.h" #if (defined _MSC_VER && _MSC_VER < 1800) || (defined __AVR__) static double rint(double v) { // NB. this is identical to round(), not rint(), but the difference is not relevant here return floor(v + 0.5); } #endif /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Decoder */ LTCDecoder* ltc_decoder_create(int apv, int queue_len) { LTCDecoder* d = (LTCDecoder*) calloc(1, sizeof(LTCDecoder)); if (!d) return NULL; d->queue_len = queue_len; d->queue = (LTCFrameExt*) calloc(d->queue_len, sizeof(LTCFrameExt)); if (!d->queue) { free(d); return NULL; } d->biphase_state = 1; d->snd_to_biphase_period = apv / 80; d->snd_to_biphase_lmt = (d->snd_to_biphase_period * 3) / 4; d->snd_to_biphase_min = SAMPLE_CENTER; d->snd_to_biphase_max = SAMPLE_CENTER; d->frame_start_prev = -1; d->biphase_tic = 0; return d; } int ltc_decoder_free(LTCDecoder *d) { if (!d) return 1; if (d->queue) free(d->queue); free(d); return 0; } void ltc_decoder_write(LTCDecoder *d, ltcsnd_sample_t *buf, size_t size, ltc_off_t posinfo) { decode_ltc(d, buf, size, posinfo); } #define LTC_CONVERSION_BUF_SIZE 1024 #define LTCWRITE_TEMPLATE(FN, FORMAT, CONV) \ void ltc_decoder_write_ ## FN (LTCDecoder *d, FORMAT *buf, size_t size, ltc_off_t posinfo) { \ ltcsnd_sample_t tmp[LTC_CONVERSION_BUF_SIZE]; \ size_t copyStart = 0; \ while (copyStart < size) { \ int i; \ int c = size - copyStart; \ c = (c > LTC_CONVERSION_BUF_SIZE) ? LTC_CONVERSION_BUF_SIZE : c; \ for (i=0; i < c; i++) { \ tmp[i] = CONV; \ } \ decode_ltc(d, tmp, c, posinfo + (ltc_off_t)copyStart); \ copyStart += c; \ } \ } LTCWRITE_TEMPLATE(float, float, 128 + (buf[copyStart+i] * 127.0)) /* this relies on the compiler to use an arithemtic right-shift for signed values */ LTCWRITE_TEMPLATE(s16, short, 128 + (buf[copyStart+i] >> 8)) /* this relies on the compiler to use a logical right-shift for unsigned values */ LTCWRITE_TEMPLATE(u16, unsigned short, (buf[copyStart+i] >> 8)) #undef LTC_CONVERSION_BUF_SIZE int ltc_decoder_read(LTCDecoder* d, LTCFrameExt* frame) { if (!frame) return -1; if (d->queue_read_off != d->queue_write_off) { memcpy(frame, &d->queue[d->queue_read_off], sizeof(LTCFrameExt)); d->queue_read_off++; if (d->queue_read_off == d->queue_len) d->queue_read_off = 0; return 1; } return 0; } void ltc_decoder_queue_flush(LTCDecoder* d) { while (d->queue_read_off != d->queue_write_off) { d->queue_read_off++; if (d->queue_read_off == d->queue_len) d->queue_read_off = 0; } } int ltc_decoder_queue_length(LTCDecoder* d) { return (d->queue_write_off - d->queue_read_off + d->queue_len) % d->queue_len; } /* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * Encoder */ LTCEncoder* ltc_encoder_create(double sample_rate, double fps, enum LTC_TV_STANDARD standard, int flags) { if (sample_rate < 1) return NULL; LTCEncoder* e = (LTCEncoder*) calloc(1, sizeof(LTCEncoder)); if (!e) return NULL; /*-3.0 dBFS default */ e->enc_lo = 38; e->enc_hi = 218; e->bufsize = 1 + ceil(sample_rate / fps); e->buf = (ltcsnd_sample_t*) calloc(e->bufsize, sizeof(ltcsnd_sample_t)); if (!e->buf) { free(e); return NULL; } ltc_frame_reset(&e->f); ltc_encoder_reinit(e, sample_rate, fps, standard, flags); return e; } void ltc_encoder_free(LTCEncoder *e) { if (!e) return; if (e->buf) free(e->buf); free(e); } int ltc_encoder_reinit(LTCEncoder *e, double sample_rate, double fps, enum LTC_TV_STANDARD standard, int flags) { if (sample_rate < 1) return -1; size_t bufsize = 1 + ceil(sample_rate / fps); if (bufsize > e->bufsize) { return -1; } e->state = 0; e->offset = 0; e->sample_rate = sample_rate; ltc_encoder_set_filter(e, 40.0); e->fps = fps; e->flags = flags; e->standard = standard; e->samples_per_clock = sample_rate / (fps * 80.0); e->samples_per_clock_2 = e->samples_per_clock / 2.0; e->sample_remainder = 0.5; if (flags & LTC_BGF_DONT_TOUCH) { e->f.col_frame = 0; if (flags<C_TC_CLOCK) { e->f.binary_group_flag_bit1 = 1; } else { e->f.binary_group_flag_bit1 = 0; } switch (standard) { case LTC_TV_625_50: /* 25 fps mode */ e->f.biphase_mark_phase_correction = 0; // BGF0 e->f.binary_group_flag_bit0 = (flags<C_USE_DATE)?1:0; // BGF2 break; default: e->f.binary_group_flag_bit0 = 0; e->f.binary_group_flag_bit2 = (flags<C_USE_DATE)?1:0; break; } } if ((flags<C_NO_PARITY) == 0) { ltc_frame_set_parity(&e->f, standard); } if ((int)rint(fps * 100.0) == 2997) e->f.dfbit = 1; else e->f.dfbit = 0; return 0; } void ltc_encoder_reset(LTCEncoder *e) { e->state = 0; e->sample_remainder = 0.5; e->offset = 0; } int ltc_encoder_set_volume(LTCEncoder *e, double dBFS) { if (dBFS > 0) return -1; double pp = rint(127.0 * pow(10, dBFS/20.0)); if (pp < 1 || pp > 127) return -1; ltcsnd_sample_t diff = ((ltcsnd_sample_t) pp)&0x7f; e->enc_lo = SAMPLE_CENTER - diff; e->enc_hi = SAMPLE_CENTER + diff; return 0; } void ltc_encoder_set_filter(LTCEncoder *e, double rise_time) { /* low-pass-filter * LTC signal should have a rise time of 40 us +/- 10 us. * * rise-time means from <10% to >90% of the signal. * in each call to addvalues() we start at 50% (SAMPLE_CENTER), so * here we need half-of it. */ if (rise_time <= 0) e->filter_const = 0; else e->filter_const = 1.0 - exp( -1.0 / (e->sample_rate * rise_time / 2000000.0 / exp(1.0)) ); } int ltc_encoder_set_bufsize(LTCEncoder *e, double sample_rate, double fps) { free (e->buf); e->offset = 0; e->bufsize = 1 + ceil(sample_rate / fps); e->buf = (ltcsnd_sample_t*) calloc(e->bufsize, sizeof(ltcsnd_sample_t)); if (!e->buf) { return -1; } return 0; } int ltc_encoder_encode_byte(LTCEncoder *e, int byte, double speed) { return encode_byte(e, byte, speed); } void ltc_encoder_encode_frame(LTCEncoder *e) { int byte; for (byte = 0 ; byte < 10 ; byte++) { encode_byte(e, byte, 1.0); } } void ltc_encoder_get_timecode(LTCEncoder *e, SMPTETimecode *t) { ltc_frame_to_time(t, &e->f, e->flags); } void ltc_encoder_set_timecode(LTCEncoder *e, SMPTETimecode *t) { ltc_time_to_frame(&e->f, t, e->standard, e->flags); } void ltc_encoder_set_user_bits(LTCEncoder *e, unsigned long data){ LTCFrame *f = &(e->f); f->user1 = data & 0xF; data >>= 4; f->user2 = data & 0xF; data >>= 4; f->user3 = data & 0xF; data >>= 4; f->user4 = data & 0xF; data >>= 4; f->user5 = data & 0xF; data >>= 4; f->user6 = data & 0xF; data >>= 4; f->user7 = data & 0xF; data >>= 4; f->user8 = data & 0xF; data >>= 4; } unsigned long ltc_frame_get_user_bits(LTCFrame *f){ unsigned long data = 0; data += f->user8; data <<= 4; data += f->user7; data <<= 4; data += f->user6; data <<= 4; data += f->user5; data <<= 4; data += f->user4; data <<= 4; data += f->user3; data <<= 4; data += f->user2; data <<= 4; data += f->user1; return data; } void ltc_encoder_get_frame(LTCEncoder *e, LTCFrame *f) { memcpy(f, &e->f, sizeof(LTCFrame)); } void ltc_encoder_set_frame(LTCEncoder *e, LTCFrame *f) { memcpy(&e->f, f, sizeof(LTCFrame)); } int ltc_encoder_inc_timecode(LTCEncoder *e) { return ltc_frame_increment (&e->f, rint(e->fps), e->standard, e->flags); } int ltc_encoder_dec_timecode(LTCEncoder *e) { return ltc_frame_decrement (&e->f, rint(e->fps), e->standard, e->flags); } size_t ltc_encoder_get_buffersize(LTCEncoder *e) { return(e->bufsize); } void ltc_encoder_buffer_flush(LTCEncoder *e) { e->offset = 0; } ltcsnd_sample_t *ltc_encoder_get_bufptr(LTCEncoder *e, int *size, int flush) { if (size) *size = e->offset; if (flush) e->offset = 0; return e->buf; } int ltc_encoder_get_buffer(LTCEncoder *e, ltcsnd_sample_t *buf) { const int len = e->offset; memcpy(buf, e->buf, len * sizeof(ltcsnd_sample_t) ); e->offset = 0; return(len); } void ltc_frame_set_parity(LTCFrame *frame, enum LTC_TV_STANDARD standard) { int i; unsigned char p = 0; if (standard != LTC_TV_625_50) { /* 30fps, 24fps */ frame->biphase_mark_phase_correction = 0; } else { /* 25fps */ frame->binary_group_flag_bit2 = 0; } for (i=0; i < LTC_FRAME_BIT_COUNT / 8; ++i){ p = p ^ (((unsigned char*)frame)[i]); } #define PRY(BIT) ((p>>BIT)&1) if (standard != LTC_TV_625_50) { /* 30fps, 24fps */ frame->biphase_mark_phase_correction = PRY(0)^PRY(1)^PRY(2)^PRY(3)^PRY(4)^PRY(5)^PRY(6)^PRY(7); } else { /* 25fps */ frame->binary_group_flag_bit2 = PRY(0)^PRY(1)^PRY(2)^PRY(3)^PRY(4)^PRY(5)^PRY(6)^PRY(7); } } ltc_off_t ltc_frame_alignment(double samples_per_frame, enum LTC_TV_STANDARD standard) { switch (standard) { case LTC_TV_525_60: return rint(samples_per_frame * 4.0 / 525.0); case LTC_TV_625_50: return rint(samples_per_frame * 1.0 / 625.0); default: return 0; } } libltc-1.3.1/src/ltc.h000066400000000000000000000754641345125773300145410ustar00rootroot00000000000000/** @file ltc.h @brief libltc - en+decode linear timecode Linear (or Longitudinal) Timecode (LTC) is an encoding of timecode data as a Manchester-Biphase encoded audio signal. The audio signal is commonly recorded on a VTR track or other storage media. libltc facilitates decoding and encoding of LTC from/to timecode, including SMPTE date support. @author Robin Gareus @copyright Copyright (C) 2006-2014 Robin Gareus Copyright (C) 2008-2009 Jan Weiß Inspired by SMPTE Decoder - Maarten de Boer This program 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 3 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 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, see . */ #ifndef LTC_H #define LTC_H 1 #ifdef __cplusplus extern "C" { #endif #if defined _WIN32 && !defined(__LITTLE_ENDIAN__) #define __LITTLE_ENDIAN__ #endif #ifdef __BIG_ENDIAN__ # define LTC_BIG_ENDIAN #elif defined _BIG_ENDIAN # define LTC_BIG_ENDIAN #elif defined __BYTE_ORDER__ # if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ # define LTC_BIG_ENDIAN # endif #elif !defined __LITTLE_ENDIAN__ # include // machine/endian.h # if (defined __BYTE_ORDER__ && defined __ORDER_BIG_ENDIAN__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) # define LTC_BIG_ENDIAN # endif #endif #include /* size_t */ #ifndef DOXYGEN_IGNORE /* libltc version */ #define LIBLTC_VERSION "1.3.1" #define LIBLTC_VERSION_MAJOR 1 #define LIBLTC_VERSION_MINOR 3 #define LIBLTC_VERSION_MICRO 1 /* interface revision number * http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html */ #define LIBLTC_CUR 12 #define LIBLTC_REV 0 #define LIBLTC_AGE 1 #endif /* end DOXYGEN_IGNORE */ /** * default audio sample type: 8bit unsigned (mono) */ typedef unsigned char ltcsnd_sample_t; /** * sample-count offset - 64bit wide */ typedef long long int ltc_off_t; #define LTC_FRAME_BIT_COUNT 80 /** * Raw 80 bit LTC frame * * The datastream for each video frame of Longitudinal Timecode consists of eighty bit-periods. * * At a frame-rate of 30 fps, the bit-rate corresponds to 30 [fps] * 80 [bits/f] = 2400 bits per second. * The frequency for a stream of zeros would be 1.2 kHz and for a stream of ones it would be 2.4 kHz. * \image html smptefmt.png * With all commonly used video-frame-rates and audio-sample-rates, LTC timecode can be recorded * easily into a audio-track. * * In each frame, 26 of the eighty bits carry the SMPTE time in binary coded decimal (BCD). * * These Bits are FRAME-UNITS, FRAME-TENS, SECS-UNITS, SECS-TENS, MINS-UNITS, MINS-TENS, HOURS-UNITS and HOURS-TENS. * The BCD digits are loaded 'least significant bit first' (libltc takes care of the architecture specific alignment). * * 32 bits are assigned as eight groups of four USER-BITS (also sometimes called the "Binary Groups"). * This capacity is generally used to carry extra info such as reel number and/or date. * The User Bits may be allocated howsoever one wishes as long as both Binary Group Flag Bits are cleared. * * The function \ref ltc_frame_to_time can interpret the user-bits as SMPTE Date+Timezone according to SMPTE 309M-1999. * similarly \ref ltc_time_to_frame will do the reverse. * * The last 16 Bits make up the SYNC WORD. These bits indicate the frame boundary, the tape direction, and the bit-rate of the sync tone. * The values of these Bits are fixed as 0011 1111 1111 1101 * * The Bi-Phase Mark Phase Correction Bit (Bit 27 or 59) may be set or cleared so that that every 80-bit word * contains an even number of zeroes. This means that the phase of the pulse train in every Sync Word will be the same. * * Bit 10 indicates drop-frame timecode. * The Colour Frame Flag col.frm is Bit 11; if the timecode intentionally synchronized to a colour TV field sequence, this bit is set. * * Bit 58 is not required for the BCD count for HOURS-TENS (which has a maximum value of two) * and has not been given any other special purpose so remains unassigned. * This Bit has been RESERVED for future assignment. * * The Binary Group Flag Bits (bits 43 and 59) are two bits indicate the format of the User Bits data. * SMPTE 12M-1999 defines the previously reserved bit 58 to signals that the time is locked to wall-clock * within a tolerance of ± 0.5 seconds. * * SMPTE 12M-1999 also changes the numbering schema of the BGF. (BGF1 was renamed to BGF2 and bit 58 becomes BGFB1) * * To further complicate matters, the BGFB assignment as well as the biphase_mark_phase_correction (aka parity) * bit depends on the timecode-format used. * *
 *          25 fps   24, 30 fps
 *  BGF0      27        43
 *  BGF1      58        58
 *  BGF2      43        59
 *  Parity    59        27
 * 
* * The variable naming chosen for the LTCFrame struct is based on the 24,30 fps standard. * * The Binary Group Flag Bits should be used only as shown in the truth table below. * The Unassigned entries in the table should not be used, as they may be allocated specific meanings in the future. * *
 *                                                 BGF0      BGF1    BGF2
 *       user-bits                     timecode    Bit 43   Bit 58  Bit 59 (30fps, 24 fps)
 *                                    |        |   Bit 27   Bit 58  Bit 43 (25fps)
 *  No User Bits format specified     |   ?    |     0       0        0
 *  Eight-bit character set (1)       |   ?    |     1       0        0
 *  Date and Timezone set             |   ?    |     0       0        1
 *  Page/Line multiplex (2)           |   ?    |     1       0        1
 *  Character set not specified       |  clk   |     0       1        0
 *  Reserved                          |   ?    |     1       1        0
 *  Date and Timezone set             |  clk   |     0       1        1
 *  Page/Line multiplex (2)           |  clk   |     1       1        1
 *
 * 
* * (1) ISO/IEC 646 or ISO/IEC 2022 character set. * If the seven-bit ISO codes are being used, they shall be converted to * eight-bit codes by setting the eighth bit to zero. 4 ISO codes can be encoded, * user7 and user8 are to be used for the first code with LSB 7 and MSB in 8. * the remaining ISO codes are to be distributed in the same manner to * user5/6 user3/4 and user1/2 accordingly. * * (2) The Page/Line indicates ANSI/SMPTE-262M is used for the user-bits. It is multiplex system that * can be used to encode large amounts of data in the binary groups through the use of time multiplexing. * * libltc does not use any of the BGF - except for the Parity bit which can be calculated and set with * \ref ltc_frame_set_parity. Setting and interpreting the BGF is left to the application using libltc. * However libltc provides functionality to parse or set date and timezoe according to SMPTE 309M-1999. * * further information: http://www.philrees.co.uk/articles/timecode.htm * and http://www.barney-wol.net/time/timecode.html */ #if (defined LTC_BIG_ENDIAN && !defined DOXYGEN_IGNORE) // Big Endian version, bytes are "upside down" struct LTCFrame { unsigned int user1:4; unsigned int frame_units:4; unsigned int user2:4; unsigned int col_frame:1; unsigned int dfbit:1; unsigned int frame_tens:2; unsigned int user3:4; unsigned int secs_units:4; unsigned int user4:4; unsigned int biphase_mark_phase_correction:1; unsigned int secs_tens:3; unsigned int user5:4; unsigned int mins_units:4; unsigned int user6:4; unsigned int binary_group_flag_bit0:1; unsigned int mins_tens:3; unsigned int user7:4; unsigned int hours_units:4; unsigned int user8:4; unsigned int binary_group_flag_bit2:1; unsigned int binary_group_flag_bit1:1; unsigned int hours_tens:2; unsigned int sync_word:16; }; #else /* Little Endian version -- and doxygen doc */ struct LTCFrame { unsigned int frame_units:4; ///< SMPTE framenumber BCD unit 0..9 unsigned int user1:4; unsigned int frame_tens:2; ///< SMPTE framenumber BCD tens 0..3 unsigned int dfbit:1; ///< indicated drop-frame timecode unsigned int col_frame:1; ///< colour-frame: timecode intentionally synchronized to a colour TV field sequence unsigned int user2:4; unsigned int secs_units:4; ///< SMPTE seconds BCD unit 0..9 unsigned int user3:4; unsigned int secs_tens:3; ///< SMPTE seconds BCD tens 0..6 unsigned int biphase_mark_phase_correction:1; ///< see note on Bit 27 in description and \ref ltc_frame_set_parity . unsigned int user4:4; unsigned int mins_units:4; ///< SMPTE minutes BCD unit 0..9 unsigned int user5:4; unsigned int mins_tens:3; ///< SMPTE minutes BCD tens 0..6 unsigned int binary_group_flag_bit0:1; ///< indicate user-data char encoding, see table above - bit 43 unsigned int user6:4; unsigned int hours_units:4; ///< SMPTE hours BCD unit 0..9 unsigned int user7:4; unsigned int hours_tens:2; ///< SMPTE hours BCD tens 0..2 unsigned int binary_group_flag_bit1:1; ///< indicate timecode is local time wall-clock, see table above - bit 58 unsigned int binary_group_flag_bit2:1; ///< indicate user-data char encoding (or parity with 25fps), see table above - bit 59 unsigned int user8:4; unsigned int sync_word:16; }; #endif /** the standard defines the assignment of the binary-group-flag bits * basically only 25fps is different, but other standards defined in * the SMPTE spec have been included for completeness. */ enum LTC_TV_STANDARD { LTC_TV_525_60, ///< 30fps LTC_TV_625_50, ///< 25fps LTC_TV_1125_60,///< 30fps LTC_TV_FILM_24 ///< 24fps }; /** encoder and LTCframe <> timecode operation flags */ enum LTC_BG_FLAGS { LTC_USE_DATE = 1, ///< LTCFrame <> SMPTETimecode converter and LTCFrame increment/decrement use date, also set BGF2 to '1' when encoder is initialized or re-initialized (unless LTC_BGF_DONT_TOUCH is given) LTC_TC_CLOCK = 2,///< the Timecode is wall-clock aka freerun. This also sets BGF1 (unless LTC_BGF_DONT_TOUCH is given) LTC_BGF_DONT_TOUCH = 4, ///< encoder init or re-init does not touch the BGF bits (initial values after initialization is zero) LTC_NO_PARITY = 8 ///< parity bit is left untouched when setting or in/decrementing the encoder frame-number }; /** * see LTCFrame */ typedef struct LTCFrame LTCFrame; /** * Extended LTC frame - includes audio-sample position offsets, volume, etc * * Note: For TV systems, the sample in the LTC audio data stream where the LTC Frame starts is not necessarily at the same time * as the video-frame which is described by the LTC Frame. * * \ref off_start denotes the time of the first transition of bit 0 in the LTC frame. * * For 525/60 Television systems, the first transition shall occur at the beginning of line 5 of the frame with which it is * associated. The tolerance is ± 1.5 lines. * * For 625/50 systems, the first transition shall occur at the beginning of line 2 ± 1.5 lines of the frame with which it is associated. * * Only for 1125/60 systems, the first transition occurs exactly at the vertical sync timing reference of the frame. ± 1 line. * */ struct LTCFrameExt { LTCFrame ltc; ///< the actual LTC frame. see \ref LTCFrame ltc_off_t off_start; ///< \anchor off_start the approximate sample in the stream corresponding to the start of the LTC frame. ltc_off_t off_end; ///< \anchor off_end the sample in the stream corresponding to the end of the LTC frame. int reverse; ///< if non-zero, a reverse played LTC frame was detected. Since the frame was reversed, it started at off_end and finishes as off_start (off_end > off_start). (Note: in reverse playback the (reversed) sync-word of the next/previous frame is detected, this offset is corrected). float biphase_tics[LTC_FRAME_BIT_COUNT]; ///< detailed timing info: phase of the LTC signal; the time between each bit in the LTC-frame in audio-frames. Summing all 80 values in the array will yield audio-frames/LTC-frame = (\ref off_end - \ref off_start + 1). ltcsnd_sample_t sample_min; ///< the minimum input sample signal for this frame (0..255) ltcsnd_sample_t sample_max; ///< the maximum input sample signal for this frame (0..255) double volume; ///< the volume of the input signal in dbFS }; /** * see \ref LTCFrameExt */ typedef struct LTCFrameExt LTCFrameExt; /** * Human readable time representation, decimal values. */ struct SMPTETimecode { char timezone[6]; ///< the timezone 6bytes: "+HHMM" textual representation unsigned char years; ///< LTC-date uses 2-digit year 00.99 unsigned char months; ///< valid months are 1..12 unsigned char days; ///< day of month 1..31 unsigned char hours; ///< hour 0..23 unsigned char mins; ///< minute 0..60 unsigned char secs; ///< second 0..60 unsigned char frame; ///< sub-second frame 0..(FPS - 1) }; /** * see \ref SMPTETimecode */ typedef struct SMPTETimecode SMPTETimecode; /** * Opaque structure * see: \ref ltc_decoder_create, \ref ltc_decoder_free */ typedef struct LTCDecoder LTCDecoder; /** * Opaque structure * see: \ref ltc_encoder_create, \ref ltc_encoder_free */ typedef struct LTCEncoder LTCEncoder; /** * Convert binary LTCFrame into SMPTETimecode struct * * @param stime output * @param frame input * @param flags binary combination of \ref LTC_BG_FLAGS - here only LTC_USE_DATE is relevant. * if LTC_USE_DATE is set, the user-fields in LTCFrame will be parsed into the date variable of SMPTETimecode. * otherwise the date information in the SMPTETimecode is set to zero. */ void ltc_frame_to_time(SMPTETimecode* stime, LTCFrame* frame, int flags); /** * Translate SMPTETimecode struct into its binary LTC representation * and set the LTC frame's parity bit accordingly (see \ref ltc_frame_set_parity) * * @param frame output - the frame to be set * @param stime input - timecode input * @param standard the TV standard to use for parity bit assignment * @param flags binary combination of \ref LTC_BG_FLAGS - here only LTC_USE_DATE and LTC_NO_PARITY are relevant. * if LTC_USE_DATE is given, user-fields in LTCFrame will be set from the date in SMPTETimecode, * otherwise the user-bits are not modified. All non-timecode fields remain untouched - except for the parity bit * unless LTC_NO_PARITY is given. */ void ltc_time_to_frame(LTCFrame* frame, SMPTETimecode* stime, enum LTC_TV_STANDARD standard, int flags); /** * Reset all values of a LTC FRAME to zero, except for the sync-word (0x3FFD) at the end. * The sync word is set according to architecture (big/little endian). * Also set the Frame's parity bit accordingly (see \ref ltc_frame_set_parity) * @param frame the LTCFrame to reset */ void ltc_frame_reset(LTCFrame* frame); /** * Increment the timecode by one Frame (1/framerate seconds) * and set the Frame's parity bit accordingly (see \ref ltc_frame_set_parity) * * @param frame the LTC-timecode to increment * @param fps integer framerate (for drop-frame-timecode set frame->dfbit and round-up the fps). * @param standard the TV standard to use for parity bit assignment * if set to 1 the 25fps standard is enabled and LTC Frame bit 59 instead of 27 is used for the parity. It only has only has effect flag bit 4 (LTC_NO_PARITY) is cleared. * @param flags binary combination of \ref LTC_BG_FLAGS - here only LTC_USE_DATE and LTC_NO_PARITY are relevant. * If the bit 0 (1) is set (1) interpret user-data as date and increment date if timecode wraps after 24h. * (Note: leap-years are taken into account, but since the year is two-digit only, the 100,400yr rules are ignored. * "00" is assumed to be year 2000 which was a leap year.) * @return 1 if timecode was wrapped around after 23:59:59:ff, 0 otherwise */ int ltc_frame_increment(LTCFrame* frame, int fps, enum LTC_TV_STANDARD standard, int flags); /** * Decrement the timecode by one Frame (1/framerate seconds) * and set the Frame's parity bit accordingly (see \ref ltc_frame_set_parity) * * @param frame the LTC-timecode to decrement * @param fps integer framerate (for drop-frame-timecode set frame->dfbit and round-up the fps). * @param standard the TV standard to use for parity bit assignment * if set to 1 the 25fps standard is enabled and LTC Frame bit 59 instead of 27 is used for the parity. It only has only has effect flag bit 4 (LTC_NO_PARITY) is cleared. * @param flags binary combination of \ref LTC_BG_FLAGS - here only LTC_USE_DATE and LTC_NO_PARITY are relevant. * if the bit 0 is set (1) interpret user-data as date and decrement date if timecode wraps at 24h. * (Note: leap-years are taken into account, but since the year is two-digit only, the 100,400yr rules are ignored. * "00" is assumed to be year 2000 which was a leap year.) * bit 3 (8) indicates that the parity bit should not be touched * @return 1 if timecode was wrapped around at 23:59:59:ff, 0 otherwise */ int ltc_frame_decrement(LTCFrame* frame, int fps, enum LTC_TV_STANDARD standard, int flags); /** * Create a new LTC decoder. * * @param apv audio-frames per video frame. This is just used for initial settings, the speed is tracked dynamically. setting this in the right ballpark is needed to properly decode the first LTC frame in a sequence. * @param queue_size length of the internal queue to store decoded frames * to SMPTEDecoderWrite. * @return decoder handle or NULL if out-of-memory */ LTCDecoder * ltc_decoder_create(int apv, int queue_size); /** * Release memory of decoder. * @param d decoder handle */ int ltc_decoder_free(LTCDecoder *d); /** * Feed the LTC decoder with new audio samples. * * Parse raw audio for LTC timestamps. Once a complete LTC frame has been * decoded it is pushed into a queue (\ref ltc_decoder_read) * * @param d decoder handle * @param buf pointer to ltcsnd_sample_t - unsigned 8 bit mono audio data * @param size \anchor size number of samples to parse * @param posinfo (optional, recommended) sample-offset in the audio-stream. It is added to \ref off_start, \ref off_end in \ref LTCFrameExt and should be monotonic (ie incremented by \ref size for every call to ltc_decoder_write) */ void ltc_decoder_write(LTCDecoder *d, ltcsnd_sample_t *buf, size_t size, ltc_off_t posinfo); /** * Wrapper around \ref ltc_decoder_write that accepts floating point * audio samples. Note: internally libltc uses 8 bit only. * * @param d decoder handle * @param buf pointer to audio sample data * @param size number of samples to parse * @param posinfo (optional, recommended) sample-offset in the audio-stream. */ void ltc_decoder_write_float(LTCDecoder *d, float *buf, size_t size, ltc_off_t posinfo); /** * Wrapper around \ref ltc_decoder_write that accepts signed 16 bit * audio samples. Note: internally libltc uses 8 bit only. * * @param d decoder handle * @param buf pointer to audio sample data * @param size number of samples to parse * @param posinfo (optional, recommended) sample-offset in the audio-stream. */ void ltc_decoder_write_s16(LTCDecoder *d, short *buf, size_t size, ltc_off_t posinfo); /** * Wrapper around \ref ltc_decoder_write that accepts unsigned 16 bit * audio samples. Note: internally libltc uses 8 bit only. * * @param d decoder handle * @param buf pointer to audio sample data * @param size number of samples to parse * @param posinfo (optional, recommended) sample-offset in the audio-stream. */ void ltc_decoder_write_u16(LTCDecoder *d, unsigned short *buf, size_t size, ltc_off_t posinfo); /** * Decoded LTC frames are placed in a queue. This function retrieves * a frame from the queue, and stores it at LTCFrameExt* * * @param d decoder handle * @param frame the decoded LTC frame is copied there * @return 1 on success or 0 when no frames queued. */ int ltc_decoder_read(LTCDecoder *d, LTCFrameExt *frame); /** * Remove all LTC frames from the internal queue. * @param d decoder handle */ void ltc_decoder_queue_flush(LTCDecoder* d); /** * Count number of LTC frames currently in the queue. * @param d decoder handle * @return number of queued frames */ int ltc_decoder_queue_length(LTCDecoder* d); /** * Allocate and initialize LTC audio encoder. * * calls \ref ltc_encoder_reinit internally see, see notes there. * * @param sample_rate audio sample rate (eg. 48000) * @param fps video-frames per second (e.g. 25.0) * @param standard the TV standard to use for Binary Group Flag bit position * @param flags binary combination of \ref LTC_BG_FLAGS */ LTCEncoder* ltc_encoder_create(double sample_rate, double fps, enum LTC_TV_STANDARD standard, int flags); /** * Release memory of the encoder. * @param e encoder handle */ void ltc_encoder_free(LTCEncoder *e); /** * Set the encoder LTC-frame to the given SMPTETimecode. * The next call to \ref ltc_encoder_encode_byte or * \ref ltc_encoder_encode_frame will encode this time to LTC audio-samples. * * Internally this call uses \ref ltc_time_to_frame because * the LTCEncoder operates on LTCframes only. * see als \ref ltc_encoder_set_frame * * @param e encoder handle * @param t timecode to set. */ void ltc_encoder_set_timecode(LTCEncoder *e, SMPTETimecode *t); /** * Query the current encoder timecode. * * Note: the decoder stores its internal state in an LTC-frame, * this function converts that LTC-Frame into SMPTETimecode on demand. * see also \ref ltc_encoder_get_frame. * * @param e encoder handle * @param t is set to current timecode */ void ltc_encoder_get_timecode(LTCEncoder *e, SMPTETimecode *t); /** * Set the user-bits of the frame to the given data. * * The data should be a 32-bits unsigned integer. * It is written LSB first continiously int the eight user fields. * * @param e encoder handle * @param data the data to write */ void ltc_encoder_set_user_bits(LTCEncoder *e, unsigned long data); /** * Get a 32-bits unsigned integer from the user-data bits. * The data should be written LSB first in the frame * * @param e encoder handle */ unsigned long ltc_frame_get_user_bits(LTCFrame *f); /** * Move the encoder to the next timecode frame. * uses \ref ltc_frame_increment() internally. */ int ltc_encoder_inc_timecode(LTCEncoder *e); /** * Move the encoder to the previous timecode frame. * This is useful for encoding reverse LTC. * uses \ref ltc_frame_decrement() internally. */ int ltc_encoder_dec_timecode(LTCEncoder *e); /** * Low-level access to the internal LTCFrame data. * * Note: be careful to about f->dfbit, the encoder sets this [only] upon * initialization. * * @param e encoder handle * @param f LTC frame data to use */ void ltc_encoder_set_frame(LTCEncoder *e, LTCFrame *f); /** * Low-level access to the encoder internal LTCFrame data * * @param e encoder handle * @param f return LTC frame data */ void ltc_encoder_get_frame(LTCEncoder *e, LTCFrame *f); /** * Copy the accumulated encoded audio to the given * sample-buffer and flush the internal buffer. * * @param e encoder handle * @param buf place to store the audio-samples, needs to be large enough * to hold \ref ltc_encoder_get_buffersize bytes * @return the number of bytes written to the memory area * pointed to by buf. */ int ltc_encoder_get_buffer(LTCEncoder *e, ltcsnd_sample_t *buf); /** * Retrieve a pointer to the accumulated encoded audio-data. * * @param e encoder handle * @param size if set, the number of valid bytes in the buffer is stored there * @param flush call \ref ltc_encoder_buffer_flush - reset the buffer write-pointer * @return pointer to encoder-buffer */ ltcsnd_sample_t *ltc_encoder_get_bufptr(LTCEncoder *e, int *size, int flush); /** * reset the write-pointer of the encoder-buffer * @param e encoder handle */ void ltc_encoder_buffer_flush(LTCEncoder *e); /** * Query the length of the internal buffer. It is allocated * to hold audio-frames for exactly one LTC frame for the given * sample-rate and frame-rate. ie. (1 + sample-rate / fps) bytes * * Note this returns the total size of the buffer, not the used/free * part. See also \ref ltc_encoder_get_bufptr * * @param e encoder handle * @return size of the allocated internal buffer. */ size_t ltc_encoder_get_buffersize(LTCEncoder *e); /** * Change the encoder settings without re-allocating any * library internal data structure (realtime safe). * changing the fps and or sample-rate implies a buffer flush, * and biphase state reset. * * This call will fail if the internal buffer is too small * to hold one full LTC frame. Use \ref ltc_encoder_set_bufsize to * prepare an internal buffer large enough to accommodate all * sample_rate, fps combinations that you would like to re-init to. * * The LTC frame payload data is not modified by this call, however, * the flag-bits of the LTC-Frame are updated: * If fps equals to 29.97 or 30000.0/1001.0, the LTCFrame's 'dfbit' bit is set to 1 * to indicate drop-frame timecode. * * Unless the LTC_BGF_DONT_TOUCH flag is set the BGF1 is set or cleared depending * on LTC_TC_CLOCK and BGF0,2 according to LTC_USE_DATE and the given standard. * col_frame is cleared and the parity recomputed (unless LTC_NO_PARITY is given). * * @param e encoder handle * @param sample_rate audio sample rate (eg. 48000) * @param fps video-frames per second (e.g. 25.0) * @param standard the TV standard to use for Binary Group Flag bit position * @param flags binary combination of \ref LTC_BG_FLAGS */ int ltc_encoder_reinit(LTCEncoder *e, double sample_rate, double fps, enum LTC_TV_STANDARD standard, int flags); /** * reset ecoder state. * flushes buffer, reset biphase state * * @param e encoder handle */ void ltc_encoder_reset(LTCEncoder *e); /** * Configure a custom size for the internal buffer. * * This is needed if you are planning to call \ref ltc_encoder_reinit() * or if you want to keep more than one LTC frame's worth of data in * the library's internal buffer. * * The buffer-size is (1 + sample_rate / fps) bytes. * resizing the internal buffer will flush all existing data * in it - alike \ref ltc_encoder_buffer_flush. * * @param e encoder handle * @param sample_rate audio sample rate (eg. 48000) * @param fps video-frames per second (e.g. 25.0) * @return 0 on success, -1 if allocation fails (which makes the * encoder unusable, call \ref ltc_encoder_free or realloc the buffer) */ int ltc_encoder_set_bufsize(LTCEncoder *e, double sample_rate, double fps); /** * Set the volume of the generated LTC signal * * typically LTC is sent at 0dBu ; in EBU callibrated systems that * corresponds to -18dBFS. - by default libltc creates -3dBFS * * since libltc generated 8bit audio-data, the minimum dBFS * is about -42dB which corresponds to 1 bit. * * 0dB corresponds to a signal range of 127 * 1..255 with 128 at the center. * * @param e encoder handle * @param dBFS the volume in dB full-scale (<= 0.0) * @return 0 on success, -1 if the value was out of range */ int ltc_encoder_set_volume(LTCEncoder *e, double dBFS); /** * Set encoder signal rise-time / signal filtering * * LTC signal should have a rise time of 40us +/- 10 us. * by default the encoder honors this and low-pass filters * the output depending on the sample-rate. * * If you want a perfect square wave, set 'rise_time' to 0. * * Note \ref ltc_encoder_reinit resets the filter-time-constant to use * the default 40us for the given sample-rate, overriding any value * previously set with \ref ltc_encoder_set_filter * * @param e encoder handle * @param rise_time the signal rise-time in us (10^(-6) sec), set to 0 for perfect square wave, default 40.0 */ void ltc_encoder_set_filter(LTCEncoder *e, double rise_time); /** * Generate LTC audio for given byte of the LTC-frame and * place it into the internal buffer. * * see \ref ltc_encoder_get_buffer and \ref ltc_encoder_get_bufptr * * LTC has 10 bytes per frame: 0 <= bytecnt < 10 * use SMPTESetTime(..) to set the current frame before Encoding. * see tests/encoder.c for an example. * * The default output signal is @ -3dBFS (38..218 at 8 bit unsigned). * see also \ref ltc_encoder_set_volume * * if speed is < 0, the bits are encoded in reverse. * slowdown > 10.0 requires custom buffer sizes; see \ref ltc_encoder_set_bufsize * * @param e encoder handle * @param byte byte of the LTC-frame to encode 0..9 * @param speed vari-speed, < 1.0 faster, > 1.0 slower ; must be != 0 * * @return 0 on success, -1 if byte is invalid or buffer overflow (speed > 10.0) */ int ltc_encoder_encode_byte(LTCEncoder *e, int byte, double speed); /** * Encode a full LTC frame at fixed speed. * This is equivalent to calling \ref ltc_encoder_encode_byte 10 times for * bytes 0..9 with speed 1.0. * * Note: The internal buffer must be empty before calling this function. * Otherwise it may overflow. This is usually the case if it is read with * \ref ltc_encoder_get_buffer after calling this function. * * The default internal buffersize is exactly one full LTC frame at speed 1.0. * * @param e encoder handle */ void ltc_encoder_encode_frame(LTCEncoder *e); /** * Set the parity of the LTC frame. * * Bi-Phase Mark Phase Correction bit (bit 27 - or 59) may be set or cleared so that * that every 80-bit word contains an even number of zeroes. * This means that the phase in every Sync Word will be the same. * * This is merely cosmetic; the motivation to keep the polarity of the waveform * constant is to make finding the Sync Word visibly (on a scope) easier. * * There is usually no need to call this function directly. The encoder utility * functions \ref ltc_time_to_frame, \ref ltc_frame_increment and * \ref ltc_frame_decrement include a call to it. * * @param frame the LTC to analyze and set or clear the biphase_mark_phase_correction bit. * @param standard If 1 (aka LTC_TV_625_50) , the 25fps mode (bit 59 - aka binary_group_flag_bit2) is used, otherwise the 30fps, 24fps mode (bit 27 -- biphase_mark_phase_correction) is set or cleared. */ void ltc_frame_set_parity(LTCFrame *frame, enum LTC_TV_STANDARD standard); /** * Parse Binary Group Flags into standard independent format: * bit 0 (1) - BGF 0, * bit 1 (2) - BGF 1, * bit 2 (4) - BGF 2 * * @param f LTC frame data analyze * @param standard the TV standard to use -- see \ref LTCFrame for BGF assignment * @return LTC Binary Group Flags */ int parse_bcg_flags(LTCFrame *f, enum LTC_TV_STANDARD standard); /** * LTCFrame sample alignment offset. * * There is a relative offset of the LTC-Frame start and the TV-frame. * The first bit of a LTC frame corresponds to a specific line in the actual video * frame. When decoding this offset needs to be subtracted from the LTC-frame's * audio-sample-time to match the TV-frame's start position. * * For film frames or HDV the offset is zero. * * @param samples_per_frame audio-samples per timecode-frame (eg. 1920 = 48000/25) * @param standard the TV standard * @return offset in samples */ ltc_off_t ltc_frame_alignment(double samples_per_frame, enum LTC_TV_STANDARD standard); #ifdef __cplusplus } #endif #endif libltc-1.3.1/src/timecode.c000066400000000000000000000374261345125773300155370ustar00rootroot00000000000000/* libltc - en+decode linear timecode Copyright (C) 2006-2012 Robin Gareus This program 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 3 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 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, see . */ #include #include #include #include "ltc.h" #ifdef HAVE_CONFIG_H # include #endif /** * SMPTE Timezones */ struct SMPTETimeZonesStruct { unsigned char code; //actually 6 bit! char timezone[6]; }; /** * SMPTE Timezone codes as per http://www.barney-wol.net/time/timecode.html */ static const struct SMPTETimeZonesStruct smpte_time_zones[] = { /* code, timezone (UTC+) //Standard time //Daylight saving */ { 0x00, "+0000" /* Greenwich */ /* - */ }, { 0x00, "-0000" /* Greenwich */ /* - */ }, { 0x01, "-0100" /* Azores */ /* - */ }, { 0x02, "-0200" /* Mid-Atlantic */ /* - */ }, { 0x03, "-0300" /* Buenos Aires */ /* Halifax */ }, { 0x04, "-0400" /* Halifax */ /* New York */ }, { 0x05, "-0500" /* New York */ /* Chicago */ }, { 0x06, "-0600" /* Chicago Denver */ /* - */ }, { 0x07, "-0700" /* Denver */ /* Los Angeles */ }, { 0x08, "-0800" /* Los Angeles */ /* - */ }, { 0x09, "-0900" /* Alaska */ /* - */ }, { 0x10, "-1000" /* Hawaii */ /* - */ }, { 0x11, "-1100" /* Midway Island */ /* - */ }, { 0x12, "-1200" /* Kwaialein */ /* - */ }, { 0x13, "+1300" /* - */ /* New Zealand */ }, { 0x14, "+1200" /* New Zealand */ /* - */ }, { 0x15, "+1100" /* Solomon Islands */ /* - */ }, { 0x16, "+1000" /* Guam */ /* - */ }, { 0x17, "+0900" /* Tokyo */ /* - */ }, { 0x18, "+0800" /* Beijing */ /* - */ }, { 0x19, "+0700" /* Bangkok */ /* - */ }, { 0x20, "+0600" /* Dhaka */ /* - */ }, { 0x21, "+0500" /* Islamabad */ /* - */ }, { 0x22, "+0400" /* Abu Dhabi */ /* - */ }, { 0x23, "+0300" /* Moscow */ /* - */ }, { 0x24, "+0200" /* Eastern Europe */ /* - */ }, { 0x25, "+0100" /* Central Europe */ /* - */ }, /* { 0x26, "Undefined" Reserved; do not use },*/ /* { 0x27, "Undefined" Reserved; do not use },*/ { 0x28, "TP-03" /* Time precision class 3 */ /* - */ }, { 0x29, "TP-02" /* Time precision class 2 */ /* - */ }, { 0x30, "TP-01" /* Time precision class 1 */ /* - */ }, { 0x31, "TP-00" /* Time precision class 0 */ /* - */ }, { 0x0A, "-0030" /* - */ /* - */ }, { 0x0B, "-0130" /* - */ /* - */ }, { 0x0C, "-0230" /* - */ /* Newfoundland */ }, { 0x0D, "-0330" /* Newfoundland */ /* - */ }, { 0x0E, "-0430" /* - */ /* - */ }, { 0x0F, "-0530" /* - */ /* - */ }, { 0x1A, "-0630" /* - */ /* - */ }, { 0x1B, "-0730" /* - */ /* - */ }, { 0x1C, "-0830" /* - */ /* - */ }, { 0x1D, "-0930" /* Marquesa Islands */ /* - */ }, { 0x1E, "-1030" /* - */ /* - */ }, { 0x1F, "-1130" /* - */ /* - */ }, { 0x2A, "+1130" /* Norfolk Island */ /* - */ }, { 0x2B, "+1030" /* Lord Howe Is. */ /* - */ }, { 0x2C, "+0930" /* Darwin */ /* - */ }, { 0x2D, "+0830" /* - */ /* - */ }, { 0x2E, "+0730" /* - */ /* - */ }, { 0x2F, "+0630" /* Rangoon */ /* - */ }, { 0x3A, "+0530" /* Bombay */ /* - */ }, { 0x3B, "+0430" /* Kabul */ /* - */ }, { 0x3C, "+0330" /* Tehran */ /* - */ }, { 0x3D, "+0230" /* - */ /* - */ }, { 0x3E, "+0130" /* - */ /* - */ }, { 0x3F, "+0030" /* - */ /* - */ }, { 0x32, "+1245" /* Chatham Island */ /* - */ }, /* { 0x33, "Undefined" Reserved; do not use },*/ /* { 0x34, "Undefined" Reserved; do not use },*/ /* { 0x35, "Undefined" Reserved; do not use },*/ /* { 0x36, "Undefined" Reserved; do not use },*/ /* { 0x37, "Undefined" Reserved; do not use },*/ { 0x38, "+XXXX" /* User defined time offset */ /* - */ }, /* { 0x39, "Undefined" Unknown Unknown },*/ /* { 0x39, "Undefined" Unknown Unknown },*/ { 0xFF, "" /* The End */ } }; static void smpte_set_timezone_string(LTCFrame *frame, SMPTETimecode *stime) { int i = 0; const unsigned char code = frame->user7 + (frame->user8 << 4); char timezone[6] = "+0000"; for (i = 0 ; smpte_time_zones[i].code != 0xFF ; i++) { if ( smpte_time_zones[i].code == code ) { strcpy(timezone, smpte_time_zones[i].timezone); break; } } strcpy(stime->timezone, timezone); } static void smpte_set_timezone_code(SMPTETimecode *stime, LTCFrame *frame) { int i = 0; unsigned char code = 0x00; // Find code for timezone string // Primitive search for (i=0; smpte_time_zones[i].code != 0xFF; i++) { if ( (strcmp(smpte_time_zones[i].timezone, stime->timezone)) == 0 ) { code = smpte_time_zones[i].code; break; } } frame->user7 = code & 0x0F; frame->user8 = (code & 0xF0) >> 4; } /** Drop-frame support function * We skip the first two frame numbers (0 and 1) at the beginning of each minute, * except for minutes 0, 10, 20, 30, 40, and 50 * (i.e. we skip frame numbers at the beginning of minutes for which mins_units is not 0). */ static void skip_drop_frames(LTCFrame* frame) { if ((frame->mins_units != 0) && (frame->secs_units == 0) && (frame->secs_tens == 0) && (frame->frame_units == 0) && (frame->frame_tens == 0) ) { frame->frame_units += 2; } } void ltc_frame_to_time(SMPTETimecode *stime, LTCFrame *frame, int flags) { if (!stime) return; if (flags & LTC_USE_DATE) { smpte_set_timezone_string(frame, stime); stime->years = frame->user5 + frame->user6*10; stime->months = frame->user3 + frame->user4*10; stime->days = frame->user1 + frame->user2*10; } else { stime->years = 0; stime->months = 0; stime->days = 0; sprintf(stime->timezone,"+0000"); } stime->hours = frame->hours_units + frame->hours_tens*10; stime->mins = frame->mins_units + frame->mins_tens*10; stime->secs = frame->secs_units + frame->secs_tens*10; stime->frame = frame->frame_units + frame->frame_tens*10; } void ltc_time_to_frame(LTCFrame* frame, SMPTETimecode* stime, enum LTC_TV_STANDARD standard, int flags) { if (flags & LTC_USE_DATE) { smpte_set_timezone_code(stime, frame); frame->user6 = stime->years/10; frame->user5 = stime->years - frame->user6*10; frame->user4 = stime->months/10; frame->user3 = stime->months - frame->user4*10; frame->user2 = stime->days/10; frame->user1 = stime->days - frame->user2*10; } frame->hours_tens = stime->hours/10; frame->hours_units = stime->hours - frame->hours_tens*10; frame->mins_tens = stime->mins/10; frame->mins_units = stime->mins - frame->mins_tens*10; frame->secs_tens = stime->secs/10; frame->secs_units = stime->secs - frame->secs_tens*10; frame->frame_tens = stime->frame/10; frame->frame_units = stime->frame - frame->frame_tens*10; // Prevent illegal SMPTE frames if (frame->dfbit) { skip_drop_frames(frame); } if ((flags & LTC_NO_PARITY) == 0) { ltc_frame_set_parity(frame, standard); } } void ltc_frame_reset(LTCFrame* frame) { memset(frame, 0, sizeof(LTCFrame)); // syncword = 0x3FFD #ifdef LTC_BIG_ENDIAN // mirrored BE bit order: FCBF frame->sync_word = 0xFCBF; #else // mirrored LE bit order: BFFC frame->sync_word = 0xBFFC; #endif } int ltc_frame_increment(LTCFrame* frame, int fps, enum LTC_TV_STANDARD standard, int flags) { int rv = 0; frame->frame_units++; if (frame->frame_units == 10) { frame->frame_units = 0; frame->frame_tens++; } if (fps == frame->frame_units+frame->frame_tens*10) { frame->frame_units = 0; frame->frame_tens = 0; frame->secs_units++; if (frame->secs_units == 10) { frame->secs_units = 0; frame->secs_tens++; if (frame->secs_tens == 6) { frame->secs_tens = 0; frame->mins_units++; if (frame->mins_units == 10) { frame->mins_units = 0; frame->mins_tens++; if (frame->mins_tens == 6) { frame->mins_tens = 0; frame->hours_units++; if (frame->hours_units == 10) { frame->hours_units = 0; frame->hours_tens++; } if (frame->hours_units == 4 && frame->hours_tens==2) { /* 24h wrap around */ rv=1; frame->hours_tens=0; frame->hours_units = 0; if (flags&1) { /* wrap date */ SMPTETimecode stime; stime.years = frame->user5 + frame->user6*10; stime.months = frame->user3 + frame->user4*10; stime.days = frame->user1 + frame->user2*10; if (stime.months > 0 && stime.months < 13) { unsigned char dpm[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; /* proper leap-year calc: * ((stime.years%4)==0 && ( (stime.years%100) != 0 || (stime.years%400) == 0) ) * simplified since year is 0..99 */ if ((stime.years%4)==0 /* && stime.years!=0 */ ) /* year 2000 was a leap-year */ dpm[1]=29; stime.days++; if (stime.days > dpm[stime.months-1]) { stime.days=1; stime.months++; if (stime.months > 12) { stime.months=1; stime.years=(stime.years+1)%100; } } frame->user6 = stime.years/10; frame->user5 = stime.years%10; frame->user4 = stime.months/10; frame->user3 = stime.months%10; frame->user2 = stime.days/10; frame->user1 = stime.days%10; } else { rv=-1; } } } } } } } } if (frame->dfbit) { skip_drop_frames(frame); } if ((flags & LTC_NO_PARITY) == 0) { ltc_frame_set_parity(frame, standard); } return rv; } int ltc_frame_decrement(LTCFrame* frame, int fps, enum LTC_TV_STANDARD standard, int flags) { int rv = 0; int frames = frame->frame_units + frame->frame_tens * 10; if (frames > 0) { frames--; } else { frames = fps -1; } frame->frame_units = frames % 10; frame->frame_tens = frames / 10; if (frames == fps -1) { int secs = frame->secs_units + frame->secs_tens * 10; if (secs > 0) { secs--; } else { secs = 59; } frame->secs_units = secs % 10; frame->secs_tens = secs / 10; if (secs == 59) { int mins = frame->mins_units + frame->mins_tens * 10; if (mins > 0) { mins--; } else { mins = 59; } frame->mins_units = mins % 10; frame->mins_tens = mins / 10; if (mins == 59) { int hours = frame->hours_units + frame->hours_tens * 10; if (hours > 0) { hours--; } else { hours = 23; } frame->hours_units = hours % 10; frame->hours_tens = hours / 10; if (hours == 23) { /* 24h wrap around */ rv=1; if (flags<C_USE_DATE) { /* wrap date */ SMPTETimecode stime; stime.years = frame->user5 + frame->user6*10; stime.months = frame->user3 + frame->user4*10; stime.days = frame->user1 + frame->user2*10; if (stime.months > 0 && stime.months < 13) { unsigned char dpm[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; /* proper leap-year calc: * ((stime.years%4)==0 && ( (stime.years%100) != 0 || (stime.years%400) == 0) ) * simplified since year is 0..99 */ if ((stime.years%4)==0 /* && stime.years!=0 */ ) /* year 2000 was a leap-year */ dpm[1]=29; // if (stime.days > 1) { stime.days--; } else { stime.months = 1 + (stime.months + 10)%12; stime.days = dpm[stime.months-1]; if (stime.months == 12) { stime.years=(stime.years+99)%100; // XXX } } frame->user6 = stime.years/10; frame->user5 = stime.years%10; frame->user4 = stime.months/10; frame->user3 = stime.months%10; frame->user2 = stime.days/10; frame->user1 = stime.days%10; } else { rv=-1; } } } } } } if (frame->dfbit && /* prevent endless recursion */ fps > 2) { if ((frame->mins_units != 0) && (frame->secs_units == 0) && (frame->secs_tens == 0) && (frame->frame_units == 1) && (frame->frame_tens == 0) ) { ltc_frame_decrement(frame, fps, standard, flags<C_USE_DATE); ltc_frame_decrement(frame, fps, standard, flags<C_USE_DATE); } } if ((flags & LTC_NO_PARITY) == 0) { ltc_frame_set_parity(frame, standard); } return rv; } int parse_bcg_flags(LTCFrame *f, enum LTC_TV_STANDARD standard) { switch (standard) { case LTC_TV_625_50: /* 25 fps mode */ return ( ((f->binary_group_flag_bit0)?4:0) | ((f->binary_group_flag_bit1)?2:0) | ((f->biphase_mark_phase_correction)?1:0) ); break; default: /* 24,30 fps mode */ return ( ((f->binary_group_flag_bit2)?4:0) | ((f->binary_group_flag_bit1)?2:0) | ((f->binary_group_flag_bit0)?1:0) ); break; } } libltc-1.3.1/tests/000077500000000000000000000000001345125773300141415ustar00rootroot00000000000000libltc-1.3.1/tests/Makefile.am000066400000000000000000000022431345125773300161760ustar00rootroot00000000000000check_PROGRAMS = ltcencode ltcdecode CLEANFILES = output.raw atconfig EXTRA_DIST= \ example_encode.c \ timecode.raw timecode.txt \ expect_48k_2sec.txt expect_96k_2sec.txt LIBLTCDIR =../src INCLUDES = -I$(srcdir)/$(LIBLTCDIR) ltcdecode_SOURCES = ltcdecode.c ltcdecode_LDADD = $(LIBLTCDIR)/libltc.la -lm ltcdecode_CFLAGS=-g -Wall ltcencode_SOURCES = ltcencode.c ltcencode_CFLAGS=-g -Wall ltcencode_LDADD = $(LIBLTCDIR)/libltc.la -lm check: $(check_PROGRAMS) date uname -a @echo "-----------------------------------------------------------------" ./ltcencode output.raw ./ltcdecode output.raw | diff -q $(srcdir)/expect_48k_2sec.txt - @echo "-----------------------------------------------------------------" ./ltcencode output.raw 192000 ./ltcdecode output.raw 7680 | diff -q $(srcdir)/expect_96k_2sec.txt - @echo "-----------------------------------------------------------------" ./ltcdecode $(srcdir)/timecode.raw 882 | diff -q $(srcdir)/timecode.txt - @echo "-----------------------------------------------------------------" @echo " ${PACKAGE}-${VERSION} passed all tests." @echo "-----------------------------------------------------------------" libltc-1.3.1/tests/example_encode.c000066400000000000000000000104701345125773300172570ustar00rootroot00000000000000/** @brief example code for libltc LTCEncoder @file example_encode.c @author Robin Gareus Copyright (C) 2006-2016 Robin Gareus Copyright (C) 2008-2009 Jan This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 3, 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 Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * compile with * gcc -o ltc-encoder example_encode.c -lltc -lm * * from the source-folder this can be compiled after building libltc: * gcc -o ltc-encoder example_encode.c ../src/.libs/libltc.a -lm -I../src */ #include #include #include #include #ifdef _WIN32 #include // for _fmode #endif /* define "USE_LOCAL_BUFFER" to * use a local buffer instead of a pointer to * libltc's internal buffer */ //#ifdef USE_LOCAL_BUFFER int main(int argc, char **argv) { FILE* file; double length = 2; // in seconds double fps = 25; double sample_rate = 48000; char *filename; int vframe_cnt; int vframe_last; int total = 0; ltcsnd_sample_t *buf; LTCEncoder *encoder; SMPTETimecode st; /* start encoding at this timecode */ const char timezone[6] = "+0100"; strcpy(st.timezone, timezone); st.years = 8; st.months = 12; st.days = 31; st.hours = 23; st.mins = 59; st.secs = 59; st.frame = 0; /* parse commandline args */ if (argc > 1) { filename = argv[1]; if (argc > 2) { sample_rate = atof(argv[2]); } if (argc > 3) { fps = atof(argv[3]); } if (argc > 4) { length = atof(argv[4]); } } else { printf("ltc-encoder - test/example application to encode LTC to a file\n\n"); printf("Usage: ltc-encoder [sample rate [frame rate [duration in s]]]\n\n"); printf("default-values:\n"); printf(" sample rate: 48000.0 [SPS], frame rate: 25.0 [fps], duration: 2.0 [sec]\n"); printf("Report bugs to Robin Gareus \n"); return 1; } #ifdef _WIN32 // see https://msdn.microsoft.com/en-us/library/ktss1a9b.aspx and // https://github.com/x42/libltc/issues/18 _set_fmode(_O_BINARY); #endif /* open output file */ file = fopen(filename, "wb"); if (!file) { fprintf(stderr, "Error: can not open file '%s' for writing.\n", filename); return 1; } /* prepare encoder */ encoder = ltc_encoder_create(sample_rate, fps, fps==25?LTC_TV_625_50:LTC_TV_525_60, LTC_USE_DATE); ltc_encoder_set_timecode(encoder, &st); #ifdef USE_LOCAL_BUFFER buf = calloc(ltc_encoder_get_buffersize(encoder), sizeof(ltcsnd_sample_t)); if (!buf) { return -1; } #endif /* ready to go, print some info first */ printf("sample rate: %.2f\n", sample_rate); printf("frames/sec: %.2f\n", fps); printf("secs to write: %.2f\n", length); printf("sample format: 8bit unsigned mono\n"); vframe_cnt = 0; vframe_last = length * fps; while (vframe_cnt++ < vframe_last) { #if 1 /* encode and write each of the 80 LTC frame bits (10 bytes) */ int byte_cnt; for (byte_cnt = 0 ; byte_cnt < 10 ; byte_cnt++) { ltc_encoder_encode_byte(encoder, byte_cnt, 1.0); #ifdef USE_LOCAL_BUFFER int len = ltc_encoder_get_buffer(encoder, buf); #else int len; buf = ltc_encoder_get_bufptr(encoder, &len, 1); #endif if (len > 0) { fwrite(buf, sizeof(ltcsnd_sample_t), len, file); total+=len; } } #else /* encode a complete LTC frame in one step */ ltc_encoder_encode_frame(encoder); #ifdef USE_LOCAL_BUFFER int len = ltc_encoder_get_buffer(encoder, buf); #else int len; buf = ltc_encoder_get_bufptr(encoder, &len, 1); #endif if (len > 0) { fwrite(buf, sizeof(ltcsnd_sample_t), len, file); total+=len; } #endif ltc_encoder_inc_timecode(encoder); } fclose(file); ltc_encoder_free(encoder); printf("Done: wrote %d samples to '%s'\n", total, filename); #ifdef USE_LOCAL_BUFFER free(buf); #endif return 0; } libltc-1.3.1/tests/expect_48k_2sec.txt000066400000000000000000000045411345125773300176000ustar00rootroot000000000000002008-12-31 +0100 23:59:59:00 | 0 1919 2008-12-31 +0100 23:59:59:01 | 1920 3839 2008-12-31 +0100 23:59:59:02 | 3840 5759 2008-12-31 +0100 23:59:59:03 | 5760 7679 2008-12-31 +0100 23:59:59:04 | 7680 9599 2008-12-31 +0100 23:59:59:05 | 9600 11519 2008-12-31 +0100 23:59:59:06 | 11520 13439 2008-12-31 +0100 23:59:59:07 | 13440 15359 2008-12-31 +0100 23:59:59:08 | 15360 17279 2008-12-31 +0100 23:59:59:09 | 17280 19199 2008-12-31 +0100 23:59:59:10 | 19200 21119 2008-12-31 +0100 23:59:59:11 | 21120 23039 2008-12-31 +0100 23:59:59:12 | 23040 24959 2008-12-31 +0100 23:59:59:13 | 24960 26879 2008-12-31 +0100 23:59:59:14 | 26880 28799 2008-12-31 +0100 23:59:59:15 | 28800 30719 2008-12-31 +0100 23:59:59:16 | 30720 32639 2008-12-31 +0100 23:59:59:17 | 32640 34559 2008-12-31 +0100 23:59:59:18 | 34560 36479 2008-12-31 +0100 23:59:59:19 | 36480 38399 2008-12-31 +0100 23:59:59:20 | 38400 40319 2008-12-31 +0100 23:59:59:21 | 40320 42239 2008-12-31 +0100 23:59:59:22 | 42240 44159 2008-12-31 +0100 23:59:59:23 | 44160 46079 2008-12-31 +0100 23:59:59:24 | 46080 47999 2009-01-01 +0100 00:00:00:00 | 48000 49919 2009-01-01 +0100 00:00:00:01 | 49920 51839 2009-01-01 +0100 00:00:00:02 | 51840 53759 2009-01-01 +0100 00:00:00:03 | 53760 55679 2009-01-01 +0100 00:00:00:04 | 55680 57599 2009-01-01 +0100 00:00:00:05 | 57600 59519 2009-01-01 +0100 00:00:00:06 | 59520 61439 2009-01-01 +0100 00:00:00:07 | 61440 63359 2009-01-01 +0100 00:00:00:08 | 63360 65279 2009-01-01 +0100 00:00:00:09 | 65280 67199 2009-01-01 +0100 00:00:00:10 | 67200 69119 2009-01-01 +0100 00:00:00:11 | 69120 71039 2009-01-01 +0100 00:00:00:12 | 71040 72959 2009-01-01 +0100 00:00:00:13 | 72960 74879 2009-01-01 +0100 00:00:00:14 | 74880 76799 2009-01-01 +0100 00:00:00:15 | 76800 78719 2009-01-01 +0100 00:00:00:16 | 78720 80639 2009-01-01 +0100 00:00:00:17 | 80640 82559 2009-01-01 +0100 00:00:00:18 | 82560 84479 2009-01-01 +0100 00:00:00:19 | 84480 86399 2009-01-01 +0100 00:00:00:20 | 86400 88319 2009-01-01 +0100 00:00:00:21 | 88320 90239 2009-01-01 +0100 00:00:00:22 | 90240 92159 2009-01-01 +0100 00:00:00:23 | 92160 94079 libltc-1.3.1/tests/expect_96k_2sec.txt000066400000000000000000000045411345125773300176030ustar00rootroot000000000000002008-12-31 +0100 23:59:59:00 | 0 7679 2008-12-31 +0100 23:59:59:01 | 7680 15359 2008-12-31 +0100 23:59:59:02 | 15360 23039 2008-12-31 +0100 23:59:59:03 | 23040 30719 2008-12-31 +0100 23:59:59:04 | 30720 38399 2008-12-31 +0100 23:59:59:05 | 38400 46079 2008-12-31 +0100 23:59:59:06 | 46080 53759 2008-12-31 +0100 23:59:59:07 | 53760 61439 2008-12-31 +0100 23:59:59:08 | 61440 69119 2008-12-31 +0100 23:59:59:09 | 69120 76799 2008-12-31 +0100 23:59:59:10 | 76800 84479 2008-12-31 +0100 23:59:59:11 | 84480 92159 2008-12-31 +0100 23:59:59:12 | 92160 99839 2008-12-31 +0100 23:59:59:13 | 99840 107519 2008-12-31 +0100 23:59:59:14 | 107520 115199 2008-12-31 +0100 23:59:59:15 | 115200 122879 2008-12-31 +0100 23:59:59:16 | 122880 130559 2008-12-31 +0100 23:59:59:17 | 130560 138239 2008-12-31 +0100 23:59:59:18 | 138240 145919 2008-12-31 +0100 23:59:59:19 | 145920 153599 2008-12-31 +0100 23:59:59:20 | 153600 161279 2008-12-31 +0100 23:59:59:21 | 161280 168959 2008-12-31 +0100 23:59:59:22 | 168960 176639 2008-12-31 +0100 23:59:59:23 | 176640 184319 2008-12-31 +0100 23:59:59:24 | 184320 191999 2009-01-01 +0100 00:00:00:00 | 192000 199679 2009-01-01 +0100 00:00:00:01 | 199680 207359 2009-01-01 +0100 00:00:00:02 | 207360 215039 2009-01-01 +0100 00:00:00:03 | 215040 222719 2009-01-01 +0100 00:00:00:04 | 222720 230399 2009-01-01 +0100 00:00:00:05 | 230400 238079 2009-01-01 +0100 00:00:00:06 | 238080 245759 2009-01-01 +0100 00:00:00:07 | 245760 253439 2009-01-01 +0100 00:00:00:08 | 253440 261119 2009-01-01 +0100 00:00:00:09 | 261120 268799 2009-01-01 +0100 00:00:00:10 | 268800 276479 2009-01-01 +0100 00:00:00:11 | 276480 284159 2009-01-01 +0100 00:00:00:12 | 284160 291839 2009-01-01 +0100 00:00:00:13 | 291840 299519 2009-01-01 +0100 00:00:00:14 | 299520 307199 2009-01-01 +0100 00:00:00:15 | 307200 314879 2009-01-01 +0100 00:00:00:16 | 314880 322559 2009-01-01 +0100 00:00:00:17 | 322560 330239 2009-01-01 +0100 00:00:00:18 | 330240 337919 2009-01-01 +0100 00:00:00:19 | 337920 345599 2009-01-01 +0100 00:00:00:20 | 345600 353279 2009-01-01 +0100 00:00:00:21 | 353280 360959 2009-01-01 +0100 00:00:00:22 | 360960 368639 2009-01-01 +0100 00:00:00:23 | 368640 376319 libltc-1.3.1/tests/ltcdecode.c000066400000000000000000000051421345125773300162350ustar00rootroot00000000000000/** @brief self-test and example code for libltc LTCDecoder @file ltcdecode.c @author Robin Gareus Copyright (C) 2003 Maarten de Boer Copyright (C) 2006-2016 Robin Gareus Copyright (C) 2008-2009 Jan This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 3, 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 Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #ifdef _WIN32 #include // for _fmode #endif #define BUFFER_SIZE (1024) /** * simple example and test decoder */ int main(int argc, char **argv) { int apv = 1920; ltcsnd_sample_t sound[BUFFER_SIZE]; size_t n; long int total; FILE* f; char* filename; LTCDecoder *decoder; LTCFrameExt frame; if (argc > 1) { filename = argv[1]; if (argc > 2) { sscanf(argv[2], "%i", &apv); } } else { printf("Usage: %s [audio-frames-per-video-frame]\n", argv[0]); return -1; } #ifdef _WIN32 // see https://msdn.microsoft.com/en-us/library/ktss1a9b.aspx and // https://github.com/x42/libltc/issues/18 _set_fmode(_O_BINARY); #endif f = fopen(filename, "r"); if (!f) { fprintf(stderr, "error opening '%s'\n", filename); return -1; } fprintf(stderr, "* reading from: %s\n", filename); total = 0; decoder = ltc_decoder_create(apv, 32); do { n = fread(sound, sizeof(ltcsnd_sample_t), BUFFER_SIZE, f); ltc_decoder_write(decoder, sound, n, total); while (ltc_decoder_read(decoder, &frame)) { SMPTETimecode stime; ltc_frame_to_time(&stime, &frame.ltc, 1); printf("%04d-%02d-%02d %s ", ((stime.years < 67) ? 2000+stime.years : 1900+stime.years), stime.months, stime.days, stime.timezone ); printf("%02d:%02d:%02d%c%02d | %8lld %8lld%s\n", stime.hours, stime.mins, stime.secs, (frame.ltc.dfbit) ? '.' : ':', stime.frame, frame.off_start, frame.off_end, frame.reverse ? " R" : "" ); } total += n; } while (n); fclose(f); ltc_decoder_free(decoder); return 0; } libltc-1.3.1/tests/ltcencode.c000066400000000000000000000064341345125773300162540ustar00rootroot00000000000000/** @brief self-test (and example code) for libltc LTCEncoder @file ltcencoder.c @author Robin Gareus Copyright (C) 2006-2016 Robin Gareus Copyright (C) 2008-2009 Jan This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 3, 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 Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #ifdef _WIN32 #include // for _fmode #endif int main(int argc, char **argv) { FILE* file; double length = 2; // in seconds double fps = 25; double sampleRate = 48000; char *filename; int total = 0; int vframe_cnt; int vframe_last; LTCEncoder *encoder; SMPTETimecode st; const char timezone[6] = "+0100"; strcpy(st.timezone, timezone); st.years = 8; st.months = 12; st.days = 31; st.hours = 23; st.mins = 59; st.secs = 59; st.frame = 0; if (argc > 1) { filename = argv[1]; if (argc > 2) { sampleRate = atof(argv[2]); } if (argc > 3) { fps = atof(argv[3]); } if (argc > 4) { length = atof(argv[4]); } } else { printf("ltcencode - test/example application to encode LTC to a file\n\n"); printf("Usage: ltcencode [sample rate [frame rate [duration in s]]]\n\n"); printf("default-values:\n"); printf(" sample rate: 48000.0 [SPS], frame rate: 25.0 [fps], duration: 2.0 [sec]\n"); printf("Report bugs to Robin Gareus \n"); return 1; } #ifdef _WIN32 // see https://msdn.microsoft.com/en-us/library/ktss1a9b.aspx and // https://github.com/x42/libltc/issues/18 _set_fmode(_O_BINARY); #endif file = fopen(filename, "wb"); if (!file) { fprintf(stderr, "Error: can not open file '%s' for writing.\n", filename); return 1; } encoder = ltc_encoder_create(1, 1, 0, LTC_USE_DATE); ltc_encoder_set_bufsize(encoder, sampleRate, fps); ltc_encoder_reinit(encoder, sampleRate, fps, fps==25?LTC_TV_625_50:LTC_TV_525_60, LTC_USE_DATE); ltc_encoder_set_filter(encoder, 0); ltc_encoder_set_filter(encoder, 25.0); ltc_encoder_set_volume(encoder, -18.0); ltc_encoder_set_timecode(encoder, &st); printf("sample rate: %.2f\n", sampleRate); printf("frames/sec: %.2f\n", fps); printf("secs to write: %.2f\n", length); printf("sample format: 8bit unsigned mono\n"); vframe_cnt = 0; vframe_last = length * fps; while (vframe_cnt++ < vframe_last) { int len; ltcsnd_sample_t *buf; ltc_encoder_encode_frame(encoder); buf = ltc_encoder_get_bufptr(encoder, &len, 1); if (len > 0) { fwrite(buf, sizeof(ltcsnd_sample_t), len, file); total+=len; } ltc_encoder_inc_timecode(encoder); } fclose(file); ltc_encoder_free(encoder); printf("Done: wrote %d samples to '%s'\n", total, filename); return 0; } libltc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