CUEPlayer

This commit is contained in:
chudov
2010-04-06 14:22:27 +00:00
parent 8b692a8a54
commit a866b79341
56 changed files with 5494 additions and 41 deletions

69
CUEPlayer/Browser.Designer.cs generated Normal file
View File

@@ -0,0 +1,69 @@
namespace CUEPlayer
{
partial class Browser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.fileSystemTreeView1 = new CUEControls.FileSystemTreeView();
this.SuspendLayout();
//
// fileSystemTreeView1
//
this.fileSystemTreeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.fileSystemTreeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.fileSystemTreeView1.Location = new System.Drawing.Point(0, 0);
this.fileSystemTreeView1.Name = "fileSystemTreeView1";
this.fileSystemTreeView1.ShowLines = false;
this.fileSystemTreeView1.ShowRootLines = false;
this.fileSystemTreeView1.Size = new System.Drawing.Size(284, 264);
this.fileSystemTreeView1.SpecialFolders = new CUEControls.ExtraSpecialFolder[] {
CUEControls.ExtraSpecialFolder.MyComputer,
CUEControls.ExtraSpecialFolder.MyMusic,
CUEControls.ExtraSpecialFolder.CommonMusic};
this.fileSystemTreeView1.TabIndex = 1;
this.fileSystemTreeView1.NodeExpand += new CUEControls.FileSystemTreeViewNodeExpandHandler(this.fileSystemTreeView1_NodeExpand);
//
// Browser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 264);
this.ControlBox = false;
this.Controls.Add(this.fileSystemTreeView1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "Browser";
this.Text = "Browser";
this.Load += new System.EventHandler(this.Browser_Load);
this.ResumeLayout(false);
}
#endregion
private CUEControls.FileSystemTreeView fileSystemTreeView1;
}
}

57
CUEPlayer/Browser.cs Normal file
View File

@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CUEControls;
using CUETools.Codecs;
using CUETools.Processor;
namespace CUEPlayer
{
public partial class Browser : Form
{
private CUEConfig _config;
public Browser()
{
InitializeComponent();
}
public void Init(frmCUEPlayer parent)
{
_config = parent.Config;
MdiParent = parent;
Show();
fileSystemTreeView1.IconManager = parent.IconMgr;
fileSystemTreeView1.SelectedFolder = ExtraSpecialFolder.MyMusic;
}
internal FileSystemTreeView TreeView
{
get
{
return fileSystemTreeView1;
}
}
private void fileSystemTreeView1_NodeExpand(object sender, CUEControls.FileSystemTreeViewNodeExpandEventArgs e)
{
List<FileGroupInfo> fileGroups = CUESheet.ScanFolder(_config, e.files);
foreach (FileGroupInfo fileGroup in fileGroups)
{
TreeNode node = fileSystemTreeView1.NewNode(fileGroup.main, fileGroup.type == FileGroupInfoType.Folder);
if (fileGroup.type == FileGroupInfoType.TrackFiles)
node.Text = node.Text + ": " + fileGroup.files.Count.ToString() + " files";
e.node.Nodes.Add(node);
}
}
private void Browser_Load(object sender, EventArgs e)
{
}
}
}

120
CUEPlayer/Browser.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

261
CUEPlayer/CUEPlayer.csproj Normal file
View File

@@ -0,0 +1,261 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{04E59836-0C5A-4B9B-8899-848D56911758}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CUEPlayer</RootNamespace>
<AssemblyName>CUEPlayer</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Browser.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Browser.Designer.cs">
<DependentUpon>Browser.cs</DependentUpon>
</Compile>
<Compile Include="DataSet1.cs">
<DependentUpon>DataSet1.xsd</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="DataSet1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>DataSet1.xsd</DependentUpon>
</Compile>
<Compile Include="Deck.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Deck.Designer.cs">
<DependentUpon>Deck.cs</DependentUpon>
</Compile>
<Compile Include="frmCUEPlayer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmCUEPlayer.Designer.cs">
<DependentUpon>frmCUEPlayer.cs</DependentUpon>
</Compile>
<Compile Include="Output.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Output.Designer.cs">
<DependentUpon>Output.cs</DependentUpon>
</Compile>
<Compile Include="Playlist.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Playlist.Designer.cs">
<DependentUpon>Playlist.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Browser.resx">
<DependentUpon>Browser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Deck.resx">
<DependentUpon>Deck.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmCUEPlayer.resx">
<DependentUpon>frmCUEPlayer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Output.resx">
<DependentUpon>Output.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Playlist.resx">
<DependentUpon>Playlist.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CUEControls\CUEControls.csproj">
<Project>{CA4D64E6-6544-4A29-8BA5-7DB08D50D072}</Project>
<Name>CUEControls</Name>
</ProjectReference>
<ProjectReference Include="..\CUETools.CDImage\CUETools.CDImage.csproj">
<Project>{1DD41038-D885-46C5-8DDE-E0B82F066584}</Project>
<Name>CUETools.CDImage</Name>
</ProjectReference>
<ProjectReference Include="..\CUETools.Codecs.CoreAudio\CUETools.Codecs.CoreAudio.csproj">
<Project>{FAD09EE2-D6B2-4A8E-9F1C-2A9FB293661A}</Project>
<Name>CUETools.Codecs.CoreAudio</Name>
</ProjectReference>
<ProjectReference Include="..\CUETools.Codecs\CUETools.Codecs.csproj">
<Project>{6458A13A-30EF-45A9-9D58-E5031B17BEE2}</Project>
<Name>CUETools.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\CUETools.DSP.Mixer\CUETools.DSP.Mixer.csproj">
<Project>{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}</Project>
<Name>CUETools.DSP.Mixer</Name>
</ProjectReference>
<ProjectReference Include="..\CUETools.DSP.Resampler\CUETools.DSP.Resampler.csproj">
<Project>{A6303861-CA06-4C2C-A104-BA9291538F6F}</Project>
<Name>CUETools.DSP.Resampler</Name>
</ProjectReference>
<ProjectReference Include="..\CUETools.Processor\CUETools.Processor.csproj">
<Project>{4911BD82-49EF-4858-8B51-5394F86739A4}</Project>
<Name>CUETools.Processor</Name>
</ProjectReference>
<ProjectReference Include="..\ProgressODoom\ProgressODoom.csproj">
<Project>{8DD1E84B-0B03-4C0B-9B42-1E49F75E7CB1}</Project>
<Name>ProgressODoom</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_play_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_stop_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_pause_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_end_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_start_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_eject.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_eject_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_fastforward_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_repeat_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\control_rewind_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="DataSet1.xsc">
<DependentUpon>DataSet1.xsd</DependentUpon>
</None>
<None Include="DataSet1.xsd">
<SubType>Designer</SubType>
<Generator>MSDataSetGenerator</Generator>
<LastGenOutput>DataSet1.Designer.cs</LastGenOutput>
</None>
<None Include="DataSet1.xss">
<DependentUpon>DataSet1.xsd</DependentUpon>
</None>
<None Include="Properties\DataSources\frmCUEPlayer.datasource" />
<None Include="Resources\control_equalizer_blue.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.SQL.Server.Compact.3.5">
<Visible>False</Visible>
<ProductName>SQL Server Compact 3.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="CUEPlayer.sdf">
</Content>
<None Include="Resources\ctdb.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,21 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>
</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<ErrorReportUrlHistory>
</ErrorReportUrlHistory>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>

BIN
CUEPlayer/CUEPlayer.sdf Normal file

Binary file not shown.

227
CUEPlayer/CUEPlayerDataSet.Designer.cs generated Normal file
View File

