• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FLUID_FREE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FLUID_FREE函数的典型用法代码示例。如果您正苦于以下问题:C++ FLUID_FREE函数的具体用法?C++ FLUID_FREE怎么用?C++ FLUID_FREE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FLUID_FREE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: delete_fluid_sequencer

/**
 * Free a sequencer object.
 * @param seq Sequencer to delete
 */
void
delete_fluid_sequencer (fluid_sequencer_t* seq)
{

	if (seq == NULL) {
		return;
	}

	/* cleanup clients */
	while (seq->clients) {
		fluid_sequencer_client_t *client = (fluid_sequencer_client_t*)seq->clients->data;
		fluid_sequencer_unregister_client(seq, client->id);
	}

	_fluid_seq_queue_end(seq);

/*	if (seq->clients) {
		fluid_list_t *tmp = seq->clients;
		while (tmp != NULL) {
			fluid_sequencer_client_t *client = (fluid_sequencer_client_t*)tmp->data;
			if (client->name) FLUID_FREE(client->name);
			tmp = tmp->next;
		}
		delete_fluid_list(seq->clients);
		seq->clients = NULL;
	}*/

#if FLUID_SEQ_WITH_TRACE
	if (seq->tracebuf != NULL)
		FLUID_FREE(seq->tracebuf);
	seq->tracebuf = NULL;
#endif

	FLUID_FREE(seq);
}
开发者ID:libretro,项目名称:libretro-prboom,代码行数:39,代码来源:fluid_seq.c


示例2: _fluid_evt_heap_free

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
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:26,代码来源:fluid_event.c


示例3: new_fluid_midi_file

/**
 * Open a MIDI file and return a new MIDI file handle.
 * @internal
 * @param filename Path of file to open.
 * @return New MIDI file handle or NULL on error.
 */
