From: <sag...@us...> - 2014-02-02 19:29:37
|
Revision: 3632 http://sourceforge.net/p/modplug/code/3632 Author: saga-games Date: 2014-02-02 19:29:27 +0000 (Sun, 02 Feb 2014) Log Message: ----------- [Ref] Remove some tables that can easily be created procedurally (ModSquareTable, ITSquareTable, szDefaultNoteNames) Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/PatternClipboard.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/Tables.cpp trunk/OpenMPT/soundlib/Tables.h Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/Mptrack.h 2014-02-02 19:29:27 UTC (rev 3632) @@ -399,7 +399,7 @@ // Append note names to combobox. If pSndFile != nullprt, appends only notes that are // available in the module type. If nInstr is given, instrument specific note names are used instead of // default note names. -void AppendNotesToControlEx(CComboBox& combobox, const CSoundFile* const pSndFile = nullptr, const INSTRUMENTINDEX nInstr = MAX_INSTRUMENTS); +void AppendNotesToControlEx(CComboBox& combobox, const CSoundFile &sndFile, const INSTRUMENTINDEX nInstr = MAX_INSTRUMENTS); /////////////////////////////////////////////////// // Tables Modified: trunk/OpenMPT/mptrack/PatternClipboard.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternClipboard.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/PatternClipboard.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -182,17 +182,7 @@ // Note if(selection.ContainsHorizontal(cursor)) { - switch(m->note) - { - case NOTE_NONE: data.Append("..."); break; - case NOTE_KEYOFF: data.Append("==="); break; - case NOTE_NOTECUT: data.Append("^^^"); break; - case NOTE_FADE: data.Append("~~~"); break; - case NOTE_PC: data.Append("PC "); break; - case NOTE_PCS: data.Append("PCS"); break; - default: if(m->IsNote()) data.Append(szDefaultNoteNames[m->note - NOTE_MIN]); - else data.Append("..."); - } + data.Append(CSoundFile::GetNoteName(m->note).c_str()); } else { // No note Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -168,7 +168,7 @@ { combo->SetItemData(combo->AddString("any"), findAny); } - AppendNotesToControlEx(*combo, &sndFile); + AppendNotesToControlEx(*combo, sndFile); UINT ncount = combo->GetCount(); for (UINT i=0; i<ncount; i++) if (m_Cmd.note == combo->GetItemData(i)) @@ -628,9 +628,9 @@ if ((!parent) || (!pModDoc)) return FALSE; m_hWndView = parent->m_hWnd; m_pModDoc = pModDoc; - m_pageNote = new CPageEditNote(m_pModDoc->GetrSoundFile(), this); - m_pageVolume = new CPageEditVolume(m_pModDoc->GetrSoundFile(), this); - m_pageEffect = new CPageEditEffect(m_pModDoc->GetrSoundFile(), this); + m_pageNote = new CPageEditNote(m_pModDoc->GetrSoundFile(), *this); + m_pageVolume = new CPageEditVolume(m_pModDoc->GetrSoundFile(), *this); + m_pageEffect = new CPageEditEffect(m_pModDoc->GetrSoundFile(), *this); AddPage(m_pageNote); AddPage(m_pageVolume); AddPage(m_pageEffect); @@ -746,11 +746,7 @@ m->instr = instr; m_Command = *m; m_pModDoc->SetModified(); - // -> CODE#0008 - // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)" - // m_pModDoc->UpdateAllViews(NULL, (m_nRow << 24) | HINT_PATTERNROW, NULL); m_pModDoc->UpdateAllViews(NULL, (m_nRow << HINT_SHIFT_ROW) | HINT_PATTERNROW, NULL); - // -! BEHAVIOUR_CHANGE#0008 } } @@ -774,11 +770,7 @@ m->volcmd = volcmd; m->vol = vol; m_pModDoc->SetModified(); - // -> CODE#0008 - // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)" - // m_pModDoc->UpdateAllViews(NULL, (m_nRow << 24) | HINT_PATTERNROW, NULL); m_pModDoc->UpdateAllViews(NULL, (m_nRow << HINT_SHIFT_ROW) | HINT_PATTERNROW, NULL); - // -! BEHAVIOUR_CHANGE#0008 } } @@ -814,11 +806,7 @@ m->command = command; m->param = param; m_pModDoc->SetModified(); - // -> CODE#0008 - // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)" - // m_pModDoc->UpdateAllViews(NULL, (m_nRow << 24) | HINT_PATTERNROW, NULL); m_pModDoc->UpdateAllViews(NULL, (m_nRow << HINT_SHIFT_ROW) | HINT_PATTERNROW, NULL); - // -! BEHAVIOUR_CHANGE#0008 } } @@ -866,15 +854,14 @@ { combo->ResetContent(); combo->SetItemData(combo->AddString("No note"), 0); - AppendNotesToControlEx(*combo, &sndFile, m_nInstr); + AppendNotesToControlEx(*combo, sndFile, m_nInstr); if (ModCommand::IsNoteOrEmpty(m_nNote)) { // Normal note / no note const ModCommand::NOTE noteStart = sndFile.GetModSpecifications().noteMin; combo->SetCurSel(m_nNote - (noteStart - 1)); - } - else + } else { // Special notes for(int i = combo->GetCount() - 1; i >= 0; --i) @@ -951,9 +938,13 @@ } const bool bIsNowParamControl = ModCommand::IsPcNote(m_nNote); if(bWasParamControl != bIsNowParamControl) + { UpdateDialog(); + m_pParent.m_pageVolume->UpdateDialog(); + m_pParent.m_pageEffect->UpdateDialog(); + } - if (m_pParent) m_pParent->UpdateNote(m_nNote, m_nInstr); + m_pParent.UpdateNote(m_nNote, m_nInstr); } @@ -1054,7 +1045,7 @@ { m_nVolume = static_cast<ModCommand::VOL>(slider->GetPos()); } - if (m_pParent) m_pParent->UpdateVolume(m_nVolCmd, m_nVolume); + m_pParent.UpdateVolume(m_nVolCmd, m_nVolume); } @@ -1178,7 +1169,7 @@ } SetDlgItemText(IDC_TEXT1, s); - if ((m_pParent) && (bSet)) m_pParent->UpdateEffect(m_nCommand, m_nParam); + if (bSet) m_pParent.UpdateEffect(m_nCommand, m_nParam); } Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2014-02-02 19:29:27 UTC (rev 3632) @@ -123,11 +123,11 @@ protected: CSoundFile &sndFile; EffectInfo effectInfo; - CEditCommand *m_pParent; + CEditCommand &m_pParent; bool m_bInitialized; public: - CPageEditCommand(CSoundFile &sf, CEditCommand *parent, UINT id) : CPropertyPage(id), sndFile(sf), effectInfo(sf), m_pParent(parent), m_bInitialized(false) {}; + CPageEditCommand(CSoundFile &sf, CEditCommand &parent, UINT id) : CPropertyPage(id), sndFile(sf), effectInfo(sf), m_pParent(parent), m_bInitialized(false) {}; virtual ~CPageEditCommand() {} virtual BOOL OnInitDialog(); @@ -145,7 +145,7 @@ ModCommand::INSTR m_nInstr; public: - CPageEditNote(CSoundFile &sf, CEditCommand *parent) : CPageEditCommand(sf, parent, IDD_PAGEEDITNOTE) {} + CPageEditNote(CSoundFile &sf, CEditCommand &parent) : CPageEditCommand(sf, parent, IDD_PAGEEDITNOTE) {} void Init(ModCommand &m) { m_nNote = m.note; m_nInstr = m.instr; } void UpdateDialog(); @@ -168,7 +168,7 @@ bool m_bIsParamControl; public: - CPageEditVolume(CSoundFile &sf, CEditCommand *parent) : CPageEditCommand(sf, parent, IDD_PAGEEDITVOLUME) {}; + CPageEditVolume(CSoundFile &sf, CEditCommand &parent) : CPageEditCommand(sf, parent, IDD_PAGEEDITVOLUME) {}; void Init(ModCommand &m) { m_nVolCmd = m.volcmd; m_nVolume = m.vol; m_bIsParamControl = m.IsPcNote(); }; void UpdateDialog(); void UpdateRanges(); @@ -200,7 +200,7 @@ ModCommand* m_pModcommand; public: - CPageEditEffect(CSoundFile &sf, CEditCommand *parent) : CPageEditCommand(sf, parent, IDD_PAGEEDITEFFECT) {} + CPageEditEffect(CSoundFile &sf, CEditCommand &parent) : CPageEditCommand(sf, parent, IDD_PAGEEDITEFFECT) {} // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" void Init(ModCommand &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = m.IsPcNote(); m_nPlugin = m.instr; m_nPluginParam = m.GetValueVolCol();} @@ -224,6 +224,7 @@ class CEditCommand: public CPropertySheet //======================================= { + friend class CPageEditNote; protected: CPageEditNote *m_pageNote; CPageEditVolume *m_pageVolume; @@ -242,10 +243,7 @@ public: BOOL SetParent(CWnd *parent, CModDoc *pModDoc); BOOL ShowEditWindow(PATTERNINDEX nPat, const PatternCursor &cursor); - // -> CODE#0010 - // -> DESC="add extended parameter mechanism to pattern effects" void OnSelListChange(); - // -! NEW_FEATURE#0010 void UpdateNote(ModCommand::NOTE note, ModCommand::INSTR instr); void UpdateVolume(ModCommand::VOLCMD volcmd, ModCommand::VOL vol); void UpdateEffect(ModCommand::COMMAND command, ModCommand::PARAM param); Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -897,7 +897,7 @@ for(size_t i = 0; i < CountOf(chords); i++) { uint32 chord; - if((chord = conf.Read<int32>("Chords", szDefaultNoteNames[i], -1)) >= 0) + if((chord = conf.Read<int32>("Chords", CSoundFile::GetNoteName(i + NOTE_MIN), -1)) >= 0) { if((chord & 0xFFFFFFC0) || (!chords[i].notes[0])) { @@ -917,7 +917,7 @@ for(size_t i = 0; i < CountOf(chords); i++) { int32 s = (chords[i].key) | (chords[i].notes[0] << 6) | (chords[i].notes[1] << 12) | (chords[i].notes[2] << 18); - conf.Write<int32>("Chords", szDefaultNoteNames[i], s); + conf.Write<int32>("Chords", CSoundFile::GetNoteName(i + NOTE_MIN), s); } } Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -2233,9 +2233,11 @@ ModSample &sample = sndFile.GetSample(m_nSample); uint32 freq = sndFile.GetFreqFromPeriod(sndFile.GetPeriodFromNote(note + (sndFile.GetType() == MOD_TYPE_XM ? sample.RelativeTone : 0), sample.nFineTune, sample.nC5Speed), sample.nC5Speed, 0); - CHAR s[32]; - wsprintf(s, "%s (%d.%02d Hz)", szDefaultNoteNames[note - 1], freq >> FREQ_FRACBITS, Util::muldiv(freq & ((1 << FREQ_FRACBITS) - 1), 100, 1 << FREQ_FRACBITS)); - pMainFrm->SetInfoText(s); + const std::string s = mpt::String::Print("%1 (%2.%3 Hz)", + sndFile.GetNoteName((ModCommand::NOTE)note), + freq >> FREQ_FRACBITS, + mpt::fmt::dec0<2>(Util::muldiv(freq & ((1 << FREQ_FRACBITS) - 1), 100, 1 << FREQ_FRACBITS))); + pMainFrm->SetInfoText(s.c_str()); } } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -517,7 +517,7 @@ for (UINT iPerc=24; iPerc<=84; iPerc++) { DWORD dwImage = IMAGE_NOSAMPLE; - s = mpt::ToWide(mpt::CharsetASCII, szDefaultNoteNames[iPerc]) + L": " + mpt::ToWide(mpt::CharsetASCII, szMidiPercussionNames[iPerc - 24]); + s = mpt::ToWide(mpt::CharsetASCII, CSoundFile::GetNoteName(iPerc + NOTE_MIN)) + L": " + mpt::ToWide(mpt::CharsetASCII, szMidiPercussionNames[iPerc - 24]); const LPARAM param = (MODITEM_MIDIPERCUSSION << MIDILIB_SHIFT) | iPerc; if(!midiLib.MidiMap[iPerc | 0x80].empty()) { Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -1287,29 +1287,26 @@ void AppendNotesToControl(CComboBox& combobox, const ModCommand::NOTE noteStart, const ModCommand::NOTE noteEnd) -//------------------------------------------------------------------------------------------------------------------ +//-------------------------------------------------------------------------------------------------------------- { - const ModCommand::NOTE upperLimit = MIN(CountOf(szDefaultNoteNames) - 1, noteEnd); + const ModCommand::NOTE upperLimit = MIN(NOTE_MAX - NOTE_MIN, noteEnd); for(ModCommand::NOTE note = noteStart; note <= upperLimit; ++note) - combobox.SetItemData(combobox.AddString(szDefaultNoteNames[note]), note); + combobox.SetItemData(combobox.AddString(CSoundFile::GetNoteName(note + NOTE_MIN).c_str()), note); } -void AppendNotesToControlEx(CComboBox& combobox, const CSoundFile* const pSndFile /* = nullptr*/, const INSTRUMENTINDEX nInstr/* = MAX_INSTRUMENTS*/) -//---------------------------------------------------------------------------------------------------------------------------------- +void AppendNotesToControlEx(CComboBox& combobox, const CSoundFile &sndFile, const INSTRUMENTINDEX nInstr/* = MAX_INSTRUMENTS*/) +//----------------------------------------------------------------------------------------------------------------------------- { - const ModCommand::NOTE noteStart = (pSndFile != nullptr) ? pSndFile->GetModSpecifications().noteMin : NOTE_MIN; - const ModCommand::NOTE noteEnd = (pSndFile != nullptr) ? pSndFile->GetModSpecifications().noteMax : NOTE_MAX; + const ModCommand::NOTE noteStart = sndFile.GetModSpecifications().noteMin; + const ModCommand::NOTE noteEnd = sndFile.GetModSpecifications().noteMax; for(ModCommand::NOTE nNote = noteStart; nNote <= noteEnd; nNote++) { - if(pSndFile != nullptr && nInstr != MAX_INSTRUMENTS) - combobox.SetItemData(combobox.AddString(pSndFile->GetNoteName(nNote, nInstr).c_str()), nNote); - else - combobox.SetItemData(combobox.AddString(szDefaultNoteNames[nNote - 1]), nNote); + combobox.SetItemData(combobox.AddString(sndFile.GetNoteName(nNote, nInstr).c_str()), nNote); } for(ModCommand::NOTE nNote = NOTE_MIN_SPECIAL - 1; nNote++ < NOTE_MAX_SPECIAL;) { - if(pSndFile == nullptr || pSndFile->GetModSpecifications().HasNote(nNote) == true) - combobox.SetItemData(combobox.AddString(szSpecialNoteNamesMPT[nNote-NOTE_MIN_SPECIAL]), nNote); + if(sndFile.GetModSpecifications().HasNote(nNote)) + combobox.SetItemData(combobox.AddString(szSpecialNoteNamesMPT[nNote - NOTE_MIN_SPECIAL]), nNote); } } Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -243,7 +243,7 @@ for (UINT i=0; i<61; i++) { UINT note = i+24; - wsprintf(s, "%d (%s): %s", note, szDefaultNoteNames[note], szMidiPercussionNames[i]); + wsprintf(s, "%d (%s%d): %s", note, szNoteNames[note % 12], note / 12, szMidiPercussionNames[i]); m_CbnProgram.SetItemData(m_CbnProgram.AddString(s), note/*+1*/); //+1 removed by rewbs because MIDI drums appear to be offset by 1 } } else Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -31,7 +31,6 @@ #endif // NO_ARCHIVE_SUPPORT extern BOOL MMCMP_Unpack(LPCBYTE *ppMemFile, LPDWORD pdwMemLength); -extern const char *szSpecialNoteNames[]; // -> CODE#0027 @@ -1744,22 +1743,37 @@ std::string CSoundFile::GetNoteName(const ModCommand::NOTE note, const INSTRUMENTINDEX inst) const //------------------------------------------------------------------------------------------------ { + // For MPTM instruments with custom tuning, find the appropriate note name. Else, use default note names. + if(ModCommand::IsNote(note) && GetType() == MOD_TYPE_MPT && inst >= 1 && inst <= GetNumInstruments() && Instruments[inst] && Instruments[inst]->pTuning) + { + return Instruments[inst]->pTuning->GetNoteName(note - NOTE_MIDDLEC); + } else + { + return GetNoteName(note); + } +} + + +std::string CSoundFile::GetNoteName(const ModCommand::NOTE note) +//-------------------------------------------------------------- +{ if(ModCommand::IsSpecialNote(note)) { - return szSpecialNoteNames[note - NOTE_MIN_SPECIAL]; + const char specialNoteNames[][4] = { "PCs", "PC ", "~~~", "^^^", "===" }; + STATIC_ASSERT(CountOf(specialNoteNames) == NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1); + + return specialNoteNames[note - NOTE_MIN_SPECIAL]; + } else if(ModCommand::IsNote(note)) + { + char name[4]; + MemCopy<char[4]>(name, szNoteNames[(note - NOTE_MIN) % 12]); // e.g. "C#" + name[2] = '0' + (note - NOTE_MIN) / 12; // e.g. 5 + return name; //szNoteNames[(note - NOTE_MIN) % 12] + std::string(1, '0' + (note - NOTE_MIN) / 12); } else if(note == NOTE_NONE) { return "..."; - } else if(!ModCommand::IsNote(note)) - { - return "???"; } - - // For MPTM instruments with custom tuning, find the appropriate note name. Else, use default note names. - if(GetType() == MOD_TYPE_MPT && inst >= 1 && inst <= GetNumInstruments() && Instruments[inst] && Instruments[inst]->pTuning) - return Instruments[inst]->pTuning->GetNoteName(note - NOTE_MIDDLEC); - else - return szDefaultNoteNames[note - 1]; + return "???"; } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/soundlib/Sndfile.h 2014-02-02 19:29:27 UTC (rev 3632) @@ -296,7 +296,8 @@ static CTuning *GetDefaultTuning() {return nullptr;} CTuningCollection& GetTuneSpecificTunings() {return *m_pTuningsTuneSpecific;} - std::string GetNoteName(const ModCommand::NOTE note, const INSTRUMENTINDEX inst = INSTRUMENTINDEX_INVALID) const; + std::string GetNoteName(const ModCommand::NOTE note, const INSTRUMENTINDEX inst) const; + static std::string GetNoteName(const ModCommand::NOTE note); private: CTuningCollection* m_pTuningsTuneSpecific; #ifdef MODPLUG_TRACKER @@ -870,8 +871,7 @@ #endif -extern const char *szNoteNames[12]; -extern const char *szDefaultNoteNames[NOTE_MAX]; +extern const char szNoteNames[12][4]; inline IMixPlugin* CSoundFile::GetInstrumentPlugin(INSTRUMENTINDEX instr) Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -578,7 +578,10 @@ case 2: // IT compatibility: IT has its own, more precise tables - return IsCompatibleMode(TRK_IMPULSETRACKER) ? ITSquareTable[position] : ModSquareTable[position]; + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + return position < 128 ? 64 : 0; + else + return position < 32 ? 127 : -127; case 3: //IT compatibility 19. Use random values @@ -1381,7 +1384,7 @@ vdelta = -ITRampDownTable[vibpos]; break; case VIB_SQUARE: - vdelta = ITSquareTable[vibpos]; + vdelta = vibpos < 128 ? 64 : 0; break; case VIB_SINE: default: Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/soundlib/Tables.cpp 2014-02-02 19:29:27 UTC (rev 3632) @@ -15,38 +15,19 @@ #include "Sndfile.h" #include "Resampler.h" -// rewbs.resamplerConf #include "WindowedFIR.h" -// end rewbs.resamplerConf ///////////////////////////////////////////////////////////////////////////// // Common Tables -const char *szNoteNames[12] = +const char szNoteNames[12][4] = { "C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-" }; -const char *szDefaultNoteNames[NOTE_MAX] = -{ - "C-0", "C#0", "D-0", "D#0", "E-0", "F-0", "F#0", "G-0", "G#0", "A-0", "A#0", "B-0", - "C-1", "C#1", "D-1", "D#1", "E-1", "F-1", "F#1", "G-1", "G#1", "A-1", "A#1", "B-1", - "C-2", "C#2", "D-2", "D#2", "E-2", "F-2", "F#2", "G-2", "G#2", "A-2", "A#2", "B-2", - "C-3", "C#3", "D-3", "D#3", "E-3", "F-3", "F#3", "G-3", "G#3", "A-3", "A#3", "B-3", - "C-4", "C#4", "D-4", "D#4", "E-4", "F-4", "F#4", "G-4", "G#4", "A-4", "A#4", "B-4", - "C-5", "C#5", "D-5", "D#5", "E-5", "F-5", "F#5", "G-5", "G#5", "A-5", "A#5", "B-5", - "C-6", "C#6", "D-6", "D#6", "E-6", "F-6", "F#6", "G-6", "G#6", "A-6", "A#6", "B-6", - "C-7", "C#7", "D-7", "D#7", "E-7", "F-7", "F#7", "G-7", "G#7", "A-7", "A#7", "B-7", - "C-8", "C#8", "D-8", "D#8", "E-8", "F-8", "F#8", "G-8", "G#8", "A-8", "A#8", "B-8", - "C-9", "C#9", "D-9", "D#9", "E-9", "F-9", "F#9", "G-9", "G#9", "A-9", "A#9", "B-9", -}; -const char *szSpecialNoteNames[] = { "PCs", "PC", "~~~", "^^^", "===" }; -STATIC_ASSERT(CountOf(szSpecialNoteNames) == NOTE_MAX_SPECIAL - NOTE_MIN_SPECIAL + 1); - - /////////////////////////////////////////////////////////// // File Formats Information (name, extension, etc) @@ -397,15 +378,6 @@ 63,59,55,51,47,43,39,35,31,27,23,19,15,11,7,3 }; -// Square wave table -const int8 ModSquareTable[64] = -{ - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, - -127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127, - -127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127 -}; - // Random wave table const int8 ModRandomTable[64] = { @@ -459,26 +431,6 @@ -56,-57,-57,-58,-58,-59,-59,-60,-60,-61,-61,-62,-62,-63,-63,-64, }; -// Square wave table -const int8 ITSquareTable[256] = -{ - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; // volume fade tables for Retrig Note: const int8 retrigTable1[16] = Modified: trunk/OpenMPT/soundlib/Tables.h =================================================================== --- trunk/OpenMPT/soundlib/Tables.h 2014-02-02 17:20:53 UTC (rev 3631) +++ trunk/OpenMPT/soundlib/Tables.h 2014-02-02 19:29:27 UTC (rev 3632) @@ -20,11 +20,9 @@ extern const uint16 S3MFineTuneTable[16]; extern const int8 ModSinusTable[64]; extern const int8 ModRampDownTable[64]; -extern const int8 ModSquareTable[64]; extern const int8 ModRandomTable[64]; extern const int8 ITSinusTable[256]; extern const int8 ITRampDownTable[256]; -extern const int8 ITSquareTable[256]; extern const int8 retrigTable1[16]; extern const int8 retrigTable2[16]; extern const uint16 XMPeriodTable[104]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |