Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 7e0676c

Browse files
committed
Version 1.1.3
1 parent 4cad943 commit 7e0676c

5 files changed

Lines changed: 39 additions & 20 deletions

File tree

DCP Ripper/DCP Ripper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net6.0-windows</TargetFramework>
3+
<TargetFramework>net8.0-windows</TargetFramework>
44
<OutputType>WinExe</OutputType>
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
<UseWindowsForms>true</UseWindowsForms>

DCP Ripper/MainWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
<TextBlock Text="Downmix:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,60,0,0"/>
113113
<ComboBox x:Name="downmix" HorizontalAlignment="Left" Width="141" Margin="67,57,0,0" VerticalAlignment="Top">
114114
<ComboBoxItem x:Name="downmix_Bypass" Content="Bypass"/>
115-
<ComboBoxItem x:Name="downmix_GainKeeping51" Content="Gain-keeping 5.1"/>
116-
<ComboBoxItem x:Name="downmix_Surround" Content="5.1 or 7.1 if available" IsSelected="True"/>
115+
<ComboBoxItem x:Name="downmix_GainKeeping51" Content="Gain-keeping 5.1 (strip HI/VI/syncs)"/>
116+
<ComboBoxItem x:Name="downmix_Surround" Content="5.1 or 7.1 if available (strip HI/VI/syncs)" IsSelected="True"/>
117117
<ComboBoxItem x:Name="downmix_RawMapping" Content="Raw mapping"/>
118118
<ComboBoxItem x:Name="downmix_Cavern" Content="Render with Cavern"/>
119119
</ComboBox>

DCP Ripper/Processing/Downmix.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ public static void GainKeeping51(RIFFWaveReader input, string output) {
8585
while (progress < input.Length) {
8686
input.ReadBlock(inData, 0, blockSize);
8787
// 6-7 are hearing/visually impaired tracks, 12+ are sync signals
88-
for (int i = 8; i < Math.Min(inData.Length, 12); ++i)
88+
for (int i = 8; i < Math.Min(inData.Length, 12); i++) {
8989
WaveformUtils.Mix(inData[i], inData[4 + i % 2]);
90+
}
9091
writer.WriteBlock(outData, 0, Math.Min(blockSize, input.Length - progress));
9192
progress += blockSize;
9293
}

DCP Ripper/Processing/PlaylistProcessor.cs

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,24 @@ public PlaylistProcessor(string cplPath) {
5656
Dictionary<string, string> assets = ParseAssetMap(directory);
5757
Reel reel = new();
5858
using XmlReader reader = XmlReader.Create(cplPath);
59-
bool video = true;
59+
bool video = false,
60+
audio = false;
6061
while (reader.Read()) {
6162
if (reader.NodeType != XmlNodeType.Element) {
62-
if (reader.NodeType == XmlNodeType.EndElement && reader.Name.Equals("Reel"))
63-
Contents.Add(reel);
63+
if (reader.NodeType == XmlNodeType.EndElement) {
64+
switch (reader.Name) {
65+
case "Reel":
66+
Contents.Add(reel);
67+
break;
68+
case "MainPicture":
69+
case "MainStereoscopicPicture":
70+
video = false;
71+
break;
72+
case "MainSound":
73+
audio = false;
74+
break;
75+
}
76+
}
6477
continue;
6578
} else if (reader.Name.EndsWith("MainStereoscopicPicture")) {
6679
video = true;
@@ -71,37 +84,40 @@ public PlaylistProcessor(string cplPath) {
7184
case "Id":
7285
reader.Read();
7386
if (assets.ContainsKey(reader.Value)) {
74-
if (video)
87+
if (video) {
7588
reel.videoFile = directory + assets[reader.Value];
76-
else
89+
} else if (audio) {
7790
reel.audioFile = directory + assets[reader.Value];
91+
}
7892
} else { // Try to parse a single reel content with a missing asset map
7993
List<string> bulkAssets = Finder.ForceGetAssets(directory);
8094
if (bulkAssets.Count == 2) {
8195
long size0 = new FileInfo(bulkAssets[0]).Length, size1 = new FileInfo(bulkAssets[1]).Length;
82-
if (video)
96+
if (video) {
8397
reel.videoFile = bulkAssets[size0 < size1 ? 1 : 0];
84-
else
98+
} else if (audio) {
8599
reel.audioFile = bulkAssets[size1 < size0 ? 1 : 0];
100+
}
86101
}
87102
}
88103
break;
89104
case "EntryPoint":
90105
reader.Read();
91-
if (video)
106+
if (video) {
92107
reel.videoStartFrame = int.Parse(reader.Value);
93-
else
108+
} else if (audio) {
94109
reel.audioStartFrame = int.Parse(reader.Value);
110+
}
95111
break;
96112
case "Duration":
97113
reader.Read();
98114
reel.duration = int.Parse(reader.Value);
99115
break;
100116
case "FrameRate":
101117
reader.Read();
102-
int split = reader.Value.IndexOf(' ');
103118
if (string.IsNullOrWhiteSpace(reader.Value)) // Handles <FrameRate />
104119
break;
120+
int split = reader.Value.IndexOf(' ');
105121
reel.framerate = int.Parse(reader.Value[..split]) / float.Parse(reader.Value[split..]);
106122
if (reel.is3D)
107123
reel.framerate *= .5f;
@@ -113,14 +129,16 @@ public PlaylistProcessor(string cplPath) {
113129
video = true;
114130
break;
115131
case "MainSound":
116-
video = false;
132+
audio = true;
117133
break;
118134
case "MainSubtitle":
119135
case "ns1:AuxData":
120136
case "axd:AuxData":
137+
case "axd-cpl:AuxData":
121138
string name = reader.Name;
122-
while (reader.Read() &&
123-
(reader.NodeType != XmlNodeType.EndElement || !reader.Name.Equals(name))) ;
139+
while (reader.Read() && (reader.NodeType != XmlNodeType.EndElement || !reader.Name.Equals(name))) {
140+
// Skip these blocks, they can't be parsed
141+
}
124142
break;
125143
case "KeyId":
126144
reel.needsKey = true;

DCP Ripper/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
[assembly: AssemblyConfiguration("")]
88
[assembly: AssemblyCompany("VoidX")]
99
[assembly: AssemblyProduct("DCP Ripper")]
10-
[assembly: AssemblyCopyright("Copyright © VoidX 2019-2023")]
10+
[assembly: AssemblyCopyright("Copyright © VoidX 2019-2025")]
1111
[assembly: AssemblyTrademark("")]
1212
[assembly: AssemblyCulture("")]
1313
[assembly: ComVisible(false)]
1414
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
15-
[assembly: AssemblyVersion("1.1.2")]
16-
[assembly: AssemblyFileVersion("1.1.2")]
15+
[assembly: AssemblyVersion("1.1.3")]
16+
[assembly: AssemblyFileVersion("1.1.3")]

0 commit comments

Comments
 (0)