public SongParser()
 {
     _madmomProcess = new MadmomProcess()
     {
     };
     _vampProcessEnergies = new VampProcess();
     _vampProcessSegments = new VampProcess();
 }
 public BeatStructureMadmom(
     UserSongClip userSong,
     MadmomProcess madmomProcess,
     VampProcess vampProcessSegments,
     VampProcess vampProcessEnergies)
 {
     this._madmomProcess       = madmomProcess;
     this._userSong            = userSong;
     this._vampProcessSegments = vampProcessSegments;
     this._vampProcessEnergies = vampProcessEnergies;
     this._isBuilt             = false;
 }
Пример #3
0
        public void ApplyCoroutine(
            string pluginId,
            string musicPath,
            Action onFinished)
        {
            VampProcess vampProcess = this;

            File.Delete(vampProcess.outputPath);
            string str = $" -d {pluginId} \"{musicPath}\" -w csv --csv-force --csv-one-file \"{vampProcess.outputPath}\"";

            vampProcess._process = new Process();
            vampProcess._process.StartInfo.FileName = vampProcess.vampToolPath;
            vampProcess._process.StartInfo.RedirectStandardOutput            = true;
            vampProcess._process.StartInfo.UseShellExecute                   = false;
            vampProcess._process.StartInfo.CreateNoWindow                    = true;
            vampProcess._process.StartInfo.EnvironmentVariables["VAMP_PATH"] = vampProcess.vampPluginPath;
            vampProcess._process.StartInfo.Arguments = str;
            vampProcess._process.EnableRaisingEvents = true;
            // ISSUE: reference to a compiler-generated method
            //vampProcess._process.Exited += new EventHandler(vampProcess.\u003CApplyCoroutine\u003Eb__12_0);
            vampProcess.isProcessComplete = false;
            vampProcess._process.Start();
            while (!vampProcess.isProcessComplete && !vampProcess._process.HasExited)
            {
            }
            if ((vampProcess._process.ExitCode != 0 ? 0 : (File.Exists(vampProcess.outputPath) ? 1 : 0)) != 0)
            {
                vampProcess._resultEntries = File.ReadAllLines(vampProcess.outputPath);
                vampProcess._process.Close();
                onFinished.Invoke();
            }
            else
            {
                vampProcess._process.Close();
                throw new Exception("PROCESOR_ANALYSISERROR: There was an error analyzing the music file.");
            }
        }