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

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