@@ -0,0 +1,227 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#pragma warning disable 1591
namespace CUEPlayer {
/// <summary>
///Represents a strongly typed in-memory cache of data.
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
[global::System.Serializable()]
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[global::System.Xml.Serialization.XmlRootAttribute("CUEPlayerDataSet")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class CUEPlayerDataSet : global::System.Data.DataSet {
private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public CUEPlayerDataSet() {
this.BeginInit();
this.InitClass();
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
base.Relations.CollectionChanged += schemaChangedHandler;
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected CUEPlayerDataSet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
global::System.Data.DataSet ds = new global::System.Data.DataSet();
ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.ComponentModel.BrowsableAttribute(true)]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
get {
return this._schemaSerializationMode;
}
set {
this._schemaSerializationMode = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataTableCollection Tables {
get {
return base.Tables;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new global::System.Data.DataRelationCollection Relations {
get {
return base.Relations;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void InitializeDerivedDataSet() {
this.BeginInit();
this.InitClass();
this.EndInit();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public override global::System.Data.DataSet Clone() {
CUEPlayerDataSet cln = ((CUEPlayerDataSet)(base.Clone()));
cln.InitVars();
cln.SchemaSerializationMode = this.SchemaSerializationMode;
return cln;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override bool ShouldSerializeTables() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override bool ShouldSerializeRelations() {
return false;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
this.Reset();
global::System.Data.DataSet ds = new global::System.Data.DataSet();
ds.ReadXml(reader);
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXml(reader);
this.InitVars();
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
stream.Position = 0;
return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal void InitVars() {
this.InitVars(true);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal void InitVars(bool initTable) {
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitClass() {
this.DataSetName = "CUEPlayerDataSet";
this.Prefix = "";
this.Namespace = "http://tempuri.org/CUEPlayerDataSet.xsd";
this.EnforceConstraints = true;
this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars();
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
CUEPlayerDataSet ds = new CUEPlayerDataSet();
global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
any.Namespace = ds.Namespace;
sequence.Items.Add(any);
type.Particle = sequence;
global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
if (xs.Contains(dsSchema.TargetNamespace)) {
global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
try {
global::System.Xml.Schema.XmlSchema schema = null;
dsSchema.Write(s1);
for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
s2.SetLength(0);
schema.Write(s2);
if ((s1.Length == s2.Length)) {
s1.Position = 0;
s2.Position = 0;
for (; ((s1.Position != s1.Length)
&& (s1.ReadByte() == s2.ReadByte())); ) {
;
}
if ((s1.Position == s1.Length)) {
return type;
}
}
}
}
finally {
if ((s1 != null)) {
s1.Close();
}
if ((s2 != null)) {
s2.Close();
}
}
}
xs.Add(dsSchema);
return type;
}
}
}
#pragma warning restore 1591

View File

@@ -0,0 +1 @@


View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="CUEPlayerDataSet" targetNamespace="http://tempuri.org/CUEPlayerDataSet.xsd" xmlns:mstns="http://tempuri.org/CUEPlayerDataSet.xsd" xmlns="http://tempuri.org/CUEPlayerDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="CUEPlayerConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="CUEPlayerConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.CUEPlayer.Properties.Settings.GlobalReference.Default.CUEPlayerConnectionString" Provider="Microsoft.SqlServerCe.Client.3.5" />
</Connections>
<Tables />
<Sources />
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="CUEPlayerDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="CUEPlayerDataSet" msprop:Generator_UserDSName="CUEPlayerDataSet" msprop:EnableTableAdapterManager="True">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded" />
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1 @@


1521
CUEPlayer/DataSet1.Designer.cs generated Normal file

File diff suppressed because it is too large Load Diff

9
CUEPlayer/DataSet1.cs Normal file
View File

@@ -0,0 +1,9 @@
namespace CUEPlayer {
public partial class DataSet1 {
partial class PlaylistDataTable
{
}
}
}

9
CUEPlayer/DataSet1.xsc Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--<autogenerated>
This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DataSetUISetting Version="1.00" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TableUISettings />
</DataSetUISetting>

119
CUEPlayer/DataSet1.xsd Normal file
View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd" xmlns:mstns="http://tempuri.org/DataSet1.xsd" xmlns="http://tempuri.org/DataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="CUEPlayerConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="CUEPlayerConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.CUEPlayer.Properties.Settings.GlobalReference.Default.CUEPlayerConnectionString" Provider="Microsoft.SqlServerCe.Client.3.5" />
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PlaylistTableAdapter" GeneratorDataComponentClassName="PlaylistTableAdapter" Name="Playlist" UserDataComponentName="PlaylistTableAdapter">
<MainSource>
<DbSource ConnectionRef="CUEPlayerConnectionString (Settings)" DbObjectName="Playlist" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DeleteCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>DELETE FROM [Playlist] WHERE (([id] = @p1))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p1" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="id" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</DeleteCommand>
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [Playlist] ([path], [artist], [title], [album], [length], [track]) VALUES (@p1, @p2, @p3, @p4, @p5, @p6)</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p1" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="path" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p2" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="artist" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p3" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="title" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p4" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="album" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p5" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="length" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p6" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="track" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT [id], [path], [artist], [title], [album], [length], [track] FROM [Playlist]</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
<UpdateCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>UPDATE [Playlist] SET [path] = @p1, [artist] = @p2, [title] = @p3, [album] = @p4, [length] = @p5, [track] = @p6 WHERE (([id] = @p7))</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p1" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="path" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p2" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="artist" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p3" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="title" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@p4" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="album" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p5" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="length" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p6" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="track" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@p7" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="id" SourceColumnNullMapping="false" SourceVersion="Original" />
</Parameters>
</DbCommand>
</UpdateCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="id" DataSetColumn="id" />
<Mapping SourceColumn="path" DataSetColumn="path" />
<Mapping SourceColumn="artist" DataSetColumn="artist" />
<Mapping SourceColumn="title" DataSetColumn="title" />
<Mapping SourceColumn="album" DataSetColumn="album" />
<Mapping SourceColumn="length" DataSetColumn="length" />
<Mapping SourceColumn="track" DataSetColumn="track" />
</Mappings>
<Sources />
</TableAdapter>
</Tables>
<Sources />
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="DataSet1" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="DataSet1" msprop:Generator_UserDSName="DataSet1" msprop:EnableTableAdapterManager="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Playlist" msprop:Generator_UserTableName="Playlist" msprop:Generator_RowDeletedName="PlaylistRowDeleted" msprop:Generator_TableClassName="PlaylistDataTable" msprop:Generator_RowChangedName="PlaylistRowChanged" msprop:Generator_RowClassName="PlaylistRow" msprop:Generator_RowChangingName="PlaylistRowChanging" msprop:Generator_RowEvArgName="PlaylistRowChangeEvent" msprop:Generator_RowEvHandlerName="PlaylistRowChangeEventHandler" msprop:Generator_TablePropName="Playlist" msprop:Generator_TableVarName="tablePlaylist" msprop:Generator_RowDeletingName="PlaylistRowDeleting">
<xs:complexType>
<xs:sequence>
<xs:element name="id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="id" msprop:Generator_ColumnPropNameInRow="id" msprop:Generator_ColumnVarNameInTable="columnid" msprop:Generator_ColumnPropNameInTable="idColumn" type="xs:int" />
<xs:element name="path" msprop:Generator_UserColumnName="path" msprop:Generator_ColumnPropNameInRow="path" msprop:Generator_ColumnVarNameInTable="columnpath" msprop:Generator_ColumnPropNameInTable="pathColumn">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="artist" msprop:Generator_UserColumnName="artist" msprop:Generator_ColumnPropNameInRow="artist" msprop:Generator_ColumnVarNameInTable="columnartist" msprop:Generator_ColumnPropNameInTable="artistColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="title" msprop:Generator_UserColumnName="title" msprop:Generator_ColumnPropNameInRow="title" msprop:Generator_ColumnVarNameInTable="columntitle" msprop:Generator_ColumnPropNameInTable="titleColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="album" msprop:Generator_UserColumnName="album" msprop:Generator_ColumnPropNameInRow="album" msprop:Generator_ColumnVarNameInTable="columnalbum" msprop:Generator_ColumnPropNameInTable="albumColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="length" msprop:Generator_UserColumnName="length" msprop:Generator_ColumnPropNameInRow="length" msprop:Generator_ColumnVarNameInTable="columnlength" msprop:Generator_ColumnPropNameInTable="lengthColumn" type="xs:int" minOccurs="0" />
<xs:element name="track" msprop:Generator_UserColumnName="track" msprop:Generator_ColumnPropNameInRow="track" msprop:Generator_ColumnVarNameInTable="columntrack" msprop:Generator_ColumnPropNameInTable="trackColumn" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Playlist" />
<xs:field xpath="mstns:id" />
</xs:unique>
</xs:element>
</xs:schema>

1
CUEPlayer/DataSet1.xss Normal file
View File

@@ -0,0 +1 @@


290
CUEPlayer/Deck.Designer.cs generated Normal file
View File

@@ -0,0 +1,290 @@
namespace CUEPlayer
{
partial class Deck
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.textBoxArtist = new System.Windows.Forms.TextBox();
this.textBoxAlbum = new System.Windows.Forms.TextBox();
this.textBoxTitle = new System.Windows.Forms.TextBox();
this.textBoxDuration = new System.Windows.Forms.TextBox();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.buttonPlay = new System.Windows.Forms.Button();
this.buttonStop = new System.Windows.Forms.Button();
this.mediaSlider = new MediaSlider.MediaSlider();
this.buttonPause = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.mediaSliderVolume = new MediaSlider.MediaSlider();
this.buttonRewind = new System.Windows.Forms.Button();
this.buttonNext = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout();
//
// textBoxArtist
//
this.textBoxArtist.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBoxArtist.Location = new System.Drawing.Point(130, 12);
this.textBoxArtist.Name = "textBoxArtist";
this.textBoxArtist.ReadOnly = true;
this.textBoxArtist.Size = new System.Drawing.Size(203, 13);
this.textBoxArtist.TabIndex = 10;
//
// textBoxAlbum
//
this.textBoxAlbum.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBoxAlbum.Location = new System.Drawing.Point(130, 31);
this.textBoxAlbum.Name = "textBoxAlbum";
this.textBoxAlbum.ReadOnly = true;
this.textBoxAlbum.Size = new System.Drawing.Size(203, 13);
this.textBoxAlbum.TabIndex = 11;
//
// textBoxTitle
//
this.textBoxTitle.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBoxTitle.Location = new System.Drawing.Point(130, 50);
this.textBoxTitle.Name = "textBoxTitle";
this.textBoxTitle.ReadOnly = true;
this.textBoxTitle.Size = new System.Drawing.Size(203, 13);
this.textBoxTitle.TabIndex = 12;
//
// textBoxDuration
//
this.textBoxDuration.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBoxDuration.Location = new System.Drawing.Point(130, 69);
this.textBoxDuration.Name = "textBoxDuration";
this.textBoxDuration.ReadOnly = true;
this.textBoxDuration.Size = new System.Drawing.Size(123, 13);
this.textBoxDuration.TabIndex = 13;
//
// pictureBox
//
this.pictureBox.ErrorImage = global::CUEPlayer.Properties.Resources.ctdb;
this.pictureBox.Image = global::CUEPlayer.Properties.Resources.ctdb;
this.pictureBox.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.pictureBox.InitialImage = global::CUEPlayer.Properties.Resources.ctdb;
this.pictureBox.Location = new System.Drawing.Point(12, 12);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(100, 100);
this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox.TabIndex = 16;
this.pictureBox.TabStop = false;
//
// buttonPlay
//
this.buttonPlay.BackColor = System.Drawing.Color.Transparent;
this.buttonPlay.BackgroundImage = global::CUEPlayer.Properties.Resources.control_play_blue;
this.buttonPlay.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.buttonPlay.FlatAppearance.BorderSize = 0;
this.buttonPlay.Location = new System.Drawing.Point(206, 87);
this.buttonPlay.Name = "buttonPlay";
this.buttonPlay.Size = new System.Drawing.Size(25, 25);
this.buttonPlay.TabIndex = 4;
this.buttonPlay.UseVisualStyleBackColor = false;
this.buttonPlay.Click += new System.EventHandler(this.buttonPlay_Click);
//
// buttonStop
//
this.buttonStop.Image = global::CUEPlayer.Properties.Resources.control_stop_blue;
this.buttonStop.Location = new System.Drawing.Point(231, 87);
this.buttonStop.Name = "buttonStop";
this.buttonStop.Size = new System.Drawing.Size(25, 25);
this.buttonStop.TabIndex = 9;
this.buttonStop.UseVisualStyleBackColor = true;
this.buttonStop.Click += new System.EventHandler(this.buttonStop_Click);
//
// mediaSlider
//
this.mediaSlider.Animated = false;
this.mediaSlider.AnimationSize = 0.2F;
this.mediaSlider.AnimationSpeed = MediaSlider.MediaSlider.AnimateSpeed.Normal;
this.mediaSlider.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.mediaSlider.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.mediaSlider.BackColor = System.Drawing.SystemColors.Control;
this.mediaSlider.BackgroundImage = null;
this.mediaSlider.ButtonAccentColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.mediaSlider.ButtonBorderColor = System.Drawing.Color.Black;
this.mediaSlider.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.mediaSlider.ButtonCornerRadius = ((uint)(4u));
this.mediaSlider.ButtonSize = new System.Drawing.Size(10, 20);
this.mediaSlider.ButtonStyle = MediaSlider.MediaSlider.ButtonType.GlassOverlap;
this.mediaSlider.ContextMenuStrip = null;
this.mediaSlider.LargeChange = 2;
this.mediaSlider.Location = new System.Drawing.Point(0, 115);
this.mediaSlider.Margin = new System.Windows.Forms.Padding(0);
this.mediaSlider.Maximum = 1;
this.mediaSlider.Minimum = 0;
this.mediaSlider.Name = "mediaSlider";
this.mediaSlider.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.mediaSlider.ShowButtonOnHover = true;
this.mediaSlider.Size = new System.Drawing.Size(362, 25);
this.mediaSlider.SliderFlyOut = MediaSlider.MediaSlider.FlyOutStyle.None;
this.mediaSlider.SmallChange = 1;
this.mediaSlider.SmoothScrolling = true;
this.mediaSlider.TabIndex = 9;
this.mediaSlider.TickColor = System.Drawing.Color.DarkGray;
this.mediaSlider.TickStyle = System.Windows.Forms.TickStyle.None;
this.mediaSlider.TickType = MediaSlider.MediaSlider.TickMode.Standard;
this.mediaSlider.TrackBorderColor = System.Drawing.SystemColors.ButtonShadow;
this.mediaSlider.TrackDepth = 9;
this.mediaSlider.TrackFillColor = System.Drawing.SystemColors.ButtonFace;
this.mediaSlider.TrackProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(101)))), ((int)(((byte)(188)))));
this.mediaSlider.TrackShadow = true;
this.mediaSlider.TrackShadowColor = System.Drawing.SystemColors.ButtonShadow;
this.mediaSlider.TrackStyle = MediaSlider.MediaSlider.TrackType.Progress;
this.mediaSlider.Value = 0;
this.mediaSlider.ValueChanged += new System.EventHandler(this.mediaSliderA_ValueChanged);
this.mediaSlider.Scrolled += new System.EventHandler(this.mediaSlider_Scrolled);
//
// buttonPause
//
this.buttonPause.Image = global::CUEPlayer.Properties.Resources.control_pause_blue;
this.buttonPause.Location = new System.Drawing.Point(256, 87);
this.buttonPause.Name = "buttonPause";
this.buttonPause.Size = new System.Drawing.Size(25, 25);
this.buttonPause.TabIndex = 17;
this.buttonPause.UseVisualStyleBackColor = true;
this.buttonPause.Click += new System.EventHandler(this.buttonPause_Click);
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// mediaSliderVolume
//
this.mediaSliderVolume.Animated = false;
this.mediaSliderVolume.AnimationSize = 0.2F;
this.mediaSliderVolume.AnimationSpeed = MediaSlider.MediaSlider.AnimateSpeed.Normal;
this.mediaSliderVolume.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.mediaSliderVolume.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.mediaSliderVolume.BackColor = System.Drawing.SystemColors.Control;
this.mediaSliderVolume.BackgroundImage = null;
this.mediaSliderVolume.ButtonAccentColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.mediaSliderVolume.ButtonBorderColor = System.Drawing.Color.Black;
this.mediaSliderVolume.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.mediaSliderVolume.ButtonCornerRadius = ((uint)(4u));
this.mediaSliderVolume.ButtonSize = new System.Drawing.Size(14, 14);
this.mediaSliderVolume.ButtonStyle = MediaSlider.MediaSlider.ButtonType.GlassOverlap;
this.mediaSliderVolume.ContextMenuStrip = null;
this.mediaSliderVolume.LargeChange = 5;
this.mediaSliderVolume.Location = new System.Drawing.Point(336, 12);
this.mediaSliderVolume.Margin = new System.Windows.Forms.Padding(0);
this.mediaSliderVolume.Maximum = 100;
this.mediaSliderVolume.Minimum = 0;
this.mediaSliderVolume.Name = "mediaSliderVolume";
this.mediaSliderVolume.Orientation = System.Windows.Forms.Orientation.Vertical;
this.mediaSliderVolume.ShowButtonOnHover = false;
this.mediaSliderVolume.Size = new System.Drawing.Size(26, 100);
this.mediaSliderVolume.SliderFlyOut = MediaSlider.MediaSlider.FlyOutStyle.None;
this.mediaSliderVolume.SmallChange = 1;
this.mediaSliderVolume.SmoothScrolling = true;
this.mediaSliderVolume.TabIndex = 18;
this.mediaSliderVolume.TickColor = System.Drawing.Color.DarkGray;
this.mediaSliderVolume.TickStyle = System.Windows.Forms.TickStyle.None;
this.mediaSliderVolume.TickType = MediaSlider.MediaSlider.TickMode.Standard;
this.mediaSliderVolume.TrackBorderColor = System.Drawing.SystemColors.ActiveBorder;
this.mediaSliderVolume.TrackDepth = 6;
this.mediaSliderVolume.TrackFillColor = System.Drawing.SystemColors.ActiveBorder;
this.mediaSliderVolume.TrackProgressColor = System.Drawing.Color.Green;
this.mediaSliderVolume.TrackShadow = true;
this.mediaSliderVolume.TrackShadowColor = System.Drawing.SystemColors.ScrollBar;
this.mediaSliderVolume.TrackStyle = MediaSlider.MediaSlider.TrackType.Progress;
this.mediaSliderVolume.Value = 100;
this.mediaSliderVolume.Scrolled += new System.EventHandler(this.mediaSliderVolume_Scrolled);
//
// buttonRewind
//
this.buttonRewind.Image = global::CUEPlayer.Properties.Resources.control_rewind_blue;
this.buttonRewind.Location = new System.Drawing.Point(281, 87);
this.buttonRewind.Name = "buttonRewind";
this.buttonRewind.Size = new System.Drawing.Size(25, 25);
this.buttonRewind.TabIndex = 19;
this.buttonRewind.UseVisualStyleBackColor = true;
this.buttonRewind.Click += new System.EventHandler(this.buttonRewind_Click);
//
// buttonNext
//
this.buttonNext.Image = global::CUEPlayer.Properties.Resources.control_end_blue;
this.buttonNext.Location = new System.Drawing.Point(306, 87);
this.buttonNext.Name = "buttonNext";
this.buttonNext.Size = new System.Drawing.Size(25, 25);
this.buttonNext.TabIndex = 20;
this.buttonNext.UseVisualStyleBackColor = true;
this.buttonNext.Click += new System.EventHandler(this.buttonNext_Click);
//
// Deck
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(361, 145);
this.ControlBox = false;
this.Controls.Add(this.buttonNext);
this.Controls.Add(this.buttonRewind);
this.Controls.Add(this.mediaSliderVolume);
this.Controls.Add(this.buttonPause);
this.Controls.Add(this.mediaSlider);
this.Controls.Add(this.pictureBox);
this.Controls.Add(this.textBoxDuration);
this.Controls.Add(this.buttonPlay);
this.Controls.Add(this.textBoxTitle);
this.Controls.Add(this.buttonStop);
this.Controls.Add(this.textBoxAlbum);
this.Controls.Add(this.textBoxArtist);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Deck";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Deck";
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Deck_DragDrop);
this.DragOver += new System.Windows.Forms.DragEventHandler(this.Deck_DragOver);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonPlay;
private System.Windows.Forms.Button buttonStop;
private System.Windows.Forms.TextBox textBoxArtist;
private System.Windows.Forms.TextBox textBoxAlbum;
private System.Windows.Forms.TextBox textBoxTitle;
private System.Windows.Forms.TextBox textBoxDuration;
private System.Windows.Forms.PictureBox pictureBox;
private MediaSlider.MediaSlider mediaSlider;
private System.Windows.Forms.Button buttonPause;
private System.Windows.Forms.Timer timer1;
private MediaSlider.MediaSlider mediaSliderVolume;
private System.Windows.Forms.Button buttonRewind;
private System.Windows.Forms.Button buttonNext;
}
}

317
CUEPlayer/Deck.cs Normal file
View File

@@ -0,0 +1,317 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using CUETools.Codecs;
using CUETools.Processor;
using CUETools.DSP.Mixer;
namespace CUEPlayer
{
public partial class Deck : Form
{
IAudioSource playingSource = null;
CUESheet playingCue = null;
int playingRow = -1;
long playingStart = 0;
long playingFinish = 0;
Thread playThread;
int iSource;
MixingSource mixer;
MixingWriter writer;
Deck nextDeck;
bool needUpdate = false;
public Deck(int iSource, string suffix)
{
InitializeComponent();
this.iSource = iSource;
if (suffix != null)
Text += " " + suffix;
//mediaSliderA.FlyOutInfo += new MediaSlider.MediaSlider.FlyOutInfoDelegate(mediaSliderA_FlyOutInfo);
}
public void Init(frmCUEPlayer parent, Deck nextDeck)
{
MdiParent = parent;
mixer = (parent as frmCUEPlayer).Mixer;
writer = new MixingWriter(mixer, iSource);
this.nextDeck = nextDeck;
Show();
}
//void mediaSliderA_FlyOutInfo(ref string data)
//{
// TimeSpan ts = TimeSpan.FromSeconds(mediaSliderA.Value / 44100.0);
// data = ts.ToString();
//}
internal int PlayingOffset
{
set
{
if (!mediaSlider.Capture) mediaSlider.Value = value;
}
}
internal void UpdateDeck()
{
if (needUpdate)
{
needUpdate = false;
DataSet1 dataSet = (MdiParent as frmCUEPlayer).DataSet;
mediaSlider.Maximum = (int)(playingFinish - playingStart);
mediaSlider.Value = 0;
textBoxArtist.Text = playingRow < 0 ? "" : dataSet.Playlist[playingRow].artist;
textBoxAlbum.Text = playingRow < 0 ? "" : dataSet.Playlist[playingRow].album;
textBoxTitle.Text = playingRow < 0 ? "" : dataSet.Playlist[playingRow].title;
textBoxDuration.Text = "";
pictureBox.Image = playingCue != null ? playingCue.Cover : pictureBox.InitialImage;
if (nextDeck != null && nextDeck.playingSource == null && playingRow >= 0 && playingRow < dataSet.Playlist.Rows.Count - 1)
{
nextDeck.LoadDeck(playingRow + 1);
}
}
mediaSlider.Enabled = playingSource != null;
if (playingSource != null)
mediaSlider.Value = (int)(playingSource.Position - playingStart);
}
private void mediaSliderA_ValueChanged(object sender, EventArgs e)
{
if (mediaSlider.Maximum == 1) return;
TimeSpan len1 = TimeSpan.FromSeconds(mediaSlider.Maximum / 44100.0);
TimeSpan len2 = TimeSpan.FromSeconds(mediaSlider.Value / 44100.0);
string lenStr1 = string.Format("{0:d}.{1:d2}:{2:d2}:{3:d2}", len1.Days, len1.Hours, len1.Minutes, len1.Seconds).TrimStart('0', ':', '.');
string lenStr2 = string.Format("{0:d}.{1:d2}:{2:d2}:{3:d2}", len2.Days, len2.Hours, len2.Minutes, len2.Seconds).TrimStart('0', ':', '.');
lenStr1 = "0:00".Substring(0, Math.Max(0, 4 - lenStr1.Length)) + lenStr1;
lenStr2 = "0:00".Substring(0, Math.Max(0, 4 - lenStr2.Length)) + lenStr2;
textBoxDuration.Text = lenStr2 + " / " + lenStr1;
}
private int seekTo = -1;
private bool stopNow = false;
private void PlayThread()
{
AudioBuffer buff = new AudioBuffer(playingSource.PCM, 0x2000);
try
{
do
{
if (playingSource == null)
writer.Pause();
else
{
if (seekTo >= 0 && playingStart + seekTo < playingFinish)
{
playingSource.Position = playingStart + seekTo;
seekTo = -1;
}
if (playingSource.Position == playingFinish || stopNow || seekTo == (int)(playingFinish - playingStart))
{
seekTo = -1;
playingSource.Close();
playingSource = null;
if (playingCue != null)
{
playingCue.Close();
playingCue = null;
}
playingFinish = 0;
playingStart = 0;
playingRow = -1;
if (stopNow || nextDeck == null || nextDeck.playingSource == null)
{
writer.Flush();
stopNow = false;
mixer.BufferPlaying(iSource, false);
needUpdate = true;
playThread = null;
return;
}
playingSource = nextDeck.playingSource;
playingCue = nextDeck.playingCue;
playingStart = nextDeck.playingStart;
playingFinish = nextDeck.playingFinish;
playingRow = nextDeck.playingRow;
needUpdate = true;
nextDeck.playingSource = null;
nextDeck.playingCue = null;
nextDeck.playingStart = 0;
nextDeck.playingFinish = 0;
nextDeck.playingRow = -1;
nextDeck.needUpdate = true;
}
playingSource.Read(buff, Math.Min(buff.Size, (int)(playingFinish - playingSource.Position)));
writer.Write(buff);
}
} while (true);
}
catch (Exception ex)
{
}
if (playingCue != null)
{
playingCue.Close();
playingCue = null;
}
if (playingSource != null)
{
playingSource.Close();
playingSource = null;
}
playThread = null;
}
internal void LoadDeck(int row)
{
CUEConfig _config = (MdiParent as frmCUEPlayer).Config;
DataSet1 dataSet = (MdiParent as frmCUEPlayer).DataSet;
Playlist playlist = (MdiParent as frmCUEPlayer).wndPlaylist;
string path = dataSet.Playlist[row].path;
int track = dataSet.Playlist[row].track;
try
{
playingCue = new CUESheet(_config);
playingCue.Open(path);
playingSource = new CUESheetAudio(playingCue);
playingSource.Position = (long)playingCue.TOC[track].Start * 588;
playingSource = new AudioPipe(playingSource, 0x2000);
playingStart = playingSource.Position;
playingFinish = playingStart + (long)playingCue.TOC[track].Length * 588;
playingRow = row;
//playlist.List.Items[playingRow].BackColor = Color.AliceBlue;
needUpdate = true;
UpdateDeck();
}
catch (Exception ex)
{
playingStart = playingFinish = 0;
playingCue = null;
playingSource = null;
return;
}
}
private void buttonPlay_Click(object sender, EventArgs e)
{
if (playingSource == null)
{
Playlist playlist = (MdiParent as frmCUEPlayer).wndPlaylist;
LoadDeck(playlist.List.SelectedIndices[0]);
}
mixer.BufferPlaying(iSource, true);
if (playThread == null)
{
playThread = new Thread(PlayThread);
playThread.Priority = ThreadPriority.AboveNormal;
playThread.IsBackground = true;
playThread.Name = Text;
playThread.Start();
}
}
private void buttonStop_Click(object sender, EventArgs e)
{
if (playThread != null)
{
stopNow = true;
playThread.Join();
}
else
{
if (playingSource != null)
{
playingSource.Close();
playingSource = null;
}
if (playingCue != null)
{
playingCue.Close();
playingCue = null;
}
playingFinish = 0;
playingStart = 0;
playingRow = -1;
needUpdate = true;
UpdateDeck();
}
}
private void buttonPause_Click(object sender, EventArgs e)
{
mixer.BufferPlaying(iSource, false);
}
private void timer1_Tick(object sender, EventArgs e)
{
UpdateDeck();
}
private void mediaSlider_Scrolled(object sender, EventArgs e)
{
if (playThread != null)
{
seekTo = mediaSlider.Value;
}
else
{
if (playingSource != null)
playingSource.Position = playingStart + mediaSlider.Value;
}
}
private void mediaSliderVolume_Scrolled(object sender, EventArgs e)
{
writer.Volume = mediaSliderVolume.Value / 100.0f;
}
private void Deck_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.Serializable))
{
e.Effect = DragDropEffects.Copy;
}
}
private void Deck_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.Serializable))
{
ListView.SelectedIndexCollection indexes =
e.Data.GetData(DataFormats.Serializable) as ListView.SelectedIndexCollection;
if (playThread == null && indexes != null)
{
LoadDeck(indexes[0]);
}
}
}
private void buttonNext_Click(object sender, EventArgs e)
{
seekTo = (int)(playingFinish - playingStart);
}
private void buttonRewind_Click(object sender, EventArgs e)
{
if (playThread != null)
{
seekTo = 0;
}
else if (playingSource != null)
{
playingSource.Position = playingStart;
}
}
}
}

