@@ -27,6 +27,8 @@ public class MainViewModel : ViewModelBase
2727 private string sourceDescription ;
2828 private Title selectedTitle ;
2929 private Title oldTitle ;
30+ private List < int > angles ;
31+ private int angle ;
3032
3133 private Chapter selectedStartChapter ;
3234 private Chapter selectedEndChapter ;
@@ -539,17 +541,9 @@ public Title SelectedTitle
539541
540542 set
541543 {
542- PreviewViewModel previewWindow = WindowManager . FindWindow ( typeof ( PreviewViewModel ) ) as PreviewViewModel ;
543-
544544 if ( value == null )
545545 {
546546 this . selectedTitle = null ;
547-
548- if ( previewWindow != null )
549- {
550- previewWindow . RefreshPreviews ( ) ;
551- //previewWindow.Job = null;
552- }
553547 }
554548 else
555549 {
@@ -659,14 +653,27 @@ public Title SelectedTitle
659653 this . SelectedStartChapter = this . selectedTitle . Chapters [ 0 ] ;
660654 this . SelectedEndChapter = this . selectedTitle . Chapters [ this . selectedTitle . Chapters . Count - 1 ] ;
661655
662- if ( previewWindow != null )
656+ this . angles = new List < int > ( ) ;
657+ for ( int i = 1 ; i <= this . selectedTitle . AngleCount ; i ++ )
663658 {
664- previewWindow . RefreshPreviews ( ) ;
659+ this . angles . Add ( i ) ;
665660 }
666661
662+ this . angle = 1 ;
663+
664+ this . NotifyPropertyChanged ( "Angles" ) ;
665+ this . NotifyPropertyChanged ( "Angle" ) ;
666+ this . NotifyPropertyChanged ( "AngleVisible" ) ;
667+
667668 this . oldTitle = value ;
668669 }
669670
671+ PreviewViewModel previewWindow = WindowManager . FindWindow ( typeof ( PreviewViewModel ) ) as PreviewViewModel ;
672+ if ( previewWindow != null )
673+ {
674+ previewWindow . RefreshPreviews ( ) ;
675+ }
676+
670677 this . NotifyPropertyChanged ( "SubtitlesSummary" ) ;
671678 CommandManager . InvalidateRequerySuggested ( ) ;
672679 this . GenerateOutputFileName ( ) ;
@@ -676,6 +683,44 @@ public Title SelectedTitle
676683 }
677684 }
678685
686+ public List < int > Angles
687+ {
688+ get
689+ {
690+ return this . angles ;
691+ }
692+ }
693+
694+ public bool AngleVisible
695+ {
696+ get
697+ {
698+ return true ;
699+ return this . SelectedTitle != null && this . SelectedTitle . AngleCount > 1 ;
700+ }
701+ }
702+
703+ public int Angle
704+ {
705+ get
706+ {
707+ return this . angle ;
708+ }
709+
710+ set
711+ {
712+ this . angle = value ;
713+
714+ PreviewViewModel previewWindow = WindowManager . FindWindow ( typeof ( PreviewViewModel ) ) as PreviewViewModel ;
715+ if ( previewWindow != null )
716+ {
717+ previewWindow . RefreshPreviews ( ) ;
718+ }
719+
720+ this . NotifyPropertyChanged ( "Angle" ) ;
721+ }
722+ }
723+
679724 public Subtitles CurrentSubtitles
680725 {
681726 get
@@ -1701,6 +1746,7 @@ public EncodeJob EncodeJob
17011746 OutputPath = this . OutputPath ,
17021747 EncodingProfile = this . SelectedPreset . Preset . EncodingProfile ,
17031748 Title = this . SelectedTitle . TitleNumber ,
1749+ Angle = this . Angle ,
17041750 ChapterStart = this . SelectedStartChapter . ChapterNumber ,
17051751 ChapterEnd = this . SelectedEndChapter . ChapterNumber ,
17061752 ChosenAudioTracks = this . GetChosenAudioTracks ( ) ,
0 commit comments