## CheeseFileUtil CheeseFileUtil — File utility functions for Cheese |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <cheese/cheese-fileutil.h>

    struct              CheeseFileUtil;
    CheeseFileUtil *    cheese_fileutil_new                 (void);
    #define             CHEESE_PHOTO_NAME_SUFFIX
    #define             CHEESE_VIDEO_NAME_SUFFIX
    enum                CheeseMediaMode;
    gchar *             cheese_fileutil_get_new_media_filename
                                                            (CheeseFileUtil *fileutil,
                                                             CheeseMediaMode mode);
    const gchar *       cheese_fileutil_get_photo_path      (CheeseFileUtil *fileutil);
    const gchar *       cheese_fileutil_get_video_path      (CheeseFileUtil *fileutil);
    void                cheese_fileutil_reset_burst         (CheeseFileUtil *fileutil);

## Object Hierarchy

      GObject
       +----CheeseFileUtil

## Description

CheeseFileUtil provides some helpful utility functions for looking up paths for photos and videos.

## Details

### struct CheeseFileUtil

    struct CheeseFileUtil;

Use the accessor functions below.

### cheese_fileutil_new ()

    CheeseFileUtil *    cheese_fileutil_new                 (void);

Create a new CheeseFileUtil object.

Returns : | a new CheeseFileUtil

### CHEESE_PHOTO_NAME_SUFFIX

    #define CHEESE_PHOTO_NAME_SUFFIX ".jpg"

The filename suffix for photos saved by Cheese.

### CHEESE_VIDEO_NAME_SUFFIX

    #define CHEESE_VIDEO_NAME_SUFFIX ".webm"

The filename suffix for videos saved by Cheese.

### enum CheeseMediaMode

    typedef enum {
      CHEESE_MEDIA_MODE_PHOTO,
      CHEESE_MEDIA_MODE_VIDEO,
      CHEESE_MEDIA_MODE_BURST
    } CheeseMediaMode;

The media type, used for generating filenames with `cheese_fileutil_get_new_media_filename()`.

`CHEESE_MEDIA_MODE_PHOTO` | photo
`CHEESE_MEDIA_MODE_VIDEO` | video
`CHEESE_MEDIA_MODE_BURST` | a burst of photos

### cheese_fileutil_get_new_media_filename ()

    gchar *             cheese_fileutil_get_new_media_filename
                                                            (CheeseFileUtil *fileutil,
                                                             CheeseMediaMode mode);

Creates a filename for one of the three media types: photo, photo burst or video. If a filename for a photo burst image was previously created, this function increments the burst count automatically. To start a new burst, first call `cheese_fileutil_reset_burst()`.

`fileutil` : | a CheeseFileUtil
`mode` : | the type of media to create a filename for
Returns : | a new filename. [transfer full][type filename]

### cheese_fileutil_get_photo_path ()

    const gchar *       cheese_fileutil_get_photo_path      (CheeseFileUtil *fileutil);

Get the path where Cheese photo files are stored.

`fileutil` : | a CheeseFileUtil
Returns : | the Cheese photo path. [transfer none][type filename]

### cheese_fileutil_get_video_path ()

    const gchar *       cheese_fileutil_get_video_path      (CheeseFileUtil *fileutil);

Get the path where Cheese video files are stored.

`fileutil` : | a CheeseFileUtil
Returns : | the Cheese video path. [transfer none][type filename]

### cheese_fileutil_reset_burst ()

    void                cheese_fileutil_reset_burst         (CheeseFileUtil *fileutil);

Resets the burst counter, so that calling `cheese_fileutil_get_new_media_filename()` with a photo burst starts a new burst of photos.

`fileutil` : | a CheeseFileUtil