Exemplo n.º 1
0
/*
 * change queue's owner and permission
 */
int snd_seq_queue_set_owner(int queueid, int client, int locked)
{
    struct snd_seq_queue *q = queueptr(queueid);

    if (q == NULL)
        return -EINVAL;

    if (! queue_access_lock(q, client)) {
        queuefree(q);
        return -EPERM;
    }

    q->locked = locked ? 1 : 0;
    q->owner = client;
    queue_access_unlock(q);
    queuefree(q);

    return 0;
}
Exemplo n.º 2
0
/*
 * Queue control via timer control port:
 * this function is exported as a callback of timer port.
 */
int snd_seq_control_queue(struct snd_seq_event *ev, int atomic, int hop)
{
    struct snd_seq_queue *q;

    snd_assert(ev != NULL, return -EINVAL);
    q = queueptr(ev->data.queue.queue);

    if (q == NULL)
        return -EINVAL;

    if (! queue_access_lock(q, ev->source.client)) {
        queuefree(q);
        return -EPERM;
    }

    snd_seq_queue_process_event(q, ev, atomic, hop);

    queue_access_unlock(q);
    queuefree(q);
    return 0;
}
Exemplo n.º 3
0
/* change queue tempo and ppq */
int snd_seq_queue_timer_set_tempo(int queueid, int client, snd_seq_queue_tempo_t *info)
{
	queue_t *q = queueptr(queueid);
	int result;

	if (q == NULL)
		return -EINVAL;
	if (! queue_access_lock(q, client)) {
		queuefree(q);
		return -EPERM;
	}

	result = snd_seq_timer_set_tempo(q->timer, info->tempo);
	if (result >= 0)
		result = snd_seq_timer_set_ppq(q->timer, info->ppq);
	if (result >= 0 && info->skew_base > 0)
		result = snd_seq_timer_set_skew(q->timer, info->skew_value, info->skew_base);
	queue_access_unlock(q);
	queuefree(q);
	return result;
}