public void StartProcessing(CancellationToken cancellationToken = default) { try { var attentionBuffer = new FixedSizedQueue <int>(20); var thinkgearController = new ThinkgearController(attentionBuffer); var volumeController = new MusicController(attentionBuffer, tokenInfo); var playlistController = new MusicController(attentionBuffer, tokenInfo); thinkgearController.InitConnection(); Task task1 = Task.Factory.StartNew(() => thinkgearController.CollectData()); Task task2 = Task.Factory.StartNew(() => volumeController.ControlVolume()); Task taks3 = Task.Factory.StartNew(() => playlistController.ControlPlaylist()); } catch (Exception ex) { ProcessCancellation(); } }
public ThinkgearController(FixedSizedQueue <int> attentionBuffer) { this.attentionBuffer = attentionBuffer; }
public MusicController(FixedSizedQueue <int> attentionBuffer, TokenInfo tokenInfo) { this.attentionBuffer = attentionBuffer; spotifyController = new SpotifyController(tokenInfo); }