ChapterForge
Loading...
Searching...
No Matches
chapterforge.hpp
Go to the documentation of this file.
1//
2// chapterforge.hpp
3// ChapterForge
4//
5// Created by Till Toenshoff on 12/9/25.
6// Copyright © 2025 Till Toenshoff. All rights reserved.
7//
8
9#pragma once
10#include <cstdint>
11#include <stdint.h>
12#include <string>
13#include <vector>
14
17#include "metadata_set.hpp"
18
19namespace chapterforge {
20
24
31struct Status {
32 bool ok{false};
33 std::string message;
34};
35
41std::string version_string();
42
44Status mux_file_to_m4a(const std::string &input_audio_path,
45 const std::string &chapter_json_path, const std::string &output_path,
46 bool fast_start = true);
47
49Status mux_file_to_m4a(const std::string &input_audio_path,
50 const std::vector<ChapterTextSample> &text_chapters,
51 const std::vector<ChapterImageSample> &image_chapters,
52 const MetadataSet &metadata, const std::string &output_path,
53 bool fast_start = true);
54
56Status mux_file_to_m4a(const std::string &input_audio_path,
57 const std::vector<ChapterTextSample> &text_chapters,
58 const MetadataSet &metadata, const std::string &output_path,
59 bool fast_start = true);
60
62Status mux_file_to_m4a(const std::string &input_audio_path,
63 const std::vector<ChapterTextSample> &text_chapters,
64 const std::vector<ChapterImageSample> &image_chapters,
65 const std::string &output_path,
66 bool fast_start = true);
67
79Status mux_file_to_m4a(const std::string &input_audio_path,
80 const std::vector<ChapterTextSample> &text_chapters,
81 const std::vector<ChapterTextSample> &url_chapters,
82 const std::vector<ChapterImageSample> &image_chapters,
83 const std::string &output_path,
84 bool fast_start = true);
85
97Status mux_file_to_m4a(const std::string &input_audio_path,
98 const std::vector<ChapterTextSample> &text_chapters,
99 const std::vector<ChapterTextSample> &url_chapters,
100 const std::vector<ChapterImageSample> &image_chapters,
101 const MetadataSet &metadata, const std::string &output_path,
102 bool fast_start = true);
103
115 std::vector<ChapterTextSample> titles;
116 std::vector<ChapterTextSample> urls;
117 std::vector<ChapterImageSample> images;
119};
120
121ReadResult read_m4a(const std::string &path);
122
124
125} // namespace chapterforge
bool ok
Definition chapterforge.hpp:32
std::string message
Definition chapterforge.hpp:33
ReadResult read_m4a(const std::string &path)
Status mux_file_to_m4a(const std::string &input_audio_path, const std::string &chapter_json_path, const std::string &output_path, bool fast_start=true)
Mux AAC input + chapter/text/image metadata into an M4A file (JSON driven).
std::string version_string()
Return the ChapterForge library version string.
Definition metadata_set.hpp:16
Result object with success flag and optional error message.
Definition chapterforge.hpp:31
Definition chapterforge.hpp:19
Parse an existing M4A/MP4 file and return its chapter data.
Definition chapterforge.hpp:113
std::vector< ChapterTextSample > titles
Definition chapterforge.hpp:115
MetadataSet metadata
Definition chapterforge.hpp:118
std::vector< ChapterImageSample > images
Definition chapterforge.hpp:117
Status status
Definition chapterforge.hpp:114
std::vector< ChapterTextSample > urls
Definition chapterforge.hpp:116