GESFormatter

## GESFormatter GESFormatter — Timeline saving and loading. |

## Synopsis

    #include <ges/ges.h>

                        GESFormatter;
                        GESFormatterClass;
    gboolean            (*GESFormatterLoadFromURIMethod)    (GESFormatter *formatter,
                                                             GESTimeline *timeline,
                                                             const gchar *uri,
                                                             GError **error);
    gboolean            (*GESFormatterSaveToURIMethod)      (GESFormatter *formatter,
                                                             GESTimeline *timeline,
                                                             const gchar *uri,
                                                             gboolean overwrite,
                                                             GError **error);
    gboolean            (*GESFormatterCanLoadURIMethod)     (GESFormatter *dummy_instance,
                                                             const gchar *uri,
                                                             GError **error);
    void                ges_formatter_class_register_metas  (GESFormatterClass *klass,
                                                             const gchar *name,
                                                             const gchar *description,
                                                             const gchar *extension,
                                                             const gchar *mimetype,
                                                             gdouble version,
                                                             GstRank rank);
    gboolean            ges_formatter_load_from_uri         (GESFormatter *formatter,
                                                             GESTimeline *timeline,
                                                             const gchar *uri,
                                                             GError **error);
    gboolean            ges_formatter_save_to_uri           (GESFormatter *formatter,
                                                             GESTimeline *timeline,
                                                             const gchar *uri,
                                                             gboolean overwrite,
                                                             GError **error);
    gboolean            ges_formatter_can_load_uri          (const gchar *uri,
                                                             GError **error);
    gboolean            ges_formatter_can_save_uri          (const gchar *uri,
                                                             GError **error);
    GESAsset *          ges_formatter_get_default           (void);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GESFormatter

## Implemented Interfaces

GESFormatter implements GESExtractable.

## Description

## Details

### GESFormatter

    typedef struct _GESFormatter GESFormatter;

Base class for timeline data serialization and deserialization.

### GESFormatterClass

    typedef struct {
      GInitiallyUnownedClass parent_class;

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

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

GInitiallyUnownedClass `parent_class`; | the parent class structure
GESFormatterCanLoadURIMethod `can_load_uri`; | Whether the URI can be loaded
GESFormatterLoadFromURIMethod `load_from_uri`; | class method to deserialize data from a URI
GESFormatterSaveToURIMethod `save_to_uri`; | class method to serialize data to a URI

### GESFormatterLoadFromURIMethod ()

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

Virtual method for loading a timeline from a given URI.

Every GESFormatter subclass needs to implement this method.

`formatter` : | a GESFormatter
`timeline` : | a GESTimeline
`uri` : | the URI to load from
`error` : | An error to be set in case something wrong happens or `NULL`. [out][allow-none]
Returns : | TRUE if the `timeline` was properly loaded from the given `uri`, else FALSE.

### GESFormatterSaveToURIMethod ()

    gboolean            (*GESFormatterSaveToURIMethod)      (GESFormatter *formatter,
                                                             GESTimeline *timeline,
                                                             const gchar *uri,
                                                             gboolean overwrite,
                                                             GError **error);

Virtual method for saving a timeline to a uri.

Every GESFormatter subclass needs to implement this method.

`formatter` : | a GESFormatter
`timeline` : | a GESTimeline
`uri` : | the URI to save to
`overwrite` : | Whether the file should be overwritten in case it exists
`error` : | An error to be set in case something wrong happens or `NULL`. [out][allow-none]
Returns : | TRUE if the `timeline` was properly stored to the given `uri`, else FALSE.

### GESFormatterCanLoadURIMethod ()

    gboolean            (*GESFormatterCanLoadURIMethod)     (GESFormatter *dummy_instance,
                                                             const gchar *uri,
                                                             GError **error);

### ges_formatter_class_register_metas ()

    void                ges_formatter_class_register_metas  (GESFormatterClass *klass,
                                                             const gchar *name,
                                                             const gchar *description,
                                                             const gchar *extension,
                                                             const gchar *mimetype,
                                                             gdouble version,
                                                             GstRank rank);

### ges_formatter_load_from_uri ()

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

Load data from the given URI into timeline.

`formatter` : | a GESFormatter
`timeline` : | a GESTimeline
`uri` : | a gchar * pointing to a URI
`error` : | A GError that will be set in case of error
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,
                                                             const gchar *uri,
                                                             gboolean overwrite,
                                                             GError **error);

Save data from timeline to the given URI.

`formatter` : | a GESFormatter
`timeline` : | a GESTimeline
`uri` : | a gchar * pointing to a URI
`overwrite` : | `TRUE` to overwrite file if it exists
`error` : | A GError that will be set in case of error
Returns : | TRUE if the timeline data was successfully saved to the URI else FALSE.

### ges_formatter_can_load_uri ()

    gboolean            ges_formatter_can_load_uri          (const gchar *uri,
                                                             GError **error);

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

`uri` : | a gchar * pointing to the URI
`error` : | A GError that will be set in case of error
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          (const gchar *uri,
                                                             GError **error);

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

`uri` : | a gchar * pointing to a URI
`error` : | A GError that will be set in case of error
Returns : | TRUE if the given `uri` is supported, else FALSE.

### ges_formatter_get_default ()

    GESAsset *          ges_formatter_get_default           (void);

Get the default GESAsset to use as formatter. It will return the asset for the GESFormatter that has the highest `rank`

Returns : | The GESAsset for the formatter with highest `rank`. [transfer none]