Example #1
0
int Commercials::
read_ads(const char *filename)
{
	char index_filename[BCTEXTLEN], source_filename[BCTEXTLEN];
	IndexFile::get_index_filename(source_filename,
		mwindow->preferences->index_directory, index_filename,
		filename, ".ads");
	tracks.remove_all_objects();
	FileXML xml;
	if( xml.read_from_file(index_filename, 1) ) return 1;

	do {
		if( xml.read_tag() ) return 1;
	} while( !xml.tag.title_is("ADS") );

	for(;;) {
		if( xml.read_tag() ) return 1;
		if( xml.tag.title_is("/ADS") ) break;
		if( xml.tag.title_is("CLIPS") ) {
			int pid = xml.tag.get_property("PID", (int)0);
			Clips *clips = new Clips(pid);
			tracks.append(clips);
			if( clips->load(xml) ) return 1;
			if( !xml.tag.title_is("/CLIPS") ) break;
		}
	}

	return 0;
}
Example #2
0
void PluginAClientLAD::read_data(KeyFrame *keyframe)
{
	FileXML input;
	char string[BCTEXTLEN];

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
	config.initialize(server);

	while(! input.read_tag() ) {
//printf("PluginAClientLAD::read_data %s\n", input.tag.get_title());
		if(! input.tag.title_is(lad_to_upper(string, plugin_title())) ) continue;
		const LADSPA_Descriptor *lad_desc = server->lad_descriptor;
		const LADSPA_PortDescriptor *port_desc = lad_desc->PortDescriptors;
		int port_count = lad_desc->PortCount;
		for(int port = 0, i = 0; i < port_count; i++) {
			if( !LADSPA_IS_PORT_INPUT(port_desc[i]) ) continue;
			if( !LADSPA_IS_PORT_CONTROL(port_desc[i]) ) continue;
			PluginAClientLAD::lad_to_upper(string, (char*)lad_desc->PortNames[i]);
			config.port_data[port] = 
				input.tag.get_property(string, config.port_data[port]);
//printf("PluginAClientLAD::read_data %d %f\n", port, config.port_data[port]);
			port++;
		}
	}
}
void FreezeFrameMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;
	config.enabled = 0;
	config.line_double = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("ENABLED"))
			{
				config.enabled = 1;
			}
			if(input.tag.title_is("LINE_DOUBLE"))
			{
				config.line_double = 1;
			}
		}
	}
}
Example #4
0
void SvgMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("SVG"))
			{
 				config.in_x = input.tag.get_property("IN_X", config.in_x);
				config.in_y = input.tag.get_property("IN_Y", config.in_y);
				config.in_w = input.tag.get_property("IN_W", config.in_w);
				config.in_h = input.tag.get_property("IN_H", config.in_h);
				config.out_x =	input.tag.get_property("OUT_X", config.out_x);
				config.out_y =	input.tag.get_property("OUT_Y", config.out_y);
				config.out_w =	input.tag.get_property("OUT_W", config.out_w);
				config.out_h =	input.tag.get_property("OUT_H", config.out_h);
				input.tag.get_property("SVG_FILE", config.svg_file);
			}
		}
	}
}
Example #5
0
void IVTCMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;
	float new_threshold;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("IVTC"))
			{
				config.frame_offset = input.tag.get_property("FRAME_OFFSET", config.frame_offset);
				config.first_field = input.tag.get_property("FIRST_FIELD", config.first_field);
				config.automatic = input.tag.get_property("AUTOMATIC", config.automatic);
				new_threshold = input.tag.get_property("AUTO_THRESHOLD", config.auto_threshold);
				config.pattern = input.tag.get_property("PATTERN", config.pattern);
			}
		}
	}
}
Example #6
0
void BlurMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("BLUR"))
			{
				config.vertical = input.tag.get_property("VERTICAL", config.vertical);
				config.horizontal = input.tag.get_property("HORIZONTAL", config.horizontal);
				config.radius = input.tag.get_property("RADIUS", config.radius);
//printf("BlurMain::read_data 1 %d %d %s\n", get_source_position(), keyframe->position, keyframe->get_data());
				config.r = input.tag.get_property("R", config.r);
				config.g = input.tag.get_property("G", config.g);
				config.b = input.tag.get_property("B", config.b);
				config.a = input.tag.get_property("A", config.a);
				config.a_key = input.tag.get_property("A_KEY", config.a_key);
			}
		}
	}
}
Example #7
0
void ParametricEQ::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;
	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("PARAMETRICEQ"))
			{
				config.wetness = input.tag.get_property("WETNESS", config.wetness);
				config.window_size = input.tag.get_property("WINDOW_SIZE", config.window_size);
			}
			else
			if(input.tag.title_is("BAND"))
			{
				int band = input.tag.get_property("NUMBER", 0);
				config.band[band].freq = input.tag.get_property("FREQ", config.band[band].freq);
				config.band[band].quality = input.tag.get_property("QUALITY", config.band[band].quality);
				config.band[band].magnitude = input.tag.get_property("MAGNITUDE", config.band[band].magnitude);
				config.band[band].mode = input.tag.get_property("MODE", config.band[band].mode);
			}
		}
	}
}
Example #8
0
void FlipMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->data, strlen(keyframe->data));

	int result = 0;
	config.flip_vertical = config.flip_horizontal = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("VERTICAL"))
			{
				config.flip_vertical = 1;
			}
			else
			if(input.tag.title_is("HORIZONTAL"))
			{
				config.flip_horizontal = 1;
			}
		}
	}
}
Example #9
0
void RGB601Main::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("RGB601"))
			{
				config.direction = input.tag.get_property("DIRECTION", config.direction);
			}
		}
	}

	if(thread) 
	{
		((RGB601Window*)thread->window)->update();
	}
}
void SelTempAvgMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!input.read_tag())
	{
		if(input.tag.title_is("SELECTIVE_TEMPORAL_AVERAGE"))
		{
			config.frames = input.tag.get_property("FRAMES", config.frames);
			config.method = input.tag.get_property("METHOD", config.method);
			config.offsetmode = input.tag.get_property("OFFSETMODE", config.offsetmode);
			config.paranoid = input.tag.get_property("PARANOID", config.paranoid);
			config.nosubtract = input.tag.get_property("NOSUBTRACT", config.nosubtract);
			config.offset_restartmarker_keyframe = input.tag.get_property("OFFSETMODE_RESTARTMODE_KEYFRAME", config.offset_restartmarker_keyframe);
			config.offset_fixed_value = input.tag.get_property("OFFSETMODE_FIXED_VALUE", config.offset_fixed_value);
			config.gain = input.tag.get_property("gain", config.gain);

			config.avg_threshold_RY = input.tag.get_property("AVG_THRESHOLD_RY", config.avg_threshold_RY); 
			config.avg_threshold_GU = input.tag.get_property("AVG_THRESHOLD_GU", config.avg_threshold_GU); 
			config.avg_threshold_BV = input.tag.get_property("AVG_THRESHOLD_BV", config.avg_threshold_BV); 
			config.std_threshold_RY = input.tag.get_property("STD_THRESHOLD_RY", config.std_threshold_RY); 
			config.std_threshold_GU = input.tag.get_property("STD_THRESHOLD_GU", config.std_threshold_GU); 
			config.std_threshold_BV = input.tag.get_property("STD_THRESHOLD_BV", config.std_threshold_BV);

			config.mask_RY = input.tag.get_property("MASK_RY", config.mask_RY); 
			config.mask_GU = input.tag.get_property("MASK_GU", config.mask_GU); 
			config.mask_BV = input.tag.get_property("MASK_BV", config.mask_BV);

		}
	}
}
Example #11
0
void ColorBalanceMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("COLORBALANCE"))
			{
				config.cyan = input.tag.get_property("CYAN", config.cyan);
				config.magenta = input.tag.get_property("MAGENTA", config.magenta);
				config.yellow = input.tag.get_property("YELLOW", config.yellow);
				config.preserve = input.tag.get_property("PRESERVELUMINOSITY", config.preserve);
				config.lock_params = input.tag.get_property("LOCKPARAMS", config.lock_params);
			}
		}
	}
}
Example #12
0
void TranslateMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("TRANSLATE"))
			{
 				config.in_x = input.tag.get_property("IN_X", config.in_x);
				config.in_y = input.tag.get_property("IN_Y", config.in_y);
				config.in_w = input.tag.get_property("IN_W", config.in_w);
				config.in_h = input.tag.get_property("IN_H", config.in_h);
				config.out_x =	input.tag.get_property("OUT_X", config.out_x);
				config.out_y =	input.tag.get_property("OUT_Y", config.out_y);
				config.out_w =	input.tag.get_property("OUT_W", config.out_w);
				config.out_h =	input.tag.get_property("OUT_H", config.out_h);
			}
		}
	}
}
void CompressorEffect::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;
	config.levels.remove_all();
	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("COMPRESSOR"))
			{
				config.reaction_len = input.tag.get_property("REACTION_LEN", config.reaction_len);
				config.decay_len = input.tag.get_property("DECAY_LEN", config.decay_len);
				config.trigger = input.tag.get_property("TRIGGER", config.trigger);
				config.smoothing_only = input.tag.get_property("SMOOTHING_ONLY", config.smoothing_only);
				config.input = input.tag.get_property("INPUT", config.input);
			}
			else
			if(input.tag.title_is("LEVEL"))
			{
				double x = input.tag.get_property("X", (double)0);
				double y = input.tag.get_property("Y", (double)0);
				compressor_point_t point = { x, y };

				config.levels.append(point);
			}
		}
	}
}
Example #14
0
void LensMain::read_data(KeyFrame *keyframe)
{
	FileXML input;
	char string[BCTEXTLEN];


	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("LENS"))
			{
				for(int i = 0; i < FOV_CHANNELS; i++)
				{
					sprintf(string, "FOCAL_LENGTH%d", i);
					config.fov[i] = input.tag.get_property(string, config.fov[i]);
				}
				config.aspect = input.tag.get_property("ASPECT", config.aspect);
				config.radius = input.tag.get_property("RADIUS", config.radius);
				config.mode = input.tag.get_property("MODE", config.mode);
				config.center_x = input.tag.get_property("CENTER_X", config.center_x);
				config.center_y = input.tag.get_property("CENTER_Y", config.center_y);
				config.draw_guides = input.tag.get_property("DRAW_GUIDES", config.draw_guides);
			}
		}
	}
}
Example #15
0
void Synth::read_data(KeyFrame *keyframe)
{
	FileXML input;
	char string[BCTEXTLEN];
// cause htal file to read directly from text
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

//printf("Synth::read_data %s\n", keyframe->get_data());
	int result = 0, current_osc = 0;
	//int total_oscillators = 0;
	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("SYNTH"))
			{
				config.wetness = input.tag.get_property("WETNESS", config.wetness);
				
				if(is_defaults())
				{
					window_w = input.tag.get_property("WINDOW_W", window_w);
					window_h = input.tag.get_property("WINDOW_H", window_h);
				}
				config.momentary_notes = input.tag.get_property("MOMENTARY_NOTES", config.momentary_notes);

//printf("Synth::read_data %d %d %d\n", __LINE__, window_w, window_h);
				for(int i = 0; i < MAX_FREQS; i++)
				{
					sprintf(string, "BASEFREQ_%d", i);
					config.base_freq[i] = input.tag.get_property(string, (double)0);
				}

				config.wavefunction = input.tag.get_property("WAVEFUNCTION", config.wavefunction);
				//total_oscillators = input.tag.get_property("OSCILLATORS", 0);
			}
			else
			if(input.tag.title_is("OSCILLATOR"))
			{
				if(current_osc >= config.oscillator_config.total)
					config.oscillator_config.append(new SynthOscillatorConfig(current_osc));

				config.oscillator_config.values[current_osc]->read_data(&input);
				current_osc++;
			}
		}
	}

	while(config.oscillator_config.total > current_osc)
		config.oscillator_config.remove_object();
}
Example #16
0
void SwapFrames::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
	while(!input.read_tag())
	{
		if(input.tag.title_is("SWAPFRAMES"))
		{
			config.on = input.tag.get_property("ON", config.on);
			config.swap_even = input.tag.get_property("SWAP_EVEN", config.swap_even);
		}
	}
}
Example #17
0
void _1080to540Main::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("1080TO540"))
		{
			config.first_field = input.tag.get_property("FIRST_FIELD", config.first_field);
		}
	}
}
Example #18
0
void HueEffect::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
	while(!input.read_tag())
	{
		if(input.tag.title_is("HUESATURATION"))
		{
			config.hue = input.tag.get_property("HUE", config.hue);
			config.saturation = input.tag.get_property("SATURATION", config.saturation);
			config.value = input.tag.get_property("VALUE", config.value);
		}
	}
}
Example #19
0
void GreyCStorationMain::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	while( !input.read_tag() ) {
		if(input.tag.title_is("GREYCSTORATION")) {
			config.amplitude = input.tag.get_property("AMPLITUDE", config.amplitude);
			config.sharpness = input.tag.get_property("SHARPNESS", config.sharpness);
			config.anisotropy = input.tag.get_property("ANISOTROPHY", config.anisotropy);
			config.noise_scale = input.tag.get_property("NOISE_SCALE", config.noise_scale);
		}
	}
}
void _720to480Main::read_data(KeyFrame *keyframe)
{
	FileXML input;
	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("720TO480"))
		{
			config.first_field = input.tag.get_property("FIRST_FIELD", config.first_field);
			config.direction = input.tag.get_property("DIRECTION", config.direction);
		}
	}
}
Example #21
0
void SlideMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("SLIDE"))
		{
			motion_direction = input.tag.get_property("MOTION_DIRECTION", motion_direction);
			direction = input.tag.get_property("DIRECTION", direction);
		}
	}
}
Example #22
0
int SelTempAvgMain::nextkeyframeisoffsetrestart(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("SELECTIVE_TEMPORAL_AVERAGE"))
		{
			return(input.tag.get_property("OFFSETMODE_RESTARTMODE_KEYFRAME", config.offset_restartmarker_keyframe));
		}
	}
	return (0);
}
void BandWipeMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("BANDWIPE"))
		{
			bands = input.tag.get_property("BANDS", bands);
			direction = input.tag.get_property("DIRECTION", direction);
		}
	}
}
Example #24
0
void Overlay::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("OVERLAY"))
		{
			config.mode = input.tag.get_property("MODE", config.mode);
			config.direction = input.tag.get_property("DIRECTION", config.direction);
			config.output_layer = input.tag.get_property("OUTPUT_LAYER", config.output_layer);
		}
	}
}
Example #25
0
void DeInterlaceMain::read_data(KeyFrame *keyframe)
{
	FileXML input;  char *data = keyframe->get_data();
	input.set_shared_input(data, strlen(data));

	while(!input.read_tag())
	{
		if(input.tag.title_is("DEINTERLACE"))
		{
			config.mode = input.tag.get_property("MODE", config.mode);
			config.dominance = input.tag.get_property("DOMINANCE", config.dominance);
			config.adaptive = input.tag.get_property("ADAPTIVE", config.adaptive);
			config.threshold = input.tag.get_property("THRESHOLD", config.threshold);
		}
	}

}
Example #26
0
void OilEffect::read_data(KeyFrame *keyframe)
{
    FileXML input;

    input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

    int result = 0;

    while(!input.read_tag())
    {
        if(input.tag.title_is("OIL_PAINTING"))
        {
            config.radius = input.tag.get_property("RADIUS", config.radius);
            config.use_intensity = input.tag.get_property("USE_INTENSITY", config.use_intensity);
        }
    }
}
void ThresholdMain::read_data(KeyFrame *keyframe)
{
	FileXML file;
	file.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));
	int result = 0;
	while(!result)
	{
		result = file.read_tag();
		if(!result)
		{
			config.min = file.tag.get_property("MIN", config.min);
			config.max = file.tag.get_property("MAX", config.max);
			config.plot = file.tag.get_property("PLOT", config.plot);
		}
	}
	config.boundaries();
}
void ShapeWipeMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	while(!input.read_tag())
	{
		if(input.tag.title_is("SHAPEWIPE"))
		{
			direction = input.tag.get_property("DIRECTION", direction);
			antialias = input.tag.get_property("ANTIALIAS", antialias);
			preserve_aspect = input.tag.get_property("PRESERVE_ASPECT", preserve_aspect);
			input.tag.get_property("FILENAME", filename);
			input.tag.get_property("SHAPE_NAME", shape_name);
		}
	}
}
Example #29
0
void Despike::read_data(KeyFrame *keyframe)
{
	FileXML input;
// cause xml file to read directly from text
	input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
	int result = 0;

	result = input.read_tag();

	if(!result)
	{
		if(input.tag.title_is("DESPIKE"))
		{
			config.level = input.tag.get_property("LEVEL", config.level);
			config.slope = input.tag.get_property("SLOPE", config.slope);
		}
	}
}
void Color3WayMain::read_data(KeyFrame *keyframe)
{
	FileXML input;

	input.set_shared_string(keyframe->get_data(), strlen(keyframe->get_data()));

	int result = 0;

	while(!result)
	{
		result = input.read_tag();

		if(!result)
		{
			if(input.tag.title_is("COLOR3WAY"))
			{
				for(int i = 0; i < SECTIONS; i++)
				{
					char string[BCTEXTLEN];
					sprintf(string, "HUE_X_%d", i);
					config.hue_x[i] = input.tag.get_property(string, config.hue_x[i]);
					sprintf(string, "HUE_Y_%d", i);
					config.hue_y[i] = input.tag.get_property(string, config.hue_y[i]);
					sprintf(string, "VALUE_%d", i);
					config.value[i] = input.tag.get_property(string, config.value[i]);
					sprintf(string, "SATURATION_%d", i);
					config.saturation[i] = input.tag.get_property(string, config.saturation[i]);
					
					if(is_defaults())
					{
						sprintf(string, "COPY_TO_ALL_%d", i);
						copy_to_all[i] = input.tag.get_property(string, copy_to_all[i]);
					}
				}

				if(is_defaults())
				{
					w = input.tag.get_property("W", w);
					h = input.tag.get_property("H", h);
				}
			}
		}
	}
}