## GvaInputFile GvaInputFile — A stable interface for MAME INP files |

## Synopsis

    struct              GvaInputFile;
    GvaInputFile *      gva_input_file_new                  (const gchar *filename);
    gboolean            gva_input_file_read                 (GvaInputFile *input_file,
                                                             GError **error);
    GvaProcess *        gva_input_file_play_back            (GvaInputFile *input_file,
                                                             GError **error);
    const gchar *       gva_input_file_get_filename         (GvaInputFile *input_file);
    const gchar *       gva_input_file_get_format           (GvaInputFile *input_file);
    const gchar *       gva_input_file_get_game             (GvaInputFile *input_file);
    const gchar *       gva_input_file_get_origin           (GvaInputFile *input_file);
    time_t              gva_input_file_get_timestamp        (GvaInputFile *input_file);

## Object Hierarchy

      GObject
       +----GvaInputFile

## Properties

      "filename"                 gchar*                : Read / Write / Construct Only
      "format"                   gchar*                : Read
      "game"                     gchar*                : Read
      "origin"                   gchar*                : Read
      "timestamp"                gint64                : Read

## Description

A GvaInputFile provides metadata about a MAME INP file. It handles both current and historical INP formats.

## Details

### struct GvaInputFile

    struct GvaInputFile;

Contains only private data that should be read and manipulated using the functions below.

### gva_input_file_new ()

    GvaInputFile *      gva_input_file_new                  (const gchar *filename);

Creates a new GvaInputFile for the given `filename`.

`filename` : | path to a MAME INP file
Returns : | a new GvaInputFile

### gva_input_file_read ()

    gboolean            gva_input_file_read                 (GvaInputFile *input_file,
                                                             GError **error);

Reads header information from a MAME INP file. The information is made available through the various accessor functions. If an error occurs while reading, the function returns `FALSE` and sets `error`.

`input_file` : | a GvaInputFile
`error` : | return location for a GError, or `NULL`
Returns : | `TRUE` on success, `FALSE` if an error occurred

### gva_input_file_play_back ()

    GvaProcess *        gva_input_file_play_back            (GvaInputFile *input_file,
                                                             GError **error);

Begins play back of `input_file` and returns the resulting GvaProcess. If an error occurs, it returns `NULL` and sets `error`.

`input_file` : | a GvaInputFile
`error` : | return location for a GError, or `NULL`
Returns : | a new GvaProcess, or `NULL`

### gva_input_file_get_filename ()

    const gchar *       gva_input_file_get_filename         (GvaInputFile *input_file);

Returns the filename for `input_file`.

`input_file` : | a GvaInputFile
Returns : | filename for `input_file`

### gva_input_file_get_format ()

    const gchar *       gva_input_file_get_format           (GvaInputFile *input_file);

Returns a description of the INP header format. Possible formats are "INP simple format", "INP extended format", and "INP version x.y".

`input_file` : | a GvaInputFile
Returns : | description of the header format

### gva_input_file_get_game ()

    const gchar *       gva_input_file_get_game             (GvaInputFile *input_file);

Returns the corresponding ROM name for `input_file`.

`input_file` : | a GvaInputFile
Returns : | corresponding ROM name for `input_file`

### gva_input_file_get_origin ()

    const gchar *       gva_input_file_get_origin           (GvaInputFile *input_file);

Returns a description of the MAME program that recorded the INP file.

`input_file` : | a GvaInputFile
Returns : | description of the MAME program that recorded the INP file

### gva_input_file_get_timestamp ()

    time_t              gva_input_file_get_timestamp        (GvaInputFile *input_file);

Returns an approximation of when the game recording began.

`input_file` : | a GvaInputFile
Returns : | approximation of when the game recording began

## Property Details

### The `"filename"` property

      "filename"                 gchar*                : Read / Write / Construct Only

The name of the input file.

Default value: NULL

### The `"format"` property

      "format"                   gchar*                : Read

The format of the input file.

Default value: NULL

### The `"game"` property

      "game"                     gchar*                : Read

The corresponding ROM name for the input file.

Default value: NULL

### The `"origin"` property

      "origin"                   gchar*                : Read

The version of MAME that recorded the input file.

Default value: NULL

### The `"timestamp"` property

      "timestamp"                gint64                : Read

The creation timestamp for the input file.

Default value: 0