123
CUEPlayer/Deck.resx Normal file
View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

171
CUEPlayer/Output.Designer.cs generated Normal file
View File

@@ -0,0 +1,171 @@
namespace CUEPlayer
{
partial class Output
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.mediaSliderVolume = new MediaSlider.MediaSlider();
this.peakMeterCtrl1 = new Ernzo.WinForms.Controls.PeakMeterCtrl();
this.buttonPause = new System.Windows.Forms.Button();
this.buttonPlay = new System.Windows.Forms.Button();
this.buttonStop = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// mediaSliderVolume
//
this.mediaSliderVolume.Animated = false;
this.mediaSliderVolume.AnimationSize = 0.2F;
this.mediaSliderVolume.AnimationSpeed = MediaSlider.MediaSlider.AnimateSpeed.Normal;
this.mediaSliderVolume.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.mediaSliderVolume.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.mediaSliderVolume.BackColor = System.Drawing.SystemColors.Control;
this.mediaSliderVolume.BackgroundImage = null;
this.mediaSliderVolume.ButtonAccentColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.mediaSliderVolume.ButtonBorderColor = System.Drawing.Color.Black;
this.mediaSliderVolume.ButtonColor = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.mediaSliderVolume.ButtonCornerRadius = ((uint)(4u));
this.mediaSliderVolume.ButtonSize = new System.Drawing.Size(14, 14);
this.mediaSliderVolume.ButtonStyle = MediaSlider.MediaSlider.ButtonType.GlassOverlap;
this.mediaSliderVolume.ContextMenuStrip = null;
this.mediaSliderVolume.LargeChange = 5;
this.mediaSliderVolume.Location = new System.Drawing.Point(9, 9);
this.mediaSliderVolume.Margin = new System.Windows.Forms.Padding(0);
this.mediaSliderVolume.Maximum = 100;
this.mediaSliderVolume.Minimum = 0;
this.mediaSliderVolume.Name = "mediaSliderVolume";
this.mediaSliderVolume.Orientation = System.Windows.Forms.Orientation.Vertical;
this.mediaSliderVolume.ShowButtonOnHover = false;
this.mediaSliderVolume.Size = new System.Drawing.Size(37, 114);
this.mediaSliderVolume.SliderFlyOut = MediaSlider.MediaSlider.FlyOutStyle.None;
this.mediaSliderVolume.SmallChange = 1;
this.mediaSliderVolume.SmoothScrolling = true;
this.mediaSliderVolume.TabIndex = 14;
this.mediaSliderVolume.TickColor = System.Drawing.Color.DarkGray;
this.mediaSliderVolume.TickStyle = System.Windows.Forms.TickStyle.None;
this.mediaSliderVolume.TickType = MediaSlider.MediaSlider.TickMode.Standard;
this.mediaSliderVolume.TrackBorderColor = System.Drawing.SystemColors.ActiveBorder;
this.mediaSliderVolume.TrackDepth = 6;
this.mediaSliderVolume.TrackFillColor = System.Drawing.SystemColors.ActiveBorder;
this.mediaSliderVolume.TrackProgressColor = System.Drawing.Color.Green;
this.mediaSliderVolume.TrackShadow = true;
this.mediaSliderVolume.TrackShadowColor = System.Drawing.SystemColors.ScrollBar;
this.mediaSliderVolume.TrackStyle = MediaSlider.MediaSlider.TrackType.Progress;
this.mediaSliderVolume.Value = 0;
this.mediaSliderVolume.Scrolled += new System.EventHandler(this.mediaSliderVolume_Scrolled);
//
// peakMeterCtrl1
//
this.peakMeterCtrl1.BandsCount = 2;
this.peakMeterCtrl1.ColorHigh = System.Drawing.Color.Red;
this.peakMeterCtrl1.ColorHighBack = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(150)))), ((int)(((byte)(150)))));
this.peakMeterCtrl1.ColorMedium = System.Drawing.Color.Yellow;
this.peakMeterCtrl1.ColorMediumBack = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(150)))));
this.peakMeterCtrl1.ColorNormal = System.Drawing.Color.Green;
this.peakMeterCtrl1.ColorNormalBack = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(255)))), ((int)(((byte)(150)))));
this.peakMeterCtrl1.FalloffColor = System.Drawing.Color.Blue;
this.peakMeterCtrl1.GridColor = System.Drawing.Color.Gainsboro;
this.peakMeterCtrl1.LEDCount = 25;
this.peakMeterCtrl1.Location = new System.Drawing.Point(60, 9);
this.peakMeterCtrl1.Margin = new System.Windows.Forms.Padding(0);
this.peakMeterCtrl1.Name = "peakMeterCtrl1";
this.peakMeterCtrl1.Size = new System.Drawing.Size(15, 109);
this.peakMeterCtrl1.TabIndex = 13;
this.peakMeterCtrl1.Text = "peakMeterCtrl1";
//
// buttonPause
//
this.buttonPause.Image = global::CUEPlayer.Properties.Resources.control_pause_blue;
this.buttonPause.Location = new System.Drawing.Point(59, 130);
this.buttonPause.Name = "buttonPause";
this.buttonPause.Size = new System.Drawing.Size(25, 25);
this.buttonPause.TabIndex = 12;
this.buttonPause.UseVisualStyleBackColor = true;
this.buttonPause.Click += new System.EventHandler(this.buttonPause_Click);
//
// buttonPlay
//
this.buttonPlay.BackColor = System.Drawing.Color.Transparent;
this.buttonPlay.BackgroundImage = global::CUEPlayer.Properties.Resources.control_play_blue;
this.buttonPlay.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.buttonPlay.FlatAppearance.BorderSize = 0;
this.buttonPlay.Location = new System.Drawing.Point(9, 130);
this.buttonPlay.Name = "buttonPlay";
this.buttonPlay.Size = new System.Drawing.Size(25, 25);
this.buttonPlay.TabIndex = 10;
this.buttonPlay.UseVisualStyleBackColor = false;
this.buttonPlay.Click += new System.EventHandler(this.buttonPlay_Click);
//
// buttonStop
//
this.buttonStop.Image = global::CUEPlayer.Properties.Resources.control_stop_blue;
this.buttonStop.Location = new System.Drawing.Point(34, 130);
this.buttonStop.Name = "buttonStop";
this.buttonStop.Size = new System.Drawing.Size(25, 25);
this.buttonStop.TabIndex = 11;
this.buttonStop.UseVisualStyleBackColor = true;
this.buttonStop.Click += new System.EventHandler(this.buttonStop_Click);
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 50;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Output
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(96, 168);
this.ControlBox = false;
this.Controls.Add(this.mediaSliderVolume);
this.Controls.Add(this.peakMeterCtrl1);
this.Controls.Add(this.buttonPause);
this.Controls.Add(this.buttonPlay);
this.Controls.Add(this.buttonStop);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Output";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Output";
this.Load += new System.EventHandler(this.Output_Load);
this.ResumeLayout(false);
}
#endregion
private MediaSlider.MediaSlider mediaSliderVolume;
private Ernzo.WinForms.Controls.PeakMeterCtrl peakMeterCtrl1;
private System.Windows.Forms.Button buttonPause;
private System.Windows.Forms.Button buttonPlay;
private System.Windows.Forms.Button buttonStop;
private System.Windows.Forms.Timer timer1;
}
}

