View Issue Details
|have not tried
|OpenMPT 1.?? (long term goals)
|0001456: Rethink mod conversion
Currently, converting between various module formats can have surprising results, e.g. when invoking Undo. It's probably known to most users that this kind of conversion is almost always lossy, but the results can still be surprising.
Alternative approaches should be explored, e.g. always creating a new CModDoc as a result of a format change. This way, the old module would stay open and editable, and the user can more easily compare what has changed. If a conversion is more lossy than the user expected, they can still easily go back to the previous state even if they forgot to save the file before conversion. Technically this approach would require some refactoring because many objects cannot simply be copied between different CSoundFiles.
|No tags attached.
|Has the bug occurred in previous versions?
|Tested code revision (in case you know it)
The logical step would be to implement a working copy-constructor for CSoundFile, and nothing else. Then, nothing of the existing conversion code would even need to be touched.
One important thing to keep in mind is that plugins cannot simply be "copied"; their state has to be serialized, a new instance has to be created and then the state needs to be unserialized again. As this is a non-const operation on the copied-from object, and a potentially expensive one, this should probably be rather implemented as a member function than as an actual copy constructor. Alternatively, the copy constructor wouldn't try copying over plugin state, and also not instantiate any of the copied-over plugins, and it would be the responsibility of the caller to do both.
|Note Added: 0004758
|related to 0001112
|=> OpenMPT 1.?? (long term goals)
|Note Added: 0004894
|related to 0001544