Ejemplo n.º 1
0
int PluginVClient::process_buffer(VFrame *frame,
	int64_t start_position,
	double frame_rate)
{
	read_frame(frame, 0, start_position, frame_rate);
	process_realtime(frame, frame);
	return 0;
}
Ejemplo n.º 2
0
int PluginVClient::process_buffer(VFrame **frame,
	int64_t start_position,
	double frame_rate)
{
	for(int i = 0; i < PluginClient::total_in_buffers; i++)
		read_frame(frame[i], i, start_position, frame_rate);
	if(is_multichannel())
		process_realtime(frame, frame);
	return 0;
}
Ejemplo n.º 3
0
int PluginArray::run_plugins()
{
// Length to write after process_loop
	int64_t write_length;

	done = 0;     // for when done
	error = 0;
	if(plugin_server->realtime)
	{
		int64_t len;
		MainProgressBar *progress;
		char string[BCTEXTLEN], string2[BCTEXTLEN];

		sprintf(string, _("%s..."), plugin_server->title);
		progress = mwindow->mainprogress->start_progress(string, end - start);

		for(int current_position = start; 
			current_position < end && !done && !error;
			current_position += len)
		{
			len = buffer_size;
			if(current_position + len > end) len = end - current_position;

// Process in plugin.  This pulls data from the modules
			get_buffers();
			for(int i = 0; i < total; i++)
			{
				process_realtime(i, current_position, len);
			}

// Write to file
			error = write_buffers(len);
			done = progress->update(current_position - start + len);
		}

		progress->get_time(string2);
		progress->stop_progress();
		delete progress;

		sprintf(string, _("%s took %s"), plugin_server->title, string2);
		mwindow->gui->lock_window();
		mwindow->gui->show_message(string2);
		mwindow->gui->unlock_window();
	}
	else
	{
// Run main loop once for multichannel plugins.
// Run multiple times for single channel plugins.
// Each write to the file must contain all the channels
		while(!done && !error)
		{
			for(int i = 0; i < total; i++)
			{
				write_length = 0;
				done += process_loop(i, write_length);
			}


			if(write_length)
				error = write_buffers(write_length);
		}
	}

	return error;
}