Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
 public ThinkgearController(FixedSizedQueue <int> attentionBuffer)
 {
     this.attentionBuffer = attentionBuffer;
 }
Exemplo n.º 3
0
 public MusicController(FixedSizedQueue <int> attentionBuffer, TokenInfo tokenInfo)
 {
     this.attentionBuffer = attentionBuffer;
     spotifyController    = new SpotifyController(tokenInfo);
 }