2015-07-01 08:02:44 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of libsoundio, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SOUNDIO_DUMMY_HPP
|
|
|
|
#define SOUNDIO_DUMMY_HPP
|
|
|
|
|
2015-08-20 21:48:19 +00:00
|
|
|
#include "soundio_private.h"
|
|
|
|
#include "os.h"
|
2015-07-28 00:06:12 +00:00
|
|
|
#include "atomics.hpp"
|
|
|
|
#include "ring_buffer.hpp"
|
2015-07-27 23:37:45 +00:00
|
|
|
|
2015-07-13 16:17:20 +00:00
|
|
|
int soundio_dummy_init(struct SoundIoPrivate *si);
|
2015-07-01 08:02:44 +00:00
|
|
|
|
2015-07-27 23:37:45 +00:00
|
|
|
struct SoundIoDummy {
|
|
|
|
SoundIoOsMutex *mutex;
|
|
|
|
SoundIoOsCond *cond;
|
|
|
|
bool devices_emitted;
|
|
|
|
};
|
|
|
|
|
2015-08-14 05:54:15 +00:00
|
|
|
struct SoundIoDeviceDummy { };
|
2015-07-27 23:37:45 +00:00
|
|
|
|
2015-07-28 00:06:12 +00:00
|
|
|
struct SoundIoOutStreamDummy {
|
|
|
|
struct SoundIoOsThread *thread;
|
|
|
|
struct SoundIoOsCond *cond;
|
|
|
|
atomic_flag abort_flag;
|
2015-08-14 05:54:15 +00:00
|
|
|
double period_duration;
|
2015-07-28 00:06:12 +00:00
|
|
|
int buffer_frame_count;
|
2015-08-04 07:56:03 +00:00
|
|
|
int frames_left;
|
2015-08-05 04:57:46 +00:00
|
|
|
int write_frame_count;
|
2015-07-28 00:06:12 +00:00
|
|
|
struct SoundIoRingBuffer ring_buffer;
|
|
|
|
double playback_start_time;
|
2015-09-01 22:38:49 +00:00
|
|
|
atomic_flag clear_buffer_flag;
|
2015-07-28 00:06:12 +00:00
|
|
|
SoundIoChannelArea areas[SOUNDIO_MAX_CHANNELS];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SoundIoInStreamDummy {
|
|
|
|
struct SoundIoOsThread *thread;
|
|
|
|
struct SoundIoOsCond *cond;
|
|
|
|
atomic_flag abort_flag;
|
2015-08-14 05:54:15 +00:00
|
|
|
double period_duration;
|
2015-08-04 07:56:03 +00:00
|
|
|
int frames_left;
|
2015-08-05 04:57:46 +00:00
|
|
|
int read_frame_count;
|
2015-07-28 00:06:12 +00:00
|
|
|
int buffer_frame_count;
|
|
|
|
struct SoundIoRingBuffer ring_buffer;
|
|
|
|
SoundIoChannelArea areas[SOUNDIO_MAX_CHANNELS];
|
|
|
|
};
|
|
|
|
|
2015-07-01 08:02:44 +00:00
|
|
|
#endif
|