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

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