crappy little alpha release

This commit is contained in:
Brett Sanderson 2016-03-08 23:22:19 -05:00
parent 385954f90f
commit 7c3f834786
21 changed files with 624 additions and 154 deletions

121
CdgPlayer/CdgPlayer.csproj Normal file
View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5324295-6BD2-4415-92CD-6EA77D708E00}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CdgPlayer</RootNamespace>
<AssemblyName>CdgPlayer</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Vlc.DotNet.Core, Version=2.1.115.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=x86">
<HintPath>..\packages\Vlc.DotNet.Core.2.1.115\lib\net45\x86\Vlc.DotNet.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Vlc.DotNet.Core.Interops, Version=2.1.115.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=x86">
<HintPath>..\packages\Vlc.DotNet.Core.Interops.2.1.115\lib\net45\x86\Vlc.DotNet.Core.Interops.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Vlc.DotNet.Forms, Version=2.1.115.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=x86">
<HintPath>..\packages\Vlc.DotNet.Forms.2.1.115\lib\net45\x86\Vlc.DotNet.Forms.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="KaraokeVideoOverlay.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="KaraokeVideoOverlay.Designer.cs">
<DependentUpon>KaraokeVideoOverlay.cs</DependentUpon>
</Compile>
<Compile Include="KaraokeVideoPlayer.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="KaraokeVideoPlayer.Designer.cs">
<DependentUpon>KaraokeVideoPlayer.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="KaraokeVideoOverlay.resx">
<DependentUpon>KaraokeVideoOverlay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="KaraokeVideoPlayer.resx">
<DependentUpon>KaraokeVideoPlayer.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="app.config" />
<None Include="packages.config" />
<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="..\CdgLib\CdgLib.csproj">
<Project>{3203dfd2-da5b-47b3-b009-18dd9c401fc3}</Project>
<Name>CdgLib</Name>
</ProjectReference>
</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

@ -1,6 +1,6 @@
namespace KaraokePlayer
{
partial class OverlayForm
partial class KaraokeVideoOverlay
{
/// <summary>
/// Required designer variable.

View File

@ -5,14 +5,14 @@ using System.Windows.Forms;
namespace KaraokePlayer
{
public partial class OverlayForm : Form
public partial class KaraokeVideoOverlay : Form
{
private const int DwmwaTransitionsForcedisabled = 3;
ContainerControl _parent;
public OverlayForm(ContainerControl parent)
public KaraokeVideoOverlay(ContainerControl parent)
{
var parentForm = parent.FindForm();
InitializeComponent();
Graphic.BackColor = Color.Transparent;
_parent = parent;
@ -24,7 +24,7 @@ namespace KaraokePlayer
StartPosition = FormStartPosition.Manual;
AutoScaleMode = AutoScaleMode.None;
Show(parent);
parent.ParentForm.LocationChanged += Cover_LocationChanged;
parentForm.LocationChanged += Cover_LocationChanged;
parent.LocationChanged += Cover_LocationChanged;
parent.VisibleChanged += Cover_LocationChanged;
parent.ClientSizeChanged += Cover_ClientSizeChanged;
@ -32,7 +32,7 @@ namespace KaraokePlayer
if (Environment.OSVersion.Version.Major >= 6)
{
var value = 1;
DwmSetWindowAttribute(parent.ParentForm.Handle, DwmwaTransitionsForcedisabled, ref value, 4);
DwmSetWindowAttribute(parentForm.Handle, DwmwaTransitionsForcedisabled, ref value, 4);
}
Location = parent.PointToScreen(Point.Empty);
ClientSize = parent.ClientSize;
@ -46,12 +46,14 @@ namespace KaraokePlayer
private void Cover_LocationChanged(object sender, EventArgs e)
{
Location = _parent.PointToScreen(Point.Empty);
ClientSize = _parent.ClientSize;
Location = _parent.PointToScreen(Point.Empty);
}
private void Cover_ClientSizeChanged(object sender, EventArgs e)
{
ClientSize = _parent.ClientSize;
Location = _parent.PointToScreen(Point.Empty);
}
protected override void OnFormClosing(FormClosingEventArgs e)
@ -66,13 +68,6 @@ namespace KaraokePlayer
}
base.OnFormClosing(e);
}
protected override void OnActivated(EventArgs e)
{
// Always keep the owner activated instead
BeginInvoke(new Action(() => Owner.Activate()));
}
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(IntPtr hWnd, int attr, ref int value, int attrLen);

View File

@ -29,9 +29,7 @@
private void InitializeComponent()
{
this.vlcPlayer = new Vlc.DotNet.Forms.VlcControl();
this.panelVideo = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.vlcPlayer)).BeginInit();
this.panelVideo.SuspendLayout();
this.SuspendLayout();
//
// vlcPlayer
@ -54,28 +52,17 @@
this.vlcPlayer.VlcLibDirectoryNeeded += new System.EventHandler<Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs>(this.vlcPlayer_VlcLibDirectoryNeeded);
this.vlcPlayer.Playing += new System.EventHandler<Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs>(this.vlcPlayer_Playing);
this.vlcPlayer.TimeChanged += new System.EventHandler<Vlc.DotNet.Core.VlcMediaPlayerTimeChangedEventArgs>(this.vlcPlayer_TimeChanged);
this.vlcPlayer.DoubleClick += new System.EventHandler(this.vlcPlayer_DoubleClick);
//
// panelVideo
//
this.panelVideo.Controls.Add(this.vlcPlayer);
this.panelVideo.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelVideo.Location = new System.Drawing.Point(0, 0);
this.panelVideo.Name = "panelVideo";
this.panelVideo.Size = new System.Drawing.Size(428, 330);
this.panelVideo.TabIndex = 2;
//
// KaraokeVideoPlayer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panelVideo);
this.Controls.Add(this.vlcPlayer);
this.Name = "KaraokeVideoPlayer";
this.Size = new System.Drawing.Size(428, 330);
this.DoubleClick += new System.EventHandler(this.KaraokeVideoPlayer_DoubleClick);
this.Load += new System.EventHandler(this.KaraokeVideoPlayer_Load);
this.ParentChanged += new System.EventHandler(this.KaraokeVideoPlayer_ParentChanged);
((System.ComponentModel.ISupportInitialize)(this.vlcPlayer)).EndInit();
this.panelVideo.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -83,6 +70,5 @@
#endregion
private Vlc.DotNet.Forms.VlcControl vlcPlayer;
private System.Windows.Forms.Panel panelVideo;
}
}

