Changeset 192
- Timestamp:
- 12/25/06 23:45:24 (18 years ago)
- Location:
- winamp-musepack/trunk/winamp-musepack
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
winamp-musepack/trunk/winamp-musepack/in_mpc.cpp
r191 r192 93 93 void config(HWND hwndParent) 94 94 { 95 MessageBox (hwndParent, "No configuration yet", "Configuration", MB_OK);95 MessageBoxA(hwndParent, "No configuration yet", "Configuration", MB_OK); 96 96 } 97 97 void about(HWND hwndParent) 98 98 { 99 MessageBox (hwndParent,"Musepack plugin for winamp\nAll bugs © Nicolas BOTTI", "Uh ?", MB_OK);99 MessageBoxA(hwndParent,"Musepack plugin for winamp\nAll bugs © Nicolas BOTTI", "Uh ?", MB_OK); 100 100 } 101 101 -
winamp-musepack/trunk/winamp-musepack/mpc_info.cpp
r191 r192 1 #include "mpc_info.h" 1 /* 2 Copyright (C) 2006 Nicolas BOTTI <rududu at laposte.net> 3 This file is part of the Musepack Winamp plugin. 2 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 20 #include <windows.h> 21 22 #include "in2.h" 23 #include "mpc_player.h" 24 25 namespace winamp_musepack { 26 27 System::Void mpc_info::btnCancel_Click(System::Object^ sender, System::EventArgs^ e) 28 { 29 Close(); 30 } 31 32 System::Void mpc_info::btnReload_Click(System::Object^ sender, System::EventArgs^ e) 33 { 34 player->loadTags(this); 35 } 36 37 System::Void mpc_info::btnUpdate_Click(System::Object^ sender, System::EventArgs^ e) 38 { 39 player->writeTags(this); 40 Close(); 41 } 42 43 } 44 -
winamp-musepack/trunk/winamp-musepack/mpc_info.h
r191 r192 1 /* 2 Copyright (C) 2006 Nicolas BOTTI <rududu at laposte.net> 3 This file is part of the Musepack Winamp plugin. 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 1 20 #pragma once 2 21 … … 8 27 using namespace System::Drawing; 9 28 29 class mpc_player; 10 30 11 31 namespace winamp_musepack { … … 23 43 { 24 44 public: 25 mpc_info( void)45 mpc_info(mpc_player * init_player) 26 46 { 27 47 InitializeComponent(); 28 // 29 //TODO: Add the constructor code here 30 // 48 player = init_player; 31 49 } 32 50 … … 42 60 } 43 61 } 44 private: System::Windows::Forms::GroupBox^ groupBox1; 45 public: System::Windows::Forms::TextBox^ txtTrack; 46 private: 47 48 protected: 49 50 private: System::Windows::Forms::Label^ label5; 51 public: System::Windows::Forms::TextBox^ txtYear; 52 private: 53 54 55 private: System::Windows::Forms::Label^ label4; 56 public: System::Windows::Forms::TextBox^ txtAlbum; 57 private: 58 59 60 private: System::Windows::Forms::Label^ label3; 61 public: System::Windows::Forms::TextBox^ txtArtist; 62 private: 63 64 65 private: System::Windows::Forms::Label^ label2; 66 public: System::Windows::Forms::TextBox^ txtTitle; 67 private: 68 69 70 private: System::Windows::Forms::Label^ label1; 71 private: System::Windows::Forms::GroupBox^ groupBox2; 72 public: System::Windows::Forms::TextBox^ txtComment; 73 private: 74 75 76 private: System::Windows::Forms::Label^ label6; 77 private: System::Windows::Forms::Label^ label7; 78 public: System::Windows::Forms::ComboBox^ comboGenre; 79 private: 80 public: System::Windows::Forms::Label^ lblStreamInfo; 62 private: 63 System::Windows::Forms::GroupBox^ groupBox1; 64 System::Windows::Forms::Label^ label5; 65 System::Windows::Forms::Label^ label4; 66 System::Windows::Forms::Label^ label3; 67 System::Windows::Forms::Label^ label2; 68 System::Windows::Forms::Label^ label1; 69 System::Windows::Forms::GroupBox^ groupBox2; 70 System::Windows::Forms::Label^ label6; 71 System::Windows::Forms::Label^ label7; 72 73 74 75 76 mpc_player * player; 77 78 public: 79 System::Windows::Forms::TextBox^ txtTrack; 80 System::Windows::Forms::TextBox^ txtYear; 81 System::Windows::Forms::TextBox^ txtAlbum; 82 System::Windows::Forms::TextBox^ txtArtist; 83 System::Windows::Forms::TextBox^ txtTitle; 84 System::Windows::Forms::TextBox^ txtComment; 85 System::Windows::Forms::ComboBox^ comboGenre; 86 System::Windows::Forms::Label^ lblStreamInfo; 87 private: System::Windows::Forms::Button^ btnUpdate; 88 public: 89 private: System::Windows::Forms::Button^ btnCancel; 81 90 private: System::Windows::Forms::Button^ btnReload; 82 public:83 84 private: System::Windows::Forms::Button^ btnCancel;85 public:86 87 private: System::Windows::Forms::Button^ btnUpdate;88 89 90 91 92 91 93 92 private: … … 105 104 { 106 105 this->groupBox1 = (gcnew System::Windows::Forms::GroupBox()); 106 this->btnUpdate = (gcnew System::Windows::Forms::Button()); 107 this->btnCancel = (gcnew System::Windows::Forms::Button()); 108 this->btnReload = (gcnew System::Windows::Forms::Button()); 107 109 this->label7 = (gcnew System::Windows::Forms::Label()); 108 110 this->comboGenre = (gcnew System::Windows::Forms::ComboBox()); … … 121 123 this->groupBox2 = (gcnew System::Windows::Forms::GroupBox()); 122 124 this->lblStreamInfo = (gcnew System::Windows::Forms::Label()); 123 this->btnReload = (gcnew System::Windows::Forms::Button());124 this->btnCancel = (gcnew System::Windows::Forms::Button());125 this->btnUpdate = (gcnew System::Windows::Forms::Button());126 125 this->groupBox1->SuspendLayout(); 127 126 this->groupBox2->SuspendLayout(); … … 130 129 // groupBox1 131 130 // 131 this->groupBox1->Controls->Add(this->btnUpdate); 132 this->groupBox1->Controls->Add(this->btnCancel); 133 this->groupBox1->Controls->Add(this->btnReload); 132 134 this->groupBox1->Controls->Add(this->label7); 133 135 this->groupBox1->Controls->Add(this->comboGenre); … … 146 148 this->groupBox1->Location = System::Drawing::Point(12, 12); 147 149 this->groupBox1->Name = L"groupBox1"; 148 this->groupBox1->Size = System::Drawing::Size(354, 183);150 this->groupBox1->Size = System::Drawing::Size(354, 212); 149 151 this->groupBox1->TabIndex = 0; 150 152 this->groupBox1->TabStop = false; 151 this->groupBox1->Text = L"Tag information"; 153 this->groupBox1->Text = L"Tag"; 154 // 155 // btnUpdate 156 // 157 this->btnUpdate->Location = System::Drawing::Point(6, 183); 158 this->btnUpdate->Name = L"btnUpdate"; 159 this->btnUpdate->Size = System::Drawing::Size(84, 23); 160 this->btnUpdate->TabIndex = 16; 161 this->btnUpdate->Text = L"Update"; 162 this->btnUpdate->UseVisualStyleBackColor = true; 163 this->btnUpdate->Click += gcnew System::EventHandler(this, &mpc_info::btnUpdate_Click); 164 // 165 // btnCancel 166 // 167 this->btnCancel->Location = System::Drawing::Point(135, 183); 168 this->btnCancel->Name = L"btnCancel"; 169 this->btnCancel->Size = System::Drawing::Size(84, 23); 170 this->btnCancel->TabIndex = 15; 171 this->btnCancel->Text = L"Cancel"; 172 this->btnCancel->UseVisualStyleBackColor = true; 173 this->btnCancel->Click += gcnew System::EventHandler(this, &mpc_info::btnCancel_Click); 174 // 175 // btnReload 176 // 177 this->btnReload->Location = System::Drawing::Point(264, 183); 178 this->btnReload->Name = L"btnReload"; 179 this->btnReload->Size = System::Drawing::Size(84, 23); 180 this->btnReload->TabIndex = 14; 181 this->btnReload->Text = L"Reload"; 182 this->btnReload->UseVisualStyleBackColor = true; 183 this->btnReload->Click += gcnew System::EventHandler(this, &mpc_info::btnReload_Click); 152 184 // 153 185 // label7 … … 280 312 this->groupBox2->TabIndex = 1; 281 313 this->groupBox2->TabStop = false; 282 this->groupBox2->Text = L"Stream information";314 this->groupBox2->Text = L"Stream"; 283 315 // 284 316 // lblStreamInfo … … 291 323 this->lblStreamInfo->Text = L"lblStreamInfo"; 292 324 // 293 // btnReload294 //295 this->btnReload->Location = System::Drawing::Point(282, 201);296 this->btnReload->Name = L"btnReload";297 this->btnReload->Size = System::Drawing::Size(84, 23);298 this->btnReload->TabIndex = 2;299 this->btnReload->Text = L"Reload";300 this->btnReload->UseVisualStyleBackColor = true;301 //302 // btnCancel303 //304 this->btnCancel->Location = System::Drawing::Point(147, 201);305 this->btnCancel->Name = L"btnCancel";306 this->btnCancel->Size = System::Drawing::Size(84, 23);307 this->btnCancel->TabIndex = 3;308 this->btnCancel->Text = L"Cancel";309 this->btnCancel->UseVisualStyleBackColor = true;310 this->btnCancel->Click += gcnew System::EventHandler(this, &mpc_info::btnCancel_Click);311 //312 // btnUpdate313 //314 this->btnUpdate->Location = System::Drawing::Point(12, 201);315 this->btnUpdate->Name = L"btnUpdate";316 this->btnUpdate->Size = System::Drawing::Size(84, 23);317 this->btnUpdate->TabIndex = 4;318 this->btnUpdate->Text = L"Update";319 this->btnUpdate->UseVisualStyleBackColor = true;320 //321 325 // mpc_info 322 326 // … … 324 328 this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; 325 329 this->ClientSize = System::Drawing::Size(534, 237); 326 this->Controls->Add(this->btnUpdate);327 this->Controls->Add(this->btnCancel);328 this->Controls->Add(this->btnReload);329 330 this->Controls->Add(this->groupBox2); 330 331 this->Controls->Add(this->groupBox1); … … 338 339 } 339 340 #pragma endregion 340 private: System::Void btnCancel_Click(System::Object^ sender, System::EventArgs^ e) { 341 Close(); 342 } 341 342 private : 343 System::Void btnCancel_Click(System::Object^ sender, System::EventArgs^ e); 344 System::Void btnReload_Click(System::Object^ sender, System::EventArgs^ e); 345 System::Void btnUpdate_Click(System::Object^ sender, System::EventArgs^ e); 343 346 }; 344 347 } -
winamp-musepack/trunk/winamp-musepack/mpc_player.cpp
r191 r192 27 27 28 28 #include <tag.h> 29 30 using namespace winamp_musepack; 29 #include <vcclr.h> 30 31 31 32 32 mpc_player::mpc_player(In_Module * in_mod) … … 271 271 } 272 272 273 void mpc_player::loadTags(mpc_info ^ infoBox) 274 { 275 if(tag_file == 0) 276 tag_file = new TagLib::FileRef(lastfn, false); 277 278 if (!tag_file->isNull() && tag_file->tag()) { 279 TagLib::Tag *tag = tag_file->tag(); 280 infoBox->txtTitle->Text = gcnew String(tag->title().toCString(true)); 281 infoBox->txtArtist->Text = gcnew String(tag->artist().toCString(true)); 282 infoBox->txtAlbum->Text = gcnew String(tag->album().toCString(true)); 283 infoBox->txtYear->Text = ""; 284 infoBox->txtYear->Text += tag->year(); 285 infoBox->txtTrack->Text = ""; 286 infoBox->txtTrack->Text += tag->track(); 287 infoBox->comboGenre->Text = gcnew String(tag->genre().toCString(true)); 288 infoBox->txtComment->Text = gcnew String(tag->comment().toCString(true)); 289 } 290 } 291 292 void mpc_player::writeTags(mpc_info ^ infoBox) 293 { 294 if (!tag_file->isNull() && tag_file->tag()) { 295 TagLib::Tag *tag = tag_file->tag(); 296 297 pin_ptr<const wchar_t> wch = PtrToStringChars(infoBox->txtTitle->Text); 298 tag->setTitle(wch); 299 300 wch = PtrToStringChars(infoBox->txtArtist->Text); 301 tag->setArtist(wch); 302 303 wch = PtrToStringChars(infoBox->txtAlbum->Text); 304 tag->setAlbum(wch); 305 306 wch = PtrToStringChars(infoBox->txtYear->Text); 307 TagLib::String year(wch); 308 tag->setYear(year.toInt()); 309 310 wch = PtrToStringChars(infoBox->txtTrack->Text); 311 TagLib::String track(wch); 312 tag->setTrack(track.toInt()); 313 314 wch = PtrToStringChars(infoBox->comboGenre->Text); 315 tag->setGenre(wch); 316 317 wch = PtrToStringChars(infoBox->txtComment->Text); 318 tag->setComment(wch); 319 320 tag_file->save(); // FIXME : make all crash 321 } 322 } 323 273 324 int mpc_player::infoDlg(HWND hwnd) 274 325 { 275 mpc_info infoBox ;326 mpc_info infoBox(this); 276 327 System::String ^ tmp; 277 328 … … 299 350 infoBox.lblStreamInfo->Text = tmp; 300 351 301 302 if(tag_file == 0) 303 tag_file = new TagLib::FileRef(lastfn, false); 304 305 if (!tag_file->isNull() && tag_file->tag()) { 306 TagLib::Tag *tag = tag_file->tag(); 307 infoBox.txtTitle->Text = gcnew String(tag->title().toCString(true)); 308 infoBox.txtArtist->Text = gcnew String(tag->artist().toCString(true)); 309 infoBox.txtAlbum->Text = gcnew String(tag->album().toCString(true)); 310 infoBox.txtYear->Text += tag->year(); 311 infoBox.txtTrack->Text += tag->track(); 312 infoBox.comboGenre->Text = gcnew String(tag->genre().toCString(true)); 313 infoBox.txtComment->Text = gcnew String(tag->comment().toCString(true)); 314 } 352 loadTags(% infoBox); 315 353 316 354 infoBox.ShowDialog(); -
winamp-musepack/trunk/winamp-musepack/mpc_player.h
r191 r192 22 22 #include <mpcdec/mpcdec.h> 23 23 #include <fileref.h> 24 #include "mpc_info.h" 25 26 using namespace winamp_musepack; 24 27 25 28 // post this to the main window at end of file (after playback as stopped) … … 44 47 45 48 int infoDlg(HWND hwnd); 49 void loadTags(mpc_info ^ infoBox); 50 void writeTags(mpc_info ^ infoBox); 46 51 47 52 int paused; // are we paused? -
winamp-musepack/trunk/winamp-musepack/winamp-musepack.vcproj
r191 r192 94 94 IntermediateDirectory="$(ConfigurationName)" 95 95 ConfigurationType="2" 96 ManagedExtensions="1" 96 97 > 97 98 <Tool … … 113 114 Name="VCCLCompilerTool" 114 115 AdditionalIncludeDirectories="..\..\libmpc\include;C:\Program Files\taglib\include\taglib" 115 PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE "116 PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32" 116 117 RuntimeLibrary="2" 117 118 WarningLevel="1" … … 217 218 BasicRuntimeChecks="0" 218 219 UsePrecompiledHeader="0" 219 DebugInformationFormat="3" 220 /> 221 </FileConfiguration> 222 </File> 223 <File 224 RelativePath=".\mpc_player.cpp" 225 > 226 <FileConfiguration 227 Name="Debug|Win32" 228 > 229 <Tool 230 Name="VCCLCompilerTool" 231 ExceptionHandling="2" 220 232 CompileAsManaged="1" 221 233 /> 222 234 </FileConfiguration> 223 </File>224 <File225 RelativePath=".\mpc_player.cpp"226 >227 <FileConfiguration228 Name="Debug|Win32"229 >230 <Tool231 Name="VCCLCompilerTool"232 ExceptionHandling="2"233 CompileAsManaged="1"234 />235 </FileConfiguration>236 235 <FileConfiguration 237 236 Name="Release|Win32" … … 240 239 Name="VCCLCompilerTool" 241 240 ExceptionHandling="2" 242 CompileAsManaged="1"243 241 /> 244 242 </FileConfiguration>
Note: See TracChangeset
for help on using the changeset viewer.