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

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