Index: /winamp-musepack/trunk/mpc_player.cpp
===================================================================
--- /winamp-musepack/trunk/mpc_player.cpp	(revision 249)
+++ /winamp-musepack/trunk/mpc_player.cpp	(revision 250)
@@ -144,5 +144,5 @@
 			}
 			WaitForSingleObject(wait_event, 100);		// give a little CPU time back to the system.
-		} else if (mod->outMod->CanWrite() >= (MPC_FRAME_LENGTH * sizeof(short) * si.channels)*(mod->dsp_isactive()?2:1)) {
+		} else if (mod->outMod->CanWrite() >= (int)((MPC_FRAME_LENGTH * sizeof(short) * si.channels)*(mod->dsp_isactive()?2:1))) {
 			// CanWrite() returns the number of bytes you can write, so we check that
 			// to the block size. the reason we multiply the block size by two if 
@@ -255,5 +255,5 @@
 	// dividing by 1000 for the first parameter of setinfo makes it
 	// display 'H'... for hundred.. i.e. 14H Kbps.
-	mod->SetInfo(si.average_bitrate / 1000, si.sample_freq / 1000, si.channels, 1);
+	mod->SetInfo((int)(si.average_bitrate / 1000), si.sample_freq / 1000, si.channels, 1);
 
 	// initialize visualization stuff
@@ -273,54 +273,25 @@
 }
 
-//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), 0, strlen(tag->title().toCString(true)), System::Text::Encoding::UTF8);
-//		infoBox->txtArtist->Text = gcnew String(tag->artist().toCString(true), 0, strlen(tag->artist().toCString(true)), System::Text::Encoding::UTF8);
-//		infoBox->txtAlbum->Text = gcnew String(tag->album().toCString(true), 0, strlen(tag->album().toCString(true)), System::Text::Encoding::UTF8);
-//		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), 0, strlen(tag->genre().toCString(true)), System::Text::Encoding::UTF8);
-//		infoBox->txtComment->Text = gcnew String(tag->comment().toCString(true), 0, strlen(tag->comment().toCString(true)), System::Text::Encoding::UTF8);
-//	}
-//}
-
-//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
-//	}
-//}
+void mpc_player::writeTags(HWND hDlg)
+{
+	if (!tag_file->isNull() && tag_file->tag()) {
+		TagLib::Tag *tag = tag_file->tag();
+
+		//tag->setTitle(wch);
+		//tag->setArtist(wch);
+		//tag->setAlbum(wch);
+
+		//TagLib::String year(wch);
+		//tag->setYear(year.toInt());
+
+		//TagLib::String track(wch);
+		//tag->setTrack(track.toInt());
+
+		//tag->setGenre(wch);
+		//tag->setComment(wch);
+
+		tag_file->save(); // FIXME : make all crash
+	}
+}
 
 void mpc_player::initDlg(HWND hDlg)
@@ -328,10 +299,7 @@
 	std::ostringstream tmp;
 
-	tmp << "Streamversion ";
-	tmp << si.stream_version;
-	tmp << "\nEncoder : ";
-	tmp << si.encoder;
-	tmp << "\nProfile : ";
-	tmp << si.profile_name;
+	tmp << "Streamversion " << si.stream_version;
+	tmp << "\nEncoder : " << si.encoder;
+	tmp << "\nProfile : " << si.profile_name;
 	tmp << "\nPNS : ";
 	if (si.pns) tmp << "on";
@@ -340,16 +308,29 @@
 	if (si.is_true_gapless) tmp << "on";
 	else tmp << "off";
-	tmp << "\nAverage bitrate : ";
-	tmp << floor(si.average_bitrate * 1.e-3 + .5);
-	tmp << " Kbps \nSamplerate : ";
-	tmp << si.sample_freq;
-	tmp << "\nChannels : ";
-	tmp << si.channels;
-	tmp << "\nFile size : ";
-	tmp << si.total_file_length;
-	tmp << " Bytes";
-	//// FIXME : add replay gain info
+	tmp << "\nAverage bitrate : " << floor(si.average_bitrate * 1.e-3 + .5) << " Kbps";
+	tmp << "\nSamplerate : " << si.sample_freq;
+	tmp << "\nChannels : " << si.channels;
+	tmp << "\nFile size : " << si.total_file_length << " Bytes";
+	//// FIXME : add replay gain info, lenth (min:sec), sample number
 
 	SetDlgItemText(hDlg, IDC_STREAM_INFO, tmp.str().c_str());
+
+	if(tag_file == 0)
+		tag_file = new TagLib::FileRef(lastfn, false);
+
+	if (!tag_file->isNull() && tag_file->tag()) {
+		TagLib::Tag *tag = tag_file->tag();
+		SetDlgItemText(hDlg, IDC_TITLE, tag->title().toCString(true));
+		SetDlgItemText(hDlg, IDC_ARTIST, tag->artist().toCString(true));
+		SetDlgItemText(hDlg, IDC_ALBUM, tag->album().toCString(true));
+		tmp.str("");
+		tmp << tag->year();
+		SetDlgItemText(hDlg, IDC_YEAR, tmp.str().c_str());
+		tmp.str("");
+		tmp << tag->track();
+		SetDlgItemText(hDlg, IDC_TRACK, tmp.str().c_str());
+		SetDlgItemText(hDlg, IDC_GENRE, tag->genre().toCString(true));
+		SetDlgItemText(hDlg, IDC_COMMENT, tag->comment().toCString(true));
+	}
 }
 
