Esempio n. 1
0
        public void SetInput(DirectoryInfo aDirectoryInfo)
        {
            for (int i = directoryInfoRecentList.Count - 1; i >= 0; i--)
            {
                if (directoryInfoRecentList[i].FullName == aDirectoryInfo.FullName)
                {
                    directoryInfoRecentList.RemoveAt(i);
                }
            }

            directoryInfoRecentList.Insert(0, aDirectoryInfo);

            if (directoryInfoRecentList.Count > 5)
            {
                directoryInfoRecentList.RemoveAt(5);
            }

            try
            {
                using (StreamWriter u = new StreamWriter(Application.streamingAssetsPath + "/Config/Player.ini", false))
                {
                    foreach (DirectoryInfo l in directoryInfoRecentList)
                    {
                        u.WriteLine(l.FullName);
                    }
                }
            }
            catch (Exception aExpection)
            {
                Logger.BreakDebug("Exception:" + aExpection);
                Logger.BreakDebug("Failed write Player.ini");
            }

            componentPlaylist = new ComponentPlaylist(aDirectoryInfo, PlayMusic, GetPlayingMusic);
        }
Esempio n. 2
0
        public ApplicationPlayer(DirectoryInfo aDirectoryInfo, MeshFilter aMeshFilter, MeshRenderer aMeshRenderer)
        {
            directoryInfoRecentList = new List <DirectoryInfo>();

            ReadListDirectoryInfoRecent();

            if (directoryInfoRecentList.Count == 0)
            {
                directoryInfoRecentList.Add(aDirectoryInfo);
            }

            menu                  = new MenuBar(Application.streamingAssetsPath + "/Language/Player/Menu/MenuBar.language", this);
            componentPlayer       = new ComponentPlayer(ChangeMusicPrevious, ChangeMusicNext);
            componentPlaylist     = new ComponentPlaylist(directoryInfoRecentList[0], SetFileInfoPlaying, GetFileInfoPlaying);
            componentDirectoryBar = new ComponentDirectoryBar(SetDirectoryInfo, directoryInfoRecentList);

            Rect = new Rect(0.0f, 0.0f, 0.0f, 0.0f);
        }
Esempio n. 3
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]);
        }
Esempio n. 4
0
 private void SetDirectoryInfo(DirectoryInfo aDirectoryInfo)
 {
     Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
     SetInput(aDirectoryInfo);
     componentPlaylist = new ComponentPlaylist(aDirectoryInfo, SetFileInfoPlaying, GetFileInfoPlaying);
 }