From: <sag...@us...> - 2012-02-14 21:39:39
|
Revision: 1179 http://modplug.svn.sourceforge.net/modplug/?rev=1179&view=rev Author: saga-games Date: 2012-02-14 21:39:32 +0000 (Tue, 14 Feb 2012) Log Message: ----------- [Imp] Installer: When checking for VSTs, the default VST folder is written to OpenMPT's config file if there is no other VST folder listed yet. [Fix] After saving, XM and S3M files were still marked as modified since rev. 1168. [Ref] Smaller stuff. Modified Paths: -------------- trunk/OpenMPT/installer/vst_scan.iss trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h Modified: trunk/OpenMPT/installer/vst_scan.iss =================================================================== --- trunk/OpenMPT/installer/vst_scan.iss 2012-02-11 18:52:13 UTC (rev 1178) +++ trunk/OpenMPT/installer/vst_scan.iss 2012-02-14 21:39:32 UTC (rev 1179) @@ -99,6 +99,9 @@ if(VSTPluginNumber <> OldVSTPluginNumber) then begin SetIniInt('VST Plugins', 'NumPlugins', VSTPluginNumber, INIFile); + // Also write the detected VST dir to the INI file if there was no previous entry in it. + if(GetIniString('Paths', 'Plugins_Directory', '', INIFile) = '') then + SetIniString('Paths', 'Plugins_Directory', Dir, INIFile); end; end; Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2012-02-11 18:52:13 UTC (rev 1178) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2012-02-14 21:39:32 UTC (rev 1179) @@ -467,18 +467,18 @@ m_EditGlobalVol.GetWindowText(s, sizeof(s)); if (s[0]) { - UINT n = atoi(s); - Limit(n, 0u, 256u / GetGlobalVolumeFactor()); - if (n != (m_pSndFile->m_nDefaultGlobalVolume >> 1)) + UINT n = atoi(s) * GetGlobalVolumeFactor(); + Limit(n, 0u, 256u); + if (n != m_pSndFile->m_nDefaultGlobalVolume) { - m_bEditsLocked=true; + m_bEditsLocked = true; m_EditGlobalVol.SetModify(FALSE); - m_pSndFile->m_nDefaultGlobalVolume = n * GetGlobalVolumeFactor(); - m_pSndFile->m_nGlobalVolume = n * GetGlobalVolumeFactor(); + m_pSndFile->m_nDefaultGlobalVolume = n; + m_pSndFile->m_nGlobalVolume = n; m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); UpdateView(HINT_MODGENERAL, NULL); - m_bEditsLocked=false; + m_bEditsLocked = false; } } } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2012-02-11 18:52:13 UTC (rev 1178) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2012-02-14 21:39:32 UTC (rev 1179) @@ -640,7 +640,7 @@ SetModified(FALSE); m_bHasValidPath=true; m_ShowSavedialog = false; - UpdateAllViews(NULL, HINT_MODGENERAL); // Update treeview (e.g. filename might have changed). + CMainFrame::GetMainFrame()->UpdateTree(this, HINT_MODGENERAL); // Update treeview (e.g. filename might have changed). return TRUE; } else { @@ -1652,7 +1652,7 @@ // Re-mute previously processed sample if(i > 0) MuteSample((SAMPLEINDEX)i, true); - if(m_SndFile.GetSample(i + 1).pSample == nullptr || !m_SndFile.IsSampleUsed((SAMPLEINDEX)(i + 1))) + if(m_SndFile.GetSample((SAMPLEINDEX)(i + 1)).pSample == nullptr || !m_SndFile.IsSampleUsed((SAMPLEINDEX)(i + 1))) continue; // Add sample number & name (if available) to path string if(strlen(m_SndFile.m_szNames[i + 1]) > 0) @@ -2066,17 +2066,16 @@ } +// Enable menu item only module types that support MIDI Mappings void CModDoc::OnUpdateHasMIDIMappings(CCmdUI *p) //---------------------------------------------- { - if(!p) return; - if(m_SndFile.GetModSpecifications().MIDIMappingDirectivesMax > 0) - p->Enable(); - else - p->Enable(FALSE); + if(p) + p->Enable((m_SndFile.GetModSpecifications().MIDIMappingDirectivesMax > 0) ? TRUE : FALSE); } +// Enable menu item only for IT / MPTM / XM files void CModDoc::OnUpdateXMITMPTOnly(CCmdUI *p) //--------------------------------------- { @@ -2085,6 +2084,7 @@ } +// Enable menu item only for IT / MPTM files void CModDoc::OnUpdateITMPTOnly(CCmdUI *p) //--------------------------------------- { @@ -2093,6 +2093,7 @@ } +// Enable menu item if MP3 encoder is present void CModDoc::OnUpdateMP3Encode(CCmdUI *p) //---------------------------------------- { @@ -2100,6 +2101,7 @@ } +// Enable menu item if current module type supports compatibility export void CModDoc::OnUpdateCompatExportableOnly(CCmdUI *p) //--------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2012-02-11 18:52:13 UTC (rev 1178) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2012-02-14 21:39:32 UTC (rev 1179) @@ -102,7 +102,7 @@ } else //Case: Valid path but opening fails. { - const int nOdc = AfxGetApp()->m_pDocManager->GetOpenDocumentCount(); + const int nOdc = theApp.GetOpenDocumentCount(); CString str; str.Format(GetStrI18N(_TEXT("Opening \"%s\" failed. This can happen if " "no more documents can be opened or if the file type was not " @@ -225,9 +225,16 @@ } +int CTrackApp::GetOpenDocumentCount() const +//----------------------------------------- +{ + return AfxGetApp()->m_pDocManager->GetOpenDocumentCount(); +} + + // Retrieve a list of all open modules. -vector<CModDoc *> CTrackApp::GetOpenDocuments() -//--------------------------------------------- +vector<CModDoc *> CTrackApp::GetOpenDocuments() const +//--------------------------------------------------- { vector<CModDoc *> documents; Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2012-02-11 18:52:13 UTC (rev 1178) +++ trunk/OpenMPT/mptrack/Mptrack.h 2012-02-14 21:39:32 UTC (rev 1179) @@ -168,7 +168,8 @@ static FileDlgResult ShowOpenSaveFileDialog(const bool load, const std::string defaultExtension, const std::string defaultFilename, const std::string extFilter, const std::string workingDirectory = "", const bool allowMultiSelect = false, int *filterIndex = nullptr); - vector<CModDoc *>GetOpenDocuments(); + int GetOpenDocumentCount() const; + vector<CModDoc *>GetOpenDocuments() const; public: CDocTemplate *GetModDocTemplate() const { return m_pModTemplate; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |