Skip to content

Commit

Permalink
Upgrade bindings to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Jul 20, 2019
1 parent 6554e98 commit 3e9258f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
18 changes: 13 additions & 5 deletions C/soundio/soundio.h
Expand Up @@ -239,7 +239,7 @@ enum SoundIoFormat {
SoundIoFormatS16LE, ///< Signed 16 bit Little Endian
SoundIoFormatS16BE, ///< Signed 16 bit Big Endian
SoundIoFormatU16LE, ///< Unsigned 16 bit Little Endian
SoundIoFormatU16BE, ///< Unsigned 16 bit Little Endian
SoundIoFormatU16BE, ///< Unsigned 16 bit Big Endian
SoundIoFormatS24LE, ///< Signed 24 bit Little Endian using low three bytes in 32-bit word
SoundIoFormatS24BE, ///< Signed 24 bit Big Endian using low three bytes in 32-bit word
SoundIoFormatU24LE, ///< Unsigned 24 bit Little Endian using low three bytes in 32-bit word
Expand Down Expand Up @@ -275,6 +275,10 @@ enum SoundIoFormat {

#elif defined(SOUNDIO_OS_LITTLE_ENDIAN)

/// Note that we build the documentation in Little Endian mode,
/// so all the "NE" macros in the docs point to "LE" and
/// "FE" macros point to "BE". On a Big Endian system it is the
/// other way around.
#define SoundIoFormatS16NE SoundIoFormatS16LE
#define SoundIoFormatU16NE SoundIoFormatU16LE
#define SoundIoFormatS24NE SoundIoFormatS24LE
Expand Down Expand Up @@ -532,7 +536,8 @@ struct SoundIoOutStream {
/// For JACK, this value is always equal to
/// SoundIoDevice::software_latency_current of the device.
double software_latency;

/// Core Audio and WASAPI only: current output Audio Unit volume. Float, 0.0-1.0.
float volume;
/// Defaults to NULL. Put whatever you want here.
void *userdata;
/// In this callback, you call ::soundio_outstream_begin_write and
Expand Down Expand Up @@ -928,7 +933,7 @@ SOUNDIO_EXPORT void soundio_outstream_destroy(struct SoundIoOutStream *outstream
/// After you call this function, SoundIoOutStream::software_latency is set to
/// the correct value.
///
/// The next thing to do is call ::soundio_instream_start.
/// The next thing to do is call ::soundio_outstream_start.
/// If this function returns an error, the outstream is in an invalid state and
/// you must call ::soundio_outstream_destroy on it.
///
Expand All @@ -942,7 +947,6 @@ SOUNDIO_EXPORT void soundio_outstream_destroy(struct SoundIoOutStream *outstream
/// * #SoundIoErrorBackendDisconnected
/// * #SoundIoErrorSystemResources
/// * #SoundIoErrorNoSuchClient - when JACK returns `JackNoSuchClient`
/// * #SoundIoErrorOpeningDevice
/// * #SoundIoErrorIncompatibleBackend - SoundIoOutStream::channel_count is
/// greater than the number of channels the backend can handle.
/// * #SoundIoErrorIncompatibleDevice - stream parameters requested are not
Expand Down Expand Up @@ -1054,6 +1058,9 @@ SOUNDIO_EXPORT int soundio_outstream_pause(struct SoundIoOutStream *outstream, b
SOUNDIO_EXPORT int soundio_outstream_get_latency(struct SoundIoOutStream *outstream,
double *out_latency);

SOUNDIO_EXPORT int soundio_outstream_set_volume(struct SoundIoOutStream *outstream,
double volume);



// Input Streams
Expand Down Expand Up @@ -1160,11 +1167,12 @@ SOUNDIO_EXPORT int soundio_instream_get_latency(struct SoundIoInStream *instream
double *out_latency);


struct SoundIoRingBuffer;

/// A ring buffer is a single-reader single-writer lock-free fixed-size queue.
/// libsoundio ring buffers use memory mapping techniques to enable a
/// contiguous buffer when reading or writing across the boundary of the ring
/// buffer's capacity.
struct SoundIoRingBuffer;
/// `requested_capacity` in bytes.
/// Returns `NULL` if and only if memory could not be allocated.
/// Use ::soundio_ring_buffer_capacity to get the actual capacity, which might
Expand Down
11 changes: 7 additions & 4 deletions deimos/soundio/soundio.d
Expand Up @@ -226,7 +226,7 @@ enum SoundIoFormat
SoundIoFormatS16LE = 3, ///< Signed 16 bit Little Endian
SoundIoFormatS16BE = 4, ///< Signed 16 bit Big Endian
SoundIoFormatU16LE = 5, ///< Unsigned 16 bit Little Endian
SoundIoFormatU16BE = 6, ///< Unsigned 16 bit Little Endian
SoundIoFormatU16BE = 6, ///< Unsigned 16 bit Big Endian
SoundIoFormatS24LE = 7, ///< Signed 24 bit Little Endian using low three bytes in 32-bit word
SoundIoFormatS24BE = 8, ///< Signed 24 bit Big Endian using low three bytes in 32-bit word
SoundIoFormatU24LE = 9, ///< Unsigned 24 bit Little Endian using low three bytes in 32-bit word
Expand Down Expand Up @@ -525,7 +525,8 @@ struct SoundIoOutStream
/// For JACK, this value is always equal to
/// SoundIoDevice::software_latency_current of the device.
double software_latency;

/// Core Audio and WASAPI only: current output Audio Unit volume. Float, 0.0-1.0.
float volume;
/// Defaults to NULL. Put whatever you want here.
void* userdata;
/// In this callback, you call ::soundio_outstream_begin_write and
Expand Down Expand Up @@ -897,7 +898,7 @@ void soundio_outstream_destroy(SoundIoOutStream* outstream);
/// After you call this function, SoundIoOutStream::software_latency is set to
/// the correct value.
///
/// The next thing to do is call ::soundio_instream_start.
/// The next thing to do is call ::soundio_outstream_start.
/// If this function returns an error, the outstream is in an invalid state and
/// you must call ::soundio_outstream_destroy on it.
///
Expand All @@ -911,7 +912,6 @@ void soundio_outstream_destroy(SoundIoOutStream* outstream);
/// * #SoundIoErrorBackendDisconnected
/// * #SoundIoErrorSystemResources
/// * #SoundIoErrorNoSuchClient - when JACK returns `JackNoSuchClient`
/// * #SoundIoErrorOpeningDevice
/// * #SoundIoErrorIncompatibleBackend - SoundIoOutStream::channel_count is
/// greater than the number of channels the backend can handle.
/// * #SoundIoErrorIncompatibleDevice - stream parameters requested are not
Expand Down Expand Up @@ -1022,6 +1022,9 @@ int soundio_outstream_pause(SoundIoOutStream* outstream, bool pause);
/// * #SoundIoErrorStreaming
int soundio_outstream_get_latency(SoundIoOutStream* outstream, double* out_latency);

///
int soundio_outstream_set_volume(SoundIoOutStream* outstream, double volume);

// Input Streams
/// Allocates memory and sets defaults. Next you should fill out the struct fields
/// and then call ::soundio_instream_open. Sets all fields to defaults.
Expand Down
2 changes: 1 addition & 1 deletion dub.sdl
@@ -1,5 +1,5 @@
name "libsoundio"
description "Binding for libsoundio 1.1.0"
description "Binding for libsoundio 1.1.0 and 2.0.0"
authors "webfreak"
copyright "Copyright © 2018, webfreak"
license "MIT"
Expand Down

0 comments on commit 3e9258f

Please sign in to comment.