View Issue Details

IDProjectCategoryView StatusLast Update
0001456OpenMPTGeneralpublic2022-01-09 13:31
ReporterSaga Musix Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Target VersionOpenMPT 1.?? (long term goals) 
Summary0001456: Rethink mod conversion
Description

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.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

related to 0001112 acknowledgedmanx Properly report and handle out-of-memory 
related to 0001544 resolvedSaga Musix Sample sustain loop fields are greyed out for Digital Symphony modules. 

Activities

manx

manx

2021-05-06 17:13

administrator   ~0004758

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.
Implementing a working copy-constructor basically implies having working copy-constructors for all sub-objects.
I somewhat doubt any refactoring not strictly directed into this direction would be all that useful in the end.

Saga Musix

Saga Musix

2021-11-02 20:28

administrator   ~0004894

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.

Issue History

Date Modified Username Field Change
2021-05-06 17:07 Saga Musix New Issue
2021-05-06 17:13 manx Note Added: 0004758
2021-05-06 17:13 manx Relationship added related to 0001112
2021-05-06 17:14 manx Target Version => OpenMPT 1.?? (long term goals)
2021-11-02 20:28 Saga Musix Note Added: 0004894
2022-01-09 13:31 Saga Musix Relationship added related to 0001544