OSDN Git Service

ソースの文字コードと改行コードを修正
authoryukihane <yukihane.feather@gmail.com>
Tue, 2 Aug 2011 09:22:09 +0000 (18:22 +0900)
committeryukihane <yukihane.feather@gmail.com>
Wed, 3 Aug 2011 09:46:39 +0000 (18:46 +0900)
28 files changed:
vhook/chat/chat.c
vhook/chat/chat.h
vhook/chat/chat_slot.c
vhook/chat/chat_slot.h
vhook/chat/process_chat.c
vhook/chat/process_chat.h
vhook/comment/com_surface.c
vhook/comment/com_surface.h
vhook/comment/shadow.c
vhook/comment/shadow.h
vhook/comment/surf_util.c
vhook/comment/surf_util.h
vhook/common/framehook_ext.h
vhook/docs/nicoplayer.swf.readme [new file with mode: 0644]
vhook/docs/nicoplayer.swf.source [new file with mode: 0644]
vhook/framehook.c
vhook/framehook.h
vhook/header.h
vhook/main.c
vhook/main.h
vhook/mydef.h
vhook/nbproject/project.xml
vhook/nicodef.h
vhook/process.c
vhook/process.h
vhook/struct_define.h
vhook/util.c
vhook/util.h

index 1ee9448..844daec 100644 (file)
-#include <SDL/SDL_endian.h>\r
-#include <stdio.h>\r
-\r
-#include <stdlib.h>\r
-#include "chat.h"\r
-#include "../mydef.h"\r
-#include "../nicodef.h"\r
-\r
-int initChat(FILE* log,CHAT* chat,const char* file_path,CHAT_SLOT* slot,int video_length){\r
-       int i;\r
-       int max_no = INTEGER_MIN;\r
-       int min_no = INTEGER_MAX;\r
-       int max_item;\r
-       chat->slot = slot;\r
-       FILE* com_f = fopen(file_path,"rb");\r
-       if(com_f == NULL){\r
-               fputs("[chat/init]failed to open comment file.\n",log);\r
-               return FALSE;\r
-       }\r
-       /*\97v\91f\90\94\82Ì\8eæ\93¾*/\r
-       if(fread(&max_item,sizeof(max_item),1,com_f) <= 0){\r
-               fputs("[chat/init]failed to read the number of comments.\n",log);\r
-               return FALSE;\r
-       }\r
-       max_item = SDL_SwapLE32(max_item);\r
-       fprintf(log,"[chat/init]%d comments.\n",max_item);\r
-       chat->max_item = max_item;\r
-       //\83A\83C\83e\83\80\94z\97ñ\82Ì\8am\95Û\r
-       chat->item = malloc(sizeof(CHAT_ITEM) * max_item);\r
-       if(chat->item == NULL){\r
-               fputs("[chat/init]failed to malloc for comment.\n",log);\r
-               return FALSE;\r
-       }\r
-       /*\8cÂ\95Ê\97v\91f\82Ì\8f\89\8aú\89»*/\r
-       CHAT_ITEM* item;\r
-       int no;\r
-       int vpos;\r
-       int location;\r
-       int size;\r
-       int color;\r
-       int str_length;\r
-       Uint16* str;\r
-       for(i=0;i<max_item;i++){\r
-               item = &chat->item[i];\r
-               item->chat = chat;\r
-               item->showed = FALSE;\r
-               //\83R\83\81\83\93\83g\94Ô\8d\86\r
-               if(fread(&no,sizeof(no),1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment number.\n",log);\r
-                       return FALSE;\r
-               }\r
-               no = SDL_SwapLE32(no);\r
-               max_no = MAX(max_no,no);\r
-               min_no = MIN(min_no,no);\r
-               //vpos\r
-               if(fread(&vpos,sizeof(vpos),1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment vpos.\n",log);\r
-                       return FALSE;\r
-               }\r
-               vpos = SDL_SwapLE32(vpos);\r
-               //\95\8e\9a\82Ì\8fê\8f\8a\r
-               if(fread(&location,sizeof(location),1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment location.\n",log);\r
-                       return FALSE;\r
-               }\r
-               location = SDL_SwapLE32(location);\r
-               //\83T\83C\83Y\r
-               if(fread(&size,sizeof(size),1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment size.\n",log);\r
-                       return FALSE;\r
-               }\r
-               size = SDL_SwapLE32(size);\r
-               //\90F\r
-               if(fread(&color,sizeof(color),1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment color.\n",log);\r
-                       return FALSE;\r
-               }\r
-               color = SDL_SwapLE32(color);\r
-               //\95\8e\9a\90\94\r
-               if(fread(&str_length,sizeof(str_length),1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment length.\n",log);\r
-                       return FALSE;\r
-               }\r
-               str_length = SDL_SwapLE32(str_length);\r
-               //\95\8e\9a\97ñ\r
-               str = malloc(str_length);\r
-               if(str == NULL){\r
-                       fputs("[chat/init]failed to malloc for comment text.\n",log);\r
-                       return FALSE;\r
-               }\r
-               if(fread(str,str_length,1,com_f) <= 0){\r
-                       fputs("[chat/init]failed to read comment text.\n",log);\r
-                       return FALSE;\r
-               }\r
-               //\95Ï\90\94\83Z\83b\83g\r
-               item->no = no;\r
-               item->vpos = vpos;\r
-               item->location = location;\r
-               item->size = size;\r
-               item->color = color;\r
-               item->str = str;\r
-               /*\93à\95\94\8f\88\97\9d\82æ\82è*/\r
-               if(location != CMD_LOC_DEF){\r
-                       item->vstart = vpos;\r
-                       item->vend = vpos + TEXT_SHOW_SEC - TEXT_AHEAD_SEC;\r
-               }else{\r
-                       item->vstart = vpos - TEXT_AHEAD_SEC;\r
-                       item->vend = item->vstart + TEXT_SHOW_SEC;\r
-               }\r
-               int fix = item->vend - video_length;\r
-               if(fix > 0){\r
-                       item->vend -= fix;\r
-                       item->vpos -= fix;\r
-                       item->vstart -= fix;\r
-                       fprintf(log,"[chat/fix]comment %d time adjusted.\n",i);\r
-               }\r
-               /*\93à\95\94\8f\88\97\9d\82æ\82è\81@\82¨\82í\82è*/\r
-       }\r
-       fclose(com_f);\r
-       chat->max_no = max_no;\r
-       chat->min_no = min_no;\r
-       return TRUE;\r
-}\r
-\r
-void closeChat(CHAT* chat){\r
-       int i;\r
-       int max_item = chat->max_item;\r
-       for(i=0;i<max_item;i++){\r
-               free((void*)chat->item[i].str);\r
-       }\r
-       free(chat->item);\r
-}\r
-\r
-/*\r
- * \83C\83e\83\8c\81[\83^\82ð\83\8a\83Z\83b\83g\82·\82é\81B\r
- */\r
-void resetChatIterator(CHAT* chat){\r
-       chat->iterator_index = 0;\r
-}\r
-/*\r
- * \83C\83e\83\8c\81[\83^\82ð\93¾\82é\r
- */\r
-CHAT_ITEM* getChatShowed(CHAT* chat,int now_vpos){\r
-       int *i = &chat->iterator_index;\r
-       int max_item = chat->max_item;\r
-       CHAT_ITEM* item;\r
-       for(;*i<max_item;(*i)++){\r
-               item = &chat->item[*i];\r
-               if(now_vpos >= item->vstart && now_vpos <= item->vend && !item->showed){\r
-                       return item;\r
-               }\r
-       }\r
-       return NULL;\r
-}\r
+#include <SDL/SDL_endian.h>
+#include <stdio.h>
+
+#include <stdlib.h>
+#include "chat.h"
+#include "../mydef.h"
+#include "../nicodef.h"
+
+int initChat(FILE* log,CHAT* chat,const char* file_path,CHAT_SLOT* slot,int video_length){
+       int i;
+       int max_no = INTEGER_MIN;
+       int min_no = INTEGER_MAX;
+       int max_item;
+       chat->slot = slot;
+       FILE* com_f = fopen(file_path,"rb");
+       if(com_f == NULL){
+               fputs("[chat/init]failed to open comment file.\n",log);
+               return FALSE;
+       }
+       /*要素数の取得*/
+       if(fread(&max_item,sizeof(max_item),1,com_f) <= 0){
+               fputs("[chat/init]failed to read the number of comments.\n",log);
+               return FALSE;
+       }
+       max_item = SDL_SwapLE32(max_item);
+       fprintf(log,"[chat/init]%d comments.\n",max_item);
+       chat->max_item = max_item;
+       //アイテム配列の確保
+       chat->item = malloc(sizeof(CHAT_ITEM) * max_item);
+       if(chat->item == NULL){
+               fputs("[chat/init]failed to malloc for comment.\n",log);
+               return FALSE;
+       }
+       /*個別要素の初期化*/
+       CHAT_ITEM* item;
+       int no;
+       int vpos;
+       int location;
+       int size;
+       int color;
+       int str_length;
+       Uint16* str;
+       for(i=0;i<max_item;i++){
+               item = &chat->item[i];
+               item->chat = chat;
+               item->showed = FALSE;
+               //コメント番号
+               if(fread(&no,sizeof(no),1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment number.\n",log);
+                       return FALSE;
+               }
+               no = SDL_SwapLE32(no);
+               max_no = MAX(max_no,no);
+               min_no = MIN(min_no,no);
+               //vpos
+               if(fread(&vpos,sizeof(vpos),1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment vpos.\n",log);
+                       return FALSE;
+               }
+               vpos = SDL_SwapLE32(vpos);
+               //文字の場所
+               if(fread(&location,sizeof(location),1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment location.\n",log);
+                       return FALSE;
+               }
+               location = SDL_SwapLE32(location);
+               //サイズ
+               if(fread(&size,sizeof(size),1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment size.\n",log);
+                       return FALSE;
+               }
+               size = SDL_SwapLE32(size);
+               //
+               if(fread(&color,sizeof(color),1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment color.\n",log);
+                       return FALSE;
+               }
+               color = SDL_SwapLE32(color);
+               //文字数
+               if(fread(&str_length,sizeof(str_length),1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment length.\n",log);
+                       return FALSE;
+               }
+               str_length = SDL_SwapLE32(str_length);
+               //文字列
+               str = malloc(str_length);
+               if(str == NULL){
+                       fputs("[chat/init]failed to malloc for comment text.\n",log);
+                       return FALSE;
+               }
+               if(fread(str,str_length,1,com_f) <= 0){
+                       fputs("[chat/init]failed to read comment text.\n",log);
+                       return FALSE;
+               }
+               //変数セット
+               item->no = no;
+               item->vpos = vpos;
+               item->location = location;
+               item->size = size;
+               item->color = color;
+               item->str = str;
+               /*内部処理より*/
+               if(location != CMD_LOC_DEF){
+                       item->vstart = vpos;
+                       item->vend = vpos + TEXT_SHOW_SEC - TEXT_AHEAD_SEC;
+               }else{
+                       item->vstart = vpos - TEXT_AHEAD_SEC;
+                       item->vend = item->vstart + TEXT_SHOW_SEC;
+               }
+               int fix = item->vend - video_length;
+               if(fix > 0){
+                       item->vend -= fix;
+                       item->vpos -= fix;
+                       item->vstart -= fix;
+                       fprintf(log,"[chat/fix]comment %d time adjusted.\n",i);
+               }
+               /*内部処理より おわり*/
+       }
+       fclose(com_f);
+       chat->max_no = max_no;
+       chat->min_no = min_no;
+       return TRUE;
+}
+
+void closeChat(CHAT* chat){
+       int i;
+       int max_item = chat->max_item;
+       for(i=0;i<max_item;i++){
+               free((void*)chat->item[i].str);
+       }
+       free(chat->item);
+}
+
+/*
+ * イテレータをリセットする。
+ */
+void resetChatIterator(CHAT* chat){
+       chat->iterator_index = 0;
+}
+/*
+ * イテレータを得る
+ */
+CHAT_ITEM* getChatShowed(CHAT* chat,int now_vpos){
+       int *i = &chat->iterator_index;
+       int max_item = chat->max_item;
+       CHAT_ITEM* item;
+       for(;*i<max_item;(*i)++){
+               item = &chat->item[*i];
+               if(now_vpos >= item->vstart && now_vpos <= item->vend && !item->showed){
+                       return item;
+               }
+       }
+       return NULL;
+}
index 08ee058..efc49a1 100644 (file)
@@ -1,48 +1,48 @@
-#ifndef CHAT_H_\r
-#define CHAT_H_\r
-\r
-#include <SDL/SDL.h>\r
-#include "../struct_define.h"\r
-\r
-struct CHAT_ITEM{\r
-       //\8fê\8f\8a\82Ì\93Á\92è\r
-       int no;\r
-       int vpos;\r
-       int location;\r
-       //\95\8e\9a\82Ì\8fC\8fü\r
-       int size;\r
-       int color;\r
-       Uint16* str;\r
-       //\93à\95\94\8f\88\97\9d\82Å\8eg\82¤\r
-       int vstart;\r
-       int vend;\r
-       int showed;\r
-       //\83\8a\83t\83@\83\8c\83\93\83X\r
-       CHAT* chat;\r
-};\r
-\r
-struct CHAT{\r
-       int max_no;\r
-       int min_no;\r
-       //\83A\83C\83e\83\80\r
-       int max_item;\r
-       int iterator_index;\r
-       CHAT_ITEM* item;\r
-       //\83\8a\83t\83@\83\8c\83\93\83X\r
-       CHAT_SLOT* slot;\r
-};\r
-\r
-#include "chat_slot.h"\r
-struct CHAT_SET{\r
-       CHAT chat;\r
-       CHAT_SLOT slot;\r
-};\r
-\r
-//\8f\89\8aú\89»\r
-int initChat(FILE* log,CHAT* chat,const char* file_path,CHAT_SLOT* slot,int video_length);\r
-void closeChat();\r
-//\83C\83e\83\8c\81[\83^\r
-void resetChatIterator(CHAT* chat);\r
-CHAT_ITEM* getChatShowed(CHAT* chat,int now_vpos);\r
-\r
-#endif /*CHAT_H_*/\r
+#ifndef CHAT_H_
+#define CHAT_H_
+
+#include <SDL/SDL.h>
+#include "../struct_define.h"
+
+struct CHAT_ITEM{
+       //場所の特定
+       int no;
+       int vpos;
+       int location;
+       //文字の修飾
+       int size;
+       int color;
+       Uint16* str;
+       //内部処理で使う
+       int vstart;
+       int vend;
+       int showed;
+       //リファレンス
+       CHAT* chat;
+};
+
+struct CHAT{
+       int max_no;
+       int min_no;
+       //アイテム
+       int max_item;
+       int iterator_index;
+       CHAT_ITEM* item;
+       //リファレンス
+       CHAT_SLOT* slot;
+};
+
+#include "chat_slot.h"
+struct CHAT_SET{
+       CHAT chat;
+       CHAT_SLOT slot;
+};
+
+//初期化
+int initChat(FILE* log,CHAT* chat,const char* file_path,CHAT_SLOT* slot,int video_length);
+void closeChat();
+//イテレータ
+void resetChatIterator(CHAT* chat);
+CHAT_ITEM* getChatShowed(CHAT* chat,int now_vpos);
+
+#endif /*CHAT_H_*/
index 6e3dd7b..1c9f4f0 100644 (file)
-#include "chat.h"\r
-#include "chat_slot.h"\r
-#include "process_chat.h"\r
-#include "../mydef.h"\r
-#include "../comment/com_surface.h"\r
-#include "../nicodef.h"\r
-#include "../util.h"\r
-#include <SDL/SDL.h>\r
-#include <stdio.h>\r
-#include <string.h>\r
-\r
-int initChatSlot(FILE* log,CHAT_SLOT* slot,int max_slot,CHAT* chat){\r
-       slot->max_item=max_slot;\r
-       slot->chat = chat;\r
-       slot->item = malloc(sizeof(CHAT_SLOT_ITEM) * max_slot);\r
-       if(slot->item == NULL){\r
-               fputs("failed to malloc for comment slot.\n",log);\r
-               return FALSE;\r
-       }\r
-       int i;\r
-       CHAT_SLOT_ITEM* item;\r
-       for(i=0;i<max_slot;i++){\r
-               item = &slot->item[i];\r
-               item->used = FALSE;\r
-               item->slot = slot;\r
-               item->surf=NULL;\r
-       }\r
-       return TRUE;\r
-}\r
-void closeChatSlot(CHAT_SLOT* slot){\r
-       int i;\r
-       CHAT_SLOT_ITEM* item;\r
-       for(i=0;i<slot->max_item;i++){\r
-               item = &slot->item[i];\r
-               SDL_FreeSurface(item->surf);\r
-       }\r
-       //\83A\83C\83e\83\80\82ð\8fÁ\8b\8e\81B\r
-       free(slot->item);\r
-}\r
-\r
-void deleteChatSlot(CHAT_SLOT* slot,CHAT_SLOT_ITEM* item){\r
-       item->chat_item=NULL;\r
-       SDL_FreeSurface(item->surf);\r
-       item->surf = NULL;\r
-       item->used = FALSE;\r
-}\r
-\r
-void deleteChatSlotFromIndex(CHAT_SLOT* slot,int index){\r
-       CHAT_SLOT_ITEM* item = &slot->item[index];\r
-       deleteChatSlot(slot,item);\r
-}\r
-\r
-/*\r
- * \83X\83\8d\83b\83g\82É\92Ç\89Á\82·\82é\81B\r
- */\r
-void addChatSlot(COMMDATA* data,CHAT_SLOT* slot,CHAT_ITEM* item,int video_width,int video_height){\r
-       //\82à\82¤\8c©\82¹\82ç\82ê\82½\81B\r
-       item->showed = TRUE;\r
-       if(slot->max_item <= 0){\r
-               return;\r
-       }\r
-       SDL_Surface* surf = makeCommentSurface(data,item,video_width,video_height);\r
-       /*\8aJ\82«\83X\83\8d\83b\83g\83\8b\8c\9f\8dõ*/\r
-       int i;\r
-       int cnt = -1;\r
-       int slot_max = slot->max_item;\r
-       for(i=0;i<slot_max;i++){\r
-               if(!slot->item[i].used){\r
-                       cnt = i;\r
-                       break;\r
-               }\r
-               if(cnt < 0 || slot->item[cnt].chat_item->vend > slot->item[i].chat_item->vend){\r
-                       cnt = i;\r
-               }\r
-       }\r
-       CHAT_SLOT_ITEM* slot_item = &slot->item[cnt];\r
-       /*\8bó\82«\82ª\96³\82¯\82ê\82Î\8b­\90§\93I\82É\8dì\82é\81B*/\r
-       if(slot_item->used){\r
-               deleteChatSlotFromIndex(slot,cnt);\r
-       }\r
-       //\82±\82Ì\8e\9e\93_\82Å\92Ç\89Á\r
-       slot_item->chat_item = item;\r
-       slot_item->surf = surf;\r
-       /*\83\8d\83P\81[\83V\83\87\83\93\82Å\95ª\8aò*/\r
-       int y;\r
-       if(item->location == CMD_LOC_BOTTOM){\r
-               y = video_height - surf->h;\r
-       }else{\r
-               y = 0;\r
-       }\r
-       int running;\r
-       do{\r
-               running = FALSE;\r
-               for(i=0;i<slot_max;i++){\r
-                       CHAT_SLOT_ITEM* other_slot = &slot->item[i];\r
-                       if(!other_slot->used){\r
-                               continue;\r
-                       }\r
-                       const CHAT_ITEM* other_item = other_slot->chat_item;\r
-                       int other_y = other_slot->y;\r
-                       /*\96³\8e\8b\82·\82é\8fð\8c\8f*/\r
-                       if(other_y + other_slot->surf->h <= y){\r
-                               continue;\r
-                       }\r
-                       if(y + surf->h <= other_y){\r
-                               continue;\r
-                       }\r
-                       if(other_item->location != item->location){\r
-                               continue;\r
-                       }\r
-                       int start = MAX(other_item->vstart,item->vstart);\r
-                       int end = MIN(other_item->vend,item->vend);\r
-                       int obj_x_t1 = getX(start,slot_item,video_width);\r
-                       int obj_x_t2 = getX(end,slot_item,video_width);\r
-                       int o_x_t1 = getX(start,other_slot,video_width);\r
-                       int o_x_t2 = getX(end,other_slot,video_width);\r
-                       //\93\96\82½\82è\94»\92è\r
-                       if ((obj_x_t1 <= o_x_t1 + other_slot->surf->w && o_x_t1 <= obj_x_t1 + surf->w)\r
-                || (obj_x_t2 <= o_x_t2 + other_slot->surf->w && o_x_t2 <= obj_x_t2 + surf->w)){\r
-                               if(item->location == CMD_LOC_BOTTOM){\r
-                                       y = other_y - surf->h - 1;\r
-                               }else{\r
-                                       y = other_y + other_slot->surf->h + 1;\r
-                               }\r
-                               running = TRUE;\r
-                               break;\r
-                       }\r
-               }\r
-       }while(running);\r
-       /*\82»\82à\82»\82à\89æ\96Ê\93à\82É\96³\82¯\82ê\82Î\96³\88Ó\96¡\81B*/\r
-       if(y < 0 || y+surf->h > video_height){//\94Í\88Í\82ð\92´\82¦\82Ä\82é\82Ì\82Å\81A\83\89\83\93\83_\83\80\82É\94z\92u\81B\r
-               y = ((rnd() & 0xffff) * (video_height - surf->h)) / 0xffff;\r
-       }\r
-       //\92Ç\89Á\r
-       slot_item->used = TRUE;\r
-       slot_item->y = y;\r
-}\r
-/*\r
- * \83C\83e\83\8c\81[\83^\82ð\83\8a\83Z\83b\83g\82·\82é\81B\r
- */\r
-void resetChatSlotIterator(CHAT_SLOT* slot){\r
-       slot->iterator_index = 0;\r
-}\r
-/*\r
- * \83C\83e\83\8c\81[\83^\82ð\93¾\82é\r
- */\r
-CHAT_SLOT_ITEM* getChatSlotErased(CHAT_SLOT* slot,int now_vpos){\r
-       int *i = &slot->iterator_index;\r
-       int max_item = slot->max_item;\r
-       CHAT_ITEM* item;\r
-       CHAT_SLOT_ITEM* slot_item;\r
-       for(;*i<max_item;(*i)++){\r
-               slot_item = &slot->item[*i];\r
-               if(!slot_item->used){\r
-                       continue;\r
-               }\r
-               item = slot_item->chat_item;\r
-               if(item==NULL)continue;\r
-               if(now_vpos < item->vstart || now_vpos > item->vend){\r
-                       return slot_item;\r
-               }\r
-       }\r
-       return NULL;\r
-}\r
+#include "chat.h"
+#include "chat_slot.h"
+#include "process_chat.h"
+#include "../mydef.h"
+#include "../comment/com_surface.h"
+#include "../nicodef.h"
+#include "../util.h"
+#include <SDL/SDL.h>
+#include <stdio.h>
+#include <string.h>
+
+int initChatSlot(FILE* log,CHAT_SLOT* slot,int max_slot,CHAT* chat){
+       slot->max_item=max_slot;
+       slot->chat = chat;
+       slot->item = malloc(sizeof(CHAT_SLOT_ITEM) * max_slot);
+       if(slot->item == NULL){
+               fputs("failed to malloc for comment slot.\n",log);
+               return FALSE;
+       }
+       int i;
+       CHAT_SLOT_ITEM* item;
+       for(i=0;i<max_slot;i++){
+               item = &slot->item[i];
+               item->used = FALSE;
+               item->slot = slot;
+               item->surf=NULL;
+       }
+       return TRUE;
+}
+void closeChatSlot(CHAT_SLOT* slot){
+       int i;
+       CHAT_SLOT_ITEM* item;
+       for(i=0;i<slot->max_item;i++){
+               item = &slot->item[i];
+               SDL_FreeSurface(item->surf);
+       }
+       //アイテムを消去。
+       free(slot->item);
+}
+
+void deleteChatSlot(CHAT_SLOT* slot,CHAT_SLOT_ITEM* item){
+       item->chat_item=NULL;
+       SDL_FreeSurface(item->surf);
+       item->surf = NULL;
+       item->used = FALSE;
+}
+
+void deleteChatSlotFromIndex(CHAT_SLOT* slot,int index){
+       CHAT_SLOT_ITEM* item = &slot->item[index];
+       deleteChatSlot(slot,item);
+}
+
+/*
+ * スロットに追加する。
+ */
+void addChatSlot(COMMDATA* data,CHAT_SLOT* slot,CHAT_ITEM* item,int video_width,int video_height){
+       //もう見せられた。
+       item->showed = TRUE;
+       if(slot->max_item <= 0){
+               return;
+       }
+       SDL_Surface* surf = makeCommentSurface(data,item,video_width,video_height);
+       /*開きスロットル検索*/
+       int i;
+       int cnt = -1;
+       int slot_max = slot->max_item;
+       for(i=0;i<slot_max;i++){
+               if(!slot->item[i].used){
+                       cnt = i;
+                       break;
+               }
+               if(cnt < 0 || slot->item[cnt].chat_item->vend > slot->item[i].chat_item->vend){
+                       cnt = i;
+               }
+       }
+       CHAT_SLOT_ITEM* slot_item = &slot->item[cnt];
+       /*空きが無ければ強制的に作る。*/
+       if(slot_item->used){
+               deleteChatSlotFromIndex(slot,cnt);
+       }
+       //この時点で追加
+       slot_item->chat_item = item;
+       slot_item->surf = surf;
+       /*ロケーションで分岐*/
+       int y;
+       if(item->location == CMD_LOC_BOTTOM){
+               y = video_height - surf->h;
+       }else{
+               y = 0;
+       }
+       int running;
+       do{
+               running = FALSE;
+               for(i=0;i<slot_max;i++){
+                       CHAT_SLOT_ITEM* other_slot = &slot->item[i];
+                       if(!other_slot->used){
+                               continue;
+                       }
+                       const CHAT_ITEM* other_item = other_slot->chat_item;
+                       int other_y = other_slot->y;
+                       /*無視する条件*/
+                       if(other_y + other_slot->surf->h <= y){
+                               continue;
+                       }
+                       if(y + surf->h <= other_y){
+                               continue;
+                       }
+                       if(other_item->location != item->location){
+                               continue;
+                       }
+                       int start = MAX(other_item->vstart,item->vstart);
+                       int end = MIN(other_item->vend,item->vend);
+                       int obj_x_t1 = getX(start,slot_item,video_width);
+                       int obj_x_t2 = getX(end,slot_item,video_width);
+                       int o_x_t1 = getX(start,other_slot,video_width);
+                       int o_x_t2 = getX(end,other_slot,video_width);
+                       //当たり判定
+                       if ((obj_x_t1 <= o_x_t1 + other_slot->surf->w && o_x_t1 <= obj_x_t1 + surf->w)
+                || (obj_x_t2 <= o_x_t2 + other_slot->surf->w && o_x_t2 <= obj_x_t2 + surf->w)){
+                               if(item->location == CMD_LOC_BOTTOM){
+                                       y = other_y - surf->h - 1;
+                               }else{
+                                       y = other_y + other_slot->surf->h + 1;
+                               }
+                               running = TRUE;
+                               break;
+                       }
+               }
+       }while(running);
+       /*そもそも画面内に無ければ無意味。*/
+       if(y < 0 || y+surf->h > video_height){//範囲を超えてるので、ランダムに配置。
+               y = ((rnd() & 0xffff) * (video_height - surf->h)) / 0xffff;
+       }
+       //追加
+       slot_item->used = TRUE;
+       slot_item->y = y;
+}
+/*
+ * イテレータをリセットする。
+ */
+void resetChatSlotIterator(CHAT_SLOT* slot){
+       slot->iterator_index = 0;
+}
+/*
+ * イテレータを得る
+ */
+CHAT_SLOT_ITEM* getChatSlotErased(CHAT_SLOT* slot,int now_vpos){
+       int *i = &slot->iterator_index;
+       int max_item = slot->max_item;
+       CHAT_ITEM* item;
+       CHAT_SLOT_ITEM* slot_item;
+       for(;*i<max_item;(*i)++){
+               slot_item = &slot->item[*i];
+               if(!slot_item->used){
+                       continue;
+               }
+               item = slot_item->chat_item;
+               if(item==NULL)continue;
+               if(now_vpos < item->vstart || now_vpos > item->vend){
+                       return slot_item;
+               }
+       }
+       return NULL;
+}
index 120c6e5..8766aac 100644 (file)
@@ -1,36 +1,36 @@
-#ifndef CHAT_SLOT_H_\r
-#define CHAT_SLOT_H_\r
-\r
-#include "../struct_define.h"\r
-#include "chat.h"\r
-#include <SDL/SDL.h>\r
-\r
-struct CHAT_SLOT_ITEM{\r
-       int used;\r
-       CHAT_ITEM* chat_item;\r
-       SDL_Surface* surf;\r
-       int y;\r
-       //\83\8a\83t\83@\83\8c\83\93\83X\r
-       CHAT_SLOT* slot;\r
-};\r
-\r
-struct CHAT_SLOT{\r
-       int max_item;\r
-       int iterator_index;\r
-       CHAT_SLOT_ITEM* item;\r
-       //\83\8a\83t\83@\83\8c\83\93\83X\r
-       CHAT* chat;\r
-};\r
-#include "../main.h"\r
-//\8f\89\8aú\89»\r
-int initChatSlot(FILE* log,CHAT_SLOT* slot,int max_slot,CHAT* chat);\r
-void closeChatSlot(CHAT_SLOT* slot);\r
-//\92Ç\89Á\81A\8dí\8f\9c\r
-void addChatSlot(COMMDATA* data,CHAT_SLOT* slot,CHAT_ITEM* item,int video_width,int video_height);\r
-void deleteChatSlot(CHAT_SLOT* slot,CHAT_SLOT_ITEM* item);\r
-void deleteChatSlotFromIndex(CHAT_SLOT* slot,int index);\r
-\r
-//\83C\83e\83\8c\81[\83^\r
-void resetChatSlotIterator(CHAT_SLOT* slot);\r
-CHAT_SLOT_ITEM* getChatSlotErased(CHAT_SLOT* slot,int now_vpos);\r
-#endif /*CHAT_SLOT_H_*/\r
+#ifndef CHAT_SLOT_H_
+#define CHAT_SLOT_H_
+
+#include "../struct_define.h"
+#include "chat.h"
+#include <SDL/SDL.h>
+
+struct CHAT_SLOT_ITEM{
+       int used;
+       CHAT_ITEM* chat_item;
+       SDL_Surface* surf;
+       int y;
+       //リファレンス
+       CHAT_SLOT* slot;
+};
+
+struct CHAT_SLOT{
+       int max_item;
+       int iterator_index;
+       CHAT_SLOT_ITEM* item;
+       //リファレンス
+       CHAT* chat;
+};
+#include "../main.h"
+//初期化
+int initChatSlot(FILE* log,CHAT_SLOT* slot,int max_slot,CHAT* chat);
+void closeChatSlot(CHAT_SLOT* slot);
+//追加、削除
+void addChatSlot(COMMDATA* data,CHAT_SLOT* slot,CHAT_ITEM* item,int video_width,int video_height);
+void deleteChatSlot(CHAT_SLOT* slot,CHAT_SLOT_ITEM* item);
+void deleteChatSlotFromIndex(CHAT_SLOT* slot,int index);
+
+//イテレータ
+void resetChatSlotIterator(CHAT_SLOT* slot);
+CHAT_SLOT_ITEM* getChatSlotErased(CHAT_SLOT* slot,int now_vpos);
+#endif /*CHAT_SLOT_H_*/
index db2759c..3bb8fbd 100644 (file)
@@ -1,71 +1,71 @@
-#include <SDL/SDL.h>\r
-#include "chat.h"\r
-#include "chat_slot.h"\r
-#include "process_chat.h"\r
-#include "../main.h"\r
-#include "../mydef.h"\r
-\r
-//\82±\82Ì\83\\81[\83X\93à\82Å\82µ\82©\8eg\82í\82È\82¢\83\81\83\\83b\83h\r
-void drawComment(SDL_Surface* surf,CHAT_SLOT* slot,int now_vpos);\r
-\r
-/**\r
- * \83R\83\81\83\93\83g\82ð\95`\89æ\82·\82é\81B\r
- */\r
-int chat_process(COMMDATA* data,SDL_Surface* surf,const int now_vpos){\r
-       CHAT* chat = &data->chat;\r
-       CHAT_SLOT* slot = &data->slot;\r
-       FILE* log = data->common->log;\r
-       /*\8c©\82¹\82È\82¢\82à\82Ì\82ð\8dí\8f\9c*/\r
-       CHAT_SLOT_ITEM* slot_item;\r
-       CHAT_ITEM* chat_item;\r
-       resetChatSlotIterator(slot);\r
-       while((slot_item = getChatSlotErased(slot,now_vpos)) != NULL){\r
-               chat_item = slot_item->chat_item;\r
-               fprintf(log,"[process-chat/process]<vpos:%6d>com%4d<color:%2d loc:%2d size:%2d %6d-%6d(%6d)> erased. \n",now_vpos,chat_item->no,chat_item->color,chat_item->location,chat_item->size,chat_item->vstart,chat_item->vend,chat_item->vpos);\r
-               fflush(log);\r
-               deleteChatSlot(slot,slot_item);\r
-       }\r
-       /*\8c©\82¹\82é\82à\82Ì\82ð\83Z\83b\83g*/\r
-       resetChatIterator(chat);\r
-       while((chat_item = getChatShowed(chat,now_vpos)) != NULL){\r
-               fprintf(log,"[process-chat/process]<vpos:%6d>com%4d<color:%2d loc:%2d size:%2d %6d-%6d(%6d)> added. \n",now_vpos,chat_item->no,chat_item->color,chat_item->location,chat_item->size,chat_item->vstart,chat_item->vend,chat_item->vpos);\r
-               fflush(log);\r
-               addChatSlot(data,slot,chat_item,surf->w,surf->h);\r
-       }\r
-       drawComment(surf,slot,now_vpos);\r
-       return TRUE;\r
-}\r
-\r
-/*\r
- * \83\8c\83C\83\84\8f\87\82É\82»\82Á\82Ä\95`\89æ\82·\82é\r
- */\r
-\r
-void drawComment(SDL_Surface* surf,CHAT_SLOT* slot,int now_vpos){\r
-       int i;\r
-       SDL_Rect rect;\r
-       int max_item = slot->max_item;\r
-       CHAT_SLOT_ITEM* item;\r
-       for(i=0;i<max_item;i++){\r
-               item = &slot->item[i];\r
-               if(item->used){\r
-                       rect.x = getX(now_vpos,item,surf->w);\r
-                       rect.y = item->y;\r
-                       SDL_BlitSurface(item->surf,NULL,surf,&rect);\r
-               }\r
-       }\r
-}\r
-\r
-/*\r
- * \88Ê\92u\82ð\8b\81\82ß\82é\r
- */\r
-int getX(int now_vpos,const CHAT_SLOT_ITEM* item,int video_width){\r
-       int text_width = item->surf->w;\r
-       int width = video_width;\r
-       if(item->chat_item->location != CMD_LOC_DEF){\r
-               return (width - text_width) >>1;\r
-       }else{\r
-               int tmp = now_vpos - item->chat_item->vpos + TEXT_AHEAD_SEC;\r
-               return width - ((tmp * (width + text_width)) / TEXT_SHOW_SEC);\r
-       }\r
-       return -1;\r
-}\r
+#include <SDL/SDL.h>
+#include "chat.h"
+#include "chat_slot.h"
+#include "process_chat.h"
+#include "../main.h"
+#include "../mydef.h"
+
+//このソース内でしか使わないメソッド
+void drawComment(SDL_Surface* surf,CHAT_SLOT* slot,int now_vpos);
+
+/**
+ * コメントを描画する。
+ */
+int chat_process(COMMDATA* data,SDL_Surface* surf,const int now_vpos){
+       CHAT* chat = &data->chat;
+       CHAT_SLOT* slot = &data->slot;
+       FILE* log = data->common->log;
+       /*見せないものを削除*/
+       CHAT_SLOT_ITEM* slot_item;
+       CHAT_ITEM* chat_item;
+       resetChatSlotIterator(slot);
+       while((slot_item = getChatSlotErased(slot,now_vpos)) != NULL){
+               chat_item = slot_item->chat_item;
+               fprintf(log,"[process-chat/process]<vpos:%6d>com%4d<color:%2d loc:%2d size:%2d %6d-%6d(%6d)> erased. \n",now_vpos,chat_item->no,chat_item->color,chat_item->location,chat_item->size,chat_item->vstart,chat_item->vend,chat_item->vpos);
+               fflush(log);
+               deleteChatSlot(slot,slot_item);
+       }
+       /*見せるものをセット*/
+       resetChatIterator(chat);
+       while((chat_item = getChatShowed(chat,now_vpos)) != NULL){
+               fprintf(log,"[process-chat/process]<vpos:%6d>com%4d<color:%2d loc:%2d size:%2d %6d-%6d(%6d)> added. \n",now_vpos,chat_item->no,chat_item->color,chat_item->location,chat_item->size,chat_item->vstart,chat_item->vend,chat_item->vpos);
+               fflush(log);
+               addChatSlot(data,slot,chat_item,surf->w,surf->h);
+       }
+       drawComment(surf,slot,now_vpos);
+       return TRUE;
+}
+
+/*
+ * レイヤ順にそって描画する
+ */
+
+void drawComment(SDL_Surface* surf,CHAT_SLOT* slot,int now_vpos){
+       int i;
+       SDL_Rect rect;
+       int max_item = slot->max_item;
+       CHAT_SLOT_ITEM* item;
+       for(i=0;i<max_item;i++){
+               item = &slot->item[i];
+               if(item->used){
+                       rect.x = getX(now_vpos,item,surf->w);
+                       rect.y = item->y;
+                       SDL_BlitSurface(item->surf,NULL,surf,&rect);
+               }
+       }
+}
+
+/*
+ * 位置を求める
+ */
+int getX(int now_vpos,const CHAT_SLOT_ITEM* item,int video_width){
+       int text_width = item->surf->w;
+       int width = video_width;
+       if(item->chat_item->location != CMD_LOC_DEF){
+               return (width - text_width) >>1;
+       }else{
+               int tmp = now_vpos - item->chat_item->vpos + TEXT_AHEAD_SEC;
+               return width - ((tmp * (width + text_width)) / TEXT_SHOW_SEC);
+       }
+       return -1;
+}
index 469b881..f1d3480 100644 (file)
@@ -1,10 +1,10 @@
-#ifndef PROCESS_CHAT_H_\r
-#define PROCESS_CHAT_H_\r
-#include <SDL/SDL.h>\r
-#include "chat.h"\r
-#include "chat_slot.h"\r
-#include "../main.h"\r
-int chat_process(COMMDATA* data,SDL_Surface* surf,const int now_vpos);\r
-int getX(int now_vpos,const CHAT_SLOT_ITEM* item,int video_width);\r
-\r
-#endif /*PROCESS_CHAT_H_*/\r
+#ifndef PROCESS_CHAT_H_
+#define PROCESS_CHAT_H_
+#include <SDL/SDL.h>
+#include "chat.h"
+#include "chat_slot.h"
+#include "../main.h"
+int chat_process(COMMDATA* data,SDL_Surface* surf,const int now_vpos);
+int getX(int now_vpos,const CHAT_SLOT_ITEM* item,int video_width);
+
+#endif /*PROCESS_CHAT_H_*/
index 98a8910..0590620 100644 (file)
-#include <SDL/SDL.h>\r
-#include <SDL/SDL_ttf.h>\r
-#include <SDL/SDL_rotozoom.h>\r
-#include "com_surface.h"\r
-#include "surf_util.h"\r
-#include "../chat/chat.h"\r
-#include "../chat/chat_slot.h"\r
-#include "../nicodef.h"\r
-#include "../mydef.h"\r
-#include "../main.h"\r
-#include "shadow.h"\r
-\r
-\r
-SDL_Surface* drawText(COMMDATA* data,int size,int color,Uint16* str);\r
-\r
-SDL_Surface* makeCommentSurface(COMMDATA* data,const CHAT_ITEM* item,int video_width,int video_height){\r
-       Uint16* index = item->str;\r
-       Uint16* last = item->str;\r
-       SDL_Surface* ret = NULL;\r
-       int color = item->color;\r
-       int size = item->size;\r
-\r
-       /*\r
-        * \89e\82Í\92u\82¢\82Ä\82¨\82¢\82Ä\81A\82Æ\82è\82 \82¦\82¸\95\8e\9a\82Ì\95`\89æ\r
-        */\r
-       while(*index != '\0'){\r
-               if(*index == '\n'){\r
-                       *index = '\0';//\82±\82±\82Å\88ê\92U\90Ø\82é\r
-                       if(ret == null){//\8c\8b\8bÇ\89ü\8ds\82Í\96³\82¢\r
-                               ret = drawText(data,size,color,last);\r
-                       }else{/*\89ü\8ds\82 \82è*/\r
-                               ret = connectSurface(ret,drawText(data,size,color,last));\r
-                       }\r
-                       *index = '\n';//\82±\82±\82Å\88ê\92U\90Ø\82é\r
-                       last = index+1;\r
-               }\r
-               index++;\r
-       }\r
-       if(ret == null){//\8c\8b\8bÇ\89ü\8ds\82Í\96³\82¢\r
-               ret = drawText(data,size,color,item->str);\r
-       }else{/*\89ü\8ds\82 \82è*/\r
-               ret = connectSurface(ret,drawText(data,size,color,last));\r
-       }\r
-       \r
-       if(ret->w == 0 || ret->h == 0){\r
-               fprintf(data->common->log,"[comsurface/make]comment %04d has no char.\n",item->no);\r
-               fflush(data->common->log);\r
-               return ret;\r
-       }\r
-       \r
-        /*\r
-         * \89e\8f\88\97\9d\r
-         */\r
-         int shadow = data->common->shadow_kind;\r
-         if(shadow >= SHADOW_MAX){\r
-               shadow = SHADOW_DEFAULT;\r
-         }\r
-         ret = (*ShadowFunc[shadow])(ret,item->color == CMD_COLOR_BLACK,data->common->fontsize_fix);\r
-\r
-       /*\r
-        * \83A\83\8b\83t\83@\92l\82Ì\90Ý\92è\r
-        */\r
-        if(!data->opaque_comment){\r
-               float alpha_t = (((float)(item->no)/(item->chat->max_no)) * 0.4) + 0.6;\r
-               fprintf(data->common->log,"[comsurface/make]comment %04d set alpha:%5.2f%%.\n",item->no,alpha_t*100);\r
-               setAlpha(ret,alpha_t);\r
-        }\r
-\r
-       /*\r
-        * \83X\83P\81[\83\8b\90Ý\92è\r
-        */\r
-\r
-       double zoomx = 1.0f;\r
-       //double zoomy = 1.0f;\r
-       //\8fk\8f¬\r
-       \r
-       if(data->common->fontsize_fix){\r
-               zoomx = (0.5f * (double)video_width) / (double)NICO_WIDTH;\r
-               //zoomy = (0.5f * (double)video_height) / (double)NICO_HEIGHT;\r
-       }\r
-\r
-       /*\83X\83P\81[\83\8b\82Ì\92²\90®*/\r
-       //if(((double)ret->h * zoomy) > ((double)video_height/3.0f)){\r
-       if(((double)ret->h * zoomx) > ((double)video_height/3.0f)){\r
-               zoomx *= 0.5f;\r
-               //zoomy *= 0.5f;\r
-       }\r
-       if(item->location != CMD_LOC_DEF && (ret->w * zoomx) > (double)video_width){\r
-               double scale = ((double)video_width) / (ret->w * zoomx);\r
-               zoomx *= scale;\r
-               //zoomy *= scale;\r
-       }\r
-       //\89æ\96Ê\83T\83C\83Y\82É\8d\87\82í\82¹\82Ä\95Ï\8dX\r
-       //if(zoomx != 1.0f || zoomy != 1.0f){\r
-       if(zoomx != 1.0f){\r
-               //fprintf(data->log,"[comsurface/make]comment %04d resized.(%5.2f%%,%5.2f%%)\n",item->no,zoomx*100,zoomy*100);\r
-               fprintf(data->common->log,"[comsurface/make]comment %04d resized.(%5.2f%%)\n",item->no,zoomx*100);\r
-               fflush(data->common->log);\r
-               SDL_Surface* tmp = ret;\r
-               ret = zoomSurface(tmp,zoomx,zoomx,SMOOTHING_ON);\r
-               SDL_FreeSurface(tmp);\r
-       }\r
-\r
-       return ret;\r
-}\r
-/**\r
- * \95\8e\9a\82ð\95`\89æ\r
- */\r
-\r
-SDL_Surface* drawText(COMMDATA* data,int size,int color,Uint16* str){\r
-       if(str[0] == '\0'){\r
-               return SDL_CreateRGBSurface(    SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                               0,COMMENT_FONT_SIZE[size],32,\r
-                                                                                       #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                           0xff000000,\r
-                                                                                           0x00ff0000,\r
-                                                                                           0x0000ff00,\r
-                                                                                           0x000000ff\r
-                                                                                       #else\r
-                                                                                           0x000000ff,\r
-                                                                                           0x0000ff00,\r
-                                                                                           0x00ff0000,\r
-                                                                                           0xff000000\r
-                                                                                       #endif\r
-                                                                       );\r
-       }\r
-       /*\r
-       SDL_Surface* fmt = SDL_CreateRGBSurface(        SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                                               0,\r
-                                                                                               0,\r
-                                                                                               32,\r
-                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                                   0xff000000,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x000000ff\r
-                                                                                               #else\r
-                                                                                                   0x000000ff,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0xff000000\r
-                                                                                               #endif\r
-                                                                                       );\r
-\r
-       SDL_Surface* tmp = TTF_RenderUNICODE_Blended(data->font[size],str,COMMENT_COLOR[color]);\r
-       SDL_SetAlpha(tmp,SDL_SRCALPHA | SDL_RLEACCEL,0xff);\r
-       SDL_Surface* surf = SDL_ConvertSurface(tmp,fmt->format,SDL_SRCALPHA | SDL_HWSURFACE);\r
-       SDL_FreeSurface(tmp);\r
-       SDL_FreeSurface(fmt);\r
-       */\r
-       SDL_Surface* surf = TTF_RenderUNICODE_Blended(data->common->font[size],str,COMMENT_COLOR[color]);\r
-       return surf;\r
-}\r
+#include <SDL/SDL.h>
+#include <SDL/SDL_ttf.h>
+#include <SDL/SDL_rotozoom.h>
+#include "com_surface.h"
+#include "surf_util.h"
+#include "../chat/chat.h"
+#include "../chat/chat_slot.h"
+#include "../nicodef.h"
+#include "../mydef.h"
+#include "../main.h"
+#include "shadow.h"
+
+
+SDL_Surface* drawText(COMMDATA* data,int size,int color,Uint16* str);
+
+SDL_Surface* makeCommentSurface(COMMDATA* data,const CHAT_ITEM* item,int video_width,int video_height){
+       Uint16* index = item->str;
+       Uint16* last = item->str;
+       SDL_Surface* ret = NULL;
+       int color = item->color;
+       int size = item->size;
+
+       /*
+        * 影は置いておいて、とりあえず文字の描画
+        */
+       while(*index != '\0'){
+               if(*index == '\n'){
+                       *index = '\0';//ここで一旦切る
+                       if(ret == null){//結局改行は無い
+                               ret = drawText(data,size,color,last);
+                       }else{/*改行あり*/
+                               ret = connectSurface(ret,drawText(data,size,color,last));
+                       }
+                       *index = '\n';//ここで一旦切る
+                       last = index+1;
+               }
+               index++;
+       }
+       if(ret == null){//結局改行は無い
+               ret = drawText(data,size,color,item->str);
+       }else{/*改行あり*/
+               ret = connectSurface(ret,drawText(data,size,color,last));
+       }
+       
+       if(ret->w == 0 || ret->h == 0){
+               fprintf(data->common->log,"[comsurface/make]comment %04d has no char.\n",item->no);
+               fflush(data->common->log);
+               return ret;
+       }
+       
+        /*
+         * 影処理
+         */
+         int shadow = data->common->shadow_kind;
+         if(shadow >= SHADOW_MAX){
+               shadow = SHADOW_DEFAULT;
+         }
+         ret = (*ShadowFunc[shadow])(ret,item->color == CMD_COLOR_BLACK,data->common->fontsize_fix);
+
+       /*
+        * アルファ値の設定
+        */
+        if(!data->opaque_comment){
+               float alpha_t = (((float)(item->no)/(item->chat->max_no)) * 0.4) + 0.6;
+               fprintf(data->common->log,"[comsurface/make]comment %04d set alpha:%5.2f%%.\n",item->no,alpha_t*100);
+               setAlpha(ret,alpha_t);
+        }
+
+       /*
+        * スケール設定
+        */
+
+       double zoomx = 1.0f;
+       //double zoomy = 1.0f;
+       //縮小
+       
+       if(data->common->fontsize_fix){
+               zoomx = (0.5f * (double)video_width) / (double)NICO_WIDTH;
+               //zoomy = (0.5f * (double)video_height) / (double)NICO_HEIGHT;
+       }
+
+       /*スケールの調整*/
+       //if(((double)ret->h * zoomy) > ((double)video_height/3.0f)){
+       if(((double)ret->h * zoomx) > ((double)video_height/3.0f)){
+               zoomx *= 0.5f;
+               //zoomy *= 0.5f;
+       }
+       if(item->location != CMD_LOC_DEF && (ret->w * zoomx) > (double)video_width){
+               double scale = ((double)video_width) / (ret->w * zoomx);
+               zoomx *= scale;
+               //zoomy *= scale;
+       }
+       //画面サイズに合わせて変更
+       //if(zoomx != 1.0f || zoomy != 1.0f){
+       if(zoomx != 1.0f){
+               //fprintf(data->log,"[comsurface/make]comment %04d resized.(%5.2f%%,%5.2f%%)\n",item->no,zoomx*100,zoomy*100);
+               fprintf(data->common->log,"[comsurface/make]comment %04d resized.(%5.2f%%)\n",item->no,zoomx*100);
+               fflush(data->common->log);
+               SDL_Surface* tmp = ret;
+               ret = zoomSurface(tmp,zoomx,zoomx,SMOOTHING_ON);
+               SDL_FreeSurface(tmp);
+       }
+
+       return ret;
+}
+/**
+ * 文字を描画
+ */
+
+SDL_Surface* drawText(COMMDATA* data,int size,int color,Uint16* str){
+       if(str[0] == '\0'){
+               return SDL_CreateRGBSurface(    SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                               0,COMMENT_FONT_SIZE[size],32,
+                                                                                       #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                           0xff000000,
+                                                                                           0x00ff0000,
+                                                                                           0x0000ff00,
+                                                                                           0x000000ff
+                                                                                       #else
+                                                                                           0x000000ff,
+                                                                                           0x0000ff00,
+                                                                                           0x00ff0000,
+                                                                                           0xff000000
+                                                                                       #endif
+                                                                       );
+       }
+       /*
+       SDL_Surface* fmt = SDL_CreateRGBSurface(        SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                                               0,
+                                                                                               0,
+                                                                                               32,
+                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                                   0xff000000,
+                                                                                                   0x00ff0000,
+                                                                                                   0x0000ff00,
+                                                                                                   0x000000ff
+                                                                                               #else
+                                                                                                   0x000000ff,
+                                                                                                   0x0000ff00,
+                                                                                                   0x00ff0000,
+                                                                                                   0xff000000
+                                                                                               #endif
+                                                                                       );
+
+       SDL_Surface* tmp = TTF_RenderUNICODE_Blended(data->font[size],str,COMMENT_COLOR[color]);
+       SDL_SetAlpha(tmp,SDL_SRCALPHA | SDL_RLEACCEL,0xff);
+       SDL_Surface* surf = SDL_ConvertSurface(tmp,fmt->format,SDL_SRCALPHA | SDL_HWSURFACE);
+       SDL_FreeSurface(tmp);
+       SDL_FreeSurface(fmt);
+       */
+       SDL_Surface* surf = TTF_RenderUNICODE_Blended(data->common->font[size],str,COMMENT_COLOR[color]);
+       return surf;
+}
index f5965da..4704c4f 100644 (file)
@@ -1,11 +1,11 @@
-#ifndef COM_SURFACE_H_\r
-#define COM_SURFACE_H_\r
-#include <SDL/SDL.h>\r
-#include "../chat/chat.h"\r
-#include "../chat/chat_slot.h"\r
-#include "../main.h"\r
-\r
-SDL_Surface* makeCommentSurface(COMMDATA* data,const CHAT_ITEM* item,int video_width,int video_height);\r
-\r
-\r
-#endif /*COM_SURFACE_H_*/\r
+#ifndef COM_SURFACE_H_
+#define COM_SURFACE_H_
+#include <SDL/SDL.h>
+#include "../chat/chat.h"
+#include "../chat/chat_slot.h"
+#include "../main.h"
+
+SDL_Surface* makeCommentSurface(COMMDATA* data,const CHAT_ITEM* item,int video_width,int video_height);
+
+
+#endif /*COM_SURFACE_H_*/
index ae54544..c859d80 100644 (file)
-#include <SDL/SDL.h>\r
-#include "surf_util.h"\r
-#include "shadow.h"\r
-\r
-/*\89e\82È\82µ*/\r
-SDL_Surface* noShadow(SDL_Surface* surf,int is_black,int is_fix_size){\r
-       return surf;\r
-}\r
-/*\89E\89º*/\r
-#define SHADOW_SIZE 3\r
-\r
-SDL_Surface* likeNicoNico(SDL_Surface* surf,int is_black,int is_fix_size){\r
-       /*\83X\83\89\83C\83h\95\9d\82Ì\8am\92è*/\r
-       int slide = SHADOW_SIZE;\r
-       if(is_fix_size){\r
-               slide <<= 1;\r
-       }\r
-       int w = surf->w;\r
-       int h = surf->h;\r
-       SDL_Surface* shadow = SDL_CreateRGBSurface(             SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                                               w+(slide<<1),\r
-                                                                                               h+(slide<<1),\r
-                                                                                               32,\r
-                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                                   0xff000000,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x000000ff\r
-                                                                                               #else\r
-                                                                                                   0x000000ff,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0xff000000\r
-                                                                                               #endif\r
-                                                                                       );\r
-       SDL_Surface* shadow2 = SDL_CreateRGBSurface(    SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                                               w+(slide<<1),\r
-                                                                                               h+(slide<<1),\r
-                                                                                               32,\r
-                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                                   0xff000000,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x000000ff\r
-                                                                                               #else\r
-                                                                                                   0x000000ff,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0xff000000\r
-                                                                                               #endif\r
-                                                                                       );\r
-       SDL_Rect rect = {slide,slide};\r
-       SDL_SetAlpha(surf,0,0xff);\r
-       SDL_BlitSurface(surf,NULL,shadow,&rect);\r
-       SDL_SetAlpha(surf,SDL_SRCALPHA,0xff);\r
-       if(is_black){//\8d\95\82Å\82 \82ê\82Î\81A\8eü\82è\82ð\82µ\82ë\82Å\88Í\82Þ\r
-               setRGB(shadow,0xffffffff);\r
-       }else{\r
-               setRGB(shadow,0);\r
-       }\r
-       SDL_SetAlpha(shadow,0,0xff);\r
-       SDL_BlitSurface(shadow,NULL,shadow2,NULL);\r
-       SDL_SetAlpha(shadow,SDL_SRCALPHA,0xff);\r
-       int x,y,z;\r
-       int nw = shadow->w;\r
-       int nh = shadow->h;\r
-       int *pix;\r
-       int *pix2;\r
-       int pitch = shadow->pitch;\r
-       int bps = shadow->format->BytesPerPixel;\r
-       Uint32 Amask = shadow->format->Amask;\r
-       Uint32 Mask = (shadow->format->Rmask | shadow->format->Gmask | shadow->format->Bmask);\r
-       Uint32 Ashift = shadow->format->Ashift;\r
-       Uint32 Aloss = shadow->format->Aloss;\r
-       SDL_LockSurface(shadow);\r
-       SDL_LockSurface(shadow2);\r
-       //\82±\82±\82Í\8bô\90\94\82É\82·\82é\82±\82Æ\81B\r
-       int zmax = 10;\r
-       if(is_fix_size){\r
-               zmax = 16;\r
-       }\r
-       SDL_Surface* tmp;\r
-       for(z=0;z<zmax;z++){\r
-               char *pixels = (char*)shadow->pixels;\r
-               char *pixels2 = (char*)shadow2->pixels;\r
-               for(y=0;y<nh;y++){\r
-                       pix = (int*)(&pixels[pitch * y]);\r
-                       pix2 = (int*)(&pixels2[pitch * y]);\r
-                       for(x=0;x<nw;x++){\r
-                               int right = (x==nw-1) ? 0 : *(int*)((((char*)pix)+bps));\r
-                               int left = (x==0) ? 0 : *(int*)((((char*)pix)-bps));\r
-                               int up = (y==0) ? 0 : *(int*)((((char*)pix)-pitch));\r
-                               int down = (y==nh-1) ? 0 : *(int*)((((char*)pix)+pitch));\r
-                               int my = *pix2;\r
-                               int new_alpha = (((((my & Amask) >> Ashift) << Aloss) +(((right & Amask) >> Ashift) << Aloss)+(((left & Amask) >> Ashift) << Aloss)+(((up & Amask) >> Ashift) << Aloss)+(((down & Amask) >> Ashift) << Aloss)) / 5) & 0xff;\r
-                               new_alpha = (new_alpha * 18) >> 4;\r
-                               if(new_alpha > 0xff){\r
-                                       new_alpha = 0xff;\r
-                               }\r
-                               *pix2 &= Mask;\r
-                               *pix2 |= ((new_alpha >> Aloss) << Ashift) & Amask;\r
-                               pix = (int*)(((char*)pix)+bps);\r
-                               pix2 = (int*)(((char*)pix2)+bps);\r
-                       }\r
-               }\r
-               tmp = shadow2;\r
-               shadow2 = shadow;\r
-               shadow = tmp;\r
-       }\r
-       SDL_UnlockSurface(shadow);\r
-       SDL_UnlockSurface(shadow2);\r
-       shadowBlitSurface(surf,NULL,shadow,&rect);\r
-       SDL_FreeSurface(surf);\r
-       SDL_FreeSurface(shadow2);\r
-       return shadow;\r
-}\r
-\r
-/*\89E\89º*/\r
-#define SHADOW_SLIDE 2\r
-SDL_Surface* likeNovel(SDL_Surface* surf,int is_black,int is_fix_size){\r
-       /*\83X\83\89\83C\83h\95\9d\82Ì\8am\92è*/\r
-       int slide = SHADOW_SLIDE;\r
-       if(is_fix_size){\r
-               slide <<= 1;\r
-       }\r
-       /*\8d\95\82Ì\97p\88Ó*/\r
-       SDL_Surface* black = SDL_CreateRGBSurface(      SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                                               surf->w+slide,\r
-                                                                                               surf->h+slide,\r
-                                                                                               32,\r
-                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                                   0xff000000,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x000000ff\r
-                                                                                               #else\r
-                                                                                                   0x000000ff,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0xff000000\r
-                                                                                               #endif\r
-                                                                                               );\r
-       SDL_Rect rect = {slide,slide};\r
-       SDL_SetAlpha(surf,0,0xff);//\88ê\89ñalpha\8d\87\90¬\82ð\90Ø\82é\r
-       SDL_BlitSurface(surf,NULL,black,&rect);\r
-       SDL_SetAlpha(surf,SDL_SRCALPHA,0xff);\r
-       if(is_black){//\8d\95\82Å\82 \82ê\82Î\81A\8eü\82è\82ð\82µ\82ë\82Å\88Í\82Þ\r
-               setRGB(black,0xffffffff);\r
-       }else{\r
-               setRGB(black,0);\r
-       }\r
-       setAlpha(black,0.6f);\r
-       shadowBlitSurface(surf,NULL,black,NULL);\r
-       SDL_FreeSurface(surf);\r
-       return black;\r
-}\r
-\r
-//\8eU\82ç\82·\82Ì\82Å\82Í\82È\82­\81A\88Í\82Á\82Ä\82µ\82Ü\82¤\81B\r
-SDL_Surface* likeOld(SDL_Surface* surf,int is_black,int is_fix_size){\r
-       /*\83X\83\89\83C\83h\95\9d\82Ì\8am\92è*/\r
-       int slide = SHADOW_SIZE;\r
-       if(is_fix_size){\r
-               slide <<= 1;\r
-       }\r
-       int w = surf->w;\r
-       int h = surf->h;\r
-       SDL_Surface* shadow = SDL_CreateRGBSurface(             SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                                               w+(slide<<1),\r
-                                                                                               h+(slide<<1),\r
-                                                                                               32,\r
-                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                                   0xff000000,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x000000ff\r
-                                                                                               #else\r
-                                                                                                   0x000000ff,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0xff000000\r
-                                                                                               #endif\r
-                                                                                       );\r
-       SDL_Surface* shadow2 = SDL_CreateRGBSurface(    SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,\r
-                                                                                               w+(slide<<1),\r
-                                                                                               h+(slide<<1),\r
-                                                                                               32,\r
-                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                                   0xff000000,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x000000ff\r
-                                                                                               #else\r
-                                                                                                   0x000000ff,\r
-                                                                                                   0x0000ff00,\r
-                                                                                                   0x00ff0000,\r
-                                                                                                   0xff000000\r
-                                                                                               #endif\r
-                                                                                       );\r
-       SDL_Rect rect = {slide,slide};\r
-       SDL_SetAlpha(surf,0,0xff);\r
-       SDL_BlitSurface(surf,NULL,shadow,&rect);\r
-       SDL_SetAlpha(surf,SDL_SRCALPHA,0xff);\r
-       if(is_black){//\8d\95\82Å\82 \82ê\82Î\81A\8eü\82è\82ð\82µ\82ë\82Å\88Í\82Þ\r
-               setRGB(shadow,0xffffffff);\r
-       }else{\r
-               setRGB(shadow,0);\r
-       }\r
-       SDL_SetAlpha(shadow,0,0xff);\r
-       SDL_BlitSurface(shadow,NULL,shadow2,NULL);\r
-       SDL_SetAlpha(shadow,SDL_SRCALPHA,0xff);\r
-       int x,y,z;\r
-       int nw = shadow->w;\r
-       int nh = shadow->h;\r
-       int *pix;\r
-       int *pix2;\r
-       int pitch = shadow->pitch;\r
-       int bps = shadow->format->BytesPerPixel;\r
-       Uint32 Amask = shadow->format->Amask;\r
-       Uint32 Mask = (shadow->format->Rmask | shadow->format->Gmask | shadow->format->Bmask);\r
-       Uint32 Ashift = shadow->format->Ashift;\r
-       Uint32 Aloss = shadow->format->Aloss;\r
-       SDL_Surface* tmp;\r
-       SDL_LockSurface(shadow);\r
-       SDL_LockSurface(shadow2);\r
-       int zmax = 1;\r
-       if(is_fix_size){\r
-               zmax = 2;\r
-       }\r
-       for(z=0;z<zmax;z++){\r
-               char *pixels = (char*)shadow->pixels;\r
-               char *pixels2 = (char*)shadow2->pixels;\r
-               for(y=0;y<nh;y++){\r
-                       pix = (int*)(&pixels[pitch * y]);\r
-                       pix2 = (int*)(&pixels2[pitch * y]);\r
-                       for(x=0;x<nw;x++){\r
-                               int right = (x==nw-1) ? 0 : *(int*)((((char*)pix)+bps));\r
-                               int left = (x==0) ? 0 : *(int*)((((char*)pix)-bps));\r
-                               int up = (y==0) ? 0 : *(int*)((((char*)pix)-pitch));\r
-                               int down = (y==nh-1) ? 0 : *(int*)((((char*)pix)+pitch));\r
-                               int my = *pix2;\r
-                               //\8eü\82è\82ª\8bó\94\92\82Å\82È\82¢\r
-                               if(((right | left | up | down | my) & Amask) != 0){\r
-                                       *pix2 &= Mask;\r
-                                       *pix2 |= (((0xff/(z+1)) >> Aloss) << Ashift) & Amask;\r
-                               }\r
-                               pix = (int*)(((char*)pix)+bps);\r
-                               pix2 = (int*)(((char*)pix2)+bps);\r
-                       }\r
-               }\r
-               tmp = shadow2;\r
-               shadow2 = shadow;\r
-               shadow = tmp;\r
-       }\r
-       SDL_UnlockSurface(shadow);\r
-       SDL_UnlockSurface(shadow2);\r
-       shadowBlitSurface(surf,NULL,shadow,&rect);\r
-       SDL_FreeSurface(surf);\r
-       SDL_FreeSurface(shadow2);\r
-       return shadow;\r
-}\r
-\r
-\r
-//\92è\8b`\r
-SDL_Surface* (*ShadowFunc[SHADOW_MAX])(SDL_Surface* surf,int is_black,int is_fix_size) = {\r
-       noShadow,\r
-       likeNicoNico,\r
-       likeNovel,\r
-       likeOld\r
-};\r
+#include <SDL/SDL.h>
+#include "surf_util.h"
+#include "shadow.h"
+
+/*影なし*/
+SDL_Surface* noShadow(SDL_Surface* surf,int is_black,int is_fix_size){
+       return surf;
+}
+/*右下*/
+#define SHADOW_SIZE 3
+
+SDL_Surface* likeNicoNico(SDL_Surface* surf,int is_black,int is_fix_size){
+       /*スライド幅の確定*/
+       int slide = SHADOW_SIZE;
+       if(is_fix_size){
+               slide <<= 1;
+       }
+       int w = surf->w;
+       int h = surf->h;
+       SDL_Surface* shadow = SDL_CreateRGBSurface(             SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                                               w+(slide<<1),
+                                                                                               h+(slide<<1),
+                                                                                               32,
+                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                                   0xff000000,
+                                                                                                   0x00ff0000,
+                                                                                                   0x0000ff00,
+                                                                                                   0x000000ff
+                                                                                               #else
+                                                                                                   0x000000ff,
+                                                                                                   0x0000ff00,
+                                                                                                   0x00ff0000,
+                                                                                                   0xff000000
+                                                                                               #endif
+                                                                                       );
+       SDL_Surface* shadow2 = SDL_CreateRGBSurface(    SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                                               w+(slide<<1),
+                                                                                               h+(slide<<1),
+                                                                                               32,
+                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                                   0xff000000,
+                                                                                                   0x00ff0000,
+                                                                                                   0x0000ff00,
+                                                                                                   0x000000ff
+                                                                                               #else
+                                                                                                   0x000000ff,
+                                                                                                   0x0000ff00,
+                                                                                                   0x00ff0000,
+                                                                                                   0xff000000
+                                                                                               #endif
+                                                                                       );
+       SDL_Rect rect = {slide,slide};
+       SDL_SetAlpha(surf,0,0xff);
+       SDL_BlitSurface(surf,NULL,shadow,&rect);
+       SDL_SetAlpha(surf,SDL_SRCALPHA,0xff);
+       if(is_black){//黒であれば、周りをしろで囲む
+               setRGB(shadow,0xffffffff);
+       }else{
+               setRGB(shadow,0);
+       }
+       SDL_SetAlpha(shadow,0,0xff);
+       SDL_BlitSurface(shadow,NULL,shadow2,NULL);
+       SDL_SetAlpha(shadow,SDL_SRCALPHA,0xff);
+       int x,y,z;
+       int nw = shadow->w;
+       int nh = shadow->h;
+       int *pix;
+       int *pix2;
+       int pitch = shadow->pitch;
+       int bps = shadow->format->BytesPerPixel;
+       Uint32 Amask = shadow->format->Amask;
+       Uint32 Mask = (shadow->format->Rmask | shadow->format->Gmask | shadow->format->Bmask);
+       Uint32 Ashift = shadow->format->Ashift;
+       Uint32 Aloss = shadow->format->Aloss;
+       SDL_LockSurface(shadow);
+       SDL_LockSurface(shadow2);
+       //ここは偶数にすること。
+       int zmax = 10;
+       if(is_fix_size){
+               zmax = 16;
+       }
+       SDL_Surface* tmp;
+       for(z=0;z<zmax;z++){
+               char *pixels = (char*)shadow->pixels;
+               char *pixels2 = (char*)shadow2->pixels;
+               for(y=0;y<nh;y++){
+                       pix = (int*)(&pixels[pitch * y]);
+                       pix2 = (int*)(&pixels2[pitch * y]);
+                       for(x=0;x<nw;x++){
+                               int right = (x==nw-1) ? 0 : *(int*)((((char*)pix)+bps));
+                               int left = (x==0) ? 0 : *(int*)((((char*)pix)-bps));
+                               int up = (y==0) ? 0 : *(int*)((((char*)pix)-pitch));
+                               int down = (y==nh-1) ? 0 : *(int*)((((char*)pix)+pitch));
+                               int my = *pix2;
+                               int new_alpha = (((((my & Amask) >> Ashift) << Aloss) +(((right & Amask) >> Ashift) << Aloss)+(((left & Amask) >> Ashift) << Aloss)+(((up & Amask) >> Ashift) << Aloss)+(((down & Amask) >> Ashift) << Aloss)) / 5) & 0xff;
+                               new_alpha = (new_alpha * 18) >> 4;
+                               if(new_alpha > 0xff){
+                                       new_alpha = 0xff;
+                               }
+                               *pix2 &= Mask;
+                               *pix2 |= ((new_alpha >> Aloss) << Ashift) & Amask;
+                               pix = (int*)(((char*)pix)+bps);
+                               pix2 = (int*)(((char*)pix2)+bps);
+                       }
+               }
+               tmp = shadow2;
+               shadow2 = shadow;
+               shadow = tmp;
+       }
+       SDL_UnlockSurface(shadow);
+       SDL_UnlockSurface(shadow2);
+       shadowBlitSurface(surf,NULL,shadow,&rect);
+       SDL_FreeSurface(surf);
+       SDL_FreeSurface(shadow2);
+       return shadow;
+}
+
+/*右下*/
+#define SHADOW_SLIDE 2
+SDL_Surface* likeNovel(SDL_Surface* surf,int is_black,int is_fix_size){
+       /*スライド幅の確定*/
+       int slide = SHADOW_SLIDE;
+       if(is_fix_size){
+               slide <<= 1;
+       }
+       /*黒の用意*/
+       SDL_Surface* black = SDL_CreateRGBSurface(      SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                                               surf->w+slide,
+                                                                                               surf->h+slide,
+                                                                                               32,
+                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                                   0xff000000,
+                                                                                                   0x00ff0000,
+                                                                                                   0x0000ff00,
+                                                                                                   0x000000ff
+                                                                                               #else
+                                                                                                   0x000000ff,
+                                                                                                   0x0000ff00,
+                                                                                                   0x00ff0000,
+                                                                                                   0xff000000
+                                                                                               #endif
+                                                                                               );
+       SDL_Rect rect = {slide,slide};
+       SDL_SetAlpha(surf,0,0xff);//一回alpha合成を切る
+       SDL_BlitSurface(surf,NULL,black,&rect);
+       SDL_SetAlpha(surf,SDL_SRCALPHA,0xff);
+       if(is_black){//黒であれば、周りをしろで囲む
+               setRGB(black,0xffffffff);
+       }else{
+               setRGB(black,0);
+       }
+       setAlpha(black,0.6f);
+       shadowBlitSurface(surf,NULL,black,NULL);
+       SDL_FreeSurface(surf);
+       return black;
+}
+
+//散らすのではなく、囲ってしまう。
+SDL_Surface* likeOld(SDL_Surface* surf,int is_black,int is_fix_size){
+       /*スライド幅の確定*/
+       int slide = SHADOW_SIZE;
+       if(is_fix_size){
+               slide <<= 1;
+       }
+       int w = surf->w;
+       int h = surf->h;
+       SDL_Surface* shadow = SDL_CreateRGBSurface(             SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                                               w+(slide<<1),
+                                                                                               h+(slide<<1),
+                                                                                               32,
+                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                                   0xff000000,
+                                                                                                   0x00ff0000,
+                                                                                                   0x0000ff00,
+                                                                                                   0x000000ff
+                                                                                               #else
+                                                                                                   0x000000ff,
+                                                                                                   0x0000ff00,
+                                                                                                   0x00ff0000,
+                                                                                                   0xff000000
+                                                                                               #endif
+                                                                                       );
+       SDL_Surface* shadow2 = SDL_CreateRGBSurface(    SDL_SRCALPHA | SDL_HWSURFACE | SDL_HWACCEL,
+                                                                                               w+(slide<<1),
+                                                                                               h+(slide<<1),
+                                                                                               32,
+                                                                                               #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                                   0xff000000,
+                                                                                                   0x00ff0000,
+                                                                                                   0x0000ff00,
+                                                                                                   0x000000ff
+                                                                                               #else
+                                                                                                   0x000000ff,
+                                                                                                   0x0000ff00,
+                                                                                                   0x00ff0000,
+                                                                                                   0xff000000
+                                                                                               #endif
+                                                                                       );
+       SDL_Rect rect = {slide,slide};
+       SDL_SetAlpha(surf,0,0xff);
+       SDL_BlitSurface(surf,NULL,shadow,&rect);
+       SDL_SetAlpha(surf,SDL_SRCALPHA,0xff);
+       if(is_black){//黒であれば、周りをしろで囲む
+               setRGB(shadow,0xffffffff);
+       }else{
+               setRGB(shadow,0);
+       }
+       SDL_SetAlpha(shadow,0,0xff);
+       SDL_BlitSurface(shadow,NULL,shadow2,NULL);
+       SDL_SetAlpha(shadow,SDL_SRCALPHA,0xff);
+       int x,y,z;
+       int nw = shadow->w;
+       int nh = shadow->h;
+       int *pix;
+       int *pix2;
+       int pitch = shadow->pitch;
+       int bps = shadow->format->BytesPerPixel;
+       Uint32 Amask = shadow->format->Amask;
+       Uint32 Mask = (shadow->format->Rmask | shadow->format->Gmask | shadow->format->Bmask);
+       Uint32 Ashift = shadow->format->Ashift;
+       Uint32 Aloss = shadow->format->Aloss;
+       SDL_Surface* tmp;
+       SDL_LockSurface(shadow);
+       SDL_LockSurface(shadow2);
+       int zmax = 1;
+       if(is_fix_size){
+               zmax = 2;
+       }
+       for(z=0;z<zmax;z++){
+               char *pixels = (char*)shadow->pixels;
+               char *pixels2 = (char*)shadow2->pixels;
+               for(y=0;y<nh;y++){
+                       pix = (int*)(&pixels[pitch * y]);
+                       pix2 = (int*)(&pixels2[pitch * y]);
+                       for(x=0;x<nw;x++){
+                               int right = (x==nw-1) ? 0 : *(int*)((((char*)pix)+bps));
+                               int left = (x==0) ? 0 : *(int*)((((char*)pix)-bps));
+                               int up = (y==0) ? 0 : *(int*)((((char*)pix)-pitch));
+                               int down = (y==nh-1) ? 0 : *(int*)((((char*)pix)+pitch));
+                               int my = *pix2;
+                               //周りが空白でない
+                               if(((right | left | up | down | my) & Amask) != 0){
+                                       *pix2 &= Mask;
+                                       *pix2 |= (((0xff/(z+1)) >> Aloss) << Ashift) & Amask;
+                               }
+                               pix = (int*)(((char*)pix)+bps);
+                               pix2 = (int*)(((char*)pix2)+bps);
+                       }
+               }
+               tmp = shadow2;
+               shadow2 = shadow;
+               shadow = tmp;
+       }
+       SDL_UnlockSurface(shadow);
+       SDL_UnlockSurface(shadow2);
+       shadowBlitSurface(surf,NULL,shadow,&rect);
+       SDL_FreeSurface(surf);
+       SDL_FreeSurface(shadow2);
+       return shadow;
+}
+
+
+//定義
+SDL_Surface* (*ShadowFunc[SHADOW_MAX])(SDL_Surface* surf,int is_black,int is_fix_size) = {
+       noShadow,
+       likeNicoNico,
+       likeNovel,
+       likeOld
+};
index 0359680..d436a9b 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef SHADOW_H_\r
-#define SHADOW_H_\r
-\r
-#define SHADOW_MAX 4\r
-#define SHADOW_DEFAULT 1\r
-SDL_Surface* (*ShadowFunc[SHADOW_MAX])(SDL_Surface* surf,int is_black,int is_fix_size);\r
-\r
-#endif /*SHADOW_H_*/\r
+#ifndef SHADOW_H_
+#define SHADOW_H_
+
+#define SHADOW_MAX 4
+#define SHADOW_DEFAULT 1
+SDL_Surface* (*ShadowFunc[SHADOW_MAX])(SDL_Surface* surf,int is_black,int is_fix_size);
+
+#endif /*SHADOW_H_*/
index f8da9b7..a948b00 100644 (file)
-#include <SDL/SDL.h>\r
-#include "surf_util.h"\r
-#include "../mydef.h"\r
-\r
-SDL_Surface* connectSurface(SDL_Surface* top,SDL_Surface* bottom){\r
-       SDL_Surface* ret = SDL_CreateRGBSurface( SDL_SRCALPHA,\r
-                                                                                       MAX(top->w,bottom->w),\r
-                                                                                       top->h+bottom->h,\r
-                                                                                       32,\r
-                                                                                       #if SDL_BYTEORDER == SDL_BIG_ENDIAN\r
-                                                                                           0xff000000,\r
-                                                                                           0x00ff0000,\r
-                                                                                           0x0000ff00,\r
-                                                                                           0x000000ff\r
-                                                                                       #else\r
-                                                                                           0x000000ff,\r
-                                                                                           0x0000ff00,\r
-                                                                                           0x00ff0000,\r
-                                                                                               0xff000000\r
-                                                                                       #endif\r
-                                                                                       );\r
-       SDL_SetAlpha(top,SDL_SRCALPHA | SDL_RLEACCEL,0xff);\r
-       SDL_SetAlpha(bottom,SDL_SRCALPHA | SDL_RLEACCEL,0xff);\r
-\r
-       SDL_BlitSurface(top,NULL,ret,NULL);\r
-\r
-       SDL_Rect rect2 = {0,top->h};\r
-       SDL_BlitSurface(bottom,NULL,ret,&rect2);\r
-       SDL_FreeSurface(top);\r
-       SDL_FreeSurface(bottom);\r
-       return ret;\r
-}\r
-\r
-void setAlpha(SDL_Surface* surf,double alpha_t){\r
-       int x,y;\r
-       int h = surf->h;\r
-       int w = surf->w;\r
-       Uint32 mask,shift,bytesp,pitch,loss;\r
-       Uint8 alpha;\r
-       Uint8* pixels;\r
-       Uint32* pix;\r
-       SDL_PixelFormat* format = surf->format;\r
-       /*\95Ï\90\94\82Ì\90Ý\92è*/\r
-       mask = format->Amask;\r
-       shift = format->Ashift;\r
-       loss = format->Aloss;\r
-       bytesp = format->BytesPerPixel;\r
-       pitch = surf->pitch;\r
-       pixels = surf->pixels;\r
-       SDL_LockSurface(surf);//\83T\81[\83t\83F\83C\83X\82ð\83\8d\83b\83N\r
-       for(y=0;y<h;y++){\r
-               for(x=0;x<w;x++){\r
-                       pix = (Uint32*)(&pixels[y*pitch + x*bytesp]);\r
-                       alpha = (Uint8)((((*pix) & mask) >> shift) << loss);\r
-                       alpha *= alpha_t;\r
-                       (*pix) &= ~((0xff >> loss) << shift);\r
-                       (*pix) |= (alpha >> loss) << shift;\r
-               }\r
-       }\r
-       SDL_UnlockSurface(surf);//\83A\83\93\83\8d\83b\83N\r
-}\r
-\r
-/**\r
- * src\82Ì\95s\93§\96¾\93x\82ð\8fã\8f\91\82«\82µ\82Ä\82µ\82Ü\82¤\81B\r
- * src\82Ì\95û\82ª\95s\93§\96¾\82È\82ç\81A\82»\82ê\82ð\8fã\8f\91\82«\81B\r
- */\r
-\r
-void overrideAlpha(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect){\r
-       SDL_LockSurface(src);//\83T\81[\83t\83F\83C\83X\82ð\83\8d\83b\83N\r
-       SDL_LockSurface(dst);//\83T\81[\83t\83F\83C\83X\82ð\83\8d\83b\83N\r
-       //\94Í\88Í\82Ì\8am\92è\r
-       int sw = src->w;\r
-       int sh = src->h;\r
-       int sx = 0;\r
-       int sy = 0;\r
-       if(srcrect != NULL){\r
-               sx = srcrect->x;\r
-               sy = srcrect->y;\r
-               if(sx >= sw || sy > sh){\r
-                       return;\r
-               }\r
-               sw = MIN(sw-sx,srcrect->w);\r
-               sh = MIN(sh-sy,srcrect->h);\r
-       }\r
-       int dw = dst->w;\r
-       int dh = dst->h;\r
-       int dx = 0;\r
-       int dy = 0;\r
-       if(dstrect != NULL){\r
-               dx = dstrect->x;\r
-               dy = dstrect->y;\r
-               if(dx >= dw || dy > dh){\r
-                       return;\r
-               }\r
-               dw = MIN(dw-dx,dstrect->w);\r
-               dh = MIN(dh-dy,dstrect->h);\r
-       }\r
-       //\8f¬\82³\82¢\82Ù\82¤\82É\82 \82í\82¹\82é\r
-       if(dw > sw){\r
-               dw = sw;\r
-       }else{\r
-               sw = dw;\r
-       }\r
-       if(dh > sh){\r
-               dh = sh;\r
-       }else{\r
-               sh = dh;\r
-       }\r
-       //\82â\82Á\82Æ\82±\82³\95`\89æ\81B\81B\r
-       int sbytesp = src->format->BytesPerPixel;\r
-       int dbytesp = dst->format->BytesPerPixel;\r
-       int spitch = src->pitch;\r
-       int dpitch = dst->pitch;\r
-       int sAmask = src->format->Amask;\r
-       int dAmask = dst->format->Amask;\r
-       int sAshift = src->format->Ashift;\r
-       int dAshift = dst->format->Ashift;\r
-       int sAloss = src->format->Aloss;\r
-       int dAloss = dst->format->Aloss;\r
-       Uint8* spix = (Uint8*)src->pixels;\r
-       Uint8* dpix = (Uint8*)dst->pixels;\r
-       Uint32* spt;\r
-       Uint32* dpt;\r
-       Uint32 salpha;\r
-       Uint32 dalpha;\r
-       int x,y;\r
-       for(y=0;y<sh;y++){\r
-               for(x=0;x<sw;x++){\r
-                       spt = (Uint32*)(&spix[(sy+y)*spitch+(sx+x)*sbytesp]);\r
-                       dpt = (Uint32*)(&dpix[(dy+y)*dpitch+(dx+x)*dbytesp]);\r
-                       salpha = ((*spt & sAmask)>>sAshift)<<sAloss;\r
-                       dalpha = ((*dpt & dAmask)>>dAshift)<<dAloss;\r
-                       if(salpha > dalpha){\r
-                               *dpt &= ~dAmask;\r
-                               *dpt |= (salpha>>dAloss)<<dAshift;\r
-                       }\r
-               }\r
-       }\r
-       SDL_UnlockSurface(dst);//\83A\83\93\83\8d\83b\83N\r
-       SDL_UnlockSurface(src);//\83A\83\93\83\8d\83b\83N\r
-}\r
-\r
-void inline shadowBlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect){\r
-       SDL_BlitSurface(src,srcrect,dst,dstrect);\r
-       overrideAlpha(src,srcrect,dst,dstrect);\r
-}\r
-\r
-void setRGB(SDL_Surface* surf,Uint32 color){\r
-       int x,y;\r
-       int h = surf->h;\r
-       int w = surf->w;\r
-       int bytesp = surf->format->BytesPerPixel;\r
-       int pitch = surf->pitch;\r
-       Uint32 Amask = surf->format->Amask;\r
-       color &= surf->format->Rmask | surf->format->Gmask | surf->format->Bmask;\r
-       Uint8* pix = (Uint8*)surf->pixels;\r
-       Uint32* pt;\r
-       SDL_LockSurface(surf);//\83T\81[\83t\83F\83C\83X\82ð\83\8d\83b\83N\r
-       for(y=0;y<h;y++){\r
-               for(x=0;x<w;x++){\r
-                       pt = (Uint32*)(&pix[y*pitch + x*bytesp]);\r
-                       *pt &= Amask;\r
-                       *pt |= color;\r
-               }\r
-       }\r
-       SDL_UnlockSurface(surf);//\83T\81[\83t\83F\83C\83X\82ð\83A\83\93\83\8d\83b\83N\r
-}\r
-\r
-void getRGBA(SDL_Surface* surf,int x,int y,char* r,char* g,char* b,char* a){\r
-       int pix_index = y * surf->pitch + x * surf->format->BytesPerPixel;\r
-       char* pix = (char*)surf->pixels;\r
-       SDL_GetRGBA(*(Uint32*)(&pix[pix_index]),surf->format,(Uint8*)r,(Uint8*)g,(Uint8*)b,(Uint8*)a);\r
-}\r
-\r
+#include <SDL/SDL.h>
+#include "surf_util.h"
+#include "../mydef.h"
+
+SDL_Surface* connectSurface(SDL_Surface* top,SDL_Surface* bottom){
+       SDL_Surface* ret = SDL_CreateRGBSurface( SDL_SRCALPHA,
+                                                                                       MAX(top->w,bottom->w),
+                                                                                       top->h+bottom->h,
+                                                                                       32,
+                                                                                       #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+                                                                                           0xff000000,
+                                                                                           0x00ff0000,
+                                                                                           0x0000ff00,
+                                                                                           0x000000ff
+                                                                                       #else
+                                                                                           0x000000ff,
+                                                                                           0x0000ff00,
+                                                                                           0x00ff0000,
+                                                                                               0xff000000
+                                                                                       #endif
+                                                                                       );
+       SDL_SetAlpha(top,SDL_SRCALPHA | SDL_RLEACCEL,0xff);
+       SDL_SetAlpha(bottom,SDL_SRCALPHA | SDL_RLEACCEL,0xff);
+
+       SDL_BlitSurface(top,NULL,ret,NULL);
+
+       SDL_Rect rect2 = {0,top->h};
+       SDL_BlitSurface(bottom,NULL,ret,&rect2);
+       SDL_FreeSurface(top);
+       SDL_FreeSurface(bottom);
+       return ret;
+}
+
+void setAlpha(SDL_Surface* surf,double alpha_t){
+       int x,y;
+       int h = surf->h;
+       int w = surf->w;
+       Uint32 mask,shift,bytesp,pitch,loss;
+       Uint8 alpha;
+       Uint8* pixels;
+       Uint32* pix;
+       SDL_PixelFormat* format = surf->format;
+       /*変数の設定*/
+       mask = format->Amask;
+       shift = format->Ashift;
+       loss = format->Aloss;
+       bytesp = format->BytesPerPixel;
+       pitch = surf->pitch;
+       pixels = surf->pixels;
+       SDL_LockSurface(surf);//サーフェイスをロック
+       for(y=0;y<h;y++){
+               for(x=0;x<w;x++){
+                       pix = (Uint32*)(&pixels[y*pitch + x*bytesp]);
+                       alpha = (Uint8)((((*pix) & mask) >> shift) << loss);
+                       alpha *= alpha_t;
+                       (*pix) &= ~((0xff >> loss) << shift);
+                       (*pix) |= (alpha >> loss) << shift;
+               }
+       }
+       SDL_UnlockSurface(surf);//アンロック
+}
+
+/**
+ * srcの不透明度を上書きしてしまう。
+ * srcの方が不透明なら、それを上書き。
+ */
+
+void overrideAlpha(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect){
+       SDL_LockSurface(src);//サーフェイスをロック
+       SDL_LockSurface(dst);//サーフェイスをロック
+       //範囲の確定
+       int sw = src->w;
+       int sh = src->h;
+       int sx = 0;
+       int sy = 0;
+       if(srcrect != NULL){
+               sx = srcrect->x;
+               sy = srcrect->y;
+               if(sx >= sw || sy > sh){
+                       return;
+               }
+               sw = MIN(sw-sx,srcrect->w);
+               sh = MIN(sh-sy,srcrect->h);
+       }
+       int dw = dst->w;
+       int dh = dst->h;
+       int dx = 0;
+       int dy = 0;
+       if(dstrect != NULL){
+               dx = dstrect->x;
+               dy = dstrect->y;
+               if(dx >= dw || dy > dh){
+                       return;
+               }
+               dw = MIN(dw-dx,dstrect->w);
+               dh = MIN(dh-dy,dstrect->h);
+       }
+       //小さいほうにあわせる
+       if(dw > sw){
+               dw = sw;
+       }else{
+               sw = dw;
+       }
+       if(dh > sh){
+               dh = sh;
+       }else{
+               sh = dh;
+       }
+       //やっとこさ描画。。
+       int sbytesp = src->format->BytesPerPixel;
+       int dbytesp = dst->format->BytesPerPixel;
+       int spitch = src->pitch;
+       int dpitch = dst->pitch;
+       int sAmask = src->format->Amask;
+       int dAmask = dst->format->Amask;
+       int sAshift = src->format->Ashift;
+       int dAshift = dst->format->Ashift;
+       int sAloss = src->format->Aloss;
+       int dAloss = dst->format->Aloss;
+       Uint8* spix = (Uint8*)src->pixels;
+       Uint8* dpix = (Uint8*)dst->pixels;
+       Uint32* spt;
+       Uint32* dpt;
+       Uint32 salpha;
+       Uint32 dalpha;
+       int x,y;
+       for(y=0;y<sh;y++){
+               for(x=0;x<sw;x++){
+                       spt = (Uint32*)(&spix[(sy+y)*spitch+(sx+x)*sbytesp]);
+                       dpt = (Uint32*)(&dpix[(dy+y)*dpitch+(dx+x)*dbytesp]);
+                       salpha = ((*spt & sAmask)>>sAshift)<<sAloss;
+                       dalpha = ((*dpt & dAmask)>>dAshift)<<dAloss;
+                       if(salpha > dalpha){
+                               *dpt &= ~dAmask;
+                               *dpt |= (salpha>>dAloss)<<dAshift;
+                       }
+               }
+       }
+       SDL_UnlockSurface(dst);//アンロック
+       SDL_UnlockSurface(src);//アンロック
+}
+
+void inline shadowBlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect){
+       SDL_BlitSurface(src,srcrect,dst,dstrect);
+       overrideAlpha(src,srcrect,dst,dstrect);
+}
+
+void setRGB(SDL_Surface* surf,Uint32 color){
+       int x,y;
+       int h = surf->h;
+       int w = surf->w;
+       int bytesp = surf->format->BytesPerPixel;
+       int pitch = surf->pitch;
+       Uint32 Amask = surf->format->Amask;
+       color &= surf->format->Rmask | surf->format->Gmask | surf->format->Bmask;
+       Uint8* pix = (Uint8*)surf->pixels;
+       Uint32* pt;
+       SDL_LockSurface(surf);//サーフェイスをロック
+       for(y=0;y<h;y++){
+               for(x=0;x<w;x++){
+                       pt = (Uint32*)(&pix[y*pitch + x*bytesp]);
+                       *pt &= Amask;
+                       *pt |= color;
+               }
+       }
+       SDL_UnlockSurface(surf);//サーフェイスをアンロック
+}
+
+void getRGBA(SDL_Surface* surf,int x,int y,char* r,char* g,char* b,char* a){
+       int pix_index = y * surf->pitch + x * surf->format->BytesPerPixel;
+       char* pix = (char*)surf->pixels;
+       SDL_GetRGBA(*(Uint32*)(&pix[pix_index]),surf->format,(Uint8*)r,(Uint8*)g,(Uint8*)b,(Uint8*)a);
+}
+
index 5d81a15..b082506 100644 (file)
@@ -1,9 +1,9 @@
-#ifndef SURF_UTIL_H_\r
-#define SURF_UTIL_H_\r
-#include <SDL/SDL.h>\r
-SDL_Surface* connectSurface(SDL_Surface* top,SDL_Surface* bottom);\r
-void setAlpha(SDL_Surface* surf,double alpha_t);\r
-void overrideAlpha(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);\r
-void inline shadowBlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);\r
-void setRGB(SDL_Surface* surf,Uint32 color);\r
-#endif /*SURF_UTIL_H_*/\r
+#ifndef SURF_UTIL_H_
+#define SURF_UTIL_H_
+#include <SDL/SDL.h>
+SDL_Surface* connectSurface(SDL_Surface* top,SDL_Surface* bottom);
+void setAlpha(SDL_Surface* surf,double alpha_t);
+void overrideAlpha(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
+void inline shadowBlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
+void setRGB(SDL_Surface* surf,Uint32 color);
+#endif /*SURF_UTIL_H_*/
index ca55b5a..e1ea56d 100644 (file)
@@ -1,57 +1,57 @@
-/*\r
- * \8ag\92£Vhook\83t\83B\83\8b\83^\r
- * copyright (c) 2008 \83Õ\81i\83v\83T\83C\81j\r
- *\r
- * \82³\82«\82ã\82Î\82·\97p\82É\8ag\92£\82³\82ê\82½Vhook\83\89\83C\83u\83\89\83\8a\82ð\r
- * \83r\83\8b\83h\82·\82é\82½\82ß\82Ì\83w\83b\83_\82Å\82·\81B\r
- *\r
- * \82±\82Ì\83t\83@\83C\83\8b\82Í\81u\82³\82«\82ã\82Î\82·\81v\82Ì\88ê\95\94\82Å\82 \82è\81A\r
- * \82±\82Ì\83\\81[\83X\83R\81[\83h\82ÍGPL\83\89\83C\83Z\83\93\83X\82Å\94z\95z\82³\82ê\82Ü\82·\82Å\82·\81B\r
- */\r
-#ifndef SACCUBUS_VF_VHEXT_H\r
-#define SACCUBUS_VF_VHEXT_H\r
-/*\r
- * \83c\81[\83\8b\83{\83b\83N\83X\82Ì\83o\81[\83W\83\87\83\93\r
- * DLL\82Ì\92\86\82Å\8am\94F\82µ\82Æ\82¢\82½\95û\82ª\82¢\82¢\81B\r
- */\r
-#define TOOLBOX_VERSION 2\r
-\r
-/*\r
- * \8cÄ\82Î\82ê\82é\82Æ\82«\82É\88ê\8f\8f\82É\82Â\82¢\82Ä\82­\82étoolbox.\r
- * \82±\82±\82©\82ç\93®\89æ\82Ì\8fî\95ñ\82È\82ñ\82©\82à\8eæ\93¾\82Å\82«\82é\81B\r
- */\r
-typedef struct toolbox{\r
-       //\83o\81[\83W\83\87\83\93\r
-       int version;\r
-       double video_length;\r
-} toolbox;\r
-\r
-typedef struct vhext_frame{\r
-       void *data;\r
-       int linesize;\r
-       int w;\r
-       int h;\r
-       double pts;\r
-} vhext_frame;\r
-\r
-\r
-/*\r
- * \8ag\92£vhook\83\89\83C\83u\83\89\83\8a\97p\8aÖ\90\94\8cQ\92è\8b`\r
- */\r
-\r
-//configure\97p\r
-typedef int (FrameHookExtConfigure)(void **ctxp,const toolbox *tbox, int argc, char *argv[]);\r
-typedef FrameHookExtConfigure *FrameHookExtConfigureFn;\r
-extern FrameHookExtConfigure ExtConfigure;\r
-\r
-//\83t\83\8c\81[\83\80\97p\r
-typedef void (FrameHookExtProcess)(void *ctx,const toolbox *tbox,vhext_frame *pict);\r
-typedef FrameHookExtProcess *FrameHookExtProcessFn;\r
-extern FrameHookExtProcess ExtProcess;\r
-\r
-//\8fI\97¹\8e\9e\82É\8cÄ\82Ô\r
-typedef void (FrameHookExtRelease)(void *ctx,const toolbox *tbox);\r
-typedef FrameHookExtRelease *FrameHookExtReleaseFn;\r
-extern FrameHookExtRelease ExtRelease;\r
-\r
-#endif /* SACCUBUS_VF_VHEXT_H */\r
+/*
+ * 拡張Vhookフィルタ
+ * copyright (c) 2008 ψ(プサイ)
+ *
+ * さきゅばす用に拡張されたVhookライブラリを
+ * ビルドするためのヘッダです。
+ *
+ * このファイルは「さきゅばす」の一部であり、
+ * このソースコードはGPLライセンスで配布されますです。
+ */
+#ifndef SACCUBUS_VF_VHEXT_H
+#define SACCUBUS_VF_VHEXT_H
+/*
+ * ツールボックスのバージョン
+ * DLLの中で確認しといた方がいい。
+ */
+#define TOOLBOX_VERSION 2
+
+/*
+ * 呼ばれるときに一緒についてくるtoolbox.
+ * ここから動画の情報なんかも取得できる。
+ */
+typedef struct toolbox{
+       //バージョン
+       int version;
+       double video_length;
+} toolbox;
+
+typedef struct vhext_frame{
+       void *data;
+       int linesize;
+       int w;
+       int h;
+       double pts;
+} vhext_frame;
+
+
+/*
+ * 拡張vhookライブラリ用関数群定義
+ */
+
+//configure
+typedef int (FrameHookExtConfigure)(void **ctxp,const toolbox *tbox, int argc, char *argv[]);
+typedef FrameHookExtConfigure *FrameHookExtConfigureFn;
+extern FrameHookExtConfigure ExtConfigure;
+
+//フレーム用
+typedef void (FrameHookExtProcess)(void *ctx,const toolbox *tbox,vhext_frame *pict);
+typedef FrameHookExtProcess *FrameHookExtProcessFn;
+extern FrameHookExtProcess ExtProcess;
+
+//終了時に呼ぶ
+typedef void (FrameHookExtRelease)(void *ctx,const toolbox *tbox);
+typedef FrameHookExtRelease *FrameHookExtReleaseFn;
+extern FrameHookExtRelease ExtRelease;
+
+#endif /* SACCUBUS_VF_VHEXT_H */
diff --git a/vhook/docs/nicoplayer.swf.readme b/vhook/docs/nicoplayer.swf.readme
new file mode 100644 (file)
index 0000000..f4b8ca6
--- /dev/null
@@ -0,0 +1,2 @@
+http://blogs.yahoo.co.jp/kerupani/9913707.html
+に記載されていたnicoplayer.swfのデコンパイルテキストです.
diff --git a/vhook/docs/nicoplayer.swf.source b/vhook/docs/nicoplayer.swf.source
new file mode 100644 (file)
index 0000000..a132a00
--- /dev/null
@@ -0,0 +1,45599 @@
+//■ABC File MinorVersion:16 , MajorVersion:46
+
+//INT cnt=143
+//UINT cnt=1
+//DOUBLE cnt=32
+//STRING cnt=6667
+//NAMESPACES cnt=1166
+//NAMESPACE_SETS cnt=279
+//MULTINAMES cnt=7959
+//Methods cnt=5427
+//METADATA cnt=0
+//INTERFACE cnt=465
+//CLASS cnt=465
+//SCRIPT cnt=396
+
+//■script000■
+
+package jp.nicovideo.ext{
+
+       import jp.nicovideo.ext.config.IThumbConfig
+       import jp.nicovideo.nicoplayer.models.flashvars.NicoFlashVars
+
+       //■class(instance)_index:0
+       public interface IThumbPlayer
+       {
+               //static constructor
+               public static function IThumbPlayer$cinit()
+               {       //MethodID:0, LocalCount= 1 , MaxScope= 0, MaxStack= 0, CodeLength= 1
+               }
+
+               //variables/etc.
+               function setThumbWatchVars(hug1:IThumbConfig, hug2:NicoFlashVars):void;     //MethodID:1, dispID:0
+
+               function get initialized():Boolean;                                         //MethodID:2, dispID:0
+
+               function playThumbPlayer():void;                                            //MethodID:3, dispID:0
+
+               function pauseThumbPlayer():void;                                           //MethodID:4, dispID:0
+
+               function set onChangedVideoStatus(hug1:Function):void;                      //MethodID:5, dispID:0
+
+               function get videoPlayerStatus():String;                                    //MethodID:6, dispID:0
+
+               //constructor
+               public function IThumbPlayer();                                             //MethodID:7, dispID:0
+       }
+}
+
+//■script001■
+
+package jp.nicovideo.nicoplayer{
+
+       import flash.display.DisplayObject
+       import flash.display.MovieClip
+       import flash.display.Sprite
+       import flash.display.StageAlign
+       import flash.display.StageScaleMode
+       import flash.errors.IOError
+       import flash.errors.IllegalOperationError
+       import flash.events.Event
+       import flash.events.TimerEvent
+       import flash.net.URLRequest
+       import flash.net.URLVariables
+       import flash.net.navigateToURL
+       import flash.system.Security
+       import flash.ui.ContextMenu
+       import flash.utils.Timer
+       import jp.nicovideo.ext.config.IThumbConfig
+       import jp.nicovideo.hiroba.HirobaConnectorClient
+       import jp.nicovideo.hiroba.IHirobaConnector
+       import jp.nicovideo.hiroba.events.HirobaErrorEvent
+       import jp.nicovideo.hiroba.events.HirobaEvent
+       import jp.nicovideo.hiroba.events.HirobaEventReferer
+       import jp.nicovideo.hiroba.models.HirobaMessageServerInfo
+       import jp.nicovideo.marquee.INicoMarqueePlayer
+       import jp.nicovideo.marquee.MarqueeClient
+       import jp.nicovideo.nicoplayer.app.ApplibarLoader
+       import jp.nicovideo.nicoplayer.config.DebugMode
+       import jp.nicovideo.nicoplayer.config.DefaultInitializer
+       import jp.nicovideo.nicoplayer.config.NicoConfig
+       import jp.nicovideo.nicoplayer.config.getDebugMode
+       import jp.nicovideo.nicoplayer.external.ExternalClient
+       import jp.nicovideo.nicoplayer.hiroba.HirobaPlayer
+       import jp.nicovideo.nicoplayer.hiroba.events.HirobaErrorStatus
+       import jp.nicovideo.nicoplayer.models.IPlayerConfig
+       import jp.nicovideo.nicoplayer.models.MyList
+       import jp.nicovideo.nicoplayer.models.PlayDelay
+       import jp.nicovideo.nicoplayer.models.PlayerConfig
+       import jp.nicovideo.nicoplayer.models.PlayerInfo
+       import jp.nicovideo.nicoplayer.models.PlayerVersion
+       import jp.nicovideo.nicoplayer.models.RelatedVideoList
+       import jp.nicovideo.nicoplayer.models.ScreenAspectRatio
+       import jp.nicovideo.nicoplayer.models.StartVposConfig
+       import jp.nicovideo.nicoplayer.models.SystemMessage
+       import jp.nicovideo.nicoplayer.models.VideoDetail
+       import jp.nicovideo.nicoplayer.models.VideoLoadGuardian
+       import jp.nicovideo.nicoplayer.models.api.BGMVideoInfo
+       import jp.nicovideo.nicoplayer.models.api.GetBGM
+       import jp.nicovideo.nicoplayer.models.api.GetChecklist
+       import jp.nicovideo.nicoplayer.models.api.GetFLV
+       import jp.nicovideo.nicoplayer.models.api.GetRelation
+       import jp.nicovideo.nicoplayer.models.api.GetSponsorInfo
+       import jp.nicovideo.nicoplayer.models.api.ICapturableVideoContainer
+       import jp.nicovideo.nicoplayer.models.api.IKeygen
+       import jp.nicovideo.nicoplayer.models.api.InitializeInfo
+       import jp.nicovideo.nicoplayer.models.api.Jumper
+       import jp.nicovideo.nicoplayer.models.api.Keygen
+       import jp.nicovideo.nicoplayer.models.api.RegisterBGM
+       import jp.nicovideo.nicoplayer.models.comment.CommentConstants
+       import jp.nicovideo.nicoplayer.models.comment.CommentList
+       import jp.nicovideo.nicoplayer.models.comment.CommentListPublicStatus
+       import jp.nicovideo.nicoplayer.models.comment.CommentPoolContainer
+       import jp.nicovideo.nicoplayer.models.comment.CommentRouter
+       import jp.nicovideo.nicoplayer.models.comment.CommentStorageEvents
+       import jp.nicovideo.nicoplayer.models.comment.ICommentList
+       import jp.nicovideo.nicoplayer.models.comment.LocalCommentList
+       import jp.nicovideo.nicoplayer.models.comment.OwnerCommentList
+       import jp.nicovideo.nicoplayer.models.comment.TimeMachine
+       import jp.nicovideo.nicoplayer.models.filter.ChannelReplacer
+       import jp.nicovideo.nicoplayer.models.filter.DeleteFilter
+       import jp.nicovideo.nicoplayer.models.filter.LockedComment
+       import jp.nicovideo.nicoplayer.models.filter.NGComment
+       import jp.nicovideo.nicoplayer.models.filter.NGInfo
+       import jp.nicovideo.nicoplayer.models.filter.NGResponseConstants
+       import jp.nicovideo.nicoplayer.models.filter.NGType
+       import jp.nicovideo.nicoplayer.models.filter.Replacer
+       import jp.nicovideo.nicoplayer.models.flashvars.NicoFlashVars
+       import jp.nicovideo.nicoplayer.models.flashvars.NicoFlashVarsInitializer
+       import jp.nicovideo.nicoplayer.models.flashvars.PlaylistFlashVars
+       import jp.nicovideo.nicoplayer.models.log.LogManager
+       import jp.nicovideo.nicoplayer.models.mylist.DefaultMylistAppender
+       import jp.nicovideo.nicoplayer.models.playlist.Playlist
+       import jp.nicovideo.nicoplayer.models.playlist.PlaylistController
+       import jp.nicovideo.nicoplayer.models.playlist.PlaylistErrorManager
+       import jp.nicovideo.nicoplayer.models.video.ChildVideoName
+       import jp.nicovideo.nicoplayer.models.video.FLVVideo
+       import jp.nicovideo.nicoplayer.models.video.IVideo
+       import jp.nicovideo.nicoplayer.models.video.SWFVideo
+       import jp.nicovideo.nicoplayer.models.video.VideoController
+       import jp.nicovideo.nicoplayer.models.video.VideoLoadWatcher
+       import jp.nicovideo.nicoplayer.models.video.VideoType
+       import jp.nicovideo.nicoplayer.models.video.VideoWrapper
+       import jp.nicovideo.nicoplayer.models.video.VposWatcher
+       import jp.nicovideo.nicoplayer.models.video.userSponsor.IUserSponsorVideo
+       import jp.nicovideo.nicoplayer.models.video.userSponsor.UserSponsorVideoClient
+       import jp.nicovideo.nicoplayer.plugin.NicoPluginClient
+       import jp.nicovideo.nicoplayer.remocon.RemoconClient
+       import jp.nicovideo.nicoplayer.remocon.RemoconFullScreenKeeper
+       import jp.nicovideo.nicoplayer.remocon.RemoconNotifier
+       import jp.nicovideo.nicoplayer.remocon.RemoconPlayerStateObserver
+       import jp.nicovideo.nicoplayer.remocon.RemoconReceiver
+       import jp.nicovideo.nicoplayer.remocon.RemoconState
+       import jp.nicovideo.nicoplayer.remocon.method.defineRemoconMethods
+       import jp.nicovideo.nicoplayer.storages.CommentStorage
+       import jp.nicovideo.nicoplayer.storages.CommentStorageError
+       import jp.nicovideo.nicoplayer.storages.ICommentStorage
+       import jp.nicovideo.nicoplayer.storages.MessageServerClient
+       import jp.nicovideo.nicoplayer.tpls.INicoViewController
+       import jp.nicovideo.nicoplayer.tpls.NicoViewControllerClient
+       import jp.nicovideo.nicoplayer.tpls.shutter.AudioShutterConstants
+       import jp.nicovideo.nicoplayer.tpls.shutter.CommentShutterConstants
+       import jp.nicovideo.nicoplayer.tpls.shutter.ControllerShutter
+       import jp.nicovideo.nicoplayer.videoender.IVideoenderTesterConfig
+       import jp.nicovideo.nicoplayer.videoender.VideoenderTesterConfig
+       import jp.nicovideo.nicoplayer.views.JumpMessageLayer
+       import jp.nicovideo.nicoplayer.views.VideoLayerConstants
+       import jp.nicovideo.nicoplayer.views.VideoLayerManager
+       import jp.nicovideo.nicoplayer.views.comment.CommentLayer
+       import jp.nicovideo.nicoplayer.views.comment.CommentLayerID
+       import jp.nicovideo.nicoplayer.views.comment.CommentLayerView
+       import jp.nicovideo.nicoplayer.views.comment.CommentViewTransformer
+       import jp.nicovideo.nicoplayer.views.framerate.FrameRateBooster
+       import jp.nicovideo.nicoscript.INicoSPlayer
+       import jp.nicovideo.nicoscript.NicoSClient
+       import jp.nicovideo.nicoscript.NicoSConstants
+       import jp.nicovideo.nicoscript.macro.parsers.IMacroParserResult
+       import jp.nicovideo.util.CrossSharedObject
+       import jp.nicovideo.util.HTTPUtils
+       import jp.nicovideo.util.ObjectUtils
+       import jp.nicovideo.util.StringUtils
+       import jp.nicovideo.util.api.APICacheProxy
+       import jp.nicovideo.util.events.EventBarrier
+       import jp.nicovideo.util.events.EventChunk
+       import jp.nicovideo.util.events.EventPipe
+       import jp.nicovideo.util.events.EventResult
+       import jp.nicovideo.util.events.EventSequence
+       import jp.nicovideo.util.events.event_sender
+       import jp.nicovideo.util.external.JSConnector
+       import jp.nicovideo.util.loka.Loka
+       import jp.nicovideo.util.loka.__MSG__
+
+       //■class(instance)_index:1
+       public class NicoPlayer extends Sprite implements IThumbPlayer
+       {
+               //static constructor
+               public static function NicoPlayer$cinit()
+               {       //MethodID:9, LocalCount= 1 , MaxScope= 1, MaxStack= 3, CodeLength= 54
+                       DEBUG_MODE = getDebugMode();
+                       DEBUG_MODE_EXT = ((DEBUG_MODE == DebugMode.NON) ? DebugMode.NON : DebugMode.EXTDEV);
+               }
+
+               //static variables/etc.
+               private static const DEBUG_MODE:uint;                           //slotID:1
+               private static const DEBUG_MODE_EXT:uint;                       //slotID:2
+
+               //constructor
+               public function NicoPlayer()
+               {       //MethodID:10, LocalCount= 1 , MaxScope= 1, MaxStack= 3, CodeLength= 137
+                       this.commentListContainer = {};
+                       this.systemMessage = SystemMessage.instance;
+                       this.nicoViewControllerClient = new NicoViewControllerClient();
+                       this.pluginClient = new NicoPluginClient();
+                       this._playlistSequences = [];
+
+                       super();
+                       Security.allowDomain("*");
+
+                       this.isThumbWatchMode = (loaderInfo.parameters[this._IS_THUMBWATCH_PARAM] == "1");
+                       this.configure = new NicoConfig();
+                       Loka.instance.debug = true;
+
+                       if(this.isThumbWatchMode) return;
+
+                       if(loaderInfo.parameters[this._PLAYLIST_ID]){
+                               this.initializePlaylistPlayer();
+
+                               return;
+                       }
+
+                       this.initializeWatchPlayer();
+               }
+
+               //variables/etc.
+               private const _IS_THUMBWATCH_PARAM:String = "thumbWatch";       //slotID:0
+               private const _PLAYLIST_ID:String = "playlistId";               //slotID:0
+               private var getFLV:GetFLV;                                      //slotID:0
+               private var flashVars:NicoFlashVars;                            //slotID:0
+               private var playlistFlashVars:PlaylistFlashVars;                //slotID:0
+               private var playerConfig:IPlayerConfig;                         //slotID:0
+               private var video:VideoWrapper;                                 //slotID:0
+               private var commentListContainer:Object;                        //slotID:0
+               private var mainCommentListName:String = "commentlist:main";    //slotID:0
+               private var commentList:CommentList;                            //slotID:0
+               private var ownerCommentList:OwnerCommentList;                  //slotID:0
+               private var privateCommentList:CommentList;                     //slotID:0
+               private var nicoSCommentList:CommentList;                       //slotID:0
+               private var localCommentList:LocalCommentList;                  //slotID:0
+               private var systemMessage:SystemMessage;                        //slotID:0
+               private var relatedList:RelatedVideoList;                       //slotID:0
+               private var ngComment:NGComment;                                //slotID:0
+               private var lockedComment:LockedComment;                        //slotID:0
+               private var replacer:Replacer;                                  //slotID:0
+               private var playerVersion:PlayerVersion;                        //slotID:0
+               private var playerInfo:PlayerInfo;                              //slotID:0
+               private var timeMachine:TimeMachine;                            //slotID:0
+               private var deleteFilter:DeleteFilter;                          //slotID:0
+               private var channelReplacer:ChannelReplacer;                    //slotID:0
+               private var videoLoadGuardian:VideoLoadGuardian;                //slotID:0
+               private var getChecklist:GetChecklist;                          //slotID:0
+               private var myList:MyList;                                      //slotID:0
+               private var playlist:Playlist;                                  //slotID:0
+               private var initializeInfo:InitializeInfo;                      //slotID:0
+               private var _startVposConfig:StartVposConfig;                   //slotID:0
+               private var commentLayerView:CommentLayerView;                  //slotID:0
+               private var commentLayer:CommentLayer;                          //slotID:0
+               private var commentViewTransformer:CommentViewTransformer;      //slotID:0
+               private var commentRouter:CommentRouter;                        //slotID:0
+               private var videoLayerManager:VideoLayerManager;                //slotID:0
+               private var videoController:VideoController;                    //slotID:0
+               private var jumpMsgLayer:JumpMessageLayer;                      //slotID:0
+               private var nicoViewController:INicoViewController;             //slotID:0
+               private var nicoViewControllerClient:NicoViewControllerClient;  //slotID:0
+               private var vposWatcher:VposWatcher;                            //slotID:0
+               private var commentShutter:ControllerShutter;                   //slotID:0
+               private var audioShutter:ControllerShutter;                     //slotID:0
+               private var playlistController:PlaylistController;              //slotID:0
+               private var frameRateBooster:FrameRateBooster;                  //slotID:0
+               private var userSponsorVideo:IUserSponsorVideo;                 //slotID:0
+               private var hirobaPlayer:HirobaPlayer;                          //slotID:0
+               private var hirobaConnectorClient:HirobaConnectorClient;        //slotID:0
+               private var _thumbConfig:IThumbConfig;                          //slotID:0
+               private var configure:NicoConfig;                               //slotID:0
+               private var keygen:IKeygen;                                     //slotID:0
+               private var commentStorage:ICommentStorage;                     //slotID:0
+               private var jumper:Jumper;                                      //slotID:0
+               private var nicosPlayer:INicoSPlayer;                           //slotID:0
+               private var nicosClient:NicoSClient;                            //slotID:0
+               private var nicosPipe:Function;                                 //slotID:0
+               private var BGMVideoInfos:Array;                                //slotID:0
+               private var marqueeClient:MarqueeClient;                        //slotID:0
+               private var externalClient:ExternalClient;                      //slotID:0
+               private var isThumbWatchMode:Boolean = false;                   //slotID:0
+               private var _onChangedVideoStatus:Function;                     //slotID:0
+               private var _initialized:Boolean = false;                       //slotID:0
+               private var _wholeVideoLoadSucceeded:Boolean = false;           //slotID:0
+               private var pluginClient:NicoPluginClient;                      //slotID:0
+               private var _playlistSequences:Array;                           //slotID:0
+               private var _isPlaylist:Boolean = false;                        //slotID:0
+               private var _videoLoadSucceeded:Boolean;                        //slotID:0
+               private var _isPlaylistPrepared:Boolean = false;                //slotID:0
+               private var _shutterKeyLastClosed:int = -1;                     //slotID:0
+               private var _isShowedDialog:Boolean = false;                    //slotID:0
+               private var _logManager:LogManager;                             //slotID:0
+               private var _playerPageMyselfURL:String;                        //slotID:0
+               private var _videoenderTesterConfig:IVideoenderTesterConfig;    //slotID:0
+
+               private function initializePlaylistPlayer():void
+               {       //MethodID:12, LocalCount= 2 , MaxScope= 2, MaxStack= 19, CodeLength= 422
+                       internal var menu:ContextMenu;                                  //slotID:1
+                       internal var vars:Object;                                       //slotID:2
+                       internal var seq:EventSequence;                                 //slotID:3
+
+                       this._isPlaylist = true;
+
+                       DefaultInitializer.setConfig(this.configure, loaderInfo.url, DEBUG_MODE);
+
+                       this.keygen = new Keygen(this.configure);
+                       stage.align = StageAlign.TOP_LEFT;
+                       stage.scaleMode = StageScaleMode.NO_SCALE;
+                       menu = new ContextMenu();
+
+                       menu.hideBuiltInItems();
+
+                       menu.builtInItems.quality = true;
+                       contextMenu = menu;
+                       vars = loaderInfo.parameters;
+                       this.flashVars = new NicoFlashVars();
+
+                       NicoFlashVarsInitializer.setFlashVars(this.flashVars, vars);
+
+                       this.playlistFlashVars = new PlaylistFlashVars(vars);
+                       this._playerPageMyselfURL = function():String{  //MethodID:11, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 49
+                               var hug1:* = {};
+
+                               if(playlistFlashVars.playlistSort) hug1["sort"] = playlistFlashVars.playlistSort;
+
+                               return StringUtils.joinQuery((configure.PLAYLIST_PAGE_BASE_URL + playlistFlashVars.playlistID), hug1);
+                       }();
+                       this.nicoViewControllerClient.nicoConfig = this.configure;
+
+                       this.nicoViewControllerClient.flashVars = this.flashVars;
+                       this.nicoViewControllerClient.playlistFlashVars = this.playlistFlashVars;
+                       this.nicoViewControllerClient.playerPageMyselfURL = this._playerPageMyselfURL;
+
+                       this.pluginClient.setProperty("nicoConfig", this.configure);
+                       this.pluginClient.setProperty("flashVars", this.flashVars);
+
+                       this.nicoViewControllerClient.pluginClient = this.pluginClient;
+                       this._playlistSequences = [this._loadWatchAPI, this.loadVideoInfoAPI, this.initializeMyList, this.loadBGMVideoInfo, this.initializeCommentStorage, this.initializeGetChecklist, this.initializeHiroba, this.prepareVideo, this.prepareCommentLists, this.initializeModelAndView, this.initializeCommentRouter, this.initializeModelAndView4Watch, this.initializeLogger, this.loadConfirm, this.initializePlugin, this.initializeCommentLists, this._delayVideo, this._loadVideo];
+                       seq = new EventSequence(this);
+
+                       seq.push(this.initializePlayerVersion, this.initializePlayerInfo, this.initializeCrossSharedObjectSWF, this.initializeJSConnector, this.initializeJumper, this.createLogger, this.initializePlayerConfig, this.loadTemplateSWF, this.initializePlaylist, this.loadViewControllerSWF, this.loadNicoScriptSWF, this.checkInitializePlaylist, this.initializeNG, this.startPlaylist);
+                       seq.next();
+               }
+
+               private function startPlaylist():void
+               {       //MethodID:13, LocalCount= 1 , MaxScope= 1, MaxStack= 5, CodeLength= 54
+                       if(this.playlistController) this.playlistController.play(null, null, (this.playerConfig.autoPlay && !this.initializeInfo.isPremium));
+                       EventSequence.current.next();
+               }
+
+               private function _loadWatchAPI():void
+               {       //MethodID:15, LocalCount= 2 , MaxScope= 2, MaxStack= 4, CodeLength= 96
+                       internal var apiParams:Object;                                  //slotID:1
+
+                       this.nicoViewControllerClient.flashVars = null;
+                       apiParams = {};
+
+                       if(this._isPlaylist){
+                               apiParams["mode"] = "playlist";
+                               apiParams["playlist_token"] = this.playlist.token;
+                       }
+
+                       HTTPUtils.loadJSON(EventSequence.bind(function(hug1:Object):void{       //MethodID:14, LocalCount= 5 , MaxScope= 0, MaxStack= 4, CodeLength= 245
+                               var hug2:* = undefined;
+
+                               if(!hug1 || (hug1.status == "ng")){
+                                       if(_isPlaylist){
+                                               if(hug1.status_message == PlaylistErrorManager.TOKEN_TIMEOUT){
+                                                       if(playlistController.errorCount < 1){
+                                                               playlistController.errorCount++;
+                                                               playlistController.isInvalidToken = true;
+                                                               playlistController.isVideoUpdating = false;
+
+                                                               playlistController.play(playlistController.threadID);
+
+                                                               return;
+                                                       }
+                                               }
+
+                                               playlistController.onError(hug1.status_message.toString());
+
+                                               if(PlaylistErrorManager.TABWINDOW_ALERT_ERRORS.indexOf(hug1.status_message.toString()) != (-1)) playlistController.goNext(null, (playerConfig.autoPlay && !initializeInfo.isPremium));
+                                       }
+
+                                       return;
+                               }
+
+                               flashVars = new NicoFlashVars();
+
+                               NicoFlashVarsInitializer.setFlashVars(flashVars, hug1);
+
+                               if(_isPlaylist){
+                                       hug2 = playlist.getVideoInfo(playlistController.threadID);
+                                       hug2.flashVars = flashVars;
+                               }
+
+                               nicoViewControllerClient.flashVars = flashVars;
+
+                               EventSequence.current.next();
+                       }), (this.configure.WATCH_API_URL + this.playlistController.threadID), apiParams);
+               }
+
+               private function initializePlaylist():void
+               {       //MethodID:18, LocalCount= 2 , MaxScope= 2, MaxStack= 7, CodeLength= 96
+                       internal var apiParams:Object;                                  //slotID:1
+
+                       apiParams = {};
+                       apiParams["ts"] = new Date().time;
+                       apiParams["playlist_token"] = this.playlistFlashVars.playlistToken;
+                       this.playlist = new Playlist((this.configure.GET_PLAYLIST_URL + this.playlistFlashVars.playlistID), apiParams, this.playlistFlashVars.playlistSort, EventSequence.bind(function(hug1:Boolean):void{     //MethodID:17, LocalCount= 3 , MaxScope= 1, MaxStack= 11, CodeLength= 172
+                               internal var success:Boolean;                                   //slotID:1
+                               internal var reset:Function;                                    //slotID:2
+
+                               reset = null;
+                               success = hug1;
+                               reset = function():void{        //MethodID:16, LocalCount= 1 , MaxScope= 0, MaxStack= 2, CodeLength= 43
+                                       nicoViewControllerClient.getFLVData = null;
+                                       nicoViewControllerClient.videoController = null;
+                                       nicoViewControllerClient.commentRouter = null;
+                                       nicoViewControllerClient.relatedList = null;
+                                       nicoViewControllerClient.myList = null;
+                                       nicoViewControllerClient.defaultMylistAppender = null;
+                               };
+
+                               _isPlaylistPrepared = success;
+
+                               if(!success){
+                                       EventSequence.current.next();
+
+                                       return;
+                               }
+
+                               if(playlistController){
+                                       EventSequence.current.next();
+
+                                       return;
+                               }
+
+                               initializeInfo = InitializeInfo.getInstance();
+                               nicoViewControllerClient.initializeInfo = initializeInfo;
+
+                               pluginClient.setProperty("initializeInfo", initializeInfo);
+
+                               playlistController = new PlaylistController(_playlistSequences, initializePlaylist, playlist, playlistFlashVars, configure, playerInfo.playlistLimit, reset, playerConfig.isPlaylistRandomPlay, _playerPageMyselfURL);
+                               nicoViewControllerClient.playlistController = playlistController;
+
+                               EventSequence.current.next();
+                       }));
+               }
+
+               private function checkInitializePlaylist():void
+               {       //MethodID:19, LocalCount= 2 , MaxScope= 1, MaxStack= 3, CodeLength= 105
+                       var hug1:String = null;
+
+                       if(!this.initializeInfo || !this.initializeInfo.userID){
+                               this.systemMessage.informln(__MSG__("ユーザー情報の取得に失敗"));
+
+                               hug1 = ("<p><b>" + __MSG__("ユーザー情報の取得に失敗しました。") + "</b></p>" + "<p>" + __MSG__("ログインしていない可能性があります。") + "</p>");
+
+                               this.systemMessage.alert(hug1);
+
+                               return;
+                       }
+
+                       EventSequence.current.next();
+               }
+
+               public function setThumbWatchVars(hug1:IThumbConfig, hug2:NicoFlashVars):void
+               {       //MethodID:20, LocalCount= 4 , MaxScope= 1, MaxStack= 23, CodeLength= 234
+                       if(DEBUG_MODE_EXT != DebugMode.NON){
+                               DefaultInitializer.setConfig(this.configure, loaderInfo.url, DEBUG_MODE_EXT);
+                               DefaultInitializer.setThumbDebugMode(this.configure);
+                       }else{
+                               DefaultInitializer.setConfig(this.configure, hug1.playerURL, DebugMode.NON);
+                       }
+
+                       this.keygen = new Keygen(this.configure);
+                       this._thumbConfig = hug1;
+                       this.flashVars = hug2;
+                       this.nicoViewControllerClient.thumbConfig = hug1;
+                       this.nicoViewControllerClient.nicoConfig = this.configure;
+                       this.nicoViewControllerClient.flashVars = hug2;
+                       var hug3:EventSequence = new EventSequence(this);
+
+                       hug3.push(this.initializePlayerVersion, this.initializePlayerInfo, this.initializeCrossSharedObjectSWF, this.initializeJSConnector, this.initializeJumper, this.initializePlayerConfig, this._loadThumbViewSWF, this._loadThumbControllerSWF, this.loadNicoScriptSWF, this._loadThumbVideoInfo, this.loadBGMVideoInfo, this.initializeNG, this.initializeCommentStorage, this.prepareVideo, this.prepareCommentLists, this.initializeModelAndView, this._initializeModelAndViewThumbWatch, this.initializeSponsorVideo, this._delayVideo, this._loadVideo, this.initializeCommentLists, this.beginToPlayVideo);
+                       hug3.next();
+               }
+
+               public function get initialized():Boolean
+               {       //MethodID:21, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._initialized;
+               }
+
+               public function playThumbPlayer():void
+               {       //MethodID:22, LocalCount= 1 , MaxScope= 1, MaxStack= 2, CodeLength= 47
+                       if(this.isThumbWatchMode && this.video && this.video.isInitialized) this.video.play();
+               }
+
+               public function pauseThumbPlayer():void
+               {       //MethodID:23, LocalCount= 1 , MaxScope= 1, MaxStack= 2, CodeLength= 47
+                       if(this.isThumbWatchMode && this.video && this.video.isInitialized) this.video.stop();
+               }
+
+               public function set onChangedVideoStatus(hug1:Function):void
+               {       //MethodID:25, LocalCount= 3 , MaxScope= 2, MaxStack= 2, CodeLength= 57
+                       internal var onChanged:Function;                                //slotID:1
+
+                       onChanged = hug1;
+
+                       if(!this.isThumbWatchMode) throw new IllegalOperationError("NicoPlayer.set onChangedVideoStatus: player is not in thumbwatch.");
+
+                       if(onChanged == null) throw new ArgumentError("NicoPlayer.set onChangedVideoStatus: invalid parameters onChanged is null.");
+
+                       this._onChangedVideoStatus = function(hug1:String):void{        //MethodID:24, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 24
+                               if(!_initialized) _initialized = true;
+                               onChanged(hug1);
+                       };
+               }
+
+               public function get videoPlayerStatus():String
+               {       //MethodID:26, LocalCount= 1 , MaxScope= 1, MaxStack= 2, CodeLength= 49
+                       if(this.isThumbWatchMode && this.video && this.video.isInitialized) return this.video.videoPlayerStatus;
+
+                       return "";
+               }
+
+               private function initializeWatchPlayer():void
+               {       //MethodID:27, LocalCount= 4 , MaxScope= 1, MaxStack= 31, CodeLength= 362
+                       DefaultInitializer.setConfig(this.configure, loaderInfo.url, DEBUG_MODE);
+
+                       this.keygen = new Keygen(this.configure);
+                       stage.align = StageAlign.TOP_LEFT;
+                       stage.scaleMode = StageScaleMode.NO_SCALE;
+                       var hug1:ContextMenu = new ContextMenu();
+
+                       hug1.hideBuiltInItems();
+
+                       hug1.builtInItems.quality = true;
+                       contextMenu = hug1;
+                       var hug2:Object = loaderInfo.parameters;
+                       this.flashVars = new NicoFlashVars();
+
+                       NicoFlashVarsInitializer.setFlashVars(this.flashVars, hug2);
+
+                       this._playerPageMyselfURL = (this.configure.BASE_URL + "watch/" + this.flashVars.watchID);
+                       this.nicoViewControllerClient.nicoConfig = this.configure;
+                       this.nicoViewControllerClient.flashVars = this.flashVars;
+                       this.nicoViewControllerClient.playerPageMyselfURL = this._playerPageMyselfURL;
+
+                       this.pluginClient.setProperty("nicoConfig", this.configure);
+                       this.pluginClient.setProperty("flashVars", this.flashVars);
+
+                       this.nicoViewControllerClient.pluginClient = this.pluginClient;
+                       var hug3:EventSequence = new EventSequence(this);
+
+                       hug3.push(this.initializePlayerVersion, this.initializePlayerInfo, this.initializeCrossSharedObjectSWF, this.initializeJSConnector, this.initializeJumper, this.createLogger, this.initializePlayerConfig, this.loadTemplateSWF, this.loadViewControllerSWF, this.loadNicoScriptSWF, this.loadVideoInfoAPI, this.initializeMyList, this.loadBGMVideoInfo, this.initializeNG, this.initializeCommentStorage, this.initializeGetChecklist, this.initializeHiroba, this.prepareVideo, this.prepareCommentLists, this.initializeModelAndView, this.initializeCommentRouter, this.initializeModelAndView4Watch, this.initializeSponsorVideo, this.initializeLogger, this.loadConfirm, this.initializePlugin, this.initializeCommentLists, this._delayVideo, this._loadVideo, this.beginToPlayVideo);
+                       hug3.next();
+               }
+
+               private function initializeCrossSharedObjectSWF():void
+               {       //MethodID:30, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 64
+                       internal var _url:String;                                       //slotID:1
+
+                       _url = null;
+                       _url = StringUtils.joinQuery(this.configure.CROSSSHAREDOBJECT_SWF_URL, {t:this.playerVersion.crossSharedObject});
+
+                       CrossSharedObject.init(_url, EventSequence.bind(function(hug1:Boolean):void{    //MethodID:29, LocalCount= 3 , MaxScope= 1, MaxStack= 5, CodeLength= 134
+                               internal var sccessed:Boolean;                                  //slotID:1
+
+                               sccessed = hug1;
+
+                               if(!sccessed) throw new Error("NicoPlayer.loadCrossSharedObjectSWF: failure to load \"" + configure.CROSSSHAREDOBJECT_SWF_URL + "\"");
+
+                               if(CrossSharedObject.isPersistable || !configure.CROSSSHAREDOBJECT_NONIMG_SWF_URL){
+                                       EventSequence.current.next();
+                               }else{
+                                       CrossSharedObject.terminate();
+
+                                       _url = StringUtils.joinQuery(configure.CROSSSHAREDOBJECT_NONIMG_SWF_URL, {t:playerVersion.crossSharedObject});
+
+                                       CrossSharedObject.init(_url, EventSequence.bind(function(hug1:Boolean):void{    //MethodID:28, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 38
+                                               if(!hug1) throw new Error("NicoPlayer.loadCrossSharedObjectNoNimgSWF: failure to load \"" + configure.CROSSSHAREDOBJECT_NONIMG_SWF_URL + "\"");
+                                               EventSequence.current.next();
+                                       }));
+                               }
+                       }));
+               }
+
+               private function createLogger():void
+               {       //MethodID:31, LocalCount= 1 , MaxScope= 1, MaxStack= 3, CodeLength= 42
+                       this._logManager = new LogManager(!CrossSharedObject.isPersistable);
+                       this.nicoViewControllerClient.logManager = this._logManager;
+
+                       EventSequence.current.next();
+               }
+
+               private function initializePlayerConfig():void
+               {       //MethodID:32, LocalCount= 1 , MaxScope= 1, MaxStack= 3, CodeLength= 116
+                       this.playerConfig = new PlayerConfig(this.isThumbWatchMode);
+                       this.nicoViewControllerClient.playerConfig = this.playerConfig;
+
+                       this.pluginClient.setProperty("playerConfig", this.playerConfig);
+
+                       this.playerConfig.deepenedCommentForce = this.flashVars.isDeepenedCommentForce;
+                       this.playerConfig.aspectRatio = ((this.flashVars.isWide || this._isPlaylist) ? ScreenAspectRatio.WIDE : ScreenAspectRatio.NORMAL);
+
+                       EventSequence.current.next();
+               }
+
+               private function initializeJumper():void
+               {       //MethodID:33, LocalCount= 1 , MaxScope= 1, MaxStack= 4, CodeLength= 74
+                       this.jumper = new Jumper(this.configure, this.flashVars.watchID);
+                       this.nicoViewControllerClient.jumper = this.jumper;
+                       this._startVposConfig = new StartVposConfig(this.jumper, this.flashVars);
+                       this.nicoViewControllerClient.startVposConfig = this._startVposConfig;
+
+                       EventSequence.current.next();
+               }
+
+               private function initializePlayerVersion():void
+               {       //MethodID:35, LocalCount= 2 , MaxScope= 2, MaxStack= 7, CodeLength= 116
+                       internal var request:URLRequest;                                //slotID:1
+                       internal var params:URLVariables;                               //slotID:2
+                       internal var api:APICacheProxy;                                 //slotID:3
+
+                       request = new URLRequest(this.configure.PLAYERVERSION_XML_URL);
+                       params = new URLVariables();
+                       params.v = this.flashVars.playerVersionUpdated;
+                       request.data = params;
+                       api = new APICacheProxy(request, 0, uint.MAX_VALUE, this.flashVars.playerVersionUpdated, false);
+                       this.playerVersion = new PlayerVersion(EventSequence.bind(function(hug1:Boolean):void{  //MethodID:34, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 36
+                               if(!hug1) throw new Error("NicoPlayer.playerVersion. initialize error");
+
+                               nicoViewControllerClient.playerVersion = playerVersion;
+
+                               EventSequence.current.next();
+                       }), api);
+               }
+
+               private function initializeJSConnector():void
+               {       //MethodID:37, LocalCount= 2 , MaxScope= 2, MaxStack= 4, CodeLength= 71
+                       internal var request:URLRequest;                                //slotID:1
+
+                       request = new URLRequest(this.configure.JSCONNECTOR_SWF_URL);
+                       request.data = new URLVariables("v=" + this.playerVersion.jsconnector);
+
+                       JSConnector.init(request, EventSequence.current.bind(function(hug1:Boolean):void{       //MethodID:36, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 27
+                               if(!hug1) throw new IOError("NicoPlayer.initializeJSConnector: initialize error.");
+                               EventSequence.current.next();
+                       }));
+               }
+
+               private function initializePlayerInfo():void
+               {       //MethodID:39, LocalCount= 2 , MaxScope= 2, MaxStack= 7, CodeLength= 116
+                       internal var request:URLRequest;                                //slotID:1
+                       internal var params:URLVariables;                               //slotID:2
+                       internal var api:APICacheProxy;                                 //slotID:3
+
+                       request = new URLRequest(this.configure.PLAYERINFO_XML_URL);
+                       params = new URLVariables();
+                       params.v = this.flashVars.playerInfoUpdated;
+                       request.data = params;
+                       api = new APICacheProxy(request, 0, uint.MAX_VALUE, this.flashVars.playerInfoUpdated, false);
+                       this.playerInfo = new PlayerInfo(EventSequence.bind(function(hug1:Boolean):void{        //MethodID:38, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 36
+                               if(!hug1) throw new Error("NicoPlayer.playerInfo. initialize error");
+
+                               nicoViewControllerClient.playerInfo = playerInfo;
+
+                               EventSequence.current.next();
+                       }), api);
+               }
+
+               private function loadTemplateSWF():void
+               {       //MethodID:41, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 42
+                       HTTPUtils.loadSWF(EventSequence.bind(function(hug1:*):void{     //MethodID:40, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 45
+                               if(!hug1) throw new Error("NicoPlayer.loadTemplateSWF: failure to load \"" + configure.VIEW_SWF_URL + "\"");
+
+                               nicoViewControllerClient.viewRoot = hug1;
+
+                               EventSequence.current.next();
+                       }), this.configure.VIEW_SWF_URL, {t:this.playerVersion.nicoplayerTemplate});
+               }
+
+               private function loadViewControllerSWF():void
+               {       //MethodID:43, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 42
+                       HTTPUtils.loadSWF(EventSequence.bind(function(hug1:*):void{     //MethodID:42, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 89
+                               if(!hug1) throw new Error("NicoPlayer.loadViewControllerSWF: failure to load \"" + configure.VIEWCONTROLLER_SWF_URL + "\"");
+                               addChild(nicoViewControllerClient.viewRoot);
+
+                               nicoViewController = INicoViewController(hug1);
+
+                               nicoViewController.startInit(nicoViewControllerClient);
+
+                               if(playlistController) playlistController.nicoViewController = nicoViewController;
+                               EventSequence.current.next();
+                       }), this.configure.VIEWCONTROLLER_SWF_URL, {t:this.playerVersion.nicoplayerViewController});
+               }
+
+               private function loadNicoScriptSWF():void
+               {       //MethodID:45, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 76
+                       if(!this.flashVars.hasOwnerThread && !this.playlistFlashVars){
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       HTTPUtils.loadSWF(EventSequence.bind(function(hug1:*):void{     //MethodID:44, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 50
+                               if(!hug1) throw new Error("NicoPlayer.loadViewControllerSWF: failure to load \"" + configure.NICOSPLAYER_URL + "\"");
+
+                               nicosPlayer = INicoSPlayer(hug1);
+
+                               EventSequence.current.next();
+                       }), this.configure.NICOSPLAYER_URL, {t:this.playerVersion.nicoscriptPlayer});
+               }
+
+               private function getGetFLVAPIParams():Object
+               {       //MethodID:46, LocalCount= 2 , MaxScope= 1, MaxStack= 4, CodeLength= 165
+                       var hug1:Object = {};
+                       hug1["v"] = ((this._isPlaylist && this.playlistController) ? this.playlistController.threadID : this.flashVars.watchID);
+
+                       if(this.flashVars.videoType == VideoType.SWF) hug1["as3"] = "1";
+
+                       if(this.flashVars.forceLowMode) hug1["lo"] = "1";
+
+                       if(this.flashVars.economyMode) hug1["eco"] = this.flashVars.economyMode;
+
+                       if(this.flashVars.watchFlashVars.noHiroba || this._isPlaylist) hug1["nh"] = "1";
+
+                       return hug1;
+               }
+
+               private function loadVideoInfoAPI():void
+               {       //MethodID:48, LocalCount= 2 , MaxScope= 2, MaxStack= 6, CodeLength= 65
+                       this.nicoViewControllerClient.getFLVData = null;
+
+                       this.systemMessage.informln(__MSG__("動画情報を取得開始"));
+
+                       this.getFLV = new GetFLV(this.configure.GETFLV_URL, this.getGetFLVAPIParams(), EventSequence.bind(function(hug1:Boolean):void{  //MethodID:47, LocalCount= 7 , MaxScope= 0, MaxStack= 4, CodeLength= 508
+                               var hug2:* = undefined;
+                               var hug6:* = undefined;
+                               var hug3:* = _playerPageMyselfURL;
+
+                               if(!hug1 || getFLV.closed){
+                                       systemMessage.informln(__MSG__("動画情報の取得に失敗"));
+
+                                       hug2 = (("<p><b>" + __MSG__("動画情報の取得に失敗しました。") + "</b></p>" + "<p>" + __MSG__("ログイン状態が解除されているか、動画が非公開状態にある可能性があります。") + "<br />") + __MSG__("<a href=\"[[url]]\">リロードして再度ログイン</a>", hug3) + "</p>");
+
+                                       systemMessage.alert(hug2);
+
+                                       return;
+                               }
+
+                               if(!initializeInfo){
+                                       initializeInfo = InitializeInfo.getInstance();
+                                       nicoViewControllerClient.initializeInfo = initializeInfo;
+
+                                       pluginClient.setProperty("initializeInfo", initializeInfo);
+                               }
+
+                               if(!initializeInfo.userID){
+                                       systemMessage.informln(__MSG__("ユーザー情報の取得に失敗"));
+
+                                       hug2 = ("<p><b>" + __MSG__("ユーザー情報の取得に失敗しました。") + "</b></p>" + "<p>" + __MSG__("以下のページにアクセスしログインしてください。") + "<a href=\"" + hug3 + "\">" + hug3 + "</a>" + "</p>");
+
+                                       systemMessage.alert(hug2);
+
+                                       return;
+                               }
+
+                               if(flashVars.isChannel){
+                                       systemMessage.informln(__MSG__("チャンネル動画"));
+                               }else if(flashVars.isCommunityThread){
+                                       systemMessage.informln(__MSG__("コミュニティ動画"));
+                               }
+
+                               nicoViewControllerClient.getFLVData = getFLV;
+
+                               if(!pluginClient.hasInitialized("getFLV")) pluginClient.setProperty("getFLV", getFLV);
+                               SystemMessage.instance.informln(__MSG__("スレッド(動画)") + ":" + flashVars.watchID);
+
+                               var hug4:* = new RegExp("(https?|rtmp(e|t|te)?)://([^.]+).+", "ig");
+                               var hug5:* = hug4.exec(getFLV.videoURL);
+
+                               if(hug5 != null){
+                                       hug6 = ((__MSG__("動画ホスト") + ":") + ((hug5.length >= 1) ? hug5[3] : ""));
+
+                                       if(new RegExp("low$").test(getFLV.videoURL)) hug6 += __MSG__(" (エコノミー)");
+                                       SystemMessage.instance.informln(hug6);
+                               }
+
+                               EventSequence.current.next();
+                       }));
+               }
+
+               private function initializeMyList():void
+               {       //MethodID:49, LocalCount= 1 , MaxScope= 1, MaxStack= 4, CodeLength= 46
+                       this.myList = new MyList(this.configure, this.getFLV.threadID);
+                       this.nicoViewControllerClient.myList = this.myList;
+
+                       EventSequence.current.next();
+               }
+
+               private function loadBGMVideoInfo():void
+               {       //MethodID:51, LocalCount= 2 , MaxScope= 2, MaxStack= 4, CodeLength= 119
+                       this.BGMVideoInfos = [];
+
+                       if((!this.flashVars.importedBGMVideos || (this.flashVars.importedBGMVideos.length == 0)) || ((this.getFLV.deleted != 0) && (this.getFLV.deleted != 8))){
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       GetBGM.exec(EventSequence.bind(function(hug1:Boolean, hug2:Array):void{ //MethodID:50, LocalCount= 5 , MaxScope= 0, MaxStack= 3, CodeLength= 118
+                               var hug3:* = undefined;
+                               var hug4:* = undefined;
+
+                               if(!hug1){
+                                       systemMessage.informln(__MSG__("引用動画の情報の取得に失敗"));
+
+                                       hug3 = _playerPageMyselfURL;
+                                       hug4 = ("<p><b>" + __MSG__("引用動画の情報の取得に失敗しました。") + "</b></p>" + "<p>" + __MSG__("お手数ですが以下のリンクをおしてページをロードしてください。") + "<a href=\"" + hug3 + "\">" + hug3 + "</a>" + "</p>");
+
+                                       systemMessage.alert(hug4);
+
+                                       return;
+                               }
+
+                               BGMVideoInfos = hug2;
+
+                               EventSequence.current.next();
+                       }), this.configure.GETBGM_API_URL, this.getFLV.threadID);
+               }
+
+               private function initializeNG():void
+               {       //MethodID:55, LocalCount= 2 , MaxScope= 2, MaxStack= 11, CodeLength= 145
+                       internal var noLoad:Boolean;                                    //slotID:1
+
+                       noLoad = !CrossSharedObject.isPersistable;
+                       this.nicoViewControllerClient.ngFilter = null;
+                       this.ngComment = new NGComment(this.initializeInfo.userID, this.initializeInfo.ngRevision, this.configure.GETCONFIGURENGCLIENT_URL, this.initializeInfo.isPremium, this.playerConfig, this.initializeInfo.isNGMaintenance, noLoad, this.flashVars.isMymemory, (this.isThumbWatchMode ? null : this.flashVars.watchFlashVars.csrfToken));
+
+                       this.ngComment.onInitialized.add(EventSequence.bind(function(hug1:Boolean):void{        //MethodID:53, LocalCount= 3 , MaxScope= 1, MaxStack= 4, CodeLength= 187
+                               internal var success:Boolean;                                   //slotID:1
+                               internal var ngCommentLength:*;                                 //slotID:2
+                               internal var ngUserLength:*;                                    //slotID:3
+
+                               ngCommentLength = undefined;
+                               ngUserLength = undefined;
+                               success = hug1;
+
+                               if(!success) systemMessage.alert("<p><b>" + __MSG__("NG設定の読み込みに失敗") + "</b></p>" + "<p>" + __MSG__("時間を空けてアクセスしていただくか、下のリンクからお知らせください。") + "<br />" + "<a href=\"https://secure.nicovideo.jp/secure/support_form\" target=\"_blank\">" + "お問い合わせ" + "</a>" + "</p>");
+
+                               nicoViewControllerClient.ngFilter = ngComment;
+
+                               if(!pluginClient.hasInitialized("ngFilter")) pluginClient.setProperty("ngFilter", ngComment);
+
+                               if(!isThumbWatchMode){
+                                       ngCommentLength = 0;
+                                       ngUserLength = 0;
+
+                                       ngComment.list.forEach(function(hug1:NGInfo, hug2:int, hug3:Array):void{        //MethodID:52, LocalCount= 6 , MaxScope= 0, MaxStack= 2, CodeLength= 79
+                                               if(hug1.type == NGType.MESSAGE){
+                                                       ngCommentLength++;
+                                               }else if(hug1.type == NGType.USER_ID){
+                                                       ngUserLength++;
+                                               }
+                                       });
+                                       _logManager.observer.onNGCommentInitialized(ngCommentLength, ngUserLength);
+                               }
+
+                               EventSequence.current.next();
+                       }));
+                       this.ngComment.onUpdated.add(function(hug1:Array, hug2:String):void{    //MethodID:54, LocalCount= 6 , MaxScope= 0, MaxStack= 2, CodeLength= 56
+                               var hug3:ICommentList = null;
+
+                               if(hug2 == NGResponseConstants.UNSERVE) return;
+
+                               for each(hug3 in commentListContainer){
+                                       hug3.serveCommentList();
+                               }
+                       });
+               }
+
+               private function initializeCommentStorage():void
+               {       //MethodID:59, LocalCount= 2 , MaxScope= 2, MaxStack= 3, CodeLength= 106
+                       internal var client:MessageServerClient;                        //slotID:1
+
+                       client = null;
+                       this.nicoViewControllerClient.commentStorageEvents = null;
+                       client = new MessageServerClient(this.getFLV.messageServerURL);
+
+                       client.connectionLost.add(function(hug1:String):void{   //MethodID:56, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 20
+                               systemMessage.informln(__MSG__("コメント受信中にエラーが発生: ") + hug1);
+                       });
+                       client.connected.add(function():void{   //MethodID:57, LocalCount= 1 , MaxScope= 0, MaxStack= 3, CodeLength= 18
+                               systemMessage.informln(__MSG__("コメントサーバーへの接続準備完了"));
+                       });
+
+                       if(this._logManager) this._logManager.observer.onThreadLoadStarted();
+                       client.connect(EventSequence.bind(function(hug1:Boolean, hug2:String):void{     //MethodID:58, LocalCount= 3 , MaxScope= 0, MaxStack= 8, CodeLength= 131
+                               commentStorage = new CommentStorage(client, keygen, initializeInfo.userID, initializeInfo.isPremium, flashVars, getFLV);
+
+                               if((playerInfo.leafFilter.indexOf(getFLV.messageServerURL) != (-1)) || (flashVars.leafSwitch == NicoFlashVars.LEAF_DISABLE)) commentStorage.forceLeafOff = true;
+
+                               nicoViewControllerClient.commentStorageEvents = new CommentStorageEvents(commentStorage);
+
+                               if(_logManager) _logManager.observer.onThreadLoadCompleted(hug1);
+                               EventSequence.current.next();
+                       }));
+               }
+
+               private function initializeGetChecklist():void
+               {       //MethodID:61, LocalCount= 2 , MaxScope= 2, MaxStack= 6, CodeLength= 102
+                       internal var apiCacheProxy:APICacheProxy;                       //slotID:1
+                       internal var callback:Function;                                 //slotID:2
+                       internal var noLoad:Boolean;                                    //slotID:3
+
+                       apiCacheProxy = new APICacheProxy(new URLRequest(this.configure.GET_CHECKLIST_URL), 0, 0, this.initializeInfo.userID);
+                       callback = EventSequence.bind(function(hug1:Boolean):void{      //MethodID:60, LocalCount= 2 , MaxScope= 0, MaxStack= 1, CodeLength= 11
+                               EventSequence.current.next();
+                       });
+
+                       noLoad = !CrossSharedObject.isPersistable;
+                       this.getChecklist = new GetChecklist(callback, apiCacheProxy, this.flashVars.watchFlashVars.useChecklistCache, noLoad);
+               }
+
+               private function initializeHiroba():void
+               {       //MethodID:69, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 380
+                       this._logManager.observer.onHirobaInitializeStarted();
+
+                       if((this.getFLV.hirobaHost == null) || (this.getFLV.hirobaPort == 0) || (this.getFLV.hirobaThreadID == null) || this.flashVars.watchFlashVars.noHiroba || this.flashVars.isNoComment || this.flashVars.watchFlashVars.isOwnerThreadEditMode || this.flashVars.watchFlashVars.isEditMode){
+                               if(!(((this.getFLV.hirobaHost != null) && (this.getFLV.hirobaPort != 0) && !(!(this.getFLV.hirobaThreadID == null))) && (this.flashVars.watchFlashVars.noHiroba || this.flashVars.isNoComment || this.flashVars.watchFlashVars.isOwnerThreadEditMode || this.flashVars.watchFlashVars.isEditMode))) this._logManager.observer.onHirobaConnected(false, HirobaErrorStatus.HIROBA_INFO_NOT_FOUND, HirobaEventReferer.NICO_PLAYER);
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       if(this.nicoViewControllerClient.hirobaPlayer){
+                               this._logManager.observer.onHirobaInitializeAborted();
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       this.hirobaPlayer = new HirobaPlayer(this.playerConfig, this.initializeInfo.isPremium);
+                       this.nicoViewControllerClient.hirobaPlayer = this.hirobaPlayer;
+
+                       HTTPUtils.loadSWF(function(hug1:Sprite):void{   //MethodID:68, LocalCount= 3 , MaxScope= 1, MaxStack= 6, CodeLength= 276
+                               internal var swf:Sprite;                                        //slotID:1
+                               internal var connector:IHirobaConnector;                        //slotID:2
+                               internal var succeeded:Boolean;                                 //slotID:3
+                               internal var client:HirobaConnectorClient;                      //slotID:4
+                               internal var onConnectionFailed:Function;                       //slotID:5
+                               internal var onDisconnected:Function;                           //slotID:6
+                               internal var onConnected:Function;                              //slotID:7
+
+                               connector = null;
+                               client = null;
+                               onConnectionFailed = null;
+                               onDisconnected = null;
+                               onConnected = null;
+                               swf = hug1;
+                               onConnectionFailed = function(hug1:HirobaErrorEvent):void{      //MethodID:63, LocalCount= 2 , MaxScope= 0, MaxStack= 4, CodeLength= 37
+                                       systemMessage.informln(__MSG__("広場の接続中にエラーが発生"));
+                                       _logManager.observer.onHirobaConnected(false, hug1.text, hug1.referer);
+                               };
+
+                               onDisconnected = function(hug1:HirobaErrorEvent):void{  //MethodID:64, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 36
+                                       systemMessage.informln(__MSG__("広場の接続中にエラーが発生"));
+                                       _logManager.observer.onHirobaDisconnected(hug1.text, hug1.referer);
+                               };
+
+                               onConnected = function(hug1:Boolean, hug2:String, hug3:String):void{    //MethodID:66, LocalCount= 5 , MaxScope= 1, MaxStack= 4, CodeLength= 243
+                                       internal var succeeded:Boolean;                                 //slotID:1
+                                       internal var status:String;                                     //slotID:2
+                                       internal var referer:String;                                    //slotID:3
+
+                                       succeeded = hug1;
+                                       status = hug2;
+                                       referer = hug3;
+
+                                       if((referer == HirobaEventReferer.HIROBA_AGENT) && succeeded){
+                                               _logManager.observer.onHirobaConnected(true, status, referer);
+
+                                               return;
+                                       }
+
+                                       if(!succeeded){
+                                               systemMessage.informln(__MSG__("広場の接続に失敗"));
+                                               _logManager.observer.onHirobaConnected(false, status, referer);
+
+                                               return;
+                                       }
+
+                                       systemMessage.informln(__MSG__("広場の接続に成功"));
+                                       _logManager.observer.onHirobaConnected(true, status, referer);
+                                       hirobaPlayer.onClickedLink.add(function():void{ //MethodID:65, LocalCount= 1 , MaxScope= 0, MaxStack= 1, CodeLength= 15
+                                               if(videoController) videoController.stop();
+                                       });
+
+                                       hirobaPlayer.connector = connector;
+
+                                       if(commentRouter) commentRouter.addHiroba(hirobaPlayer);
+
+                                       if(marqueeClient && marqueeClient.marqueePlayer) client.insertItemOnMarquee_0 = INicoMarqueePlayer(marqueeClient.marqueePlayer).interruptContent;
+
+                                       hirobaConnectorClient = client;
+
+                                       nicoViewController.onHirobaInitialized();
+                               };
+
+                               connector = IHirobaConnector(swf);
+                               succeeded = (connector != null);
+
+                               if(!succeeded){
+                                       systemMessage.informln(__MSG__("広場の接続に失敗"));
+                                       _logManager.observer.onHirobaConnected(false, HirobaErrorStatus.HIROBA_CONNECTOR_NOT_FOUND, HirobaEventReferer.NICO_PLAYER);
+
+                                       return;
+                               }
+
+                               client = new HirobaConnectorClient(new HirobaMessageServerInfo(getFLV, configure.GETFLV_URL, getGetFLVAPIParams()), initializeInfo.userID, keygen, function():Number{   //MethodID:62, LocalCount= 1 , MaxScope= 0, MaxStack= 1, CodeLength= 25
+                                       return (playerConfig.isMute ? 0 : playerConfig.volume);
+                               });
+
+                               client.checkList = getChecklist;
+
+                               connector.initialize(client);
+                               connector.addEventListener(HirobaErrorEvent.CONNECTION_FAIL, onConnectionFailed);
+                               connector.addEventListener(HirobaErrorEvent.DISCONNECTED, onDisconnected);
+                               connector.addEventListener(HirobaEvent.CLICKED_LINK, function(hug1:Event):void{ //MethodID:67, LocalCount= 2 , MaxScope= 0, MaxStack= 1, CodeLength= 15
+                                       if(videoController) videoController.stop();
+                               });
+                               connector.connect(onConnected);
+                       }, this.configure.HIROBACONNECTOR_SWF_URL, {v:this.playerVersion.hirobaconnector});
+                       EventSequence.current.next();
+               }
+
+               private function prepareVideo():void
+               {       //MethodID:71, LocalCount= 2 , MaxScope= 2, MaxStack= 8, CodeLength= 570
+                       internal var videoWidth:int;                                    //slotID:1
+                       internal var videoHeight:int;                                   //slotID:2
+
+                       this.nicoViewControllerClient.video = null;
+                       this.nicoViewControllerClient.videoController = null;
+
+                       if(!this.videoLayerManager){
+                               this.videoLayerManager = new VideoLayerManager(this.nicoViewController.videoBase, this.playerConfig.aspectRatio);
+
+                               if(this.playerConfig.deepenedComment){
+                                       ObjectUtils.callLater(function():void{  //MethodID:70, LocalCount= 1 , MaxScope= 0, MaxStack= 1, CodeLength= 8
+                                               videoLayerManager.deepenComment();
+                                       });
+                               }
+
+                               this.nicoViewControllerClient.videoLayerManager = this.videoLayerManager;
+                       }else{
+                               this.videoLayerManager.refreshLayers();
+                       }
+
+                       if(!this.pluginClient.hasInitialized("videoLayerManager")) this.pluginClient.setProperty("videoLayerManager", this.videoLayerManager);
+
+                       videoWidth = ((this.flashVars.isWide || this._isPlaylist) ? VideoLayerConstants.VIDEO_LAYER_HD_WIDTH : VideoLayerConstants.VIDEO_LAYER_SD_WIDTH);
+                       videoHeight = ((this.flashVars.isWide || this._isPlaylist) ? VideoLayerConstants.VIDEO_LAYER_HD_HEIGHT : VideoLayerConstants.VIDEO_LAYER_SD_HEIGHT);
+
+                       if(this.video && this.video.isInitialized){
+                               this.video.close();
+
+                               this.video = null;
+                       }
+
+                       this.video = new VideoWrapper(this.videoLayerManager.videoLayer, this.getFLV, this.configure, this.flashVars, videoWidth, videoHeight);
+                       this.nicoViewControllerClient.video = this.video;
+                       this.videoController = new VideoController(this.video, this.playerConfig, this.initializeInfo.isPremium, this._isPlaylist);
+                       this.nicoViewControllerClient.videoController = this.videoController;
+
+                       if(this._logManager){
+                               this.video.onVideoLoadComplete.add(this._logManager.observer.onVideoLoadCompleted);
+                               this.video.onVideoBufferingStarted.add(this._logManager.observer.onVideoBufferingStarted);
+                       }
+
+                       if(this.playlistController) this.playlistController.videoController = this.videoController;
+
+                       if(!this.pluginClient.hasInitialized("videoController")) this.pluginClient.setProperty("videoController", this.videoController);
+
+                       if(this._onChangedVideoStatus != null) this.video.onChangedVideoStatus.add(this._onChangedVideoStatus);
+
+                       if(this.vposWatcher) this.vposWatcher.kill();
+
+                       this.vposWatcher = new VposWatcher(this.video);
+
+                       if(this.videoLoadGuardian != null) this.videoLoadGuardian.destroy();
+
+                       this.videoLoadGuardian = new VideoLoadGuardian(this.video, this.initializeInfo.isPremium);
+
+                       if(this.nicoViewControllerClient.videoLoadWatcher == null) this.nicoViewControllerClient.videoLoadWatcher = new VideoLoadWatcher();
+                       EventSequence.current.next();
+               }
+
+               private function prepareCommentLists():void
+               {       //MethodID:73, LocalCount= 2 , MaxScope= 2, MaxStack= 12, CodeLength= 597
+                       internal var normalThreadID:String;                             //slotID:1
+                       internal var leafMode:Boolean;                                  //slotID:2
+                       internal var clear:Function;                                    //slotID:3
+                       internal var filtered:CommentPoolContainer;                     //slotID:4
+
+                       filtered = null;
+                       clear = function():void{        //MethodID:72, LocalCount= 1 , MaxScope= 0, MaxStack= 2, CodeLength= 150
+                               nicoViewControllerClient.commentListContainer = null;
+                               nicoViewControllerClient.nicoSClient = null;
+
+                               if(nicosClient) nicosClient.clear();
+
+                               if(nicosPlayer) nicosPlayer.clear();
+
+                               nicosClient = null;
+                               privateCommentList = null;
+                               commentList = null;
+                               nicoSCommentList = null;
+                               ownerCommentList = null;
+                               localCommentList = null;
+
+                               delete commentListContainer[CommentConstants.CL_PRIVATE];
+                               delete commentListContainer[CommentConstants.CL_MAIN];
+                               delete commentListContainer[CommentConstants.CL_NICOS];
+                               delete commentListContainer[CommentConstants.CL_OWNER];
+                               delete commentListContainer[CommentConstants.CL_LOCAL];
+                       };
+
+                       clear();
+
+                       normalThreadID = this.getFLV.threadID;
+                       leafMode = (((this.playerInfo.leafFilter.indexOf(this.getFLV.messageServerURL) != (-1)) || (this.flashVars.leafSwitch != NicoFlashVars.LEAF_DISABLE)) && this.playerConfig.isEnabledLeafMode);
+
+                       if(this.flashVars.isCommunityThread){
+                               this.privateCommentList = new CommentList(this.getFLV.threadID, this.getFLV.videoLength, this.commentStorage, CommentConstants.CL_PRIVATE, this.flashVars.isMymemory, leafMode);
+                               this.commentListContainer[CommentConstants.CL_PRIVATE] = this.privateCommentList;
+                               this.mainCommentListName = CommentConstants.CL_PRIVATE;
+                               normalThreadID = this.getFLV.optionalThreadID;
+                       }
+
+                       if(this.getFLV.nicoSThreadID){
+                               this.nicoSCommentList = new CommentList(this.getFLV.nicoSThreadID, this.getFLV.videoLength, this.commentStorage, CommentConstants.CL_NICOS);
+                               this.commentListContainer[CommentConstants.CL_NICOS] = this.nicoSCommentList;
+                       }
+
+                       this.commentList = new CommentList(normalThreadID, this.getFLV.videoLength, this.commentStorage, CommentConstants.CL_MAIN, this.flashVars.isMymemory, leafMode);
+                       this.commentListContainer[CommentConstants.CL_MAIN] = this.commentList;
+
+                       if(this.flashVars.hasOwnerThread){
+                               this.nicosClient = new NicoSClient(this.nicosPlayer, this.videoController, this.videoLayerManager, this.jumper, this.flashVars, null, null, this.nicoSCommentList, this.playerConfig, this._isPlaylist);
+                               this.ownerCommentList = new OwnerCommentList(normalThreadID, this.commentStorage, this.nicosClient, new RegisterBGM(this.configure));
+                               this.commentListContainer[CommentConstants.CL_OWNER] = this.ownerCommentList;
+                       }
+
+                       this.localCommentList = new LocalCommentList();
+                       this.commentListContainer[CommentConstants.CL_LOCAL] = this.localCommentList;
+                       this.nicoViewControllerClient.commentListContainer = this.commentListContainer;
+                       this.nicoViewControllerClient.nicoSClient = this.nicosClient;
+
+                       if(!this.pluginClient.hasInitialized("commentListContainer")) this.pluginClient.setProperty("commentListContainer", this.commentListContainer);
+
+                       if(!this.nicoViewControllerClient.filteredCommentPoolContainers) this.nicoViewControllerClient.filteredCommentPoolContainers = [];
+
+                       if(!this.pluginClient.hasInitialized("filteredCommentPoolContainer")){
+                               filtered = new CommentPoolContainer();
+
+                               this.pluginClient.setProperty("filteredCommentPoolContainer", filtered);
+                               this.nicoViewControllerClient.filteredCommentPoolContainers.push(filtered);
+                       }
+
+                       EventSequence.current.next();
+               }
+
+               private function initializeModelAndView():void
+               {       //MethodID:74, LocalCount= 3 , MaxScope= 1, MaxStack= 9, CodeLength= 768
+                       var hug2:GetRelation = null;
+                       this.nicoViewControllerClient.commentLayer = null;
+                       this.nicoViewControllerClient.commentLayerView = null;
+                       this.nicoViewControllerClient.commentViewTransformer = null;
+                       this.nicoViewControllerClient.jumpMessageLayer = null;
+                       this.nicoViewControllerClient.replacer = null;
+                       this.nicoViewControllerClient.channelReplacer = null;
+                       this.nicoViewControllerClient.deleteFilter = null;
+                       this.nicoViewControllerClient.externalClient = null;
+
+                       this.initializeCommentLayerView();
+
+                       this.nicoViewControllerClient.commentLayer = this.commentLayer;
+                       this.nicoViewControllerClient.commentLayerView = this.commentLayerView;
+                       this.nicoViewControllerClient.commentViewTransformer = this.commentViewTransformer;
+
+                       if(this.nicosClient){
+                               this.nicosClient.commentLayerView_ = this.commentLayerView;
+                               this.nicosClient.commentLayer_ = this.commentLayer;
+                       }
+
+                       this.jumpMsgLayer = new JumpMessageLayer(this.videoLayerManager.jumpMsgLayer);
+                       this.nicoViewControllerClient.jumpMessageLayer = this.jumpMsgLayer;
+                       this.replacer = new Replacer(this.getFLV.ownerFilter, this.configure.GET_CONFIGURE_NGWORD, this.flashVars.watchID, this.initializeInfo.isNGMaintenance, (this.isThumbWatchMode ? null : this.flashVars.watchFlashVars.csrfToken));
+                       this.nicoViewControllerClient.replacer = this.replacer;
+
+                       if(this.getFLV.channelFilter){
+                               this.channelReplacer = new ChannelReplacer(this.getFLV.channelFilter);
+                               this.nicoViewControllerClient.channelReplacer = this.channelReplacer;
+                       }
+
+                       var hug1:Object = {};
+
+                       if(this.commentList) hug1[CommentConstants.CL_MAIN] = this.commentList;
+
+                       if(this.nicoSCommentList) hug1[CommentConstants.CL_NICOS] = this.nicoSCommentList;
+
+                       if(this.privateCommentList) hug1[CommentConstants.CL_PRIVATE] = this.privateCommentList;
+
+                       this.deleteFilter = new DeleteFilter(hug1, (this.isThumbWatchMode ? false : this.flashVars.watchFlashVars.isEditMode));
+                       this.nicoViewControllerClient.deleteFilter = this.deleteFilter;
+
+                       if(!this.audioShutter){
+                               this.audioShutter = new ControllerShutter(AudioShutterConstants.END_OF_ENUM, "AUDIO");
+                               this.nicoViewControllerClient.audioShutter = this.audioShutter;
+
+                               this.pluginClient.setProperty("audioShutter", this.audioShutter);
+                       }
+
+                       if(!this.externalClient) this.externalClient = new ExternalClient();
+                       this.externalClient.initialize(this.flashVars.watchID, this.video, this.videoController, this.playerConfig, this.initializeInfo.isPremium, (this.isThumbWatchMode ? false : this.flashVars.watchFlashVars.isOwnerThreadEditMode), (this.getFLV.nicoSThreadID != null));
+
+                       this.externalClient.localCommentList = this.localCommentList;
+                       this.externalClient.ownerCommentList = this.ownerCommentList;
+                       this.nicoViewControllerClient.externalClient = this.externalClient;
+
+                       this.video.onChangedVideoStatus.add(this.externalClient.onChangeVideoStatus);
+
+                       if(!this.commentShutter){
+                               this.commentShutter = new ControllerShutter(CommentShutterConstants.END_OF_ENUM, "COMMENT");
+                               this.nicoViewControllerClient.commentShutter = this.commentShutter;
+
+                               if(this.playlistController != null) this.playlistController.commentShutter = this.commentShutter;
+                       }
+
+                       if(this.nicosClient){
+                               this.nicosClient.audioShutter = this.audioShutter;
+                               this.nicosClient.commentShutter = this.commentShutter;
+                       }
+
+                       if(!this.flashVars.forceRelationInvisible){
+                               hug2 = new GetRelation(HTTPUtils.loadXML, this.configure.GETRELATION_URL, this.flashVars.watchID, this.flashVars.category);
+                               this.relatedList = new RelatedVideoList(hug2, this.flashVars.noRelatedVideo);
+                               this.nicoViewControllerClient.relatedList = this.relatedList;
+                       }
+
+                       EventSequence.current.next();
+               }
+
+               private function initializeCommentRouter():void
+               {       //MethodID:78, LocalCount= 2 , MaxScope= 2, MaxStack= 8, CodeLength= 271
+                       this.nicoViewControllerClient.lockedComment = null;
+                       this.nicoViewControllerClient.commentRouter = null;
+
+                       if(this.isThumbWatchMode && !this.flashVars.thumbFlashVars.thumbComment){
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       this.lockedComment = new LockedComment(this.getFLV.threadID, this.mainCommentListName, this.flashVars.watchFlashVars.isPostLocked, this.flashVars.watchFlashVars.isEditMode);
+                       this.nicoViewControllerClient.lockedComment = this.lockedComment;
+                       this.deleteFilter.lockedComment = this.lockedComment;
+                       this.commentRouter = new CommentRouter(this.flashVars, this.playerConfig, this.lockedComment, this.nicosClient, this.initializeInfo.isPremium, this.channelReplacer);
+
+                       this.commentRouter.onCommentPostErorr.add(function(hug1:String):void{   //MethodID:75, LocalCount= 3 , MaxScope= 0, MaxStack= 5, CodeLength= 580
+                               var hug2:String = hug1;
+
+                               switch(hug2){
+                               case CommentRouter.ERROR_POST_184:
+                                       systemMessage.informComment(__MSG__("チャンネルとコミュニティ動画では184コマンドを使用できません"));
+                                       break;
+                               case CommentRouter.ERROR_POST_AT_COMMENT_UNDEFINED:
+                                       systemMessage.alert(__MSG__("入力された@コメントは、以下のどちらかの理由で使用できません。<br />") + __MSG__("・存在しない<br />") + __MSG__("・投稿者以外は使えない<br />") + __MSG__("現在、動画閲覧者が使用できるのは、") + "<a href=\"http://info.nicovideo.jp/help/player/script/90.html#s01\" target=\"_blank\">" + __MSG__("@ボタン(閲覧者用)") + "</a>、<a href=\"http://info.nicovideo.jp/help/player/script/90.html#s02\" target=\"_blank\">" + __MSG__("@ピザ") + "</a>" + __MSG__("の2つです。"));
+                                       break;
+                               case CommentRouter.ERROR_POST_BUTTON_ONCE:
+                                       systemMessage.informComment(__MSG__("@ボタンは、1視聴につき1つまでしかご利用になれません"));
+                                       break;
+                               case CommentRouter.ERROR_POST_BUTTON_PREMIUM_ONLY:
+                                       systemMessage.alert(__MSG__("@ボタンは現在[[a_tag_open]]プレミアム会員[[a_tag_close]]のみ使用可能です。", "<a href=\"http://www.nicovideo.jp/?p=premium_top&sec=at_button\" target=\"_blank\">", "</a>"));
+                                       break;
+                               case CommentRouter.ERROR_POST_HIROBA:
+                                       systemMessage.informComment(__MSG__("広場では@ボタンは使えません。"));
+                                       break;
+                               case CommentRouter.ERROR_POST_INITIALIZE:
+                                       systemMessage.informComment(__MSG__("コメント投稿の準備が未完了です"));
+                                       break;
+                               case CommentRouter.ERROR_POST_BUTTON_ARGUMENTS:
+                                       systemMessage.informComment(__MSG__("@ボタンの設定項目が足りません。"));
+                                       break;
+                               case CommentRouter.ERROR_POST_SAME_COMMENT:
+                                       systemMessage.informComment(__MSG__("同じコメントを連続で投稿することができません。"));
+                                       break;
+                               case CommentRouter.ERROR_POST_CHANNEL_FILTER:
+                                       systemMessage.informComment(__MSG__("入力されたコメントはこの動画では投稿できません。"));
+                                       break;
+                               case CommentRouter.ERROR_POST_AT_COMMENT_DISABLED:
+                                       systemMessage.informComment(__MSG__("この動画では@コメントは使えません。"));
+                                       break;
+                               case CommentRouter.ERROR_POST_COMMAND_DISABLED:
+                                       systemMessage.informComment(__MSG__("この動画ではコマンドは使えません。"));
+                                       break;
+                               default:
+                                       break;
+                               }
+                       });
+
+                       if(this.flashVars.watchFlashVars.noAtPizza || this.isThumbWatchMode){
+                               this.commentRouter.onCommentHavingMacro.add(function(hug1:IMacroParserResult):void{     //MethodID:76, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 22
+                                       if(hug1.macroName == "ピザ") systemMessage.informComment("@ピザは、使用できません。");
+                               });
+                       }else{
+                               this.commentRouter.onCommentHavingMacro.add(function(hug1:IMacroParserResult):void{     //MethodID:77, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 40
+                                       if(hug1.macroName == "ピザ"){
+                                               navigateToURL(new URLRequest(configure.PIZZA_URL), "_blank");
+                                               videoController.stop();
+                                       }
+                               });
+                       }
+
+                       if(this.nicosClient) this.nicosClient.commentRouter = this.commentRouter;
+
+                       this.nicoViewControllerClient.commentRouter = this.commentRouter;
+                       EventSequence.current.next();
+               }
+
+               private function initializeModelAndView4Watch():void
+               {       //MethodID:82, LocalCount= 3 , MaxScope= 2, MaxStack= 10, CodeLength= 1164
+                       internal var linkURL:String;                                    //slotID:1
+                       internal var pageURL:String;                                    //slotID:2
+                       internal var messageHTML:String;                                //slotID:3
+                       internal var onMarqueePlayerLoaded:Function;                    //slotID:4
+                       internal var isUseVideoEnder:Boolean;                           //slotID:5
+
+                       linkURL = null;
+                       pageURL = null;
+                       messageHTML = null;
+                       isUseVideoEnder = false;
+                       this.nicoViewControllerClient.timeMachine = null;
+                       this.nicoViewControllerClient.marqueeClient = null;
+                       this.nicoViewControllerClient.frameRateBooster = null;
+                       this.timeMachine = new TimeMachine(new Date(parseInt(this.getFLV.threadID, 10) * 1000));
+                       this.nicoViewControllerClient.timeMachine = this.timeMachine;
+
+                       if(!this.frameRateBooster) this.frameRateBooster = new FrameRateBooster(stage);
+
+                       this.nicoViewControllerClient.frameRateBooster = this.frameRateBooster;
+
+                       if(this._isPlaylist && (this._shutterKeyLastClosed >= 0)){
+                               this.commentShutter.open(this._shutterKeyLastClosed);
+
+                               this._shutterKeyLastClosed = -1;
+                       }
+
+                       if(this.flashVars.isMymemory){
+                               this.commentShutter.close(this._shutterKeyLastClosed = CommentShutterConstants.SHUTTER_MYMEMORY, __MSG__("マイメモリーはコメントできません"));
+                       }else if(!this.getFLV.commentExpire && !this.flashVars.watchFlashVars.isOwnerThreadEditMode){
+                               if(this.flashVars.watchFlashVars.commentListPublicStatus == CommentListPublicStatus.MEMBER_ONLY){
+                                       linkURL = (this.configure.CHANNEL_URL + (this.flashVars.isChannel ? "channel" : "community") + "/" + this.flashVars.communityGlobalID);
+
+                                       this.commentShutter.close(this._shutterKeyLastClosed = CommentShutterConstants.SHUTTER_CHANNEL_COMMUNITY, (("<a href=\"" + linkURL + "\"><u>") + (this.flashVars.isChannel ? __MSG__("コメントするにはチャンネルに入会してください") : __MSG__("コメントするにはコミュニティに入会してください")) + "</u></a>"));
+                               }else{
+                                       this.commentShutter.close(this._shutterKeyLastClosed = CommentShutterConstants.SHUTTER_OTHER, "");
+                               }
+                       }else if(this.flashVars.watchFlashVars.isCommentShuttered){
+                               this.commentShutter.close(this._shutterKeyLastClosed = CommentShutterConstants.SHUTTER_LOCKED, __MSG__("あなたはコメントを禁止されています"));
+                       }
+
+                       if(!CrossSharedObject.isPersistable){
+                               if(!this.flashVars.watchFlashVars.isEditMode && !this.flashVars.watchFlashVars.isOwnerThreadEditMode) this.commentShutter.close(this._shutterKeyLastClosed = CommentShutterConstants.SHUTTER_NOSHAREDOBJECT, ("<p>" + __MSG__("ローカル記憶領域が使用できないため、コメント機能を制限をしています") + "</p>"));
+
+                               if(!this._isShowedDialog){
+                                       this._isShowedDialog = true;
+
+                                       this.systemMessage.informln(__MSG__("SharedObjectの初期に失敗しました。"));
+
+                                       pageURL = this._playerPageMyselfURL;
+                                       messageHTML = ("<p><b>" + __MSG__("ローカル記憶領域の書き込みが出来ません。") + "</b></p>" + "<p>" + __MSG__("NG設定、音量設定の保存、ニコニコニュース、RSS、") + "<br>" + __MSG__("生放送開始のお知らせ、ユーザーが設定した@CMなど、") + "<br>" + __MSG__("プレーヤーの機能がご利用出来ない状態です。") + "<br>" + __MSG__("プレーヤーの各機能を有効にするため、Flashの設定を変更してください。") + "<br>" + "<a href=\"" + this.configure.NOSO_URL + "\" target=\"_blank\">ローカル記憶領域の設定を変更する方法について</a>" + "</p>");
+
+                                       this.systemMessage.alert(messageHTML);
+                               }
+                       }
+
+                       if(this.flashVars.watchFlashVars.isEditMode){
+                               this.deleteFilter.onFinishedEdit = function(hug1:Boolean):void{ //MethodID:79, LocalCount= 5 , MaxScope= 0, MaxStack= 4, CodeLength= 144
+                                       var hug3:String = null;
+                                       var hug4:String = null;
+                                       var hug2:String = _playerPageMyselfURL;
+
+                                       if(!hug1){
+                                               if(flashVars.isMymemory){
+                                                       hug3 = StringUtils.joinQuery(hug2, {edit:"mymemory"});
+                                                       hug4 = ("<b>マイメモリーの編集に失敗しました。</b>" + "再度編集しなおす場合は、以下のURLからお願いします。<br />" + "<a href=\"" + hug3 + "\">" + hug3 + "</a>");
+                                               }else{
+                                                       hug3 = StringUtils.joinQuery(hug2, {edit:"comment"});
+                                                       hug4 = ("<b>編集の保存に失敗しました。</b>" + "再度編集しなおす場合は、以下のURLからお願いします。<br />" + "<a href=\"" + hug3 + "\">" + hug3 + "</a>");
+                                               }
+
+                                               systemMessage.alert(hug4);
+
+                                               return;
+                                       }
+
+                                       navigateToURL(new URLRequest(hug2), "_self");
+                               };
+                       }
+
+                       if(!this.flashVars.watchFlashVars.isNoMarquee && !this.flashVars.watchFlashVars.isEditMode && !this.flashVars.watchFlashVars.isOwnerThreadEditMode && CrossSharedObject.isPersistable){
+                               onMarqueePlayerLoaded = function():void{        //MethodID:80, LocalCount= 1 , MaxScope= 0, MaxStack= 3, CodeLength= 94
+                                       if(nicosClient) nicosClient.marqueePlayer = INicoMarqueePlayer(marqueeClient.marqueePlayer);
+
+                                       if(hirobaConnectorClient) hirobaConnectorClient.insertItemOnMarquee_0 = INicoMarqueePlayer(marqueeClient.marqueePlayer).interruptContent;
+
+                                       if(playlistController) playlistController.marqueeClient = marqueeClient;
+                                       pluginClient.setProperty("marqueeClient", marqueeClient);
+                                       commentRouter.addMarqueePlayer(marqueeClient.marqueePlayer);
+                               };
+
+                               if(!this.marqueeClient) this.marqueeClient = new MarqueeClient(this.configure.MARQUEE_PLAYER_URL, this.playerVersion, this.playerInfo, this.nicoViewController.marqueeBase, this.videoLayerManager, this.playerConfig, this.initializeInfo, onMarqueePlayerLoaded);
+
+                               if(this.nicosClient) this.nicosClient.marqueePlayer = INicoMarqueePlayer(this.marqueeClient.marqueePlayer);
+
+                               this.marqueeClient.videoController = this.videoController;
+                               this.marqueeClient.flashVars = this.flashVars;
+                               this.nicoViewControllerClient.marqueeClient = this.marqueeClient;
+                       }
+
+                       if(!this.flashVars.watchFlashVars.isNoAppli && !this.pluginClient.hasInitialized("videoDetail")) this.pluginClient.setProperty("videoDetail", new VideoDetail(this.flashVars.category, this.flashVars.videoDetail));
+                       function():void{        //MethodID:81, LocalCount= 5 , MaxScope= 0, MaxStack= 23, CodeLength= 193
+                               if(_isPlaylist) return;
+
+                               var hug1:* = new RemoconNotifier(configure.REMOCON_ALERT_SWF_URL + "?" + playerVersion.remoconAlert);
+                               var hug2:* = new RemoconFullScreenKeeper(playerConfig, externalClient);
+                               var hug3:* = new RemoconPlayerStateObserver(externalClient.udpateRemoconState, hug1, hug2);
+
+                               commentRouter.onCommentPostErorr.add(hug3.onCommentRouterPostError);
+
+                               var hug4:* = new RemoconClient(hug3, hug1, RemoconState.instance);
+
+                               RemoconReceiver.initialize({videoController:videoController, playerConfig:playerConfig, commentRouter:commentRouter, isPremium:initializeInfo.isPremium, stateObserver:hug3, notifier:hug1, userID:initializeInfo.userID, userNasme:initializeInfo.nickname, commentShutter:commentShutter, audioShutter:audioShutter, fullScreenKeeper:hug2}, defineRemoconMethods);
+                               hug2.start();
+
+                               nicoViewControllerClient.remoconClient = hug4;
+                       }();
+
+                       this.nicoViewControllerClient.defaultMylistAppender = new DefaultMylistAppender(HTTPUtils.loadJSON, this.configure.MYLIST_ADD_API_URL, this.getFLV.threadID, this.flashVars.watchFlashVars.noDeflistAdd, this.flashVars.watchFlashVars.csrfToken);
+
+                       if(this.nicoViewControllerClient.videoenderTesterConfig == null){
+                               if(this._isPlaylist){
+                                       isUseVideoEnder = (this.playlistFlashVars && this.playlistFlashVars.useVideoEnder);
+                               }else{
+                                       isUseVideoEnder = (this.flashVars.watchFlashVars && this.flashVars.watchFlashVars.useVideoEnder);
+                               }
+
+                               this._videoenderTesterConfig = new VideoenderTesterConfig(isUseVideoEnder);
+                               this.nicoViewControllerClient.videoenderTesterConfig = this._videoenderTesterConfig;
+                       }
+
+                       EventSequence.current.next();
+               }
+
+               private function initializeSponsorVideo():void
+               {       //MethodID:85, LocalCount= 2 , MaxScope= 2, MaxStack= 7, CodeLength= 169
+                       internal var url:String;                                        //slotID:1
+                       internal var info:GetSponsorInfo;                               //slotID:2
+
+                       info = null;
+                       this.nicoViewControllerClient.getSponsorInfo = null;
+
+                       if(!this.isThumbWatchMode && (this.flashVars.isMymemory || this.flashVars.watchFlashVars.isEditMode || this.flashVars.watchFlashVars.isOwnerThreadEditMode)){
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       url = StringUtils.joinQuery(this.configure.GETSPONSOR_API_URL, {limit:"4", videoid:this.flashVars.originalVideoID});
+                       info = new GetSponsorInfo(url, function(hug1:Boolean):void{     //MethodID:84, LocalCount= 3 , MaxScope= 1, MaxStack= 5, CodeLength= 213
+                               internal var succeeded:Boolean;                                 //slotID:1
+                               internal var layer:*;                                           //slotID:2
+                               internal var userSponsorSWFURL:*;                               //slotID:3
+                               internal var otherSponsorLink:*;                                //slotID:4
+                               internal var youAlsoLink:*;                                     //slotID:5
+
+                               layer = undefined;
+                               otherSponsorLink = undefined;
+                               youAlsoLink = undefined;
+                               succeeded = hug1;
+
+                               if(!succeeded || (info.sponsorInfoList.length == 0)) return;
+
+                               layer = videoLayerManager.createOptionalLayer(VideoLayerManager.OPTIONAL_LAYER_SPONSORVIDEOLAYER);
+                               userSponsorSWFURL = StringUtils.joinQuery(configure.USERSPONSOR_MOVIE_URL, {t:playerVersion.userSponsorMovie});
+                               otherSponsorLink = (StringUtils.joinQuery(configure.OTHERSPONSOR_URL, {vid:flashVars.originalVideoID}) + "&video_player");
+                               youAlsoLink = (StringUtils.joinQuery(configure.OTHERSPONSOR_URL, {vid:flashVars.originalVideoID}) + "&video_player_also");
+
+                               if(video.hasLoaded){
+                                       HTTPUtils.loadSWF(function(hug1:*):void{        //MethodID:83, LocalCount= 2 , MaxScope= 0, MaxStack= 8, CodeLength= 76
+                                               if(hug1){
+                                                       userSponsorVideo = IUserSponsorVideo(hug1);
+
+                                                       userSponsorVideo.initialize(new UserSponsorVideoClient(info, layer, otherSponsorLink, youAlsoLink, ICapturableVideoContainer(videoController.videoWrapper), vposWatcher));
+                                                       video.appendVideo(ChildVideoName.USER_SPONSOR, userSponsorVideo);
+                                               }
+                                       }, userSponsorSWFURL, {});
+                               }else{
+                                       video.appendVideo(ChildVideoName.USER_SPONSOR, userSponsorVideo);
+                               }
+                       });
+
+                       this.nicoViewControllerClient.getSponsorInfo = info;
+
+                       EventSequence.current.next();
+               }
+
+               private function loadConfirm():void
+               {       //MethodID:87, LocalCount= 2 , MaxScope= 2, MaxStack= 3, CodeLength= 24
+                       this.videoLoadGuardian.loadStart(EventSequence.bind(function(hug1:Boolean):void{        //MethodID:86, LocalCount= 3 , MaxScope= 0, MaxStack= 5, CodeLength= 144
+                               var hug2:* = undefined;
+
+                               if(hug1){
+                                       EventSequence.current.next();
+                               }else if(!isThumbWatchMode){
+                                       if(_isPlaylist && playlistController){
+                                               playlistController.onError(PlaylistErrorManager.VIDEO_LOAD_STOP);
+                                       }else{
+                                               hug2 = _playerPageMyselfURL;
+
+                                               SystemMessage.instance.alert(("<p><b>" + __MSG__("動画の読み込みができません。") + "</b></p>" + "<p>" + __MSG__("別のタブかウィンドウで、動画をいくつか読み込み中です。<br />") + __MSG__("読み込みが完了してから再度アクセスしてください。<br />") + "<br />") + __MSG__("<a href=\"[[url]]\">リロードする</a>", hug2) + "</p>");
+                                       }
+                               }
+                       }));
+               }
+
+               private function initializePlugin():void
+               {       //MethodID:91, LocalCount= 2 , MaxScope= 2, MaxStack= 9, CodeLength= 208
+                       internal var loader:ApplibarLoader;                             //slotID:1
+
+                       loader = null;
+
+                       if(this.flashVars.watchFlashVars.isNoAppli || this.flashVars.watchFlashVars.isEditMode || this.flashVars.watchFlashVars.isOwnerThreadEditMode || !CrossSharedObject.isPersistable){
+                               EventSequence.current.next();
+
+                               return;
+                       }
+
+                       loader = new ApplibarLoader(this.configure.APPLIBAR_URL, {v:this.playerVersion.applibar}, this.initializeInfo.userID, this.flashVars.watchFlashVars.bootApp, this.playerConfig, this.flashVars.watchFlashVars.appliInstalled, this.flashVars.watchFlashVars.isAppliPromotion);
+
+                       loader.onLoaded.add(function(hug1:Boolean):void{        //MethodID:88, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 26
+                               if(!hug1) return;
+
+                               nicoViewControllerClient.applibarLoader = loader;
+
+                               loader.setPluginClient(pluginClient);
+                       });
+                       loader.onPageOpen.add(function():void{  //MethodID:89, LocalCount= 1 , MaxScope= 0, MaxStack= 1, CodeLength= 18
+                               if(videoController.isPlaying) videoController.stop();
+                       });
+                       this._playlistSequences.forEach(function(hug1:Function, hug2:int, hug3:Array):Boolean{  //MethodID:90, LocalCount= 4 , MaxScope= 0, MaxStack= 3, CodeLength= 22
+                               if(hug1 == initializePlugin){
+                                       _playlistSequences.splice(hug2, 1);
+
+                                       return false;
+                               }
+
+                               return true;
+                       });
+                       EventSequence.current.next();
+               }
+
+               private function _delayVideo():void
+               {       //MethodID:93, LocalCount= 2 , MaxScope= 2, MaxStack= 4, CodeLength= 101
+                       internal var delay:Number;                                      //slotID:1
+                       internal var timer:Timer;                                       //slotID:2
+                       internal var handler:Function;                                  //slotID:3
+
+                       timer = null;
+                       handler = null;
+                       delay = PlayDelay.getPlayDelayTime(this.initializeInfo.isPremium, this.isThumbWatchMode);
+                       timer = new Timer(delay, 1);
+                       handler = EventSequence.bind(function():void{   //MethodID:92, LocalCount= 1 , MaxScope= 0, MaxStack= 3, CodeLength= 40
+                               timer.stop();
+                               timer.reset();
+                               timer.removeEventListener(TimerEvent.TIMER_COMPLETE, handler);
+                               EventSequence.current.next();
+                       });
+                       timer.addEventListener(TimerEvent.TIMER_COMPLETE, handler);
+                       timer.start();
+               }
+
+               private function _loadVideo():void
+               {       //MethodID:97, LocalCount= 5 , MaxScope= 2, MaxStack= 10, CodeLength= 779
+                       internal var barrier:EventBarrier;                              //slotID:1
+                       internal var succeeded_all:Boolean;                             //slotID:2
+                       internal var bgmNeeded:Boolean;                                 //slotID:3
+                       internal var bgmVideos:Object;                                  //slotID:4
+                       internal var cmVideos:Object;                                   //slotID:5
+                       internal var bgmInfo:BGMVideoInfo;                              //slotID:6
+                       internal var bgmVideo:IVideo;                                   //slotID:7
+                       internal var container:Sprite;                                  //slotID:8
+
+                       succeeded_all = false;
+                       bgmNeeded = false;
+                       bgmVideos = null;
+                       cmVideos = null;
+                       bgmInfo = null;
+                       bgmVideo = null;
+                       container = null;
+
+                       if(this._logManager) this._logManager.observer.onVideoLoadStarted();
+
+                       barrier = new EventBarrier();
+                       succeeded_all = true;
+
+                       this.systemMessage.informln(__MSG__("動画の読み込みを開始"));
+
+                       if((this.getFLV.videoProtocol == "rtmp") || (this.getFLV.videoProtocol == "rtmpe") || (this.getFLV.videoProtocol == "rtmpt") || (this.getFLV.videoProtocol == "rtmpte")) this.systemMessage.informln(__MSG__("動画に接続"));
+
+                       this.video.isRetryable = false;
+
+                       this.video.load(barrier.bind(function(hug1:Boolean):void{       //MethodID:94, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 110
+                               succeeded_all = (succeeded_all && hug1);
+
+                               if(!hug1 && !isThumbWatchMode && _logManager) _logManager.observer.onVideoLoadErrorOccurred();
+
+                               if(_startVposConfig.halfwayStartEnabled) _startVposConfig.judgebyVideoLength(video);
+
+                               if(!_startVposConfig.halfwayStartEnabled){
+                                       nicoViewController.initVideoEventPipe(vposWatcher);
+                                       nicoViewController.onVideoInitialized(hug1);
+                               }
+
+                               _videoLoadSucceeded = hug1;
+                       }));
+
+                       bgmNeeded = Boolean(this.BGMVideoInfos.length != 0);
+
+                       bgmVideos = {};
+                       cmVideos = {};
+
+                       if(this.flashVars.watchFlashVars && !this.flashVars.watchFlashVars.isOwnerThreadEditMode || this.flashVars.thumbFlashVars && this.BGMVideoInfos && bgmNeeded){
+                               for each(bgmInfo in this.BGMVideoInfos){
+                                       if(bgmInfo.type == BGMVideoInfo.TYPE_BGM){
+                                               container = new Sprite();
+
+                                               container.graphics.beginFill(0);
+                                               container.graphics.drawRect(0, 0, NicoSConstants.ATBGM_VIDEO_WIDTH, NicoSConstants.ATBGM_VIDEO_HEIGHT);
+                                       }else{
+                                               container = new MovieClip();
+
+                                               container.graphics.beginFill(0);
+                                               container.graphics.drawRect(0, 0, NicoSConstants.ATCM_VIDEO_WIDTH, NicoSConstants.ATCM_VIDEO_HEIGHT);
+                                       }
+
+                                       container.graphics.endFill();
+
+                                       switch(bgmInfo.movieType){
+                                       case VideoType.FLV:
+                                       case VideoType.MP4:
+                                               bgmVideo = new FLVVideo(bgmInfo.URL, container, -1);
+                                               break;
+                                       case VideoType.SWF:
+                                               bgmVideo = new SWFVideo(bgmInfo.URL, container, NaN, false, "", null, "", bgmInfo.isAS3);
+                                               break;
+                                       default:
+                                               throw new Error("未定義のBGMタイプ:" + bgmInfo.movieType);
+                                               break;
+                                       }
+
+                                       if(bgmInfo.type == BGMVideoInfo.TYPE_BGM){
+                                               bgmVideos[bgmInfo.ID] = bgmVideo;
+                                       }else{
+                                               cmVideos[bgmInfo.ID] = bgmVideo;
+                                       }
+
+                                       bgmVideo.load(barrier.bind(function(hug1:Boolean):void{ //MethodID:95, LocalCount= 2 , MaxScope= 0, MaxStack= 4, CodeLength= 102
+                                               if(!succeeded_all) return;
+
+                                               succeeded_all = (succeeded_all && hug1);
+
+                                               if(!hug1){
+                                                       if(!isThumbWatchMode) SystemMessage.instance.alert("<p><b>" + __MSG__("引用動画の読み込みに失敗") + "</b></p>" + "<p>" + __MSG__("問題解消に向けて努力しております。") + "<br />" + __MSG__("しばらく時間をおいて再度アクセスしてみて下さい。") + "</p>");
+
+                                                       return;
+                                               }
+                                       }));
+                               }
+                       }
+
+                       barrier.finish(EventSequence.bind(function():void{      //MethodID:96, LocalCount= 5 , MaxScope= 0, MaxStack= 4, CodeLength= 145
+                               var hug1:* = undefined;
+                               var hug2:* = undefined;
+                               _wholeVideoLoadSucceeded = succeeded_all;
+
+                               if(!succeeded_all){
+                                       EventSequence.current.next();
+
+                                       return;
+                               }
+
+                               if(bgmNeeded){
+                                       hug1 = {};
+
+                                       for(hug2 in cmVideos){
+                                               hug1[hug2] = cmVideos[hug2].movieClip;
+                                       }
+
+                                       nicosClient.setBGMVideos(bgmVideos, hug1);
+                               }
+
+                               if(getFLV.deleted == 0) PlayDelay.countUp();
+
+                               if(marqueeClient) marqueeClient.load();
+                               EventSequence.current.next();
+                       }));
+               }
+
+               private function initializeLogger():void
+               {       //MethodID:98, LocalCount= 1 , MaxScope= 1, MaxStack= 13, CodeLength= 63
+                       this._logManager.initialize(this.initializeInfo, this.configure, this.flashVars, this.getFLV, this.playerConfig, this.playerInfo, this, this.isThumbWatchMode, this.video, this, this._isPlaylist, this._videoenderTesterConfig);
+                       EventSequence.current.next();
+               }
+
+               private function initializeCommentLists():void
+               {       //MethodID:102, LocalCount= 2 , MaxScope= 2, MaxStack= 3, CodeLength= 241
+                       internal var barrier:EventBarrier;                              //slotID:1
+                       internal var error:CommentStorageError;                         //slotID:2
+                       internal var init_handler:Function;                             //slotID:3
+
+                       barrier = null;
+                       error = null;
+                       init_handler = null;
+                       init_handler = function(hug1:CommentStorageError):void{ //MethodID:99, LocalCount= 3 , MaxScope= 0, MaxStack= 3, CodeLength= 38
+                               var hug2:CommentStorageError = hug1;
+                               error = hug2;
+
+                               if(!(error || hug2)) return;
+                               barrier.finish();
+                       };
+
+                       if(this.nicosClient) this.nicosClient.setup();
+                       this.systemMessage.informln(__MSG__("コメントサーバーへの接続を開始"));
+
+                       barrier = new EventBarrier();
+                       error = null;
+
+                       this.commentList.onCommentPostFinished.add(function(hug1:String, hug2:int, hug3:int):void{      //MethodID:100, LocalCount= 5 , MaxScope= 0, MaxStack= 2, CodeLength= 63
+                               var hug4:XMLList = null;
+
+                               if(hug2 == MessageServerClient.POST_INVALID_THREAD){
+                                       hug4 = playerInfo.getThreadError;
+
+                                       if(hug4 && (hug4.post_invalid_thread != "")) SystemMessage.instance.alert(hug4.post_invalid_thread);
+                               }
+                       });
+                       this.commentList.initialize(barrier.bind(init_handler));
+
+                       if(this.flashVars.isCommunityThread) this.privateCommentList.initialize(barrier.bind(init_handler));
+
+                       if(this.nicoSCommentList) this.nicoSCommentList.initialize(barrier.bind(init_handler));
+
+                       if(this.flashVars.hasOwnerThread) this.ownerCommentList.initialize(barrier.bind(init_handler));
+                       barrier.finish(function():void{ //MethodID:101, LocalCount= 4 , MaxScope= 0, MaxStack= 4, CodeLength= 201
+                               var hug1:String = null;
+
+                               if(error){
+                                       if(error.isInLowerLayer){
+                                               systemMessage.informln(__MSG__("コメントサーバーへの接続に失敗"));
+                                       }else{
+                                               systemMessage.informln(threadStatusCodeToMessage(error.status));
+                                       }
+
+                                       nicoViewController.onCommentListInitialized(false);
+
+                                       return;
+                               }
+
+                               systemMessage.informln(__MSG__("コメントサーバーへの接続に成功"));
+
+                               if(flashVars.thumbFlashVars && flashVars.thumbFlashVars.thumbComment || !isThumbWatchMode && !flashVars.isMymemory){
+                                       for(hug1 in commentListContainer){
+                                               commentRouter.add(hug1, commentListContainer[hug1]);
+                                       }
+                               }
+
+                               nicoViewController.onCommentListInitialized(true);
+                               setupCommentListEventPipes();
+                       });
+                       EventSequence.current.next();
+               }
+
+               private function setupCommentListEventPipes():void
+               {       //MethodID:103, LocalCount= 4 , MaxScope= 1, MaxStack= 2, CodeLength= 51
+                       var hug1:ICommentList = null;
+
+                       this.nicoViewController.initCommentEventPipe();
+
+                       for each(hug1 in this.commentListContainer){
+                               hug1.serveCommentList();
+                       }
+               }
+
+               private function beginToPlayVideo():void
+               {       //MethodID:108, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 216
+                       internal var alreadyBegan:Boolean;                              //slotID:1
+                       internal var begin:Function;                                    //slotID:2
+                       internal var vpos:Number;                                       //slotID:3
+
+                       alreadyBegan = false;
+                       vpos = NaN;
+                       begin = function():void{        //MethodID:104, LocalCount= 1 , MaxScope= 0, MaxStack= 3, CodeLength= 129
+                               if(_startVposConfig.halfwayStartEnabled) nicoViewController.initVideoEventPipe(vposWatcher);
+
+                               if(isThumbWatchMode){
+                                       if(!flashVars.thumbFlashVars.isP4Mode) videoController.play();
+                               }else{
+                                       videoController.startToPlay(_startVposConfig.isAutoPlay || (nicoViewControllerClient.initializeInfo.isPremium && playerConfig.autoPlay));
+
+                                       if(!_wholeVideoLoadSucceeded) videoController.stop();
+                               }
+
+                               if(_startVposConfig.halfwayStartEnabled) nicoViewController.onVideoInitialized(_videoLoadSucceeded);
+                       };
+
+                       this.externalClient.onPlayerReady();
+
+                       if(this.isThumbWatchMode){
+                               begin();
+
+                               return;
+                       }
+
+                       if(this.flashVars.watchFlashVars.jumpReturnVideoID){
+                               vpos = this.flashVars.watchFlashVars.jumpPlayLength;
+
+                               if(this._startVposConfig.halfwayStartEnabled) vpos += this.flashVars.watchFlashVars.jumpVPosPlayFrom;
+
+                               vpos *= 1000;
+
+                               this.vposWatcher.addWatchPoint(function():void{ //MethodID:106, LocalCount= 2 , MaxScope= 1, MaxStack= 4, CodeLength= 97
+                                       internal var params:Object;                                     //slotID:1
+
+                                       params = null;
+
+                                       videoController.stop();
+
+                                       params = {};
+
+                                       if(flashVars.watchFlashVars.jumpVPosReturnTo > 0) params.from = flashVars.watchFlashVars.jumpVPosReturnTo;
+                                       SystemMessage.instance.informJumpMessage(function():void{       //MethodID:105, LocalCount= 4 , MaxScope= 0, MaxStack= 10, CodeLength= 109
+                                               var hug1:Object = jumper.tossedObject;
+                                               var hug2:String = flashVars.watchFlashVars.jumpReturnVideoID;
+                                               var hug3:Object = {};
+
+                                               if(hug1 && hug1.jumpHistory) hug3 = hug1.jumpHistory;
+
+                                               hug3[flashVars.watchID] = true;
+
+                                               jumper.jump(hug2, params, false, {jumpFrom:flashVars.watchID, jumpHistory:hug3, jumpHash_:(hug1 ? hug1.jumpHash : undefined)});
+                                       }, (flashVars.watchFlashVars.jumpReturnMessage || __MSG__("元の動画にジャンプします")));
+                               }, vpos, 0x7FFFFFFF);
+                       }
+
+                       if(!this._startVposConfig.halfwayStartEnabled){
+                               begin();
+
+                               return;
+                       }
+
+                       alreadyBegan = false;
+
+                       EventPipe.serial(new EventChunk(this.video, ["onVideoSeeked"]), this.videoController, EventSequence.bind(function(hug1:String, hug2:Array):EventResult{ //MethodID:107, LocalCount= 3 , MaxScope= 0, MaxStack= 2, CodeLength= 28
+                               if(!alreadyBegan){
+                                       alreadyBegan = true;
+
+                                       begin();
+                               }
+
+                               return EventResult.BREAK;
+                       }));
+                       this.videoController.seek(this._startVposConfig.fromMsec, true);
+               }
+
+               private function initializeCommentLayerView():void
+               {       //MethodID:109, LocalCount= 2 , MaxScope= 1, MaxStack= 7, CodeLength= 343
+                       this.commentLayer = new CommentLayer(this.videoLayerManager.commentLayer, this.playerConfig, this.initializeInfo.isPremium);
+
+                       this.commentLayer.addLayer(CommentLayerID.MAIN);
+                       this.commentLayer.addLayer(CommentLayerID.OWNER);
+
+                       var hug1:Object = {};
+
+                       if(this.flashVars.isCommunityThread){
+                               hug1[CommentLayerID.MAIN] = [CommentConstants.CL_PRIVATE, CommentConstants.CL_LOCAL];
+                               hug1[CommentLayerID.OWNER] = [CommentConstants.CL_OWNER];
+                               hug1[CommentLayerID.OPTION] = [CommentConstants.CL_MAIN];
+
+                               this.commentLayer.addLayer(CommentLayerID.OPTION, 0);
+                               this.commentLayer.setOptionalLayer(CommentLayerID.OPTION);
+                       }else{
+                               hug1[CommentLayerID.MAIN] = [CommentConstants.CL_MAIN, CommentConstants.CL_LOCAL, CommentConstants.CL_NICOS];
+                               hug1[CommentLayerID.OWNER] = [CommentConstants.CL_OWNER];
+                       }
+
+                       this.commentLayerView = new CommentLayerView(this, this.video, VideoLayerConstants.COMMENT_LAYER_SD_WIDTH, VideoLayerConstants.COMMENT_LAYER_SD_HEIGHT, this.getFLV.videoLength);
+                       this.commentViewTransformer = new CommentViewTransformer(hug1, this.commentLayer, this.commentLayerView, (this.nicosClient ? this.nicosClient.player : null));
+
+                       if(this.isThumbWatchMode && this.flashVars.thumbFlashVars && this.flashVars.thumbFlashVars.isP4Mode) this.commentViewTransformer.setP4Mode();
+               }
+
+               private function threadStatusCodeToMessage(hug1:int):String
+               {       //MethodID:110, LocalCount= 4 , MaxScope= 1, MaxStack= 3, CodeLength= 415
+                       var hug2:XMLList = null;
+                       var hug3:int = hug1;
+
+                       switch(hug3){
+                       case MessageServerClient.THREAD_FOUND:
+                               return __MSG__("...");
+                       case MessageServerClient.THREAD_INVALID:
+                               return __MSG__("メッセージサーバーへの接続に失敗");
+                       case MessageServerClient.THREAD_NOT_FOUND:
+                               hug2 = this.playerInfo.getThreadError;
+
+                               if(hug2 && (hug2.thread_not_found != "")) SystemMessage.instance.alert(hug2.thread_not_found);
+
+                               return __MSG__("スレッドが見つかりません");
+                       case MessageServerClient.THREAD_VERSION:
+                               return __MSG__("プレイヤーのバージョンが不正");
+                       case MessageServerClient.THREAD_INVALID_ADMINKEY:
+                               return __MSG__("AdminKeyが不正");
+                       case MessageServerClient.THREAD_TOO_OLD_ADMINKEY:
+                               return __MSG__("AdminKeyが失効");
+                       case MessageServerClient.THREAD_INVALID_WAYBACKKEY:
+                               return __MSG__("WaybackKeyが不正");
+                       case MessageServerClient.THREAD_TOO_OLD_WAYBACKKEY:
+                               return __MSG__("WaybackKeyが失効");
+                       case MessageServerClient.THREAD_INVALID_THREADKEY:
+                               return __MSG__("ThreadKeyが不正");
+                       case MessageServerClient.THREAD_TOO_OLD_THREADKEY:
+                               return __MSG__("ThreadKeyが失効");
+                       default:
+                               return __MSG__("不明なエラー:code=[code]", hug1);
+                               break;
+                       }
+               }
+
+               private function _loadThumbViewSWF():void
+               {       //MethodID:112, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 42
+                       HTTPUtils.loadSWF(EventSequence.bind(function(hug1:*):void{     //MethodID:111, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 73
+                               if(!hug1) throw new Error("NicoPlayer._loadThumbViewSWF: load failure.");
+
+                               if(!hug1 is MovieClip) throw new Error("NicoPlayer._loadThumbViewSWF: content is not MovieClip.");
+                               addChild(hug1 as DisplayObject);
+
+                               (hug1 as DisplayObject).visible = false;
+                               nicoViewControllerClient.viewRoot = hug1;
+
+                               EventSequence.current.next();
+                       }), this.configure.THUMBPLAYER_VIEW_URL, {t:this.playerVersion.thumbplayerView});
+               }
+
+               private function _loadThumbControllerSWF():void
+               {       //MethodID:114, LocalCount= 2 , MaxScope= 2, MaxStack= 5, CodeLength= 42
+                       HTTPUtils.loadSWF(EventSequence.bind(function(hug1:*):void{     //MethodID:113, LocalCount= 2 , MaxScope= 0, MaxStack= 3, CodeLength= 67
+                               if(!hug1) throw new Error("NicoPlayer._loadThumbControllerSWF: load failure.");
+
+                               nicoViewController = INicoViewController(hug1);
+
+                               if(!nicoViewController) throw new Error("NicoPlayer._loadThumbControllerSWF: content is not INicoViewController.");
+                               nicoViewController.startInit(nicoViewControllerClient);
+                               EventSequence.current.next();
+                       }), this.configure.THUMBPLAYER_CONTROLLER_URL, {t:this.playerVersion.thumbplayerController});
+               }
+
+               private function _loadThumbVideoInfo():void
+               {       //MethodID:116, LocalCount= 2 , MaxScope= 2, MaxStack= 6, CodeLength= 148
+                       internal var apiParams:Object;                                  //slotID:1
+
+                       apiParams = {};
+                       apiParams["as3"] = "1";
+                       apiParams["v"] = this.flashVars.watchID;
+                       apiParams["k"] = this.flashVars.thumbFlashVars.thumbPlayKey;
+
+                       if(this.flashVars.forceLowMode) apiParams["lo"] = "1";
+
+                       if(this.flashVars.economyMode) apiParams["eco"] = this.flashVars.economyMode;
+
+                       this.getFLV = new GetFLV(this.configure.THUMBWATCH_URL, apiParams, EventSequence.bind(function(hug1:Boolean):void{      //MethodID:115, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 41
+                               nicoViewControllerClient.getFLVData = getFLV;
+                               initializeInfo = InitializeInfo.getInstance();
+                               nicoViewControllerClient.initializeInfo = initializeInfo;
+
+                               EventSequence.current.next();
+                       }));
+               }
+
+               private function _initializeModelAndViewThumbWatch():void
+               {       //MethodID:119, LocalCount= 2 , MaxScope= 2, MaxStack= 7, CodeLength= 118
+                       if(this.flashVars.thumbFlashVars.thumbComment){
+                               this.commentRouter = new CommentRouter(this.flashVars, this.playerConfig, null, this.nicosClient, this.initializeInfo.isPremium);
+
+                               this.commentRouter.onCommentPostErorr.add(function(hug1:String):void{   //MethodID:117, LocalCount= 3 , MaxScope= 0, MaxStack= 3, CodeLength= 346
+                                       var hug2:String = hug1;
+
+                                       switch(hug2){
+                                       case CommentRouter.ERROR_POST_184:
+                                               systemMessage.informComment(__MSG__("チャンネルとコミュニティ動画では184コマンドを使用できません。"));
+                                               break;
+                                       case CommentRouter.ERROR_POST_BUTTON_ARGUMENTS:
+                                       case CommentRouter.ERROR_POST_BUTTON_ONCE:
+                                       case CommentRouter.ERROR_POST_BUTTON_PREMIUM_ONLY:
+                                       case CommentRouter.ERROR_POST_BUTTON_DISABLED:
+                                               systemMessage.informComment(__MSG__("@ボタンは、使用できません。"));
+                                               break;
+                                       case CommentRouter.ERROR_POST_AT_COMMENT_UNDEFINED:
+                                               systemMessage.informComment(__MSG__("その@コメントは存在しないか、投稿者以外は使えないかのどちらかです。"));
+                                               break;
+                                       case CommentRouter.ERROR_POST_INITIALIZE:
+                                               systemMessage.informComment(__MSG__("コメント投稿の準備が未完了です。"));
+                                               break;
+                                       case CommentRouter.ERROR_POST_SAME_COMMENT:
+                                               systemMessage.informComment(__MSG__("同じコメントを連続で投稿することができません。"));
+                                               break;
+                                       case CommentRouter.ERROR_POST_CHANNEL_FILTER:
+                                               systemMessage.informComment(__MSG__("入力されたコメントはチャンネルにより規制されています。"));
+                                               break;
+                                       default:
+                                               break;
+                                       }
+                               });
+                               this.commentRouter.onCommentHavingMacro.add(function(hug1:IMacroParserResult):void{     //MethodID:118, LocalCount= 2 , MaxScope= 0, MaxStack= 2, CodeLength= 22
+                                       if(hug1.macroName == "ピザ") systemMessage.informComment("@ピザは、使用できません。");
+                               });
+
+                               if(this.nicosClient) this.nicosClient.commentRouter = this.commentRouter;
+
+                               this.nicoViewControllerClient.commentRouter = this.commentRouter;
+                       }
+
+                       EventSequence.current.next();
+               }
+       }
+}
+
+//■script002■
+
+package{
+
+       import jp.nicovideo.nicoplayer.NicoPlayer
+
+       //■class(instance)_index:2
+       public class nicoplayer extends NicoPlayer
+       {
+               //static constructor
+               public static function nicoplayer$cinit()
+               {       //MethodID:121, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 3
+               }
+
+               //constructor
+               public function nicoplayer()
+               {       //MethodID:122, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 6
+                       super();
+               }
+       }
+}
+
+//■script003■
+
+package jp.nicovideo.ext.config{
+
+       //■class(instance)_index:3
+       public interface IThumbConfig
+       {
+               //static constructor
+               public static function IThumbConfig$cinit()
+               {       //MethodID:124, LocalCount= 1 , MaxScope= 0, MaxStack= 0, CodeLength= 1
+               }
+
+               //variables/etc.
+               function get nicovideoURL():String;                                         //MethodID:125, dispID:0
+
+               function get playerURL():String;                                            //MethodID:126, dispID:0
+
+               //constructor
+               public function IThumbConfig();                                             //MethodID:127, dispID:0
+       }
+}
+
+//■script004■
+
+package jp.nicovideo.nicoplayer.models.flashvars{
+
+       //■class(instance)_index:4
+       public class NicoFlashVars extends Object
+       {
+               //static constructor
+               public static function NicoFlashVars$cinit()
+               {       //MethodID:129, LocalCount= 1 , MaxScope= 1, MaxStack= 2, CodeLength= 27
+                       LEAF_NO_LOCK = 0;
+                       LEAF_HIDDEN_MENU = 1;
+                       LEAF_DISABLE = 2;
+               }
+
+               //static variables/etc.
+               public static const LEAF_NO_LOCK:uint = 0;                      //slotID:1
+               public static const LEAF_HIDDEN_MENU:uint = 1;                  //slotID:2
+               public static const LEAF_DISABLE:uint = 2;                      //slotID:3
+
+               //variables/etc.
+               private var _watchFlashVars:WatchFlashVars;                     //slotID:0
+               private var _thumbFlashVars:ThumbFlashVars;                     //slotID:0
+               private var _watchID:String;                                    //slotID:0
+               private var _originalVideoID:String;                            //slotID:0
+               private var _mylistCount:uint;                                  //slotID:0
+               private var _videoType:String;                                  //slotID:0
+               private var _videoTitle:String = "";                            //slotID:0
+               private var _videoDescription:String = "";                      //slotID:0
+               private var _isMymemory:Boolean;                                //slotID:0
+               private var _waitsSWFVideoInit:Boolean;                         //slotID:0
+               private var _forceLowMode:Boolean;                              //slotID:0
+               private var _economyMode:String;                                //slotID:0
+               private var _playerVersionUpdated:String;                       //slotID:0
+               private var _playerInfoUpdated:String;                          //slotID:0
+               private var _isCommunityVideo:Boolean;                          //slotID:0
+               private var _isCommunityThread:Boolean;                         //slotID:0
+               private var _hasOwnerThread:Boolean;                            //slotID:0
+               private var _isDeepenedCommentForce:Boolean;                    //slotID:0
+               private var _isChannel:Boolean;                                 //slotID:0
+               private var _isNoComment:Boolean;                               //slotID:0
+               private var _importedBGMVideos:Array;                           //slotID:0
+               private var _category:String;                                   //slotID:0
+               private var _categoryGroup:String;                              //slotID:0
+               private var _communityID:String;                                //slotID:0
+               private var _communityGlobalID:String;                          //slotID:0
+               private var _isNoCommand:Boolean;                               //slotID:0
+               private var _isNoAtComment:Boolean;                             //slotID:0
+               private var _isWide:Boolean;                                    //slotID:0
+               private var _countryCode:String;                                //slotID:0
+               private var _videoDetail:Object;                                //slotID:0
+               private var _leafSwitch:uint = 0;                               //slotID:0
+               private var _noRelation:Boolean;                                //slotID:0
+               private var _noRelatedVideo:Boolean;                            //slotID:0
+
+               public function get watchID():String
+               {       //MethodID:130, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._watchID;
+               }
+
+               internal function set watchID(hug1:String):void
+               {       //MethodID:131, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._watchID = hug1;
+               }
+
+               public function get originalVideoID():String
+               {       //MethodID:132, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._originalVideoID;
+               }
+
+               internal function set originalVideoID(hug1:String):void
+               {       //MethodID:133, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._originalVideoID = hug1;
+               }
+
+               public function get mylistCount():uint
+               {       //MethodID:134, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._mylistCount;
+               }
+
+               internal function set mylistCount(hug1:uint):void
+               {       //MethodID:135, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._mylistCount = hug1;
+               }
+
+               public function get videoType():String
+               {       //MethodID:136, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._videoType;
+               }
+
+               internal function set videoType(hug1:String):void
+               {       //MethodID:137, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._videoType = hug1;
+               }
+
+               public function get videoTitle():String
+               {       //MethodID:138, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._videoTitle;
+               }
+
+               internal function set videoTitle(hug1:String):void
+               {       //MethodID:139, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._videoTitle = hug1;
+               }
+
+               public function get videoDescription():String
+               {       //MethodID:140, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._videoDescription;
+               }
+
+               internal function set videoDescription(hug1:String):void
+               {       //MethodID:141, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._videoDescription = hug1;
+               }
+
+               public function get isMymemory():Boolean
+               {       //MethodID:142, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isMymemory;
+               }
+
+               internal function set isMymemory(hug1:Boolean):void
+               {       //MethodID:143, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isMymemory = hug1;
+               }
+
+               public function get waitsSWFVideoInit():Boolean
+               {       //MethodID:144, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._waitsSWFVideoInit;
+               }
+
+               internal function set waitsSWFVideoInit(hug1:Boolean):void
+               {       //MethodID:145, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._waitsSWFVideoInit = hug1;
+               }
+
+               public function get forceLowMode():Boolean
+               {       //MethodID:146, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._forceLowMode;
+               }
+
+               internal function set forceLowMode(hug1:Boolean):void
+               {       //MethodID:147, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._forceLowMode = hug1;
+               }
+
+               public function get economyMode():String
+               {       //MethodID:148, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._economyMode;
+               }
+
+               internal function set economyMode(hug1:String):void
+               {       //MethodID:149, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._economyMode = hug1;
+               }
+
+               public function get playerVersionUpdated():String
+               {       //MethodID:150, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._playerVersionUpdated;
+               }
+
+               internal function set playerVersionUpdated(hug1:String):void
+               {       //MethodID:151, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._playerVersionUpdated = hug1;
+               }
+
+               public function get playerInfoUpdated():String
+               {       //MethodID:152, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._playerInfoUpdated;
+               }
+
+               internal function set playerInfoUpdated(hug1:String):void
+               {       //MethodID:153, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._playerInfoUpdated = hug1;
+               }
+
+               public function get isCommunityVideo():Boolean
+               {       //MethodID:154, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isCommunityVideo;
+               }
+
+               internal function set isCommunityVideo(hug1:Boolean):void
+               {       //MethodID:155, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isCommunityVideo = hug1;
+               }
+
+               public function get isCommunityThread():Boolean
+               {       //MethodID:156, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isCommunityThread;
+               }
+
+               internal function set isCommunityThread(hug1:Boolean):void
+               {       //MethodID:157, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isCommunityThread = hug1;
+               }
+
+               public function get hasOwnerThread():Boolean
+               {       //MethodID:158, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._hasOwnerThread;
+               }
+
+               internal function set hasOwnerThread(hug1:Boolean):void
+               {       //MethodID:159, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._hasOwnerThread = hug1;
+               }
+
+               public function get isDeepenedCommentForce():Boolean
+               {       //MethodID:160, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isDeepenedCommentForce;
+               }
+
+               internal function set isDeepenedCommentForce(hug1:Boolean):void
+               {       //MethodID:161, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isDeepenedCommentForce = hug1;
+               }
+
+               public function get importedBGMVideos():Array
+               {       //MethodID:162, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._importedBGMVideos;
+               }
+
+               internal function set importedBGMVideos(hug1:Array):void
+               {       //MethodID:163, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._importedBGMVideos = hug1;
+               }
+
+               public function get isChannel():Boolean
+               {       //MethodID:164, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isChannel;
+               }
+
+               internal function set isChannel(hug1:Boolean):void
+               {       //MethodID:165, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isChannel = hug1;
+               }
+
+               public function get isNoComment():Boolean
+               {       //MethodID:166, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isNoComment;
+               }
+
+               internal function set isNoComment(hug1:Boolean):void
+               {       //MethodID:167, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isNoComment = hug1;
+               }
+
+               public function get category():String
+               {       //MethodID:168, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._category;
+               }
+
+               internal function set category(hug1:String):void
+               {       //MethodID:169, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._category = hug1;
+               }
+
+               public function get categoryGroup():String
+               {       //MethodID:170, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._categoryGroup;
+               }
+
+               internal function set categoryGroup(hug1:String):void
+               {       //MethodID:171, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._categoryGroup = hug1;
+               }
+
+               public function get watchFlashVars():WatchFlashVars
+               {       //MethodID:172, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._watchFlashVars;
+               }
+
+               internal function set watchFlashVars(hug1:WatchFlashVars):void
+               {       //MethodID:173, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._watchFlashVars = hug1;
+               }
+
+               public function get thumbFlashVars():ThumbFlashVars
+               {       //MethodID:174, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._thumbFlashVars;
+               }
+
+               internal function set thumbFlashVars(hug1:ThumbFlashVars):void
+               {       //MethodID:175, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._thumbFlashVars = hug1;
+               }
+
+               public function get communityID():String
+               {       //MethodID:176, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._communityID;
+               }
+
+               internal function set communityID(hug1:String):void
+               {       //MethodID:177, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._communityID = hug1;
+               }
+
+               public function get communityGlobalID():String
+               {       //MethodID:178, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._communityGlobalID;
+               }
+
+               internal function set communityGlobalID(hug1:String):void
+               {       //MethodID:179, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._communityGlobalID = hug1;
+               }
+
+               public function get isNoCommand():Boolean
+               {       //MethodID:180, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isNoCommand;
+               }
+
+               internal function set isNoCommand(hug1:Boolean):void
+               {       //MethodID:181, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isNoCommand = hug1;
+               }
+
+               public function get isNoAtComment():Boolean
+               {       //MethodID:182, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isNoAtComment;
+               }
+
+               internal function set isNoAtComment(hug1:Boolean):void
+               {       //MethodID:183, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isNoAtComment = hug1;
+               }
+
+               public function get isWide():Boolean
+               {       //MethodID:184, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._isWide;
+               }
+
+               internal function set isWide(hug1:Boolean):void
+               {       //MethodID:185, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._isWide = hug1;
+               }
+
+               public function get countryCode():String
+               {       //MethodID:186, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._countryCode;
+               }
+
+               internal function set countryCode(hug1:String):void
+               {       //MethodID:187, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._countryCode = hug1;
+               }
+
+               public function get videoDetail():Object
+               {       //MethodID:188, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._videoDetail;
+               }
+
+               internal function set videoDetail(hug1:Object):void
+               {       //MethodID:189, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._videoDetail = hug1;
+               }
+
+               public function get leafSwitch():uint
+               {       //MethodID:190, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._leafSwitch;
+               }
+
+               internal function set leafSwitch(hug1:uint):void
+               {       //MethodID:191, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._leafSwitch = hug1;
+               }
+
+               public function get forceRelationInvisible():Boolean
+               {       //MethodID:192, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._noRelation;
+               }
+
+               internal function set forceRelationInvisible(hug1:Boolean):void
+               {       //MethodID:193, LocalCount= 2 , MaxScope= 1, MaxStack= 2, CodeLength= 8
+                       this._noRelation = hug1;
+               }
+
+               public function get noRelatedVideo():Boolean
+               {       //MethodID:194, LocalCount= 1 , MaxScope= 1, MaxStack= 1, CodeLength= 7
+                       return this._noRelatedVideo;
+               }
+
+               internal function set noRelatedVideo(hug1:Boolean):void
+