4 #include "nlite_include.h"
10 CNicoVideoAuth::CNicoVideoAuth()
11 :nicoVideoAuth(NicoVideoAuth_new()){}
15 CNicoVideoAuth::~CNicoVideoAuth(){
17 NicoVideoAuth_delete(&nicoVideoAuth);
20 LPCTSTR CNicoVideoAuth::GetUserSession(){
22 return NicoVideoAuth_getUserSession(nicoVideoAuth);
26 VOID CNicoVideoAuth::SetBrowserType(BROWSERTYPE bt){
29 rslt = NicoVideoAuth_getNicoVideoAuth(nicoVideoAuth,bt);
30 if(rslt != NLIB_ERR_OK){
32 throw NLIBException(TEXT("
\83j
\83R
\83j
\83R
\93®
\89æ
\94F
\8fØ
\8fî
\95ñ
\8eæ
\93¾
\82É
\8e¸
\94s
\82µ
\82Ü
\82µ
\82½"),rslt,__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
41 BOOL CCommentMaker::SetChatString(LPCTSTR chatString){
43 if(this->chatString.Length() != 0)return FALSE;
44 this->chatString = chatString;
49 BOOL CCommentMaker::AddMail(LPCTSTR mail){
51 mailsBuffer.push_back(mail);
52 mails.push_back(mailsBuffer.back());
57 BOOL CCommentMaker::AddExAttribute(LPCTSTR name,LPCTSTR value){
59 exAttributeBuffer.push_back(name);
60 exAttribute.push_back(exAttributeBuffer.back());
61 exAttributeBuffer.push_back(value);
62 exAttribute.push_back(exAttributeBuffer.back());
67 NicoVideoAuth_P CNicoVideoAuth::GetAuth(){
69 return this->nicoVideoAuth;
74 CNicoLiveStream::CNicoLiveStream()
75 :self(NicoLiveStream_new())
80 CNicoLiveStream::~CNicoLiveStream(){
82 NicoLiveStream_delete(&self);
87 VOID CNicoLiveStream::SetResFrom(INT_PTR res_from){
89 NicoLiveStrream_setResFrom(self,res_from);
93 INT_PTR CNicoLiveStream::GetResFrom(){
95 return NicoLiveStream_getResFrom(self);
98 NLIB_RESULT CNicoLiveStream::Connect(CNicoVideoAuth &nicoVideoAuth,LPCTSTR url,NicoRecvCallBack callback,LPVOID userData){
102 return NicoLiveStream_connect(self,nicoVideoAuth.GetAuth(),url,callback,userData);
109 VOID CNicoLiveStream::SetHeartBeatMsec(DWORD msec){
111 NicoLiveStream_setHeartBeatMsec(self,msec);
116 DWORD CNicoLiveStream::GetHeartBeatMsec(){
118 return NicoLiveStream_getHeartBeatMsec(self);
122 VOID CNicoLiveStream::SetHeartBeatFlag(BOOL flag){
124 NicoLiveStream_setHeartBeatFlag(self,flag);
130 BOOL CNicoLiveStream::GetHeartBeatFlag(){
132 return NicoLiveStream_getHeartBeatFlag(self);
136 VOID CNicoLiveStream::SetKeapALiveMsec(DWORD msec){
138 NicoLiveStream_setKeapALiveMsec(self,msec);
144 DWORD CNicoLiveStream::GetKeapALiveMsec(){
146 return NicoLiveStream_getKeapALiveMsec(self);
151 VOID CNicoLiveStream::SetKeapAliveFlag(BOOL flag){
153 NicoLiveStream_setKeapALiveFlag(self,flag);
158 BOOL CNicoLiveStream::GetKeapAliveFlag(){
160 return NicoLiveStream_getKeapALiveFlag(self);
166 NLIB_RESULT CNicoLiveStream::SendHeartBeat(){
168 return NicoLiveStream_sendHeartBeat(self);
172 VOID CNicoLiveStream::DisConnect(){
174 NicoLiveStream_disConnect(self);
178 NLIB_RESULT CNicoLiveStream::SendChat(CCommentMaker &commentMaker){
179 commentMaker.mails.push_back(NULL);
180 commentMaker.exAttribute.push_back(NULL);
181 return NicoLiveStream_sendChat(self,commentMaker.chatString,&commentMaker.mails[0],&commentMaker.exAttribute[0]);
186 NLIB_RESULT CNicoLiveStream::SendOwnerChat(CCommentMaker &commentMaker){
187 commentMaker.mails.push_back(NULL);
188 commentMaker.exAttribute.push_back(NULL);
189 return NicoLiveStream_sendOwnerChat(self,commentMaker.chatString,&commentMaker.mails[0],&commentMaker.exAttribute[0]);
194 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82ÌID
\82ð
\8eæ
\93¾
196 LPCTSTR CNicoLiveStream::GetId(){
198 return NicoLiveStream_getId(self);
203 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83R
\83~
\83\85\83j
\83e
\83B
\94Ô
\8d\86\82ð
\8eæ
\93¾
205 LPCTSTR CNicoLiveStream::GetDefaultCommunity(){
207 return NicoLiveStream_getDefaultCommunity(self);
212 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83v
\83\8d\83o
\83C
\83_
\83^
\83C
\83v
\82ð
\8eæ
\93¾
214 PROVIDERTYPE CNicoLiveStream::GetProviderType(){
216 return NicoLiveStream_getProviderType(self);
221 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83I
\81[
\83i
\81[
\83t
\83\89\83O
\82ð
\8eæ
\93¾
223 BOOL CNicoLiveStream::IsOwner(){
225 return NicoLiveStream_isOwner(self);
229 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\8aJ
\8en
\8e\9e\8d\8f\82ð
\8eæ
\93¾
231 time_t CNicoLiveStream::GetStartTime(){
233 return NicoLiveStream_getStartTime(self);
237 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\8fI
\97¹
\8e\9e\8d\8f\82ð
\8eæ
\93¾
239 time_t CNicoLiveStream::GetEndTime(){
241 return NicoLiveStream_getEndTime(self);
245 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\8aJ
\8fê
\8e\9e\8d\8f\82ð
\8eæ
\93¾
247 time_t CNicoLiveStream::GetOpenTime(){
249 return NicoLiveStream_getOpenTime(self);
254 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83x
\81[
\83X
\8e\9e\8d\8f\82ð
\8eæ
\93¾
256 time_t CNicoLiveStream::GetBaseTime(){
258 return NicoLiveStream_getBaseTime(self);
263 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83^
\83C
\83g
\83\8b\8eæ
\93¾
265 LPCTSTR CNicoLiveStream::GetTitle(){
267 return NicoLiveStream_getTitle(self);
270 BOOL CNicoLiveStream::IsPremium(){
272 return NicoLiveStream_isPremium(self);