コード例 #1
0
        /// <summary>
        /// Stop all processes.
        /// </summary>
        public void Stop()
        {
            AudioRecording.StopRecording();
            API_Helper.StopAPI();
            cts.Cancel();

            EmptyBuffer();
        }
コード例 #2
0
        /// <summary>
        /// Start the all processes.
        /// </summary>
        /// <param name="webView">WebView which renders the music sheet.</param>
        public void Start(WebView webView)
        {
            if (DevFlags.LoggingEnabled)
            {
                Logger.Log("Starting now");
            }
            TimeHelper.SetStartTime();
            TimeHelper.SetStartTime_Analysis();

            AudioRecording.StartRecording();
            API_Helper.StartAPI();
            DataAnalyzer.AnalyseAsync(cts.Token, webView);
        }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// <para>Initialises all fields.</para>
        /// </summary>
        /// <param name="song">Song that was serialised from the "SongName.xml".</param>
        public UtilityHelper(Song song, ProgressBar progressBar)
        {
            //Init Buffer
            AudioBuffer  = new AudioBuffer();
            ResultBuffer = new ResultBuffer();

            //Init Classes
            AudioRecording = new AudioRecording(AudioBuffer);
            API_Helper     = new API_Helper(AudioBuffer, ResultBuffer, ConfigFileHelper.ConfigApiAddress);
            DataAnalyzer   = new DataAnalyzer(ResultBuffer);

            SongHelper.InitHelper(song);
            SongHelper.ProgressMade += OnProgressMade;

            _progressBar = progressBar;

            cts = new CancellationTokenSource();
        }