Index: /winamp-musepack/trunk/winamp-musepack/in_mpc.cpp
===================================================================
--- /winamp-musepack/trunk/winamp-musepack/in_mpc.cpp	(revision 191)
+++ /winamp-musepack/trunk/winamp-musepack/in_mpc.cpp	(revision 192)
@@ -93,9 +93,9 @@
 void config(HWND hwndParent)
 {
-	MessageBox(hwndParent, "No configuration yet", "Configuration", MB_OK);
+	MessageBoxA(hwndParent, "No configuration yet", "Configuration", MB_OK);
 }
 void about(HWND hwndParent)
 {
-	MessageBox(hwndParent,"Musepack plugin for winamp\nAll bugs © Nicolas BOTTI", "Uh ?", MB_OK);
+	MessageBoxA(hwndParent,"Musepack plugin for winamp\nAll bugs © Nicolas BOTTI", "Uh ?", MB_OK);
 }
 
Index: /winamp-musepack/trunk/winamp-musepack/mpc_info.cpp
===================================================================
--- /winamp-musepack/trunk/winamp-musepack/mpc_info.cpp	(revision 191)
+++ /winamp-musepack/trunk/winamp-musepack/mpc_info.cpp	(revision 192)
@@ -1,2 +1,44 @@
-#include "mpc_info.h"
+/*
+	Copyright (C) 2006 Nicolas BOTTI <rududu at laposte.net>
+	This file is part of the Musepack Winamp plugin.
 
+	This library is free software; you can redistribute it and/or
+	modify it under the terms of the GNU Lesser General Public
+	License as published by the Free Software Foundation; either
+	version 2.1 of the License, or (at your option) any later version.
+
+	This library is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	Lesser General Public License for more details.
+
+	You should have received a copy of the GNU Lesser General Public
+	License along with this library; if not, write to the Free Software
+	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <windows.h>
+
+#include "in2.h"
+#include "mpc_player.h"
+
+namespace winamp_musepack {
+
+System::Void mpc_info::btnCancel_Click(System::Object^  sender, System::EventArgs^  e)
+{
+	Close();
+}
+
+System::Void mpc_info::btnReload_Click(System::Object^  sender, System::EventArgs^  e)
+{
+	player->loadTags(this);
+}
+
+System::Void mpc_info::btnUpdate_Click(System::Object^  sender, System::EventArgs^  e)
+{
+	player->writeTags(this);
+	Close();
+}
+
+}
+
Index: /winamp-musepack/trunk/winamp-musepack/mpc_info.h
===================================================================
--- /winamp-musepack/trunk/winamp-musepack/mpc_info.h	(revision 191)
+++ /winamp-musepack/trunk/winamp-musepack/mpc_info.h	(revision 192)
@@ -1,2 +1,21 @@
+/*
+	Copyright (C) 2006 Nicolas BOTTI <rududu at laposte.net>
+	This file is part of the Musepack Winamp plugin.
+
+	This library is free software; you can redistribute it and/or
+	modify it under the terms of the GNU Lesser General Public
+	License as published by the Free Software Foundation; either
+	version 2.1 of the License, or (at your option) any later version.
+
+	This library is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	Lesser General Public License for more details.
+
+	You should have received a copy of the GNU Lesser General Public
+	License along with this library; if not, write to the Free Software
+	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
 #pragma once
 
@@ -8,4 +27,5 @@
 using namespace System::Drawing;
 
+class mpc_player;
 
 namespace winamp_musepack {
@@ -23,10 +43,8 @@
 	{
 	public:
-		mpc_info(void)
+		mpc_info(mpc_player * init_player)
 		{
 			InitializeComponent();
-			//
-			//TODO: Add the constructor code here
-			//
+			player = init_player;
 		}
 
@@ -42,52 +60,33 @@
 			}
 		}
-	private: System::Windows::Forms::GroupBox^  groupBox1;
-	public: System::Windows::Forms::TextBox^  txtTrack;
-	private: 
-
-	protected: 
-
-	private: System::Windows::Forms::Label^  label5;
-	public: System::Windows::Forms::TextBox^  txtYear;
-	private: 
-
-
-	private: System::Windows::Forms::Label^  label4;
-	public: System::Windows::Forms::TextBox^  txtAlbum;
-	private: 
-
-
-	private: System::Windows::Forms::Label^  label3;
-	public: System::Windows::Forms::TextBox^  txtArtist;
-	private: 
-
-
-	private: System::Windows::Forms::Label^  label2;
-	public: System::Windows::Forms::TextBox^  txtTitle;
-	private: 
-
-
-	private: System::Windows::Forms::Label^  label1;
-	private: System::Windows::Forms::GroupBox^  groupBox2;
-	public: System::Windows::Forms::TextBox^  txtComment;
-	private: 
-
-
-	private: System::Windows::Forms::Label^  label6;
-	private: System::Windows::Forms::Label^  label7;
-	public: System::Windows::Forms::ComboBox^  comboGenre;
-	private: 
-	public: System::Windows::Forms::Label^  lblStreamInfo;
+	private:
+	System::Windows::Forms::GroupBox^  groupBox1;
+	System::Windows::Forms::Label^  label5;
+	System::Windows::Forms::Label^  label4;
+	System::Windows::Forms::Label^  label3;
+	System::Windows::Forms::Label^  label2;
+	System::Windows::Forms::Label^  label1;
+	System::Windows::Forms::GroupBox^  groupBox2;
+	System::Windows::Forms::Label^  label6;
+	System::Windows::Forms::Label^  label7;
+
+
+
+
+	mpc_player * player;
+			 
+	public:
+	System::Windows::Forms::TextBox^  txtTrack;
+	System::Windows::Forms::TextBox^  txtYear;
+	System::Windows::Forms::TextBox^  txtAlbum;
+	System::Windows::Forms::TextBox^  txtArtist;
+	System::Windows::Forms::TextBox^  txtTitle;
+	System::Windows::Forms::TextBox^  txtComment;
+	System::Windows::Forms::ComboBox^  comboGenre;
+	System::Windows::Forms::Label^  lblStreamInfo;
+	private: System::Windows::Forms::Button^  btnUpdate;
+	public: 
+	private: System::Windows::Forms::Button^  btnCancel;
 	private: System::Windows::Forms::Button^  btnReload;
-	public: 
-
-	private: System::Windows::Forms::Button^  btnCancel;
-	public: 
-
-	private: System::Windows::Forms::Button^  btnUpdate;
-
-
-
-
 
 	private:
@@ -105,4 +104,7 @@
 		{
 			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
+			this->btnUpdate = (gcnew System::Windows::Forms::Button());
+			this->btnCancel = (gcnew System::Windows::Forms::Button());
+			this->btnReload = (gcnew System::Windows::Forms::Button());
 			this->label7 = (gcnew System::Windows::Forms::Label());
 			this->comboGenre = (gcnew System::Windows::Forms::ComboBox());
@@ -121,7 +123,4 @@
 			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
 			this->lblStreamInfo = (gcnew System::Windows::Forms::Label());
-			this->btnReload = (gcnew System::Windows::Forms::Button());
-			this->btnCancel = (gcnew System::Windows::Forms::Button());
-			this->btnUpdate = (gcnew System::Windows::Forms::Button());
 			this->groupBox1->SuspendLayout();
 			this->groupBox2->SuspendLayout();
@@ -130,4 +129,7 @@
 			// groupBox1
 			// 
+			this->groupBox1->Controls->Add(this->btnUpdate);
+			this->groupBox1->Controls->Add(this->btnCancel);
+			this->groupBox1->Controls->Add(this->btnReload);
 			this->groupBox1->Controls->Add(this->label7);
 			this->groupBox1->Controls->Add(this->comboGenre);
@@ -146,8 +148,38 @@
 			this->groupBox1->Location = System::Drawing::Point(12, 12);
 			this->groupBox1->Name = L"groupBox1";
-			this->groupBox1->Size = System::Drawing::Size(354, 183);
+			this->groupBox1->Size = System::Drawing::Size(354, 212);
 			this->groupBox1->TabIndex = 0;
 			this->groupBox1->TabStop = false;
-			this->groupBox1->Text = L"Tag information";
+			this->groupBox1->Text = L"Tag";
+			// 
+			// btnUpdate
+			// 
+			this->btnUpdate->Location = System::Drawing::Point(6, 183);
+			this->btnUpdate->Name = L"btnUpdate";
+			this->btnUpdate->Size = System::Drawing::Size(84, 23);
+			this->btnUpdate->TabIndex = 16;
+			this->btnUpdate->Text = L"Update";
+			this->btnUpdate->UseVisualStyleBackColor = true;
+			this->btnUpdate->Click += gcnew System::EventHandler(this, &mpc_info::btnUpdate_Click);
+			// 
+			// btnCancel
+			// 
+			this->btnCancel->Location = System::Drawing::Point(135, 183);
+			this->btnCancel->Name = L"btnCancel";
+			this->btnCancel->Size = System::Drawing::Size(84, 23);
+			this->btnCancel->TabIndex = 15;
+			this->btnCancel->Text = L"Cancel";
+			this->btnCancel->UseVisualStyleBackColor = true;
+			this->btnCancel->Click += gcnew System::EventHandler(this, &mpc_info::btnCancel_Click);
+			// 
+			// btnReload
+			// 
+			this->btnReload->Location = System::Drawing::Point(264, 183);
+			this->btnReload->Name = L"btnReload";
+			this->btnReload->Size = System::Drawing::Size(84, 23);
+			this->btnReload->TabIndex = 14;
+			this->btnReload->Text = L"Reload";
+			this->btnReload->UseVisualStyleBackColor = true;
+			this->btnReload->Click += gcnew System::EventHandler(this, &mpc_info::btnReload_Click);
 			// 
 			// label7
@@ -280,5 +312,5 @@
 			this->groupBox2->TabIndex = 1;
 			this->groupBox2->TabStop = false;
-			this->groupBox2->Text = L"Stream information";
+			this->groupBox2->Text = L"Stream";
 			// 
 			// lblStreamInfo
@@ -291,32 +323,4 @@
 			this->lblStreamInfo->Text = L"lblStreamInfo";
 			// 
-			// btnReload
-			// 
-			this->btnReload->Location = System::Drawing::Point(282, 201);
-			this->btnReload->Name = L"btnReload";
-			this->btnReload->Size = System::Drawing::Size(84, 23);
-			this->btnReload->TabIndex = 2;
-			this->btnReload->Text = L"Reload";
-			this->btnReload->UseVisualStyleBackColor = true;
-			// 
-			// btnCancel
-			// 
-			this->btnCancel->Location = System::Drawing::Point(147, 201);
-			this->btnCancel->Name = L"btnCancel";
-			this->btnCancel->Size = System::Drawing::Size(84, 23);
-			this->btnCancel->TabIndex = 3;
-			this->btnCancel->Text = L"Cancel";
-			this->btnCancel->UseVisualStyleBackColor = true;
-			this->btnCancel->Click += gcnew System::EventHandler(this, &mpc_info::btnCancel_Click);
-			// 
-			// btnUpdate
-			// 
-			this->btnUpdate->Location = System::Drawing::Point(12, 201);
-			this->btnUpdate->Name = L"btnUpdate";
-			this->btnUpdate->Size = System::Drawing::Size(84, 23);
-			this->btnUpdate->TabIndex = 4;
-			this->btnUpdate->Text = L"Update";
-			this->btnUpdate->UseVisualStyleBackColor = true;
-			// 
 			// mpc_info
 			// 
@@ -324,7 +328,4 @@
 			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
 			this->ClientSize = System::Drawing::Size(534, 237);
-			this->Controls->Add(this->btnUpdate);
-			this->Controls->Add(this->btnCancel);
-			this->Controls->Add(this->btnReload);
 			this->Controls->Add(this->groupBox2);
 			this->Controls->Add(this->groupBox1);
@@ -338,7 +339,9 @@
 		}
 #pragma endregion
-private: System::Void btnCancel_Click(System::Object^  sender, System::EventArgs^  e) {
-			 Close();
-		 }
+
+	private :
+	System::Void btnCancel_Click(System::Object^  sender, System::EventArgs^  e);
+	System::Void btnReload_Click(System::Object^  sender, System::EventArgs^  e);
+	System::Void btnUpdate_Click(System::Object^  sender, System::EventArgs^  e);
 };
 }
Index: /winamp-musepack/trunk/winamp-musepack/mpc_player.cpp
===================================================================
--- /winamp-musepack/trunk/winamp-musepack/mpc_player.cpp	(revision 191)
+++ /winamp-musepack/trunk/winamp-musepack/mpc_player.cpp	(revision 192)
@@ -27,6 +27,6 @@
 
 #include <tag.h>
-
-using namespace winamp_musepack;
+#include <vcclr.h>
+
 
 mpc_player::mpc_player(In_Module * in_mod)
@@ -271,7 +271,58 @@
 }
 
+void mpc_player::loadTags(mpc_info ^ infoBox)
+{
+	if(tag_file == 0)
+		tag_file = new TagLib::FileRef(lastfn, false);
+
+	if (!tag_file->isNull() && tag_file->tag()) {
+		TagLib::Tag *tag = tag_file->tag();
+		infoBox->txtTitle->Text = gcnew String(tag->title().toCString(true));
+		infoBox->txtArtist->Text = gcnew String(tag->artist().toCString(true));
+		infoBox->txtAlbum->Text = gcnew String(tag->album().toCString(true));
+		infoBox->txtYear->Text = "";
+		infoBox->txtYear->Text += tag->year();
+		infoBox->txtTrack->Text = "";
+		infoBox->txtTrack->Text += tag->track();
+		infoBox->comboGenre->Text = gcnew String(tag->genre().toCString(true));
+		infoBox->txtComment->Text = gcnew String(tag->comment().toCString(true));
+	}
+}
+
+void mpc_player::writeTags(mpc_info ^ infoBox)
+{
+	if (!tag_file->isNull() && tag_file->tag()) {
+		TagLib::Tag *tag = tag_file->tag();
+
+		pin_ptr<const wchar_t> wch = PtrToStringChars(infoBox->txtTitle->Text);
+		tag->setTitle(wch);
+
+		wch = PtrToStringChars(infoBox->txtArtist->Text);
+		tag->setArtist(wch);
+
+		wch = PtrToStringChars(infoBox->txtAlbum->Text);
+		tag->setAlbum(wch);
+
+		wch = PtrToStringChars(infoBox->txtYear->Text);
+		TagLib::String year(wch);
+		tag->setYear(year.toInt());
+
+		wch = PtrToStringChars(infoBox->txtTrack->Text);
+		TagLib::String track(wch);
+		tag->setTrack(track.toInt());
+
+		wch = PtrToStringChars(infoBox->comboGenre->Text);
+		tag->setGenre(wch);
+
+		wch = PtrToStringChars(infoBox->txtComment->Text);
+		tag->setComment(wch);
+
+		tag_file->save(); // FIXME : make all crash
+	}
+}
+
 int mpc_player::infoDlg(HWND hwnd)
 {
-	mpc_info infoBox;
+	mpc_info infoBox(this);
 	System::String ^ tmp;
 
@@ -299,18 +350,5 @@
 	infoBox.lblStreamInfo->Text = tmp;
 
-
-	if(tag_file == 0)
-		tag_file = new TagLib::FileRef(lastfn, false);
-
-	if (!tag_file->isNull() && tag_file->tag()) {
-		TagLib::Tag *tag = tag_file->tag();
-		infoBox.txtTitle->Text = gcnew String(tag->title().toCString(true));
-		infoBox.txtArtist->Text = gcnew String(tag->artist().toCString(true));
-		infoBox.txtAlbum->Text = gcnew String(tag->album().toCString(true));
-		infoBox.txtYear->Text += tag->year();
-		infoBox.txtTrack->Text += tag->track();
-		infoBox.comboGenre->Text = gcnew String(tag->genre().toCString(true));
-		infoBox.txtComment->Text = gcnew String(tag->comment().toCString(true));
-	}
+	loadTags(% infoBox);
 
 	infoBox.ShowDialog();
Index: /winamp-musepack/trunk/winamp-musepack/mpc_player.h
===================================================================
--- /winamp-musepack/trunk/winamp-musepack/mpc_player.h	(revision 191)
+++ /winamp-musepack/trunk/winamp-musepack/mpc_player.h	(revision 192)
@@ -22,4 +22,7 @@
 #include <mpcdec/mpcdec.h>
 #include <fileref.h>
+#include "mpc_info.h"
+
+using namespace winamp_musepack;
 
 // post this to the main window at end of file (after playback as stopped)
@@ -44,4 +47,6 @@
 
 	int infoDlg(HWND hwnd);
+	void loadTags(mpc_info ^ infoBox);
+	void writeTags(mpc_info ^ infoBox);
 
 	int paused;				// are we paused?
Index: /winamp-musepack/trunk/winamp-musepack/winamp-musepack.vcproj
===================================================================
--- /winamp-musepack/trunk/winamp-musepack/winamp-musepack.vcproj	(revision 191)
+++ /winamp-musepack/trunk/winamp-musepack/winamp-musepack.vcproj	(revision 192)
@@ -94,4 +94,5 @@
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="2"
+			ManagedExtensions="1"
 			>
 			<Tool
@@ -113,5 +114,5 @@
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="..\..\libmpc\include;C:\Program Files\taglib\include\taglib"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32"
 				RuntimeLibrary="2"
 				WarningLevel="1"
@@ -217,21 +218,19 @@
 						BasicRuntimeChecks="0"
 						UsePrecompiledHeader="0"
-						DebugInformationFormat="3"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\mpc_player.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ExceptionHandling="2"
 						CompileAsManaged="1"
 					/>
 				</FileConfiguration>
-			</File>
-			<File
-				RelativePath=".\mpc_player.cpp"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						ExceptionHandling="2"
-						CompileAsManaged="1"
-					/>
-				</FileConfiguration>
 				<FileConfiguration
 					Name="Release|Win32"
@@ -240,5 +239,4 @@
 						Name="VCCLCompilerTool"
 						ExceptionHandling="2"
-						CompileAsManaged="1"
 					/>
 				</FileConfiguration>
