Skip to content

Commit

Permalink
🔀 Merge branch 'format-selection-list'
Browse files Browse the repository at this point in the history
- Closes #3
  • Loading branch information
database64128 committed Jul 22, 2020
2 parents cf5dbce + 4d1825e commit 0566edf
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 123 deletions.
2 changes: 1 addition & 1 deletion AboutDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Style="{StaticResource MaterialDesignHeadline6TextBlock}"
TextWrapping="Wrap"
VerticalAlignment="Center">
About - v1.1 Build 20200715
About - v1.2 Build 20200722
</TextBlock>
<TextBlock Grid.Row="1"
Grid.Column="1"
Expand Down
Binary file modified DarkMode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions Formats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Format Selection Design Goals

## Container Selection (editable):

```
- Auto
- webm
- mp4
- mkv
- opus
- flac
- ogg
- m4a
- mp3
```

## Format Selection (editable):

```
- Auto
- Custom
- bestvideo+bestaudio/best
- bestvideo+bestaudio
- bestvideo+worstaudio
- worstvideo+bestaudio
- worstvideo+worstaudio
- worstvideo+worstaudio/worst
- best
- worst
- bestvideo
- worstvideo
- bestaudio
- worstaudio
- YouTube 4K 60fps HDR webm (337+251)
- YouTube 4K 60fps webm (315+251)
- YouTube 4K 60fps AV1 (401+140)
- YouTube 4K webm (313+251)
- YouTube 1080p60 webm (303+251)
- YouTube 1080p webm (248+251)
- 1080p
- 720p
```

## Generated Format Selection Strings:

- `Auto + bestvideo+bestaudio/best == bestvideo+bestaudio/best`
- `Auto + "248+251" == 248+251`
- `webm + Auto == webm`
- `webm + bestvideo+bestaudio/best == (bestvideo+bestaudio/best)[ext=webm]`
- `webm + "248+251" == (248+251)[ext=webm]`
- `mp4 + Custom + "137+140" == 137[ext=mp4]+140[ext=m4a]`

## Rules

- Can select format ONLY WHEN container is `Auto`.
176 changes: 93 additions & 83 deletions Home.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}" VerticalAlignment="Center" Margin="8">Video Link</TextBlock>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="8">Video Link</TextBlock>
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1">
<TextBox
x:Name="linkTextBox"
materialDesign:HintAssist.Hint="e.g. https://www.youtube.com/watch?v=b2390GAm4d0"
Expand Down Expand Up @@ -58,87 +69,86 @@
Foreground="White"
Command="{Binding AbortDl}">_Abort</Button>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}" Margin="8">Options</TextBlock>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<ToggleButton
x:Name="overrideFormatsToggle"
Margin="8"
IsChecked="{Binding OverrideFormats}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Override Formats</TextBlock>
<TextBlock VerticalAlignment="Center" Margin="8">Video Format</TextBlock>
<TextBox
x:Name="videoTextBox"
Margin="0,8,8,8"
Width="50"
IsEnabled="{Binding Path=IsChecked, ElementName=overrideFormatsToggle}"
TextAlignment="Right"
Text="{Binding VideoFormat}"/>
<TextBlock VerticalAlignment="Center" Margin="8">Audio Format</TextBlock>
<TextBox
x:Name="audioTextBox"
Margin="0,8,8,8"
Width="50"
IsEnabled="{Binding Path=IsChecked, ElementName=overrideFormatsToggle}"
TextAlignment="Right"
Text="{Binding AudioFormat}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1">
<ToggleButton
x:Name="metadataToggle"
Margin="8"
IsChecked="{Binding AddMetadata}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Add Metadata</TextBlock>
<ToggleButton
x:Name="thumbnailToggle"
Margin="8"
IsChecked="{Binding DownloadThumbnail}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Download Thumbnail</TextBlock>
<ToggleButton
x:Name="subtitlesToggle"
Margin="8"
IsChecked="{Binding DownloadSubtitles}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Download Subtitles</TextBlock>
<ToggleButton
x:Name="playlistToggle"
Margin="8"
IsChecked="{Binding DownloadPlaylist}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Download Playlist</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2">
<ToggleButton
x:Name="pathToggle"
Margin="8"
IsChecked="{Binding UseCustomPath}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Custom Download Path</TextBlock>
<TextBox
x:Name="pathTextBox"
Margin="8,8,1,8"
Width="384"
IsEnabled="{Binding Path=IsChecked, ElementName=pathToggle}"
Text="{Binding DownloadPath, UpdateSourceTrigger=PropertyChanged}"/>
<Button
x:Name="browseButton"
Margin="1,0,1,0"
Style="{StaticResource MaterialDesignFlatButton}"
IsEnabled="{Binding Path=IsChecked, ElementName=pathToggle}"
Command="{Binding BrowseFolder}"
CommandParameter="DownloadPath">Browse</Button>
<Button
x:Name="openFolderButton"
Margin="1,0,1,0"
Style="{StaticResource MaterialDesignFlatButton}"
Command="{Binding OpenFolder}">Open Folder</Button>
</StackPanel>
</Grid>

<TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}" Grid.Row="1" Grid.Column="0" Margin="8" VerticalAlignment="Center">Options</TextBlock>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
<TextBlock VerticalAlignment="Center" Margin="8">Container</TextBlock>
<ComboBox ItemsSource="{Binding ContainerList}"
Text="{Binding Container}"
IsEditable="True"
IsReadOnly="False"
IsTextSearchCaseSensitive="True"
StaysOpenOnEdit="True"
Margin="0 8 8 8">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
<TextBlock VerticalAlignment="Center" Margin="8">Format</TextBlock>
<ComboBox ItemsSource="{Binding FormatList}"
Text="{Binding Format}"
IsEnabled="{Binding EnableFormatSelection}"
IsEditable="True"
IsReadOnly="False"
StaysOpenOnEdit="True"
Margin="0 8 8 8">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1">
<ToggleButton
x:Name="metadataToggle"
Margin="8"
IsChecked="{Binding AddMetadata}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Add Metadata</TextBlock>
<ToggleButton
x:Name="thumbnailToggle"
Margin="8"
IsChecked="{Binding DownloadThumbnail}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Download Thumbnail</TextBlock>
<ToggleButton
x:Name="subtitlesToggle"
Margin="8"
IsChecked="{Binding DownloadSubtitles}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Download Subtitles</TextBlock>
<ToggleButton
x:Name="playlistToggle"
Margin="8"
IsChecked="{Binding DownloadPlaylist}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Download Playlist</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1">
<ToggleButton
x:Name="pathToggle"
Margin="8"
IsChecked="{Binding UseCustomPath}"/>
<TextBlock VerticalAlignment="Center" Margin="0,8,8,8">Custom Download Path</TextBlock>
<TextBox
x:Name="pathTextBox"
Margin="8,8,1,8"
Width="384"
IsEnabled="{Binding Path=IsChecked, ElementName=pathToggle}"
Text="{Binding DownloadPath, UpdateSourceTrigger=PropertyChanged}"/>
<Button
x:Name="browseButton"
Margin="1,0,1,0"
Style="{StaticResource MaterialDesignFlatButton}"
IsEnabled="{Binding Path=IsChecked, ElementName=pathToggle}"
Command="{Binding BrowseFolder}"
CommandParameter="DownloadPath">Browse</Button>
<Button
x:Name="openFolderButton"
Margin="1,0,1,0"
Style="{StaticResource MaterialDesignFlatButton}"
Command="{Binding OpenFolder}">Open Folder</Button>
</StackPanel>
</Grid>
</ScrollViewer>
<TextBlock Grid.Row="2" Margin="8,20,8,8" Style="{StaticResource MaterialDesignHeadline5TextBlock}">Results</TextBlock>
<TextBox
Expand Down
Loading

0 comments on commit 0566edf

Please sign in to comment.