|
LMMS
|
#include <DataFile.h>
Public Types | |
| enum class | Type { Unknown , SongProject , SongProjectTemplate , InstrumentTrackSettings , DragNDropData , ClipboardData , JournalData , EffectSettings , MidiClip } |
Public Member Functions | |
| DataFile (const QString &fileName) | |
| DataFile (const QByteArray &data) | |
| DataFile (Type type) | |
| virtual | ~DataFile ()=default |
| bool | validate (QString extension) |
| validate performs basic validation, compared to file extension. | |
| QString | nameWithExtension (const QString &fn) const |
| void | write (QTextStream &strm) |
| bool | writeFile (const QString &fn, bool withResources=false) |
| bool | copyResources (const QString &resourcesDir) |
| Copies resources to the resourcesDir and changes the DataFile to use local paths to them. | |
| bool | hasLocalPlugins (QDomElement parent=QDomElement(), bool firstCall=true) const |
| This recursive method will go through all XML nodes of the DataFile and check whether any of them have local paths. If they are not on our list of elements that can have local paths we return true, indicating that we potentially have plugins with local paths that would be a security issue. The Song class can then abort loading this project. | |
| QDomElement & | content () |
| QDomElement & | head () |
| Type | type () const |
| unsigned int | legacyFileVersion () |
Private Types | |
| using | UpgradeMethod = void(DataFile::*)() |
| using | ResourcesMap = std::map<QString, std::vector<QString>> |
Static Private Member Functions | |
| static Type | type (const QString &typeName) |
| static QString | typeName (Type type) |
Private Attributes | |
| QString | m_fileName |
| The origin file name or "" if this DataFile didn't originate from a file. | |
| QDomElement | m_content |
| QDomElement | m_head |
| Type | m_type |
| unsigned int | m_fileVersion |
Static Private Attributes | |
| static const std::vector< UpgradeMethod > | UPGRADE_METHODS |
| static const std::vector< ProjectVersion > | UPGRADE_VERSIONS |
| static const ResourcesMap | ELEMENTS_WITH_RESOURCES |
|
private |
|
private |
|
strong |
| lmms::DataFile::DataFile | ( | const QString & | fileName | ) |
| lmms::DataFile::DataFile | ( | const QByteArray & | data | ) |
| lmms::DataFile::DataFile | ( | Type | type | ) |
|
virtualdefault |
|
private |
|
inline |
| bool lmms::DataFile::copyResources | ( | const QString & | resourcesDir | ) |
Copies resources to the resourcesDir and changes the DataFile to use local paths to them.
|
private |
| bool lmms::DataFile::hasLocalPlugins | ( | QDomElement | parent = QDomElement(), |
| bool | firstCall = true ) const |
This recursive method will go through all XML nodes of the DataFile and check whether any of them have local paths. If they are not on our list of elements that can have local paths we return true, indicating that we potentially have plugins with local paths that would be a security issue. The Song class can then abort loading this project.
| parent | The parent node being iterated. When called without arguments, this will be an empty element that will be ignored (since the second parameter will be true). |
| firstCall | Defaults to true, and indicates to this recursive method whether this is the first call. If it is it will use the root element as the parent. |
|
inline |
| unsigned int lmms::DataFile::legacyFileVersion | ( | ) |
|
private |
| QString lmms::DataFile::nameWithExtension | ( | const QString & | fn | ) | const |
|
inline |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
TripleOscillator switched to using high-quality, alias-free oscillators by default.
Older projects were made without this feature and would sound differently if loaded with the new default setting. This upgrade routine preserves their old behavior.
|
private |
Note range has been extended to match MIDI specification.
The non-standard note range previously affected all MIDI-based instruments except OpulenZ, and made them sound an octave lower than they should (#1857).
|
private |
|
private |
|
private |
|
private |
Update MIDI CC indexes, so that they are counted from 0. Older releases of LMMS count the CCs from 1.
|
private |
|
private |
|
private |
|
private |
|
private |
| bool lmms::DataFile::validate | ( | QString | extension | ) |
validate performs basic validation, compared to file extension.
| void lmms::DataFile::write | ( | QTextStream & | strm | ) |
|
staticprivate |
|
private |
|
private |
The origin file name or "" if this DataFile didn't originate from a file.
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |