Exemplo n.º 1
0
bool tdialog::show(CVideo& video, const unsigned auto_close_time)
{
	if(video.faked() && !show_even_without_video_) {
		if(!allow_plugin_skip_) {
			return false;
		}

		plugins_manager* pm = plugins_manager::get();
		if (pm && pm->any_running())
		{
			plugins_context pc("Dialog");
			pc.set_callback("skip_dialog", [this](config) { retval_ = twindow::OK; }, false);
			pc.set_callback("quit", [](config) {}, false);
			pc.play_slice();
		}

		return false;
	}

	std::unique_ptr<twindow> window(build_window(video));
	assert(window.get());

	post_build(*window);

	window->set_owner(this);

	init_fields(*window);

	pre_show(*window);

	retval_ = window->show(restore_, auto_close_time);

	/*
	 * It can happen that when two clicks follow each other fast that the event
	 * handling code in events.cpp generates a DOUBLE_CLICK_EVENT. For some
	 * reason it can happen that this event gets pushed in the queue when the
	 * window is shown, but processed after the window is closed. This causes
	 * the next window to get this pending event.
	 *
	 * This caused a bug where double clicking in the campaign selection dialog
	 * directly selected a difficulty level and started the campaign. In order
	 * to avoid that problem, filter all pending DOUBLE_CLICK_EVENT events after
	 * the window is closed.
	 */
	SDL_FlushEvent(DOUBLE_CLICK_EVENT);

	finalize_fields(*window, (retval_ == twindow::OK || always_save_fields_));

	post_show(*window);

	// post_show may have updated the windoe retval. Update it here.
	retval_ = window->get_retval();

	return retval_ == twindow::OK;
}
Exemplo n.º 2
0
bool ATKJUCEAudioProcessor::process_slice(ATK::OutCircularPointerFilter<float>& filter, std::vector<double>& windowedData)
{
  bool process = false;
  
  const auto& data = filter.get_last_slice(process);
  if(process)
  {
    if(window.size() != data.size())
    {
      build_window(data.size());
    }
    for(std::size_t i = 0; i < data.size(); ++i)
    {
      windowedData[i] = window[i] * data[i];
    }
  }
  return process;
}
Exemplo n.º 3
0
SIPHON create_siphon (int run, int insize, float* in, int sipsize, int fftsize, int specmode)
{
	SIPHON a = (SIPHON) malloc0 (sizeof (siphon));
	a->run = run;
	a->insize = insize;
	a->in = in;
	a->sipsize = sipsize;	// NOTE:  sipsize MUST BE A POWER OF TWO!!
	a->sipbuff = (float *) malloc0 (a->sipsize * sizeof (complex));
	a->idx = 0;
	a->sipout  = (float *) malloc0 (a->sipsize * sizeof (complex));
	a->fftsize = fftsize;
	a->specout = (float *) malloc0 (a->fftsize * sizeof (complex));
	a->specmode = specmode;
	a->sipplan = fftwf_plan_dft_1d (a->fftsize, (fftwf_complex *)a->sipout, (fftwf_complex *)a->specout, FFTW_FORWARD, FFTW_PATIENT);
	a->window  = (float *) malloc0 (a->fftsize * sizeof (complex));
	InitializeCriticalSectionAndSpinCount(&a->update, 2500);
	build_window (a);
	return a;
}
Exemplo n.º 4
0
void tpopup::show(CVideo& video
		, const bool allow_interaction
		, const unsigned /*auto_close_time*/)
{
	if(video.faked()) {
		return;
	}

	hide();

	window_ = build_window(video);

	post_build(video, *window_);

	pre_show(video, *window_);

	if(allow_interaction) {
		window_->show_non_modal();
	} else {
		window_->show_tooltip(/*auto_close_time*/);
	}
}