From 15e67e4e4e2333731e8d7a9e70bd95976e512f2c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 30 May 2022 20:06:57 -0400 Subject: Reduce dependence on jalv_internal.h --- src/backend.h | 2 +- src/frontend.h | 2 +- src/jack.c | 3 ++- src/jalv.c | 1 + src/jalv_console.c | 1 + src/jalv_gtk.c | 1 + src/jalv_internal.h | 11 ++--------- src/jalv_qt.hpp | 2 +- src/log.h | 2 +- src/portaudio.c | 2 +- src/state.h | 2 +- src/types.h | 24 ++++++++++++++++++++++++ 12 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 src/types.h (limited to 'src') diff --git a/src/backend.h b/src/backend.h index f05d687..53f5db2 100644 --- a/src/backend.h +++ b/src/backend.h @@ -4,7 +4,7 @@ #ifndef JALV_BACKEND_H #define JALV_BACKEND_H -#include "jalv_internal.h" +#include "types.h" #include diff --git a/src/frontend.h b/src/frontend.h index 31ac003..68e6863 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -4,8 +4,8 @@ #ifndef JALV_UI_H #define JALV_UI_H -#include "jalv_internal.h" #include "options.h" +#include "types.h" #include "lilv/lilv.h" diff --git a/src/jack.c b/src/jack.c index c5cb5f8..2253d5a 100644 --- a/src/jack.c +++ b/src/jack.c @@ -12,6 +12,7 @@ #include "nodes.h" #include "options.h" #include "port.h" +#include "types.h" #include "urids.h" #include "lilv/lilv.h" @@ -37,7 +38,7 @@ #include #include -struct JalvBackend { +struct JalvBackendImpl { jack_client_t* client; ///< Jack client bool is_internal_client; ///< Running inside jackd }; diff --git a/src/jalv.c b/src/jalv.c index dd9e66b..682afa0 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -16,6 +16,7 @@ #include "options.h" #include "port.h" #include "state.h" +#include "types.h" #include "urids.h" #include "worker.h" diff --git a/src/jalv_console.c b/src/jalv_console.c index f71c49f..ebb9164 100644 --- a/src/jalv_console.c +++ b/src/jalv_console.c @@ -14,6 +14,7 @@ #include "options.h" #include "port.h" #include "state.h" +#include "types.h" #include "lilv/lilv.h" #include "lv2/ui/ui.h" diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c index 3be1957..998d789 100644 --- a/src/jalv_gtk.c +++ b/src/jalv_gtk.c @@ -8,6 +8,7 @@ #include "options.h" #include "port.h" #include "state.h" +#include "types.h" #include "urids.h" #include "lilv/lilv.h" diff --git a/src/jalv_internal.h b/src/jalv_internal.h index f07241b..a841e80 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -9,6 +9,7 @@ #include "nodes.h" #include "options.h" #include "symap.h" +#include "types.h" #include "urids.h" #include "worker.h" @@ -46,14 +47,6 @@ extern "C" { #endif -struct Jalv; - -typedef struct JalvBackend JalvBackend; - -typedef struct Jalv Jalv; - -typedef enum { JALV_RUNNING, JALV_PAUSE_REQUESTED, JALV_PAUSED } JalvPlayState; - typedef struct { LV2_Feature map_feature; LV2_Feature unmap_feature; @@ -73,7 +66,7 @@ typedef struct { LV2_Extension_Data_Feature ext_data; } JalvFeatures; -struct Jalv { +struct JalvImpl { JalvOptions opts; ///< Command-line options JalvURIDs urids; ///< URIDs JalvNodes nodes; ///< Nodes diff --git a/src/jalv_qt.hpp b/src/jalv_qt.hpp index bb74e46..24a57b5 100644 --- a/src/jalv_qt.hpp +++ b/src/jalv_qt.hpp @@ -1,8 +1,8 @@ // Copyright 2007-2022 David Robillard // SPDX-License-Identifier: ISC -#include "jalv_internal.h" #include "state.h" +#include "types.h" #include "lilv/lilv.h" diff --git a/src/log.h b/src/log.h index 2f81d76..a08edd7 100644 --- a/src/log.h +++ b/src/log.h @@ -4,7 +4,7 @@ #ifndef JALV_LOG_H #define JALV_LOG_H -#include "jalv_internal.h" +#include "types.h" #include "lv2/log/log.h" #include "lv2/urid/urid.h" diff --git a/src/portaudio.c b/src/portaudio.c index 403002c..f50c262 100644 --- a/src/portaudio.c +++ b/src/portaudio.c @@ -10,7 +10,7 @@ #include #include -struct JalvBackend { +struct JalvBackendImpl { PaStream* stream; }; diff --git a/src/state.h b/src/state.h index 72c11da..6d68967 100644 --- a/src/state.h +++ b/src/state.h @@ -4,7 +4,7 @@ #ifndef JALV_STATE_H #define JALV_STATE_H -#include "jalv_internal.h" +#include "types.h" #include "lilv/lilv.h" #include "lv2/atom/atom.h" diff --git a/src/types.h b/src/types.h new file mode 100644 index 0000000..6a1cfd7 --- /dev/null +++ b/src/types.h @@ -0,0 +1,24 @@ +// Copyright 2007-2022 David Robillard +// SPDX-License-Identifier: ISC + +#ifndef JALV_TYPES_H +#define JALV_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/// Backend playing state +typedef enum { JALV_RUNNING, JALV_PAUSE_REQUESTED, JALV_PAUSED } JalvPlayState; + +/// "Global" application state +typedef struct JalvImpl Jalv; + +/// Audio/MIDI backend +typedef struct JalvBackendImpl JalvBackend; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // JALV_TYPES_H -- cgit v1.2.1