TracktionEngine
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::ProjectItem Class Reference

Represents a file-based resource that is used in a project. More...

Inheritance diagram for tracktion::engine::ProjectItem:

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 }
 
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(). More...
 
 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. More...
 
 ~ProjectItem () override
 
juce::String getSelectableDescription () override
 Subclasses must return a description of what they are. More...
 
void selectionStatusChanged (bool isNowSelected) override
 Can be overridden to tell this object that it has just been selected or deselected. More...
 
ProjectItemID getID () const noexcept
 
juce::ReferenceCountedObjectPtr< ProjectgetProject () 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 More...
 
void setMarkedPoints (const juce::Array< TimePosition > &points)
 
void copyAllPropertiesFrom (const ProjectItem &other)
 copies the full description, categories, properties, etc. More...
 
bool convertEditFile ()
 
double getLength () const
 
void setLength (double length)
 
juce::String getProjectName () const
 name of the project it's inside. More...
 
juce::File getEditPreviewFile () const
 Returns the file that should be used as a preview for this Edit. More...
 
juce::File getEditThumbnailFile () const
 Returns the file that should be used as a visual preview for this Edit. More...
 
juce::File getSourceFile ()
 
juce::String getRawFileName () const
 
juce::String getFileName () const
 
void setSourceFile (const juce::File &)
 
bool isForFile (const juce::File &)
 
void renameSourceFile ()
 lets the user rename the file. More...
 
Ptr createCopy ()
 Creates a copy of this object and returns the copy. More...
 
void sendChange ()
 
bool copySectionToNewFile (const juce::File &destFile, juce::File &actualFileCreated, double startTime, double length)
 the actual file created may differ, e.g. More...
 
bool deleteSourceFile ()
 
void verifyLength ()
 Updates the stored length value in this object. More...
 
void changeProjectId (int oldID, int newID)
 used when moving to another project. More...
 
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. More...
 
- 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. More...
 
virtual void selectableAboutToBeDeleted ()
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. More...
 
void addSelectableListener (SelectableListener *)
 
void removeSelectableListener (SelectableListener *)
 
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions. More...
 
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. More...
 

Public Attributes

Engineengine
 The Engine instance this belongs to. More...
 
- Public Attributes inherited from tracktion::engine::Selectable
WeakRef::Master masterReference
 

Detailed Description

Represents a file-based resource that is used in a project.

This might be an edit, audio file, midi file, etc.

Member Typedef Documentation

◆ Ptr

using tracktion::engine::ProjectItem::Ptr = juce::ReferenceCountedObjectPtr<ProjectItem>

◆ Array

using tracktion::engine::ProjectItem::Array = juce::ReferenceCountedArray<ProjectItem>

Member Enumeration Documentation

◆ Category

Enumerator
none 
edit 
recorded 
exports 
archives 
imported 
rendered 
frozen 
video 

◆ RenameMode

Enumerator
always 
local 
never 

◆ SetNameMode

Enumerator
doDefault 
forceRename 
forceNoRename 

Constructor & Destructor Documentation

◆ ProjectItem() [1/2]

tracktion::engine::ProjectItem::ProjectItem ( Engine ,
ProjectItemID  ,
juce::InputStream *   
)

Loads a ProjectItem from a stream that was saved using writeToStream().

◆ ProjectItem() [2/2]

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.

◆ ~ProjectItem()

tracktion::engine::ProjectItem::~ProjectItem ( )
override

Member Function Documentation

◆ getSelectableDescription()

juce::String tracktion::engine::ProjectItem::getSelectableDescription ( )
overridevirtual

Subclasses must return a description of what they are.

Implements tracktion::engine::Selectable.

◆ selectionStatusChanged()

void tracktion::engine::ProjectItem::selectionStatusChanged ( bool  isNowSelected)
overridevirtual

Can be overridden to tell this object that it has just been selected or deselected.

Reimplemented from tracktion::engine::Selectable.

◆ getID()

ProjectItemID tracktion::engine::ProjectItem::getID ( ) const
noexcept

◆ getProject()

juce::ReferenceCountedObjectPtr<Project> tracktion::engine::ProjectItem::getProject ( ) const

◆ hasBeenDeleted()

bool tracktion::engine::ProjectItem::hasBeenDeleted ( ) const

◆ waveItemType()

static const char* tracktion::engine::ProjectItem::waveItemType ( )
staticnoexcept

Referenced by isWave().

◆ editItemType()

static const char* tracktion::engine::ProjectItem::editItemType ( )
staticnoexcept

Referenced by isEdit().

◆ midiItemType()

static const char* tracktion::engine::ProjectItem::midiItemType ( )
staticnoexcept

