void DidFinishRecording(object sender, QTCaptureFileErrorEventArgs e) { Console.WriteLine("Recorded {0} bytes duration {1}", movieFileOutput.RecordedFileSize, movieFileOutput.RecordedDuration); DidChangeValue("Recording"); // TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=27691 IntPtr library = Dlfcn.dlopen("/System/Library/Frameworks/QTKit.framework/QTKit", 0); var key = Dlfcn.GetStringConstant(library, "QTCaptureConnectionAttributeWillChangeNotification"); if (e.Reason != null && !((NSNumber)e.Reason.UserInfo [key]).BoolValue) { NSAlert.WithError(e.Reason).BeginSheet(Window, () => { }); return; } var save = NSSavePanel.SavePanel; save.AllowedFileTypes = new string[] { "mov" }; save.CanSelectHiddenExtension = true; save.BeginSheet(WindowForSheet, code => { NSError err2; if (code == (int)NSPanelButtonType.Ok) { if (NSFileManager.DefaultManager.Move(e.OutputFileURL, save.Url, out err2)) { NSWorkspace.SharedWorkspace.OpenUrl(save.Url); } else { save.OrderOut(this); } } else { NSFileManager.DefaultManager.Remove(e.OutputFileURL.Path, out err2); } }); }
void DidFinishRecording (object sender, QTCaptureFileErrorEventArgs e) { Console.WriteLine ("Recorded {0} bytes duration {1}", movieFileOutput.RecordedFileSize, movieFileOutput.RecordedDuration); DidChangeValue ("Recording"); // TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=27691 IntPtr library = Dlfcn.dlopen ("/System/Library/Frameworks/QTKit.framework/QTKit", 0); var key = Dlfcn.GetStringConstant (library, "QTCaptureConnectionAttributeWillChangeNotification"); if (e.Reason != null && !((NSNumber)e.Reason.UserInfo [key]).BoolValue) { NSAlert.WithError (e.Reason).BeginSheet (Window, () => { }); return; } var save = NSSavePanel.SavePanel; save.AllowedFileTypes = new string[] { "mov" }; save.CanSelectHiddenExtension = true; save.BeginSheet (WindowForSheet, code => { NSError err2; if (code == (int)NSPanelButtonType.Ok) { if (NSFileManager.DefaultManager.Move (e.OutputFileURL, save.Url, out err2)) NSWorkspace.SharedWorkspace.OpenUrl (save.Url); else save.OrderOut (this); } else { NSFileManager.DefaultManager.Remove (e.OutputFileURL.Path, out err2); } }); }
void WillFinishRecording (object sender, QTCaptureFileErrorEventArgs e) { Console.WriteLine ("Will finish recording to {0} due to error {1}", e.OutputFileURL.Description, e.Reason); InvokeOnMainThread (() => WillChangeValue ("Recording")); }
void MustChangeOutputFile (object sender, QTCaptureFileErrorEventArgs e) { Console.WriteLine ("Must change file due to error"); }
void WillFinishRecording(object sender, QTCaptureFileErrorEventArgs e) { Console.WriteLine("Will finish recording to {0} due to error {1}", e.OutputFileURL.Description, e.Reason); InvokeOnMainThread(() => WillChangeValue("Recording")); }
void MustChangeOutputFile(object sender, QTCaptureFileErrorEventArgs e) { Console.WriteLine("Must change file due to error"); }