#include <pulse/pulseaudio.h>
+#define SET_STRING(_field, _val) do { if (!_field || strcmp(_field, _val)) { xfree(_field); _field = xstrdup(_val); } } while (0)
+
/* ursary.c */
void schedule_update(void);
void notify_rotary(int rotary, int delta);
+void notify_touch(int rotary, int on);
void notify_button(int button, int on);
/* nocturn.c */
void noct_set_ring(int ring, int mode, int val);
void noct_set_button(int button, int val);
+extern char noct_rotary_touched[10]; // 8=center, 9=slider
+extern char noct_button_pressed[16];
+
enum ring_mode {
RING_MODE_LEFT,
RING_MODE_RIGHT,
cnode n;
int idx;
char *name;
- uns channels;
- uns volume;
- uns base_volume;
+ uint channels;
+ uint volume;
+ uint base_volume;
int mute;
};
char *name;
int client_idx;
int sink_idx;
- uns channels;
- uns volume;
- uns mute;
+ uint channels;
+ uint volume;
+ uint mute;
int noct_client_idx; // Used by the high-level logic below
};
void pulse_init(void);
void pulse_dump(void);
struct pulse_sink *pulse_sink_by_name(const char *name);
+struct pulse_sink *pulse_sink_by_idx(int idx);
void pulse_sink_set_volume(int idx, pa_cvolume *cvol);
void pulse_sink_set_mute(int idx, bool mute);
void pulse_sink_input_set_volume(int idx, pa_cvolume *cvol);
void pulse_sink_input_set_mute(int idx, bool mute);
+void pulse_sink_input_move(int input_idx, int sink_idx);
struct pulse_client *pulse_client_by_idx(int idx);
void pulse_server_set_default_sink(const char *name);
extern struct pa_mainloop_api pmain_api;
void pmain_init(void);
+
+/* mpd.c */
+
+enum mpd_state {
+ MPD_OFFLINE,
+ MPD_CONNECTING,
+ MPD_WAIT_GREETING,
+ MPD_ONLINE,
+};
+
+extern enum mpd_state mpd_state;
+
+void mpd_init(void);
+const char *mpd_get_player_state(void);
+void mpd_play(void);
+void mpd_stop(void);
+void mpd_pause(int arg);