GESFormatter

GESFormatter — Timeline saving and loading.

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GESFormatter
        ╰── GESKeyfileFormatter

Includes

#include <ges/ges.h>

Description

The GESFormatter is the object responsible for loading and/or saving the contents of a GESTimeline to/from various formats.

In order to save a GESTimeline, you can either let GES pick a default formatter by using ges_timeline_save_to_uri(), or pick your own formatter and use ges_formatter_save_to_uri().

To load a GESTimeline, you might want to be able to track the progress of the loading, in which case you should create an empty GESTimeline, connect to the relevant signals and call ges_formatter_load_from_uri().

If you do not care about tracking the loading progress, you can use the convenience ges_timeline_new_from_uri() method.

Support for saving or loading new formats can be added by creating a subclass of GESFormatter and implement the various vmethods of GESFormatterClass.

Functions

GESFormatterLoadFromURIMethod ()

gboolean
(*GESFormatterLoadFromURIMethod) (GESFormatter *formatter,
                                  GESTimeline *timeline,
                                  gchar *uri);

Virtual method for loading a timeline from a given URI.

Every GESFormatter subclass needs to implement this method.

Parameters

formatter

a GESFormatter

 

timeline

a GESTimeline

 

uri

the URI to load from

 

Returns

TRUE if the timeline was properly loaded from the given uri , else FALSE.


GESFormatterSaveToURIMethod ()

gboolean
(*GESFormatterSaveToURIMethod) (GESFormatter *formatter,
                                GESTimeline *timeline,
                                gchar *uri);

Virtual method for saving a timeline to a uri.

Every GESFormatter subclass needs to implement this method.

Parameters

formatter

a GESFormatter

 

timeline

a GESTimeline

 

uri

the URI to save to

 

Returns

TRUE if the timeline was properly stored to the given uri , else FALSE.


ges_default_formatter_new ()

GESFormatter *
ges_default_formatter_new (void);

Creates a new instance of the default GESFormatter type on this system (currently GESKeyfileFormatter).

Returns

a GESFormatter instance or NULL


ges_formatter_load_from_uri ()

gboolean
ges_formatter_load_from_uri (GESFormatter *formatter,
                             GESTimeline *timeline,
                             gchar *uri);

Load data from the given URI into timeline.

Parameters

formatter

a GESFormatter

 

timeline

a GESTimeline

 

uri

a gchar * pointing to a URI

 

Returns

TRUE if the timeline data was successfully loaded from the URI, else FALSE.


ges_formatter_save_to_uri ()

gboolean
ges_formatter_save_to_uri (GESFormatter *formatter,
                           GESTimeline *timeline,
                           gchar *uri);

Save data from timeline to the given URI.

Parameters

formatter

a GESFormatter

 

timeline

a GESTimeline

 

uri

a gchar * pointing to a URI

 

Returns

TRUE if the timeline data was successfully saved to the URI else FALSE.


ges_formatter_new_for_uri ()

GESFormatter *
ges_formatter_new_for_uri (gchar *uri);

Creates a GESFormatter that can handle the given URI.

Parameters

uri

a gchar * pointing to the uri

 

Returns

A GESFormatter that can load the given uri, or NULL if the uri is not supported.


ges_formatter_can_load_uri ()

gboolean
ges_formatter_can_load_uri (gchar *uri);

Checks if there is a GESFormatter available which can load a GESTimeline from the given URI.

Parameters

uri

a gchar * pointing to the URI

 

Returns

TRUE if there is a GESFormatter that can support the given uri or FALSE if not.


ges_formatter_can_save_uri ()

gboolean
ges_formatter_can_save_uri (gchar *uri);

Returns TRUE if there is a GESFormatter available which can save a GESTimeline to the given URI.

Parameters

uri

a gchar * pointing to a URI

 

Returns

TRUE if the given uri is supported, else FALSE.

Types and Values

GESFormatter

typedef struct _GESFormatter GESFormatter;

Base class for timeline data serialization and deserialization.


GESFormatterClass

typedef struct {
  GObjectClass parent_class;

  /* FIXME : formatter name */
  /* FIXME : formatter description */
  /* FIXME : format name/mime-type */

  GESFormatterCanLoadURIMethod can_load_uri;
  GESFormatterCanSaveURIMethod can_save_uri;
  GESFormatterLoadFromURIMethod load_from_uri;
  GESFormatterSaveToURIMethod save_to_uri;
} GESFormatterClass;

GES Formatter class. Override the vmethods to implement the formatter functionnality.

Members

GObjectClass parent_class;

the parent class structure

 

GESFormatterCanLoadURIMethod can_load_uri;

Whether the URI can be loaded

 

GESFormatterCanSaveURIMethod can_save_uri;

Whether the URI can be saved

 

GESFormatterLoadFromURIMethod load_from_uri;

class method to deserialize data from a URI

 

GESFormatterSaveToURIMethod save_to_uri;

class method to serialize data to a URI