Skip to content

Commit c2b13e2

Browse files
author
RandomEngy
committed
Added support for multiple angles, lowered minimum main window width.
1 parent 4ecae35 commit c2b13e2

4 files changed

Lines changed: 63 additions & 12 deletions

File tree

Lib/HandBrakeInterop.dll

0 Bytes
Binary file not shown.

Lib/HandBrakeInterop.pdb

0 Bytes
Binary file not shown.

VidCoder/View/MainWindow.xaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Title="VidCoder"
88
Width="671"
99
Height="445"
10-
MinWidth="639"
10+
MinWidth="617"
1111
MinHeight="445"
1212
Style="{StaticResource NormalWindow}"
1313
Closing="Window_Closing" AllowDrop="True" PreviewDrop="Window_Drop" PreviewDragOver="Window_PreviewDragOver">
@@ -217,7 +217,7 @@
217217
Grid.Row="1" Height="20" Margin="6,0,0,0"
218218
Value="{Binding ScanProgress}"/>
219219
</Grid>
220-
<StackPanel Margin="52,39,12,7" VerticalAlignment="Top">
220+
<StackPanel Margin="30,39,12,7" VerticalAlignment="Top">
221221
<TextBlock
222222
Text="An error occurred while scanning."
223223
Style="{StaticResource ScanStatus}"
@@ -267,6 +267,11 @@
267267
</ComboBox>
268268
<Polygon Style="{StaticResource ArrowSeparator}" />
269269
</StackPanel>
270+
<StackPanel Orientation="Horizontal" Visibility="{Binding AngleVisible, Converter={StaticResource VisibilityConverter}}">
271+
<TextBlock Text="Angle:" Style="{StaticResource PlainTitle}" />
272+
<ComboBox ItemsSource="{Binding Angles}" SelectedItem="{Binding Angle}" Width="32" Height="23" VerticalAlignment="Center" />
273+
<Polygon Style="{StaticResource ArrowSeparator}" />
274+
</StackPanel>
270275
<StackPanel Orientation="Horizontal" Visibility="{Binding ChaptersVisible, Converter={StaticResource VisibilityConverter}}">
271276
<TextBlock Text="Chapters:" Style="{StaticResource PlainTitle}" />
272277
<ComboBox MinWidth="38"

VidCoder/ViewModel/MainViewModel.cs

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)