42 static void xmms_visualization_destroy (
xmms_object_t *
object);
44 #include "visualization/object_ipc.c" 52 for (
id = 0;
id < vis->
clientc; ++id) {
75 if (id < 0 || id >= vis->
clientc) {
88 if (id < 0 || id >= vis->
clientc) {
122 xmms_visualization_register_ipc_commands (
XMMS_OBJECT (vis));
148 g_io_channel_shutdown (vis->
socketio, FALSE, NULL);
152 xmms_visualization_unregister_ipc_commands ();
176 if (!g_strcasecmp (key,
"type")) {
177 if (!g_strcasecmp (data,
"pcm")) {
179 }
else if (!g_strcasecmp (data,
"spectrum")) {
181 }
else if (!g_strcasecmp (data,
"peak")) {
186 }
else if (!g_strcasecmp (key,
"stereo")) {
187 p->
stereo = (atoi (data) > 0);
188 }
else if (!g_strcasecmp (key,
"pcm.hardwire")) {
191 }
else if (!g_strcasecmp (key,
"timeframe")) {
209 id = create_client ();
211 xmms_error_set (err,
XMMS_ERROR_OOM,
"could not allocate dataset");
217 properties_init (&c->
prop);
231 if (!property_set (&c->
prop, key, value)) {
247 const gchar *key, *valstr;
253 xmms_error_set (err,
XMMS_ERROR_INVAL,
"properties must be sent as a dict!");
259 xmms_error_set (err,
XMMS_ERROR_INVAL,
"key-value property pair could not be read!");
261 xmms_error_set (err,
XMMS_ERROR_INVAL,
"property value could not be read!");
262 }
else if (!property_set (&c->
prop, key, valstr)) {
282 if (sscanf (shmidstr,
"%d", &shmid) != 1) {
286 return init_shm (vis,
id, shmid, err);
305 package_write (
xmms_vis_client_t *c, int32_t
id,
struct timeval *time,
int channels,
int size,
short *buf)
330 gettimeofday (&time, NULL);
331 time.tv_sec += (latency / 1000);
332 time.tv_usec += (latency % 1000) * 1000;
333 if (time.tv_usec > 1000000) {
335 time.tv_usec -= 1000000;
339 for (i = 0; i < vis->
clientc; ++i) {
341 package_write (vis->
clientv[i], i, &time, channels, size, buf);
#define xmms_object_unref(obj)
xmmsc_vis_properties_t prop
The structures for a vis client.
int xmmsv_dict_iter_pair(xmmsv_dict_iter_t *it, const char **key, xmmsv_t **val)
Get the key-element pair currently pointed at by the iterator.
gboolean write_udp(xmmsc_vis_udp_t *t, xmms_vis_client_t *c, int32_t id, struct timeval *time, int channels, int size, short *buf, int socket)
void xmmsv_dict_iter_next(xmmsv_dict_iter_t *it)
Advance the iterator to the next pair in the dict.
guint32 xmms_output_latency(xmms_output_t *output)
union xmms_vis_client_t::@2 transport
xmms_vis_client_t ** clientv
xmms_vis_client_t * get_client(int32_t id)
void cleanup_shm(xmmsc_vis_unixshm_t *t)
int xmmsv_dict_iter_valid(xmmsv_dict_iter_t *it)
Check whether the iterator is valid and points to a valid pair.
int32_t init_udp(xmms_visualization_t *vis, int32_t id, xmms_error_t *err)
#define x_fetch_client(id)
xmmsc_vis_transport_t type
struct xmms_output_St xmms_output_t
#define x_release_client()
void xmms_socket_invalidate(xmms_socket_t *socket)
xmmsv_type_t xmmsv_get_type(const xmmsv_t *val)
Get the type of the value.
xmms_visualization_t * xmms_visualization_new(xmms_output_t *output)
Initialize the Vis module.
Properties of the delivered vis data.
#define xmms_log_info(fmt,...)
#define xmms_object_ref(obj)
void xmms_log_debug(const gchar *fmt,...)
#define XMMS_DBG(fmt,...)
void delete_client(int32_t id)
void send_data(int channels, int size, short *buf)
void cleanup_udp(xmmsc_vis_udp_t *t, xmms_socket_t socket)
int xmmsv_get_string(const xmmsv_t *val, const char **r)
Retrieves a string from the value.
#define xmms_object_new(objtype, destroyfunc)
G_BEGIN_DECLS struct xmms_error_St xmms_error_t
#define XMMS_VISPACKET_VERSION
struct xmmsv_dict_iter_St xmmsv_dict_iter_t
int xmmsv_get_dict_iter(const xmmsv_t *val, xmmsv_dict_iter_t **it)
Retrieves a dict iterator from a dict xmmsv_t.
void xmms_socket_close(xmms_socket_t socket)
int32_t init_shm(xmms_visualization_t *vis, int32_t id, int32_t shmid, xmms_error_t *err)
The structures for the vis module.
int xmms_socket_valid(xmms_socket_t socket)
gboolean write_shm(xmmsc_vis_unixshm_t *t, xmms_vis_client_t *c, int32_t id, struct timeval *time, int channels, int size, short *buf)