Exemplo n.º 1
0
static PyObject *
alsaseq_status(PyObject *self /* Not used */, PyObject *args)
{
        snd_seq_queue_status_t *queue_status;
        int running, events;
        const snd_seq_real_time_t *current_time;
	if (!PyArg_ParseTuple(args, "" ))
		return NULL;

        snd_seq_queue_status_malloc( &queue_status );
        snd_seq_get_queue_status( seq_handle, queue_id, queue_status );
        current_time = snd_seq_queue_status_get_real_time( queue_status );
        running = snd_seq_queue_status_get_status( queue_status );
        events = snd_seq_queue_status_get_events( queue_status );
        snd_seq_queue_status_free( queue_status );
        
	return Py_BuildValue( "(i(ii),i)", running, current_time->tv_sec, current_time->tv_nsec, events );
}
Exemplo n.º 2
0
static PyObject *
alsaseq_status(PyObject *self /* Not used */, PyObject *args)
{
        snd_seq_queue_status_t *queue_status;
        int running, events;
        const snd_seq_real_time_t *current_time;
	if (!PyArg_ParseTuple(args, "" ))
		return NULL;

        if (!seq_handle) {
                PyErr_SetString(PyExc_RuntimeError, "Must initialize module with alsaseq.client() before using it");
                return NULL;
        }

        snd_seq_queue_status_malloc( &queue_status );
        snd_seq_get_queue_status( seq_handle, queue_id, queue_status );
        current_time = snd_seq_queue_status_get_real_time( queue_status );
        running = snd_seq_queue_status_get_status( queue_status );
        events = snd_seq_queue_status_get_events( queue_status );
        snd_seq_queue_status_free( queue_status );
        
	return Py_BuildValue( "(i(ii),i)", running, current_time->tv_sec, current_time->tv_nsec, events );
}