gi-ges-1.0.4: libges bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GES.Objects.Project

Description

The Project is used to control a set of Asset and is a Asset with GES_TYPE_TIMELINE as extractableType itself. That means that you can extract Timeline from a project as followed:

GESProject *project;
GESTimeline *timeline;

project = ges_project_new ("file:///path/to/a/valid/project/uri");

// Here you can connect to the various signal to get more infos about
// what is happening and recover from errors if possible
...

timeline = ges_asset_extract (GES_ASSET (project));

The Project class offers a higher level API to handle Asset-s. It lets you request new asset, and it informs you about new assets through a set of signals. Also it handles problem such as missing files/missing Element and lets you try to recover from those.

Subprojects

In order to add a subproject, the only thing to do is to add the subproject to the main project:

c code

ges_project_add_asset (project, GES_ASSET (subproject));

then the subproject will be serialized in the project files. To use the subproject in a timeline, you should use a UriClip with the same subproject URI.

When loading a project with subproject, subprojects URIs will be temporary writable local files. If you want to edit the subproject timeline, you should retrieve the subproject from the parent project asset list and extract the timeline with assetExtract and save it at the same temporary location.

Synopsis

Exported types

newtype Project Source #

Memory-managed wrapper type.

Constructors

Project (ManagedPtr Project) 

Instances

Instances details
Eq Project Source # 
Instance details

Defined in GI.GES.Objects.Project

Methods

(==) :: Project -> Project -> Bool #

(/=) :: Project -> Project -> Bool #

GObject Project Source # 
Instance details

Defined in GI.GES.Objects.Project

ManagedPtrNewtype Project Source # 
Instance details

Defined in GI.GES.Objects.Project

Methods

toManagedPtr :: Project -> ManagedPtr Project

TypedObject Project Source # 
Instance details

Defined in GI.GES.Objects.Project

Methods

glibType :: IO GType

HasParentTypes Project Source # 
Instance details

Defined in GI.GES.Objects.Project

IsGValue (Maybe Project) Source #

Convert Project to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GES.Objects.Project

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Project -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Project)

type ParentTypes Project Source # 
Instance details

Defined in GI.GES.Objects.Project

type ParentTypes Project = '[Asset, Object, MetaContainer, AsyncInitable, Initable]

class (GObject o, IsDescendantOf Project o) => IsProject o Source #

Type class for types which can be safely cast to Project, for instance with toProject.

Instances

Instances details
(GObject o, IsDescendantOf Project o) => IsProject o Source # 
Instance details

Defined in GI.GES.Objects.Project

toProject :: (MonadIO m, IsProject o) => o -> m Project Source #

Cast to Project, for types for which this is known to be safe. For general casts, use castTo.

Methods

addAsset

projectAddAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a, IsAsset b) 
=> a

project: A Project

-> b

asset: A Asset to add to project

-> m Bool

Returns: True if the asset could be added False it was already in the project

Adds a Asset to project, the project will keep a reference on asset.

addEncodingProfile

projectAddEncodingProfile Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a, IsEncodingProfile b) 
=> a

project: A Project

-> b

profile: A EncodingProfile to add to the project. If a profile with the same name already exists, it will be replaced

-> m Bool

Returns: True if profile could be added, False otherwize

Adds profile to the project. It lets you save in what format the project has been renders and keep a reference to those formats. Also, those formats will be saves to the project file when possible.

addFormatter

projectAddFormatter Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a, IsFormatter b) 
=> a

project: The project to add a formatter to

-> b

formatter: A formatter used by project

-> m () 

Adds a formatter as used to load project

Since: 1.18

createAsset

projectCreateAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> Maybe Text

id: The id of the asset to create and add to project

-> GType

extractableType: The GType of the asset to create

-> m Bool

Returns: True if the asset started to be added False it was already in the project

Create and add a Asset to project. You should connect to the "asset-added" signal to get the asset when it finally gets added to project

createAssetSync

projectCreateAssetSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> Maybe Text

id: The id of the asset to create and add to project

-> GType

extractableType: The GType of the asset to create

-> m (Maybe Asset)

Returns: The newly created Asset or Nothing. (Can throw GError)

Create and add a Asset to project. You should connect to the "asset-added" signal to get the asset when it finally gets added to project

getAsset

projectGetAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> Text

id: The id of the asset to retrieve

-> GType

extractableType: The extractable_type of the asset to retrieve from object

-> m (Maybe Asset)

Returns: The Asset with id or Nothing if no asset with id as an ID

No description available in the introspection data.

getLoadingAssets

projectGetLoadingAssets Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> m [Asset]

Returns: A set of loading asset that will be added to project. Note that those Asset are *not* loaded yet, and thus can not be used

Get the assets that are being loaded

getUri

projectGetUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> m (Maybe Text)

Returns: a newly allocated string representing uri.

Retrieve the uri that is currently set on project

listAssets

projectListAssets Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> GType

filter: Type of assets to list, GES_TYPE_EXTRACTABLE will list all assets

-> m [Asset]

Returns: The list of Asset the object contains

List all asset contained in project filtering per extractable_type as defined by filter. It copies the asset and thus will not be updated in time.

listEncodingProfiles

projectListEncodingProfiles Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a) 
=> a

project: A Project

-> m [EncodingProfile]

Returns: The list of EncodingProfile used in project

Lists the encoding profile that have been set to project. The first one is the latest added.

load

projectLoad Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a, IsTimeline b) 
=> a

project: A Project that has an uri set already

-> b

timeline: A blank timeline to load project into

-> m ()

(Can throw GError)

Loads project into timeline

new

projectNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

uri: The uri to be set after creating the project.

-> m Project

Returns: A newly created Project

Creates a new Project and sets its uri to uri if provided. Note that if uri is not valid or Nothing, the uri of the project will then be set the first time you save the project. If you then save the project to other locations, it will never be updated again and the first valid URI is the URI it will keep refering to.

removeAsset

projectRemoveAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a, IsAsset b) 
=> a

project: A Project

-> b

asset: A Asset to remove from project

-> m Bool

Returns: True if the asset could be removed False otherwise

remove a asset to from project.

save

projectSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsProject a, IsTimeline b, IsAsset c) 
=> a

project: A Project to save

-> b

timeline: The Timeline to save, it must have been extracted from project

-> Text

uri: The uri where to save project and timeline

-> Maybe c

formatterAsset: The formatter asset to use or Nothing. If Nothing, will try to save in the same format as the one from which the timeline as been loaded or default to the best formatter as defined in ges_find_formatter_for_uri

-> Bool

overwrite: True to overwrite file if it exists

-> m ()

(Can throw GError)

Save the timeline of project to uri. You should make sure that timeline is one of the timelines that have been extracted from project (using ges_asset_extract (project);)

Properties

uri

No description available in the introspection data.

constructProjectUri :: (IsProject o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “uri” property. This is rarely needed directly, but it is used by new.

getProjectUri :: (MonadIO m, IsProject o) => o -> m (Maybe Text) Source #

Get the value of the “uri” property. When overloading is enabled, this is equivalent to

get project #uri

Signals

assetAdded

type ProjectAssetAddedCallback Source #

Arguments

 = Asset

asset: The Asset that has been added to project

-> IO () 

No description available in the introspection data.

afterProjectAssetAdded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the assetAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #assetAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectAssetAdded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the assetAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #assetAdded callback

assetLoading

type ProjectAssetLoadingCallback Source #

Arguments

 = Asset

asset: The Asset that started loading

-> IO () 

No description available in the introspection data.

Since: 1.8

afterProjectAssetLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetLoadingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the assetLoading signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #assetLoading callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectAssetLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetLoadingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the assetLoading signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #assetLoading callback

assetRemoved

type ProjectAssetRemovedCallback Source #

Arguments

 = Asset

asset: The Asset that has been removed from project

-> IO () 

No description available in the introspection data.

afterProjectAssetRemoved :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the assetRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #assetRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectAssetRemoved :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the assetRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #assetRemoved callback

errorLoading

type ProjectErrorLoadingCallback Source #

Arguments

 = Timeline

timeline: The timeline that failed loading

-> GError

error: The GError defining the error that occured

-> IO () 

No description available in the introspection data.

Since: 1.18

afterProjectErrorLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the errorLoading signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #errorLoading callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectErrorLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the errorLoading signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #errorLoading callback

errorLoadingAsset

type ProjectErrorLoadingAssetCallback Source #

Arguments

 = GError

error: The GError defining the error that occured, might be Nothing

-> Text

id: The id of the asset that failed loading

-> GType

extractableType: The extractableType of the asset that failed loading

-> IO () 

Informs you that a Asset could not be created. In case of missing GStreamer plugins, the error will be set to GST_CORE_ERROR GST_CORE_ERROR_MISSING_PLUGIN

afterProjectErrorLoadingAsset :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingAssetCallback) -> m SignalHandlerId Source #

Connect a signal handler for the errorLoadingAsset signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #errorLoadingAsset callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectErrorLoadingAsset :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingAssetCallback) -> m SignalHandlerId Source #

Connect a signal handler for the errorLoadingAsset signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #errorLoadingAsset callback

loaded

type ProjectLoadedCallback Source #

Arguments

 = Timeline

timeline: The Timeline that completed loading

-> IO () 

No description available in the introspection data.

afterProjectLoaded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the loaded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #loaded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectLoaded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the loaded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #loaded callback

loading

type ProjectLoadingCallback Source #

Arguments

 = Timeline

timeline: The Timeline that started loading

-> IO () 

No description available in the introspection data.

Since: 1.18

afterProjectLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the loading signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #loading callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadingCallback) -> m SignalHandlerId Source #

Connect a signal handler for the loading signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #loading callback

missingUri

type ProjectMissingUriCallback Source #

Arguments

 = GError

error: The error that happened

-> Asset

wrongAsset: The asset with the wrong ID, you should us it and its content only to find out what the new location is.

-> IO (Maybe Text)

Returns: The new URI of wrongAsset

static gchar
source_moved_cb (GESProject *project, GError *error, GESAsset *asset_with_error)
{
  return g_strdup ("file:///the/new/uri.ogg");
}

static int
main (int argc, gchar ** argv)
{
  GESTimeline *timeline;
  GESProject *project = ges_project_new ("file:///some/uri.xges");

  g_signal_connect (project, "missing-uri", source_moved_cb, NULL);
  timeline = ges_asset_extract (GES_ASSET (project));
}

afterProjectMissingUri :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectMissingUriCallback) -> m SignalHandlerId Source #

Connect a signal handler for the missingUri signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after project #missingUri callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onProjectMissingUri :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectMissingUriCallback) -> m SignalHandlerId Source #

Connect a signal handler for the missingUri signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on project #missingUri callback