1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
|
/*
* ModConvert.cpp
* --------------
* Purpose: Converting between various module formats.
* Notes : Incomplete list of MPTm-only features and extensions in the old formats:
* Features only available for MPTm:
* - User definable tunings.
* - Extended pattern range
* - Extended sequence
* - Multiple sequences ("songs")
* - Pattern-specific time signatures
* - Pattern effects :xy, S7D, S7E
* - Long instrument envelopes
* - Envelope release node (this was previously also usable in the IT format, but is now deprecated in that format)
* - Fractional tempo
* - Song-specific resampling
* - Alternative tempo modes (only usable in legacy XM / IT files)
*
* Extended features in IT/XM/S3M (not all listed below are available in all of those formats):
* - Plugins
* - Extended ranges for
* - Sample count
* - Instrument count
* - Pattern count
* - Sequence size
* - Row count
* - Channel count
* - Tempo limits
* - Extended sample/instrument properties.
* - MIDI mapping directives
* - Version info
* - Channel names
* - Pattern names
* - For more info, see e.g. SaveExtendedSongProperties(), SaveExtendedInstrumentProperties()
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#include "stdafx.h"
#include "Moddoc.h"
#include "Mainfrm.h"
#include "InputHandler.h"
#include "../tracklib/SampleEdit.h"
#include "../soundlib/modsmp_ctrl.h"
#include "../soundlib/mod_specifications.h"
#include "ModConvert.h"
OPENMPT_NAMESPACE_BEGIN
// Trim envelopes and remove release nodes.
static void UpdateEnvelopes(InstrumentEnvelope &mptEnv, const CModSpecifications &specs, std::bitset<wNumWarnings> &warnings)
{
// shorten instrument envelope if necessary (for mod conversion)
const uint8 envMax = specs.envelopePointsMax;
#define TRIMENV(envLen) if(envLen >= envMax) { envLen = envMax - 1; warnings.set(wTrimmedEnvelopes); }
if(mptEnv.size() > envMax)
{
mptEnv.resize(envMax);
warnings.set(wTrimmedEnvelopes);
}
TRIMENV(mptEnv.nLoopStart);
TRIMENV(mptEnv.nLoopEnd);
TRIMENV(mptEnv.nSustainStart);
TRIMENV(mptEnv.nSustainEnd);
if(mptEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET)
{
if(specs.hasReleaseNode)
{
TRIMENV(mptEnv.nReleaseNode);
} else
{
mptEnv.nReleaseNode = ENV_RELEASE_NODE_UNSET;
warnings.set(wReleaseNode);
}
}
#undef TRIMENV
}
bool CModDoc::ChangeModType(MODTYPE nNewType)
{
std::bitset<wNumWarnings> warnings;
warnings.reset();
PATTERNINDEX nResizedPatterns = 0;
const MODTYPE nOldType = m_SndFile.GetType();
if(nNewType == nOldType)
return true;
const bool oldTypeIsXM = (nOldType == MOD_TYPE_XM),
oldTypeIsS3M = (nOldType == MOD_TYPE_S3M), oldTypeIsIT = (nOldType == MOD_TYPE_IT),
oldTypeIsMPT = (nOldType == MOD_TYPE_MPT),
oldTypeIsS3M_IT_MPT = (oldTypeIsS3M || oldTypeIsIT || oldTypeIsMPT),
oldTypeIsIT_MPT = (oldTypeIsIT || oldTypeIsMPT);
const bool newTypeIsMOD = (nNewType == MOD_TYPE_MOD), newTypeIsXM = (nNewType == MOD_TYPE_XM),
newTypeIsS3M = (nNewType == MOD_TYPE_S3M), newTypeIsIT = (nNewType == MOD_TYPE_IT),
newTypeIsMPT = (nNewType == MOD_TYPE_MPT), newTypeIsMOD_XM = (newTypeIsMOD || newTypeIsXM),
newTypeIsIT_MPT = (newTypeIsIT || newTypeIsMPT);
const CModSpecifications &specs = m_SndFile.GetModSpecifications(nNewType);
// Check if conversion to 64 rows is necessary
for(const auto &pat : m_SndFile.Patterns)
{
if(pat.IsValid() && pat.GetNumRows() != 64)
nResizedPatterns++;
}
if((m_SndFile.GetNumInstruments() || nResizedPatterns) && (nNewType & (MOD_TYPE_MOD|MOD_TYPE_S3M)))
{
if(Reporting::Confirm(
"This operation will convert all instruments to samples,\n"
"and resize all patterns to 64 rows.\n"
"Do you want to continue?", "Warning") != cnfYes) return false;
BeginWaitCursor();
CriticalSection cs;
// Converting instruments to samples
if(m_SndFile.GetNumInstruments())
{
ConvertInstrumentsToSamples();
warnings.set(wInstrumentsToSamples);
}
// Resizing all patterns to 64 rows
for(auto &pat : m_SndFile.Patterns) if(pat.IsValid() && pat.GetNumRows() != 64)
{
ROWINDEX origRows = pat.GetNumRows();
pat.Resize(64);
if(origRows < 64)
{
// Try to save short patterns by inserting a pattern break.
pat.WriteEffect(EffectWriter(CMD_PATTERNBREAK, 0).Row(origRows - 1).RetryNextRow());
}
warnings.set(wResizedPatterns);
}
// Removing all instrument headers from channels
for(auto &chn : m_SndFile.m_PlayState.Chn)
{
chn.pModInstrument = nullptr;
}
for(INSTRUMENTINDEX nIns = 0; nIns <= m_SndFile.GetNumInstruments(); nIns++)
{
delete m_SndFile.Instruments[nIns];
m_SndFile.Instruments[nIns] = nullptr;
}
m_SndFile.m_nInstruments = 0;
EndWaitCursor();
} //End if (((m_SndFile.m_nInstruments) || (b64)) && (nNewType & (MOD_TYPE_MOD|MOD_TYPE_S3M)))
BeginWaitCursor();
/////////////////////////////
// Converting pattern data
// When converting to MOD, get the new sample transpose setting right here so that we can compensate notes in the pattern.
if(newTypeIsMOD && !oldTypeIsXM)
{
for(SAMPLEINDEX smp = 1; smp <= m_SndFile.GetNumSamples(); smp++)
{
m_SndFile.GetSample(smp).FrequencyToTranspose();
}
}
bool onlyAmigaNotes = true;
for(auto &pat : m_SndFile.Patterns) if(pat.IsValid())
{
// This is used for -> MOD/XM conversion
std::vector<std::array<ModCommand::PARAM, MAX_EFFECTS>> effMemory(GetNumChannels());
std::vector<ModCommand::VOL> volMemory(GetNumChannels(), 0);
std::vector<ModCommand::INSTR> instrMemory(GetNumChannels(), 0);
bool addBreak = false; // When converting to XM, avoid the E60 bug.
CHANNELINDEX chn = 0;
ROWINDEX row = 0;
for(auto m = pat.begin(); m != pat.end(); m++, chn++)
{
if(chn >= GetNumChannels())
{
chn = 0;
row++;
}
ModCommand::INSTR instr = m->instr;
if(m->instr) instrMemory[chn] = instr;
else instr = instrMemory[chn];
// Deal with volume column slide memory (it's not shared with the effect column)
if(oldTypeIsIT_MPT && (newTypeIsMOD_XM || newTypeIsS3M))
{
switch(m->volcmd)
{
case VOLCMD_VOLSLIDEUP:
case VOLCMD_VOLSLIDEDOWN:
case VOLCMD_FINEVOLUP:
case VOLCMD_FINEVOLDOWN:
if(m->vol == 0)
m->vol = volMemory[chn];
else
volMemory[chn] = m->vol;
break;
}
}
// Deal with MOD/XM commands without effect memory
if(oldTypeIsS3M_IT_MPT && newTypeIsMOD_XM)
{
switch(m->command)
{
// No effect memory in XM / MOD
case CMD_ARPEGGIO:
case CMD_S3MCMDEX:
case CMD_MODCMDEX:
// These have effect memory in XM, but it is spread over several commands (for fine and extra-fine slides), so the easiest way to fix this is to just always use the previous value.
case CMD_PORTAMENTOUP:
case CMD_PORTAMENTODOWN:
case CMD_VOLUMESLIDE:
if(m->param == 0)
m->param = effMemory[chn][m->command];
else
effMemory[chn][m->command] = m->param;
break;
}
}
// Adjust effect memory for MOD files
if(newTypeIsMOD)
{
switch(m->command)
{
case CMD_PORTAMENTOUP:
case CMD_PORTAMENTODOWN:
case CMD_TONEPORTAVOL:
case CMD_VIBRATOVOL:
case CMD_VOLUMESLIDE:
// ProTracker doesn't have effect memory for these commands, so let's try to fix them
if(m->param == 0)
m->param = effMemory[chn][m->command];
else
effMemory[chn][m->command] = m->param;
break;
}
// Compensate for loss of transpose information
if(m->IsNote() && instr && instr <= GetNumSamples())
{
const int newNote = m->note + m_SndFile.GetSample(instr).RelativeTone;
m->note = static_cast<ModCommand::NOTE>(Clamp(newNote, specs.noteMin, specs.noteMax));
}
if(!m->IsAmigaNote())
{
onlyAmigaNotes = false;
}
}
m->Convert(nOldType, nNewType, m_SndFile);
// When converting to XM, avoid the E60 bug.
if(newTypeIsXM)
{
switch(m->command)
{
case CMD_MODCMDEX:
if(m->param == 0x60 && row > 0)
{
addBreak = true;
}
break;
case CMD_POSITIONJUMP:
case CMD_PATTERNBREAK:
addBreak = false;
break;
}
}
// Fix Row Delay commands when converting between MOD/XM and S3M/IT.
// FT2 only considers the rightmost command, ST3/IT only the leftmost...
if((nOldType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) && (nNewType & (MOD_TYPE_MOD | MOD_TYPE_XM))
&& m->command == CMD_MODCMDEX && (m->param & 0xF0) == 0xE0)
{
if(oldTypeIsIT_MPT || m->param != 0xE0)
{
// If the leftmost row delay command is SE0, ST3 ignores it, IT doesn't.
// Delete all commands right of the first command
auto p = m + 1;
for(CHANNELINDEX c = chn + 1; c < m_SndFile.GetNumChannels(); c++, p++)
{
if(p->command == CMD_S3MCMDEX && (p->param & 0xF0) == 0xE0)
{
p->command = CMD_NONE;
}
}
}
} else if((nOldType & (MOD_TYPE_MOD | MOD_TYPE_XM)) && (nNewType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))
&& m->command == CMD_S3MCMDEX && (m->param & 0xF0) == 0xE0)
{
// Delete all commands left of the last command
auto p = m - 1;
for(CHANNELINDEX c = 0; c < chn; c++, p--)
{
if(p->command == CMD_S3MCMDEX && (p->param & 0xF0) == 0xE0)
{
p->command = CMD_NONE;
}
}
}
}
if(addBreak)
{
pat.WriteEffect(EffectWriter(CMD_PATTERNBREAK, 0).Row(pat.GetNumRows() - 1));
}
}
////////////////////////////////////////////////
// Converting instrument / sample / etc. data
// Do some sample conversion
const bool newTypeHasPingPongLoops = !(newTypeIsMOD || newTypeIsS3M);
for(SAMPLEINDEX smp = 1; smp <= m_SndFile.GetNumSamples(); smp++)
{
ModSample &sample = m_SndFile.GetSample(smp);
GetSampleUndo().PrepareUndo(smp, sundo_none, "Song Conversion");
// Too many samples? Only 31 samples allowed in MOD format...
if(newTypeIsMOD && smp > 31 && sample.nLength > 0)
{
warnings.set(wMOD31Samples);
}
// No auto-vibrato in MOD/S3M
if((newTypeIsMOD || newTypeIsS3M) && (sample.nVibDepth | sample.nVibRate | sample.nVibSweep) != 0)
{
warnings.set(wSampleAutoVibrato);
}
// No sustain loops for MOD/S3M/XM
bool ignoreLoopConversion = false;
if(newTypeIsMOD_XM || newTypeIsS3M)
{
// Sustain loops - convert to normal loops
if(sample.uFlags[CHN_SUSTAINLOOP])
{
warnings.set(wSampleSustainLoops);
// Prepare conversion to regular loop
if(!newTypeHasPingPongLoops)
{
ignoreLoopConversion = true;
if(!SampleEdit::ConvertPingPongLoop(sample, m_SndFile, true))
warnings.set(wSampleBidiLoops);
}
}
}
// No ping-pong loops in MOD/S3M
if(!ignoreLoopConversion && !newTypeHasPingPongLoops && sample.HasPingPongLoop())
{
if(!SampleEdit::ConvertPingPongLoop(sample, m_SndFile, false))
warnings.set(wSampleBidiLoops);
}
if(newTypeIsMOD && sample.RelativeTone != 0)
{
warnings.set(wMODSampleFrequency);
}
if(!CSoundFile::SupportsOPL(nNewType) && sample.uFlags[CHN_ADLIB])
{
warnings.set(wAdlibInstruments);
}
sample.Convert(nOldType, nNewType);
}
for(INSTRUMENTINDEX ins = 1; ins <= m_SndFile.GetNumInstruments(); ins++)
{
ModInstrument *pIns = m_SndFile.Instruments[ins];
if(pIns == nullptr)
{
continue;
}
// Convert IT/MPT to XM (fix instruments)
if(newTypeIsXM)
{
for(size_t i = 0; i < std::size(pIns->NoteMap); i++)
{
if (pIns->NoteMap[i] && pIns->NoteMap[i] != (i + 1))
{
warnings.set(wBrokenNoteMap);
break;
}
}
// Convert sustain loops to sustain "points"
if(pIns->VolEnv.nSustainStart != pIns->VolEnv.nSustainEnd)
{
warnings.set(wInstrumentSustainLoops);
}
if(pIns->PanEnv.nSustainStart != pIns->PanEnv.nSustainEnd)
{
warnings.set(wInstrumentSustainLoops);
}
}
// Convert MPT to anything - remove instrument tunings, Pitch/Tempo Lock, filter variation
if(oldTypeIsMPT)
{
if(pIns->pTuning != nullptr)
{
warnings.set(wInstrumentTuning);
}
if(pIns->pitchToTempoLock.GetRaw() != 0)
{
warnings.set(wPitchToTempoLock);
}
if((pIns->nCutSwing | pIns->nResSwing) != 0)
{
warnings.set(wFilterVariation);
}
}
pIns->Convert(nOldType, nNewType);
}
if(newTypeIsMOD)
{
// Not supported in MOD format
auto firstPat = std::find_if(m_SndFile.Order().cbegin(), m_SndFile.Order().cend(), [this](PATTERNINDEX pat) { return m_SndFile.Patterns.IsValidPat(pat); });
bool firstPatValid = firstPat != m_SndFile.Order().cend();
bool lossy = false;
if(m_SndFile.m_nDefaultSpeed != 6)
{
if(firstPatValid)
{
m_SndFile.Patterns[*firstPat].WriteEffect(EffectWriter(CMD_SPEED, ModCommand::PARAM(m_SndFile.m_nDefaultSpeed)).RetryNextRow());
}
m_SndFile.m_nDefaultSpeed = 6;
lossy = true;
}
if(m_SndFile.m_nDefaultTempo != TEMPO(125, 0))
{
if(firstPatValid)
{
m_SndFile.Patterns[*firstPat].WriteEffect(EffectWriter(CMD_TEMPO, ModCommand::PARAM(m_SndFile.m_nDefaultTempo.GetInt())).RetryNextRow());
}
m_SndFile.m_nDefaultTempo.Set(125);
lossy = true;
}
if(m_SndFile.m_nDefaultGlobalVolume != MAX_GLOBAL_VOLUME || m_SndFile.m_nSamplePreAmp != 48 || m_SndFile.m_nVSTiVolume != 48)
{
m_SndFile.m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME;
m_SndFile.m_nSamplePreAmp = 48;
m_SndFile.m_nVSTiVolume = 48;
lossy = true;
}
if(lossy)
{
warnings.set(wMODGlobalVars);
}
}
// Is the "restart position" value allowed in this format?
for(SEQUENCEINDEX seq = 0; seq < m_SndFile.Order.GetNumSequences(); seq++)
{
if(m_SndFile.Order(seq).GetRestartPos() > 0 && !specs.hasRestartPos)
{
// Try to fix it by placing a pattern jump command in the pattern.
if(!m_SndFile.Order.RestartPosToPattern(seq))
{
// Couldn't fix it! :(
warnings.set(wRestartPos);
}
}
}
// Fix channel settings (pan/vol)
for(CHANNELINDEX nChn = 0; nChn < GetNumChannels(); nChn++)
{
if(newTypeIsMOD_XM || newTypeIsS3M)
{
if(m_SndFile.ChnSettings[nChn].nVolume != 64 || m_SndFile.ChnSettings[nChn].dwFlags[CHN_SURROUND])
{
m_SndFile.ChnSettings[nChn].nVolume = 64;
m_SndFile.ChnSettings[nChn].dwFlags.reset(CHN_SURROUND);
warnings.set(wChannelVolSurround);
}
}
if(newTypeIsXM)
{
if(m_SndFile.ChnSettings[nChn].nPan != 128)
{
m_SndFile.ChnSettings[nChn].nPan = 128;
warnings.set(wChannelPanning);
}
}
}
// Check for patterns with custom time signatures (fixing will be applied in the pattern container)
if(!specs.hasPatternSignatures)
{
for(const auto &pat: m_SndFile.Patterns)
{
if(pat.GetOverrideSignature())
{
warnings.set(wPatternSignatures);
break;
}
}
}
// Check whether the new format supports embedding the edit history in the file.
if(oldTypeIsIT_MPT && !newTypeIsIT_MPT && GetSoundFile().GetFileHistory().size() > 0)
{
warnings.set(wEditHistory);
}
if((nOldType & MOD_TYPE_XM) && m_SndFile.m_playBehaviour[kFT2VolumeRamping])
{
warnings.set(wVolRamp);
}
CriticalSection cs;
m_SndFile.ChangeModTypeTo(nNewType);
// In case we need to update IT bidi loop handling pre-computation or loops got changed...
m_SndFile.PrecomputeSampleLoops(false);
// Song flags
if(!(specs.songFlags & SONG_LINEARSLIDES) && m_SndFile.m_SongFlags[SONG_LINEARSLIDES])
{
warnings.set(wLinearSlides);
}
if(oldTypeIsXM && newTypeIsIT_MPT)
{
m_SndFile.m_SongFlags.set(SONG_ITCOMPATGXX);
} else if(newTypeIsMOD && GetNumChannels() == 4 && onlyAmigaNotes)
{
m_SndFile.m_SongFlags.set(SONG_ISAMIGA);
m_SndFile.InitAmigaResampler();
}
m_SndFile.m_SongFlags &= (specs.songFlags | SONG_PLAY_FLAGS);
// Adjust mix levels
if(newTypeIsMOD || newTypeIsS3M)
{
m_SndFile.SetMixLevels(MixLevels::Compatible);
}
if(oldTypeIsMPT && m_SndFile.GetMixLevels() != MixLevels::Compatible && m_SndFile.GetMixLevels() != MixLevels::CompatibleFT2)
{
warnings.set(wMixmode);
}
if(!specs.hasFractionalTempo && m_SndFile.m_nDefaultTempo.GetFract() != 0)
{
m_SndFile.m_nDefaultTempo.Set(m_SndFile.m_nDefaultTempo.GetInt(), 0);
warnings.set(wFractionalTempo);
}
ChangeFileExtension(nNewType);
// Check mod specifications
Limit(m_SndFile.m_nDefaultTempo, specs.GetTempoMin(), specs.GetTempoMax());
Limit(m_SndFile.m_nDefaultSpeed, specs.speedMin, specs.speedMax);
for(INSTRUMENTINDEX i = 1; i <= m_SndFile.GetNumInstruments(); i++) if(m_SndFile.Instruments[i] != nullptr)
{
UpdateEnvelopes(m_SndFile.Instruments[i]->VolEnv, specs, warnings);
UpdateEnvelopes(m_SndFile.Instruments[i]->PanEnv, specs, warnings);
UpdateEnvelopes(m_SndFile.Instruments[i]->PitchEnv, specs, warnings);
}
// XM requires instruments, so we create them right away.
if(newTypeIsXM && GetNumInstruments() == 0)
{
ConvertSamplesToInstruments();
}
// XM has no global volume
if(newTypeIsXM && m_SndFile.m_nDefaultGlobalVolume != MAX_GLOBAL_VOLUME)
{
if(!GlobalVolumeToPattern())
{
warnings.set(wGlobalVolumeNotSupported);
}
}
// Resampling is only saved in MPTM
if(!newTypeIsMPT && m_SndFile.m_nResampling != SRCMODE_DEFAULT)
{
warnings.set(wResamplingMode);
m_SndFile.m_nResampling = SRCMODE_DEFAULT;
}
cs.Leave();
if(warnings[wResizedPatterns])
{
AddToLog(LogInformation, MPT_UFORMAT("{} patterns have been resized to 64 rows")(nResizedPatterns));
}
static constexpr struct
{
ConversionWarning warning;
const char *mesage;
} messages[] =
{
// Pattern warnings
{ wRestartPos, "Restart position is not supported by the new format." },
{ wPatternSignatures, "Pattern-specific time signatures are not supported by the new format." },
{ wChannelVolSurround, "Channel volume and surround are not supported by the new format." },
{ wChannelPanning, "Channel panning is not supported by the new format." },
// Sample warnings
{ wSampleBidiLoops, "Sample bidi loops are not supported by the new format." },
{ wSampleSustainLoops, "New format doesn't support sample sustain loops." },
{ wSampleAutoVibrato, "New format doesn't support sample autovibrato." },
{ wMODSampleFrequency, "Sample C-5 frequencies will be lost." },
{ wMOD31Samples, "Samples above 31 will be lost when saving as MOD. Consider rearranging samples if there are unused slots available." },
{ wAdlibInstruments, "OPL instruments are not supported by this format." },
// Instrument warnings
{ wInstrumentsToSamples, "All instruments have been converted to samples." },
{ wTrimmedEnvelopes, "Instrument envelopes have been shortened." },
{ wInstrumentSustainLoops, "Sustain loops were converted to sustain points." },
{ wInstrumentTuning, "Instrument tunings will be lost." },
{ wPitchToTempoLock, "Pitch / Tempo Lock instrument property is not supported by the new format." },
{ wBrokenNoteMap, "Instrument Note Mapping is not supported by the new format." },
{ wReleaseNode, "Instrument envelope release nodes are not supported by the new format." },
{ wFilterVariation, "Random filter variation is not supported by the new format." },
// General warnings
{ wMODGlobalVars, "Default speed, tempo and global volume will be lost." },
{ wLinearSlides, "Linear Frequency Slides not supported by the new format." },
{ wEditHistory, "Edit history will not be saved in the new format." },
{ wMixmode, "Consider setting the mix levels to \"Compatible\" in the song properties when working with legacy formats." },
{ wVolRamp, "Fasttracker 2 compatible super soft volume ramping gets lost when converting XM files to another type." },
{ wGlobalVolumeNotSupported, "Default global volume is not supported by the new format." },
{ wResamplingMode, "Song-specific resampling mode is not supported by the new format." },
{ wFractionalTempo, "Fractional tempo is not supported by the new format." },
};
for(const auto &msg : messages)
{
if(warnings[msg.warning])
AddToLog(LogInformation, mpt::ToUnicode(mpt::Charset::UTF8, msg.mesage));
}
SetModified();
GetPatternUndo().ClearUndo();
UpdateAllViews(nullptr, GeneralHint().General().ModType());
EndWaitCursor();
// Update effect key commands
CMainFrame::GetInputHandler()->SetEffectLetters(m_SndFile.GetModSpecifications());
return true;
}
OPENMPT_NAMESPACE_END
|