Renamed CUETools.Codecs.BLDLPCM into CUETools.Codecs.MPEG

This commit is contained in:
Grigory Chudov
2018-04-07 21:09:28 -04:00
parent bfcbd825b2
commit 513ab1c64e
14 changed files with 1689 additions and 1691 deletions

View File

@@ -1,45 +1,45 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Text; using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace CUETools.Codecs.BDLPCM namespace CUETools.Codecs.MPEG.BDLPCM
{ {
[JsonObject(MemberSerialization.OptIn)] [JsonObject(MemberSerialization.OptIn)]
public class DecoderSettings : IAudioDecoderSettings public class DecoderSettings : IAudioDecoderSettings
{ {
#region IAudioDecoderSettings implementation #region IAudioDecoderSettings implementation
[Browsable(false)] [Browsable(false)]
public string Extension => "m2ts"; public string Extension => "m2ts";
[Browsable(false)] [Browsable(false)]
public string Name => "cuetools"; public string Name => "cuetools";
[Browsable(false)] [Browsable(false)]
public Type DecoderType => typeof(AudioDecoder); public Type DecoderType => typeof(AudioDecoder);
[Browsable(false)] [Browsable(false)]
public int Priority => 2; public int Priority => 2;
public IAudioDecoderSettings Clone() public IAudioDecoderSettings Clone()
{ {
return MemberwiseClone() as IAudioDecoderSettings; return MemberwiseClone() as IAudioDecoderSettings;
} }
#endregion #endregion
public DecoderSettings() public DecoderSettings()
{ {
this.Init(); this.Init();
} }
[DefaultValue(true)] [DefaultValue(true)]
public bool IgnoreShortItems { get; set; } public bool IgnoreShortItems { get; set; }
[Browsable(false)] [Browsable(false)]
public int? Stream { get; set; } public int? Stream { get; set; }
[Browsable(false)] [Browsable(false)]
public int? StreamId { get; set; } public int? StreamId { get; set; }
} }
} }

View File

@@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net40;net20;netstandard2.0</TargetFrameworks> <TargetFrameworks>net40;net20;netstandard2.0</TargetFrameworks>
<Version>2.1.7.0</Version> <Version>2.1.7.0</Version>
<AssemblyName>CUETools.Codecs.BDLPCM</AssemblyName> <AssemblyName>CUETools.Codecs.MPEG</AssemblyName>
<RootNamespace>CUETools.Codecs</RootNamespace> <RootNamespace>CUETools.Codecs.MPEG</RootNamespace>
<Product>CUETools</Product> <Product>CUETools</Product>
<Description>A library for encoding and decoding BluRay Disc LPCM audio.</Description> <Description>A library for encoding and decoding BluRay Disc LPCM audio.</Description>
<Copyright>Copyright (c) 2008-2018 Grigory Chudov</Copyright> <Copyright>Copyright (c) 2008-2018 Grigory Chudov</Copyright>
<Authors>Grigory Chudov</Authors> <Authors>Grigory Chudov</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputPath>..\bin\$(Configuration)\plugins</OutputPath> <OutputPath>..\bin\$(Configuration)\plugins</OutputPath>
<RepositoryUrl>https://github.com/gchudov/cuetools.net</RepositoryUrl> <RepositoryUrl>https://github.com/gchudov/cuetools.net</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<Company /> <Company />
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ProjectReference> <ProjectReference>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CUETools.Codecs\CUETools.Codecs.csproj" /> <ProjectReference Include="..\CUETools.Codecs\CUETools.Codecs.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,116 +1,116 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace CUETools.Codecs.BDLPCM namespace CUETools.Codecs.MPEG
{ {
internal unsafe class FrameReader internal unsafe class FrameReader
{ {
internal FrameReader(byte* ptr, byte* end) internal FrameReader(byte* ptr, byte* end)
{ {
ptr_m = ptr; ptr_m = ptr;
end_m = end; end_m = end;
} }
internal FrameReader(byte* ptr, long len) internal FrameReader(byte* ptr, long len)
{ {
ptr_m = ptr; ptr_m = ptr;
end_m = ptr + len; end_m = ptr + len;
} }
internal FrameReader(FrameReader src, long len) internal FrameReader(FrameReader src, long len)
{ {
if (src.ptr_m + len > src.end_m) throw new IndexOutOfRangeException(); if (src.ptr_m + len > src.end_m) throw new IndexOutOfRangeException();
ptr_m = src.ptr_m; ptr_m = src.ptr_m;
end_m = src.ptr_m + len; end_m = src.ptr_m + len;
} }
internal void read_bytes(byte* dst, int len) internal void read_bytes(byte* dst, int len)
{ {
if (ptr_m + len > end_m) throw new IndexOutOfRangeException(); if (ptr_m + len > end_m) throw new IndexOutOfRangeException();
AudioSamples.MemCpy(dst, ptr_m, len); AudioSamples.MemCpy(dst, ptr_m, len);
ptr_m += len; ptr_m += len;
} }
internal byte[] read_bytes(int len) internal byte[] read_bytes(int len)
{ {
var res = new byte[len]; var res = new byte[len];
fixed (byte* ptr = &res[0]) fixed (byte* ptr = &res[0])
read_bytes(ptr, len); read_bytes(ptr, len);
return res; return res;
} }
internal string read_string(int len) internal string read_string(int len)
{ {
var res = new byte[len]; var res = new byte[len];
fixed (byte* ptr = &res[0]) fixed (byte* ptr = &res[0])
read_bytes(ptr, len); read_bytes(ptr, len);
return Encoding.UTF8.GetString(res, 0, res.Length);; return Encoding.UTF8.GetString(res, 0, res.Length);;
} }
internal byte read_byte() internal byte read_byte()
{ {
if (ptr_m + 1 > end_m) throw new IndexOutOfRangeException(); if (ptr_m + 1 > end_m) throw new IndexOutOfRangeException();
return *(ptr_m++); return *(ptr_m++);
} }
internal ushort read_ushort() internal ushort read_ushort()
{ {
if (ptr_m + 2 > end_m) throw new IndexOutOfRangeException(); if (ptr_m + 2 > end_m) throw new IndexOutOfRangeException();
ushort n = (ushort)(*(ptr_m++)); ushort n = (ushort)(*(ptr_m++));
n <<= 8; n += (ushort)(*(ptr_m++)); n <<= 8; n += (ushort)(*(ptr_m++));
return n; return n;
} }
internal uint read_uint() internal uint read_uint()
{ {
if (ptr_m + 4 > end_m) throw new IndexOutOfRangeException(); if (ptr_m + 4 > end_m) throw new IndexOutOfRangeException();
uint n = (uint)(*(ptr_m++)); uint n = (uint)(*(ptr_m++));
n <<= 8; n += (uint)(*(ptr_m++)); n <<= 8; n += (uint)(*(ptr_m++));
n <<= 8; n += (uint)(*(ptr_m++)); n <<= 8; n += (uint)(*(ptr_m++));
n <<= 8; n += (uint)(*(ptr_m++)); n <<= 8; n += (uint)(*(ptr_m++));
return n; return n;
} }
internal ulong read_pts() internal ulong read_pts()
{ {
if (ptr_m + 5 > end_m) throw new IndexOutOfRangeException(); if (ptr_m + 5 > end_m) throw new IndexOutOfRangeException();
ulong pts ulong pts
= ((ulong)(*(ptr_m++) & 0x0e) << 29); = ((ulong)(*(ptr_m++) & 0x0e) << 29);
pts |= ((ulong)(*(ptr_m++) & 0xff) << 22); pts |= ((ulong)(*(ptr_m++) & 0xff) << 22);
pts |= ((ulong)(*(ptr_m++) & 0xfe) << 14); pts |= ((ulong)(*(ptr_m++) & 0xfe) << 14);
pts |= ((ulong)(*(ptr_m++) & 0xff) << 7); pts |= ((ulong)(*(ptr_m++) & 0xff) << 7);
pts |= ((ulong)(*(ptr_m++) & 0xfe) >> 1); pts |= ((ulong)(*(ptr_m++) & 0xfe) >> 1);
return pts; return pts;
} }
internal void skip(long bytes) internal void skip(long bytes)
{ {
if (ptr_m + bytes > end_m) throw new IndexOutOfRangeException(); if (ptr_m + bytes > end_m) throw new IndexOutOfRangeException();
ptr_m += bytes; ptr_m += bytes;
} }
internal long Length internal long Length
{ {
get get
{ {
return end_m - ptr_m; return end_m - ptr_m;
} }
set set
{ {
end_m = ptr_m + value; end_m = ptr_m + value;
} }
} }
internal byte* Ptr internal byte* Ptr
{ {
get get
{ {
return ptr_m; return ptr_m;
} }
} }
byte* ptr_m; byte* ptr_m;
byte* end_m; byte* end_m;
} }
} }

View File

@@ -4,7 +4,7 @@ using System.ComponentModel;
using System.Text; using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace CUETools.Codecs.MPLS namespace CUETools.Codecs.MPEG.MPLS
{ {
[JsonObject(MemberSerialization.OptIn)] [JsonObject(MemberSerialization.OptIn)]
public class DecoderSettings : IAudioDecoderSettings public class DecoderSettings : IAudioDecoderSettings
@@ -17,7 +17,7 @@ namespace CUETools.Codecs.MPLS
public string Name => "cuetools"; public string Name => "cuetools";
[Browsable(false)] [Browsable(false)]
public Type DecoderType => typeof(BDLPCM.MPLSDecoder); public Type DecoderType => typeof(AudioDecoder);
[Browsable(false)] [Browsable(false)]
public int Priority => 2; public int Priority => 2;

View File

@@ -1,59 +1,59 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace CUETools.Codecs.BDLPCM namespace CUETools.Codecs.MPEG
{ {
internal class TsStream internal class TsStream
{ {
internal UInt16 channel; // channel number (1,2 ...) internal UInt16 channel; // channel number (1,2 ...)
internal int streamId; // stream number in channel internal int streamId; // stream number in channel
internal byte type; // 0xff - not ES internal byte type; // 0xff - not ES
internal AudioPCMConfig pcm; internal AudioPCMConfig pcm;
internal byte[] savedBuffer; internal byte[] savedBuffer;
internal int savedBufferOffset; internal int savedBufferOffset;
internal int savedBufferSize; internal int savedBufferSize;
internal byte[] psi; // PAT,PMT cache (only for PSI streams) internal byte[] psi; // PAT,PMT cache (only for PSI streams)
internal int psi_len; internal int psi_len;
internal int psi_offset; internal int psi_offset;
internal int psi_table; internal int psi_table;
internal bool at_packet_header; internal bool at_packet_header;
internal byte ts_stream_id; // MPEG stream id internal byte ts_stream_id; // MPEG stream id
internal bool is_opened; internal bool is_opened;
internal UInt64 dts; // current MPEG stream DTS (presentation time for audio, decode time for video) internal UInt64 dts; // current MPEG stream DTS (presentation time for audio, decode time for video)
internal UInt64 first_dts; internal UInt64 first_dts;
internal UInt64 first_pts; internal UInt64 first_pts;
internal UInt64 last_pts; internal UInt64 last_pts;
internal UInt32 frame_length; // frame length in ticks (90 ticks = 1 ms, 90000/frame_length=fps) internal UInt32 frame_length; // frame length in ticks (90 ticks = 1 ms, 90000/frame_length=fps)
internal UInt32 frame_size; // frame size in bytes internal UInt32 frame_size; // frame size in bytes
internal UInt64 frame_num; // frame counter internal UInt64 frame_num; // frame counter
internal TsStream() internal TsStream()
{ {
is_opened = false; is_opened = false;
psi = new byte[512]; psi = new byte[512];
psi_len = 0; psi_len = 0;
psi_offset = 0; psi_offset = 0;
psi_table = 0; psi_table = 0;
channel = 0xffff; channel = 0xffff;
streamId = 0; streamId = 0;
type = 0xff; type = 0xff;
ts_stream_id = 0; ts_stream_id = 0;
dts = 0; dts = 0;
first_dts = 0; first_dts = 0;
first_pts = 0; first_pts = 0;
last_pts = 0; last_pts = 0;
frame_length = 0; frame_length = 0;
frame_size = 0; frame_size = 0;
frame_num = 0; frame_num = 0;
pcm = null; pcm = null;
savedBuffer = new byte[192]; savedBuffer = new byte[192];
savedBufferOffset = 0; savedBufferOffset = 0;
savedBufferSize = 0; savedBufferSize = 0;
} }
}; };
} }

View File

@@ -111,4 +111,13 @@ namespace CUETools.Codecs.ffmpegdll
this.Init(); this.Init();
} }
} }
public class MpegDecoderSettings : DecoderSettings, IAudioDecoderSettings
{
public override string Extension => "aob";
public override string Format => "mpeg";
public MpegDecoderSettings()
{
this.Init();
}
}
} }

View File

@@ -88,6 +88,7 @@ namespace CUETools.Codecs
formats.Add("ogg", new CUEToolsFormat("ogg", CUEToolsTagger.TagLibSharp, false, true, false, true, null, encodersViewModel.GetDefault("ogg", false), null)); formats.Add("ogg", new CUEToolsFormat("ogg", CUEToolsTagger.TagLibSharp, false, true, false, true, null, encodersViewModel.GetDefault("ogg", false), null));
formats.Add("opus", new CUEToolsFormat("opus", CUEToolsTagger.TagLibSharp, false, true, false, true, null, encodersViewModel.GetDefault("opus", false), null)); formats.Add("opus", new CUEToolsFormat("opus", CUEToolsTagger.TagLibSharp, false, true, false, true, null, encodersViewModel.GetDefault("opus", false), null));
formats.Add("mlp", new CUEToolsFormat("mlp", CUEToolsTagger.APEv2, true, false, false, false, null, null, decodersViewModel.GetDefault("mlp"))); formats.Add("mlp", new CUEToolsFormat("mlp", CUEToolsTagger.APEv2, true, false, false, false, null, null, decodersViewModel.GetDefault("mlp")));
formats.Add("aob", new CUEToolsFormat("aob", CUEToolsTagger.APEv2, true, false, false, false, null, null, decodersViewModel.GetDefault("aob")));
} }
} }
} }

View File