106
CUEPlayer/Output.cs Normal file
View File

@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using NAudio.CoreAudioApi;
using CUETools.Codecs;
using CUETools.Codecs.CoreAudio;
using CUETools.Processor;
namespace CUEPlayer
{
public partial class Output : Form
{
private MMDevice _device;
internal MMDevice Device
{
get
{
return _device;
}
set
{
_device = value;
}
}
public Output()
{
InitializeComponent();
}
public void Init(frmCUEPlayer parent)
{
MdiParent = parent;
_device = WasapiOut.GetDefaultAudioEndpoint();
_device.AudioEndpointVolume.OnVolumeNotification += new AudioEndpointVolumeNotificationDelegate(AudioEndpointVolume_OnVolumeNotification);
mediaSliderVolume.Value = (int)(_device.AudioEndpointVolume.MasterVolumeLevelScalar * 100);
Show();
}
void AudioEndpointVolume_OnVolumeNotification(AudioVolumeNotificationData data)
{
if (data.EventContext == Guid.Empty)
return;
if (this.InvokeRequired)
this.Invoke((MethodInvoker)delegate() { AudioEndpointVolume_OnVolumeNotification(data); });
else
mediaSliderVolume.Value = (int)(data.MasterVolume * 100);
}
private void mediaSliderVolume_Scrolled(object sender, EventArgs e)
{
try
{
_device.AudioEndpointVolume.MasterVolumeLevelScalar = mediaSliderVolume.Value / 100.0f;
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
}
private int[] peakValues = null;
private void timer1_Tick(object sender, EventArgs e)
{
if (_device == null)
return;
if (peakValues == null || peakValues.Length != _device.AudioMeterInformation.PeakValues.Count)
{
peakValues = new int[_device.AudioMeterInformation.PeakValues.Count];
peakMeterCtrl1.SetMeterBands(peakValues.Length, 25);
}
for (int i = 0; i < peakValues.Length; i++)
peakValues[i] = (int)(_device.AudioMeterInformation.PeakValues[i] * 100);
//peakValues[0] = (int)(_device.AudioMeterInformation.MasterPeakValue * 100);
peakMeterCtrl1.SetData(peakValues, 0, peakValues.Length);
}
private void buttonPlay_Click(object sender, EventArgs e)
{
(MdiParent as frmCUEPlayer).buttonPlay_Click(sender, e);
}
private void buttonStop_Click(object sender, EventArgs e)
{
(MdiParent as frmCUEPlayer).buttonStop_Click(sender, e);
}
private void buttonPause_Click(object sender, EventArgs e)
{
(MdiParent as frmCUEPlayer).buttonPause_Click(sender, e);
}
private void Output_Load(object sender, EventArgs e)
{
peakMeterCtrl1.Start(50);
}
}
}

123
CUEPlayer/Output.resx Normal file
View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

121
CUEPlayer/Playlist.Designer.cs generated Normal file
View File

@@ -0,0 +1,121 @@
namespace CUEPlayer
{
partial class Playlist
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.listViewTracks = new System.Windows.Forms.ListView();
this.columnName = new System.Windows.Forms.ColumnHeader();
this.columnLength = new System.Windows.Forms.ColumnHeader();
this.contextMenuStripPlaylist = new System.Windows.Forms.ContextMenuStrip(this.components);
this.exploreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStripPlaylist.SuspendLayout();
this.SuspendLayout();
//
// listViewTracks
//
this.listViewTracks.AllowDrop = true;
this.listViewTracks.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listViewTracks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnName,
this.columnLength});
this.listViewTracks.ContextMenuStrip = this.contextMenuStripPlaylist;
this.listViewTracks.Dock = System.Windows.Forms.DockStyle.Fill;
this.listViewTracks.FullRowSelect = true;
this.listViewTracks.GridLines = true;
this.listViewTracks.Location = new System.Drawing.Point(0, 0);
this.listViewTracks.Margin = new System.Windows.Forms.Padding(0);
this.listViewTracks.Name = "listViewTracks";
this.listViewTracks.Size = new System.Drawing.Size(372, 279);
this.listViewTracks.TabIndex = 6;
this.listViewTracks.UseCompatibleStateImageBehavior = false;
this.listViewTracks.View = System.Windows.Forms.View.Details;
this.listViewTracks.DragDrop += new System.Windows.Forms.DragEventHandler(this.listViewTracks_DragDrop);
this.listViewTracks.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listViewTracks_KeyDown);
this.listViewTracks.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listViewTracks_ItemDrag);
this.listViewTracks.DragOver += new System.Windows.Forms.DragEventHandler(this.listViewTracks_DragOver);
//
// columnName
//
this.columnName.Text = "Name";
this.columnName.Width = 256;
//
// columnLength
//
this.columnLength.Text = "Length";
this.columnLength.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.columnLength.Width = 80;
//
// contextMenuStripPlaylist
//
this.contextMenuStripPlaylist.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exploreToolStripMenuItem,
this.removeToolStripMenuItem});
this.contextMenuStripPlaylist.Name = "contextMenuStripPlaylist";
this.contextMenuStripPlaylist.Size = new System.Drawing.Size(118, 48);
//
// exploreToolStripMenuItem
//
this.exploreToolStripMenuItem.Name = "exploreToolStripMenuItem";
this.exploreToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.exploreToolStripMenuItem.Text = "Explore";
this.exploreToolStripMenuItem.Click += new System.EventHandler(this.exploreToolStripMenuItem_Click);
//
// removeToolStripMenuItem
//
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.removeToolStripMenuItem.Text = "Remove";
this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
//
// Playlist
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(372, 279);
this.ControlBox = false;
this.Controls.Add(this.listViewTracks);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "Playlist";
this.Text = "Playlist";
this.contextMenuStripPlaylist.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListView listViewTracks;
private System.Windows.Forms.ColumnHeader columnName;
private System.Windows.Forms.ColumnHeader columnLength;
private System.Windows.Forms.ContextMenuStrip contextMenuStripPlaylist;
private System.Windows.Forms.ToolStripMenuItem exploreToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
}
}

