## CheeseFileUtil CheeseFileUtil — File utility functions for Cheese |

## Stability Level

Unstable, unless otherwise indicated

## Functions

CheeseFileUtil * | cheese_fileutil_new ()
gchar * | cheese_fileutil_get_new_media_filename ()
const gchar * | cheese_fileutil_get_photo_path ()
const gchar * | cheese_fileutil_get_video_path ()
void | cheese_fileutil_reset_burst ()

## Types and Values

| CheeseFileUtil
#define | CHEESE_PHOTO_NAME_SUFFIX
#define | CHEESE_VIDEO_NAME_SUFFIX
enum | CheeseMediaMode

## Object Hierarchy

        GObject
        ╰── CheeseFileUtil

## Includes

    #include <cheese/cheese-fileutil.h>

## Description

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

## Functions

### cheese_fileutil_new ()

    CheeseFileUtil *
    cheese_fileutil_new (void);

Create a new CheeseFileUtil object.

#### Returns

a new CheeseFileUtil

### 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()`.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

fileutil | a CheeseFileUtil |

## Types and Values

### CheeseFileUtil

    typedef struct _CheeseFileUtil CheeseFileUtil;

Use the accessor functions below.

### 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

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

#### Members

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