GithubHelp home page GithubHelp logo

schafo / libadm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebu/libadm

0.0 0.0 0.0 616 KB

Audio Definition Model (ITU-R BS.2076) handling library

License: Apache License 2.0

CMake 0.90% C++ 92.49% HTML 6.61%

libadm's Introduction

libadm - ITU-R BS.2076 Library

Build Status Build status Documentation Status codecov

Introduction

The libadm library is a modern C++11 library to parse, modify, create and write ITU-R BS.2076-1 conform XML document. It works well with the header-only library libbw64 to write ADM related applications with minimal dependencies.

Features

  • minimal dependencies
  • expressive syntax
  • easy access to referenced ADM elements
  • common definitions support

Dependencies

  • compiler with C++11 support
  • Boost header libraries (version 1.57 or later)
    • Boost.Optional
    • Boost.Variant
    • Boost.Range
    • Boost.Iterator
    • Boost.Functional
    • Boost.Format
  • CMake build system (version 3.5 or later)

Installation

macOS

On macOS you can use homebrew to install the library. You just have to add the IRT’s NGA homebrew tap and can then use the usual install command.

brew tap irt-open-source/homebrew-nga
brew install libadm

Manual installation

To manually install the library you have to clone the git repository and then use the CMake build system to build and install it.

git clone [email protected]:irt-open-source/libadm.git
cd libadm
mkdir build && cd build
cmake ..
make
make install

CMake

As the library uses CMake as a build system it is really easy to set up and use if your project does too. Assuming you have installed the library, the following code shows a complete CMake example to compile a program which uses the libadm.

cmake_minimum_required(VERSION 3.5)
project(libadm_example VERSION 1.0.0 LANGUAGES CXX)

find_package(Boost 1.57 REQUIRED)
find_package(adm REQUIRED)

add_executable(examples example.cpp)
target_link_libraries(example PRIVATE adm)

If you prefer not to install the library on your system you can also use the library as a subproject. You can just add the library as a CMake subproject. Just add the folder containing the repository to your project and you can use the adm target.

cmake_minimum_required(VERSION 3.5)
project(libadm_example VERSION 1.0.0 LANGUAGES CXX)

add_subdirectory(submodules/libadm)

add_executable(example example.cpp)
target_link_libraries(example PRIVATE adm)

Note

If libadm is used as a CMake subproject the default values of the options

  • ADM_UNIT_TESTS
  • ADM_EXAMPLES
  • ADM_PACKAGE_AND_INSTALL

are automatically set to FALSE.

Example

The following minimal example shows how easy a valid ADM file can be created from scratch using the libadm library. For more examples have a look at the examples folder in the repository.

#include <iostream>
#include <sstream>
#include <adm/adm.hpp>
#include <adm/utilities/object_creation.hpp>
#include <adm/write.hpp>

int main() {
  using namespace adm;

  // create ADM elements
  auto admProgramme = AudioProgramme::create(AudioProgrammeName("Alice and Bob talking"));
  auto speechContent = AudioContent::create(AudioContentName("Speech"));
  auto aliceHolder = createSimpleObject("Alice");
  auto bobHolder = createSimpleObject("Bob");

  // add references
  admProgramme->addReference(speechContent);
  speechContent->addReference(aliceHolder.audioObject);
  speechContent->addReference(bobHolder.audioObject);

  auto admDocument = Document::create();
  admDocument->add(admProgramme);

  // write XML data to stdout
  writeXml(std::cout, admDocument);
  return 0;
}

Current Limitations

  1. some ADM sub-elements are missing
  2. no SADM support (ITU-R BS.[SERIAL])

Acknowledgement

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 687645.

License

Copyright 2018 Institut fuer Rundfunktechnik GmbH (IRT)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

libadm's People

Contributors

benjamin-weiss avatar mikedevnull avatar rsjbailey avatar tomjnixon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.