BParameterWeb	*VideoRecorderNode::GetParameterWeb(void)
{
	int32 cookie = 0;
	bool first=true;
	media_file_format *mff=new media_file_format;
//	if (web) delete web;
	web = new BParameterWeb();
	BParameterGroup *videoFormat=web->MakeGroup("VideoFormat");
	BParameterGroup *formatGroup = videoFormat->MakeGroup("Fileformat");
	format = formatGroup->MakeDiscreteParameter(VIDEO_FORMAT, B_MEDIA_RAW_VIDEO, "VideoFileFormat", "FileFormat");
	BParameterGroup *codecGroup = videoFormat->MakeGroup("Codec");
	codec = codecGroup->MakeDiscreteParameter(VIDEO_CODEC, B_MEDIA_RAW_VIDEO, "Codec", "Codec");
	BParameterGroup *qualityGroup = videoFormat->MakeGroup("Quality");
	quality = qualityGroup->MakeContinuousParameter(VIDEO_QUALITY, B_MEDIA_RAW_VIDEO, "Video Quality", B_QUALITY,"",0,1.0,0.005);
	while (get_next_file_format(&cookie, mff) == B_OK)
	{
		if (mff->capabilities & media_file_format::B_KNOWS_ENCODED_VIDEO)
		{
//			format->AddItem(formatList->CountItems(), mff->pretty_name);
			format->AddItem((uint32)mff->family, mff->pretty_name);

			formatList->AddItem(&(mff->family));
			if (first)
			{
				videoFileFormat=*mff;
				BuildCodecMenu(videoFileFormat.family);
				first=false;
			}
		}
	}
	videoQuality=1.0;
	return web;	
}
void
OutputView::UpdateSettings()
{
	Settings settings;
	
	if (fWholeScreen->Value() == B_CONTROL_ON)
		settings.SetCaptureArea(BScreen().Frame());
		
	//BRect captureRect = settings.CaptureArea();
	//const float factor = 100;
	
	//  TODO: set the frame
	//settings.SetClipFrame(GetScaledRect(captureRect, factor));
	
	UpdatePreviewFromSettings();
	
	BuildCodecMenu(FormatFamily());
	
	fController->SetMediaFormat(fFormat);
}
void 
VideoRecorderNode::SetParameterValue(int32 id, bigtime_t when,
							const void *value, size_t size)
{
//	*last_change = fLastSelectionChange;
	if (id == VIDEO_FORMAT)
	{
		if (size == sizeof(uint32))
		{
			
			videoFormat=*((uint32 *)value);
			media_format_family	mffFamily=(media_format_family)videoFormat;

			INFO("%ld selected\n",videoFormat);
		//	media_format_family	mffFamily=*((media_format_family *)formatList->ItemAt(videoFormat));
			//videoFileFormat=*((media_file_format *)formatList->ItemAt(videoFormat));
		//	INFO("build codec with %s\n",videoFileFormat.pretty_name);
//			BuildCodecMenu(videoFileFormat.family);		
			BuildCodecMenu(mffFamily);		
			SetParameterWeb(web);
//			StartControlPanel(NULL);
		}
		
	}
	else if (id == VIDEO_CODEC)
	{
		if (size == sizeof(int32))
			videoCodec= *((uint32 *)value);
	}
	else if (id = VIDEO_QUALITY)
	{
		if (size == sizeof(float))
		INFO("QUALITY=%lf\n",*((float *)value));
			videoQuality=*((float *)value);
	}
}