diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-05 21:08:03 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-05 21:08:22 +0200 |
commit | 8618657695b2530f463d1e7e0fca11304d2b897e (patch) | |
tree | 1f183912e438599ef7abdc0e188c48a3da30d56d /src/simulator | |
parent | ba105ccbf7c350e24ee527472a99e3672983e93d (diff) | |
download | glutte-o-matic-8618657695b2530f463d1e7e0fca11304d2b897e.tar.gz glutte-o-matic-8618657695b2530f463d1e7e0fca11304d2b897e.tar.bz2 glutte-o-matic-8618657695b2530f463d1e7e0fca11304d2b897e.zip |
Make object for common/Audio
Diffstat (limited to 'src/simulator')
-rw-r--r-- | src/simulator/src/Audio/audio.c | 36 | ||||
-rw-r--r-- | src/simulator/src/Audio/cw.c | 24 |
2 files changed, 53 insertions, 7 deletions
diff --git a/src/simulator/src/Audio/audio.c b/src/simulator/src/Audio/audio.c index e4a0129..51a7f3d 100644 --- a/src/simulator/src/Audio/audio.c +++ b/src/simulator/src/Audio/audio.c @@ -1,15 +1,39 @@ -#include "../../../common/src/Audio/audio.c" - +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + +#include <stdio.h> #include <pulse/simple.h> +#include "Audio/audio.h" #include "FreeRTOS.h" #include "task.h" - pa_simple *s = NULL; int current_buffer_length = 0; int16_t * current_buffer_samples; +static void audio_buffer_sent(); static void audio_buffer_sender(void *args); extern char gui_audio_on; @@ -60,7 +84,7 @@ static void audio_buffer_sender(void *args) { } -void audio_buffer_sent() { +static void audio_buffer_sent() { if (next_buffer_samples) { audio_start_dma_and_request_buffers(); @@ -119,7 +143,7 @@ bool audio_provide_buffer_without_blocking(void *samples, int numsamples) { return true; } -static void audio_start_dma_and_request_buffers() { +void audio_start_dma_and_request_buffers() { current_buffer_length = next_buffer_length; current_buffer_samples = next_buffer_samples; @@ -134,7 +158,7 @@ static void audio_start_dma_and_request_buffers() { callback_function(callback_context, buffer_number); } -static void audio_stop_dma() { +void audio_stop_dma() { dma_running = false; } diff --git a/src/simulator/src/Audio/cw.c b/src/simulator/src/Audio/cw.c index 0f37be4..e9321da 100644 --- a/src/simulator/src/Audio/cw.c +++ b/src/simulator/src/Audio/cw.c @@ -1,4 +1,26 @@ -#include "../../../common/src/Audio/cw.c" +/* + * The MIT License (MIT) + * + * Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ extern char gui_cw_text[4096]; int gui_cw_text_pointer = 0; |