void RegistryInit(string DefaultOysterAddress,int DefaultOysterConnectionPort, int DefaultOysterFilePort,string DefaultOysterDeviceID,string OysterDeviceFriendlyName, bool ManualConfiguration, RecordOptions.ScreenRecordType RecordType, string WindowTitleToRecord, ScreenEncoder.CapturePerformance ScreenCapturePerformance, RecordOptions.CameraSelection CamerasSelected, int MinutesToRecord, int SecondsToCountdown, string ScreenProfileDirectory, string ScreenWMVDirectory, RecordOptions.PrimaryCamera CameraPrimary) { m_sDefaultOysterDeviceAddress = (string) m_RegKey.GetValue("DefaultOysterDeviceAddress",DefaultOysterDeviceAddress); m_iDefaultOysterDeviceConnectionPort = (int) m_RegKey.GetValue("DefaultOysterDeviceConnectionPort",DefaultOysterDeviceConnectionPort); m_iDefaultOysterDeviceFilePort = (int) m_RegKey.GetValue("DefaultOysterDeviceFilePort",DefaultOysterDeviceFilePort); m_sDefaultOysterAddress = (string) m_RegKey.GetValue("DefaultOysterAddress",DefaultOysterAddress); m_iDefaultOysterConnectionPort = (int) m_RegKey.GetValue("DefaultOysterConnectionPort",DefaultOysterConnectionPort); m_iDefaultOysterFilePort = (int) m_RegKey.GetValue("DefaultOysterFilePort",DefaultOysterFilePort); m_sDefaultOysterDeviceID = (string) m_RegKey.GetValue("DefaultOysterDeviceID",DefaultOysterDeviceID); m_sOysterDeviceFriendlyName = (string) m_RegKey.GetValue("OysterDeviceFriendlyName",OysterDeviceFriendlyName); m_bManualConfiguration = bool.Parse((string)m_RegKey.GetValue("ManualConfiguration",ManualConfiguration.ToString())); m_ScreenRecordType = (RecordOptions.ScreenRecordType) System.Enum.Parse(typeof(RecordOptions.ScreenRecordType), (string)m_RegKey.GetValue("RecordType",RecordType.ToString())); m_sWindowTitleToRecord = (string) m_RegKey.GetValue("WindowTitleToRecord",WindowTitleToRecord); m_ScreenCapturePerformance = (ScreenEncoder.CapturePerformance) System.Enum.Parse(typeof(ScreenEncoder.CapturePerformance), (string)m_RegKey.GetValue("CapturePerformance",ScreenCapturePerformance.ToString())); m_CameraSelection = (RecordOptions.CameraSelection) System.Enum.Parse(typeof(RecordOptions.CameraSelection), (string)m_RegKey.GetValue("SelectedCamera",CamerasSelected.ToString())); m_iMinutesToRecord = (int)m_RegKey.GetValue("MinutesToRecord",MinutesToRecord); m_iMinutesToCountdown = (int)m_RegKey.GetValue("SecondsToCountdown",SecondsToCountdown); m_sProfileDirectory = (string)m_RegKey.GetValue("ProfileDirectory",ScreenProfileDirectory); m_sProfileDirectory = RemoveTrailingBackslashFromPath(m_sProfileDirectory); m_sWMVDirectory = (string) m_RegKey.GetValue("WMVDirectory",ScreenWMVDirectory); m_sWMVDirectory = RemoveTrailingBackslashFromPath(m_sWMVDirectory); m_PrimaryCamera = (RecordOptions.PrimaryCamera) System.Enum.Parse(typeof(RecordOptions.PrimaryCamera), (string)m_RegKey.GetValue("CameraPrimary",CameraPrimary.ToString())); m_bHasBeenSaved = bool.Parse((string)m_RegKey.GetValue("HasBeenSaved",false.ToString())); }
private static void WriteToFile(RecordOptions This, ref bool bWritten) { if (System.IO.File.Exists(This.m_sPathFileToSave)) { System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); bWritten = true; formatter.Serialize(new System.IO.FileStream(This.m_sPathFileToSave, System.IO.FileMode.OpenOrCreate),This); } else { throw new System.IO.FileNotFoundException("File was not found.",This.m_sPathFileToSave); } }
void ClassInit(string DefaultOysterAddress,int DefaultOysterConnectionPort,int DefaultOysterFilePort,string DefaultOysterDeviceID,string OysterDeviceFriendlyName, bool ManualConfiguration, RecordOptions.ScreenRecordType RecordType, string WindowTitleToRecord, ScreenEncoder.CapturePerformance ScreenCapturePerformance, RecordOptions.CameraSelection CamerasSelected, int MinutesToRecord, int SecondsToCountdown, string ScreenProfileDirectory, string ScreenWMVDirectory, RecordOptions.PrimaryCamera CameraPrimary) { // System.Reflection.AssemblyTitleAttribute ata = (System.Reflection.AssemblyTitleAttribute) // System.Attribute.GetCustomAttribute(System.Reflection.Assembly.GetAssembly(typeof(DesktopRecorder.RecordOptions)), // typeof(System.Reflection.AssemblyTitleAttribute)); m_RegKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey( @"SOFTWARE\Carver Lab\Oyster\" + CarverLab.Utility.AppInfo.Title); if (m_RegKey == null) { throw new System.ApplicationException("Could not open Carver Lab registry key."); } RegistryInit(DefaultOysterAddress,DefaultOysterConnectionPort,DefaultOysterFilePort,DefaultOysterDeviceID,OysterDeviceFriendlyName,ManualConfiguration, RecordType,WindowTitleToRecord, ScreenCapturePerformance,CamerasSelected,MinutesToRecord,SecondsToCountdown, ScreenProfileDirectory,ScreenWMVDirectory, CameraPrimary); }
private static void ReadFromFile(RecordOptions This, string PathFile) { if (System.IO.File.Exists(PathFile)) { System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); formatter.Serialize(new System.IO.FileStream(PathFile, System.IO.FileMode.OpenOrCreate),This); } else { throw new System.IO.FileNotFoundException("File was not found.",PathFile); } }
public void Save(RecordOptions.SaveType HowToSave) { System.Diagnostics.Debug.Assert(HowToSave == RecordOptions.SaveType.ToRegistry,"Only Registry save is supported."); switch (HowToSave) { case RecordOptions.SaveType.ToRegistry: WriteToRegistry(); break; case RecordOptions.SaveType.ToFile: WriteToFile(this,ref m_bHasBeenSaved); break; case RecordOptions.SaveType.ToRegistryAndFile: WriteToRegistry(); WriteToFile(this,ref m_bHasBeenSaved); break; } }
public RecordOptions(RecordOptions.SaveType OptionsSaveType) { System.Diagnostics.Debug.Assert(OptionsSaveType == RecordOptions.SaveType.ToRegistry,"Only Registry save is supported."); // System.Reflection.AssemblyTitleAttribute ata = (System.Reflection.AssemblyTitleAttribute) // System.Attribute.GetCustomAttribute(System.Reflection.Assembly.GetAssembly(typeof(DesktopRecorder.RecordOptions)), // typeof(System.Reflection.AssemblyTitleAttribute)); switch (OptionsSaveType) { case RecordOptions.SaveType.ToRegistry: ClassInit("",CarverLab.Oyster.SystemDefaults.DefaultOysterNetworkPort,CarverLab.Oyster.SystemDefaults.DefaultOysterFileTransferPort,"N/A","N/A",false, RecordOptions.ScreenRecordType.ScreenRecordFullScreen, "", ScreenEncoder.CapturePerformance.MediumHigh,RecordOptions.CameraSelection.CameraOneAndTwo, 1,0, m_sDefaultApplicationDirectory + @"\Profiles", m_CurrentUserMyDocumentDirectory + @"\Oyster\" + CarverLab.Utility.AppInfo.Title + @"\Oyster Recording", RecordOptions.PrimaryCamera.CameraOne); break; case RecordOptions.SaveType.ToFile: RecordOptions.ReadFromFile(this,"RecordOptions.dat"); break; case RecordOptions.SaveType.ToRegistryAndFile: ClassInit("",CarverLab.Oyster.SystemDefaults.DefaultOysterNetworkPort,CarverLab.Oyster.SystemDefaults.DefaultOysterFileTransferPort,"N/A","N/A",false, RecordOptions.ScreenRecordType.ScreenRecordFullScreen, "", ScreenEncoder.CapturePerformance.MediumHigh,RecordOptions.CameraSelection.CameraOneAndTwo, 1,0, // @"C:\Program Files\Carver Lab\Oyster\" + ata.Title, // @"C:\Program Files\Carver Lab\Oyster\" + ata.Title + "\temp", m_sDefaultApplicationDirectory + @"\Profiles", m_CurrentUserMyDocumentDirectory + @"\Oyster\" + CarverLab.Utility.AppInfo.Title + @"\Oyster Recording", RecordOptions.PrimaryCamera.CameraOne); break; } //Make certain save directories exist // try // { // System.IO.Directory.CreateDirectory(m_CurrentUserMyDocumentDirectory + @"\" + CarverLab.Utility.AppInfo.Title + @"\temp"); // } // catch(Exception Err) // { // string ErrorString = Err.Message; // } }
public RecordOptions(string DefaultOysterAddress,int DefaultOysterConnectionPort,int DefaultOysterFilePort, string DefaultOysterDeviceID,string OysterDeviceFriendlyName, bool ManualConfiguration, RecordOptions.ScreenRecordType RecordType, string WindowTitleToRecord, ScreenEncoder.CapturePerformance ScreenCapturePerformance, RecordOptions.CameraSelection CamerasSelected, int MinutesToRecord, int SecondsToCountdown, string ScreenProfileDirectory, string ScreenWMVDirectory, RecordOptions.PrimaryCamera CameraPrimary) { ClassInit(DefaultOysterAddress,DefaultOysterConnectionPort,DefaultOysterFilePort,DefaultOysterDeviceID,OysterDeviceFriendlyName,ManualConfiguration,RecordType,WindowTitleToRecord, ScreenCapturePerformance,CamerasSelected,MinutesToRecord,SecondsToCountdown, ScreenProfileDirectory,ScreenWMVDirectory,CameraPrimary); }
public frmRecordOptions() { // // Required for Windows Form Designer support // InitializeComponent(); string FakeUDN = "DBF54A20-3C3F-477c-A15D-84673C1DDF3B"; NoDevice = Intel.UPNP.UPnPDevice.CreateEmbeddedDevice((double)1,FakeUDN); NoDevice.FriendlyName = "No Device Selected"; NoDevice.SerialNumber = "N/A"; cboOysterDevice.DisplayMember = "FriendlyName"; cboOysterDevice.ValueMember = "SerialNumber"; cboOysterDevice.Items.Add(NoDevice); disco = new OysterDeviceDiscovery(); disco.OnAddedDevice += new OysterDeviceDiscovery.DiscoveryHandler(AddSink); disco.OnRemovedDevice += new OysterDeviceDiscovery.DiscoveryHandler(RemoveSink); // // TODO: Add any constructor code after InitializeComponent call // // log = new CarverLab.Utility.Logger("DesktopRecorder"); m_RecordOptions = new RecordOptions(RecordOptions.SaveType.ToRegistry); //tabControl1.SelectedIndex = 0; m_wrap = new CarverLab.Utility.Win32Wrapper(); //disco.Start(); cboCaptureQuality.DisplayMember = "Name"; cboCaptureQuality.ValueMember = "Identifier"; cboCaptureQuality.DataSource = m_PerformanceList; }