diff --git a/CMakeLists.txt b/CMakeLists.txt index be7239e..40cf047 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,6 @@ set(CONFIGURE_OUT_FILE "${CMAKE_BINARY_DIR}/config.h") set(LIBSOUNDIO_HEADERS "${CMAKE_SOURCE_DIR}/soundio/soundio.h" "${CMAKE_SOURCE_DIR}/soundio/endian.h" - ${CONFIGURE_OUT_FILE} ) if(SOUNDIO_HAVE_JACK) diff --git a/README.md b/README.md index 1800450..e18bb4e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # libsoundio -C99 library providing cross-platform audio input and output. The API is +C library providing cross-platform audio input and output. The API is suitable for real-time software such as digital audio workstations as well as consumer software such as music players. diff --git a/soundio/soundio.h b/soundio/soundio.h index 98fb4dc..e6ce152 100644 --- a/soundio/soundio.h +++ b/soundio/soundio.h @@ -8,7 +8,6 @@ #ifndef SOUNDIO_SOUNDIO_H #define SOUNDIO_SOUNDIO_H -#include "config.h" #include "endian.h" #include @@ -670,7 +669,14 @@ struct SoundIoInStream { int layout_error; }; -// Main Context +/// See also ::soundio_version_major, ::soundio_version_minor, ::soundio_version_patch +SOUNDIO_EXPORT const char *soundio_version_string(void); +/// See also ::soundio_version_string, ::soundio_version_minor, ::soundio_version_patch +SOUNDIO_EXPORT int soundio_version_major(void); +/// See also ::soundio_version_major, ::soundio_version_string, ::soundio_version_patch +SOUNDIO_EXPORT int soundio_version_minor(void); +/// See also ::soundio_version_major, ::soundio_version_minor, ::soundio_version_string +SOUNDIO_EXPORT int soundio_version_patch(void); /// Create a SoundIo context. You may create multiple instances of this to /// connect to multiple backends. Sets all fields to defaults. diff --git a/src/soundio.c b/src/soundio.c index e01b78e..1ed2ff2 100644 --- a/src/soundio.c +++ b/src/soundio.c @@ -801,3 +801,19 @@ bool soundio_device_equal( { return a->is_raw == b->is_raw && a->aim == b->aim && strcmp(a->id, b->id) == 0; } + +const char *soundio_version_string(void) { + return SOUNDIO_VERSION_STRING; +} + +int soundio_version_major(void) { + return SOUNDIO_VERSION_MAJOR; +} + +int soundio_version_minor(void) { + return SOUNDIO_VERSION_MINOR; +} + +int soundio_version_patch(void) { + return SOUNDIO_VERSION_PATCH; +} diff --git a/src/soundio_private.h b/src/soundio_private.h index ead582d..13d1d7a 100644 --- a/src/soundio_private.h +++ b/src/soundio_private.h @@ -9,6 +9,7 @@ #define SOUNDIO_SOUNDIO_PRIVATE_H #include "soundio_internal.h" +#include "config.h" #ifdef SOUNDIO_HAVE_JACK #include "jack.h"