@@ -360,10 +341,17 @@
 	{
 	case WM_INITDIALOG:
+		SetWindowLong(hDlg, DWL_USER, lParam);
 		((mpc_player *) lParam)->initDlg(hDlg);
 		return TRUE;
 
 	case WM_COMMAND:
-		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) 
-		{
+		if (LOWORD(wParam) == IDC_CANCEL || LOWORD(wParam) == IDCANCEL) {
+			EndDialog(hDlg, LOWORD(wParam));
+			return TRUE;
+		} else if (LOWORD(wParam) == IDC_RELOAD) {
+			// FIXME : this will not work on X64
+			((mpc_player*)GetWindowLong(hDlg, DWL_USER))->initDlg(hDlg);
+		} else if (LOWORD(wParam) == IDC_SAVE) {
+			((mpc_player*)GetWindowLong(hDlg, DWL_USER))->writeTags(hDlg);
 			EndDialog(hDlg, LOWORD(wParam));
 			return TRUE;
Index: /winamp-musepack/trunk/mpc_player.h
===================================================================
--- /winamp-musepack/trunk/mpc_player.h	(revision 249)
+++ /winamp-musepack/trunk/mpc_player.h	(revision 250)
@@ -38,6 +38,6 @@
 
 	void getFileInfo(char *title, int *length_in_ms);
-	int getLength(void) {return si.samples * 1000 / si.sample_freq;}
-	int getOutputTime(void) {return decode_pos_sample * 1000 / si.sample_freq;}
+	int getLength(void) {return (int)(si.samples * 1000 / si.sample_freq);}
+	int getOutputTime(void) {return (int)(decode_pos_sample * 1000 / si.sample_freq);}
 
 	void setOutputTime(int time_in_ms);
@@ -45,4 +45,5 @@
 	int infoDlg(HWND hwnd);
 	void initDlg(HWND hDlg);
+	void writeTags(HWND hDlg);
 
 	int paused;				// are we paused?
Index: /winamp-musepack/trunk/resource.h
===================================================================
--- /winamp-musepack/trunk/resource.h	(revision 249)
+++ /winamp-musepack/trunk/resource.h	(revision 250)
@@ -6,4 +6,15 @@
 #define IDD_INFO_BOX                    101
 #define IDC_STREAM_INFO                 1001
+#define IDC_TITLE                       1002
+#define IDC_ARTIST                      1003
+#define IDC_GENRE                       1004
+#define IDC_ALBUM                       1005
+#define IDC_BUTTON1                     1006
+#define IDC_CANCEL                      1006
+#define IDC_YEAR                        1007
+#define IDC_RELOAD                      1008
+#define IDC_SAVE                        1009
+#define IDC_TRACK                       1010
+#define IDC_COMMENT                     1011
 #define IDC_STATIC                      -1
 
@@ -12,7 +23,7 @@
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_RESOURCE_VALUE        102
 #define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1002
+#define _APS_NEXT_CONTROL_VALUE         1007
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
Index: /winamp-musepack/trunk/winamp-musepack.rc
===================================================================
--- /winamp-musepack/trunk/winamp-musepack.rc	(revision 249)
+++ /winamp-musepack/trunk/winamp-musepack.rc	(revision 250)
@@ -57,13 +57,31 @@
 //
 
-IDD_INFO_BOX DIALOGEX 0, 0, 424, 246
+IDD_INFO_BOX DIALOGEX 0, 0, 406, 186
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Musepack file information"
 FONT 8, "MS Shell Dlg", 0, 0, 0x0
 BEGIN
-    GROUPBOX        "File stream informations",IDC_STATIC,264,0,156,240,
-                    BS_FLAT
+    GROUPBOX        "Stream",IDC_STATIC,264,0,138,180,BS_FLAT
     LTEXT           "C'est juste un test.\nPour voir si tout va bien.",
-                    IDC_STREAM_INFO,270,11,144,228
+                    IDC_STREAM_INFO,270,11,126,163
+    GROUPBOX        "Tag",IDC_STATIC,6,0,252,180,BS_FLAT
+    EDITTEXT        IDC_TITLE,54,12,198,12,ES_AUTOHSCROLL
+    RTEXT           "Title",IDC_STATIC,12,14,36,8
+    EDITTEXT        IDC_ARTIST,54,30,198,12,ES_AUTOHSCROLL
+    RTEXT           "Artist",IDC_STATIC,12,32,36,8
+    EDITTEXT        IDC_ALBUM,54,48,198,12,ES_AUTOHSCROLL
+    RTEXT           "Album",IDC_STATIC,12,50,36,8
+    EDITTEXT        IDC_YEAR,54,66,42,12,ES_AUTOHSCROLL | ES_NUMBER
+    RTEXT           "Year",IDC_STATIC,12,68,36,8
+    EDITTEXT        IDC_TRACK,228,66,24,12,ES_AUTOHSCROLL | ES_NUMBER
+    RTEXT           "Track",IDC_STATIC,162,68,60,8
+    COMBOBOX        IDC_GENRE,54,84,198,18,CBS_DROPDOWN | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Genre",IDC_STATIC,12,86,36,8
+    EDITTEXT        IDC_COMMENT,54,102,198,54,ES_MULTILINE | ES_AUTOHSCROLL
+    RTEXT           "Comment",IDC_STATIC,12,104,36,8
+    PUSHBUTTON      "Cancel",IDC_CANCEL,186,162,66,12
+    PUSHBUTTON      "Reload",IDC_RELOAD,99,162,66,12
+    PUSHBUTTON      "Save",IDC_SAVE,12,162,66,12
 END
 
@@ -80,7 +98,7 @@
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 417
+        RIGHTMARGIN, 399
         TOPMARGIN, 7
-        BOTTOMMARGIN, 239
+        BOTTOMMARGIN, 179
     END
 END
