Moved audio_stream.h from interfaces to core headers

pull/180/head
Silvano Seva 2023-03-15 19:36:35 +01:00
rodzic 7b64fca573
commit 1011dd1081
20 zmienionych plików z 30 dodań i 27 usunięć

Wyświetl plik

@ -24,21 +24,15 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <sys/types.h> #include <sys/types.h>
#include "audio.h" #include <interfaces/audio.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef int16_t stream_sample_t;
typedef int8_t streamId;
enum BufMode typedef int8_t streamId;
{
BUF_LINEAR, ///< Linear buffer mode, conversion stops when full.
BUF_CIRC_DOUBLE ///< Circular double buffer mode, conversion never stops,
/// thread woken up whenever half of the buffer is full.
};
typedef struct typedef struct
{ {

Wyświetl plik

@ -55,6 +55,15 @@ enum AudioPriority
PRIO_TX ///< Priority level of outward audio directed to TX stage PRIO_TX ///< Priority level of outward audio directed to TX stage
}; };
enum BufMode
{
BUF_LINEAR, ///< Linear buffer mode, conversion stops when full.
BUF_CIRC_DOUBLE ///< Circular double buffer mode, conversion never stops,
/// thread woken up whenever half of the buffer is full.
};
typedef int16_t stream_sample_t;
/** /**
* Initialise low-level audio management module. * Initialise low-level audio management module.
*/ */

Wyświetl plik

@ -34,7 +34,7 @@
#include <dsp.h> #include <dsp.h>
#include <cmath> #include <cmath>
#include <audio_path.h> #include <audio_path.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <M17/M17Datatypes.hpp> #include <M17/M17Datatypes.hpp>
#include <M17/M17Constants.hpp> #include <M17/M17Constants.hpp>

Wyświetl plik

@ -25,7 +25,7 @@
#error This header is C++ only! #error This header is C++ only!
#endif #endif
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <M17/PwmCompensator.hpp> #include <M17/PwmCompensator.hpp>
#include <M17/M17Constants.hpp> #include <M17/M17Constants.hpp>
#include <audio_path.h> #include <audio_path.h>

Wyświetl plik

@ -18,7 +18,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/> * * along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/ ***************************************************************************/
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <audio_codec.h> #include <audio_codec.h>
#include <pthread.h> #include <pthread.h>
#include <codec2.h> #include <codec2.h>

Wyświetl plik

@ -23,7 +23,7 @@
#include <M17/M17Demodulator.hpp> #include <M17/M17Demodulator.hpp>
#include <M17/M17DSP.hpp> #include <M17/M17DSP.hpp>
#include <M17/M17Utils.hpp> #include <M17/M17Utils.hpp>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <math.h> #include <math.h>
#include <cstring> #include <cstring>
#include <stdio.h> #include <stdio.h>

Wyświetl plik

@ -18,7 +18,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/> * * along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/ ***************************************************************************/
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <hwconfig.h> #include <hwconfig.h>
#include <stddef.h> #include <stddef.h>

Wyświetl plik

@ -19,7 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include <kernel/scheduler/scheduler.h> #include <kernel/scheduler/scheduler.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <toneGenerator_MDx.h> #include <toneGenerator_MDx.h>
#include <peripherals/gpio.h> #include <peripherals/gpio.h>
#include <hwconfig.h> #include <hwconfig.h>

Wyświetl plik

@ -19,7 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include <kernel/scheduler/scheduler.h> #include <kernel/scheduler/scheduler.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <toneGenerator_MDx.h> #include <toneGenerator_MDx.h>
#include <peripherals/gpio.h> #include <peripherals/gpio.h>
#include <hwconfig.h> #include <hwconfig.h>

Wyświetl plik

@ -16,7 +16,7 @@
***************************************************************************/ ***************************************************************************/
#include <hwconfig.h> #include <hwconfig.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <stddef.h> #include <stddef.h>
#include <atomic> #include <atomic>

Wyświetl plik

@ -18,7 +18,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/> * * along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/ ***************************************************************************/
#include <interfaces/audio_stream.h> #include <audio_stream.h>
streamId outputStream_start(const enum AudioSink destination, streamId outputStream_start(const enum AudioSink destination,
const enum AudioPriority prio, const enum AudioPriority prio,

Wyświetl plik

@ -19,7 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include <kernel/scheduler/scheduler.h> #include <kernel/scheduler/scheduler.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <toneGenerator_MDx.h> #include <toneGenerator_MDx.h>
#include <data_conversion.h> #include <data_conversion.h>
#include <timers.h> #include <timers.h>

Wyświetl plik

@ -19,7 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include <kernel/scheduler/scheduler.h> #include <kernel/scheduler/scheduler.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <peripherals/gpio.h> #include <peripherals/gpio.h>
#include <data_conversion.h> #include <data_conversion.h>
#include <hwconfig.h> #include <hwconfig.h>

Wyświetl plik

@ -18,7 +18,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/> * * along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/ ***************************************************************************/
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <pulse/pulseaudio.h> #include <pulse/pulseaudio.h>
#include <pulse/simple.h> #include <pulse/simple.h>
#include <pulse/error.h> #include <pulse/error.h>

Wyświetl plik

@ -18,7 +18,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/> * * along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/ ***************************************************************************/
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <interfaces/audio_path.h> #include <interfaces/audio_path.h>
#include <interfaces/platform.h> #include <interfaces/platform.h>
#include <interfaces/delays.h> #include <interfaces/delays.h>

Wyświetl plik

@ -23,7 +23,7 @@
#include <interfaces/delays.h> #include <interfaces/delays.h>
#include <interfaces/audio.h> #include <interfaces/audio.h>
#include <interfaces/audio_path.h> #include <interfaces/audio_path.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <interfaces/platform.h> #include <interfaces/platform.h>
#include <dsp.h> #include <dsp.h>

Wyświetl plik

@ -23,7 +23,7 @@
#include <interfaces/delays.h> #include <interfaces/delays.h>
#include <interfaces/audio.h> #include <interfaces/audio.h>
#include <interfaces/audio_path.h> #include <interfaces/audio_path.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <interfaces/platform.h> #include <interfaces/platform.h>
#include <dsp.h> #include <dsp.h>

Wyświetl plik

@ -29,7 +29,7 @@
#include <M17/M17DSP.h> #include <M17/M17DSP.h>
#include <M17/M17Demodulator.h> #include <M17/M17Demodulator.h>
#include <M17/M17Utils.h> #include <M17/M17Utils.h>
#include <interfaces/audio_stream.h> #include <audio_stream.h>
using namespace std; using namespace std;

Wyświetl plik

@ -23,7 +23,7 @@
#include <thread> #include <thread>
#include <vector> #include <vector>
#include "interfaces/audio_stream.h" #include "audio_stream.h"
static const char* files[] = {"MIC.raw", "RTX.raw", "MCU.raw"}; static const char* files[] = {"MIC.raw", "RTX.raw", "MCU.raw"};

Wyświetl plik

@ -22,7 +22,7 @@
// Test private methods // Test private methods
#define private public #define private public
#include <interfaces/audio_stream.h> #include <audio_stream.h>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>