示例#1
0
static void
_fluid_seq_queue_end(fluid_sequencer_t* seq)
{
	int i;

	/* free all remaining events */
	_fluid_free_evt_queue(&seq->preQueue, &seq->preQueueLast);
	for (i = 0; i < 256; i++) 
		_fluid_free_evt_queue(&(seq->queue0[i][0]), &(seq->queue0[i][1]));
	for (i = 0; i < 255; i++) 
		_fluid_free_evt_queue(&(seq->queue1[i][0]), &(seq->queue1[i][1]));
	_fluid_free_evt_queue(&seq->queueLater, NULL);


	if (seq->timer) {
		delete_fluid_timer(seq->timer);
		seq->timer = NULL;
	}

	if (seq->heap) {
		_fluid_evt_heap_free(seq->heap);
		seq->heap = NULL;
	}

	fluid_mutex_destroy(seq->mutex);
}
示例#2
0
void
_fluid_evt_heap_free(fluid_evt_heap_t* heap)
{
#ifdef HEAP_WITH_DYNALLOC
  fluid_evt_entry *tmp, *next;

  /* LOCK */
  fluid_mutex_lock(heap->mutex);

  tmp = heap->freelist;
  while (tmp) {
    next = tmp->next;
    FLUID_FREE(tmp);
    tmp = next;
  }

  /* UNLOCK */
  fluid_mutex_unlock(heap->mutex);
  fluid_mutex_destroy(heap->mutex);

  FLUID_FREE(heap);

#else
	FLUID_FREE(heap);
#endif
}
示例#3
0
/**
 * Delete a MIDI router instance.
 * @param router MIDI router to delete
 * @return Returns #FLUID_OK on success, #FLUID_FAILED otherwise (only if NULL
 *   \a router passed really)
 */
void
delete_fluid_midi_router (fluid_midi_router_t *router)
{
  fluid_midi_router_rule_t *rule;
  fluid_midi_router_rule_t *next_rule;
  int i;

  fluid_return_if_fail (router != NULL);

  for (i = 0; i < FLUID_MIDI_ROUTER_RULE_COUNT; i++)
  {
    for (rule = router->rules[i]; rule; rule = next_rule)
    {
      next_rule = rule->next;
      FLUID_FREE (rule);
    }
  }

  fluid_mutex_destroy (router->rules_mutex);
  FLUID_FREE (router);
}