fluid_midi_file* new_fluid_midi_file(char* filename)
{
	fluid_midi_file* mf;

	mf = FLUID_NEW(fluid_midi_file);
	if (mf == NULL) {
		FLUID_LOG(FLUID_ERR, "Out of memory");
		return NULL;
	}
	FLUID_MEMSET(mf, 0, sizeof(fluid_midi_file));

	mf->c = -1;
	mf->running_status = -1;
	mf->fp = FLUID_FOPEN(filename, "rb");

	if (mf->fp == NULL) {
		FLUID_LOG(FLUID_ERR, "Couldn't open the MIDI file");
		FLUID_FREE(mf);
		return NULL;
	}

	if (fluid_midi_file_read_mthd(mf) != FLUID_OK) {
		FLUID_FREE(mf);
		return NULL;
	}
	return mf;
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:33,代码来源:fluid_midi.c


示例4: delete_fluid_dsound_audio_driver

void delete_fluid_dsound_audio_driver(fluid_audio_driver_t* d)
{
  fluid_dsound_audio_driver_t* dev = (fluid_dsound_audio_driver_t*) d;
  fluid_return_if_fail(dev != NULL);

  /* tell the audio thread to stop its loop */
  dev->cont = 0;

  /* wait till the audio thread exits */
  if (dev->thread != 0) {
    if (WaitForSingleObject(dev->thread, 2000) != WAIT_OBJECT_0) {
      /* on error kill the thread mercilessly */
      FLUID_LOG(FLUID_DBG, "Couldn't join the audio thread. killing it.");
      TerminateThread(dev->thread, 0);
    }
  }

  /* release all the allocated ressources */

    FLUID_FREE(dev->format);

  if (dev->sec_buffer != NULL) {
    IDirectSoundBuffer_Stop(dev->sec_buffer);
    IDirectSoundBuffer_Release(dev->sec_buffer);
  }
  if (dev->prim_buffer != NULL) {
    IDirectSoundBuffer_Release(dev->prim_buffer);
  }
  if (dev->direct_sound != NULL) {
    IDirectSound_Release(dev->direct_sound);
  }

  FLUID_FREE(dev);
}
开发者ID:nezticle,项目名称:fluidsynth,代码行数:34,代码来源:fluid_dsound.c


示例5: delete_fluid_portaudio_driver

/*
 * delete_fluid_portaudio_driver
 */
int
delete_fluid_portaudio_driver(fluid_audio_driver_t *p)
{
  fluid_portaudio_driver_t* dev;
  PaError err;

  dev = (fluid_portaudio_driver_t*)p;
  if (dev == NULL) return FLUID_OK;

  /* PortAudio section */
  if (dev->stream) Pa_CloseStream (dev->stream);

  err = Pa_Terminate();

  if (err != paNoError)
    printf ("PortAudio termination error: %s\n", Pa_GetErrorText (err) );

  if (dev->buffers[0]) {
    FLUID_FREE(dev->buffers[0]);
  }
  if (dev->buffers[1]) {
    FLUID_FREE(dev->buffers[1]);
  }

  FLUID_FREE (dev);
  return FLUID_OK;
}
开发者ID:antoineschmitt,项目名称:fluidXtra,代码行数:30,代码来源:fluid_portaudio.c


示例6: delete_fluid_player

/**
 * Delete a MIDI player instance.
 * @param player MIDI player instance
 * @return Always returns #FLUID_OK
 */
int
delete_fluid_player(fluid_player_t *player)
{
    fluid_list_t *q;
    fluid_playlist_item* pi;

    if (player == NULL) {
        return FLUID_OK;
    }
    fluid_player_stop(player);
    fluid_player_reset(player);

    while (player->playlist != NULL) {
        q = player->playlist->next;
        pi = (fluid_playlist_item*) player->playlist->data;
        FLUID_FREE(pi->filename);
        FLUID_FREE(pi->buffer);
        FLUID_FREE(pi);
        delete1_fluid_list(player->playlist);
        player->playlist = q;
    }

    FLUID_FREE(player);
    return FLUID_OK;
}
开发者ID:midifi,项目名称:fluidsynth,代码行数:30,代码来源:fluid_midi.c


示例7: delete_samplecache_entry

static void delete_samplecache_entry(fluid_samplecache_entry_t *entry)
{
    fluid_return_if_fail(entry != NULL);

    FLUID_FREE(entry->filename);
    FLUID_FREE(entry->sample_data);
    FLUID_FREE(entry->sample_data24);
    FLUID_FREE(entry);
}
开发者ID:tecan,项目名称:LunaLibs,代码行数:9,代码来源:fluid_samplecache.c


示例8: delete_fluid_tuning

void delete_fluid_tuning(fluid_tuning_t* tuning)
{
  if (tuning == NULL) {
    return;
  }
  if (tuning->name != NULL) {
    FLUID_FREE(tuning->name);
  }
  FLUID_FREE(tuning);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:10,代码来源:fluid_tuning.c


示例9: delete_fluid_track

/*
 * delete_fluid_track
 */
int delete_fluid_track(fluid_track_t* track)
{
	if (track->name != NULL) {
		FLUID_FREE(track->name);
	}
	if (track->first != NULL) {
		delete_fluid_midi_event(track->first);
	}
	FLUID_FREE(track);
	return FLUID_OK;
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:14,代码来源:fluid_midi.c


示例10: fluid_hashtable_unref

/**
 * fluid_hashtable_unref:
 * @hashtable: a valid #fluid_hashtable_t.
 *
 * Atomically decrements the reference count of @hashtable by one.
 * If the reference count drops to 0, all keys and values will be
 * destroyed, and all memory allocated by the hash table is released.
 * This function is MT-safe and may be called from any thread.
 *
 * Since: 2.10
 **/
void
fluid_hashtable_unref (fluid_hashtable_t *hashtable)
{
  fluid_return_if_fail (hashtable != NULL);
  fluid_return_if_fail (hashtable->ref_count > 0);

  if (fluid_atomic_int_exchange_and_add (&hashtable->ref_count, -1) - 1 == 0)
    {
      fluid_hashtable_remove_all_nodes (hashtable, TRUE);
      FLUID_FREE (hashtable->nodes);
      FLUID_FREE (hashtable);
    }
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:24,代码来源:fluid_hash.c


示例11: delete_fluid_midishare_midi_driver

/*
 * delete_fluid_midishare_midi_driver
 */
int delete_fluid_midishare_midi_driver(fluid_midi_driver_t* p)
{
    fluid_midishare_midi_driver_t* dev;

    dev = (fluid_midishare_midi_driver_t*) p;
    if (dev == NULL) {
        return FLUID_OK;
    }

    if (dev->filter) MidiFreeFilter(dev->filter);

#if defined(MIDISHARE_DRIVER)
    fluid_midishare_close_driver(dev);
#else
    fluid_midishare_close_appl(dev);
#endif

#if defined(MACINTOSH) && defined(MACOS9)
    DisposeRoutineDescriptor(dev->upp_alarm_ptr);
    DisposeRoutineDescriptor(dev->upp_wakeup_ptr);
    DisposeRoutineDescriptor(dev->upp_sleep_ptr);
    DisposeRoutineDescriptor(dev->upp_task_ptr);
#endif

    dev->status = FLUID_MIDI_DONE;

    FLUID_FREE(dev);
    return FLUID_OK;
}
开发者ID:kirbyfan64,项目名称:fluidsynth,代码行数:32,代码来源:fluid_midishare.c


示例12: fluid_settings_remove_option

/**
 * Remove an option previously assigned by fluid_settings_add_option().
 * @param settings a settings object
 * @param name a setting's name
 * @param s option string to remove
 * @return 1 if the setting exists and option was removed, 0 otherwise
 */
int
fluid_settings_remove_option(fluid_settings_t* settings, const char *name, const char* s)
{
  fluid_setting_node_t *node;
  int retval = 0;

  fluid_return_val_if_fail (settings != NULL, 0);
  fluid_return_val_if_fail (name != NULL, 0);
  fluid_return_val_if_fail (s != NULL, 0);

  fluid_rec_mutex_lock (settings->mutex);

  if (fluid_settings_get(settings, name, &node)
      && (node->type == FLUID_STR_TYPE)) {

    fluid_str_setting_t* setting = (fluid_str_setting_t*) node;
    fluid_list_t* list = setting->options;

    while (list) {
      char* option = (char*) fluid_list_get(list);
      if (FLUID_STRCMP(s, option) == 0) {
	FLUID_FREE (option);
	setting->options = fluid_list_remove_link(setting->options, list);
	retval = 1;
        break;
      }
      list = fluid_list_next(list);
    }
  }

  fluid_rec_mutex_unlock (settings->mutex);

  return retval;
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:41,代码来源:fluid_settings.c


示例13: delete_fluid_dart_audio_driver

int delete_fluid_dart_audio_driver(fluid_audio_driver_t* p)
{
    fluid_dart_audio_driver_t* dev = (fluid_dart_audio_driver_t*) p;

    if (dev == NULL) {
        return FLUID_OK;
    }

    if (dev->usDeviceID != 0) {
        MCI_GENERIC_PARMS    GenericParms;

        /* Send message to stop the audio device
         */
        m_pfnmciSendCommand(dev->usDeviceID, MCI_STOP, MCI_WAIT,
                            (PVOID)&GenericParms, 0);

        /* Deallocate device buffers
         */
        m_pfnmciSendCommand(dev->usDeviceID, MCI_BUFFER,
                            MCI_WAIT | MCI_DEALLOCATE_MEMORY,
                            (PVOID)&dev->BufferParms, 0);

        /* Close device the mixer device
         */
        m_pfnmciSendCommand(dev->usDeviceID, MCI_CLOSE, MCI_WAIT,
                            (PVOID)&GenericParms, 0);
    }

    FLUID_FREE(dev);
    return FLUID_OK;
}
开发者ID:OS2World,项目名称:MM-UTIL-fluidsynth,代码行数:31,代码来源:fluid_dart.c


示例14: new_fluid_timer

fluid_timer_t*
new_fluid_timer (int msec, fluid_timer_callback_t callback, void* data,
                 int new_thread, int auto_destroy, int high_priority)
{
  fluid_timer_t *timer;

  timer = FLUID_NEW (fluid_timer_t);

  if (timer == NULL)
  {
    FLUID_LOG (FLUID_ERR, "Out of memory");
    return NULL;
  }

  timer->msec = msec;
  timer->callback = callback;
  timer->data = data;
  timer->cont = TRUE ;
  timer->thread = NULL;
  timer->auto_destroy = auto_destroy;

  if (new_thread)
  {
    timer->thread = new_fluid_thread ("timer", fluid_timer_run, timer, high_priority
                                      ? FLUID_SYS_TIMER_HIGH_PRIO_LEVEL : 0, FALSE);
    if (!timer->thread)
    {
      FLUID_FREE (timer);
      return NULL;
    }
  }
  else fluid_timer_run (timer);  /* Run directly, instead of as a separate thread */

  return timer;
}
开发者ID:paulsapps,项目名称:fluidsynth,代码行数:35,代码来源:fluid_sys.c


示例15: fluid_timer_run

void
fluid_timer_run (void *data)
{
  fluid_timer_t *timer;
  int count = 0;
  int cont;
  long start;
  long delay;

  timer = (fluid_timer_t *)data;

  /* keep track of the start time for absolute positioning */
  start = fluid_curtime ();

  while (timer->cont)
  {
    cont = (*timer->callback)(timer->data, fluid_curtime() - start);

    count++;
    if (!cont) break;

    /* to avoid incremental time errors, calculate the delay between
       two callbacks bringing in the "absolute" time (count *
       timer->msec) */
    delay = (count * timer->msec) - (fluid_curtime() - start);
    if (delay > 0) fluid_usleep (delay * 1000);
  }

  FLUID_LOG (FLUID_DBG, "Timer thread finished");

  if (timer->auto_destroy)
    FLUID_FREE (timer);

  return;
}
开发者ID:paulsapps,项目名称:fluidsynth,代码行数:35,代码来源:fluid_sys.c


示例16: fluid_settings_foreach

/**
 * Iterate the existing settings defined in a settings object, calling the
 * provided callback function for each setting.
 *
 * @param settings a settings object
 * @param data any user provided pointer
 * @param func callback function to be called on each iteration
 *
 * NOTE: Starting with FluidSynth 1.1.0 the \a func callback is called for each
 * setting in alphabetical order.  Sort order was undefined in previous versions.
 */
void
fluid_settings_foreach (fluid_settings_t* settings, void* data,
                        fluid_settings_foreach_t func)
{
  fluid_settings_foreach_bag_t bag;
  fluid_setting_node_t *node;
  fluid_list_t *p;
  int r;

  fluid_return_if_fail (settings != NULL);
  fluid_return_if_fail (func != NULL);

  bag.path[0] = 0;
  bag.names = NULL;

  fluid_rec_mutex_lock (settings->mutex);

  /* Add all node names to the bag.names list */
  fluid_hashtable_foreach (settings, fluid_settings_foreach_iter, &bag);

  /* Sort names */
  bag.names = fluid_list_sort (bag.names, fluid_list_str_compare_func);

  /* Loop over names and call the callback */
  for (p = bag.names; p; p = p->next)
  {
    r = fluid_settings_get (settings, (char *)(p->data), &node);
    if (r && node) (*func) (data, (char *)(p->data), node->type);
    FLUID_FREE (p->data);       /* -- Free name */
  }

  fluid_rec_mutex_unlock (settings->mutex);

  delete_fluid_list (bag.names);        /* -- Free names list */
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:46,代码来源:fluid_settings.c


示例17: new_fluid_set_setting

static fluid_set_setting_t*
new_fluid_set_setting(void)
{
  fluid_set_setting_t* setting;

  setting = FLUID_NEW(fluid_set_setting_t);

  if (!setting)
  {
    FLUID_LOG(FLUID_ERR, "Out of memory");
    return NULL;
  }

  setting->node.type = FLUID_SET_TYPE;
  setting->hashtable = new_fluid_hashtable_full(fluid_str_hash, fluid_str_equal,
                                                fluid_settings_key_destroy_func,
                                                fluid_settings_value_destroy_func);
  if (!setting->hashtable)
  {
    FLUID_FREE (setting);
    return NULL;
  }

  return setting;
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:25,代码来源:fluid_settings.c


示例18: delete_fluid_channel

/*
 * delete_fluid_channel
 */
int
delete_fluid_channel(fluid_channel_t* chan)
{
  if (chan->preset) delete_fluid_preset (chan->preset);
  FLUID_FREE(chan);
  return FLUID_OK;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:10,代码来源:fluid_chan.c


示例19: fluid_settings_set

/**
 * Set a setting name, value and type, replacing it if already exists
 *
 * @param settings a settings object
 * @param name Settings name
 * @param value Node instance to assign (used directly)
 * @return 1 if the value has been set, zero otherwise
 */
static int
fluid_settings_set(fluid_settings_t* settings, const char *name, void* value)
{
  fluid_hashtable_t* table = settings;
  fluid_setting_node_t *node;
  char* tokens[MAX_SETTINGS_TOKENS];
  char buf[MAX_SETTINGS_LABEL+1];
  int n, num;
  char *dupname;

  num = fluid_settings_tokenize (name, buf, tokens) - 1;

  for (n = 0; n < num; n++) {

    node = fluid_hashtable_lookup(table, tokens[n]);

    if (node) {

      if (node->type == FLUID_SET_TYPE) {
	table = ((fluid_set_setting_t *)node)->hashtable;
      } else {
	/* path ends prematurely */
	FLUID_LOG(FLUID_WARN, "'%s' is not a node", name[n]);
	return 0;
      }

    } else {
      /* create a new node */
      fluid_set_setting_t* setnode;

      dupname = FLUID_STRDUP (tokens[n]);
      setnode = new_fluid_set_setting ();

      if (!dupname || !setnode)
      {
        if (dupname) FLUID_FREE (dupname);
        else FLUID_LOG(FLUID_ERR, "Out of memory");

        if (setnode) delete_fluid_set_setting (setnode);

        return 0;
      }

      fluid_hashtable_insert(table, dupname, setnode);
      table = setnode->hashtable;
    }
  }

  dupname = FLUID_STRDUP (tokens[num]);

  if (!dupname)
  {
    FLUID_LOG(FLUID_ERR, "Out of memory");
    return 0;
  }

  fluid_hashtable_insert(table, dupname, value);

  return 1;
}
开发者ID:caomw,项目名称:fluidsynth,代码行数:68,代码来源:fluid_settings.c


示例20: delete_fluid_sndio_midi_driver

void
delete_fluid_sndio_midi_driver(fluid_midi_driver_t *addr)
{
  int err;
  fluid_sndio_midi_driver_t *dev = (fluid_sndio_midi_driver_t *)addr;

  if (dev == NULL) {
    return;
  }
  dev->status = FLUID_MIDI_DONE;

  /* cancel the thread and wait for it before cleaning up */
  if (dev->thread) {
    err = pthread_cancel(dev->thread);
    if (err) {
      FLUID_LOG(FLUID_ERR, "Failed to cancel the midi thread");
      return;
    }
    if (pthread_join(dev->thread, NULL)) {
      FLUID_LOG(FLUID_ERR, "Failed to join the midi thread");
      return;
    }
  }
  if (dev->hdl != NULL) {
    mio_close(dev->hdl);
  }
  if (dev->parser != NULL) {
    delete_fluid_midi_parser(dev->parser);
  }
  FLUID_FREE(dev);
  return;
}
开发者ID:Crest,项目名称:freebsd-ports,代码行数:32,代码来源:fluid_sndio.c



注:本文中的FLUID_FREE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FLUID_LOG函数代码示例发布时间:2022-05-30
下一篇:
C++ FLOW_DESTROY函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap