Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype Project = Project (ManagedPtr Project)
- class (GObject o, IsDescendantOf Project o) => IsProject o
- toProject :: (MonadIO m, IsProject o) => o -> m Project
- projectAddAsset :: (HasCallStack, MonadIO m, IsProject a, IsAsset b) => a -> b -> m Bool
- projectAddEncodingProfile :: (HasCallStack, MonadIO m, IsProject a, IsEncodingProfile b) => a -> b -> m Bool
- projectAddFormatter :: (HasCallStack, MonadIO m, IsProject a, IsFormatter b) => a -> b -> m ()
- projectCreateAsset :: (HasCallStack, MonadIO m, IsProject a) => a -> Maybe Text -> GType -> m Bool
- projectCreateAssetSync :: (HasCallStack, MonadIO m, IsProject a) => a -> Maybe Text -> GType -> m (Maybe Asset)
- projectGetAsset :: (HasCallStack, MonadIO m, IsProject a) => a -> Text -> GType -> m (Maybe Asset)
- projectGetLoadingAssets :: (HasCallStack, MonadIO m, IsProject a) => a -> m [Asset]
- projectGetUri :: (HasCallStack, MonadIO m, IsProject a) => a -> m (Maybe Text)
- projectListAssets :: (HasCallStack, MonadIO m, IsProject a) => a -> GType -> m [Asset]
- projectListEncodingProfiles :: (HasCallStack, MonadIO m, IsProject a) => a -> m [EncodingProfile]
- projectLoad :: (HasCallStack, MonadIO m, IsProject a, IsTimeline b) => a -> b -> m ()
- projectNew :: (HasCallStack, MonadIO m) => Maybe Text -> m Project
- projectRemoveAsset :: (HasCallStack, MonadIO m, IsProject a, IsAsset b) => a -> b -> m Bool
- projectSave :: (HasCallStack, MonadIO m, IsProject a, IsTimeline b, IsAsset c) => a -> b -> Text -> Maybe c -> Bool -> m ()
- constructProjectUri :: (IsProject o, MonadIO m) => Text -> m (GValueConstruct o)
- getProjectUri :: (MonadIO m, IsProject o) => o -> m (Maybe Text)
- type ProjectAssetAddedCallback = Asset -> IO ()
- afterProjectAssetAdded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetAddedCallback) -> m SignalHandlerId
- onProjectAssetAdded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetAddedCallback) -> m SignalHandlerId
- type ProjectAssetLoadingCallback = Asset -> IO ()
- afterProjectAssetLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetLoadingCallback) -> m SignalHandlerId
- onProjectAssetLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetLoadingCallback) -> m SignalHandlerId
- type ProjectAssetRemovedCallback = Asset -> IO ()
- afterProjectAssetRemoved :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetRemovedCallback) -> m SignalHandlerId
- onProjectAssetRemoved :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectAssetRemovedCallback) -> m SignalHandlerId
- type ProjectErrorLoadingCallback = Timeline -> GError -> IO ()
- afterProjectErrorLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingCallback) -> m SignalHandlerId
- onProjectErrorLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingCallback) -> m SignalHandlerId
- type ProjectErrorLoadingAssetCallback = GError -> Text -> GType -> IO ()
- afterProjectErrorLoadingAsset :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingAssetCallback) -> m SignalHandlerId
- onProjectErrorLoadingAsset :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectErrorLoadingAssetCallback) -> m SignalHandlerId
- type ProjectLoadedCallback = Timeline -> IO ()
- afterProjectLoaded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadedCallback) -> m SignalHandlerId
- onProjectLoaded :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadedCallback) -> m SignalHandlerId
- type ProjectLoadingCallback = Timeline -> IO ()
- afterProjectLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadingCallback) -> m SignalHandlerId
- onProjectLoading :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectLoadingCallback) -> m SignalHandlerId
- type ProjectMissingUriCallback = GError -> Asset -> IO (Maybe Text)
- afterProjectMissingUri :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectMissingUriCallback) -> m SignalHandlerId
- onProjectMissingUri :: (IsProject a, MonadIO m) => a -> ((?self :: a) => ProjectMissingUriCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Project Source # | |
GObject Project Source # | |
Defined in GI.GES.Objects.Project | |
ManagedPtrNewtype Project Source # | |
Defined in GI.GES.Objects.Project toManagedPtr :: Project -> ManagedPtr Project | |
TypedObject Project Source # | |
Defined in GI.GES.Objects.Project | |
HasParentTypes Project Source # | |
Defined in GI.GES.Objects.Project | |
IsGValue (Maybe Project) Source # | Convert |
Defined in GI.GES.Objects.Project gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Project -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Project) | |
type ParentTypes Project Source # | |
Defined in GI.GES.Objects.Project |
class (GObject o, IsDescendantOf Project o) => IsProject o Source #
Instances
(GObject o, IsDescendantOf Project o) => IsProject o Source # | |
Defined in GI.GES.Objects.Project |
Methods
Click to display all available methods, including inherited ones
Methods
addAsset, addEncodingProfile, addFormatter, addMetasFromString, bindProperty, bindPropertyFull, checkMetaRegistered, createAsset, createAssetSync, extract, forceFloating, foreach, freezeNotify, getv, init, initAsync, initFinish, isFloating, listAssets, listEncodingProfiles, listProxies, load, metasToString, newFinish, notify, notifyByPspec, ref, refSink, registerMeta, registerMetaBoolean, registerMetaDate, registerMetaDateTime, registerMetaDouble, registerMetaFloat, registerMetaInt, registerMetaInt64, registerMetaString, registerMetaUint, registerMetaUint64, registerStaticMeta, removeAsset, runDispose, save, stealData, stealQdata, thawNotify, unproxy, unref, watchClosure.
Getters
getAsset, getBoolean, getData, getDate, getDateTime, getDouble, getError, getExtractableType, getFloat, getId, getInt, getInt64, getLoadingAssets, getMarkerList, getMeta, getProperty, getProxy, getProxyTarget, getQdata, getString, getUint, getUint64, getUri.
Setters
setBoolean, setData, setDataFull, setDate, setDateTime, setDouble, setFloat, setInt, setInt64, setMarkerList, setMeta, setProperty, setProxy, setString, setUint, setUint64.
addAsset
:: (HasCallStack, MonadIO m, IsProject a, IsAsset b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Adds a Asset
to project
, the project will keep a reference on
asset
.
addEncodingProfile
projectAddEncodingProfile Source #
:: (HasCallStack, MonadIO m, IsProject a, IsEncodingProfile b) | |
=> a |
|
-> b |
|
-> m Bool |
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
:: (HasCallStack, MonadIO m, IsProject a, IsFormatter b) | |
=> a |
|
-> b |
|
-> m () |
Adds a formatter as used to load project
Since: 1.18
createAsset
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> Maybe Text |
|
-> GType |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> Maybe Text |
|
-> GType |
|
-> m (Maybe Asset) | Returns: The newly created |
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
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> Text |
|
-> GType |
|
-> m (Maybe Asset) | Returns: The |
No description available in the introspection data.
getLoadingAssets
projectGetLoadingAssets Source #
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> m [Asset] | Returns: A set of loading asset
that will be added to |
Get the assets that are being loaded
getUri
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> m (Maybe Text) | Returns: a newly allocated string representing uri. |
Retrieve the uri that is currently set on project
listAssets
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> GType |
|
-> m [Asset] | Returns: The list of
|
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 #
:: (HasCallStack, MonadIO m, IsProject a) | |
=> a |
|
-> m [EncodingProfile] | Returns: The
list of |
Lists the encoding profile that have been set to project
. The first one
is the latest added.
load
:: (HasCallStack, MonadIO m, IsProject a, IsTimeline b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Loads project
into timeline
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> m Project | Returns: A newly created |
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
:: (HasCallStack, MonadIO m, IsProject a, IsAsset b) | |
=> a |
|
-> b |
|
-> m Bool |
remove a asset
to from project
.
save
:: (HasCallStack, MonadIO m, IsProject a, IsTimeline b, IsAsset c) | |
=> a |
|
-> b |
|
-> Text |
|
-> Maybe c |
|
-> Bool |
|
-> m () | (Can throw |
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 #
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 #
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 #
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 #
= Timeline |
|
-> GError |
|
-> 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 #
= GError |
|
-> Text |
|
-> GType |
|
-> 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 #
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 #
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 #
= GError |
|
-> Asset |
|
-> IO (Maybe Text) | Returns: The new URI of |
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