[1816] | 1 | //light.h: |
---|
| 2 | |
---|
| 3 | /* |
---|
[5961] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2014 |
---|
[1816] | 5 | * |
---|
| 6 | * This file is part of roard a part of RoarAudio, |
---|
| 7 | * a cross-platform sound system for both, home and professional use. |
---|
| 8 | * See README for details. |
---|
| 9 | * |
---|
| 10 | * This file is free software; you can redistribute it and/or modify |
---|
| 11 | * it under the terms of the GNU General Public License version 3 |
---|
| 12 | * as published by the Free Software Foundation. |
---|
| 13 | * |
---|
| 14 | * RoarAudio is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this software; see the file COPYING. If not, write to |
---|
[3517] | 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
[1816] | 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
| 26 | #ifndef _LIGHT_H_ |
---|
| 27 | #define _LIGHT_H_ |
---|
| 28 | |
---|
| 29 | #include <roaraudio.h> |
---|
| 30 | |
---|
[2495] | 31 | #ifndef ROAR_WITHOUT_DCOMP_LIGHT |
---|
| 32 | |
---|
[1923] | 33 | #define LIGHT_CHANNELS_DEFAULT 512 /* one DMX Universe */ |
---|
[5920] | 34 | #define MAX_EVENTS_PER_CYCLE 16 /* this*cfreq is event thruput (16*100Hz = 1.6kEvents/s) */ |
---|
[1923] | 35 | |
---|
[5194] | 36 | extern struct light_state { |
---|
[1817] | 37 | unsigned int channels; |
---|
[5920] | 38 | uint8_t events[MAX_EVENTS_PER_CYCLE]; |
---|
| 39 | size_t eventsqueuelen; |
---|
[5916] | 40 | uint8_t * state; |
---|
| 41 | uint8_t * changes; |
---|
[5980] | 42 | uint8_t * output; |
---|
| 43 | uint8_t * outputchanges; |
---|
[5982] | 44 | struct roar_slfi_inst * filter; |
---|
[1817] | 45 | } g_light_state; |
---|
| 46 | |
---|
[5194] | 47 | extern struct light_mixer { |
---|
[2944] | 48 | int stream; |
---|
| 49 | } g_light_mixer; |
---|
| 50 | |
---|
[5210] | 51 | int light_init (uint32_t channels); |
---|
[1817] | 52 | int light_free (void); |
---|
| 53 | |
---|
| 54 | int light_update(void); |
---|
| 55 | int light_reset (void); |
---|
[1966] | 56 | int light_reinit(void); |
---|
[1817] | 57 | |
---|
[1821] | 58 | int light_check_stream (int id); |
---|
| 59 | int light_send_stream (int id); |
---|
| 60 | |
---|
[5982] | 61 | int light_filter_load(int primary, const char * name, int autoload, const struct roar_keyval * para, ssize_t paralen); |
---|
| 62 | |
---|
[5706] | 63 | // for plugins: |
---|
[6018] | 64 | // Those functions should be avoided. Please write SLFI filters instead! |
---|
| 65 | int light_dmxchannel_get(size_t index); // get channel value from output state. |
---|
| 66 | int light_dmxchannel_set(size_t index, uint8_t val); // set channel in input state. |
---|
| 67 | ssize_t light_dmxchannel_num(void); // returns number of channels. |
---|
[5706] | 68 | |
---|
[5920] | 69 | int light_dmxevent_add(const uint8_t * events, size_t len); |
---|
| 70 | int light_dmxevent_read(const uint8_t ** events, size_t * len); |
---|
| 71 | #define light_dmxevent_addone(event) light_dmxevent_add(&(uint8_t){(event)}, 1) |
---|
| 72 | |
---|
[5917] | 73 | // codec filters: |
---|
| 74 | int cf_light_roardmx_read(int id, struct roar_stream_server * ss); |
---|
| 75 | int cf_light_roardmx_write(int id, struct roar_stream_server * ss); |
---|
| 76 | |
---|
[1816] | 77 | #endif |
---|
| 78 | |
---|
[2495] | 79 | #endif |
---|
| 80 | |
---|
[1816] | 81 | //ll |
---|