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

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