Referenced by isMidi().

◆ videoItemType()

static const char* tracktion::engine::ProjectItem::videoItemType ( )
staticnoexcept

Referenced by isVideo().

◆ getType()

const juce::String& tracktion::engine::ProjectItem::getType ( ) const

Referenced by isEdit(), isMidi(), isVideo(), and isWave().

◆ isWave()

bool tracktion::engine::ProjectItem::isWave ( ) const
noexcept

References getType(), and waveItemType().

◆ isMidi()

bool tracktion::engine::ProjectItem::isMidi ( ) const
noexcept

References getType(), and midiItemType().

◆ isEdit()

bool tracktion::engine::ProjectItem::isEdit ( ) const
noexcept

References editItemType(), and getType().

◆ isVideo()

bool tracktion::engine::ProjectItem::isVideo ( ) const
noexcept

References getType(), and videoItemType().

◆ getName()

const juce::String& tracktion::engine::ProjectItem::getName ( ) const

◆ setName()

void tracktion::engine::ProjectItem::setName ( const juce::String &  name,
SetNameMode  mode 
)

◆ getCategory()

Category tracktion::engine::ProjectItem::getCategory ( ) const

◆ setCategory()

void tracktion::engine::ProjectItem::setCategory ( Category  cat)

◆ getNamedProperty()

juce::String tracktion::engine::ProjectItem::getNamedProperty ( const juce::String &  name) const

◆ setNamedProperty()

void tracktion::engine::ProjectItem::setNamedProperty ( const juce::String &  name,
const juce::String &  value 
)

◆ getDescription()

juce::String tracktion::engine::ProjectItem::getDescription ( ) const

◆ setDescription()

void tracktion::engine::ProjectItem::setDescription ( const juce::String &  newDesc)

◆ getMarkedPoints()

juce::Array<TimePosition> tracktion::engine::ProjectItem::getMarkedPoints ( ) const

optional set of interesting time markers, for wave files

◆ setMarkedPoints()

void tracktion::engine::ProjectItem::setMarkedPoints ( const juce::Array< TimePosition > &  points)

◆ copyAllPropertiesFrom()

void tracktion::engine::ProjectItem::copyAllPropertiesFrom ( const ProjectItem other)

copies the full description, categories, properties, etc.

◆ convertEditFile()

bool tracktion::engine::ProjectItem::convertEditFile ( )

◆ getLength()

double tracktion::engine::ProjectItem::getLength ( ) const

◆ setLength()

void tracktion::engine::ProjectItem::setLength ( double  length)

◆ getProjectName()

juce::String tracktion::engine::ProjectItem::getProjectName ( ) const

name of the project it's inside.

◆ getEditPreviewFile()

juce::File tracktion::engine::ProjectItem::getEditPreviewFile ( ) const

Returns the file that should be used as a preview for this Edit.

◆ getEditThumbnailFile()

juce::File tracktion::engine::ProjectItem::getEditThumbnailFile ( ) const

Returns the file that should be used as a visual preview for this Edit.

◆ getSourceFile()

juce::File tracktion::engine::ProjectItem::getSourceFile ( )

◆ getRawFileName()

juce::String tracktion::engine::ProjectItem::getRawFileName ( ) const

◆ getFileName()

juce::String tracktion::engine::ProjectItem::getFileName ( ) const

◆ setSourceFile()

void tracktion::engine::ProjectItem::setSourceFile ( const juce::File &  )

◆ isForFile()

bool tracktion::engine::ProjectItem::isForFile ( const juce::File &  )

◆ renameSourceFile()

void tracktion::engine::ProjectItem::renameSourceFile ( )

lets the user rename the file.

◆ createCopy()

Ptr tracktion::engine::ProjectItem::createCopy ( )

Creates a copy of this object and returns the copy.

◆ sendChange()

void tracktion::engine::ProjectItem::sendChange ( )

◆ copySectionToNewFile()

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.

◆ deleteSourceFile()

bool tracktion::engine::ProjectItem::deleteSourceFile ( )

◆ verifyLength()

void tracktion::engine::ProjectItem::verifyLength ( )

Updates the stored length value in this object.

◆ changeProjectId()

void tracktion::engine::ProjectItem::changeProjectId ( int  oldID,
int  newID 
)

used when moving to another project.

◆ writeToStream()

void tracktion::engine::ProjectItem::writeToStream ( juce::OutputStream &  ) const

◆ getSearchTokens()

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.

Member Data Documentation

◆ engine

Engine& tracktion::engine::ProjectItem::engine

The Engine instance this belongs to.


The documentation for this class was generated from the following file: