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

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