@@ -27,7 +27,7 @@
<ProjectReference Include="..\CUETools.Codecs\CUETools.Codecs.csproj" /> <ProjectReference Include="..\CUETools.Codecs\CUETools.Codecs.csproj" />
<ProjectReference Include="..\CUETools.Processor\CUETools.Processor.csproj" /> <ProjectReference Include="..\CUETools.Processor\CUETools.Processor.csproj" />
<ProjectReference Include="..\CUETools.CTDB\CUETools.CTDB.csproj" /> <ProjectReference Include="..\CUETools.CTDB\CUETools.CTDB.csproj" />
<ProjectReference Include="..\CUETools.Codecs.BDLPCM\CUETools.Codecs.BDLPCM.csproj" /> <ProjectReference Include="..\CUETools.Codecs.MPEG\CUETools.Codecs.MPEG.csproj" />
<ProjectReference Include="..\CUETools.CDImage\CUETools.CDImage.csproj" /> <ProjectReference Include="..\CUETools.CDImage\CUETools.CDImage.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -1,6 +1,5 @@
using CUETools.CDImage; using CUETools.CDImage;
using CUETools.Codecs; using CUETools.Codecs;
using CUETools.Codecs.BDLPCM;
using CUETools.CTDB; using CUETools.CTDB;
using CUETools.Processor; using CUETools.Processor;
using System; using System;
@@ -124,8 +123,8 @@ namespace CUETools.eac3to
{ {
IAudioSource audioSource = null; IAudioSource audioSource = null;
IAudioDest audioDest = null; IAudioDest audioDest = null;
var videos = new List<MPLSStream>(); var videos = new List<Codecs.MPEG.MPLS.MPLSStream>();
var audios = new List<MPLSStream>(); var audios = new List<Codecs.MPEG.MPLS.MPLSStream>();
List<uint> chapters; List<uint> chapters;
TimeSpan duration; TimeSpan duration;
TagLib.UserDefined.AdditionalFileTypes.Config = config; TagLib.UserDefined.AdditionalFileTypes.Config = config;
@@ -136,7 +135,7 @@ namespace CUETools.eac3to
{ {
if (true) if (true)
{ {
var mpls = new MPLSDecoder(new Codecs.MPLS.DecoderSettings(), sourceFile, null); var mpls = new Codecs.MPEG.MPLS.AudioDecoder(new Codecs.MPEG.MPLS.DecoderSettings(), sourceFile, null);
audioSource = mpls; audioSource = mpls;
Console.ForegroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.White;
int frameRate = 0; int frameRate = 0;
@@ -310,14 +309,14 @@ namespace CUETools.eac3to
throw new Exception("Unknown encoder format: " + destFile); throw new Exception("Unknown encoder format: " + destFile);
} }
if (audioSource is MPLSDecoder) if (audioSource is Codecs.MPEG.MPLS.AudioDecoder)
{ {
if (stream - chapterStreams <= videos.Count) if (stream - chapterStreams <= videos.Count)
throw new Exception("Video extraction not supported."); throw new Exception("Video extraction not supported.");
if (stream - chapterStreams - videos.Count > audios.Count) if (stream - chapterStreams - videos.Count > audios.Count)
throw new Exception(string.Format("The source file doesn't contain a track with the number {0}.", stream)); throw new Exception(string.Format("The source file doesn't contain a track with the number {0}.", stream));
int pid = audios[stream - chapterStreams - videos.Count - 1].pid; int pid = audios[stream - chapterStreams - videos.Count - 1].pid;
(audioSource.Settings as Codecs.MPLS.DecoderSettings).StreamId = pid; (audioSource.Settings as Codecs.MPEG.MPLS.DecoderSettings).StreamId = pid;
} }
} }

View File

@@ -105,9 +105,9 @@
<Project>{1dd41038-d885-46c5-8dde-e0b82f066584}</Project> <Project>{1dd41038-d885-46c5-8dde-e0b82f066584}</Project>
<Name>CUETools.CDImage</Name> <Name>CUETools.CDImage</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\CUETools.Codecs.BDLPCM\CUETools.Codecs.BDLPCM.csproj"> <ProjectReference Include="..\CUETools.Codecs.MPEG\CUETools.Codecs.MPEG.csproj">
<Project>{e75f7ccd-4266-42e1-a039-dc7eb5edd8f6}</Project> <Project>{e75f7ccd-4266-42e1-a039-dc7eb5edd8f6}</Project>
<Name>CUETools.Codecs.BDLPCM</Name> <Name>CUETools.Codecs.MPEG</Name>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\CUETools.Codecs.Flake\CUETools.Codecs.Flake.csproj"> <ProjectReference Include="..\CUETools.Codecs.Flake\CUETools.Codecs.Flake.csproj">

View File

@@ -1,28 +1,17 @@
using System; using CUETools.CDImage;
using System.IO; using CUETools.Codecs;
using CUETools.CTDB;
using CUETools.Processor;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; 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;
using CUETools.Codecs.BDLPCM;
using CUETools.CDImage;
using CUETools.CTDB;
using System.ComponentModel;
using Krystalware.UploadHelper;
using CUETools.Codecs;
//using CUETools.Codecs.Flake;
using CUETools.Processor;
using System.Collections.ObjectModel;
//using Microsoft.Win32;
namespace BluTools namespace BluTools
{ {
@@ -75,7 +64,7 @@ namespace BluTools
private void textBoxSource_TextChanged(object sender, TextChangedEventArgs e) private void textBoxSource_TextChanged(object sender, TextChangedEventArgs e)
{ {
var titleSets = new List<MPLSDecoder>(); var titleSets = new List<CUETools.Codecs.MPEG.MPLS.AudioDecoder>();
IEnumerable<string> playlists = null; IEnumerable<string> playlists = null;
try try
{ {
@@ -87,7 +76,7 @@ namespace BluTools
if (playlists != null) if (playlists != null)
foreach (var playlist in playlists) foreach (var playlist in playlists)
{ {
var title = new MPLSDecoder(new CUETools.Codecs.MPLS.DecoderSettings(), playlist, null); var title = new CUETools.Codecs.MPEG.MPLS.AudioDecoder(new CUETools.Codecs.MPEG.MPLS.DecoderSettings(), playlist, null);
if (filterDups) if (filterDups)
{ {
if (titleSets.Exists(title2 => if (titleSets.Exists(title2 =>
@@ -125,10 +114,10 @@ namespace BluTools
cmbMetadata.ItemsSource = new List<CTDBResponseMeta>(); cmbMetadata.ItemsSource = new List<CTDBResponseMeta>();
ctdb = null; ctdb = null;
var audios = new List<MPLSStream>(); var audios = new List<CUETools.Codecs.MPEG.MPLS.MPLSStream>();
if (e.AddedItems.Count == 1) if (e.AddedItems.Count == 1)
{ {
MPLSDecoder rdr = e.AddedItems[0] as MPLSDecoder; var rdr = e.AddedItems[0] as CUETools.Codecs.MPEG.MPLS.AudioDecoder;
rdr.MPLSHeader.play_item.ForEach(i => i.audio.ForEach(v => { if (!audios.Exists(v1 => v1.pid == v.pid)) audios.Add(v); })); rdr.MPLSHeader.play_item.ForEach(i => i.audio.ForEach(v => { if (!audios.Exists(v1 => v1.pid == v.pid)) audios.Add(v); }));
var chapters = rdr.Chapters; var chapters = rdr.Chapters;
@@ -190,7 +179,7 @@ namespace BluTools
{ {
if (e.AddedItems.Count == 1) if (e.AddedItems.Count == 1)
{ {
MPLSStream stream = (MPLSStream)(e.AddedItems[0]); CUETools.Codecs.MPEG.MPLS.MPLSStream stream = (CUETools.Codecs.MPEG.MPLS.MPLSStream)(e.AddedItems[0]);
} }
} }
@@ -200,7 +189,7 @@ namespace BluTools
BackgroundWorker workerExtract; BackgroundWorker workerExtract;
CUEMetadataEntry metaresult; CUEMetadataEntry metaresult;
ObservableCollection<CUEMetadataEntry> metaresults; ObservableCollection<CUEMetadataEntry> metaresults;
MPLSDecoder chosenReader; CUETools.Codecs.MPEG.MPLS.AudioDecoder chosenReader;
ushort pid; ushort pid;
string outputFolderPath; string outputFolderPath;
string outputAudioPath; string outputAudioPath;
@@ -213,8 +202,8 @@ namespace BluTools
private void buttonExtract_Click(object sender, RoutedEventArgs e) private void buttonExtract_Click(object sender, RoutedEventArgs e)
{ {
if (cmbTitleSet.SelectedItem == null) return; if (cmbTitleSet.SelectedItem == null) return;
pid = ((MPLSStream)cmbAudioTrack.SelectedItem).pid; pid = ((CUETools.Codecs.MPEG.MPLS.MPLSStream)cmbAudioTrack.SelectedItem).pid;
chosenReader = cmbTitleSet.SelectedItem as MPLSDecoder; chosenReader = cmbTitleSet.SelectedItem as CUETools.Codecs.MPEG.MPLS.AudioDecoder;
metaresult = cmbMetadata.SelectedItem as CUEMetadataEntry; metaresult = cmbMetadata.SelectedItem as CUEMetadataEntry;
outputFolderPath = Path.Combine(textBoxDestination.Text, metaresult != null ? outputFolderPath = Path.Combine(textBoxDestination.Text, metaresult != null ?
metaresult.metadata.Artist + " - " + metaresult.metadata.Year + " - " + metaresult.metadata.Title : metaresult.metadata.Artist + " - " + metaresult.metadata.Year + " - " + metaresult.metadata.Title :
@@ -239,10 +228,10 @@ namespace BluTools
void workerExtract_DoWork(object sender, DoWorkEventArgs e) void workerExtract_DoWork(object sender, DoWorkEventArgs e)
{ {
MPLSDecoder reader = null; CUETools.Codecs.MPEG.MPLS.AudioDecoder reader = null;
try try
{ {
reader = new MPLSDecoder(chosenReader.Path, null, pid); reader = new CUETools.Codecs.MPEG.MPLS.AudioDecoder(chosenReader.Path, null, pid);
Directory.CreateDirectory(outputFolderPath); Directory.CreateDirectory(outputFolderPath);
if (File.Exists(outputCuePath)) throw new Exception(string.Format("File \"{0}\" already exists", outputCuePath)); if (File.Exists(outputCuePath)) throw new Exception(string.Format("File \"{0}\" already exists", outputCuePath));
if (File.Exists(outputAudioPath)) throw new Exception(string.Format("File \"{0}\" already exists", outputAudioPath)); if (File.Exists(outputAudioPath)) throw new Exception(string.Format("File \"{0}\" already exists", outputAudioPath));

View File

@@ -163,7 +163,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsMediaLib", "..\Third
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CUETools.Codecs.WMA", "..\CUETools.Codecs.WMA\CUETools.Codecs.WMA.csproj", "{082D6B9E-326E-4D15-9798-DE70A6EDAE9E}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CUETools.Codecs.WMA", "..\CUETools.Codecs.WMA\CUETools.Codecs.WMA.csproj", "{082D6B9E-326E-4D15-9798-DE70A6EDAE9E}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CUETools.Codecs.BDLPCM", "..\CUETools.Codecs.BDLPCM\CUETools.Codecs.BDLPCM.csproj", "{E75F7CCD-4266-42E1-A039-DC7EB5EDD8F6}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CUETools.Codecs.BDLPCM", "..\CUETools.Codecs.MPEG\CUETools.Codecs.MPEG.csproj", "{E75F7CCD-4266-42E1-A039-DC7EB5EDD8F6}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CUETools.eac3to", "..\CUETools.eac3to\CUETools.eac3to.csproj", "{E3FF7539-6B22-4922-8FEF-6D26F2C2E3CE}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CUETools.eac3to", "..\CUETools.eac3to\CUETools.eac3to.csproj", "{E3FF7539-6B22-4922-8FEF-6D26F2C2E3CE}"
EndProject EndProject