|
TracktionEngine
|
Represents a file-based resource that is used in a project. More...
#include <tracktion_ProjectItem.h>
Public Types | |
| enum class | Category { none , edit , recorded , exports , archives , imported , rendered , frozen , video } |
| enum class | RenameMode { always , local , never } |
| enum class | SetNameMode { doDefault , forceRename , forceNoRename } |
| enum class | FileMode { absolute , relative , relativeIfWithinProject } |
| using | Ptr = juce::ReferenceCountedObjectPtr< ProjectItem > |
| using | Array = juce::ReferenceCountedArray< ProjectItem > |
Public Types inherited from tracktion::engine::Selectable | |
| using | WeakRef = juce::WeakReference< Selectable > |
Public Member Functions | |
| ProjectItem (Engine &, ProjectItemID, juce::InputStream *) | |
| Loads a ProjectItem from a stream that was saved using writeToStream(). | |
| ProjectItem (Engine &, const juce::String &name, const juce::String &type, const juce::String &desc, const juce::String &file, Category, double length, ProjectItemID) | |
| Creates a ProjectItem with some settings. | |
| ~ProjectItem () override | |
| juce::String | getSelectableDescription () override |
| Subclasses must return a description of what they are. | |
| void | selectionStatusChanged (bool isNowSelected) override |
| Can be overridden to tell this object that it has just been selected or deselected. | |
| ProjectItemID | getID () const noexcept |
| juce::ReferenceCountedObjectPtr< Project > | getProject () const |
| bool | hasBeenDeleted () const |
| const juce::String & | getType () const |
| bool | isWave () const noexcept |
| bool | isMidi () const noexcept |
| bool | isEdit () const noexcept |
| bool | isVideo () const noexcept |
| const juce::String & | getName () const |
| void | setName (const juce::String &name, SetNameMode mode) |
| Category | getCategory () const |
| void | setCategory (Category cat) |
| juce::String | getNamedProperty (const juce::String &name) const |
| void | setNamedProperty (const juce::String &name, const juce::String &value) |
| juce::String | getDescription () const |
| void | setDescription (const juce::String &newDesc) |
| juce::Array< TimePosition > | getMarkedPoints () const |
| optional set of interesting time markers, for wave files | |
| void | setMarkedPoints (const juce::Array< TimePosition > &points) |
| void | copyAllPropertiesFrom (const ProjectItem &other) |
| copies the full description, categories, properties, etc. | |
| bool | convertEditFile () |
| double | getLength () const |
| void | setLength (double length) |
| juce::String | getProjectName () const |
| name of the project it's inside. | |
| juce::File | getEditPreviewFile () const |
| Returns the file that should be used as a preview for this Edit. | |
| juce::File | getEditThumbnailFile () const |
| Returns the file that should be used as a visual preview for this Edit. | |
| juce::File | getSourceFile () |
| juce::String | getRawFileName () const |
| juce::String | getFileName () const |
| void | setSourceFile (const juce::File &, FileMode mode=FileMode::relativeIfWithinProject) |
| bool | isForFile (const juce::File &) |
| bool | isAbsolutePath () const |
| void | convertToRelativePath () |
| void | convertToAbsolutePath () |
| void | renameSourceFile () |
| lets the user rename the file. | |
| Ptr | createCopy () |
| Creates a copy of this object and returns the copy. | |
| void | sendChange () |
| bool | copySectionToNewFile (const juce::File &destFile, juce::File &actualFileCreated, double startTime, double length) |
| the actual file created may differ, e.g. | |
| bool | deleteSourceFile () |
| void | verifyLength () |
| Updates the stored length value in this object. | |
| void | changeProjectId (int oldID, int newID) |
| used when moving to another project. | |
| void | writeToStream (juce::OutputStream &) const |
| juce::StringArray | getSearchTokens () const |
| Returns a list of search strings for this object, by chopping up the name and description into words. | |
Public Member Functions inherited from tracktion::engine::Selectable | |
| Selectable () | |
| virtual | ~Selectable () |
| virtual void | changed () |
| This should be called to send a change notification to any SelectableListeners that are registered with this object. | |
| virtual void | selectableAboutToBeDeleted () |
| Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. | |
| void | addListener (SelectableListener *) |
| void | removeListener (SelectableListener *) |
| void | addSelectableListener (SelectableListener *) |
| void | removeSelectableListener (SelectableListener *) |
| void | cancelAnyPendingUpdates () |
| If changed() has been called, this will cancel any pending async change notificaions. | |
| void | deselect () |
| void | propertiesChanged () |
| void | notifyListenersOfDeletion () |
| WeakRef | getWeakRef () |
Static Public Member Functions | |
| static const char * | waveItemType () noexcept |
| static const char * | editItemType () noexcept |
| static const char * | midiItemType () noexcept |
| static const char * | videoItemType () noexcept |
Static Public Member Functions inherited from tracktion::engine::Selectable | |
| static void | initialise () |
| static bool | isSelectableValid (const Selectable *) noexcept |
| checks whether this object has been deleted. | |
Public Attributes | |
| Engine & | engine |
| The Engine instance this belongs to. | |
Public Attributes inherited from tracktion::engine::Selectable | |
| WeakRef::Master | masterReference |
Represents a file-based resource that is used in a project.
This might be an edit, audio file, midi file, etc.
| using tracktion::engine::ProjectItem::Ptr = juce::ReferenceCountedObjectPtr<ProjectItem> |
| using tracktion::engine::ProjectItem::Array = juce::ReferenceCountedArray<ProjectItem> |
| tracktion::engine::ProjectItem::ProjectItem | ( | Engine & | , |
| ProjectItemID | , | ||
| juce::InputStream * | |||
| ) |
Loads a ProjectItem from a stream that was saved using writeToStream().
| tracktion::engine::ProjectItem::ProjectItem | ( | Engine & | , |
| const juce::String & | name, | ||
| const juce::String & | type, | ||
| const juce::String & | desc, | ||
| const juce::String & | file, | ||
| Category | , | ||
| double | length, | ||
| ProjectItemID | |||
| ) |
Creates a ProjectItem with some settings.
|
override |
|
overridevirtual |
Subclasses must return a description of what they are.
Implements tracktion::engine::Selectable.
Can be overridden to tell this object that it has just been selected or deselected.
Reimplemented from tracktion::engine::Selectable.
|
noexcept |
| juce::ReferenceCountedObjectPtr< Project > tracktion::engine::ProjectItem::getProject | ( | ) | const |
| bool tracktion::engine::ProjectItem::hasBeenDeleted | ( | ) | const |
Referenced by isWave().
Referenced by isEdit().
Referenced by isMidi().
Referenced by isVideo().
| const juce::String & tracktion::engine::ProjectItem::getType | ( | ) | const |
|
noexcept |
References getType(), and waveItemType().
|
noexcept |
References getType(), and midiItemType().
|
noexcept |
References editItemType(), and getType().
|
noexcept |
References getType(), and videoItemType().
| const juce::String & tracktion::engine::ProjectItem::getName | ( | ) | const |
| void tracktion::engine::ProjectItem::setName | ( | const juce::String & | name, |
| SetNameMode | mode | ||
| ) |
| Category tracktion::engine::ProjectItem::getCategory | ( | ) | const |
| juce::String tracktion::engine::ProjectItem::getNamedProperty | ( | const juce::String & | name | ) | const |
| void tracktion::engine::ProjectItem::setNamedProperty | ( | const juce::String & | name, |
| const juce::String & | value | ||
| ) |
| juce::String tracktion::engine::ProjectItem::getDescription | ( | ) | const |
| juce::Array< TimePosition > tracktion::engine::ProjectItem::getMarkedPoints | ( | ) | const |
optional set of interesting time markers, for wave files
| void tracktion::engine::ProjectItem::setMarkedPoints | ( | const juce::Array< TimePosition > & | points | ) |
| void tracktion::engine::ProjectItem::copyAllPropertiesFrom | ( | const ProjectItem & | other | ) |
copies the full description, categories, properties, etc.
| bool tracktion::engine::ProjectItem::convertEditFile | ( | ) |
| double tracktion::engine::ProjectItem::getLength | ( | ) | const |
| juce::String tracktion::engine::ProjectItem::getProjectName | ( | ) | const |
name of the project it's inside.
| juce::File tracktion::engine::ProjectItem::getEditPreviewFile | ( | ) | const |
Returns the file that should be used as a preview for this Edit.
| juce::File tracktion::engine::ProjectItem::getEditThumbnailFile | ( | ) | const |
Returns the file that should be used as a visual preview for this Edit.
| juce::File tracktion::engine::ProjectItem::getSourceFile | ( | ) |
| juce::String tracktion::engine::ProjectItem::getRawFileName | ( | ) | const |
| juce::String tracktion::engine::ProjectItem::getFileName | ( | ) | const |
| void tracktion::engine::ProjectItem::setSourceFile | ( | const juce::File & | , |
| FileMode | mode = FileMode::relativeIfWithinProject |
||
| ) |
| bool tracktion::engine::ProjectItem::isAbsolutePath | ( | ) | const |
| void tracktion::engine::ProjectItem::convertToRelativePath | ( | ) |
| void tracktion::engine::ProjectItem::convertToAbsolutePath | ( | ) |
| void tracktion::engine::ProjectItem::renameSourceFile | ( | ) |
lets the user rename the file.
| Ptr tracktion::engine::ProjectItem::createCopy | ( | ) |
Creates a copy of this object and returns the copy.
| void tracktion::engine::ProjectItem::sendChange | ( | ) |
| bool tracktion::engine::ProjectItem::copySectionToNewFile | ( | const juce::File & | destFile, |
| juce::File & | actualFileCreated, | ||
| double | startTime, | ||
| double | length | ||
| ) |
the actual file created may differ, e.g.
if an ogg file is chopped up and has to become a wav.
| bool tracktion::engine::ProjectItem::deleteSourceFile | ( | ) |
| void tracktion::engine::ProjectItem::verifyLength | ( | ) |
Updates the stored length value in this object.
used when moving to another project.
| void tracktion::engine::ProjectItem::writeToStream | ( | juce::OutputStream & | ) | const |
| juce::StringArray tracktion::engine::ProjectItem::getSearchTokens | ( | ) | const |
Returns a list of search strings for this object, by chopping up the name and description into words.