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

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