View File

@ -16,21 +16,21 @@ namespace KaraokePlayer
public partial class KaraokeVideoPlayer : UserControl
{
private GraphicsFile _cdgFile;
private OverlayForm _overlayForm;
private KaraokeVideoOverlay _overlayForm;
private DateTime _startTime;
private readonly System.Timers.Timer _lyricTimer = new System.Timers.Timer();
public KaraokeVideoPlayer()
{
InitializeComponent();
_lyricTimer.Interval = 50;
_lyricTimer.Interval = 33;
_lyricTimer.Elapsed += LyricTimerOnElapsed;
}
private void LyricTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
{
var picture = _cdgFile.RenderAtTime((long)(DateTime.Now - _startTime).TotalMilliseconds);
_overlayForm.Graphic.Image = picture;
BeginInvoke(new MethodInvoker(() => { _overlayForm.Graphic.Image = picture; }));
}
public async void Play(Uri file)
@ -53,10 +53,7 @@ namespace KaraokePlayer
private void KaraokeVideoPlayer_ParentChanged(object sender, EventArgs e)
{
if (ParentForm != null)
{
_overlayForm = new OverlayForm(this);
}
}
private void vlcPlayer_VlcLibDirectoryNeeded(object sender, Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs e)
@ -64,19 +61,12 @@ namespace KaraokePlayer
e.VlcLibDirectory = new DirectoryInfo(@"lib\vlc\");
}
private void vlcPlayer_DoubleClick(object sender, EventArgs e)
private void KaraokeVideoPlayer_Load(object sender, EventArgs e)
{
}
private void KaraokeVideoPlayer_DoubleClick(object sender, EventArgs e)
{
}
private void panel1_DoubleClick(object sender, EventArgs e)
{
if (this.FindForm() != null)
{
_overlayForm = new KaraokeVideoOverlay(this);
}
}
}
}

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("CdgPlayer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CdgPlayer")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("a5324295-6bd2-4415-92cd-6ea77d708e00")]
// 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,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CdgPlayer.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", "4.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("CdgPlayer.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;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CdgPlayer.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

3
CdgPlayer/app.config Normal file
View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Vlc.DotNet.Core" version="2.1.115" targetFramework="net452" />
<package id="Vlc.DotNet.Core.Interops" version="2.1.115" targetFramework="net452" />
<package id="Vlc.DotNet.Forms" version="2.1.115" targetFramework="net452" />
</packages>

View File

@ -1,11 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25008.0
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CdgLib", "CdgLib\CdgLib.csproj", "{3203DFD2-DA5B-47B3-B009-18DD9C401FC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KaraokePlayer", "KaraokePlayer\KaraokePlayer.csproj", "{2CF318E2-04B5-40FC-9577-6DAC62B86FB2}"
ProjectSection(ProjectDependencies) = postProject
{A5324295-6BD2-4415-92CD-6EA77D708E00} = {A5324295-6BD2-4415-92CD-6EA77D708E00}
{3203DFD2-DA5B-47B3-B009-18DD9C401FC3} = {3203DFD2-DA5B-47B3-B009-18DD9C401FC3}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CdgPlayer", "CdgPlayer\CdgPlayer.csproj", "{A5324295-6BD2-4415-92CD-6EA77D708E00}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -21,6 +27,10 @@ Global
{2CF318E2-04B5-40FC-9577-6DAC62B86FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2CF318E2-04B5-40FC-9577-6DAC62B86FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2CF318E2-04B5-40FC-9577-6DAC62B86FB2}.Release|Any CPU.Build.0 = Release|Any CPU
{A5324295-6BD2-4415-92CD-6EA77D708E00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5324295-6BD2-4415-92CD-6EA77D708E00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5324295-6BD2-4415-92CD-6EA77D708E00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5324295-6BD2-4415-92CD-6EA77D708E00}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -54,52 +54,19 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Vlc.DotNet.Core, Version=2.1.115.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Vlc.DotNet.Core.2.1.115\lib\net45\x86\Vlc.DotNet.Core.dll</HintPath>
</Reference>
<Reference Include="Vlc.DotNet.Core.Interops, Version=2.1.115.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Vlc.DotNet.Core.Interops.2.1.115\lib\net45\x86\Vlc.DotNet.Core.Interops.dll</HintPath>
</Reference>
<Reference Include="Vlc.DotNet.Forms, Version=2.1.115.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Vlc.DotNet.Forms.2.1.115\lib\net45\x86\Vlc.DotNet.Forms.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="KaraokeVideoPlayer.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="KaraokeVideoPlayer.Designer.cs">
<DependentUpon>KaraokeVideoPlayer.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="OverlayForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="OverlayForm.Designer.cs">
<DependentUpon>OverlayForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TransparentPanel.cs">
<SubType>Component</SubType>
</Compile>
<EmbeddedResource Include="KaraokeVideoPlayer.resx">
<DependentUpon>KaraokeVideoPlayer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OverlayForm.resx">
<DependentUpon>OverlayForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -125,12 +92,6 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CdgLib\CdgLib.csproj">
<Project>{3203dfd2-da5b-47b3-b009-18dd9c401fc3}</Project>
<Name>CdgLib</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="lib\MaterialSkin.dll" />
<Content Include="lib\vlc\libvlc.dll" />
@ -436,6 +397,12 @@
<ItemGroup>
<Folder Include="lib\presets\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CdgPlayer\CdgPlayer.csproj">
<Project>{a5324295-6bd2-4415-92cd-6ea77d708e00}</Project>
<Name>CdgPlayer</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>XCOPY "$(ProjectDir)lib" "$(TargetDir)lib\" /S /y /c</PostBuildEvent>

View File

@ -28,49 +28,199 @@
/// </summary>
private void InitializeComponent()
{
this.materialRaisedButton1 = new MaterialSkin.Controls.MaterialRaisedButton();
this.btnPlay = new MaterialSkin.Controls.MaterialRaisedButton();
this.btnBrowse = new MaterialSkin.Controls.MaterialRaisedButton();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.browseDialog = new System.Windows.Forms.FolderBrowserDialog();
this.karaokeVideoPlayer1 = new KaraokePlayer.KaraokeVideoPlayer();
this.materialListBox1 = new MaterialSkin.Controls.MaterialListBox();
this.materialSingleLineTextField1 = new MaterialSkin.Controls.MaterialSingleLineTextField();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// materialRaisedButton1
// btnPlay
//
this.materialRaisedButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.materialRaisedButton1.Depth = 0;
this.materialRaisedButton1.Location = new System.Drawing.Point(385, 358);
this.materialRaisedButton1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialRaisedButton1.Name = "materialRaisedButton1";
this.materialRaisedButton1.Size = new System.Drawing.Size(81, 37);
this.materialRaisedButton1.TabIndex = 1;
this.materialRaisedButton1.Text = "Play";
this.materialRaisedButton1.UseVisualStyleBackColor = true;
this.materialRaisedButton1.Click += new System.EventHandler(this.materialRaisedButton1_Click);
this.btnPlay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnPlay.Depth = 0;
this.btnPlay.Location = new System.Drawing.Point(629, 3);
this.btnPlay.MouseState = MaterialSkin.MouseState.HOVER;
this.btnPlay.Name = "btnPlay";
this.btnPlay.Size = new System.Drawing.Size(81, 37);
this.btnPlay.TabIndex = 1;
this.btnPlay.Text = "Play";
this.btnPlay.UseVisualStyleBackColor = true;
this.btnPlay.Click += new System.EventHandler(this.materialRaisedButton1_Click);
//
// btnBrowse
//
this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowse.Depth = 0;
this.btnBrowse.Location = new System.Drawing.Point(542, 3);
this.btnBrowse.MouseState = MaterialSkin.MouseState.HOVER;
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(81, 37);
this.btnBrowse.TabIndex = 2;
this.btnBrowse.Text = "Browse";
this.btnBrowse.UseVisualStyleBackColor = true;
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.splitContainer1, 0, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 71);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(719, 513);
this.tableLayoutPanel1.TabIndex = 5;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
this.flowLayoutPanel1.Controls.Add(this.btnPlay);
this.flowLayoutPanel1.Controls.Add(this.btnBrowse);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 467);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(713, 43);
this.flowLayoutPanel1.TabIndex = 6;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(3, 3);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.karaokeVideoPlayer1);
this.splitContainer1.Size = new System.Drawing.Size(713, 458);
this.splitContainer1.SplitterDistance = 237;
this.splitContainer1.TabIndex = 6;
//
// browseDialog
//
this.browseDialog.SelectedPath = "D:\\Karaoke\\SF360 February 2016\\SF360-01 - Charlie Puth - One Call Away\\";
//
// karaokeVideoPlayer1
//
this.karaokeVideoPlayer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.karaokeVideoPlayer1.Location = new System.Drawing.Point(12, 72);
this.karaokeVideoPlayer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.karaokeVideoPlayer1.Location = new System.Drawing.Point(0, 0);
this.karaokeVideoPlayer1.Name = "karaokeVideoPlayer1";
this.karaokeVideoPlayer1.Size = new System.Drawing.Size(454, 280);
this.karaokeVideoPlayer1.Size = new System.Drawing.Size(472, 458);
this.karaokeVideoPlayer1.TabIndex = 0;
//
// materialListBox1
//
this.materialListBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.materialListBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.materialListBox1.Depth = 0;
this.materialListBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.materialListBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
this.materialListBox1.Font = new System.Drawing.Font("Roboto", 24F);
this.materialListBox1.FormattingEnabled = true;
this.materialListBox1.Items.AddRange(new object[] {
"1",
"2",
"3",
"4"});
this.materialListBox1.Location = new System.Drawing.Point(3, 32);
this.materialListBox1.MouseLocation = new System.Drawing.Point(-1, -1);
this.materialListBox1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialListBox1.Name = "materialListBox1";
this.materialListBox1.Size = new System.Drawing.Size(231, 423);
this.materialListBox1.TabIndex = 5;
this.materialListBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.materialListBox1_MouseDoubleClick);
//
// materialSingleLineTextField1
//
this.materialSingleLineTextField1.Depth = 0;
this.materialSingleLineTextField1.Dock = System.Windows.Forms.DockStyle.Fill;
this.materialSingleLineTextField1.Hint = "";
this.materialSingleLineTextField1.Location = new System.Drawing.Point(3, 3);
this.materialSingleLineTextField1.MaxLength = 32767;
this.materialSingleLineTextField1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialSingleLineTextField1.Name = "materialSingleLineTextField1";
this.materialSingleLineTextField1.PasswordChar = '\0';
this.materialSingleLineTextField1.SelectedText = "";
this.materialSingleLineTextField1.SelectionLength = 0;
this.materialSingleLineTextField1.SelectionStart = 0;
this.materialSingleLineTextField1.Size = new System.Drawing.Size(231, 23);
this.materialSingleLineTextField1.TabIndex = 6;
this.materialSingleLineTextField1.TabStop = false;
this.materialSingleLineTextField1.UseSystemPasswordChar = false;
this.materialSingleLineTextField1.TextChanged += new System.EventHandler(this.materialSingleLineTextField1_TextChanged);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.BackColor = System.Drawing.SystemColors.Control;
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel2.Controls.Add(this.materialListBox1, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.materialSingleLineTextField1, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.Size = new System.Drawing.Size(237, 458);
this.tableLayoutPanel2.TabIndex = 7;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(478, 407);
this.Controls.Add(this.materialRaisedButton1);
this.Controls.Add(this.karaokeVideoPlayer1);
this.ClientSize = new System.Drawing.Size(743, 596);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "MainForm";
this.Text = "Karaoke Player";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private MaterialSkin.Controls.MaterialRaisedButton btnPlay;
private MaterialSkin.Controls.MaterialRaisedButton btnBrowse;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.FolderBrowserDialog browseDialog;
private System.Windows.Forms.SplitContainer splitContainer1;
private KaraokeVideoPlayer karaokeVideoPlayer1;
private MaterialSkin.Controls.MaterialRaisedButton materialRaisedButton1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private MaterialSkin.Controls.MaterialListBox materialListBox1;
private MaterialSkin.Controls.MaterialSingleLineTextField materialSingleLineTextField1;
}
}

