예제 #1
0
 private static bool CheckMidiOutput()
 {
     if (OutputDevice.DeviceCount == 0)
     {
         UiManager.ThrowError("No MIDI output devices available.");
         Unload();
         return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #2
0
 internal static void Continue()
 {
     try
     {
         IsPlaying = true;
         sequencer.Continue();
         Timer.Start();
     }
     catch (Exception ex)
     {
         UiManager.ThrowError(ex.Message);
     }
 }
예제 #3
0
 internal static void Stop()
 {
     try
     {
         IsPlaying = false;
         sequencer.Stop();
         Timer.Stop();
     }
     catch (Exception ex)
     {
         UiManager.ThrowError(ex.Message);
     }
 }
예제 #4
0
 private static void InitOutputDevice()
 {
     try
     {
         outDevice = new OutputDevice(
             int.Parse(ConfigurationManager.AppSettings["outDeviceID"])
             );
     }
     catch (Exception ex)
     {
         UiManager.ThrowError(ex.Message);
         Unload();
     }
 }
예제 #5
0
 // TODO open file dialog to select save name
 internal static void SaveFile(string fileName)
 {
     Stop();
     try
     {
         // sequence.SaveAsync(fileName);
     }
     catch (Exception ex)
     {
         UiManager.ThrowError(ex.Message);
     }
     // on success
     UiManager.mainWindow.DisableUserInterractions();
 }