Reorganize files from svn

This commit is contained in:
james
2024-05-20 00:17:44 +00:00
parent c949f4c9a0
commit 7c830b241a
497 changed files with 0 additions and 0 deletions

41
LipSync/NicoComment/Config.Designer.cs generated Normal file
View File

@@ -0,0 +1,41 @@
namespace NicoComment {
partial class Config {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
private void InitializeComponent() {
this.SuspendLayout();
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F );
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size( 294, 206 );
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout( false );
}
#endregion
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace NicoComment {
public partial class Config : Form {
public Config() {
InitializeComponent();
}
}
}

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>

116
LipSync/NicoComment/FConfig.Designer.cs generated Normal file
View File

@@ -0,0 +1,116 @@
namespace NicoComment {
partial class FConfig {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
private void InitializeComponent() {
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point( 108, 63 );
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size( 75, 23 );
this.btnOK.TabIndex = 1;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler( this.btnOK_Click );
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point( 207, 63 );
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size( 75, 23 );
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// openFileDialog1
//
this.openFileDialog1.Filter = "text file(*.txt)|*.txt|xml format(*.xml)|*.xml|all files(*.*)|*.*";
//
// button1
//
this.button1.Location = new System.Drawing.Point( 258, 30 );
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size( 24, 23 );
this.button1.TabIndex = 3;
this.button1.Text = "...";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler( this.button1_Click );
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point( 12, 32 );
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size( 240, 19 );
this.textBox1.TabIndex = 4;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point( 10, 9 );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size( 73, 12 );
this.label1.TabIndex = 5;
this.label1.Text = "読込むファイル";
//
// FConfig
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F );
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size( 294, 97 );
this.Controls.Add( this.label1 );
this.Controls.Add( this.textBox1 );
this.Controls.Add( this.button1 );
this.Controls.Add( this.btnCancel );
this.Controls.Add( this.btnOK );
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FConfig";
this.Text = "Nico Commentの設定";
this.ResumeLayout( false );
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace NicoComment {
public partial class FConfig : Form {
private string config = "";
public string ConfigString {
get {
return config;
}
}
public FConfig( string configure ) {
InitializeComponent();
string[] result = configure.Split( new char[] { '\n' } );
textBox1.Text = result[0];
//textBox2.Lines = configure.Split( new char[]{'\n'});
}
private void btnOK_Click( object sender, EventArgs e ) {
string path = textBox1.Text;
if ( File.Exists( path ) ) {
config = path;
using ( StreamReader sr = new StreamReader( path ) ) {
while ( sr.Peek() >= 0 ) {
config += '\n' + sr.ReadLine();
}
}
this.DialogResult = DialogResult.OK;
} else {
this.DialogResult = DialogResult.Cancel;
}
base.Close();
}
private void button1_Click( object sender, EventArgs e ) {
if ( openFileDialog1.ShowDialog() == DialogResult.OK ) {
textBox1.Text = openFileDialog1.FileName;
}
}
}
}

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="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

100
LipSync/NicoComment/Form1.Designer.cs generated Normal file
View File

@@ -0,0 +1,100 @@
namespace NicoComment {
partial class Form1 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
private void InitializeComponent() {
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox3 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Location = new System.Drawing.Point( 12, 12 );
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size( 512, 384 );
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point( 18, 450 );
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size( 100, 19 );
this.textBox1.TabIndex = 1;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point( 146, 453 );
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size( 221, 19 );
this.textBox2.TabIndex = 2;
//
// button1
//
this.button1.Location = new System.Drawing.Point( 423, 453 );
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size( 75, 23 );
this.button1.TabIndex = 3;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler( this.button1_Click );
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point( 104, 478 );
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size( 101, 19 );
this.textBox3.TabIndex = 4;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F );
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size( 537, 509 );
this.Controls.Add( this.textBox3 );
this.Controls.Add( this.button1 );
this.Controls.Add( this.textBox2 );
this.Controls.Add( this.textBox1 );
this.Controls.Add( this.pictureBox1 );
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout( false );
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox3;
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace NicoComment {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
pictureBox1.Image = new Bitmap( 512, 384 );
}
private void button1_Click( object sender, EventArgs e ) {
using ( Graphics g = Graphics.FromImage( pictureBox1.Image ) ) {
g.Clear( Color.Black );
double time = double.Parse( textBox3.Text );
NComment entry = new NComment( 0.0f, textBox1.Text, textBox2.Text, 0 );
NicoComment.drawString( g, entry, pictureBox1.Bounds, time, 1 );
}
pictureBox1.Invalidate();
}
}
}

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>

View File

@@ -0,0 +1,508 @@
using System;
using System.Collections.Generic;
using System.Text;
using Plugin;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace NicoComment {
public class NicoComment : IPlugin{
private List<string> config = new List<string>();
private List<NComment> comments = new List<NComment>();
public void ApplyLanguage( string language_code ) {
}
public string Name {
get {
return "Nico Comment";
}
}
public ulong Type {
get {
return 0;
}
}
public string Abstract {
get {
return "ニコニコ動画ぽい字幕を、ニコニコ動画と同様なコマンドで追加できるプラグイン。";
}
}
public void Apply( ref Bitmap frame, float time, float e_begin, float e_end, ref string e_body ) {
using ( Graphics g = Graphics.FromImage( frame ) ) {
Rectangle rc = new Rectangle( 0, 0, frame.Width, frame.Height );
int skip_count_def = 0;
bool first_def = true;
bool first_shita = true;
bool first_ue = true;
int y_def = 0;
int y_shita = rc.Height;
int y_ue = 0;
for ( int i = 0; i < comments.Count; i++ ) {
if ( comments[i].time <= time && time < comments[i].time + 3.0 ) {
double t = time - comments[i].time;
int height = (int)comments[i].type.Size.Size;
if ( comments[i].type.Position == NComTypePosition.def ) {
if ( !first_def ) {
y_def += height;
if ( y_def > rc.Height ) {
y_def -= rc.Height;
skip_count_def++;
}
t += 0.1 * skip_count_def;
} else {
first_def = false;
}
if ( comments[i].y == NComment.NULL ) {
comments[i].y = y_def;
}
} else if ( comments[i].type.Position == NComTypePosition.shita ) {
if ( !first_shita ) {
y_shita -= (int)(1.1f * height);
if ( y_shita + height < 0 ) {
y_shita += rc.Height;
}
} else {
y_shita -= (int)(1.1f * height);
first_shita = false;
}
if ( comments[i].y == NComment.NULL ) {
comments[i].y = y_shita;
}
} else if ( comments[i].type.Position == NComTypePosition.ue ) {
if ( !first_ue ) {
y_ue += (int)(1.1f * height);
if ( y_ue > rc.Height ) {
y_ue += rc.Height;
}
} else {
first_ue = false;
}
if ( comments[i].y == NComment.NULL ) {
comments[i].y = y_ue;
}
}
NComment entry = comments[i];
drawString( g, entry, rc, t, comments.Count );
comments[i] = entry;
}
}
}
}
public string Config {
get {
string result = "";
if( config.Count > 0 ){
result = config[0];
}
for ( int i = 1; i < config.Count; i++ ) {
result += "\n" + config[i];
}
return result;
}
set {
List<string> work_config = new List<string>();
foreach ( string item in config ) {
work_config.Add( item );
}
config.Clear();
List<NComment> work_comments = new List<NComment>();
foreach ( NComment item in comments ) {
work_comments.Add( item );
}
comments.Clear();
//timing.Clear();
string[] result = value.Split( new char[] { '\n' } );
config.Add( result[0] );
for( int i = 1; i < result.Length; i++ ){
config.Add( result[i] );
string[] spl = result[i].Split( new char[] { '\t' } );
if ( spl.Length < 3 ) {
config.Clear();
foreach ( string item in work_config ) {
config.Add( item );
}
work_config.Clear();
comments.Clear();
foreach ( NComment item in work_comments ) {
comments.Add( item );
}
work_comments.Clear();
MessageBox.Show( "コメントにエラーがありました。エラーのあった行は次の通りです\n" + i + "行目\n" + result[i] );
return;
}
//timing.Add( double.Parse( spl[0] ) );
float time;
try {
time = float.Parse( spl[0] );
} catch {
config.Clear();
foreach ( string item in work_config ) {
config.Add( item );
}
work_config.Clear();
comments.Clear();
foreach ( NComment item in work_comments ) {
comments.Add( item );
}
work_comments.Clear();
MessageBox.Show( "コメントにエラーがありました。エラーのあった行は次の通りです\n" + i + "行目\n" + result[i] );
return;
}
comments.Add( new NComment( float.Parse( spl[0] ), spl[1], spl[2], i ) );
//MessageBox.Show( "Config::set; comments[i-1].type.Position.ToString()=" + comments[i - 1].type.Position.ToString() );
}
comments.Sort();
}
}
public DialogResult EntrySetting( ref string entry_config ) {
return DialogResult.Cancel;
}
public DialogResult BaseSetting() {
FConfig fconf = new FConfig( Config );
DialogResult result = fconf.ShowDialog();
if ( result == DialogResult.OK ) {
Config = fconf.ConfigString;
}
fconf.Dispose();
return result;
}
/// <summary>
/// comで指定されたコメント・タイプのニコニココメントを、
/// Graphics gの位置xに描画します。
/// </summary>
/// <param name="time">このコメントが表示され始めてからの経過時間</param>
/// <param name="g"></param>
/// <param name="com"></param>
/// <param name="x"></param>
public static void drawString( Graphics g, NComment com, Rectangle rc, double time, int comment_num ) {
const string font_name = " ゴシック";
Font font = new Font( font_name, com.type.Size.Size, FontStyle.Bold, GraphicsUnit.Pixel );
Color color = com.type.Color.Color;
int axy = com.type.Position.getPosition( rc.Height, com.type.Size.Size );
int x;
if ( com.type.Position == NComTypePosition.ue || com.type.Position == NComTypePosition.shita ) {
x = (int)(rc.Width / 2.0f - com.width / 2.0f);
} else {
x = (int)(rc.Width - time * ((com.width + rc.Width) / 3.0f));
}
GraphicsPath path = new GraphicsPath();
//FontFamily ff = new FontFamily( font_name );
FontFamily ff = font.FontFamily;
path.AddString( com.message, ff, (int)FontStyle.Bold, com.type.Size.Size, new Point( 0, 0 ), StringFormat.GenericDefault );
using ( Bitmap tmp = new Bitmap( com.width, com.height, PixelFormat.Format32bppArgb ) ) {
using ( Graphics gx = Graphics.FromImage( tmp ) ) {
gx.Clear( Color.FromArgb( 0, Color.White ) );
Color shadow;
if ( color != Color.Black ) {
shadow = Color.Black;
} else {
shadow = Color.White;
}
gx.DrawPath( new Pen( Color.FromArgb( 50, shadow ), 3.5f ), path );
gx.DrawPath( new Pen( Color.FromArgb( 180, shadow ), 2.5f ), path );
gx.FillPath( new SolidBrush( color ), path );
//gx.DrawString( com.message, font, new SolidBrush( color ), new PointF( 0, 0 ) );
}
float alpha = 0.6f + 0.4f * ((float)com.count / (float)comment_num);
ColorMatrix cm = new ColorMatrix();
cm.Matrix00 = 1;
cm.Matrix11 = 1;
cm.Matrix22 = 1;
cm.Matrix33 = alpha;
cm.Matrix44 = 1;
ImageAttributes ia = new ImageAttributes();
ia.SetColorMatrix( cm );
g.DrawImage( tmp, new Rectangle( x, com.y, tmp.Width, tmp.Height ),
0, 0, tmp.Width, tmp.Height, GraphicsUnit.Pixel, ia );
}
}
public void Render( Graphics g, Size size, float time, string mouth, string reserved ) {
}
}
public class NComment : IComparable {
public const int NULL = -999;
public float time;
public NComType type;
public string message;
public int width;
public int height;
public int count;
public int y;
public NComment( float time, string command, string message, int count ) {
this.time = time;
this.type = new NComType( command );
this.message = message;
this.count = count;
this.y = NULL;
SizeF sizef;
Bitmap dumy = new Bitmap( 1, 1 );
Font font = new Font( " ゴシック", this.type.Size.Size, FontStyle.Bold, GraphicsUnit.Pixel );
using ( Graphics g = Graphics.FromImage( dumy ) ) {
sizef = g.MeasureString( message, font );
}
this.width = (int)sizef.Width;
this.height = (int)sizef.Height;
dumy.Dispose();
font.Dispose();
}
public int CompareTo( object obj ) {
NComment com = (NComment)obj;
if ( this.time > com.time ) {
return 1;
} else if ( this.time < com.time ) {
return -1;
} else {
return 0;
}
}
}
public class NComType {
public NComTypePosition Position;
public NComTypeColor Color;
public NComTypeSize Size;
public NComType( string command ) {
Position = NComTypePosition.def;
Color = NComTypeColor.def;
Size = NComTypeSize.def;
string[] spl = command.Split( new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries );
for ( int i = spl.Length - 1; i >= 0; i-- ) {
NComTypePosition pos = NComTypePosition.fromCommand( spl[i] );
if ( pos != NComTypePosition.INVALID ) {
Position = pos;
continue;
}
NComTypeColor col = NComTypeColor.fromCommand( spl[i] );
if ( col != NComTypeColor.INVALID ) {
Color = col;
continue;
}
NComTypeSize size = NComTypeSize.fromCommand( spl[i] );
if ( size != NComTypeSize.INVALID ) {
Size = size;
continue;
}
}
}
}
public class NComTypePosition {
private int m_value;
public static NComTypePosition ue = new NComTypePosition( 0 );
public static NComTypePosition shita = new NComTypePosition( 1 );
public static NComTypePosition def = new NComTypePosition( 2 );
public static NComTypePosition INVALID = new NComTypePosition( -1 );
private NComTypePosition( int value ) {
m_value = value;
}
public static NComTypePosition fromCommand( string command ) {
switch ( command ) {
case "ue":
return ue;
case "shita":
return shita;
case "naka":
return def;
default:
return INVALID;
}
}
public int getPosition( float height, float fontsize ) {
switch ( m_value ) {
case 0:
return 0;
case 1:
return (int)(height - fontsize * 1.2f);
default:
return -1;
}
}
new public string ToString() {
switch ( m_value ) {
case 0:
return "ue";
case 1:
return "shita";
case 2:
return "def";
default:
return "INVALID";
}
}
}
public class NComTypeColor {
private int m_value;
public static NComTypeColor white = new NComTypeColor( 0 );
public static NComTypeColor def = new NComTypeColor( 0 );
public static NComTypeColor red = new NComTypeColor( 1 );
public static NComTypeColor pink = new NComTypeColor( 2 );
public static NComTypeColor orange = new NComTypeColor( 3 );
public static NComTypeColor yellow = new NComTypeColor( 4 );
public static NComTypeColor green = new NComTypeColor( 5 );
public static NComTypeColor cyan = new NComTypeColor( 6 );
public static NComTypeColor blue = new NComTypeColor( 7 );
public static NComTypeColor purple = new NComTypeColor( 8 );
public static NComTypeColor niconicowhite = new NComTypeColor( 9 );
public static NComTypeColor truered = new NComTypeColor( 10 );
public static NComTypeColor passionorange = new NComTypeColor( 11 );
public static NComTypeColor madyellow = new NComTypeColor( 12 );
public static NComTypeColor elementalgreen = new NComTypeColor( 13 );
public static NComTypeColor marineblue = new NComTypeColor( 14 );
public static NComTypeColor nobleviolet = new NComTypeColor( 15 );
public static NComTypeColor black = new NComTypeColor( 16 );
public static NComTypeColor INVALID = new NComTypeColor( -1 );
private NComTypeColor( int value ) {
m_value = value;
}
public static NComTypeColor fromCommand( string command ) {
switch ( command ) {
case "white":
return white;
case "red":
return red;
case "pink":
return pink;
case "orange":
return orange;
case "yellow":
return yellow;
case "green":
return green;
case "cyan":
return cyan;
case "blue":
return blue;
case "purple":
return purple;
case "niconicowhite":
case "white2":
return niconicowhite;
case "truered":
case "red2":
return truered;
case "passionorange":
case "orange2":
return passionorange;
case "madyellow":
case "yellow2":
return madyellow;
case "elementalgree":
case "green2":
return elementalgreen;
case "marineblue":
case "blue2":
return marineblue;
case "nobleviolet":
case "purple2":
return nobleviolet;
case "black":
return black;
default:
return INVALID;
}
}
public Color Color {
get {
switch ( m_value ) {
case 0:
return Color.White;
case 1:
return Color.Red;
case 2:
return Color.Pink;
case 3:
return Color.Orange;
case 4:
return Color.Yellow;
case 5:
return Color.FromArgb( 0, 255, 0 );
case 6:
return Color.Cyan;
case 7:
return Color.Blue;
case 8:
return Color.Purple;
case 9:
return Color.FromArgb( 204, 204, 153 );
case 10:
return Color.FromArgb( 204, 0, 51 );
case 11:
return Color.FromArgb( 255, 102, 0 );
case 12:
return Color.FromArgb( 153, 153, 0 );
case 13:
return Color.FromArgb( 0, 204, 102 );
case 14:
return Color.FromArgb( 51, 255, 252 );
case 15:
return Color.FromArgb( 102, 51, 204 );
case 16:
return Color.Black;
}
return Color.White;
}
}
}
public class NComTypeSize {
private int m_value;
public static NComTypeSize big = new NComTypeSize( 0 );
public static NComTypeSize medium = new NComTypeSize( 1 );
public static NComTypeSize small = new NComTypeSize( 2 );
public static NComTypeSize def = new NComTypeSize( 1 );
public static NComTypeSize INVALID = new NComTypeSize( -1 );
private NComTypeSize( int value ) {
m_value = value;
}
public static NComTypeSize fromCommand( string command ) {
switch ( command ) {
case "big":
return big;
case "medium":
return medium;
case "small":
return small;
default:
return INVALID;
}
}
public float Size {
get {
switch ( m_value ) {
case 0:
return 39f;
case 1:
return 24f;
case 2:
return 15f;
default:
return 24f;
}
}
}
}
}

View File

@@ -0,0 +1,92 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6CBD22A6-34C4-4444-8F90-9EE0D150CEC1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NicoComment</RootNamespace>
<AssemblyName>NicoComment</AssemblyName>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FConfig.Designer.cs">
<DependentUpon>FConfig.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="NicoComment.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FConfig.resx">
<SubType>Designer</SubType>
<DependentUpon>FConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<SubType>Designer</SubType>
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IPlugin\IPlugin.csproj">
<Project>{FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}</Project>
<Name>IPlugin</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>
-->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
namespace NicoComment {
static class Program {
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault( false );
#if !DEBUG
//DEBUGのときはIDEでエラーをハンドルしたいので。
try {
#endif
Application.Run( new Form1() );
#if !DEBUG
} catch ( Exception e ) {
using ( StreamWriter sw = new StreamWriter( "error.log", true ) ) {
sw.WriteLine( e.Message );
sw.WriteLine( e.StackTrace );
}
}
#endif
}
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle( "NicoComment" )]
[assembly: AssemblyDescription( "" )]
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "Boare" )]
[assembly: AssemblyProduct( "NicoComment" )]
[assembly: AssemblyCopyright( "Copyright (C) 2007" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]
// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントには
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible( false )]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid( "93627cb9-8b0e-49ee-aa9c-149d8e3e1a3f" )]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を
// 既定値にすることができます:
[assembly: AssemblyVersion( "1.0.0.0" )]
[assembly: AssemblyFileVersion( "1.0.0.0" )]

View File

@@ -0,0 +1,11 @@
RM=rm
CP=cp
NicoComment.dll: FConfig.cs FConfig.Designer.cs Form1.cs Form1.Designer.cs NicoComment.cs Program.cs \
IPlugin.dll
gmcs -target:library -out:NicoComment.dll \
-r:System.Windows.Forms,System.Drawing,IPlugin.dll \
FConfig.cs FConfig.Designer.cs Form1.cs Form1.Designer.cs NicoComment.cs Program.cs
clean:
$(RM) NicoComment.dll IPlugin.dll