|
TracktionEngine
|
This class wraps a string that is generally held in a 'source' property, and which is a reference to some sort of file, either in the form of a local filename or as a project ID that can be resolved. More...
#include <tracktion_SourceFileReference.h>
Public Types | |
| enum class | PathStyle { chooseBest , alwaysRelative , alwaysAbsolute } |
Public Member Functions | |
| SourceFileReference (Edit &, juce::ValueTree &, const juce::Identifier &prop) | |
| ~SourceFileReference () | |
| juce::File | getFile () const |
| bool | isUsingProjectReference () const |
| ProjectItemRef | getSourceProjectItemRef () const |
| ProjectItem::Ptr | getSourceProjectItem () const |
| void | setToFile (const juce::File &, PathStyle, bool allowProjectItems) |
| Sets this source to reference the given file. | |
| void | setToProjectFileReference (ProjectItemRef) |
Static Public Member Functions | |
| static juce::String | findPathFromFile (Edit &, const juce::File &, bool useRelativePath) |
| static juce::File | findFileFromString (Edit &, const juce::String &source) |
Public Attributes | |
| Edit & | edit |
| juce::CachedValue< juce::String > | source |
This class wraps a string that is generally held in a 'source' property, and which is a reference to some sort of file, either in the form of a local filename or as a project ID that can be resolved.
|
strong |
| engine::SourceFileReference::SourceFileReference | ( | Edit & | , |
| juce::ValueTree & | , | ||
| const juce::Identifier & | prop ) |
Referenced by findFileFromString().
| engine::SourceFileReference::~SourceFileReference | ( | ) |
| juce::File engine::SourceFileReference::getFile | ( | ) | const |
| bool engine::SourceFileReference::isUsingProjectReference | ( | ) | const |
| ProjectItemRef engine::SourceFileReference::getSourceProjectItemRef | ( | ) | const |
| ProjectItem::Ptr engine::SourceFileReference::getSourceProjectItem | ( | ) | const |
| void engine::SourceFileReference::setToFile | ( | const juce::File & | , |
| PathStyle | , | ||
| bool | allowProjectItems ) |
Sets this source to reference the given file.
If allowProjectItems is true and the edit is in a file-based project, finds or creates a ProjectItem. Otherwise stores a direct file path using the given PathStyle.
| void engine::SourceFileReference::setToProjectFileReference | ( | ProjectItemRef | ) |
|
static |
|
static |
References source, and SourceFileReference().
| Edit& engine::SourceFileReference::edit |
| juce::CachedValue<juce::String> engine::SourceFileReference::source |
Referenced by findFileFromString().