<Compile Include="Services\Encode\Model\Models\DenoisePreset.cs" />\r
<Compile Include="Services\Encode\Model\Models\DenoiseTune.cs" />\r
<Compile Include="Services\Encode\Model\Models\FramerateMode.cs" />\r
+ <Compile Include="Services\Encode\Model\Models\MetaData.cs" />\r
<Compile Include="Services\Encode\Model\Models\OutputFormat.cs" />\r
<Compile Include="Services\Encode\Model\Models\PointToPointMode.cs" />\r
<Compile Include="Services\Encode\Model\Models\SubtitleTrack.cs" />\r
<Compile Include="Controls\SourceSelection.xaml.cs">\r
<DependentUpon>SourceSelection.xaml</DependentUpon>\r
</Compile>\r
+ <Compile Include="ViewModels\Interfaces\IMetaDataViewModel.cs" />\r
<Compile Include="ViewModels\Interfaces\IPopupWindowViewModel.cs" />\r
<Compile Include="ViewModels\Interfaces\IStaticPreviewViewModel.cs" />\r
<Compile Include="ViewModels\Interfaces\IMiniViewModel.cs" />\r
<Compile Include="ViewModels\Interfaces\ISubtitlesDefaultsViewModel.cs" />\r
+ <Compile Include="ViewModels\MetaDataViewModel.cs" />\r
<Compile Include="ViewModels\MiniViewModel.cs" />\r
<Compile Include="ViewModels\PopupWindowViewModel.cs" />\r
<Compile Include="ViewModels\StaticPreviewViewModel.cs" />\r
<Compile Include="Views\AudioDefaultsView.xaml.cs">\r
<DependentUpon>AudioDefaultsView.xaml</DependentUpon>\r
</Compile>\r
+ <Compile Include="Views\MetaDataView.xaml.cs">\r
+ <DependentUpon>MetaDataView.xaml</DependentUpon>\r
+ </Compile>\r
<Compile Include="Views\PopupWindowView.xaml.cs">\r
<DependentUpon>PopupWindowView.xaml</DependentUpon>\r
</Compile>\r
<Generator>MSBuild:Compile</Generator>\r
<SubType>Designer</SubType>\r
</Page>\r
+ <Page Include="Views\MetaDataView.xaml">\r
+ <SubType>Designer</SubType>\r
+ <Generator>MSBuild:Compile</Generator>\r
+ </Page>\r
<Page Include="Views\PopupWindowView.xaml">\r
<Generator>MSBuild:Compile</Generator>\r
<SubType>Designer</SubType>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Meta Data.\r
+ /// </summary>\r
+ public static string MainView_MetaDataTab {\r
+ get {\r
+ return ResourceManager.GetString("MainView_MetaDataTab", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Options.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Meta Data.\r
+ /// </summary>\r
+ public static string MetaDataView_Title {\r
+ get {\r
+ return ResourceManager.GetString("MetaDataView_Title", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Clear Log files older than 30 days.\r
/// </summary>\r
<data name="AudioDefaultView_Behaviours" xml:space="preserve">\r
<value>Choose Behaviors:</value>\r
</data>\r
+ <data name="MetaDataView_Title" xml:space="preserve">\r
+ <value>Meta Data</value>\r
+ </data>\r
+ <data name="MainView_MetaDataTab" xml:space="preserve">\r
+ <value>Meta Data</value>\r
+ </data>\r
</root>
\ No newline at end of file
{
Metadata metaData = new Metadata();
- /* TODO NOT SUPPORTED YET. */
+ if (job.MetaData != null)
+ {
+ metaData.Artist = job.MetaData.Artist;
+ metaData.AlbumArtist = job.MetaData.AlbumArtist;
+ metaData.Comment = job.MetaData.Comment;
+ metaData.Composer = job.MetaData.Composer;
+ metaData.Description = job.MetaData.Description;
+ metaData.Genre = job.MetaData.Genre;
+ metaData.LongDescription = job.MetaData.LongDescription;
+ metaData.Name = job.MetaData.Name;
+ metaData.ReleaseDate = job.MetaData.ReleaseDate;
+ }
+
return metaData;
}
}
using HandBrake.ApplicationServices.Interop.Model;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrakeWPF.Services.Encode.Model.Models;
using HandBrakeWPF.Utilities;
using AllowedPassthru = HandBrakeWPF.Services.Encode.Model.Models.AllowedPassthru;
this.ChapterNames = new ObservableCollection<ChapterMarker>();
this.AllowedPassthruOptions = new AllowedPassthru();
this.Modulus = 16;
+ this.MetaData = new MetaData();
this.VideoTunes = new List<VideoTune>();
}
this.VideoTunes = new List<VideoTune>(task.VideoTunes);
this.ExtraAdvancedArguments = task.ExtraAdvancedArguments;
+ this.MetaData = new MetaData(task.MetaData);
+
this.ShowAdvancedTab = task.ShowAdvancedTab;
}
#endregion
+ #region MetaData
+
+ public MetaData MetaData { get; set; }
+ #endregion
+
#region Preview
/// <summary>
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="MetaData.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// An MetaData Class
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Services.Encode.Model.Models
+{
+ public class MetaData
+ {
+ private string albumArtist;
+
+ /// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary>
+ public MetaData()
+ {
+ }
+
+ /// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary>
+ public MetaData(MetaData metadata)
+ {
+ if (metadata != null)
+ {
+ this.AlbumArtist = metadata.AlbumArtist;
+ this.Artist = metadata.Artist;
+ this.Comment = metadata.Comment;
+ this.Composer = metadata.Composer;
+ this.Description = metadata.Description;
+ this.Genre = metadata.Genre;
+ this.LongDescription = metadata.LongDescription;
+ this.Name = metadata.Name;
+ this.ReleaseDate = metadata.ReleaseDate;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the album artist.
+ /// </summary>
+ public string AlbumArtist
+ {
+ get
+ {
+ return this.albumArtist;
+ }
+ set
+ {
+ this.albumArtist = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the artist.
+ /// </summary>
+ public string Artist { get; set; }
+
+ /// <summary>
+ /// Gets or sets the comment.
+ /// </summary>
+ public string Comment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the composer.
+ /// </summary>
+ public string Composer { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the genre.
+ /// </summary>
+ public string Genre { get; set; }
+
+ /// <summary>
+ /// Gets or sets the long description.
+ /// </summary>
+ public string LongDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the release date.
+ /// </summary>
+ public string ReleaseDate { get; set; }
+ }
+}
this.container.Singleton<ISubtitlesViewModel, SubtitlesViewModel>();\r
this.container.Singleton<IFiltersViewModel, FiltersViewModel>();\r
this.container.Singleton<IVideoViewModel, VideoViewModel>();\r
+ this.container.Singleton<IMetaDataViewModel, MetaDataViewModel>();\r
\r
// Shell\r
this.container.Singleton<IShellViewModel, ShellViewModel>();\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IMetaDataViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Meta Data Tab
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ public interface IMetaDataViewModel : ITabInterface
+ {
+ }
+}
/// <param name="queueViewModel">\r
/// The queue View Model.\r
/// </param>\r
+ /// <param name="metaDataViewModel">\r
+ /// The Meta Data View Model\r
+ /// </param>\r
public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService, \r
IErrorService errorService, IUpdateService updateService, \r
IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, \r
IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel, \r
IAdvancedViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,\r
- IQueueViewModel queueViewModel)\r
+ IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel)\r
{\r
this.scanService = scanService;\r
this.encodeService = encodeService;\r
\r
this.PictureSettingsViewModel = pictureSettingsViewModel;\r
this.VideoViewModel = videoViewModel;\r
+ this.MetaDataViewModel = metaDataViewModel;\r
this.FiltersViewModel = filtersViewModel;\r
this.AudioViewModel = audioViewModel;\r
this.SubtitleViewModel = subtitlesViewModel;\r
/// </summary>\r
public IStaticPreviewViewModel StaticPreviewViewModel { get; set; }\r
\r
+ /// <summary>\r
+ /// The MetaData View Model\r
+ /// </summary>\r
+ public IMetaDataViewModel MetaDataViewModel { get; set; }\r
+\r
#endregion\r
\r
#region Properties\r
this.SubtitleViewModel.SetPreset(this.SelectedPreset, this.CurrentTask);\r
this.ChaptersViewModel.SetPreset(this.SelectedPreset, this.CurrentTask);\r
this.AdvancedViewModel.SetPreset(this.SelectedPreset, this.CurrentTask);\r
+ this.MetaDataViewModel.SetPreset(this.SelectedPreset, this.CurrentTask);\r
\r
// Do this again to force an update for m4v/mp4 selection\r
this.SelectedOutputFormat = selectedPreset.Task.OutputFormat;\r
this.SubtitleViewModel.UpdateTask(this.CurrentTask);\r
this.ChaptersViewModel.UpdateTask(this.CurrentTask);\r
this.AdvancedViewModel.UpdateTask(this.CurrentTask);\r
+ this.MetaDataViewModel.UpdateTask(this.CurrentTask);\r
\r
// Cleanup\r
this.ShowStatusWindow = false;\r
this.SubtitleViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);\r
this.ChaptersViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);\r
this.AdvancedViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);\r
+ this.MetaDataViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);\r
}\r
}\r
\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="MetaDataViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Meta Data Tab
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using Caliburn.Micro;
+
+ using HandBrakeWPF.Services.Encode.Model;
+ using HandBrakeWPF.Services.Encode.Model.Models;
+ using HandBrakeWPF.Services.Interfaces;
+ using HandBrakeWPF.Services.Presets.Model;
+ using HandBrakeWPF.Services.Scan.Model;
+ using HandBrakeWPF.ViewModels.Interfaces;
+ public class MetaDataViewModel : ViewModelBase, IMetaDataViewModel
+ {
+ private EncodeTask task;
+ private MetaData metaData;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ViewModelBase"/> class.
+ /// </summary>
+ public MetaDataViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ this.Task = new EncodeTask();
+ }
+
+ /// <summary>
+ /// The Current Job
+ /// </summary>
+ public EncodeTask Task
+ {
+ get
+ {
+ return this.task;
+ }
+ set
+ {
+ this.task = value;
+
+ if (this.task != null)
+ {
+ this.MetaData = this.task.MetaData;
+ }
+
+ this.NotifyOfPropertyChange(() => this.Task);
+ }
+ }
+
+ public MetaData MetaData
+ {
+ get
+ {
+ return this.metaData;
+ }
+ set
+ {
+ this.metaData = value;
+ this.NotifyOfPropertyChange(() => this.MetaData);
+ }
+ }
+
+ /// <summary>
+ /// Setup the window after a scan.
+ /// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
+ /// <param name="selectedTitle">
+ /// The selected title.
+ /// </param>
+ /// <param name="currentPreset">
+ /// The Current preset
+ /// </param>
+ /// <param name="encodeTask">
+ /// The task.
+ /// </param>
+ public void SetSource(Source source, Title selectedTitle, Preset currentPreset, EncodeTask encodeTask)
+ {
+ this.Task = encodeTask;
+ }
+
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ /// <param name="encodeTask">
+ /// The task.
+ /// </param>
+ public void SetPreset(Preset preset, EncodeTask encodeTask)
+ {
+ this.Task = encodeTask;
+ }
+
+ /// <summary>
+ /// Update all the UI controls based on the encode task passed in.
+ /// </summary>
+ /// <param name="encodeTask">
+ /// The task.
+ /// </param>
+ public void UpdateTask(EncodeTask encodeTask)
+ {
+ this.Task = encodeTask;
+ }
+ }
+}
--- /dev/null
+<UserControl x:Class="HandBrakeWPF.Views.MetaDataView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ mc:Ignorable="d"
+ d:DesignHeight="300" d:DesignWidth="500">
+
+ <UserControl.Resources>
+ <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ </UserControl.Resources>
+
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Text="{x:Static Properties:ResourcesUI.MetaDataView_Title}" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" />
+
+ <!-- Metadata Input Area -->
+ <Grid Grid.Row="1" Margin="10,10,0,0">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ <RowDefinition Height="Auto" MinHeight="25" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" MinWidth="100" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Text="Album Artist:" Grid.Row="0" />
+ <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding MetaData.AlbumArtist, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Artist:" Grid.Row="1" Grid.Column="0" />
+ <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding MetaData.Artist, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Comment:" Grid.Row="2" Grid.Column="0" />
+ <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding MetaData.Comment, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Composer:" Grid.Row="3" Grid.Column="0" />
+ <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding MetaData.Composer, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Description:" Grid.Row="4" Grid.Column="0" />
+ <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding MetaData.Description, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Genre:" Grid.Row="5" Grid.Column="0" />
+ <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding MetaData.Genre, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Long Description:" Grid.Row="6" Grid.Column="0" />
+ <TextBox Grid.Row="6" Grid.Column="1" Text="{Binding MetaData.LongDescription, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Name:" Grid.Row="7" Grid.Column="0" />
+ <TextBox Grid.Row="7" Grid.Column="1" Text="{Binding MetaData.Name, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+
+ <TextBlock Text="Release Date:" Grid.Row="8" Grid.Column="0" />
+ <TextBox Grid.Row="8" Grid.Column="1" Text="{Binding MetaData.ReleaseDate, UpdateSourceTrigger=PropertyChanged}" Width="350" VerticalAlignment="Center" />
+ </Grid>
+
+ </Grid>
+
+</UserControl>
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace HandBrakeWPF.Views
+{
+ /// <summary>
+ /// Interaction logic for MetaDataView.xaml
+ /// </summary>
+ public partial class MetaDataView : UserControl
+ {
+ public MetaDataView()
+ {
+ InitializeComponent();
+ }
+ }
+}
\r
<Style TargetType="{x:Type TextBox}">\r
<Setter Property="VerticalContentAlignment" Value="Center"/>\r
+ <Setter Property="MinHeight" Value="20"/>\r
</Style>\r
\r
<Style TargetType="{x:Type Button}">\r