Esempio n. 1
0
        public ApplicationLoopEditor(DirectoryInfo aDirectoryInfoInput, DirectoryInfo aDirectoryInfoOutput)
        {
            player = new PlayerNull();
            directoryInfoRecentInputList  = new List <DirectoryInfo>();
            directoryInfoRecentOutputList = new List <DirectoryInfo>();
            tooltipPrevious = "";

            try
            {
                using (StreamReader u = new StreamReader(Application.streamingAssetsPath + "/Config/LoopToolInput.ini"))
                {
                    for (string line = u.ReadLine(); line != null; line = u.ReadLine())
                    {
                        if (Directory.Exists(line) == true)
                        {
                            directoryInfoRecentInputList.Add(new DirectoryInfo(line));

                            if (directoryInfoRecentInputList.Count >= 5)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception aExpection)
            {
                Logger.BreakDebug("Exception:" + aExpection);

                using (StreamWriter u = new StreamWriter(Application.streamingAssetsPath + "/Config/LoopToolInput.ini"))
                {
                    Logger.BreakDebug("Create LoopToolInput.ini");
                }
            }

            try
            {
                using (StreamReader u = new StreamReader(Application.streamingAssetsPath + "/Config/LoopToolOutput.ini"))
                {
                    for (string line = u.ReadLine(); line != null; line = u.ReadLine())
                    {
                        if (Directory.Exists(line) == true)
                        {
                            directoryInfoRecentOutputList.Add(new DirectoryInfo(line));

                            if (directoryInfoRecentOutputList.Count >= 5)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception aExpection)
            {
                using (StreamWriter u = new StreamWriter(Application.streamingAssetsPath + "/Config/LoopToolOutput.ini"))
                {
                    Logger.BreakDebug("Exception:" + aExpection);
                    Logger.BreakDebug("Create LoopToolOutput.ini");
                }
            }

            if (directoryInfoRecentInputList.Count == 0)
            {
                directoryInfoRecentInputList.Add(aDirectoryInfoInput);
            }

            if (directoryInfoRecentOutputList.Count == 0)
            {
                directoryInfoRecentOutputList.Add(aDirectoryInfoOutput);
            }

            mode = Mode.Search;
            menu = new MenuBar(Application.streamingAssetsPath + "/Language/LoopTool/Menu/MenuBar.language", this);
            componentLoopPlayer         = new ComponentPlayer(ChangeMusicPrevious, ChangeMusicNext);
            componentLoopEditor         = new ComponentLoopEditor(ChangeMusicPrevious, ChangeMusicNext);
            componentLoopSelector       = new ComponentLoopSelector(componentLoopEditor);
            componentDirectoryBarInput  = new ComponentDirectoryBar(SetInput, directoryInfoRecentInputList);
            componentDirectoryBarOutput = new ComponentDirectoryBar(SetOutput, directoryInfoRecentOutputList);

            componentInputlist = new ComponentInputlist(directoryInfoRecentInputList[0], PlayMusic, GetPlayingMusic);
            componentPlaylist  = new ComponentPlaylist(directoryInfoRecentOutputList[0], PlayMusic, GetPlayingMusic);

            componentLoopSearch = new ComponentLoopSearch(componentInputlist, componentPlaylist);
            componentLoopSave   = new ComponentLoopSave(componentPlaylist);

            SetInput(directoryInfoRecentInputList[0]);
            SetOutput(directoryInfoRecentOutputList[0]);
        }