コード例 #1
0
ファイル: LapseStudioUI.cs プロジェクト: ivynetca/lapsestudio
        public LapseStudioUI(Platform RunningPlatform, IUIHandler UIHandler, MessageBox MsgBox, FileDialog FDialog)
        {
            this.UIHandler = UIHandler;
            this.MsgBox = MsgBox;
            this.FDialog = FDialog;
            Error.Init(MsgBox);

            Init(RunningPlatform);

            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.UnhandledException += HandleUnhandledException;

            ProjectManager.BrightnessCalculated += CurrentProject_BrightnessCalculated;
            ProjectManager.FramesLoaded += CurrentProject_FramesLoaded;
            ProjectManager.ProgressChanged += CurrentProject_ProgressChanged;
            ProjectManager.WorkDone += CurrentProject_WorkDone;
            MsgBox.InfoTextChanged += MsgBox_InfoTextChanged;
        }
コード例 #2
0
 public void Click_OpenProject()
 {
     if (CheckBusy())
     {
         return;
     }
     using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.OpenFile, Message.GetString("Open Project")))
     {
         fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("LapseStudio Project"), "lasp"));
         if (Directory.Exists(LSSettings.LastProjDir))
         {
             fdlg.InitialDirectory = LSSettings.LastProjDir;
         }
         if (fdlg.Show() == WindowResponse.Ok)
         {
             LSSettings.LastProjDir = System.IO.Path.GetDirectoryName(fdlg.SelectedPath);
             LSSettings.Save();
             ProjectSavePath = fdlg.SelectedPath;
             OpeningProject();
         }
     }
     SetSaveStatus(true);
 }
コード例 #3
0
 public SettingsUI(MessageBox MsgBox, FileDialog FileDlg)
 {
     this.MsgBox  = MsgBox;
     this.FileDlg = FileDlg;
 }
コード例 #4
0
        public void OpenMetaData(int index)
        {
            if (LSSettings.UsedProgram == ProjectType.CameraRaw)
            {
                XMP CurXmp = ((FrameACR)ProjectManager.CurrentProject.Frames[index]).XMPFile;
                if (CurXmp == null || (CurXmp != null && CurXmp.Values.Count == 0))
                {
                    WindowResponse res = MsgBox.Show(Message.GetString(@"No XMP associated with this file. Do you want to reload to check if there is one now?
Yes reloads the files XMP values.
No lets you load values from a standalone XMP file."), MessageWindowType.Question, MessageWindowButtons.YesNoCancel);
                    if (res == WindowResponse.Yes)
                    {
                        ProjectManager.ReadXMP(); return;
                    }
                    else if (res == WindowResponse.Cancel)
                    {
                        return;
                    }

                    using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.OpenFile, Message.GetString("Open XMP")))
                    {
                        fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("XMP"), "xmp", "XMP"));
                        if (Directory.Exists(LSSettings.LastMetaDir))
                        {
                            fdlg.InitialDirectory = LSSettings.LastMetaDir;
                        }

                        if (fdlg.Show() == WindowResponse.Ok)
                        {
                            LSSettings.LastMetaDir = Path.GetDirectoryName(fdlg.SelectedPath);
                            LSSettings.Save();
                            ProjectManager.AddKeyframe(index, fdlg.SelectedPath);
                        }
                    }
                }
                else
                {
                    ProjectManager.AddKeyframe(index);
                }
            }
            else if (LSSettings.UsedProgram == ProjectType.RawTherapee)
            {
                using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.OpenFile, Message.GetString("Open PP3")))
                {
                    fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("Postprocessing Profile"), "PP3", "pp3"));
                    if (Directory.Exists(LSSettings.LastMetaDir))
                    {
                        fdlg.InitialDirectory = LSSettings.LastMetaDir;
                    }

                    if (fdlg.Show() == WindowResponse.Ok)
                    {
                        LSSettings.LastMetaDir = Path.GetDirectoryName(fdlg.SelectedPath);
                        LSSettings.Save();
                        ProjectManager.AddKeyframe(index, fdlg.SelectedPath);
                    }
                }
            }
            else
            {
                ProjectManager.AddKeyframe(index);
            }

            if (ProjectManager.CurrentProject.Frames[index].IsKeyframe)
            {
                MsgBox.ShowMessage(MessageContent.KeyframeAdded);
            }
            else
            {
                MsgBox.ShowMessage(MessageContent.KeyframeNotAdded);
            }
        }
コード例 #5
0
        public LapseStudioUI(Platform RunningPlatform, IUIHandler UIHandler, MessageBox MsgBox, FileDialog FDialog)
        {
            this.UIHandler = UIHandler;
            this.MsgBox    = MsgBox;
            this.FDialog   = FDialog;
            Error.Init(MsgBox);

            Init(RunningPlatform);

            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.UnhandledException += HandleUnhandledException;

            ProjectManager.BrightnessCalculated += CurrentProject_BrightnessCalculated;
            ProjectManager.FramesLoaded         += CurrentProject_FramesLoaded;
            ProjectManager.ProgressChanged      += CurrentProject_ProgressChanged;
            ProjectManager.WorkDone             += CurrentProject_WorkDone;
            MsgBox.InfoTextChanged += MsgBox_InfoTextChanged;
        }
コード例 #6
0
        public void ProcessFiles()
        {
            bool ask = true;

            if (LSSettings.UsedProgram == ProjectType.CameraRaw)
            {
                ask = false;
            }
            else if (LSSettings.UsedProgram == ProjectType.LapseStudio)
            {
                ask = true;
                ((ProjectLS)ProjectManager.CurrentProject).SaveFormat = LSSettings.SaveFormat;
            }
            else if (LSSettings.UsedProgram == ProjectType.RawTherapee)
            {
                if (!File.Exists(LSSettings.RTPath))
                {
                    string NewRTPath = ProjectRT.SearchForRT();
                    if (NewRTPath != null)
                    {
                        LSSettings.RTPath = NewRTPath;
                        LSSettings.Save();
                        ((ProjectRT)ProjectManager.CurrentProject).RTPath = NewRTPath;
                    }
                    else
                    {
                        MsgBox.Show(Message.GetString("RawTherapee can't be found. Abort!"));
                        return;
                    }
                }
                ask = ((ProjectRT)ProjectManager.CurrentProject).RunRT;
                ((ProjectRT)ProjectManager.CurrentProject).SaveFormat = LSSettings.SaveFormat;
            }

            if (ask)
            {
                using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.SelectFolder, Message.GetString("Select Folder")))
                {
                    if (Directory.Exists(LSSettings.LastProcDir))
                    {
                        fdlg.InitialDirectory = LSSettings.LastProcDir;
                    }
                    if (fdlg.Show() == WindowResponse.Ok)
                    {
                        LSSettings.LastProcDir = fdlg.SelectedPath;
                        LSSettings.Save();
                        if (ProjectManager.CurrentProject.IsBrightnessCalculated)
                        {
                            ProjectManager.SetAltBrightness(MainGraph.Points);
                        }
                        ProjectManager.ProcessFiles(fdlg.SelectedPath);
                    }
                }
            }
            else
            {
                if (ProjectManager.CurrentProject.IsBrightnessCalculated)
                {
                    ProjectManager.SetAltBrightness(MainGraph.Points);
                }
                ProjectManager.ProcessFiles();
            }
            SetSaveStatus(false);
        }
コード例 #7
0
ファイル: SettingsUI.cs プロジェクト: ivynetca/lapsestudio
 public SettingsUI(MessageBox MsgBox, FileDialog FileDlg)
 {
     this.MsgBox = MsgBox;
     this.FileDlg = FileDlg;
 }