mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-17 19:24:52 -04:00
Feature: Pattern import/export (#5891)
* Init * Suggested changes by @IanCaio, thanks! * Selecting one file to import is enough. * Explicit use of TimePos in favour of int where expected, as suggested. * Make pattern import/export future proof with using DataFile instead of custom code to read/write the pattern file. * Remove unused/duplicate imports * Make import/export dialogs file-ext filter consistent. Co-authored-by: CYBERDEViL <cyberdevil@notabug.org>
This commit is contained in:
@@ -83,7 +83,8 @@ DataFile::typeDescStruct
|
||||
{ DataFile::DragNDropData, "dnddata" },
|
||||
{ DataFile::ClipboardData, "clipboard-data" },
|
||||
{ DataFile::JournalData, "journaldata" },
|
||||
{ DataFile::EffectSettings, "effectsettings" }
|
||||
{ DataFile::EffectSettings, "effectsettings" },
|
||||
{ DataFile::NotePattern, "pattern" }
|
||||
} ;
|
||||
|
||||
|
||||
@@ -185,6 +186,12 @@ bool DataFile::validate( QString extension )
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Type::NotePattern:
|
||||
if (extension == "xpt" || extension == "xptz")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case Type::UnknownType:
|
||||
if (! ( extension == "mmp" || extension == "mpt" || extension == "mmpz" ||
|
||||
extension == "xpf" || extension == "xml" ||
|
||||
@@ -286,7 +293,8 @@ bool DataFile::writeFile( const QString& filename )
|
||||
return false;
|
||||
}
|
||||
|
||||
if( fullName.section( '.', -1 ) == "mmpz" )
|
||||
const QString extension = fullName.section('.', -1);
|
||||
if (extension == "mmpz" || extension == "xptz")
|
||||
{
|
||||
QString xml;
|
||||
QTextStream ts( &xml );
|
||||
|
||||
Reference in New Issue
Block a user