Lumiera  0.pre.03
»edit your freedom«
MediaFactory Class Reference

#include "steam/asset/media.hpp"

Description

Factory specialised for creating Media Asset objects.

Definition at line 134 of file media.hpp.

Public Types

typedef lib::P< MediaPType
 

Public Member Functions

PType operator() (Asset::Ident &key, const string &file="")
 Factory method for Media Asset instances. More...
 
PType operator() (const string &file, const Category &cat)
 Variant of the Factory method for Media Assets, automatically providing most of the Asset key fields based on the filename given.
 
PType operator() (const string &file, asset::Kind)
 
PType operator() (Asset::Ident &key, const char *file)
 convenience overload using C-String
 
PType operator() (const char *file, const Category &cat)
 
PType operator() (const char *file, asset::Kind)
 
lib::P< Clipoperator() (Media &mediaref)
 Factory method for creating a Clip asset based on the given Media asset. More...
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Member Function Documentation

◆ operator()() [1/2]

MediaFactory::PType operator() ( Asset::Ident key,
const string &  file = "" 
)

Factory method for Media Asset instances.

Depending on the filename given, either a asset::Media object or an "Unknown" placeholder will be provided. If the given Category already contains an "Unkown", we just get the corresponding smart-ptr. Otherwise a new asset::Unknown is created.

Exceptions
error::Invalidwhen media file is inaccessible or inappropriate
Returns
an Media smart ptr linked to the internally registered smart ptr created as a side effect of calling the concrete Media subclass ctor.

Definition at line 142 of file media.cpp.

References AssetManager::instance.

Referenced by MediaFactory::operator()().

+ Here is the caller graph for this function:

◆ operator()() [2/2]

lib::P< Clip > operator() ( Media mediaref)

Factory method for creating a Clip asset based on the given Media asset.

This asset::Clip can be used to create a clip in the session covering the whole length of this media.

Note
creates a dependency between media and new clip
Exceptions
Invalidif the given media asset is not top-level, but rather part or a multichannel (compound) media

Definition at line 228 of file media.cpp.

References Media::checkCompound(), AssetManager::instance, and LUMIERA_ERROR_DEFINE.

+ Here is the call graph for this function:
+ Inheritance diagram for MediaFactory:
+ Collaboration diagram for MediaFactory:

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