struct sndio_formats {
const char *name;
- enum sps_format_t fmt;
+ sps_format_t fmt;
unsigned int rate;
unsigned int bits;
unsigned int bps;
#endif
#if defined(CONFIG_DBUS_INTERFACE) || defined(CONFIG_MPRIS_INTERFACE)
-enum dbus_session_type {
+typedef enum {
DBT_system = 0, // use the session bus
DBT_session, // use the system bus
-} dbt_type;
+} dbus_session_type;
#endif
#define sps_extra_code_output_stalled 32768
yna_type use_precision_timing; // defaults to no
#if defined(CONFIG_DBUS_INTERFACE)
- enum dbus_session_type dbus_service_bus_type;
+ dbus_session_type dbus_service_bus_type;
#endif
#if defined(CONFIG_MPRIS_INTERFACE)
- enum dbus_session_type mpris_service_bus_type;
+ dbus_session_type mpris_service_bus_type;
#endif
#ifdef CONFIG_METADATA_HUB
#include <FFTConvolver/convolver.h>
#endif
+ShairportSync *shairportSyncSkeleton;
+
int service_is_running = 0;
ShairportSyncDiagnostics *shairportSyncDiagnosticsSkeleton = NULL;
#define DBUS_SERVICE_H
#include "dbus-interface.h"
-ShairportSync *shairportSyncSkeleton;
+extern ShairportSync *shairportSyncSkeleton;
int start_dbus_service();
void stop_dbus_service();
#include <openssl/md5.h>
#endif
+struct metadata_bundle metadata_store;
+
int metadata_hub_initialised = 0;
pthread_rwlock_t metadata_hub_re_lock = PTHREAD_RWLOCK_INITIALIZER;
#define number_of_watchers 2
-enum play_status_type {
+typedef enum {
PS_NOT_AVAILABLE = 0,
PS_STOPPED,
PS_PAUSED,
PS_PLAYING,
} play_status_type;
-enum active_state_type {
+typedef enum {
AM_INACTIVE = 0,
AM_ACTIVE,
} active_state_type;
-enum shuffle_status_type {
+typedef enum {
SS_NOT_AVAILABLE = 0,
SS_OFF,
SS_ON,
} shuffle_status_type;
-enum repeat_status_type {
+typedef enum {
RS_NOT_AVAILABLE = 0,
RS_OFF,
RS_ONE,
// used detect transitions between server activity being on or off
// e.g. to reease metadata when a server goes inactive, but not if it's permanently
// inactive.
- enum play_status_type play_status;
- enum shuffle_status_type shuffle_status;
- enum repeat_status_type repeat_status;
+ play_status_type play_status;
+ shuffle_status_type shuffle_status;
+ repeat_status_type repeat_status;
// the following pertain to the track playing
// end
- enum play_status_type
+ play_status_type
player_state; // this is the state of the actual player itself, which can be a bit noisy.
- enum active_state_type active_state;
+ active_state_type active_state;
int speaker_volume; // this is the actual speaker volume, allowing for the main volume and the
// speaker volume control
} metadata_bundle;
-struct metadata_bundle metadata_store;
+extern struct metadata_bundle metadata_store;
void add_metadata_watcher(metadata_watcher fn, void *userdata);
#include "metadata_hub.h"
#include "mpris-service.h"
+MediaPlayer2 *mprisPlayerSkeleton;
+MediaPlayer2Player *mprisPlayerPlayerSkeleton;
+
double airplay_volume_to_mpris_volume(double sp) {
if (sp < -30.0)
sp = -30.0;
#include "mpris-interface.h"
-MediaPlayer2 *mprisPlayerSkeleton;
-MediaPlayer2Player *mprisPlayerPlayerSkeleton;
+extern MediaPlayer2 *mprisPlayerSkeleton;
+extern MediaPlayer2Player *mprisPlayerPlayerSkeleton;
int start_mpris_service();