Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /NNDDv2/trunk/src/org/mineap/nndd/view/VideoInfoView.as

Parent Directory Parent Directory | Revision Log Revision Log


Revision 605 - (hide annotations) (download)
Sat Jun 11 10:02:06 2011 UTC (12 years, 9 months ago) by mineap
File size: 55513 byte(s)
ニコ割を再生しないオプションを追加
1 mineap 370 /**
2     * VideoInfoView.as
3     *
4     * Copyright (c) 2008-2009 MAP - MineApplicationProject. All Rights Reserved.
5     *
6     * @author shiraminekeisuke
7     *
8     */
9    
10 mineap 498 import flash.display.StageQuality;
11 mineap 370 import flash.events.Event;
12     import flash.events.MouseEvent;
13     import flash.events.NativeWindowBoundsEvent;
14     import flash.events.TextEvent;
15     import flash.geom.Rectangle;
16 mineap 498 import flash.sampler.getInvocationCount;
17 mineap 370 import flash.utils.Timer;
18    
19     import mx.collections.ArrayCollection;
20     import mx.collections.Sort;
21     import mx.collections.SortField;
22     import mx.controls.Alert;
23     import mx.controls.CheckBox;
24     import mx.controls.DataGrid;
25     import mx.controls.HSlider;
26     import mx.controls.RadioButton;
27     import mx.core.Application;
28     import mx.core.DragSource;
29 mineap 498 import mx.core.FlexGlobals;
30 mineap 526 import mx.core.Window;
31 mineap 370 import mx.events.AIREvent;
32     import mx.events.CloseEvent;
33     import mx.events.DataGridEvent;
34     import mx.events.DragEvent;
35     import mx.events.FlexEvent;
36     import mx.events.ListEvent;
37 mineap 507 import mx.events.NumericStepperEvent;
38 mineap 370 import mx.events.SliderEvent;
39    
40 mineap 439 import org.mineap.nicovideo4as.model.SearchType;
41 mineap 370 import org.mineap.nndd.LogManager;
42     import org.mineap.nndd.Message;
43     import org.mineap.nndd.model.NNDDVideo;
44     import org.mineap.nndd.model.PlayList;
45     import org.mineap.nndd.model.SearchItem;
46     import org.mineap.nndd.model.SearchSortString;
47     import org.mineap.nndd.playList.PlayListManager;
48     import org.mineap.nndd.player.PlayerController;
49     import org.mineap.nndd.util.PathMaker;
50     import org.mineap.util.config.ConfUtil;
51     import org.mineap.util.config.ConfigManager;
52 mineap 526 import org.mineap.util.font.FontUtil;
53 mineap 370
54     private var videoPlayer:VideoPlayer;
55     private var playerController:PlayerController;
56     private var logManager:LogManager;
57    
58     public var isPlayListRepeat:Boolean = false;
59     public var isSyncComment:Boolean = true;
60     public var isPlayerFollow:Boolean = true;
61     public var isRenewCommentEachPlay:Boolean = false;
62     public var isRenewOtherCommentWithCommentEachPlay:Boolean = false;
63     public var isResizePlayerEachPlay:Boolean = true;
64     public var isHideUnderController:Boolean = false;
65     public var commentScale:Number = 1.0;
66     public var fps:Number = 15;
67     public var isShowOnlyPermissionComment:Boolean = false;
68 mineap 507 public var showCommentCountPerMin:int = 50;
69     public var showOwnerCommentCountPerMin:int = 50;
70 mineap 370 public var showCommentSec:int = 3;
71     public var isAntiAlias:Boolean = true;
72     public var commentAlpha:int = 100;
73     public var isEnableJump:Boolean = true;
74     public var isAskToUserOnJump:Boolean = true;
75     public var isInfoViewAlwaysFront:Boolean = false;
76     public var isCommentFontBold:Boolean = true;
77     public var isShowAlwaysNicowariArea:Boolean = false;
78     public var selectedResizeType:int = RESIZE_TYPE_NICO;
79     public var isAlwaysEconomyForStreaming:Boolean = false;
80     public var isHideTagArea:Boolean = false;
81     public var isAppendComment:Boolean = false;
82     public var isHideSekaShinComment:Boolean = false;
83     public var isShowHTMLOwnerComment:Boolean = true;
84     public var isEnableWideMode:Boolean = true;
85     public var relationSortIndex:int = 0;
86     public var relationOrderIndex:int = 0;
87     public var isNgUpEnable:Boolean = true;
88 mineap 487 public var isSmoothing:Boolean = true;
89 mineap 529 public var isSmoothingOnlyNotPixelIdenticalDimensions:Boolean = true;
90 mineap 498 public var playerQuality:int = 2;
91 mineap 526 public var isFollowInfoViewHeight:Boolean = false;
92 mineap 605 public var isNotPlayNicowari:Boolean = false;
93 mineap 370
94     public static const RESIZE_TYPE_NICO:int = 1;
95     public static const RESIZE_TYPE_VIDEO:int = 2;
96    
97     public var videoUrlMap:Object = new Object();
98    
99     public var myListMap:Object = new Object();
100    
101     private var lastRect:Rectangle = new Rectangle();
102    
103     private var seekTimer:Timer;
104     private var seekValue:Number = 0;
105    
106     public var isActive:Boolean = false;
107    
108     public var playListName:String = "";
109    
110     [Bindable]
111     public var commentListProvider:ArrayCollection = new ArrayCollection();
112     [Bindable]
113     public var ownerCommentProvider:ArrayCollection = new ArrayCollection();
114     [Bindable]
115     private var playListProvider:ArrayCollection = new ArrayCollection();
116     [Bindable]
117     public var localTagProvider:Array = new Array();
118     [Bindable]
119     public var nicoTagProvider:Array = new Array();
120     [Bindable]
121     public var ichibaLocalProvider:ArrayCollection = new ArrayCollection();
122     [Bindable]
123     public var ichibaNicoProvider:ArrayCollection = new ArrayCollection();
124     [Bindable]
125     public var ngListProvider:ArrayCollection = new ArrayCollection();
126     [Bindable]
127     public var owner_text_nico:String = "";
128     [Bindable]
129     public var owner_text_local:String = "";
130     [Bindable]
131     private var myListDataProvider:Array = new Array();
132     [Bindable]
133     public var savedCommentListProvider:Array = new Array();
134     [Bindable]
135     public var owner_text_temp:String = "";
136     [Bindable]
137     public var relationDataProvider:ArrayCollection = new ArrayCollection();
138     [Bindable]
139     public var relationSortComboboxDataProvider:Array = new Array("���������������", "���������������", "���������", "���������");
140     [Bindable]
141     public var relationOrderComboboxDataProvider:Array = new Array("������", "������");
142     [Bindable]
143     private var label_playListTitle_dataProvider:String = "";
144 mineap 484 [Bindable]
145     public var videoType:String = "";
146     [Bindable]
147     public var connectionType:String = "";
148     [Bindable]
149     public var videoServerUrl:String = "";
150     [Bindable]
151     public var messageServerUrl:String = "";
152 mineap 490 [Bindable]
153     public var economyMode:String = "";
154     [Bindable]
155     public var nickName:String = "";
156     [Bindable]
157     public var isPremium:String = "";
158     [Bindable]
159     public var pubUserNameIconUrl:String = "";
160     [Bindalbe]
161     public var pubUserName:String = "";
162     [Bindalbe]
163     public var pubUserLinkButtonText:String = "";
164 mineap 370
165     public function init(playerController:PlayerController, videoPlayer:VideoPlayer, logManager:LogManager):void{
166     this.videoPlayer = videoPlayer;
167     this.playerController = playerController;
168     this.logManager = logManager;
169    
170     this.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
171     stage.addEventListener(AIREvent.WINDOW_ACTIVATE, function(event:AIREvent):void{
172     isActive = true;
173     });
174     stage.addEventListener(AIREvent.WINDOW_DEACTIVATE, function(event:AIREvent):void{
175     isActive = false;
176     });
177    
178     });
179    
180     readStore();
181     }
182    
183     public function resetInfo():void{
184     localTagProvider = new Array();
185     nicoTagProvider = new Array();
186     ichibaLocalProvider = new ArrayCollection();
187     ichibaNicoProvider = new ArrayCollection();
188    
189     owner_text_local = "";
190     owner_text_nico = "";
191     owner_text_temp = "";
192     }
193    
194     private function windowClosing(event:Event):void{
195    
196     event.preventDefault();
197    
198     // if(this.videoPlayer != null && !this.videoPlayer.closed){
199     // this.videoPlayer.close();
200     // }
201     //
202     // this.playerController.destructor();
203    
204     this.visible = false;
205    
206     }
207    
208     private function play():void{
209     this.playerController.play();
210     }
211    
212     private function stop():void{
213     this.playerController.stop();
214     }
215    
216     private function checkBoxAppendCommentChanged(event:Event):void{
217     this.isAppendComment = event.target.selected;
218 mineap 529 FlexGlobals.topLevelApplication.setAppendComment(this.isAppendComment);
219 mineap 370 }
220    
221     public function setAppendComment(boolean:Boolean):void{
222     this.isAppendComment = boolean;
223     if(checkBox_isAppendComment != null){
224     checkBox_isAppendComment.selected = boolean;
225     }
226     }
227    
228     public function relationItemDoubleClickHandler(event:ListEvent):void{
229     if(relationDataProvider.length > event.rowIndex){
230     var url:String = relationDataProvider[event.rowIndex].col_link;
231     if(url != null && url.length > 0){
232     var videoId:String = PathMaker.getVideoID(url);
233     if(videoId != null){
234     playerController.playMovie(url);
235     }
236     }
237     }
238     }
239    
240     public function checkBoxNgUpChanged(event:Event):void{
241     this.isNgUpEnable = checkBox_isNgUpEnable.selected;
242     if(this.playerController != null){
243     this.playerController.reloadLocalComment();
244     }
245     }
246    
247 mineap 487 public function checkBoxSmoothingChanged(event:Event):void{
248     this.isSmoothing = checkBox_isSmoothing.selected;
249 mineap 529 checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.enabled = this.isSmoothing;
250 mineap 487 if(this.playerController != null){
251     this.playerController.setVideoSmoothing(this.isSmoothing);
252     }
253     }
254    
255 mineap 529 public function checkBoxSmoothingOnlyNotPixelIdenticalDimensionsChanged(event:Event):void
256     {
257     this.isSmoothingOnlyNotPixelIdenticalDimensions = checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.selected;
258     if (this.playerController != null)
259     {
260     this.playerController.setVideoSmoothing(this.isSmoothing);
261     }
262     }
263    
264 mineap 370 private function checkBoxPlayerAlwaysFrontChanged(event:Event):void{
265     this.videoPlayer.isAlwaysFront = (event.currentTarget as CheckBox).selected;
266     this.videoPlayer.alwaysInFront = (event.currentTarget as CheckBox).selected;
267     }
268    
269     private function checkBoxInfoViewAlwaysFrontChanged(event:Event):void{
270     this.isInfoViewAlwaysFront = (event.currentTarget as CheckBox).selected;
271     this.alwaysInFront = (event.currentTarget as CheckBox).selected;
272     }
273    
274     private function checkBoxCommentFontBoldChanged(event:Event):void{
275     this.isCommentFontBold = this.checkBox_commentBold.selected;
276     playerController.setCommentFontBold(this.isCommentFontBold);
277     }
278    
279     private function checkboxSyncCommentChanged():void{
280     this.isSyncComment = this.checkbox_SyncComment.selected;
281     this.commentListProvider.sort = new Sort();
282     this.commentListProvider.sort.fields = [new SortField("vpos_column",true)];
283     this.commentListProvider.refresh();
284     }
285    
286     private function checkboxRepeatAllChanged():void{
287     this.isPlayListRepeat = this.checkBox_repeatAll.selected;
288     if(isPlayListRepeat){
289     videoPlayer.setIsRepeat(false);
290     }
291     }
292    
293     private function checkboxPlayerFollowChanged(event:Event):void{
294     this.isPlayerFollow = this.checkbox_playerFollow.selected;
295     if((event.currentTarget as CheckBox).selected){
296     this.videoPlayer.followInfoView(this.videoPlayer.lastRect);
297     }
298     }
299    
300 mineap 526 private function checkboxFollowInfoViewHeight(event:Event):void
301     {
302     this.isFollowInfoViewHeight = this.checkbox_followInfoViewHeight.selected;
303     if ((event.currentTarget as CheckBox).selected)
304     {
305     this.videoPlayer.resizeInfoView();
306     }
307     }
308    
309 mineap 370 private function checkboxHideUnderControllerChanged(event:Event):void{
310     this.isHideUnderController = this.checkbox_hideUnderController.selected;
311     if(this.videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){
312     if((event.currentTarget as CheckBox).selected){
313     //������������������������������
314     this.videoPlayer.showUnderController(false, true);
315     }else{
316     //������������������������������
317     this.videoPlayer.showUnderController(true, true);
318     }
319     }
320     this.videoPlayer.videoController.resetAlpha(true);
321     }
322    
323     private function checkboxHideTagAreaChanged(event:Event):void{
324     this.isHideTagArea = this.checkbox_hideTagArea.selected;
325     if(this.videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){
326     if((event.currentTarget as CheckBox).selected){
327     //���������������������������
328     this.videoPlayer.showTagArea(false, true);
329     }else{
330     //������������������������������������
331     this.videoPlayer.showTagArea(true, true);
332     }
333     }
334     this.videoPlayer.videoController.resetAlpha(true);
335     }
336    
337     public function changeWideMode():void{
338     if(isResizePlayerEachPlay){
339     if(this.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO){
340     isEnableWideMode = !isEnableWideMode;
341     if(checkbox_enableWideMode != null){
342     checkbox_enableWideMode.selected = isEnableWideMode;
343     }
344     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
345     }
346     }
347     }
348    
349     private function checkboxResizePlayerEachPlay(event:Event):void{
350     this.isResizePlayerEachPlay = this.checkbox_resizePlayerEachPlay.selected;
351     radioGroup_resizeType.selectedValue = selectedResizeType;
352     if(this.isResizePlayerEachPlay){
353     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
354     this.radioButton_resizeNicoDou.enabled = true;
355     this.radioButton_resizeVideo.enabled = true;
356     if(this.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO){
357     this.checkbox_enableWideMode.enabled = true;
358     }else{
359     this.checkbox_enableWideMode.enabled = false;
360     }
361     }else{
362     this.videoPlayer.nowRatio = -1;
363     this.radioButton_resizeNicoDou.enabled = false;
364     this.radioButton_resizeVideo.enabled = false;
365     this.checkbox_enableWideMode.enabled = false;
366     }
367    
368     }
369    
370     private function checkBoxAlwaysEconomyChanged(event:Event):void{
371     isAlwaysEconomyForStreaming = this.checkBox_isAlwaysEconomyForStreaming.selected;
372     }
373    
374    
375     private function checkBoxShowAlwaysNicowariAreaChanged(event:Event):void{
376     isShowAlwaysNicowariArea = this.checkBox_showAlwaysNicowariArea.selected;
377     videoPlayer.setShowAlwaysNicowariArea(isShowAlwaysNicowariArea);
378     }
379    
380 mineap 605 private function checkBoxIsNotPlayNicowariChanged(event:Event):void
381     {
382     this.isNotPlayNicowari = this.checkBox_isNotPlayNicowari.selected;
383    
384     if (isNotPlayNicowari)
385     {
386     playerController.stopNicowari();
387     videoPlayer.hideNicowariArea();
388     }
389     else if (isShowAlwaysNicowariArea)
390     {
391     videoPlayer.showNicowariArea();
392     }
393     }
394    
395 mineap 370 public function setShowAlwaysNicowariArea(isShow:Boolean):void{
396     if(this.checkBox_showAlwaysNicowariArea != null){
397     this.checkBox_showAlwaysNicowariArea.selected = isShow;
398     }
399     isShowAlwaysNicowariArea = isShow;
400     }
401    
402     private function checkBoxRenewCommentChanged():void{
403     isRenewCommentEachPlay = checkBox_renewComment.selected;
404     checkBox_renewTagAndNicowari.enabled = isRenewCommentEachPlay;
405     checkBox_isAppendComment.enabled = isRenewCommentEachPlay;
406     }
407    
408     private function checkBoxCommentBoldChanged(event:Event):void{
409     this.isCommentFontBold = checkBox_commentBold.selected;
410     playerController.setCommentFontBold(this.isCommentFontBold);
411     }
412    
413     public function setRelationComboboxEnable(enabled:Boolean):void{
414     if(combobox_relationSort != null){
415     (combobox_relationSort as ComboBox).enabled = enabled;
416     }
417     if(combobox_relationOrder != null){
418     (combobox_relationOrder as ComboBox).enabled = enabled;
419     }
420     }
421    
422     private function thumbPress(event:SliderEvent):void{
423     this.playerController.sliderChanging = true;
424     }
425    
426     private function thumbRelease(event:SliderEvent):void{
427     this.playerController.sliderChanging = false;
428     this.playerController.seek(event.value);
429     }
430    
431     private function sliderVolumeChanged(evt:SliderEvent):void{
432     this.playerController.setVolume(evt.value);
433     }
434    
435     private function sliderFpsChanged(event:SliderEvent):void{
436     this.fps = getFps(event.value);
437     this.playerController.changeFps(this.fps);
438     }
439    
440 mineap 507
441     private function commentCountNumStepperChanged(event:NumericStepperEvent):void
442     {
443     this.showCommentCountPerMin = event.value;
444 mineap 370 }
445    
446 mineap 507 private function ownerCommentCountNumStepperChanged(event:NumericStepperEvent):void
447     {
448     this.showOwnerCommentCountPerMin = event.value;
449     }
450    
451 mineap 370 private function addNGListIdButtonClicked():void{
452     var index:int = -1;
453     if(tabNavigator_comment.selectedIndex == 0){
454     index = this.dataGrid_comment.selectedIndex;
455     }else if(tabNavigator_comment.selectedIndex == 1){
456     index = this.dataGrid_oldComment.selectedIndex;
457     }
458     if(index > -1){
459     this.playerController.ngListManager.addNgID(commentListProvider.getItemAt(index).user_id_column);
460     }
461     }
462    
463     private function addNGListWordButtonClicked():void{
464     var index:int = -1;
465     if(tabNavigator_comment.selectedIndex == 0){
466     index = this.dataGrid_comment.selectedIndex;
467     }else if(tabNavigator_comment.selectedIndex == 1){
468     index = this.dataGrid_oldComment.selectedIndex;
469     }
470     if(index > -1){
471     this.playerController.ngListManager.addNgWord(commentListProvider.getItemAt(index).comment_column);
472     }
473     }
474    
475     private function addPermissionIdButtonClicked():void{
476     var index:int = -1;
477     if(tabNavigator_comment.selectedIndex == 0){
478     index = this.dataGrid_comment.selectedIndex;
479     }else if(tabNavigator_comment.selectedIndex == 1){
480     index = this.dataGrid_oldComment.selectedIndex;
481     }
482     if(index > -1){
483     this.playerController.ngListManager.addPermissionId(commentListProvider.getItemAt(index).user_id_column);
484     }
485     }
486    
487     private function headerReleaseHandler(event:DataGridEvent):void{
488     if(event.columnIndex == 1){
489     this.isSyncComment = false;
490     this.checkbox_SyncComment.selected = false;
491     }
492     }
493    
494     /**
495     * TextInput������������������������ID���NG���������������������������
496     *
497     */
498     private function addItemToNgList():void{
499     playerController.ngListManager.addItemToNgList(textInput_ng.text, combobox_ngKind.selectedLabel);
500     }
501    
502     private function ngListItemClicked(event:ListEvent):void{
503     playerController.ngListManager.ngListItemClicked(event);
504     }
505    
506     /**
507     * ���������������������NG���������NG������������������������������������
508     *
509     */
510     private function removeItemFromNgList():void{
511     playerController.ngListManager.removeItemFromNgList();
512     }
513    
514     private function ngTextInputEnter(event:FlexEvent):void{
515     playerController.ngListManager.addItemToNgList(textInput_ng.text, combobox_ngKind.selectedLabel);
516     }
517    
518     private function fpsDataTipFormatFunction(value:Number):String{
519     return new String(getFps(value));
520     }
521    
522     private function getFps(value:Number):Number{
523     switch(value){
524     case 1:
525     return 7.5;
526     case 2:
527     return 15;
528     case 3:
529     return 30;
530     case 4:
531     return 60;
532     case 5:
533     return 120;
534     default:
535     return 15;
536     }
537     }
538    
539     private function getValueByFps(fps:Number):int{
540     switch(fps){
541     case 7.5:
542     return 1;
543     case 15:
544     return 2;
545     case 30:
546     return 3;
547     case 60:
548     return 4;
549     case 120:
550     return 5;
551     default:
552     return 2;
553     }
554     }
555    
556     private function keyListener(event:KeyboardEvent):void{
557     if(event.keyCode == Keyboard.ESCAPE){
558     }else if(event.keyCode == Keyboard.F11 || (event.keyCode == Keyboard.F && (event.controlKey || event.commandKey))){
559     // trace("Ctrl + " + event.keyCode);
560     this.videoPlayer.changeFull();
561     }else if(event.keyCode == Keyboard.C){
562     // trace(event.keyCode);
563     this.stage.nativeWindow.activate();
564     }else if(event.keyCode == Keyboard.SPACE){
565     this.playerController.play();
566     }else if(event.keyCode == Keyboard.LEFT){
567     //���
568     if(seekTimer != null){
569     seekTimer.stop();
570     }
571     seekTimer = new Timer(100, 1);
572     seekTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:Event):void{
573     var newValue:Number = videoPlayer.videoController.slider_timeline.value + seekValue;
574     if(newValue <= (videoPlayer.videoController.slider_timeline as HSlider).minimum){
575     newValue = 0;
576     }else if(newValue >= (videoPlayer.videoController.slider_timeline as HSlider).maximum){
577     newValue = (videoPlayer.videoController.slider_timeline as HSlider).maximum;
578     }
579     trace(newValue +" = "+videoPlayer.videoController.slider_timeline.value +"+"+ seekValue);
580     playerController.seek(newValue);
581     seekValue = 0;
582     });
583     seekTimer.start();
584     this.seekValue -= 10;
585     }else if(event.keyCode == Keyboard.RIGHT){
586     //���
587     if(seekTimer != null){
588     seekTimer.stop();
589     }
590     seekTimer = new Timer(100, 1);
591     seekTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:Event):void{
592     var newValue:Number = videoPlayer.videoController.slider_timeline.value + seekValue;
593     if(newValue <= (videoPlayer.videoController.slider_timeline as HSlider).minimum){
594     newValue = 0;
595     }else if(newValue >= (videoPlayer.videoController.slider_timeline as HSlider).maximum){
596     newValue = (videoPlayer.videoController.slider_timeline as HSlider).maximum;
597     }
598     trace(newValue +" = "+videoPlayer.videoController.slider_timeline.value +"+"+ seekValue);
599     playerController.seek(newValue);
600     seekValue = 0;
601     });
602     seekTimer.start();
603     this.seekValue += 10;
604     }else if(event.keyCode == Keyboard.UP){
605     this.playerController.setVolume(this.videoPlayer.videoController.slider_volume.value + 0.05);
606     }else if(event.keyCode == Keyboard.DOWN){
607     this.playerController.setVolume(this.videoPlayer.videoController.slider_volume.value - 0.05);
608     }
609     }
610    
611     private function radioButtonResizeTypeChanged(event:Event):void{
612     this.selectedResizeType = int(RadioButton(event.currentTarget).value);
613    
614     if(this.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO){
615     this.checkbox_enableWideMode.enabled = true;
616     }else{
617     this.checkbox_enableWideMode.enabled = false;
618     }
619    
620     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
621     }
622    
623     private function checkboxEnableWideModeChanged(event:Event):void{
624     this.isEnableWideMode = event.target.selected;
625     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
626     }
627    
628     private function checkBox_repeatAllCompleteHandler(event:FlexEvent):void{
629     checkBox_repeatAll.selected = isPlayListRepeat;
630     }
631    
632     private function checkBoxIsSOPCChanged(event:MouseEvent):void{
633     isShowOnlyPermissionComment = checkBox_isShowOnlyPermissionComment.selected;
634     if(this.playerController != null){
635     this.playerController.reloadLocalComment();
636     }
637     }
638    
639     private function checkBoxRenewTagNicowariChanged():void{
640     isRenewOtherCommentWithCommentEachPlay = checkBox_renewTagAndNicowari.selected;
641     }
642    
643     private function checkBoxIsEnableJump(event:MouseEvent):void{
644     isEnableJump = event.currentTarget.selected;
645     (checkBox_askToUserOnJump as CheckBox).enabled = isEnableJump;
646     }
647    
648     private function checkBoxIsAskToUserOnJump(event:MouseEvent):void{
649     isAskToUserOnJump = event.currentTarget.selected;
650     }
651    
652     private function checkBoxHideSekaShinComment(event:MouseEvent):void{
653     isHideSekaShinComment = event.currentTarget.selected;
654    
655     if(this.playerController != null){
656     this.playerController.reloadLocalComment();
657     }
658     }
659    
660     private function commentListDoubleClicked(event:ListEvent):void{
661     var time:String = event.target.selectedItem.vpos_column;
662    
663     var min:int = int(time.substring(0,time.indexOf(":")));
664     var sec:int = int(time.substring(time.indexOf(":")+1));
665    
666     if(playerController.windowType == PlayerController.WINDOW_TYPE_FLV){
667     this.playerController.seek(min*60 + sec);
668     }else{
669     this.playerController.seek((min*60 + sec)*playerController.swfFrameRate);
670     }
671     }
672    
673     private function ichibaDataGridDoubleClicked(event:ListEvent):void{
674     trace((event.currentTarget as DataGrid).dataProvider[event.rowIndex].col_link);
675     var url:String = (event.currentTarget as DataGrid).dataProvider[event.rowIndex].col_link;
676     if(url != null){
677     navigateToURL(new URLRequest(url));
678     }
679     }
680    
681     private function commentScaleSliderChanged(event:SliderEvent):void{
682     this.commentScale = event.value;
683     this.playerController.windowResized(true);
684     }
685    
686     private function sliderShowCommentTimeChanged(event:SliderEvent):void{
687     this.showCommentSec = event.value;
688     }
689    
690     private function sliderCommentAlphaChanged(event:SliderEvent):void{
691     this.commentAlpha = event.value;
692     playerController.getCommentManager().setCommentAlpha(this.commentAlpha/100);
693     }
694    
695     private function myDataTipFormatFunction(value:Number):String{
696     var nowSec:String="00",nowMin:String="0";
697     nowSec = String(int(value%60));
698     nowMin = String(int(value/60));
699    
700     if(nowSec.length == 1){
701     nowSec = "0" + nowSec;
702     }
703     if(nowMin.length == 1){
704     nowMin = "0" + nowMin;
705     }
706     return nowMin + ":" + nowSec;
707     }
708    
709     private function windowCompleteHandler():void{
710    
711     videoPlayer.alwaysInFront = videoPlayer.isAlwaysFront;
712     this.alwaysInFront = this.isInfoViewAlwaysFront;
713    
714     // checkbox_repeat.selected = isRepeat;
715     // checkbox_showComment.selected = isShowComment;
716     checkbox_SyncComment.selected = isSyncComment;
717     checkBox_isShowOnlyPermissionComment.selected = isShowOnlyPermissionComment;
718     checkbox_showHtml.selected = isShowHTMLOwnerComment;
719    
720     videoPlayer.setShowAlwaysNicowariArea(isShowAlwaysNicowariArea);
721     playerController.setCommentFontBold(this.isCommentFontBold);
722    
723     videoPlayer.showUnderController(!isHideUnderController, true);
724     videoPlayer.showTagArea(!isHideTagArea, true);
725    
726     this.setStyle("fontFamily", ConfigManager.getInstance().getItem("fontFamily"));
727 mineap 439 this.setStyle("fontSize", Number(ConfigManager.getInstance().getItem("fontSize")));
728 mineap 370 }
729    
730     private function relationCanvasCreationCompleteHandler(event:FlexEvent):void{
731     combobox_relationOrder.selectedIndex = relationOrderIndex;
732     combobox_relationSort.selectedIndex = relationSortIndex;
733     }
734    
735     private function relationSortComboboxChange(event:Event):void{
736     relationSortIndex = combobox_relationSort.selectedIndex;
737     playerController.setNicoRelationInfoForRelationSortTypeChange();
738     }
739    
740     private function relationOrderComboboxChange(event:Event):void{
741     relationOrderIndex = combobox_relationOrder.selectedIndex;
742     playerController.setNicoRelationInfoForRelationSortTypeChange();
743     }
744    
745 mineap 498 private function playerQualitySliderChanged(event:Event):void{
746     playerQuality = slider_playerQuality.value;
747 mineap 370
748 mineap 498 if(playerController != null){
749     playerController.setPlayerQuality(playerQuality);
750     }
751     }
752    
753     private function configCanvas1CreationCompleteHandler(event:FlexEvent):void{
754 mineap 370 checkbox_resizePlayerEachPlay.selected = isResizePlayerEachPlay;
755 mineap 498
756     radioGroup_resizeType.selectedValue = selectedResizeType;
757 mineap 370 if(isResizePlayerEachPlay){
758     radioButton_resizeNicoDou.enabled = true;
759     radioButton_resizeVideo.enabled = true;
760     }else{
761     radioButton_resizeNicoDou.enabled = false;
762     radioButton_resizeVideo.enabled = false;
763     }
764    
765 mineap 498 checkbox_enableWideMode.selected = isEnableWideMode;
766     checkBox_isSmoothing.selected = isSmoothing;
767 mineap 529 checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.enabled = isSmoothing;
768     checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.selected = isSmoothingOnlyNotPixelIdenticalDimensions;
769 mineap 370
770 mineap 498 if(playerController.getCommentManager() != null){
771     playerController.getCommentManager().setAntiAlias(isAntiAlias);
772     }
773    
774     checkBox_isAlwaysEconomyForStreaming.selected = isAlwaysEconomyForStreaming;
775    
776     slider_playerQuality.value = playerQuality;
777    
778     }
779    
780     private function configCanvas2CreationCompleteHandler(event:FlexEvent):void{
781 mineap 370 checkBox_commentBold.selected = isCommentFontBold;
782 mineap 498 checkBox_hideSekaShinComment.selected = isHideSekaShinComment;
783     checkBox_isNgUpEnable.selected = isNgUpEnable;
784 mineap 370
785     slider_commentScale.value = commentScale;
786     slider_fps.value = getValueByFps(fps);
787 mineap 507
788     commentNumStepper.value = showCommentCountPerMin;
789     ownerCommentNumStepper.value = showOwnerCommentCountPerMin;
790    
791 mineap 370 slider_showCommentTime.value = showCommentSec;
792     slider_commentAlpha.value = commentAlpha;
793    
794    
795 mineap 498 }
796    
797     private function configCanvas3CreationCompleteHandler(event:FlexEvent):void{
798     checkbox_PlayerAlwaysFront.selected = videoPlayer.isAlwaysFront;
799     checkbox_InfoViewAlwaysFront.selected = isInfoViewAlwaysFront;
800 mineap 370
801 mineap 498 checkbox_playerFollow.selected = isPlayerFollow;
802     checkBox_renewComment.selected = isRenewCommentEachPlay;
803     checkBox_renewTagAndNicowari.selected = isRenewOtherCommentWithCommentEachPlay;
804     checkBox_renewTagAndNicowari.enabled = isRenewCommentEachPlay;
805 mineap 370
806 mineap 498 isAppendComment = FlexGlobals.topLevelApplication.getAppendComment();
807 mineap 370 checkBox_isAppendComment.selected = isAppendComment;
808     checkBox_isAppendComment.enabled = isRenewCommentEachPlay;
809    
810 mineap 527 checkbox_followInfoViewHeight.selected = isFollowInfoViewHeight;
811 mineap 370
812 mineap 605 checkBox_isNotPlayNicowari.selected = isNotPlayNicowari;
813 mineap 498 checkBox_showAlwaysNicowariArea.selected = isShowAlwaysNicowariArea;
814     checkbox_hideTagArea.selected = isHideTagArea;
815     checkbox_hideUnderController.selected = isHideUnderController;
816    
817     checkBox_enableJump.selected = isEnableJump;
818     checkBox_askToUserOnJump.selected = isAskToUserOnJump;
819     checkBox_askToUserOnJump.enabled = isEnableJump;
820 mineap 605
821    
822 mineap 370 }
823    
824 mineap 498
825 mineap 370 public function isRepeatAll():Boolean{
826     return this.isPlayListRepeat;
827     }
828    
829     private function windowResized(event:NativeWindowBoundsEvent):void{
830     lastRect = event.afterBounds;
831     }
832    
833     private function windowMove(event:NativeWindowBoundsEvent):void{
834     lastRect = event.afterBounds;
835     }
836    
837     public function playListDoubleClicked():void{
838     if(playListProvider.length > 0){
839     var url:String = videoUrlMap[playListProvider[dataGrid_playList.selectedIndex]];
840     playerController.initForVideoPlayer(url, dataGrid_playList.selectedIndex);
841     }
842     }
843    
844     /**
845     * ���������������������������������������������������������������������������������������������������
846     *
847     */
848     public function selectComment(no:Number):void{
849    
850     for(var i:int = 0; i<commentListProvider.length; i++){
851     if(commentListProvider[i].no_column == no){
852     (dataGrid_comment as DataGrid).selectedIndex = i;
853    
854     return;
855     }
856     }
857    
858     }
859    
860     private function readStore():void{
861    
862     try{
863     /*���������������������������������������������*/
864    
865     var confValue:String = null;
866     confValue = ConfigManager.getInstance().getItem("isPlayListRepeat");
867     if (confValue == null) {
868     //���������������
869     }else{
870     isPlayListRepeat = ConfUtil.parseBoolean(confValue);
871     }
872    
873     confValue = ConfigManager.getInstance().getItem("isSyncComment");
874     if (confValue == null) {
875     //���������������
876     }else{
877     isSyncComment = ConfUtil.parseBoolean(confValue);
878     }
879    
880     confValue = ConfigManager.getInstance().getItem("isPlayerFollow");
881     if (confValue == null) {
882     //���������������
883     }else{
884     isPlayerFollow = ConfUtil.parseBoolean(confValue);
885     }
886    
887     confValue = ConfigManager.getInstance().getItem("isRenewCommentEachPlay");
888     if (confValue == null) {
889     //���������������
890     }else{
891     isRenewCommentEachPlay = ConfUtil.parseBoolean(confValue);
892     }
893    
894     confValue = ConfigManager.getInstance().getItem("isResizePlayerEachPlay");
895     if (confValue == null) {
896     //���������������
897     }else{
898     isResizePlayerEachPlay = ConfUtil.parseBoolean(confValue);
899     }
900    
901     confValue = ConfigManager.getInstance().getItem("isHideUnderController");
902     if (confValue == null) {
903     //���������������
904     }else{
905     isHideUnderController = ConfUtil.parseBoolean(confValue);
906     }
907    
908     confValue = ConfigManager.getInstance().getItem("commentScale");
909     if (confValue == null) {
910     //���������������
911     }else{
912     commentScale = Number(confValue);
913     }
914    
915     confValue = ConfigManager.getInstance().getItem("commentFps");
916     if (confValue == null) {
917     //���������������
918     }else{
919     this.fps = Number(confValue);
920     this.playerController.changeFps(this.fps);
921     }
922    
923     confValue = ConfigManager.getInstance().getItem("isShowOnlyPermissionComment");
924     if (confValue == null) {
925     //���������������
926     }else{
927     isShowOnlyPermissionComment = ConfUtil.parseBoolean(confValue);
928     }
929    
930     confValue = ConfigManager.getInstance().getItem("showCommentCount");
931     if (confValue == null) {
932     //���������������
933     }else{
934 mineap 507 showCommentCountPerMin = int(confValue);
935 mineap 370 }
936    
937 mineap 507 confValue = ConfigManager.getInstance().getItem("showOwnerCommentCount");
938     if (confValue == null) {
939     showOwnerCommentCountPerMin = showCommentCountPerMin;
940     }else{
941     showOwnerCommentCountPerMin = int(confValue);
942     }
943    
944 mineap 370 confValue = ConfigManager.getInstance().getItem("showCommentSec");
945     if (confValue == null) {
946     //���������������
947     }else{
948     showCommentSec = int(confValue);
949     }
950    
951     confValue = ConfigManager.getInstance().getItem("isRenewOtherCommentWithCommentEachPlay");
952     if (confValue == null) {
953     //���������������
954     }else{
955     isRenewOtherCommentWithCommentEachPlay = ConfUtil.parseBoolean(confValue);
956     }
957    
958     confValue = ConfigManager.getInstance().getItem("isAntiAlias");
959     if (confValue == null) {
960     //���������������
961     }else{
962     isAntiAlias = ConfUtil.parseBoolean(confValue);
963     }
964    
965     confValue = ConfigManager.getInstance().getItem("commentAlpha");
966     if (confValue == null) {
967     //���������������
968     }else{
969     commentAlpha = int(confValue);
970     }
971    
972     confValue = ConfigManager.getInstance().getItem("isEnableJump");
973     if (confValue == null) {
974     //���������������
975     }else{
976     isEnableJump = ConfUtil.parseBoolean(confValue);
977     }
978    
979     confValue = ConfigManager.getInstance().getItem("isAskToUserOnJump");
980     if (confValue == null) {
981     //���������������
982     }else{
983     isAskToUserOnJump = ConfUtil.parseBoolean(confValue);
984     }
985    
986     confValue = ConfigManager.getInstance().getItem("isInfoViewAlwaysFront");
987     if (confValue == null) {
988     //���������������
989     }else{
990     isInfoViewAlwaysFront = ConfUtil.parseBoolean(confValue);
991     }
992    
993     confValue = ConfigManager.getInstance().getItem("selectedResizeType");
994     if (confValue == null) {
995     //���������������
996     }else{
997     selectedResizeType = int(confValue);
998     }
999    
1000     confValue = ConfigManager.getInstance().getItem("isCommentFontBold");
1001     if (confValue == null) {
1002     //���������������
1003     }else{
1004     isCommentFontBold = ConfUtil.parseBoolean(confValue);
1005     }
1006    
1007     confValue = ConfigManager.getInstance().getItem("isShowAlwaysNicowariArea");
1008     if (confValue == null) {
1009     //���������������
1010     }else{
1011     isShowAlwaysNicowariArea = ConfUtil.parseBoolean(confValue);
1012     }
1013    
1014     confValue = ConfigManager.getInstance().getItem("isHideTagArea");
1015     if (confValue == null) {
1016     //���������������
1017     }else{
1018     isHideTagArea = ConfUtil.parseBoolean(confValue);
1019     }
1020    
1021     confValue = ConfigManager.getInstance().getItem("isAlwaysEconomyForStreaming");
1022     if (confValue == null) {
1023     //���������������
1024     }else{
1025     isAlwaysEconomyForStreaming = ConfUtil.parseBoolean(confValue);
1026     }
1027    
1028     confValue = ConfigManager.getInstance().getItem("isAppendComment");
1029     if (confValue == null) {
1030     //���������������
1031     }else{
1032     isAppendComment = ConfUtil.parseBoolean(confValue);
1033     }
1034    
1035     confValue = ConfigManager.getInstance().getItem("isHideSekaShinComment");
1036     if (confValue == null) {
1037     //���������������
1038     }else{
1039     isHideSekaShinComment = ConfUtil.parseBoolean(confValue);
1040     }
1041    
1042     confValue = ConfigManager.getInstance().getItem("isShowHTMLOwnerComment");
1043     if (confValue == null) {
1044     //���������������
1045     }else{
1046     isShowHTMLOwnerComment = ConfUtil.parseBoolean(confValue);
1047     }
1048    
1049     //x,y,w,h
1050     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_x");
1051     var controllerPosition_x:Number = 0;
1052     if (confValue == null) {
1053     //���������������
1054     }else{
1055     controllerPosition_x = Number(confValue);
1056     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1057     nativeWindow.x = lastRect.x = controllerPosition_x;
1058     });
1059     }
1060    
1061     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_y");
1062     var controllerPosition_y:Number = 0;
1063     if (confValue == null) {
1064     //���������������
1065     }else{
1066     controllerPosition_y = Number(confValue);
1067     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1068     nativeWindow.y = lastRect.y = controllerPosition_y;
1069     });
1070     }
1071    
1072     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_w");
1073     var controllerPosition_w:Number = 380;
1074     if (confValue == null) {
1075     //���������������
1076     }else{
1077     controllerPosition_w = Number(confValue);
1078     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1079     nativeWindow.width = lastRect.width = controllerPosition_w;
1080     });
1081     }
1082    
1083     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_h");
1084     var controllerPosition_h:Number = 520;
1085     if (confValue == null) {
1086     //���������������
1087     }else{
1088     controllerPosition_h = Number(confValue);
1089     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1090     nativeWindow.height = lastRect.height = controllerPosition_h;
1091     });
1092     }
1093    
1094     confValue = ConfigManager.getInstance().getItem("isEnableWideMode");
1095     if(confValue == null){
1096     //���������������
1097     isEnableWideMode = true;
1098     }else{
1099     isEnableWideMode = ConfUtil.parseBoolean(confValue);
1100     }
1101    
1102     confValue = ConfigManager.getInstance().getItem("relationSortIndex");
1103     if(confValue == null){
1104     //���������������
1105     }else{
1106     relationSortIndex = int(confValue);
1107     }
1108    
1109     confValue = ConfigManager.getInstance().getItem("relationOrderIndex");
1110     if(confValue == null){
1111     //���������������
1112     }else{
1113     relationOrderIndex = int(confValue);
1114     }
1115    
1116     confValue = ConfigManager.getInstance().getItem("isNgUpEnable");
1117     if(confValue == null){
1118     // ���������������
1119     }else{
1120     isNgUpEnable = ConfUtil.parseBoolean(confValue);
1121     }
1122    
1123 mineap 487 confValue = ConfigManager.getInstance().getItem("isSmoothing");
1124     if(confValue != null){
1125     isSmoothing = ConfUtil.parseBoolean(confValue);
1126     }
1127     if(playerController != null){
1128     playerController.setVideoSmoothing(this.isSmoothing);
1129     }
1130 mineap 439
1131 mineap 529 confValue = ConfigManager.getInstance().getItem("isSmoothingOnlyNotPixelIdenticalDimensions");
1132     if(confValue != null){
1133     isSmoothingOnlyNotPixelIdenticalDimensions = ConfUtil.parseBoolean(confValue);
1134     }
1135    
1136 mineap 498 confValue = ConfigManager.getInstance().getItem("playerQuality");
1137     if(confValue != null){
1138     playerQuality = int(confValue);
1139     }
1140     if(playerController != null){
1141     playerController.setPlayerQuality(this.playerQuality);
1142     }
1143 mineap 487
1144 mineap 498 confValue = ConfigManager.getInstance().getItem("isEnableWideMode");
1145     if(confValue != null){
1146     isEnableWideMode = ConfUtil.parseBoolean(confValue);
1147     }
1148    
1149 mineap 526 confValue = ConfigManager.getInstance().getItem("isFollowInfoViewHeight");
1150     if (confValue != null)
1151     {
1152     isFollowInfoViewHeight = ConfUtil.parseBoolean(confValue);
1153     }
1154    
1155 mineap 605 confValue = ConfigManager.getInstance().getItem("isNotPlayNicowari");
1156     if (confValue != null)
1157     {
1158     isNotPlayNicowari = ConfUtil.parseBoolean(confValue);
1159     }
1160    
1161 mineap 370 }catch(error:Error){
1162     trace(error.getStackTrace());
1163     Alert.show(Message.M_CONF_FILE_IS_BROKEN, Message.M_ERROR);
1164     logManager.addLog(Message.FAIL_LOAD_CONF_FILE_FOR_VIDEO_INFO_VIEW + ":" + Message.M_CONF_FILE_IS_BROKEN + ":" + ConfigManager.getInstance().confFileNativePath + ":" + error);
1165     }
1166    
1167     }
1168    
1169     public function saveStore():void{
1170    
1171     try{
1172    
1173     trace("saveStore_videoInfoView");
1174    
1175     /*������������������������������������*/
1176     ConfigManager.getInstance().removeItem("isPlayListRepeat");
1177     ConfigManager.getInstance().setItem("isPlayListRepeat", isPlayListRepeat);
1178    
1179     ConfigManager.getInstance().removeItem("isSyncComment");
1180     ConfigManager.getInstance().setItem("isSyncComment", isSyncComment);
1181    
1182     ConfigManager.getInstance().removeItem("isPlayerFollow");
1183     ConfigManager.getInstance().setItem("isPlayerFollow", isPlayerFollow);
1184    
1185     ConfigManager.getInstance().removeItem("isRenewCommentEachPlay");
1186     ConfigManager.getInstance().setItem("isRenewCommentEachPlay", isRenewCommentEachPlay);
1187    
1188     ConfigManager.getInstance().removeItem("isResizePlayerEachPlay");
1189     ConfigManager.getInstance().setItem("isResizePlayerEachPlay", isResizePlayerEachPlay);
1190    
1191     ConfigManager.getInstance().removeItem("isHideUnderController");
1192     ConfigManager.getInstance().setItem("isHideUnderController", isHideUnderController);
1193    
1194     // ������������������������������������
1195     ConfigManager.getInstance().removeItem("controllerWindowPosition_x");
1196     ConfigManager.getInstance().setItem("controllerWindowPosition_x", lastRect.x);
1197    
1198     ConfigManager.getInstance().removeItem("controllerWindowPosition_y");
1199     ConfigManager.getInstance().setItem("controllerWindowPosition_y", lastRect.y);
1200    
1201     ConfigManager.getInstance().removeItem("controllerWindowPosition_w");
1202     ConfigManager.getInstance().setItem("controllerWindowPosition_w", lastRect.width);
1203    
1204     ConfigManager.getInstance().removeItem("controllerWindowPosition_h");
1205     ConfigManager.getInstance().setItem("controllerWindowPosition_h", lastRect.height);
1206    
1207     ConfigManager.getInstance().removeItem("commentScale");
1208     ConfigManager.getInstance().setItem("commentScale", commentScale);
1209    
1210     ConfigManager.getInstance().removeItem("commentFps");
1211     ConfigManager.getInstance().setItem("commentFps", fps);
1212    
1213     ConfigManager.getInstance().removeItem("isShowOnlyPermissionComment");
1214     ConfigManager.getInstance().setItem("isShowOnlyPermissionComment", isShowOnlyPermissionComment);
1215    
1216     ConfigManager.getInstance().removeItem("showCommentCount");
1217 mineap 507 ConfigManager.getInstance().setItem("showCommentCount", showCommentCountPerMin);
1218 mineap 370
1219 mineap 507 ConfigManager.getInstance().removeItem("showOwnerCommentCount");
1220     ConfigManager.getInstance().setItem("showOwnerCommentCount", showOwnerCommentCountPerMin);
1221    
1222 mineap 370 ConfigManager.getInstance().removeItem("showCommentSec");
1223     ConfigManager.getInstance().setItem("showCommentSec", showCommentSec);
1224    
1225     ConfigManager.getInstance().removeItem("isRenewOtherCommentWithCommentEachPlay");
1226     ConfigManager.getInstance().setItem("isRenewOtherCommentWithCommentEachPlay", isRenewOtherCommentWithCommentEachPlay);
1227    
1228     ConfigManager.getInstance().removeItem("isAntiAlias");
1229     ConfigManager.getInstance().setItem("isAntiAlias", isAntiAlias);
1230    
1231     ConfigManager.getInstance().removeItem("commentAlpha");
1232     ConfigManager.getInstance().setItem("commentAlpha", commentAlpha);
1233    
1234     ConfigManager.getInstance().removeItem("isEnableJump");
1235     ConfigManager.getInstance().setItem("isEnableJump", isEnableJump);
1236    
1237     ConfigManager.getInstance().removeItem("isAskToUserOnJump");
1238     ConfigManager.getInstance().setItem("isAskToUserOnJump", isAskToUserOnJump);
1239    
1240     ConfigManager.getInstance().removeItem("isInfoViewAlwaysFront");
1241     ConfigManager.getInstance().setItem("isInfoViewAlwaysFront", isInfoViewAlwaysFront);
1242    
1243     ConfigManager.getInstance().removeItem("selectedResizeType");
1244     ConfigManager.getInstance().setItem("selectedResizeType", selectedResizeType);
1245    
1246     ConfigManager.getInstance().removeItem("isCommentFontBold");
1247     ConfigManager.getInstance().setItem("isCommentFontBold", isCommentFontBold);
1248    
1249     ConfigManager.getInstance().removeItem("isShowAlwaysNicowariArea");
1250     ConfigManager.getInstance().setItem("isShowAlwaysNicowariArea", isShowAlwaysNicowariArea);
1251    
1252     ConfigManager.getInstance().removeItem("isAlwaysEconomyForStreaming");
1253     ConfigManager.getInstance().setItem("isAlwaysEconomyForStreaming", isAlwaysEconomyForStreaming);
1254    
1255     ConfigManager.getInstance().removeItem("isHideTagArea");
1256     ConfigManager.getInstance().setItem("isHideTagArea", isHideTagArea);
1257    
1258     ConfigManager.getInstance().removeItem("isAppendComment");
1259     ConfigManager.getInstance().setItem("isAppendComment", isAppendComment);
1260    
1261     ConfigManager.getInstance().removeItem("isHideSekaShinComment");
1262     ConfigManager.getInstance().setItem("isHideSekaShinComment", isHideSekaShinComment);
1263    
1264     ConfigManager.getInstance().removeItem("isShowHTMLOwnerComment");
1265     ConfigManager.getInstance().setItem("isShowHTMLOwnerComment", isShowHTMLOwnerComment);
1266    
1267     ConfigManager.getInstance().removeItem("isEnableWideMode");
1268     ConfigManager.getInstance().setItem("isEnableWideMode", isEnableWideMode);
1269    
1270     ConfigManager.getInstance().removeItem("relationSortIndex");
1271     ConfigManager.getInstance().setItem("relationSortIndex", relationSortIndex);
1272    
1273     ConfigManager.getInstance().removeItem("relationOrderIndex");
1274     ConfigManager.getInstance().setItem("relationSortIndex", relationSortIndex);
1275    
1276     ConfigManager.getInstance().removeItem("isNgUpEnable");
1277     ConfigManager.getInstance().setItem("isNgUpEnable", isNgUpEnable);
1278    
1279 mineap 487 ConfigManager.getInstance().removeItem("isSmoothing");
1280     ConfigManager.getInstance().setItem("isSmoothing",isSmoothing);
1281    
1282 mineap 529 ConfigManager.getInstance().removeItem("isSmoothingOnlyNotPixelIdenticalDimensions");
1283     ConfigManager.getInstance().setItem("isSmoothingOnlyNotPixelIdenticalDimensions", isSmoothingOnlyNotPixelIdenticalDimensions);
1284    
1285 mineap 498 ConfigManager.getInstance().removeItem("playerQuality");
1286     ConfigManager.getInstance().setItem("playerQuality", playerQuality);
1287    
1288     ConfigManager.getInstance().removeItem("isEnableWideMode");
1289     ConfigManager.getInstance().setItem("isEnableWideMode", isEnableWideMode);
1290    
1291 mineap 526 ConfigManager.getInstance().removeItem("isFollowInfoViewHeight");
1292     ConfigManager.getInstance().setItem("isFollowInfoViewHeight", isFollowInfoViewHeight);
1293    
1294 mineap 605 ConfigManager.getInstance().removeItem("isNotPlayNicowari");
1295     ConfigManager.getInstance().setItem("isNotPlayNicowari", isNotPlayNicowari);
1296    
1297 mineap 370 ConfigManager.getInstance().save();
1298    
1299     }catch(error:Error){
1300     Alert.show(Message.M_CONF_FILE_IS_BROKEN, Message.M_ERROR);
1301     logManager.addLog(Message.FAIL_SAVE_CONF_FILE_FOR_VIDEO_INFO_VIEW + ":" + Message.M_CONF_FILE_IS_BROKEN + ":" + ConfigManager.getInstance().confFileNativePath + ":" + error);
1302     trace(error.getStackTrace());
1303     }
1304    
1305     }
1306    
1307     public function resetWindowPosition():void{
1308     // ������������������������������������
1309     try{
1310    
1311     // ������������������������������������������������������������
1312     ConfigManager.getInstance().removeItem("controllerWindowPosition_x");
1313     ConfigManager.getInstance().setItem("controllerWindowPosition_x", 0);
1314    
1315     ConfigManager.getInstance().removeItem("controllerWindowPosition_y");
1316     ConfigManager.getInstance().setItem("controllerWindowPosition_y", 0);
1317    
1318     ConfigManager.getInstance().removeItem("controllerWindowPosition_w");
1319     ConfigManager.getInstance().setItem("controllerWindowPosition_w", 400);
1320    
1321     ConfigManager.getInstance().removeItem("controllerWindowPosition_h");
1322     ConfigManager.getInstance().setItem("controllerWindowPosition_h", 580);
1323    
1324     ConfigManager.getInstance().save();
1325    
1326     this.readStore();
1327    
1328     }catch(error:Error){
1329     Alert.show(Message.M_CONF_FILE_IS_BROKEN, Message.M_ERROR);
1330     logManager.addLog(Message.FAIL_SAVE_CONF_FILE_FOR_VIDEO_INFO_VIEW + ":" + Message.M_CONF_FILE_IS_BROKEN + ":" + ConfigManager.getInstance().confFileNativePath + ":" + error);
1331     trace(error.getStackTrace());
1332     }
1333    
1334     if(this.nativeWindow != null && !(this as Window).closed){
1335    
1336     this.visible = true;
1337    
1338     this.nativeWindow.x = 0;
1339     this.nativeWindow.y = 0;
1340    
1341     this.width = 380;
1342     this.height = 520;
1343     }
1344     }
1345    
1346     /**
1347     *
1348     * @param urlList
1349     * @param videoNameList
1350     * @param playListName
1351     */
1352     public function setPlayList(urlList:Array, videoNameList:Array, playListName:String):void{
1353    
1354     this.playListName = playListName;
1355     label_playListTitle_dataProvider = playListName;
1356    
1357     for each(var title:String in videoNameList){
1358     playListProvider.addItem(title);
1359     }
1360    
1361     for(var index:int = 0; index<urlList.length; index++){
1362     videoUrlMap[videoNameList[index]] = urlList[index];
1363     }
1364    
1365     if(this.dataGrid_playList != null){
1366     // (dataGrid_playList as DataGrid).validateDisplayList();
1367     }
1368     }
1369    
1370     /**
1371     *
1372     * @param url
1373     * @param title
1374     *
1375     */
1376     public function addPlayListItem(url:String, title:String):void{
1377    
1378     videoUrlMap[title] = url;
1379    
1380     }
1381    
1382     /**
1383     *
1384     * @param url
1385     * @param title
1386     * @param index
1387     *
1388     */
1389     public function addPlayListItemWithList(url:String, title:String, index:int):void{
1390     playListProvider.addItemAt(title,index);
1391    
1392     addPlayListItem(url, title);
1393    
1394     if(this.dataGrid_playList != null){
1395     (dataGrid_playList as DataGrid).dataProvider = playListProvider;
1396     (dataGrid_playList as DataGrid).validateDisplayList();
1397     }
1398    
1399     }
1400    
1401    
1402     /**
1403     *
1404     * @param title
1405     * @param index
1406     *
1407     */
1408     public function removePlayListItem(index:int):void{
1409     var title:String = String(playListProvider.removeItemAt(index));
1410    
1411     //���������������������������������������������������������������
1412     for each(var videoName:String in playListProvider){
1413     if(title == videoName){
1414     //������������������videoUrlMap���������������������
1415     return;
1416     }
1417     }
1418     //���������������������videoUrlMap������������
1419     videoUrlMap[title] = null;
1420    
1421     if(this.dataGrid_playList != null){
1422     (dataGrid_playList as DataGrid).dataProvider = playListProvider;
1423     (dataGrid_playList as DataGrid).validateDisplayList();
1424     }
1425     }
1426    
1427     /**
1428     *
1429     * @return
1430     *
1431     */
1432     public function getPlayList():Array{
1433     var array:Array = new Array();
1434     for(var i:int = 0; i<playListProvider.length; i++){
1435     array.push(String(playListProvider[i]));
1436     }
1437    
1438     var returnArray:Array = new Array();
1439    
1440     for each(var title:String in array){
1441     returnArray.push(videoUrlMap[title]);
1442     }
1443    
1444     return returnArray;
1445     }
1446    
1447     /**
1448     * ���������������������������������������������������������������
1449     * @return
1450     *
1451     */
1452     public function getNameList():Array{
1453     var array:Array = new Array();
1454     for(var i:int = 0; i<playListProvider.length; i++){
1455     array.push(String(playListProvider[i]));
1456     }
1457    
1458     return array;
1459     }
1460    
1461     /**
1462     *
1463     *
1464     */
1465     public function resetPlayList():void{
1466     this.playListName = "";
1467     if(label_playListTitle != null){
1468     label_playListTitle.text = playListName;
1469     }else{
1470     canvas_videoInfo.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
1471     canvas_playList.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
1472     label_playListTitle.text = playListName;
1473     });
1474     });
1475     }
1476    
1477     videoUrlMap = new Object();
1478    
1479     playListProvider.removeAll();
1480    
1481     if(this.dataGrid_playList != null){
1482     (dataGrid_playList as DataGrid).dataProvider = playListProvider;
1483     (dataGrid_playList as DataGrid).validateDisplayList();
1484     (dataGrid_playList as DataGrid).validateNow();
1485     }
1486     }
1487    
1488     /**
1489 mineap 476 * ���������������������������������������������
1490 mineap 370 *
1491 mineap 476 * @details edvakf���������������������������
1492     * @see https://github.com/edvakf/NNDDMOD/commit/6984ba8919727a98c249e1bc8a4848705de27df5
1493     */
1494     public function shufflePlayList():void{
1495     var tempArrayCollection:ArrayCollection = new ArrayCollection();
1496     for each(var object:Object in playListProvider){
1497     tempArrayCollection.addItem(object);
1498     }
1499     var i:int = tempArrayCollection.length;
1500     while (--i) {
1501     var j:int = Math.floor( Math.random() * (i + 1) );
1502     if (i == j) {
1503     continue;
1504     }
1505     var object:Object = tempArrayCollection.getItemAt(i);
1506     tempArrayCollection.setItemAt( tempArrayCollection.getItemAt(j), i );
1507     tempArrayCollection.setItemAt( object, j );
1508     }
1509     playListProvider = tempArrayCollection;
1510     }
1511    
1512     /**
1513     *
1514 mineap 370 * @param index
1515     * @return
1516     *
1517     */
1518     public function getPlayListUrl(index:int):String{
1519     var videoTitle:String = playListProvider[index];
1520    
1521     return videoUrlMap[videoTitle];
1522     }
1523    
1524     /**
1525     *
1526     * @param event
1527     *
1528     */
1529     public function playListDragDropHandler(event:DragEvent):void{
1530     if(event.dragInitiator == dataGrid_playList){
1531    
1532     //���������������(������������������������������������������)
1533    
1534     }else{
1535    
1536     //DataGrid���������Drag������������������������������
1537    
1538     if(event.dragInitiator as DataGrid){
1539     var selectedItems:Array = (event.dragInitiator as DataGrid).selectedItems;
1540     var addItems:Array = new Array();
1541    
1542     for(var i:int=0; i<selectedItems.length; i++){
1543    
1544     //������������������������
1545     var url:String = selectedItems[i].dataGridColumn_videoPath;
1546     if(url == null || url == ""){
1547     //��������������� or ���������videoPath���������������������
1548     url = selectedItems[i].dataGridColumn_nicoVideoUrl;
1549    
1550     if(url == null || url == ""){
1551     //������������������������������
1552     url = selectedItems[i].dataGridColumn_videoLocalPath;
1553    
1554     if(url == null || url == ""){
1555     //������������������videoLocalPath���������������������
1556     url = selectedItems[i].dataGridColumn_videoUrl;
1557    
1558     if(url == null || url == ""){
1559     //������������������������
1560     continue;
1561     }
1562     }
1563     }
1564     }
1565    
1566     var title:String = selectedItems[i].dataGridColumn_videoName;
1567     var index:int = title.indexOf("\n");
1568     if(index != -1){
1569     //������������������������������������������������������������������������
1570     title = title.substring(0, index);
1571     }
1572    
1573     addItems.push(title);
1574     addPlayListItem(url, title);
1575     }
1576    
1577     }
1578    
1579     event.dragSource = new DragSource();
1580     event.dragSource.addData(addItems, "items");
1581     }
1582     }
1583    
1584     /**
1585     *
1586     * @param event
1587     *
1588     */
1589     public function playListClearButtonClicked(event:MouseEvent):void{
1590     resetPlayList();
1591     }
1592    
1593 mineap 476 public function playListShuffleButtonClicked(event:MouseEvent):void{
1594     shufflePlayList();
1595     }
1596    
1597 mineap 370 /**
1598     *
1599     * @param event
1600     *
1601     */
1602     public function playListItemDeleteButtonClicked(event:MouseEvent):void{
1603     var selectedIndices:Array = (dataGrid_playList as DataGrid).selectedIndices;
1604    
1605     for(var index:int = selectedIndices.length; index != 0; index--){
1606     removePlayListItem(selectedIndices[index-1]);
1607     }
1608     }
1609    
1610     /**
1611     *
1612     * @param event
1613     *
1614     */
1615     public function playListSaveButtonClicked(event:MouseEvent):void{
1616     //1.���������������������������������������������������������or���������������
1617     //2.���������������������������������������������
1618     //3.������������������������������������
1619     var urlArray:Array = new Array();
1620     var nameArray:Array = new Array();
1621     for each(var name:String in playListProvider){
1622     urlArray.push(videoUrlMap[name]);
1623     nameArray.push(name);
1624     }
1625    
1626     var isExist:Boolean = false;
1627     if(playListName != null){
1628     var playList:PlayList = PlayListManager.instance.isExist(playListName);
1629    
1630     if(playList != null){
1631     isExist = true;
1632     }
1633     }
1634    
1635     if(!isExist){
1636     // ���������������������������
1637     playerController.addNewPlayList(urlArray, nameArray);
1638     }else{
1639     Application.application.activate();
1640     Alert.show("���������������������������(" + playListName + ")���������������������������\n���������������������������������������������������������������������������������������", Message.M_MESSAGE, Alert.YES | Alert.NO | Alert.CANCEL, null, function(event:CloseEvent):void{
1641     if(event.detail == Alert.YES){
1642     // ���������
1643     playerController.updatePlayList(playListName, urlArray, nameArray);
1644     }else if(event.detail == Alert.NO){
1645     // ���������������tuika
1646     var title:String = playerController.addNewPlayList(urlArray, nameArray);
1647     label_playListTitle_dataProvider = title;
1648     }else{
1649    
1650     }
1651     });
1652    
1653     }
1654    
1655     }
1656    
1657     /**
1658     *
1659     * @param index
1660     *
1661     */
1662     public function showPlayingTitle(index:int):void{
1663     if(dataGrid_playList != null){
1664     (dataGrid_playList as DataGrid).scrollToIndex(index);
1665     (dataGrid_playList as DataGrid).selectedIndex = index;
1666     }else{
1667     canvas_playList.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
1668     (dataGrid_playList as DataGrid).scrollToIndex(index);
1669     (dataGrid_playList as DataGrid).selectedIndex = index;
1670     });
1671     }
1672     }
1673    
1674     /**
1675     *
1676     * @param event
1677     *
1678     */
1679     public function tagListDoubleClickEventHandler(event:ListEvent):void{
1680     if(event.itemRenderer.data != null){
1681     if(event.itemRenderer.data is String){
1682     var word:String = String(event.itemRenderer.data);
1683     Application.application.search(new SearchItem(word,
1684     SearchSortString.convertSortTypeFromIndex(4), SearchType.TAG, word));
1685     }
1686     }
1687     }
1688    
1689     /**
1690     *
1691     * @param event
1692     *
1693     */
1694     public function button_goToWebClicked(event:Event):void{
1695     this.playerController.watchOnWeb();
1696     }
1697    
1698     /**
1699     *
1700     * @param event
1701     *
1702     */
1703     public function tweet(event:Event):void{
1704     this.playerController.tweet();
1705     }
1706    
1707     /**
1708     *
1709     * @param event
1710     *
1711     */
1712     public function addHatenaBookmark(event:Event):void{
1713     this.playerController.addHatenaBookmark();
1714     }
1715    
1716     /**
1717     *
1718     * @param event
1719     *
1720     */
1721     public function openNicoSound(event:Event):void{
1722     this.playerController.openNicoSound();
1723     }
1724    
1725     /**
1726     *
1727     * @param event
1728     *
1729     */
1730     public function openNicomimi(event:Event):void{
1731     this.playerController.openNicomimi();
1732     }
1733    
1734     /**
1735     *
1736     * @param event
1737     *
1738     */
1739     public function button_addDownloadList(event:Event):void{
1740    
1741     this.playerController.addDlList();
1742    
1743     }
1744    
1745     /**
1746     *
1747     * @param event
1748     *
1749     */
1750     public function myListAddButtonClicked(event:Event):void{
1751     var selectedItem:Object = comboBox_mylist.selectedItem;
1752    
1753     if(selectedItem != null){
1754     var name:String = String(selectedItem);
1755     this.playerController.addMyList(myListMap[name]);
1756    
1757     }else{
1758    
1759     }
1760     }
1761    
1762     /**
1763     *
1764     * @param myListNames
1765     * @param myListNums
1766     *
1767     */
1768     public function setMyLists(myListNames:Array, myListNums:Array):void{
1769    
1770     var selectedIndex:int = comboBox_mylist.selectedIndex;
1771     var selectedName:String = myListDataProvider[selectedIndex];
1772    
1773     myListDataProvider = new Array();
1774     for(var i:int = 0; i<myListNames.length; i++){
1775     myListMap[myListNames[i]] = myListNums[i];
1776     myListDataProvider[i] = myListNames[i];
1777     if(selectedName == myListDataProvider[i]){
1778     selectedIndex = i;
1779     }
1780     }
1781    
1782     comboBox_mylist.dataProvider = myListDataProvider;
1783    
1784     if(myListDataProvider.length >= 1){
1785     comboBox_mylist.selectedIndex = 0;
1786     }
1787    
1788     comboBox_mylist.validateNow();
1789    
1790     if(selectedIndex == -1){
1791     var value:Object = ConfigManager.getInstance().getItem("infoViewSelectedMyListIndex");
1792     if(value != null){
1793     selectedIndex = int(value);
1794     }else{
1795     selectedIndex = 0;
1796     }
1797     }
1798     comboBox_mylist.selectedIndex = selectedIndex;
1799    
1800     }
1801    
1802     private function ownerTextLinkClicked(event:TextEvent):void{
1803     if(event.text.indexOf("mylist/") != -1){
1804     // trace(event.text);
1805     Application.application.renewMyList(event.text);
1806     }else if(event.text.indexOf("watch/") != -1){
1807     var videoId:String = PathMaker.getVideoID(event.text);
1808     // trace(videoId);
1809     playerController.playMovie("http://www.nicovideo.jp/watch/" + videoId);
1810     }else{
1811     trace(event);
1812     }
1813     }
1814    
1815     private function playListReverseButtonClicked(event:Event):void{
1816     var tempArrayCollection:ArrayCollection = new ArrayCollection();
1817    
1818     for each(var object:Object in playListProvider){
1819     tempArrayCollection.addItemAt(object, 0);
1820     }
1821    
1822     playListProvider = tempArrayCollection;
1823     }
1824    
1825     public function get playList():PlayList{
1826     var playList:PlayList = null;
1827    
1828     if(getPlayList().length > 0){
1829    
1830     playList = new PlayList();
1831    
1832     playList.name = playListName;
1833    
1834     for(var index:int = 0; index < (getPlayList() as Array).length; index++){
1835     var path:String = getPlayList()[index];
1836     var name:String = getNameList()[index];
1837     var nnddVideo:NNDDVideo = new NNDDVideo(path, name);
1838    
1839     playList.items.push(nnddVideo);
1840     }
1841     }
1842    
1843     return playList;
1844     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26