From: <sag...@us...> - 2013-04-15 16:33:54
|
Revision: 1883 http://sourceforge.net/p/modplug/code/1883 Author: saga-games Date: 2013-04-15 16:33:46 +0000 (Mon, 15 Apr 2013) Log Message: ----------- [Ref] Updating mix levels has been unified to a single function call. Mix level stuff is now protected in CSoundFile. [Mod] Instrument previews in the tree view are now played at 0dB. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/ModConvert.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp trunk/OpenMPT/soundlib/SoundFilePlayConfig.h Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -816,7 +816,7 @@ // convert to IT... modDoc.ChangeModType(MOD_TYPE_IT); - sndFile.m_nMixLevels = mixLevels_compatible; + sndFile.SetMixLevels(mixLevels_compatible); sndFile.m_nTempoMode = tempo_mode_classic; sndFile.m_SongFlags = SONG_LINEARSLIDES; sndFile.m_MidiCfg.Reset(); Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -301,7 +301,8 @@ } } - else if (pSlider==&m_SliderVSTiVol) { + else if (pSlider==&m_SliderVSTiVol) + { const UINT vv = MAX_SLIDER_VSTI_VOL - m_SliderVSTiVol.GetPos(); if ((vv >= 0) && (vv <= MAX_SLIDER_VSTI_VOL) && (vv != m_sndFile.m_nVSTiVolume)) { @@ -528,20 +529,20 @@ const char moreRecentMixModeNote[] = "Use a more recent mixmode to see dB offsets."; if ((pszText) && (uId)) { - const bool displayDBValues = m_sndFile.m_PlayConfig.getDisplayDBValues(); + const bool displayDBValues = m_sndFile.GetPlayConfig().getDisplayDBValues(); switch(uId) { case IDC_SLIDER_SAMPLEPREAMP: - (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nSamplePreAmp, m_sndFile.m_PlayConfig.getNormalSamplePreAmp()) : wsprintf(pszText, moreRecentMixModeNote); + (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nSamplePreAmp, m_sndFile.GetPlayConfig().getNormalSamplePreAmp()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; break; case IDC_SLIDER_VSTIVOL: - (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nVSTiVolume, m_sndFile.m_PlayConfig.getNormalVSTiVol()) : wsprintf(pszText, moreRecentMixModeNote); + (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nVSTiVolume, m_sndFile.GetPlayConfig().getNormalVSTiVol()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; break; case IDC_SLIDER_GLOBALVOL: - (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nGlobalVolume, m_sndFile.m_PlayConfig.getNormalGlobalVol()) : wsprintf(pszText, moreRecentMixModeNote); + (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nGlobalVolume, m_sndFile.GetPlayConfig().getNormalGlobalVol()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; break; } Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -523,12 +523,12 @@ } } - if(m_SndFile.m_nMixLevels != mixLevels_compatible) + if(m_SndFile.GetMixLevels() != mixLevels_compatible) { AddToLog("Found incorrect mix levels (only compatible mix levels allowed)"); foundHacks = true; if(autofix) - m_SndFile.m_nMixLevels = mixLevels_compatible; + m_SndFile.SetMixLevels(mixLevels_compatible); } if(autofix && foundHacks) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -1635,19 +1635,18 @@ m_WaveFile.Destroy(); m_WaveFile.Create(NULL, 0); // Avoid global volume ramping when trying samples in the treeview. - m_WaveFile.m_PlayConfig.setGlobalVolumeAppliesToMaster(false); m_WaveFile.m_nDefaultGlobalVolume = m_WaveFile.m_nGlobalVolume = MAX_GLOBAL_VOLUME; - m_WaveFile.m_nSamplePreAmp = 48; + m_WaveFile.SetMixLevels(mixLevels_117RC3); + m_WaveFile.m_nSamplePreAmp = m_WaveFile.GetPlayConfig().getNormalSamplePreAmp(); m_WaveFile.m_nDefaultTempo = 125; m_WaveFile.m_nDefaultSpeed = 6; m_WaveFile.m_nType = MOD_TYPE_MPT; - m_WaveFile.m_nChannels = 4; + m_WaveFile.m_nChannels = 2; m_WaveFile.m_nInstruments = 1; m_WaveFile.m_nTempoMode = tempo_mode_classic; - m_WaveFile.m_nMixLevels = mixLevels_compatible; m_WaveFile.Order.resize(1); m_WaveFile.Order[0] = 0; - m_WaveFile.Patterns.Insert(0, 64); + m_WaveFile.Patterns.Insert(0, 80); } @@ -1663,19 +1662,15 @@ { m[0].note = note; m[0].instr = 1; - m[1].note = note; - m[1].instr = 1; if(m_WaveFile.m_nSamples > 1 || m_WaveFile.GetSample(1).uFlags[CHN_LOOP]) { - m[32 * 4].note = NOTE_KEYOFF; - m[32 * 4 + 1].note = NOTE_KEYOFF; - m[63 * 4].note = NOTE_NOTECUT; - m[63 * 4 + 1].note = NOTE_NOTECUT; + m[48 * 2].note = NOTE_KEYOFF; + m[79 * 2].note = NOTE_NOTECUT; } - m[63 * 4 + 2].command = CMD_POSITIONJUMP; - m[63 * 4 + 3].command = CMD_PATTERNBREAK; - m[63 * 4 + 3].param = 63; + m[79 * 2].command = CMD_POSITIONJUMP; + m[79 * 2 + 1].command = CMD_PATTERNBREAK; + m[79 * 2 + 1].param = 63; } } Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -1117,7 +1117,7 @@ m_pSndFile->InitPlayer(TRUE); m_pSndFile->m_SongFlags.reset(SONG_PAUSED | SONG_STEP); - m_pSndFile->visitedSongRows.Initialize(true); + m_pSndFile->InitializeVisitedRows(); // Setting up file limits and progress range if ((!m_dwFileLimit) || (m_dwFileLimit > 512000)) m_dwFileLimit = 512000; @@ -1208,7 +1208,7 @@ m_pSndFile->m_MixerSettings.MixerFlags = oldsndcfg; m_pSndFile->SetRepeatCount(oldrepeat); m_pSndFile->m_nMaxOrderPosition = 0; - m_pSndFile->visitedSongRows.Initialize(true); + m_pSndFile->InitializeVisitedRows(); CMainFrame::UpdateAudioParameters(*m_pSndFile, TRUE); // Success Modified: trunk/OpenMPT/mptrack/ModConvert.cpp =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/ModConvert.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -489,10 +489,9 @@ // Adjust mix levels if(newTypeIsMOD || newTypeIsS3M) { - m_SndFile.m_nMixLevels = mixLevels_compatible; - m_SndFile.m_PlayConfig.SetMixLevels(mixLevels_compatible); + m_SndFile.SetMixLevels(mixLevels_compatible); } - if(oldTypeIsMPT && m_SndFile.m_nMixLevels != mixLevels_compatible) + if(oldTypeIsMPT && m_SndFile.GetMixLevels() != mixLevels_compatible) { CHANGEMODTYPE_WARNING(wMixmode); } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -690,8 +690,7 @@ } // Refresh mix levels now that the correct mod type has been set - m_SndFile.m_nMixLevels = m_SndFile.GetModSpecifications().defaultMixLevels; - m_SndFile.m_PlayConfig.SetMixLevels(m_SndFile.m_nMixLevels); + m_SndFile.SetMixLevels(m_SndFile.GetModSpecifications().defaultMixLevels); // ...and the order length m_SndFile.Order.resize(MIN(ModSequenceSet::s_nCacheSize, m_SndFile.GetModSpecifications().ordersMax)); @@ -1714,7 +1713,7 @@ thisName += fileExt; // Render song (or current channel, or current sample/instrument) - m_SndFile.visitedSongRows.Initialize(true); + m_SndFile.InitializeVisitedRows(); m_SndFile.SetCurrentPos(0); m_SndFile.m_SongFlags.reset(SONG_PATTERNLOOP); if(wsdlg.m_bSelectPlay) Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -2032,8 +2032,8 @@ if(m_bIsInstrument) { - gain /= m_SndFile.m_PlayConfig.getVSTiAttenuation(); - gain = static_cast<float>(gain * (m_SndFile.m_nVSTiVolume / m_SndFile.m_PlayConfig.getNormalVSTiVol())); + gain /= m_SndFile.GetPlayConfig().getVSTiAttenuation(); + gain = static_cast<float>(gain * (m_SndFile.m_nVSTiVolume / m_SndFile.GetPlayConfig().getNormalVSTiVol())); } m_fGain = gain; } Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -114,9 +114,9 @@ // Mix levels m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), mixLevels_117RC3); - if(sndFile.m_nMixLevels == mixLevels_117RC2) // Only shown for backwards compatibility with existing tunes + if(sndFile.GetMixLevels() == mixLevels_117RC2) // Only shown for backwards compatibility with existing tunes m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2); - if(sndFile.m_nMixLevels == mixLevels_117RC1) // Dito + if(sndFile.GetMixLevels() == mixLevels_117RC1) // Dito m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original (MPT 1.16)"), mixLevels_original); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible"), mixLevels_compatible); @@ -124,7 +124,7 @@ m_PlugMixBox.SetCurSel(0); for(int i = m_PlugMixBox.GetCount(); i > 0; i--) { - if(m_PlugMixBox.GetItemData(i) == sndFile.m_nMixLevels) + if(m_PlugMixBox.GetItemData(i) == sndFile.GetMixLevels()) { m_PlugMixBox.SetCurSel(i); break; @@ -359,11 +359,9 @@ } sel = m_PlugMixBox.GetCurSel(); - if (sel >= 0) + if(sel >= 0) { - sndFile.m_nMixLevels = m_PlugMixBox.GetItemData(sel); - sndFile.m_PlayConfig.SetMixLevels(sndFile.m_nMixLevels); - sndFile.RecalculateGainForAllPlugs(); + sndFile.SetMixLevels(static_cast<mixLevels>(m_PlugMixBox.GetItemData(sel))); } if(m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_XM)) Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -338,7 +338,7 @@ VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_MIDICC_BUGEMULATION), false); VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLDVOLSWING), false); VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLD_MIDI_PITCHBENDS), false); - VERIFY_EQUAL_NONCONT(sndFile.m_nMixLevels, mixLevels_compatible); + VERIFY_EQUAL_NONCONT(sndFile.GetMixLevels(), mixLevels_compatible); VERIFY_EQUAL_NONCONT(sndFile.m_nTempoMode, tempo_mode_modern); VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerBeat, 6); VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerMeasure, 12); @@ -533,7 +533,7 @@ VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_MIDICC_BUGEMULATION), false); VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLDVOLSWING), false); VERIFY_EQUAL_NONCONT(sndFile.GetModFlag(MSF_OLD_MIDI_PITCHBENDS), false); - VERIFY_EQUAL_NONCONT(sndFile.m_nMixLevels, mixLevels_compatible); + VERIFY_EQUAL_NONCONT(sndFile.GetMixLevels(), mixLevels_compatible); VERIFY_EQUAL_NONCONT(sndFile.m_nTempoMode, tempo_mode_modern); VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerBeat, 6); VERIFY_EQUAL_NONCONT(sndFile.m_nDefaultRowsPerMeasure, 12); @@ -784,7 +784,7 @@ VERIFY_EQUAL_NONCONT(sndFile.m_nVSTiVolume, 48); VERIFY_EQUAL_NONCONT(sndFile.m_nSamplePreAmp, 16); VERIFY_EQUAL_NONCONT((sndFile.m_SongFlags & SONG_FILE_FLAGS), SONG_FASTVOLSLIDES); - VERIFY_EQUAL_NONCONT(sndFile.m_nMixLevels, mixLevels_compatible); + VERIFY_EQUAL_NONCONT(sndFile.GetMixLevels(), mixLevels_compatible); VERIFY_EQUAL_NONCONT(sndFile.m_nTempoMode, tempo_mode_classic); VERIFY_EQUAL_NONCONT(sndFile.m_dwLastSavedWithVersion, resaved ? (MptVersion::num & 0xFFFF0000) : MAKE_VERSION_NUMERIC(1, 20, 00, 00)); VERIFY_EQUAL_NONCONT(sndFile.m_nRestartPos, 0); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -805,8 +805,7 @@ #endif // NO_VST // Set up mix levels - m_PlayConfig.SetMixLevels(m_nMixLevels); - RecalculateGainForAllPlugs(); + SetMixLevels(m_nMixLevels); if(GetType() != MOD_TYPE_NONE) { @@ -1129,6 +1128,15 @@ } +void CSoundFile::SetMixLevels(mixLevels levels) +//--------------------------------------------- +{ + m_nMixLevels = levels; + m_PlayConfig.SetMixLevels(m_nMixLevels); + RecalculateGainForAllPlugs(); +} + + void CSoundFile::RecalculateGainForAllPlugs() //------------------------------------------- { Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-15 16:33:46 UTC (rev 1883) @@ -212,8 +212,8 @@ #endif // MODPLUG_TRACKER private: //Misc data + const CModSpecifications *m_pModSpecs; FlagSet<ModSpecificFlag, uint16> m_ModFlags; - const CModSpecifications* m_pModSpecs; private: DWORD gdwSysInfo; @@ -264,7 +264,6 @@ INSTRUMENTINDEX m_nInstruments; UINT m_nDefaultSpeed, m_nDefaultTempo, m_nDefaultGlobalVolume; FlagSet<SongFlags> m_SongFlags; - bool m_bIsRendering; UINT m_nMixChannels, m_nMixStat; samplecount_t m_nBufferCount; double m_dBufferDiff; @@ -276,7 +275,6 @@ ROWINDEX m_nDefaultRowsPerBeat, m_nDefaultRowsPerMeasure; // default rows per beat and measure for this module // rewbs.betterBPM ROWINDEX m_nCurrentRowsPerBeat, m_nCurrentRowsPerMeasure; // current rows per beat and measure for this module BYTE m_nTempoMode; // rewbs.betterBPM - BYTE m_nMixLevels; UINT m_nMusicSpeed, m_nMusicTempo; // Current speed and tempo ROWINDEX m_nNextRow, m_nRow; ROWINDEX m_nNextPatStartRow; // for FT2's E60 bug @@ -288,7 +286,6 @@ ORDERINDEX m_lockOrderStart, m_lockOrderEnd; #endif // MODPLUG_TRACKER - bool m_bPatternTransitionOccurred; UINT m_nGlobalVolume, m_nSamplesToGlobalVolRampDest, m_nGlobalVolumeRampAmount, m_nGlobalVolumeDestination, m_nSamplePreAmp, m_nVSTiVolume; long m_lHighResRampingGlobalVolume; @@ -311,7 +308,6 @@ char m_szNames[MAX_SAMPLES][MAX_SAMPLENAME]; // Song and sample names std::bitset<MAX_BASECHANNELS> m_bChannelMuteTogglePending; - CSoundFilePlayConfig m_PlayConfig; DWORD m_dwCreatedWithVersion; DWORD m_dwLastSavedWithVersion; @@ -319,9 +315,15 @@ std::vector<PatternCuePoint> m_PatternCuePoints; // For WAV export (writing pattern positions to file) #endif // MODPLUG_TRACKER +protected: + // Mix level stuff + CSoundFilePlayConfig m_PlayConfig; + mixLevels m_nMixLevels; + // For handling backwards jumps and stuff to prevent infinite loops when counting the mod length or rendering to wav. RowVisitor visitedSongRows; +public: // Song message SongMessage songMessage; @@ -330,6 +332,9 @@ mpt::String m_szInstrumentPath[MAX_INSTRUMENTS]; // -! NEW_FEATURE#0023 + bool m_bIsRendering; + bool m_bPatternTransitionOccurred; + public: CSoundFile(); ~CSoundFile(); @@ -356,6 +361,10 @@ void SetPreAmp(UINT vol); UINT GetPreAmp() const { return m_MixerSettings.m_nPreAmp; } + void SetMixLevels(mixLevels levels); + mixLevels GetMixLevels() const { return m_nMixLevels; } + const CSoundFilePlayConfig &GetPlayConfig() const { return m_PlayConfig; } + INSTRUMENTINDEX GetNumInstruments() const { return m_nInstruments; } SAMPLEINDEX GetNumSamples() const { return m_nSamples; } UINT GetCurrentPos() const; @@ -383,6 +392,8 @@ //specific order&row etc. Return value is in seconds. GetLengthType GetLength(enmGetLengthResetMode adjustMode, ORDERINDEX ord = ORDERINDEX_INVALID, ROWINDEX row = ROWINDEX_INVALID); + void InitializeVisitedRows() { visitedSongRows.Initialize(true); } + public: //Returns song length in seconds. DWORD GetSongTime() { return static_cast<DWORD>(GetLength(eNoAdjust).duration + 0.5); } Modified: trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp =================================================================== --- trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp 2013-04-15 16:33:46 UTC (rev 1883) @@ -121,8 +121,8 @@ //getters and setters. -bool CSoundFilePlayConfig::getGlobalVolumeAppliesToMaster() -//--------------------------------------------------------- +bool CSoundFilePlayConfig::getGlobalVolumeAppliesToMaster() const +//--------------------------------------------------------------- { return m_globalVolumeAppliesToMaster; } @@ -134,14 +134,14 @@ m_globalVolumeAppliesToMaster=inGlobalVolumeAppliesToMaster; } -float CSoundFilePlayConfig::getVSTiGainFactor() -//--------------------------------------------- +float CSoundFilePlayConfig::getVSTiGainFactor() const +//--------------------------------------------------- { return m_VSTiVolume; } -float CSoundFilePlayConfig::getVSTiVolume() -//----------------------------------------- +float CSoundFilePlayConfig::getVSTiVolume() const +//----------------------------------------------- { return m_VSTiVolume; } @@ -152,8 +152,8 @@ m_VSTiVolume = inVSTiVolume; } -float CSoundFilePlayConfig::getVSTiAttenuation() -//---------------------------------------------- +float CSoundFilePlayConfig::getVSTiAttenuation() const +//---------------------------------------------------- { return m_VSTiAttenuation; } @@ -164,8 +164,8 @@ m_VSTiAttenuation = inVSTiAttenuation; } -float CSoundFilePlayConfig::getIntToFloat() -//----------------------------------------- +float CSoundFilePlayConfig::getIntToFloat() const +//----------------------------------------------- { return m_IntToFloat; } @@ -177,8 +177,8 @@ } -float CSoundFilePlayConfig::getFloatToInt() -//----------------------------------------- +float CSoundFilePlayConfig::getFloatToInt() const +//----------------------------------------------- { return m_FloatToInt; } @@ -190,8 +190,8 @@ m_FloatToInt = inFloatToInt; } -bool CSoundFilePlayConfig::getUseGlobalPreAmp() -//--------------------------------------------- +bool CSoundFilePlayConfig::getUseGlobalPreAmp() const +//--------------------------------------------------- { return m_ignorePreAmp; } @@ -203,8 +203,8 @@ } -forcePanningMode CSoundFilePlayConfig::getForcePanningMode() -//---------------------------------------------------------- +forcePanningMode CSoundFilePlayConfig::getForcePanningMode() const +//---------------------------------------------------------------- { return m_forceSoftPanning; } @@ -239,26 +239,26 @@ m_normalGlobalVol = in; } -bool CSoundFilePlayConfig::getDisplayDBValues() -//--------------------------------------------- +bool CSoundFilePlayConfig::getDisplayDBValues() const +//--------------------------------------------------- { return m_displayDBValues; } -double CSoundFilePlayConfig::getNormalSamplePreAmp() -//-------------------------------------------------- +double CSoundFilePlayConfig::getNormalSamplePreAmp() const +//-------------------------------------------------------- { return m_normalSamplePreAmp; } -double CSoundFilePlayConfig::getNormalVSTiVol() -//--------------------------------------------- +double CSoundFilePlayConfig::getNormalVSTiVol() const +//--------------------------------------------------- { return m_normalVSTiVol; } -double CSoundFilePlayConfig::getNormalGlobalVol() -//----------------------------------------------- +double CSoundFilePlayConfig::getNormalGlobalVol() const +//----------------------------------------------------- { return m_normalGlobalVol; } @@ -269,8 +269,8 @@ m_extraAttenuation = attn; } -int CSoundFilePlayConfig::getExtraSampleAttenuation() -//--------------------------------------------------- +int CSoundFilePlayConfig::getExtraSampleAttenuation() const +//--------------------------------------------------------- { return m_extraAttenuation; } Modified: trunk/OpenMPT/soundlib/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/soundlib/SoundFilePlayConfig.h 2013-04-15 13:09:48 UTC (rev 1882) +++ trunk/OpenMPT/soundlib/SoundFilePlayConfig.h 2013-04-15 16:33:46 UTC (rev 1883) @@ -49,39 +49,39 @@ void SetMixLevels(int mixLevelType); //getters/setters - float getIntToFloat(); + float getIntToFloat() const; void setIntToFloat(float); - float getFloatToInt(); + float getFloatToInt() const; void setFloatToInt(float); // default VSTi gain factor, different depending on the MPT version we're "emulating" void setVSTiAttenuation(float); - float getVSTiAttenuation(); + float getVSTiAttenuation() const; // user-controllable VSTi gain factor. void setVSTiVolume(float); - float getVSTiVolume(); + float getVSTiVolume() const; void setGlobalVolumeAppliesToMaster(bool); - bool getGlobalVolumeAppliesToMaster(); + bool getGlobalVolumeAppliesToMaster() const; void setUseGlobalPreAmp(bool); - bool getUseGlobalPreAmp(); + bool getUseGlobalPreAmp() const; void setForcePanningMode(forcePanningMode); - forcePanningMode getForcePanningMode(); + forcePanningMode getForcePanningMode() const; void setDisplayDBValues(bool); - bool getDisplayDBValues(); + bool getDisplayDBValues() const; // Extra sample attenuation in bits void setExtraSampleAttenuation(int); - int getExtraSampleAttenuation(); + int getExtraSampleAttenuation() const; //Values at which volumes are unchanged - double getNormalSamplePreAmp(); - double getNormalVSTiVol(); - double getNormalGlobalVol(); + double getNormalSamplePreAmp() const; + double getNormalVSTiVol() const; + double getNormalGlobalVol() const; void setNormalSamplePreAmp(double); void setNormalVSTiVol(double); void setNormalGlobalVol(double); @@ -89,7 +89,7 @@ private: //calculated internally (getters only): - float getVSTiGainFactor(); + float getVSTiGainFactor() const; float m_IntToFloat; float m_FloatToInt; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |