Beispiel #1
0
Status_t
vs_event_delete (Event_t * ec)
{
  static const char function[] = "vs_event_delete";
  Implpriv_Event_t *implpriv;

  if (ec == 0)
  {
    IB_LOG_ERROR0 ("handle parameter is null");
    IB_EXIT (function, VSTATUS_ILLPARM);
    return VSTATUS_ILLPARM;
  }

  implpriv = (Implpriv_Event_t *) (void *) & ec->opaque;
  if (implpriv->magic != IMPLPRIV_EVENT_MAGIC)
  {
    IB_LOG_ERRORX ("Invalid magic:", implpriv->magic);
    IB_EXIT (function, VSTATUS_NXIO);
    return VSTATUS_NXIO;
  }

  implpriv->magic = ~IMPLPRIV_EVENT_MAGIC;
  ec->event_handle = 0;

  deleteMask(implpriv->id);
  implpriv->id = 0;

  IB_EXIT (function, VSTATUS_OK);
  return VSTATUS_OK;
}
void filterTracksByCloseTitle(const std::string& title, pfc::list_base_t<metadb_handle_ptr>& tracks)
{
	const t_size n = tracks.get_count();
	bit_array_bittable deleteMask(n);

	for(t_size i = 0; i < n; i++)
	{
		deleteMask.set(i, !doesTrackHaveSimilarTitle(title, tracks[i]));
	}

	tracks.remove_mask(deleteMask);
}
void filterTracksByArtist(const std::string& artist, pfc::list_base_t<metadb_handle_ptr>& tracks)
{
	const t_size n = tracks.get_count();
	bit_array_bittable deleteMask(n);

	for(t_size i = 0; i < n; i++)
	{
		deleteMask.set(i, !isTrackByArtist(artist, tracks[i]));
	}

	tracks.remove_mask(deleteMask);
}
Beispiel #4
0
void vs_evt_cleanMaskList(){
	int id = 0;

	while(1){
    	semTake(maskList_sem, WAIT_FOREVER);
    	if(MaskList_Head != 0){
    		id = MaskList_Head->id;
    	}else{
    		id = -1;
    	}
    	semGive(maskList_sem);

    	if(id > 0){
    		deleteMask(id);
    	}else{
    		break;
    	}
	}
}