Пример #1
0
status_t
BSCWindow::_CaptureStarted()
{
	fCapturing = true;
	
	Settings settings;
						
	if (settings.MinimizeOnRecording())
		Minimize(true);
	
	fStatusBar->Reset();
	
	fStartStopButton->SetLabel("Stop Recording");
	
	return B_OK;
}
Пример #2
0
status_t
BSCWindow::_CaptureStarted()
{
	fCapturing = true;
	
	Settings settings;
						
	if (settings.MinimizeOnRecording())
		Minimize(true);
	
	fCardLayout->SetVisibleItem((int32)0);
	fStatusBar->Reset();
	
	fStartStopButton->SetLabel("Stop Recording");

	SendNotices(kMsgGUIStartCapture);
	
	return B_OK;
}
Пример #3
0
OutputView::OutputView(Controller *controller)
	:
	BView("Capture Options", B_WILL_DRAW),
	fController(controller)
{
	SetLayout(new BGroupLayout(B_VERTICAL));
	
	BBox *selectBox = new BBox("selection");
	selectBox->SetLabel("Selection");
	selectBox->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
	AddChild(selectBox);
	
	BBox *outputBox = new BBox("output");
	outputBox->SetLabel("Output");
	outputBox->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
	AddChild(outputBox);

	Settings settings;
	
	const char *kTCLabel = "File name:"; 
	const char *fileName = NULL;
	settings.GetOutputFileName(&fileName);
	fFileName = new BTextControl("file name",
			kTCLabel, fileName, new BMessage(kFileNameChanged));
	
	const char *kOutputMenuLabel = "Output Format:";
	fOutputFileType = new BOptionPopUp("OutFormat",
			kOutputMenuLabel, new BMessage(kFileTypeChanged));
						
	const char *kCodecMenuLabel = "Codec:";
	BPopUpMenu *popUpMenu = new BPopUpMenu("Codecs");
	fCodecMenu = new BMenuField("OutCodec", kCodecMenuLabel, popUpMenu);
	
	fWholeScreen = new BRadioButton("screen frame", "Whole screen",
		new BMessage(kCheckBoxAreaSelectionChanged));
	fCustomArea = new BRadioButton("custom area",
		"Custom Area", new BMessage(kCheckBoxAreaSelectionChanged));
	fSelectArea = new BButton("select area", "Select", new BMessage(kSelectArea));
	fSelectArea->SetEnabled(false);
	
	fMinimizeOnStart = new BCheckBox("Minimize on start",
		"Minimize on recording", new BMessage(kMinimizeOnRecording));
	
	fRectView = new PreviewView();
	
	BView *layoutView = BLayoutBuilder::Group<>()
		.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
			B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
		.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
			.Add(fFileName)
			.Add(fOutputFileType)
			.Add(fCodecMenu)
			.Add(fMinimizeOnStart)
		.End()	
		.View();

	outputBox->AddChild(layoutView);

	layoutView = BLayoutBuilder::Group<>()
		.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
			B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
		.AddGroup(B_VERTICAL)
			.AddGroup(B_HORIZONTAL)
				.AddGroup(B_VERTICAL, 0)
					.Add(fWholeScreen)
					.Add(fCustomArea)
				.End()
				.AddGroup(B_VERTICAL)
					.AddGlue()
					.Add(fSelectArea)
				.End()
			.End()
			.Add(fRectView)
		.End()
		.View();
	
	selectBox->AddChild(layoutView);

	fMinimizeOnStart->SetValue(settings.MinimizeOnRecording() ? B_CONTROL_ON : B_CONTROL_OFF);
	
	// fill in the list of available file formats
	media_file_format mff;
	
	int32 cookie = 0;
	bool firstFound = true;
	while (get_next_file_format(&cookie, &mff) == B_OK) {
		if (mff.capabilities & media_file_format::B_KNOWS_ENCODED_VIDEO) {
			fOutputFileType->AddOption(mff.pretty_name, mff.family);
			if (firstFound) {
				fOutputFileType->MenuField()->Menu()->ItemAt(0)->SetMarked(true);
				firstFound = false;
			}
		}	
	}
	
	fWholeScreen->SetValue(B_CONTROL_ON);
	
	UpdateSettings();
	
	fController->SetCaptureArea(BScreen(Window()).Frame());
	fController->SetMediaFormatFamily(FormatFamily());
	fController->SetOutputFileName(fFileName->Text());
}
Пример #4
0
void
OutputView::_LayoutView(bool classic)
{
	SetLayout(new BGroupLayout(B_VERTICAL));
	
	BBox *selectBox = new BBox("source");
	selectBox->SetLabel("Source");
	AddChild(selectBox);
	
	BBox *outputBox = new BBox("output");
	outputBox->SetLabel("Output");
	AddChild(outputBox);

	Settings settings;
	const char *kTCLabel = "File name:"; 
	BString fileName = settings.OutputFileName();
	fFileName = new BTextControl("file name",
			kTCLabel, fileName.String(), new BMessage(kFileNameChanged));
	
	fWholeScreen = new BRadioButton("screen frame", "Whole screen",
		new BMessage(kCheckBoxAreaSelectionChanged));
	fCustomArea = new BRadioButton("region",
		"Region", new BMessage(kCheckBoxAreaSelectionChanged));
	fWindow = new BRadioButton("window", 
		"Window", new BMessage(kCheckBoxAreaSelectionChanged));
		
	fSelectArea = new BButton("select region", "Select Region", new BMessage(kSelectArea));
	fSelectArea->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
	fSelectArea->SetEnabled(false);
	
	fFilePanelButton = new BButton("...", new BMessage(kOpenFilePanel));
	fFilePanelButton->SetExplicitMaxSize(BSize(35, 25));
	fFilePanelButton->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, B_ALIGN_MIDDLE));
	
	fMinimizeOnStart = new BCheckBox("HideWhenRecording",
		"Hide window when recording", new BMessage(kMinimizeOnRecording));

	fScaleSlider = new SizeControl("scale_slider", "Scale",
		new BMessage(kScaleChanged), 25, 200, 25, "%", B_HORIZONTAL);
				
	BView *layoutView = BLayoutBuilder::Group<>()
		.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
			B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
		.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
			.AddGroup(B_VERTICAL)
				.Add(fWholeScreen)
				.Add(fCustomArea)
				.Add(fWindow)
				.Add(fSelectArea)
				.AddStrut(20)
			.End()
			.Add(fRectView = new PreviewView())
		.End()
		.View();
	
	selectBox->AddChild(layoutView);
	
	//fMediaFormatView = new MediaFormatView(fController);
	
	layoutView = BLayoutBuilder::Group<>()
		.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
			B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
		.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
			.AddGroup(B_HORIZONTAL, 0)
				.Add(fFileName)
				.Add(fFilePanelButton)
			.End()
			//.Add(fMediaFormatView)
			.Add(fScaleSlider)
			.SetInsets(B_USE_DEFAULT_SPACING)
			.Add(fMinimizeOnStart)
		.End()	
		.View();

	outputBox->AddChild(layoutView);	
	
	fScaleSlider->SetValue(100);
	
	fMinimizeOnStart->SetValue(settings.MinimizeOnRecording() ? B_CONTROL_ON : B_CONTROL_OFF);

	fFileExtension = fController->MediaFileFormat().file_extension;		
}