165
CUEPlayer/Playlist.cs Normal file
View File

@@ -0,0 +1,165 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Windows.Forms;
using CUEControls;
using CUETools.Codecs;
using CUETools.Processor;
namespace CUEPlayer
{
public partial class Playlist : Form
{
private CUEConfig _config;
private ShellIconMgr _icon_mgr;
private DataSet1 dataSet;
public Playlist()
{
InitializeComponent();
}
public void Init(frmCUEPlayer parent)
{
_config = parent.Config;
dataSet = parent.DataSet;
MdiParent = parent;
Show();
_icon_mgr = parent.IconMgr;
listViewTracks.SmallImageList = _icon_mgr.ImageList;
foreach (DataSet1.PlaylistRow row in dataSet.Playlist)
listViewTracks.Items.Add(ToItem(row));
}
public ListView List
{
get
{
return listViewTracks;
}
}
public ListViewItem ToItem(DataSet1.PlaylistRow row)
{
ListViewGroup in_group = null;
string group_name = (row.artist ?? "") + " - " + (row.album ?? "");
foreach (ListViewGroup group in listViewTracks.Groups)
{
if (group.Name == group_name)
{
in_group = group;
break;
}
}
if (in_group == null)
{
in_group = new ListViewGroup(group_name, group_name);
listViewTracks.Groups.Add(in_group);
}
int iconIndex = _icon_mgr.GetIconIndex(new FileInfo(row.path), true);
ListViewItem item = new ListViewItem(row.title, iconIndex);
TimeSpan Length = TimeSpan.FromSeconds(row.length);
string lenStr = string.Format("{0:d}.{1:d2}:{2:d2}:{3:d2}", Length.Days, Length.Hours, Length.Minutes, Length.Seconds).TrimStart('0', ':', '.');
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, lenStr));
item.Group = in_group;
item.Tag = row;
return item;
}
private void exploreToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listViewTracks.SelectedIndices.Count == 1)
{
int index = listViewTracks.SelectedIndices[0];
string path = (listViewTracks.Items[index].Tag as DataSet1.PlaylistRow).path;
(MdiParent as frmCUEPlayer).browser.TreeView.SelectedPath = path;
}
}
private void removeToolStripMenuItem_Click(object sender, EventArgs e)
{
while (listViewTracks.SelectedIndices.Count > 0)
{
int index = listViewTracks.SelectedIndices[0];
(listViewTracks.Items[index].Tag as DataSet1.PlaylistRow).Delete();
listViewTracks.Items.RemoveAt(index);
}
}
private void listViewTracks_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
if (files.Length == 1)
{
string path = files[0];
try
{
CUESheet cue = new CUESheet(_config);
cue.Open(path);
for (int iTrack = 0; iTrack < cue.TrackCount; iTrack++)
{
DataSet1.PlaylistRow row = dataSet.Playlist.AddPlaylistRow(
path,
cue.Artist,
cue.Tracks[iTrack].Title,
cue.Title,
(int)cue.TOC[cue.TOC.FirstAudio + iTrack].Length / 75,
iTrack + 1);
listViewTracks.Items.Add(ToItem(row));
}
cue.Close();
return;
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
FileInfo fi = new FileInfo(path);
if (fi.Extension != ".cue")
{
DataSet1.PlaylistRow row = dataSet.Playlist.AddPlaylistRow(
path,
null, // cue.Artist,
null, // cue.Tracks[iTrack].Title,
null, // cue.Title,
0, // (int)cue.TOC[cue.TOC.FirstAudio + iTrack].Length / 75,
0);
listViewTracks.Items.Add(ToItem(row));
}
}
}
}
private void listViewTracks_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Copy;
}
}
private void listViewTracks_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
removeToolStripMenuItem_Click(sender, EventArgs.Empty);
}
private void listViewTracks_ItemDrag(object sender, ItemDragEventArgs e)
{
if (e.Item != null && e.Item is ListViewItem)
{
DataObject dobj = new DataObject(DataFormats.Serializable, listViewTracks.SelectedIndices);
DragDropEffects effects = DoDragDrop(dobj, DragDropEffects.All);
return;
}
}
}
}