View File

@ -1,19 +1,25 @@
using System;
using MaterialSkin;
using MaterialSkin.Controls;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace KaraokePlayer
{
public partial class MainForm : MaterialForm
{
private readonly MaterialSkinManager _materialSkinManager;
private List<FileInfo> _fileList;
public MainForm()
{
InitializeComponent();
// Initialize MaterialSkinManager
_materialSkinManager = MaterialSkinManager.Instance;
_materialSkinManager.AddFormToManage(this);
_materialSkinManager.Theme = new DarkTheme();
//_materialSkinManager.Theme = new DarkTheme();
_materialSkinManager.ColorScheme = new ColorScheme(Primary.Green600, Primary.Green700, Primary.Green200, Accent.Red100, TextShade.WHITE);
}
@ -22,6 +28,32 @@ namespace KaraokePlayer
karaokeVideoPlayer1.Play(new Uri(@"D:\Karaoke\SF360 February 2016\SF360-01 - Charlie Puth - One Call Away\SF360-01 - Charlie Puth - One Call Away.mp3"));
}
private void btnBrowse_Click(object sender, EventArgs e)
{
if (browseDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
var files = System.IO.Directory.GetFiles(browseDialog.SelectedPath, "*.cdg", searchOption: System.IO.SearchOption.AllDirectories);
_fileList = files.Select(file => new FileInfo(file)).ToList();
materialListBox1.DataSource = _fileList;
materialListBox1.DisplayMember = "Name";
}
}
private void materialListBox1_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
{
int index = this.materialListBox1.IndexFromPoint(e.Location);
if (index != System.Windows.Forms.ListBox.NoMatches)
{
karaokeVideoPlayer1.Play(new Uri(Path.ChangeExtension(((FileInfo)materialListBox1.Items[index]).FullName,".mp3")));
}
}
private void materialSingleLineTextField1_TextChanged(object sender, EventArgs e)
{
materialListBox1.DataSource = _fileList.Where(
file => Regex.IsMatch(file.Name, materialSingleLineTextField1.Text, RegexOptions.IgnoreCase)).ToList();
}
}
}

View File

@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="browseDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KaraokePlayer
{
class TransparentPanel : PictureBox
{
public TransparentPanel()
{
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.Opaque, true);
}
protected override void OnPaintBackground(PaintEventArgs e)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
e.Graphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 300));
//base.OnPaintBackground(e);
}
protected override void OnPaint(PaintEventArgs e)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
e.Graphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 300));
//base.OnPaintBackground(e);
}
}
}

View File

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="SharpZipLib" version="0.86.0" targetFramework="net46" />
<package id="Vlc.DotNet.Core" version="2.1.115" targetFramework="net46" />
<package id="Vlc.DotNet.Core.Interops" version="2.1.115" targetFramework="net46" />
<package id="Vlc.DotNet.Forms" version="2.1.115" targetFramework="net46" />
</packages>