Esempio n. 1
0
        Ust Process(Atlas atlas, Ust initUst)
        {
            Log("Converter", "Start processing...");
            Ust ust = initUst.Clone();

            MakeEnds = MainWindow.MakeEnds.IsChecked.Value;
            if (int.TryParse(MainWindow.NewLengthDefault.Text, out int result))
            {
                TransLength = result;
            }
            SeparateLyric(ust);
            Converting(ust);
            AdjustLength(ust);
            Log("Converter", "Processing completed.");
            return(ust);
        }
Esempio n. 2
0
 public void SetWindow(MainWindow mainWindow)
 {
     Log("Core", "Initiating...");
     Log("Core", "Start reading files...");
     MainWindow      = mainWindow;
     mainWindow.Core = this;
     Log("Atlas", "Reading atlas...");
     try
     {
         Atlas = new Atlas(Dir);
     }
     catch (Exception ex)
     {
         Log("Atlas", $"{ex.Message }\r\n{ex.Source}\r\n{ex.TargetSite}\r\n{ex.StackTrace}", true);
         return;
     }
     Log("Atlas", "Reading complited.");
     Log("Dict", "Start reading...");
     try
     {
         Dict = new Dict();
     }
     catch (Exception ex)
     {
         Log("Dict", $"{ex.Message }\r\n{ex.Source}\r\n{ex.TargetSite}\r\n{ex.StackTrace}", true);
         return;
     }
     Log("Dict", "Reading complited.");
     Log("Ust", "Start reading...");
     try
     {
         Ust = new Ust(Dir);
     }
     catch (Exception ex)
     {
         Log("Ust", $"{ex.Message }\r\n{ex.Source}\r\n{ex.TargetSite}\r\n{ex.StackTrace}", true);
         return;
     }
     Log("Ust", "Reading complited.");
     Log("Singer", "Start reading...");
     try
     {
         Singer = new Singer(Ust.VoiceDir);
     }
     catch (Exception ex)
     {
         Log("Singer", $"{ex.Message }\r\n{ex.Source}\r\n{ex.TargetSite}\r\n{ex.StackTrace}", true);
         return;
     }
     Log("Singer", "Reading complited.");
     Log("Ust", "Reading complited.");
     Log("Core", "Reading files complited.");
     Log("Core", "Initiating values...");
     try
     {
         mainWindow.NewLengthDefault.Text      = TransLength.ToString();
         mainWindow.ChangeSingerButton.ToolTip = Singer.Name;
         InitUst = Ust.Clone();
         MainWindow.SetText(Ust.Notes);
         ConvertedUst = Process(Atlas, Ust);
         MainWindow.DrawNotes(Ust.Notes, ConvertedUst.Notes);
         MainWindow.OnNoteChanged   += OnNoteChanged_Core;
         MainWindow.OnTextChanged   += OnTextChanged_Core;
         MainWindow.OnSave          += Core_OnSave;
         mainWindow.OnLengthChanged += delegate(int length) { TransLength = length; };
         mainWindow.OnSingerChanged += MainWindow_OnSingerChanged;
         TransLength = (int)Ust.Tempo * 180 / 120;
         mainWindow.NewLengthDefault.Text = TransLength.ToString();
     }
     catch (Exception ex)
     {
         Log("Core", $"{ex.Message }\r\n{ex.Source}\r\n{ex.TargetSite}\r\n{ex.StackTrace}", true);
         return;
     }
     Log("Core", "Initiated.");
 }