// Copyright 2014-2025 Jesper Larsson
//
// This file is part of Klipspringer, <https://klipspringer.avadeaux.net/>
//
// Klipspringer is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// Klipspringer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with Klipspringer. If
// not, see <https://www.gnu.org/licenses/>.

#ifndef CHOOSE_FORMAT_H
#define CHOOSE_FORMAT_H

#include <stdbool.h>
#include <alsa/asoundlib.h>

// The definitions of the following functions are generated by alsa-pcm-choice.mjs during build.

// Gets the PCM sample format constant corresponding to given format details.
snd_pcm_format_t get_format(bool signed_int, unsigned bips, unsigned ss, bool bigend);

// Gets format details corresponding to given a PCM sample format constant. Returns true if the
// format details were successfully extracted.
bool split_format(snd_pcm_format_t f, bool *signed_int, unsigned *bips, unsigned *ss, bool *bigend);

#endif
