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

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