private void RemoveDarkframe(TableChangeType type) { try { TreeIter iter; table.GetIter(out iter, ValueTable.Selection.GetSelectedRows()[0]); int index = table.GetPath(iter).Indices[0]; switch (type) { case TableChangeType.Single: AllFiles[index].PP3.RAW.DarkFrame = null; break; case TableChangeType.TillEnd: for (int i = index; i < AllFiles.Count; i++) { AllFiles[index].PP3.RAW.DarkFrame = null; } break; case TableChangeType.TillNext: TreePath Tpath = table.GetPath(iter); table.GetIter(out iter, Tpath); string name = (string)table.GetValue(iter, (int)TableLocation.Darkframes); for (int i = index; i < AllFiles.Count; i++) { if (System.IO.Path.GetFileName(AllFiles[index].PP3.RAW.DarkFrame) != name) { AllFiles[index].PP3.RAW.DarkFrame = null; } else { break; } } break; } UpdateTable(); UpdateInfo(InfoType.Darkframe, 1); } catch (Exception ex) { ReportError("Remove Darkframe", ex); } }
private void OpenFilter(TableChangeType type) { try { FileChooserDialog fc = new FileChooserDialog("Open Filterset", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept); FileFilter filter = new FileFilter(); filter.Name = "DeSERt Filterset"; filter.AddMimeType("Filterset/fis"); filter.AddPattern("*.fis"); fc.AddFilter(filter); if (Directory.Exists(MySettings.LastFilterDir)) { fc.SetCurrentFolder(MySettings.LastFilterDir); } if (fc.Run() == (int)ResponseType.Accept) { TreeIter iter; table.GetIter(out iter, ValueTable.Selection.GetSelectedRows()[0]); int index = table.GetPath(iter).Indices[0]; string name = System.IO.Path.GetFileName(fc.Filename); MySettings.LastFilterDir = System.IO.Path.GetDirectoryName(fc.Filename); MySettings.Save(); Filterset CurFilter; switch (type) { case TableChangeType.Single: AllFiles[index].Filter = Filterset.OpenFilterset(fc.Filename); break; case TableChangeType.TillEnd: CurFilter = Filterset.OpenFilterset(fc.Filename); for (int i = index; i < AllFiles.Count; i++) { AllFiles[index].Filter = CurFilter; } break; case TableChangeType.TillNext: CurFilter = Filterset.OpenFilterset(fc.Filename); for (int i = index; i < AllFiles.Count; i++) { if (AllFiles[index].Filter == null) { AllFiles[index].Filter = CurFilter; } else { break; } } break; } UpdateTable(); UpdateInfo(InfoType.Filterset, 0); } fc.Destroy(); } catch (Exception ex) { ReportError("Open Filterset", ex); } }
private void OpenDarkframe(TableChangeType type) { try { FileChooserDialog fc = new FileChooserDialog("Open Darkframe", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept); #region Add FileFilter FileFilter filter = new FileFilter(); filter.Name = "Images"; filter.AddPattern("*.jpg"); filter.AddPattern("*.jpeg"); filter.AddPattern("*.CR2"); filter.AddPattern("*.CRW"); filter.AddPattern("*.png"); filter.AddPattern("*.tif"); filter.AddPattern("*.tiff"); filter.AddPattern("*.DNG"); filter.AddPattern("*.NEF"); filter.AddPattern("*.x3f"); filter.AddPattern("*.srw"); filter.AddPattern("*.srf"); filter.AddPattern("*.sr2"); filter.AddPattern("*.arw"); filter.AddPattern("*.erf"); filter.AddPattern("*.pef"); filter.AddPattern("*.raf"); filter.AddPattern("*.3fr"); filter.AddPattern("*.fff"); filter.AddPattern("*.dcr"); filter.AddPattern("*.dcs"); filter.AddPattern("*.kdc"); filter.AddPattern("*.rwl"); filter.AddPattern("*.mrw"); filter.AddPattern("*.mdc"); filter.AddPattern("*.nrw"); filter.AddPattern("*.orf"); filter.AddPattern("*.rw2"); fc.AddFilter(filter); filter = new FileFilter(); filter.Name = "All Files"; filter.AddPattern("*.*"); fc.AddFilter(filter); #endregion if (Directory.Exists(MySettings.LastFilterDir)) { fc.SetCurrentFolder(MySettings.LastFilterDir); } if (fc.Run() == (int)ResponseType.Accept) { TreeIter iter; table.GetIter(out iter, ValueTable.Selection.GetSelectedRows()[0]); int index = table.GetPath(iter).Indices[0]; string name = System.IO.Path.GetFileName(fc.Filename); MySettings.LastFilterDir = System.IO.Path.GetDirectoryName(fc.Filename); MySettings.Save(); switch (type) { case TableChangeType.Single: AllFiles[index].PP3.RAW.DarkFrame = fc.Filename; break; case TableChangeType.TillEnd: for (int i = index; i < AllFiles.Count; i++) { AllFiles[index].PP3.RAW.DarkFrame = fc.Filename; } break; case TableChangeType.TillNext: for (int i = index; i < AllFiles.Count; i++) { if (!String.IsNullOrEmpty(AllFiles[index].PP3.RAW.DarkFrame)) { AllFiles[index].PP3.RAW.DarkFrame = fc.Filename; } else { break; } } break; } UpdateTable(); UpdateInfo(InfoType.Darkframe, 0); } fc.Destroy(); } catch (Exception ex) { ReportError("Open Darkframe", ex); } }
private void ResetTableBrightness(TableChangeType type) { try { switch (type) { case TableChangeType.Single: TreeIter iter; table.GetIter(out iter, ValueTable.Selection.GetSelectedRows()[0]); int index = table.GetPath(iter).Indices[0]; AllFiles[index].AltBrightness = AllFiles[index].Brightness; double change = AllFiles[index].AltBrightness - AllFiles[index].Brightness; AllFiles[index].AltBrightness = AllFiles[index].Brightness; for (int i = index + 1; i < AllFiles.Count; i++) { AllFiles[i].AltBrightness -= change; } break; case TableChangeType.All: for (int i = 0; i < AllFiles.Count; i++) { AllFiles[i].AltBrightness = AllFiles[i].Brightness; } break; } UpdateTable(); } catch (Exception ex) { ReportError("Reset Table Brightness", ex); } }