Skip to content

Integration Headers

Purpose: Convenient single-header includes for different use cases

Overview

Integration headers bundle related functionality into single includes. This makes it easy to get started while keeping build times reasonable.

Headers

audiolab.hpp

Master include - Everything in one header

Use when: Getting started, prototyping, don't care about build time

Includes: - All shared types - All interface contracts - Core functionality - DSP utilities - Plugin helpers

Example:

#include <audiolab/audiolab.hpp>

class MyPlugin : public audiolab::IAudioProcessor {
    // Everything available
};

Usage Strategies

Strategy 1: Single Master Include (Simplest)

#include <audiolab/audiolab.hpp>  // Get everything

Pros: Simple, can't forget anything Cons: Longer compile times

Strategy 2: Minimal Includes (Fastest)

#include <audiolab/shared_types/audiolab_types.hpp>
#include <audiolab/interface_contracts/IAudioProcessor.hpp>
// Only what you need

Pros: Fastest compile times Cons: More verbose, easy to miss includes

Strategy 3: Layered Includes (Balanced)

#include <audiolab/audiolab_core.hpp>  // Core functionality
// Add DSP, plugin, etc. as needed

Pros: Balance of convenience and speed Cons: Need to know what's in each header

Integration with Build Systems

CMake

target_include_directories(my_plugin PRIVATE
    ${AUDIOLAB_INCLUDE_DIR}
)

# Now can use:
# #include <audiolab/audiolab.hpp>

Precompiled Headers

For faster builds, use precompiled headers:

target_precompile_headers(my_plugin PRIVATE
    <audiolab/audiolab.hpp>
)

Forward Declarations

For minimal includes, use forward declarations:

// In header
namespace audiolab {
    class IAudioProcessor;
    struct BufferConfig;
}

class MyHost {
    void add_processor(audiolab::IAudioProcessor& proc);
};
// In implementation
#include <audiolab/audiolab.hpp>  // Full definitions

void MyHost::add_processor(audiolab::IAudioProcessor& proc) {
    // Use full API
}

Recommendation: Start with audiolab.hpp, optimize later if compile time becomes an issue.