Skip to content

Commit

Permalink
Fixed possible scan issue where the feature title is not available in…
Browse files Browse the repository at this point in the history
… the list of titles.

Fixed bug causing denoise tune to not apply.
Fixed crash that could occur when searching for backup database.
Fixed issue where job count becomes incorrect after editing a queue item.
Updated translations.
  • Loading branch information
RandomEngy committed Jan 15, 2018
1 parent c6cfbbd commit dd3e7dd
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,6 +1,10 @@
Installer/BuiltInstallers/*
Flags/*
packages/*
*/AppPackages/*
*/BundleArtifacts/*
VidCoderPackage_StoreKey.pfx
_pkginfo.txt
Import/*
HandBrakeInterop.XmlSerializers.dll
.vs
Expand Down
5 changes: 5 additions & 0 deletions VidCoder/Model/Database.cs
Expand Up @@ -232,6 +232,11 @@ private static void BackupDatabaseFile(int databaseVersion)
private static int FindBackupDatabaseFile()
{
DirectoryInfo backupDirectoryInfo = new DirectoryInfo(BackupDatabaseFolder);
if (!backupDirectoryInfo.Exists)
{
return -1;
}

FileInfo[] backupFiles = backupDirectoryInfo.GetFiles();
Regex regex = new Regex(@"^VidCoder-v(?<version>\d+)\.sqlite$");

Expand Down
2 changes: 1 addition & 1 deletion VidCoder/Resources/Translations/ChapterMarkersRes.it.resx
Expand Up @@ -99,7 +99,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ChapterMarkersDialogTitle">
<value xml:space="preserve">Marcatori Capitolo</value>
<value xml:space="preserve">Marcatori capitolo</value>
</data>
<data name="DefaultChapterNamesRadioButton">
<value xml:space="preserve">Utilizzare i nomi predefiniti del capitolo</value>
Expand Down
2 changes: 1 addition & 1 deletion VidCoder/Resources/Translations/EncodeDetailsRes.it.resx
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="EncodeDetailsWindowTitle" xml:space="preserve">
<value>Dettagli di codifica</value>
<value>Dettagli della codifica</value>
</data>
<data name="QueueSectionHeader" xml:space="preserve">
<value>Tutti i file in coda</value>
Expand Down
12 changes: 6 additions & 6 deletions VidCoder/Resources/Translations/EncodingRes.it.resx
Expand Up @@ -346,7 +346,7 @@ Per sorgente audio che ha un'ampia gamma dinamica (sequenze molto forti e molto
<value>Dimensione del bersaglio (MB)</value>
</data>
<data name="AverageBitrateRadioButton" xml:space="preserve">
<value>AVG Bitrate (kbps)</value>
<value>Velocità di trasferimento media (kbps)</value>
</data>
<data name="ConstantQualityRadioButton" xml:space="preserve">
<value>Qualità costante</value>
Expand All @@ -361,7 +361,7 @@ Per sorgente audio che ha un'ampia gamma dinamica (sequenze molto forti e molto
<value>Preimpostato:</value>
</data>
<data name="TuneLabel" xml:space="preserve">
<value>Melodia:</value>
<value>Regolazione:</value>
</data>
<data name="Profile_baseline" xml:space="preserve">
<value>Linea di base</value>
Expand Down Expand Up @@ -722,13 +722,13 @@ Per sorgente audio che ha un'ampia gamma dinamica (sequenze molto forti e molto
<value>Ulteriori opzioni avanzate x264:</value>
</data>
<data name="LevelToolTip" xml:space="preserve">
<value>Imposta e garantisce la conformità con il livello specificato di h. 264. Esegue l'override di tutte le altre impostazioni.</value>
<value>Imposta e garantisce la conformità con il livello specificato di h. 264. Sovvrascrive tutte le altre impostazioni.</value>
</data>
<data name="Profile_high444" xml:space="preserve">
<value>Alta 4:4:4 predittiva</value>
</data>
<data name="VideoCodecLabel" xml:space="preserve">
<value>Codec video:</value>
<value>Codificatore video:</value>
</data>
<data name="VideoEncoder_ffmpeg2" xml:space="preserve">
<value>MPEG-2 (Libav)</value>
Expand Down Expand Up @@ -811,7 +811,7 @@ Per sorgente audio che ha un'ampia gamma dinamica (sequenze molto forti e molto
<value>Passthrough non funziona su tutti i codec audio. Questo specifica l'encoder per ripiegare se la traccia non può essere passata attraverso.</value>
</data>
<data name="EncoderSettings" xml:space="preserve">
<value>Impostazioni encoder</value>
<value>Impostazioni codificatore</value>
</data>
<data name="QsvDecodingLabel" xml:space="preserve">
<value>QSV decodifica</value>
Expand All @@ -832,7 +832,7 @@ Per sorgente audio che ha un'ampia gamma dinamica (sequenze molto forti e molto
<value>Qualità</value>
</data>
<data name="PresetToolTip" xml:space="preserve">
<value>Modificare le opzioni di commercio fuori contro la velocità di codifica di compressione efficienza.</value>
<value>Modifica il valore per bilanciare la qualità del video compresso con la velocità di codifica.</value>
</data>
<data name="ScaleMethodToolTip" xml:space="preserve">
<value>Lanczos: Questo è il ridimensionamento predefinito con la migliore qualità. Bicubica: Questo è un algoritmo di ridimensionamento accelerato OpenCL hardware.</value>
Expand Down
2 changes: 1 addition & 1 deletion VidCoder/Resources/Translations/EnumsRes.it.resx
Expand Up @@ -145,7 +145,7 @@
<value>Veloce</value>
</data>
<data name="Default" xml:space="preserve">
<value>Impostazione Predefinita</value>
<value>Impostazione predefinita</value>
</data>
<data name="DeinterlacePreset_bob" xml:space="preserve">
<value>Bob</value>
Expand Down
4 changes: 2 additions & 2 deletions VidCoder/Resources/Translations/MainRes.it.resx
Expand Up @@ -593,7 +593,7 @@
<value>Chiudere il file corrente e aprire il disco?</value>
</data>
<data name="EncodeDetailsMenuItem" xml:space="preserve">
<value>Dettagli di codifica</value>
<value>Dettagli della codifica</value>
</data>
<data name="EncodingSettingsChangedMessage" xml:space="preserve">
<value>Impostazioni di codifica sono cambiate da quando l'ultima aggiunto un elemento alla coda. Si desidera applicare le impostazioni di codifica corrente a tutti gli elementi nella coda?</value>
Expand All @@ -613,7 +613,7 @@
<comment>Dialog title for a message explaining that the current database file is unsupported.</comment>
</data>
<data name="PickerMenuItem" xml:space="preserve">
<value>Selettore</value>
<value>Selezione</value>
</data>
<data name="CouldNotLoadPickerMessage" xml:space="preserve">
<value>Impossibile caricare il selettore: </value>
Expand Down
6 changes: 3 additions & 3 deletions VidCoder/Resources/Translations/PreviewRes.it.resx
Expand Up @@ -118,10 +118,10 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="PlaySourceButton" xml:space="preserve">
<value>Play Sorgente</value>
<value>Riproduci sorgente</value>
</data>
<data name="EncodePreviewClipButton" xml:space="preserve">
<value>Codifica Clip di anteprima</value>
<value>Codifica spezzone di anteprima</value>
</data>
<data name="EncodePreviewClipToolTip" xml:space="preserve">
<value>Codifica e gioca una piccola anteprima clip dallo schermo selezionato. Utilizza le impostazioni di codifica corrente.</value>
Expand Down Expand Up @@ -157,7 +157,7 @@
<value>secondi</value>
</data>
<data name="PreviewDisplay_Corners" xml:space="preserve">
<value>Angoli</value>
<value>Margini</value>
</data>
<data name="PreviewDisplay_FitToWindow" xml:space="preserve">
<value>Adatta alla finestra</value>
Expand Down
6 changes: 5 additions & 1 deletion VidCoder/Utilities/Utilities.cs
Expand Up @@ -490,7 +490,11 @@ public static SourceTitle GetFeatureTitle(List<SourceTitle> titles, int hbFeatur
// If the feature title is supplied, find it in the list.
if (hbFeatureTitle > 0)
{
return titles.FirstOrDefault(title => title.Index == hbFeatureTitle);
SourceTitle featureTitle = titles.FirstOrDefault(title => title.Index == hbFeatureTitle);
if (featureTitle != null)
{
return featureTitle;
}
}

// Select the first title within 80% of the duration of the longest title.
Expand Down
2 changes: 1 addition & 1 deletion VidCoder/ViewModel/MainViewModel.cs
Expand Up @@ -2146,7 +2146,7 @@ public void EditJob(EncodeJobViewModel jobVM, bool isQueueItem = true)
if (isQueueItem)
{
// Since it's been sent back for editing, remove the queue item
this.ProcessingService.EncodeQueue.Remove(jobVM);
this.ProcessingService.RemoveQueueJob(jobVM);
}

this.PresetsService.SaveUserPresets();
Expand Down
34 changes: 17 additions & 17 deletions VidCoderCommon/Model/JsonEncodeFactory.cs
Expand Up @@ -373,7 +373,7 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
Filter filterItem = new Filter
{
ID = (int)hb_filter_ids.HB_FILTER_DETELECINE,
Settings = this.GetFilterSettings(hb_filter_ids.HB_FILTER_DETELECINE, presetString, settingsString)
Settings = this.GetFilterSettingsPresetOnly(hb_filter_ids.HB_FILTER_DETELECINE, presetString, settingsString)
};
filters.FilterList.Add(filterItem);
}
Expand All @@ -388,11 +388,11 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
JToken settings;
if (profile.DeinterlacePreset == "custom")
{
settings = this.GetFilterSettings(filterId, "custom", profile.CustomDeinterlace);
settings = this.GetFilterSettingsPresetOnly(filterId, "custom", profile.CustomDeinterlace);
}
else
{
settings = this.GetFilterSettings(filterId, profile.DeinterlacePreset, null);
settings = this.GetFilterSettingsPresetOnly(filterId, profile.DeinterlacePreset, null);
}

if (settings != null)
Expand All @@ -408,11 +408,11 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
JToken settings;
if (profile.CombDetect == "custom")
{
settings = this.GetFilterSettings(hb_filter_ids.HB_FILTER_COMB_DETECT, "custom", profile.CustomCombDetect);
settings = this.GetFilterSettingsPresetOnly(hb_filter_ids.HB_FILTER_COMB_DETECT, "custom", profile.CustomCombDetect);
}
else
{
settings = this.GetFilterSettings(hb_filter_ids.HB_FILTER_COMB_DETECT, profile.CombDetect, null);
settings = this.GetFilterSettingsPresetOnly(hb_filter_ids.HB_FILTER_COMB_DETECT, profile.CombDetect, null);
}

if (settings != null)
Expand Down Expand Up @@ -462,7 +462,7 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
// Deblock
if (profile.Deblock >= 5)
{
JToken settings = this.GetFilterSettings(
JToken settings = this.GetFilterSettingsCustom(
hb_filter_ids.HB_FILTER_DEBLOCK,
string.Format(CultureInfo.InvariantCulture, "qp={0}", profile.Deblock));

Expand All @@ -480,11 +480,11 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
JToken settings;
if (profile.DenoisePreset == "custom")
{
settings = this.GetFilterSettings(filterId, "custom", profile.CustomDenoise);
settings = this.GetFilterSettingsPresetOnly(filterId, "custom", profile.CustomDenoise);
}
else
{
settings = this.GetFilterSettings(filterId, profile.DenoisePreset, profile.DenoiseTune);
settings = this.GetFilterSettingsPresetAndTune(filterId, profile.DenoisePreset, profile.DenoiseTune, null);
}

if (settings != null)
Expand All @@ -496,7 +496,7 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn

// CropScale Filter
VCCropping cropping = GetCropping(profile, title);
JToken cropFilterSettings = this.GetFilterSettings(
JToken cropFilterSettings = this.GetFilterSettingsCustom(
hb_filter_ids.HB_FILTER_CROP_SCALE,
string.Format(
CultureInfo.InvariantCulture,
Expand Down Expand Up @@ -535,7 +535,7 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
flipHorizontal = true;
}

JToken rotateSettings = this.GetFilterSettings(
JToken rotateSettings = this.GetFilterSettingsCustom(
hb_filter_ids.HB_FILTER_ROTATE,
string.Format(
CultureInfo.InvariantCulture,
Expand Down Expand Up @@ -563,7 +563,7 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
{
var padColor = !string.IsNullOrEmpty(profile.PadColor) ? profile.PadColor : "000000";

JToken padSettings = this.GetFilterSettings(
JToken padSettings = this.GetFilterSettingsCustom(
hb_filter_ids.HB_FILTER_PAD,
FormattableString.Invariant($"width={outputSizeInfo.OutputWidth}:height={outputSizeInfo.OutputHeight}:x={outputSizeInfo.Padding.Left}:y={outputSizeInfo.Padding.Top}:color=0x{padColor}"));
Filter filterItem = new Filter { ID = (int)hb_filter_ids.HB_FILTER_PAD, Settings = padSettings };
Expand All @@ -573,17 +573,17 @@ private Filters CreateFilters(VCProfile profile, SourceTitle title, OutputSizeIn
return filters;
}

private JToken GetFilterSettings(hb_filter_ids filter, string custom)
private JToken GetFilterSettingsCustom(hb_filter_ids filter, string custom)
{
return this.GetFilterSettings(filter, null, null, custom);
return this.GetFilterSettingsPresetAndTune(filter, null, null, custom);
}

private JToken GetFilterSettings(hb_filter_ids filter, string preset, string custom)
private JToken GetFilterSettingsPresetOnly(hb_filter_ids filter, string preset, string custom)
{
return this.GetFilterSettings(filter, preset, null, custom);
return this.GetFilterSettingsPresetAndTune(filter, preset, null, custom);
}

private JToken GetFilterSettings(hb_filter_ids filter, string preset, string tune, string custom)
private JToken GetFilterSettingsPresetAndTune(hb_filter_ids filter, string preset, string tune, string custom)
{
custom = custom?.Trim();

Expand All @@ -601,7 +601,7 @@ private JToken GetFilterSettings(hb_filter_ids filter, string preset, string tun

private JToken GetFramerateSettings(int framerateMode, int framerateNumerator, int framerateDenominator)
{
return this.GetFilterSettings(
return this.GetFilterSettingsCustom(
hb_filter_ids.HB_FILTER_VFR,
string.Format(
CultureInfo.InvariantCulture,
Expand Down

0 comments on commit dd3e7dd

Please sign in to comment.