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

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