123
CUEPlayer/Playlist.resx Normal file
View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStripPlaylist.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

20
CUEPlayer/Program.cs Normal file
View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace CUEPlayer
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmCUEPlayer());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CUEPlayer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("CUEPlayer")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("64db1f35-5084-4f32-adc5-7d5b4059c9bf")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="frmCUEPlayer" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>CUEPlayer.frmCUEPlayer, CUEPlayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

147
CUEPlayer/Properties/Resources.Designer.cs generated Normal file
View File

@@ -0,0 +1,147 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CUEPlayer.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CUEPlayer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap control_eject {
get {
object obj = ResourceManager.GetObject("control_eject", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_eject_blue {
get {
object obj = ResourceManager.GetObject("control_eject_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_end_blue {
get {
object obj = ResourceManager.GetObject("control_end_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_equalizer_blue {
get {
object obj = ResourceManager.GetObject("control_equalizer_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_fastforward_blue {
get {
object obj = ResourceManager.GetObject("control_fastforward_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_pause_blue {
get {
object obj = ResourceManager.GetObject("control_pause_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_play_blue {
get {
object obj = ResourceManager.GetObject("control_play_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_repeat_blue {
get {
object obj = ResourceManager.GetObject("control_repeat_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_rewind_blue {
get {
object obj = ResourceManager.GetObject("control_rewind_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_start_blue {
get {
object obj = ResourceManager.GetObject("control_start_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap control_stop_blue {
get {
object obj = ResourceManager.GetObject("control_stop_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap ctdb {
get {
object obj = ResourceManager.GetObject("ctdb", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="control_eject_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_eject_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_fastforward_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_fastforward_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_start_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_start_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_eject" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_eject.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_end_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_end_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_repeat_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_repeat_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_rewind_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_rewind_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_pause_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_pause_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_stop_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_stop_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_play_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_play_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="control_equalizer_blue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\control_equalizer_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ctdb" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ctdb.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CUEPlayer.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=|DataDirectory|\\CUEPlayer.sdf")]
public string CUEPlayerConnectionString {
get {
return ((string)(this["CUEPlayerConnectionString"]));
}
}
}
}

View File

@@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="CUEPlayer.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="CUEPlayerConnectionString" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;ConnectionString&gt;Data Source=|DataDirectory|\CUEPlayer.sdf&lt;/ConnectionString&gt;
&lt;ProviderName&gt;Microsoft.SqlServerCe.Client.3.5&lt;/ProviderName&gt;
&lt;/SerializableConnectionString&gt;</DesignTimeValue>
<Value Profile="(Default)">Data Source=|DataDirectory|\CUEPlayer.sdf</Value>
</Setting>
</Settings>
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

10
CUEPlayer/app.config Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="CUEPlayer.Properties.Settings.CUEPlayerConnectionString"
connectionString="Data Source=|DataDirectory|\CUEPlayer.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" />
</connectionStrings>
</configuration>

51
CUEPlayer/frmCUEPlayer.Designer.cs generated Normal file
View File

@@ -0,0 +1,51 @@
namespace CUEPlayer
{
partial class frmCUEPlayer
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// frmCUEPlayer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1200, 477);
this.IsMdiContainer = true;
this.Name = "frmCUEPlayer";
this.Text = "CUEPlayer 2.0.7";
this.Load += new System.EventHandler(this.frmCUEPlayer_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmCUEPlayer_FormClosing);
this.ResumeLayout(false);
}
#endregion
}
}

354
CUEPlayer/frmCUEPlayer.cs Normal file
View File

@@ -0,0 +1,354 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using System.Diagnostics;
using NAudio.CoreAudioApi;
using CUEControls;
using CUETools.Codecs;
using CUETools.Codecs.CoreAudio;
using CUETools.DSP.Mixer;
using CUETools.DSP.Resampler;
using CUETools.Processor;
namespace CUEPlayer
{
public partial class frmCUEPlayer : Form
{
private ShellIconMgr _icon_mgr;
private CUEConfig _config;
private IWavePlayer _player;
DataSet1TableAdapters.PlaylistTableAdapter adapterPlayList = new DataSet1TableAdapters.PlaylistTableAdapter();
private DataSet1 dataSet = new DataSet1();
private Thread mixThread;
private MixingSource _mixer;
private SOXResampler _resampler;
internal Playlist wndPlaylist
{
get
{
return playlist;
}
}
internal DataSet1 DataSet
{
get
{
return dataSet;
}
}
internal CUEConfig Config
{
get
{
return _config;
}
}
internal ShellIconMgr IconMgr
{
get
{
return _icon_mgr;
}
}
public MixingSource Mixer
{
get
{
return _mixer;
}
}
public frmCUEPlayer()
{
InitializeComponent();
_icon_mgr = new ShellIconMgr();
_config = new CUEConfig();
_config.separateDecodingThread = false;
}
internal Deck deckA = new Deck(0, "A");
internal Deck deckB = new Deck(1, "B");
internal Output outputA = new Output();
internal Browser browser = new Browser();
internal Playlist playlist = new Playlist();
private void frmCUEPlayer_Load(object sender, EventArgs e)
{
int delay = 100;
AudioPCMConfig mixerPCM = AudioPCMConfig.RedBook;
//System.Data.SqlServerCe.SqlCeDataAdapter ad = new System.Data.SqlServerCe.SqlCeDataAdapter();
//ad.SelectCommand = new System.Data.SqlServerCe.SqlCeCommand("SELECT * FROM Playlist WHERE track=1", adapterPlayList.Connection);
//ad.Fill(dataSet.Playlist);
adapterPlayList.Fill(dataSet.Playlist);
_mixer = new MixingSource(mixerPCM, delay, 2);
outputA.Init(this);
browser.Init(this);
playlist.Init(this);
deckB.Init(this, null);
deckA.Init(this, deckB);
//LayoutMdi(MdiLayout.TileHorizontal);
browser.Location = new Point(0, 0);
browser.Height = ClientRectangle.Height - 5;
playlist.Location = new Point(browser.Location.X + browser.Width, 0);
playlist.Height = ClientRectangle.Height - 5;
deckA.Location = new Point(playlist.Location.X + playlist.Width, 0);
deckB.Location = new Point(playlist.Location.X + playlist.Width, deckA.Height);
outputA.Location = new Point(deckA.Location.X + deckA.Width, 0);
try
{
_player = new WasapiOut(outputA.Device, NAudio.CoreAudioApi.AudioClientShareMode.Shared, true, delay, new AudioPCMConfig(32, 2, 44100));
}
catch
{
_player = null;
}
if (_player == null)
{
try
{
_player = new WasapiOut(outputA.Device, NAudio.CoreAudioApi.AudioClientShareMode.Shared, true, delay, new AudioPCMConfig(32, 2, 48000));
SOXResamplerConfig cfg;
cfg.quality = SOXResamplerQuality.Very;
cfg.phase = 50;
cfg.allow_aliasing = false;
cfg.bandwidth = 0;
_resampler = new SOXResampler(mixerPCM, _player.PCM, cfg);
}
catch(Exception ex)
{
_player = null;
Trace.WriteLine(ex.Message);
}
}
if (_player != null)
{
_player.Play();
mixThread = new Thread(MixThread);
mixThread.Priority = ThreadPriority.AboveNormal;
mixThread.IsBackground = true;
mixThread.Name = "Mixer";
mixThread.Start();
}
}
Thread playThread;
int playingRow;
private void PlayThread()
{
AudioBuffer buff = new AudioBuffer(AudioPCMConfig.RedBook, 0x2000);
IAudioSource playingSource = null;
CUESheet playingCue = null;
long playingOffs = 0;
long playingFin = 0;
try
{
do
{
// End of playlist entry or source file
if (playingSource != null && (playingOffs == playingFin || playingSource.Remaining == 0))
{
this.Invoke((MethodInvoker)delegate()
{
playlist.List.Items[playingRow].BackColor = Color.White;
});
playingRow++;
playingOffs = 0;
if (playingRow >= dataSet.Playlist.Rows.Count)
break;
string path = dataSet.Playlist[playingRow].path;
int track = dataSet.Playlist[playingRow].track;
if (playingCue == null ||
playingSource == null ||
playingCue.InputPath != path ||
playingSource.Position != (long)playingCue.TOC[track].Start * 588)
{
if (playingSource != null)
{
playingSource.Close();
playingSource = null;
}
if (playingCue != null)
{
playingCue.Close();
playingCue = null;
}
}
else
{
playingFin = (long)playingCue.TOC[track].Length * 588;
this.Invoke((MethodInvoker)delegate()
{
playlist.List.Items[playingRow].BackColor = Color.AliceBlue;
//deckA.UpdateDeck(dataSet, playingRow, playingCue, playingFin);
});
}
}
// Open it
if (playingSource == null)
{
string path = dataSet.Playlist[playingRow].path;
int track = dataSet.Playlist[playingRow].track;
try
{
playingCue = new CUESheet(_config);
playingCue.Open(path);
playingSource = new CUESheetAudio(playingCue);
playingSource.Position = (long)playingCue.TOC[track].Start * 588 + playingOffs;
playingSource = new AudioPipe(playingSource, 0x2000);
playingFin = (long)playingCue.TOC[track].Length * 588;
this.Invoke((MethodInvoker)delegate()
{
playlist.List.Items[playingRow].BackColor = Color.AliceBlue;
//deckA.UpdateDeck(dataSet, playingRow, playingCue, playingFin);
});
}
catch (Exception ex)
{
// skip it
playingOffs = playingFin = 0;
continue;
}
}
playingSource.Read(buff, (int)(playingFin - playingOffs));
this.Invoke((MethodInvoker)delegate()
{
deckA.PlayingOffset = (int)playingOffs;
});
_player.Write(buff);
playingOffs += buff.Length;
} while (_player.PlaybackState != PlaybackState.Stopped);
}
catch (Exception ex)
{
// Can't invoke while joining
//if (playingRow < dataSet.Playlist.Rows.Count)
// this.Invoke((MethodInvoker)delegate()
// {
// listViewTracks.Items[playingRow].BackColor = Color.White;
// });
}
if (playingCue != null)
{
playingCue.Close();
playingCue = null;
}
if (playingSource != null)
{
playingSource.Close();
playingSource = null;
}
}
internal void buttonPlay_Click(object sender, EventArgs e)
{
try
{
_player.Stop();
if (playThread != null)
{
playThread.Join();
playThread = null;
}
if (playlist.List.SelectedIndices.Count < 0)
return;
playingRow = playlist.List.SelectedIndices[0];
playlist.List.Items[playingRow].BackColor = Color.AliceBlue;
_player.Play();
playThread = new Thread(new ThreadStart(PlayThread));
playThread.Priority = ThreadPriority.AboveNormal;
playThread.IsBackground = true;
playThread.Start();
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
}
internal void buttonStop_Click(object sender, EventArgs e)
{
try
{
_player.Stop();
if (playThread != null)
{
playThread.Join();
playThread = null;
}
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
}
internal void buttonPause_Click(object sender, EventArgs e)
{
_player.Pause();
}
private void frmCUEPlayer_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
int rowsAffected = adapterPlayList.Update(dataSet.Playlist);
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine(ex.Message);
}
}
private void MixThread()
{
AudioBuffer result = new AudioBuffer(
new AudioPCMConfig(_player.PCM.BitsPerSample, _player.PCM.ChannelCount, _mixer.PCM.SampleRate), _mixer.BufferSize);
AudioBuffer resampled = _resampler == null ? null : new AudioBuffer(_player.PCM, _mixer.BufferSize * 2 * _mixer.PCM.SampleRate / _player.PCM.SampleRate);
while (true)
{
//Trace.WriteLine(string.Format("Read"));
_mixer.Read(result, -1);
if (_resampler == null)
_player.Write(result);
else
{
//Trace.WriteLine(string.Format("Flow: {0}", result.Length));
_resampler.Flow(result, resampled);
//Trace.WriteLine(string.Format("Play: {0}", resampled.Length));
if (resampled.Length != 0)
_player.Write(resampled);
}
}
}
}
}

123
CUEPlayer/frmCUEPlayer.resx Normal file
View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>39</value>
</metadata>
</root>

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DetectingDrives" xml:space="preserve">
<value>Определение приводов</value>
</data>
<data name="DoneRipping" xml:space="preserve">
<value>Извлечение завершено</value>
</data>
<data name="DoneRippingErrors" xml:space="preserve">
<value>Судя по всему, были ошибки</value>
</data>
<data name="DoneRippingRepair" xml:space="preserve">
<value>Можете попытаться исправить ошибки с помощью CUETools</value>
</data>
<data name="ExceptionMessage" xml:space="preserve">
<value>Ошибка</value>
</data>
<data name="FailedToLoadRipperModule" xml:space="preserve">
<value>Не удалось загрузить библиотеку</value>
</data>
<data name="LookingUpVia" xml:space="preserve">
<value>Поиск альбома в базе</value>
</data>
<data name="NoDrives" xml:space="preserve">
<value>Приводы не найдены</value>
</data>
<data name="PausedMessage" xml:space="preserve">
<value>Пауза</value>
</data>
<data name="Retry" xml:space="preserve">
<value>повтор</value>
</data>
</root>

View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="listTracks.ToolTip" xml:space="preserve">
<value>Редактирование названий треков начинается двойным кликом мыши</value>
</data>
<data name="Title.Text" xml:space="preserve">
<value>Название</value>
</data>
<data name="Start.Text" xml:space="preserve">
<value>Начало</value>
</data>
<data name="Length.Text" xml:space="preserve">
<value>Длина</value>
</data>
<data name="buttonGo.Text" xml:space="preserve">
<value>Поехали</value>
</data>
<data name="buttonAbort.Text" xml:space="preserve">
<value>Стоп</value>
</data>
<data name="buttonPause.Text" xml:space="preserve">
<value>Пауза</value>
</data>
<data name="lblWriteOffset.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="lblWriteOffset.Text" xml:space="preserve">
<value>Смещение</value>
</data>
<data name="checkBoxEACMode.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 17</value>
</data>
<data name="checkBoxEACMode.Text" xml:space="preserve">
<value>Отчет в стиле EAC</value>
</data>
<data name="txtOutputPath.ToolTip" xml:space="preserve">
<value>Для выбора шаблона выходной папки кликните мышкой</value>
</data>
</root>

View File

@@ -17,6 +17,7 @@ namespace CUETools.Codecs.CoreAudio
AudioClient audioClient;
AudioClientShareMode shareMode;
AudioRenderClient renderClient;
bool audioClient_started = false;
int latencyMilliseconds;
int bufferFrameCount;
bool isUsingEventSync;
@@ -26,7 +27,8 @@ namespace CUETools.Codecs.CoreAudio
Thread playThread;
private long _sampleOffset;
private AudioPCMConfig pcm;
private NAudio.Wave.WaveFormat outputFormat;
private NAudio.Wave.WaveFormatExtensible outputFormat;
WaitHandle[] waitHandles;
/// <summary>
/// Playback Stopped
@@ -70,7 +72,7 @@ namespace CUETools.Codecs.CoreAudio
this.isUsingEventSync = useEventSync;
this.latencyMilliseconds = latency;
this.pcm = pcm;
this.outputFormat = new NAudio.Wave.WaveFormat(pcm.SampleRate, pcm.BitsPerSample, pcm.ChannelCount);
this.outputFormat = new NAudio.Wave.WaveFormatExtensible(pcm.SampleRate, pcm.BitsPerSample, pcm.ChannelCount);
NAudio.Wave.WaveFormatExtensible closestSampleRateFormat;
if (!audioClient.IsFormatSupported(shareMode, outputFormat, out closestSampleRateFormat))
throw new NotSupportedException("PCM format mismatch");
@@ -142,7 +144,6 @@ namespace CUETools.Codecs.CoreAudio
ReleaseBuffer(buff, false, 0);
// Create WaitHandle for sync
WaitHandle[] waitHandles = new WaitHandle[] { frameEventWaitHandle };
if (frameEventWaitHandle != null)
frameEventWaitHandle.Reset();
audioClient.Start();
@@ -263,11 +264,14 @@ namespace CUETools.Codecs.CoreAudio
return;
case PlaybackState.Stopped:
playbackState = PlaybackState.Playing;
if (shareMode == AudioClientShareMode.Exclusive)
{
playThread = new Thread(new ThreadStart(PlayThread));
playThread.Priority = ThreadPriority.Highest;
playThread.IsBackground = true;
playThread.Name = "Pro Audio";
playThread.Start();
}
return;
}
}
@@ -282,8 +286,16 @@ namespace CUETools.Codecs.CoreAudio
playbackState = PlaybackState.Stopped;
if (frameEventWaitHandle != null)
frameEventWaitHandle.Set();
if (audioClient_started)
{
audioClient.Stop();
audioClient_started = false;
}
if (playThread != null)
{
playThread.Join();
playThread = null;
}
ReleaseBuffer(readBuffers[0], false, 0);
ReleaseBuffer(readBuffers[1], false, 0);
active = null;
@@ -325,11 +337,12 @@ namespace CUETools.Codecs.CoreAudio
if (shareMode == AudioClientShareMode.Shared)
{
// With EventCallBack and Shared, both latencies must be set to 0
audioClient.Initialize(shareMode, AudioClientStreamFlags.EventCallback, 0, 0,
audioClient.Initialize(shareMode, AudioClientStreamFlags.EventCallback, latencyRefTimes, 0,
outputFormat, Guid.Empty);
// Get back the effective latency from AudioClient
latencyMilliseconds = (int)(audioClient.StreamLatency / 10000);
// This is all wrong! it should be treated differently
// latencyMilliseconds = (int)(audioClient.StreamLatency / 10000);
}
else
{
@@ -349,6 +362,8 @@ namespace CUETools.Codecs.CoreAudio
outputFormat, Guid.Empty);
}
waitHandles = new WaitHandle[] { frameEventWaitHandle };
// Get the RenderClient
renderClient = audioClient.AudioRenderClient;
inited = true;
@@ -402,6 +417,10 @@ namespace CUETools.Codecs.CoreAudio
Stop();
return;
}
if (src.PCM.BitsPerSample != pcm.BitsPerSample || src.PCM.ChannelCount != pcm.ChannelCount)
throw new NotSupportedException();
if (playThread != null)
{
int src_offs = 0;
do
{
@@ -410,7 +429,7 @@ namespace CUETools.Codecs.CoreAudio
if (active == null)
throw new Exception("done");
int toCopy = Math.Min(active.Size - active_offset, src.Length - src_offs);
Array.Copy(src.Bytes, src_offs * pcm.BlockAlign, active.Bytes, active_offset * pcm.BlockAlign, toCopy * pcm.BlockAlign);
Buffer.BlockCopy(src.Bytes, src_offs * pcm.BlockAlign, active.Bytes, active_offset * pcm.BlockAlign, toCopy * pcm.BlockAlign);
src_offs += toCopy;
active_offset += toCopy;
if (active_offset == active.Size)
@@ -422,6 +441,36 @@ namespace CUETools.Codecs.CoreAudio
}
while (src_offs < src.Length);
}
else
{
int src_offs = 0;
byte[] b = src.Bytes;
if (!audioClient_started)
{
audioClient.Reset();
if (frameEventWaitHandle != null)
frameEventWaitHandle.Set();
audioClient.Start();
audioClient_started = true;
}
do
{
// If using Event Sync, Wait for notification from AudioClient or Sleep half latency
int indexHandle = WaitHandle.WaitAny(waitHandles, latencyMilliseconds / 2, false);
// See how much buffer space is available.
int numFramesAvailable = Math.Min(bufferFrameCount - audioClient.CurrentPadding, src.Length - src_offs);
if (numFramesAvailable > 0)
{
//Trace.WriteLine(string.Format("Write {0}", numFramesAvailable));
IntPtr buffer = renderClient.GetBuffer(numFramesAvailable);
Marshal.Copy(b, src_offs * pcm.BlockAlign, buffer, numFramesAvailable * pcm.BlockAlign);
renderClient.ReleaseBuffer(numFramesAvailable, AudioClientBufferFlags.None);
src_offs += numFramesAvailable;
}
} while (src_offs < src.Length);
}
}
#endregion

View File

@@ -531,6 +531,8 @@ namespace CUETools.Codecs
FloatToBytes_16(inSamples, inSampleOffset, outSamples, outByteOffset, sampleCount, channelCount);
//else if (bitsPerSample > 16 && bitsPerSample <= 24)
// FLACSamplesToBytes_24(inSamples, inSampleOffset, outSamples, outByteOffset, sampleCount, channelCount, 24 - bitsPerSample);
else if (bitsPerSample == 32)
Buffer.BlockCopy(inSamples, inSampleOffset * 4 * channelCount, outSamples, outByteOffset, sampleCount * 4 * channelCount);
else
throw new Exception("Unsupported bitsPerSample value");
}
@@ -2016,6 +2018,7 @@ namespace CUETools.Codecs
_workThread = new Thread(Decompress);
_workThread.Priority = priority;
_workThread.IsBackground = true;
_workThread.Name = "AudioPipe";
_workThread.Start(null);
}

View File

@@ -10,8 +10,7 @@ namespace CUETools.DSP.Mixer
public class MixingSource : IAudioSource
{
AudioPCMConfig pcm;
MixingBuffer buf0;
MixingBuffer buf1;
MixingBuffer[] buf;
bool[] playing;
float[] volume;
long samplePos;
@@ -21,8 +20,9 @@ namespace CUETools.DSP.Mixer
{
this.pcm = pcm;
this.size = delay * pcm.SampleRate / 1000;
this.buf0 = new MixingBuffer(pcm, size, sources);
this.buf1 = new MixingBuffer(pcm, size, sources);
this.buf = new MixingBuffer[2];
this.buf[0] = new MixingBuffer(pcm, size, sources);
this.buf[1] = new MixingBuffer(pcm, size, sources);
this.playing = new bool[sources];
this.volume = new float[sources];
this.samplePos = 0;
@@ -83,10 +83,10 @@ namespace CUETools.DSP.Mixer
float sumVolume = 0.0f;
for (int iSource = 0; iSource < mixbuff.source.Length; iSource++)
if (playing[iSource])
if (mixbuff.filled[iSource])
sumVolume += mixbuff.volume[iSource];
for (int iSource = 0; iSource < mixbuff.source.Length; iSource++)
volume[iSource] = playing[iSource] ? mixbuff.volume[iSource] / Math.Max(1.0f, sumVolume) : 0.0f;
volume[iSource] = mixbuff.filled[iSource] ? mixbuff.volume[iSource] / Math.Max(1.0f, sumVolume) : 0.0f;
for (int iSmp = 0; iSmp < result.Length; iSmp++)
{
for (int iChan = 0; iChan < result.PCM.ChannelCount; iChan++)
@@ -114,7 +114,7 @@ namespace CUETools.DSP.Mixer
{
get
{
return buf0.source[0].Size;
return buf[0].source[0].Size;
}
}
@@ -126,6 +126,8 @@ namespace CUETools.DSP.Mixer
return res;
}
int current = 0;
internal MixingBuffer LockFilledBuffer()
{
lock (this)
@@ -133,9 +135,11 @@ namespace CUETools.DSP.Mixer
//Trace.WriteLine(string.Format("LockFilledBuffer: 0.0: {0} {1}; 0.1: {2} {3}; 1.0: {4} {5}; 1.1: {6} {7};",
// buf0.playing[0], buf0.filled[0], buf0.playing[1], buf0.filled[1],
// buf0.playing[0], buf0.filled[0], buf0.playing[1], buf0.filled[1]));
while (!IsFilled(buf0) && !IsFilled(buf1))
int no = current;
while (!IsFilled(buf[no]))
Monitor.Wait(this);
return IsFilled(buf0) ? buf0 : buf1;
current = 1 - no;
return buf[no];
}
}
@@ -179,10 +183,10 @@ namespace CUETools.DSP.Mixer
// buf0.playing[0], buf0.filled[0], buf0.playing[1], buf0.filled[1],
// buf0.playing[0], buf0.filled[0], buf0.playing[1], buf0.filled[1], iSource));
while (!playing[iSource] || (buf0.filled[iSource] && buf1.filled[iSource]))
while (!playing[iSource] || buf[current].filled[iSource])
Monitor.Wait(this);
return !buf0.filled[iSource] ? buf0 : buf1;
return buf[current];
}
}
@@ -301,6 +305,17 @@ namespace CUETools.DSP.Mixer
mixer.LockEmptyBuffer(iSource);
}
public void Flush()
{
if (mixbuff != null)
{
if (mixbuff.source[iSource].Length < mixbuff.source[iSource].Size)
AudioSamples.MemSet(mixbuff.source[iSource].Bytes, 0, mixbuff.source[iSource].Length * PCM.BlockAlign, (mixbuff.source[iSource].Size - mixbuff.source[iSource].Length) * PCM.BlockAlign);
mixer.UnlockEmptyBuffer(mixbuff, iSource, volume);
mixbuff = null;
}
}
public void Write(AudioBuffer buff)
{
int bs = PCM.BlockAlign;

View File

@@ -25,10 +25,11 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>..\bin\Release\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
@@ -43,6 +44,7 @@
<Compile Include="Crc32Test.cs" />
<Compile Include="FlakeWriterTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SOXResamplerTest.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\CUETools.AccurateRip\CUETools.AccurateRip.csproj">
@@ -67,6 +69,10 @@
<Project>{6458A13A-30EF-45A9-9D58-E5031B17BEE2}</Project>
<Name>CUETools.Codecs</Name>
</ProjectReference>
<ProjectReference Include="..\..\CUETools.DSP.Resampler\CUETools.DSP.Resampler.csproj">
<Project>{A6303861-CA06-4C2C-A104-BA9291538F6F}</Project>
<Name>CUETools.DSP.Resampler</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

View File

@@ -0,0 +1,100 @@
using CUETools.DSP.Resampler;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CUETools.Codecs;
using System;
namespace CUETools.TestCodecs
{
/// <summary>
///This is a test class for SOXResamplerTest and is intended
///to contain all SOXResamplerTest Unit Tests
///</summary>
[TestClass()]
public class SOXResamplerTest
{
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
/// <summary>
///A test for SOXResampler Constructor
///</summary>
[TestMethod()]
public void SOXResamplerConstructorTest()
{
AudioPCMConfig inputPCM = new AudioPCMConfig(32, 1, 44100);
AudioPCMConfig outputPCM = new AudioPCMConfig(32, 1, 48000);
SOXResamplerConfig cfg;
cfg.quality = SOXResamplerQuality.Very;
cfg.phase = 50;
cfg.allow_aliasing = false;
cfg.bandwidth = 0;
SOXResampler resampler = new SOXResampler(inputPCM, outputPCM, cfg);
AudioBuffer src = new AudioBuffer(inputPCM, 400 * inputPCM.SampleRate / 1000);
AudioBuffer dst = new AudioBuffer(outputPCM, src.Size * 3);
int offs = 0;
double delta = 0;
for (int i = 0; i < 100; i++)
{
src.Prepare(-1);
for (int j = 0; j < src.Size; j++)
src.Float[j, 0] = (float)Math.Sin((i * src.Size + j) * Math.PI / 44100);
src.Length = src.Size;
resampler.Flow(src, dst);
for (int j = 0; j < dst.Length; j++)
delta += dst.Float[j, 0] - Math.Sin((offs + j) * Math.PI / 48000);
offs += dst.Length;
}
Assert.IsTrue(Math.Abs(delta) < 0.00001, "Error too large");
}
}
}

View File

@@ -159,6 +159,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUEPlayer", "..\CUEPlayer\C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUETools.Codecs.CoreAudio", "..\CUETools.Codecs.CoreAudio\CUETools.Codecs.CoreAudio.csproj", "{FAD09EE2-D6B2-4A8E-9F1C-2A9FB293661A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUETools.Codecs.LAME", "..\CUETools.Codecs.LAME\CUETools.Codecs.LAME.csproj", "{1AF02E2C-2CB2-44B5-B417-37653071FEC6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUETools.Codecs.DirectSound", "..\CUETools.Codecs.DirectSound\CUETools.Codecs.DirectSound.csproj", "{5A9FB016-6388-475D-AB33-6F86AD49FDAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUETools.DSP.Mixer", "..\CUETools.DSP.Mixer\CUETools.DSP.Mixer.csproj", "{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUETools.DSP.Resampler", "..\CUETools.DSP.Resampler\CUETools.DSP.Resampler.csproj", "{A6303861-CA06-4C2C-A104-BA9291538F6F}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = CUETools1.vsmdi
@@ -590,6 +598,38 @@ Global
{FAD09EE2-D6B2-4A8E-9F1C-2A9FB293661A}.Release|Any CPU.Build.0 = Release|Any CPU
{FAD09EE2-D6B2-4A8E-9F1C-2A9FB293661A}.Release|Win32.ActiveCfg = Release|Any CPU
{FAD09EE2-D6B2-4A8E-9F1C-2A9FB293661A}.Release|x64.ActiveCfg = Release|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Debug|x64.ActiveCfg = Debug|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Release|Any CPU.Build.0 = Release|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Release|Win32.ActiveCfg = Release|Any CPU
{1AF02E2C-2CB2-44B5-B417-37653071FEC6}.Release|x64.ActiveCfg = Release|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Debug|x64.ActiveCfg = Debug|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Release|Any CPU.Build.0 = Release|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Release|Win32.ActiveCfg = Release|Any CPU
{5A9FB016-6388-475D-AB33-6F86AD49FDAD}.Release|x64.ActiveCfg = Release|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Debug|Win32.ActiveCfg = Debug|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Debug|x64.ActiveCfg = Debug|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Release|Any CPU.Build.0 = Release|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Release|Win32.ActiveCfg = Release|Any CPU
{AFF1AFF9-839D-4892-88CD-8BD09BAFC1D2}.Release|x64.ActiveCfg = Release|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Debug|Win32.ActiveCfg = Debug|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Debug|x64.ActiveCfg = Debug|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Release|Any CPU.Build.0 = Release|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Release|Win32.ActiveCfg = Release|Any CPU
{A6303861-CA06-4C2C-A104-BA9291538F6F}.Release|x64.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -624,6 +664,7 @@ Global
{082D6B9E-326E-4D15-9798-EDAE9EDE70A6} = {93B7AE1D-DEF6-4A04-A222-5CDE09DF262D}
{DFE50673-906C-4B8F-993B-A24CAD1CA17D} = {93B7AE1D-DEF6-4A04-A222-5CDE09DF262D}
{DDE1EA77-637C-4D5F-96F3-1328BC45CE80} = {93B7AE1D-DEF6-4A04-A222-5CDE09DF262D}
{1AF02E2C-2CB2-44B5-B417-37653071FEC6} = {93B7AE1D-DEF6-4A04-A222-5CDE09DF262D}
{04945FB2-8410-4F14-8262-2ED18DCDACD6} = {D9D97BB6-002F-4858-8EF2-49B4C4C4DDB4}
{A430AD28-B76A-4ED0-AF7D-D13B8969297F} = {D9D97BB6-002F-4858-8EF2-49B4C4C4DDB4}
{5C8B61C0-BC3D-4316-B8A7-419D55BB5796} = {D9D97BB6-002F-4858-8EF2-49B4C4C4DDB4}

View File

@@ -3,7 +3,7 @@
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="cad9b348-419f-496e-92ed-2dfc5d74da06" name="Local Test Run" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
<TestList name="Tests Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d">
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d">
<TestLinks>
<TestLink id="707b580c-3801-a61c-0d6a-866ccb489f00" name="CDRepairFixTest" storage="cuetools.testparity\bin\release\cuetools.testparity.dll" enabled="false" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />
</TestLinks>