예제 #1
0
int MYWAVE::poll()
{
    AGS::Engine::MutexLock _lock(_mutex);

    if (!done && _destroyThis)
    {
        internal_destroy();
        _destroyThis = false;
    }

    if (wave == NULL)
    {
        return 1;
    }
    if (paused)
    {
        return 0;
    }

    if (firstTime) {
        // need to wait until here so that we have been assigned a channel
        //sample_update_callback(wave, voice);
        firstTime = 0;
    }

    if (voice_get_position(voice) < 0)
    {
        done = 1;
        if (psp_audio_multithreaded)
            internal_destroy();
    }

    return done;
}
예제 #2
0
int MYOGG::poll()
{
    _mutex.Lock();

    if (!done && _destroyThis)
    {
      internal_destroy();
      _destroyThis = false;
    }

    if (done)
    {
        _mutex.Unlock();
        return done;
    }
    if (paused)
    {
        _mutex.Unlock();
        return 0;
    }

    if ((!done) && (in->todo > 0))
    {
        // update the buffer
        char *tempbuf = (char *)alogg_get_oggstream_buffer(stream);
        if (tempbuf != NULL)
        {
            int free_val = -1;
            if (chunksize > in->todo)
            {
                chunksize = in->todo;
                free_val = chunksize;
            }
            pack_fread(tempbuf, chunksize, in);
            alogg_free_oggstream_buffer(stream, free_val);
        }
    }
    if (alogg_poll_oggstream(stream) == ALOGG_POLL_PLAYJUSTFINISHED) {
        done = 1;
        if (psp_audio_multithreaded)
            internal_destroy();
    }
    else get_pos_ms();  // call this to keep the last_but_one stuff up to date

    _mutex.Unlock();

    return done;
}
/**
 * A function to destroy a load balancer.
 * @param[in] api The deltacloud_api structure representing the connection
 * @param[in] balancer The deltacloud_loadbalancer structure representing the
 *                     load balancer
 * @returns 0 on success, -1 on error
 */
int deltacloud_loadbalancer_destroy(struct deltacloud_api *api,
				    struct deltacloud_loadbalancer *balancer)
{
  if (!valid_api(api) || !valid_arg(balancer))
    return -1;

  return internal_destroy(balancer->href, api->user, api->password, api->driver, api->provider);
}
/**
 * A function to destroy a storage snapshot.
 * @param[in] api The deltacloud_api structure representing the connection
 * @param[in] storage_snapshot The deltacloud_storage_snapstho structure
 *                             representing the storage snapshot
 * @returns 0 on success, -1 on error
 */
int deltacloud_storage_snapshot_destroy(struct deltacloud_api *api,
					struct deltacloud_storage_snapshot *storage_snapshot)
{
  if (!valid_api(api) || !valid_arg(storage_snapshot))
    return -1;

  return internal_destroy(storage_snapshot->href, api->user, api->password, api->driver, api->provider);
}
예제 #5
0
void MYWAVE::destroy()
{
    AGS::Engine::MutexLock _lock(_mutex);

    if (psp_audio_multithreaded && _playing && !_audio_doing_crossfade)
        _destroyThis = true;
    else
        internal_destroy();

    _lock.Release();

    while (!done)
        AGSPlatformDriver::GetDriver()->YieldCPU();
}
예제 #6
0
void MYOGG::destroy()
{
    _mutex.Lock();

    if (psp_audio_multithreaded && _playing)
      _destroyThis = true;
    else
      internal_destroy();

    _mutex.Unlock();

    while (!done)
      AGSPlatformDriver::GetDriver()->YieldCPU();
}
예제 #7
0
int MYSTATICOGG::poll()
{
	AGS::Engine::MutexLock _lock(_mutex);

    if (tune && !done && _destroyThis)
    {
      internal_destroy();
      _destroyThis = false;
    }

    if ((tune == NULL) || (!ready))
        ; // Do nothing
    else if (alogg_poll_ogg(tune) == ALOGG_POLL_PLAYJUSTFINISHED) {
        if (!repeat)
        {
            done = 1;
            if (psp_audio_multithreaded)
                internal_destroy();
        }
    }
    else get_pos();  // call this to keep the last_but_one stuff up to date

    return done;
}
예제 #8
0
void
isc_interfaceiter_destroy(isc_interfaceiter_t **iterp)
{
	isc_interfaceiter_t *iter;
	REQUIRE(iterp != NULL);
	iter = *iterp;
	REQUIRE(VALID_IFITER(iter));

	internal_destroy(iter);
	if (iter->buf != NULL)
		isc_mem_put(iter->mctx, iter->buf, iter->bufsize);

	iter->magic = 0;
	isc_mem_put(iter->mctx, iter, sizeof(*iter));
	*iterp = NULL;
}
예제 #9
0
void MYSTATICOGG::destroy()
{
	AGS::Engine::MutexLock _lock(_mutex);

    if (psp_audio_multithreaded && _playing && !_audio_doing_crossfade)
      _destroyThis = true;
    else
      internal_destroy();

	_lock.Release();

    while (!done)
      AGSPlatformDriver::GetDriver()->YieldCPU();

    // Allow the last poll cycle to finish.
	_lock.Acquire(_mutex);
}
예제 #10
0
 virtual void destroy() {
   internal_destroy();
   FirstValid = NULL;
   LastValid = NULL;
   }