Twitch SDK (Internal)
gamestreamstask.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
12 
13 namespace ttv
14 {
15  namespace broadcast
16  {
17  class GameStreamsTask;
18  }
19 }
20 
22 {
23 public:
25  {
26  std::string channelUrl;
27  std::string previewUrlTemplate;
28  std::string streamTitle;
29  std::string channelDisplayName;
30  unsigned int viewerCount;
31  };
32  typedef std::vector<LiveGameStreamInfo> LiveGameStreamList;
33 
34  struct Result
35  {
36  LiveGameStreamList streams;
37  };
38 
39  typedef std::function<void(GameStreamsTask* source, TTV_ErrorCode ec, const std::shared_ptr<Result>& result)> Callback;
40 
41 public:
42  GameStreamsTask(const std::string& gameName, uint limit, uint offset, Callback callback);
43 
44  virtual void OnComplete() override;
45  virtual const char* GetTaskName() const override { return "GameStreamsTask"; }
46 
47 protected:
48  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
49  virtual void ProcessResponse(uint status, const std::vector<char>& response) override;
50 
51 private:
52  std::shared_ptr<Result> mResult;
54 
55  std::string mGameName;
58 };
virtual const char * GetTaskName() const override
Definition: gamestreamstask.h:45
virtual void ProcessResponse(uint status, const std::vector< char > &response) override
Definition: gamestreamstask.h:21
Definition: httptask.h:19
std::string channelDisplayName
Definition: gamestreamstask.h:29
GameStreamsTask(const std::string &gameName, uint limit, uint offset, Callback callback)
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
std::string previewUrlTemplate
Definition: gamestreamstask.h:27
std::string mGameName
Definition: gamestreamstask.h:55
uint mLimit
Definition: gamestreamstask.h:56
uint mOffset
Definition: gamestreamstask.h:57
std::shared_ptr< Result > mResult
Definition: gamestreamstask.h:52
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
LiveGameStreamList streams
Definition: gamestreamstask.h:36
std::string channelUrl
Definition: gamestreamstask.h:26
unsigned int uint
Definition: coretypes.h:18
Callback mCallback
Definition: gamestreamstask.h:53
std::function< void(GameStreamsTask *source, TTV_ErrorCode ec, const std::shared_ptr< Result > &result)> Callback
Definition: gamestreamstask.h:39
virtual void OnComplete() override
Definition: gamestreamstask.h:34
Definition: httptask.h:22
std::vector< LiveGameStreamInfo > LiveGameStreamList
Definition: gamestreamstask.h:32
unsigned int viewerCount
Definition: gamestreamstask.h:30
std::string streamTitle
Definition: gamestreamstask.h:28