Develop and Download Open Source Software

Browse Subversion Repository

Contents of /NNDDv2/trunk/src/org/mineap/nndd/view/VideoInfoView.as

Parent Directory Parent Directory | Revision Log Revision Log


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

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