function control = parameter__control__create(parameter, context)

% CLIP - parameter__control__create

control = empty(control_create);

%--
% format
%--

formats = get_writeable_formats;

for k = 1:length(formats)
	ext{k} = formats(k).ext{1};
end

ext = upper(ext); value = find(strcmpi(ext, parameter.format));

if isempty(value)
	value = 1;
end

control(end + 1) = control_create( ...
	'name', 'format', ...
	'style', 'popup', ...
	'string', ext, ...
	'value', value ...
);

%--
% output
%--

% TODO: add non-editable state for controls, this would trigger the color change

control(end + 1) = control_create( ...
	'name', 'output', ...
	'alias', 'output directory', ...
	'color', '__LCD__', ...
	'style', 'edit', ...
	'lines', 3, ...
	'string', parameter.output ...
);

% control(end + 1) = control_create( ...
% 	'name', 'browse ...', ...
% 	'style', 'buttongroup', ...
% 	'lines', 1.5, ...
% 	'width', 0.5, ...
% 	'align', 'right' ...
% );
