Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
film.c File Reference
#include "common/film.h"
#include "database/database.h"
#include "database/film_repository.h"
#include "control/settings.h"
#include "common/collection.h"
#include "caches/mipmap_cache.h"
#include "system/dtpthread.h"
#include "caches/image_cache.h"
#include "metadata/tags.h"
#include "common/conf.h"
#include "control/control.h"
#include "control/jobs/film_jobs.h"
#include "control/jobs.h"
#include "views/view.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "common/utility.h"
+ Include dependency graph for film.c:

Go to the source code of this file.

Data Structures

struct  _empty_rolls_t
 
struct  _relocation_t
 

Typedefs

typedef struct _empty_rolls_t _empty_rolls_t
 
typedef struct _relocation_t _relocation_t
 

Functions

void dt_film_init (dt_film_t *film)
 
void dt_film_cleanup (dt_film_t *film)
 
void dt_film_set_query (const int32_t id)
 
int32_t dt_film_get_id (const char *folder)
 
int dt_film_open (const int32_t id)
 
int dt_film_new (dt_film_t *film, const char *directory)
 
int dt_film_import (const char *dirname)
 
void dt_film_set_confirm_rmdir_handler (dt_film_confirm_rmdir_handler_t handler)
 
void dt_film_set_rolls_changed_handler (dt_film_rolls_changed_handler_t handler)
 Install the handler, or NULL to remove it.
 
void dt_film_notify_rolls_changed (void)
 State that the film-roll list changed.
 
void dt_film_remove_directories (const GList *dirs)
 
static void _collect_empty_roll (void *user_data, const int32_t id, const char *folder)
 
static void _collect_relocation (void *user_data, const int32_t id, const char *folder)
 
void dt_film_remove_empty ()
 
gboolean dt_film_is_empty (const int id)
 
void dt_film_remove (const int id)
 
void dt_film_relocate (const char *old_path, const char *new_path)
 
GList * dt_film_get_image_ids (const int filmid)
 
static void _record_folder_status (void *user_data, const int32_t id, const char *folder)
 
void dt_film_set_folder_status ()
 

Variables

static dt_film_confirm_rmdir_handler_t _confirm_rmdir_handler = NULL
 
static dt_film_rolls_changed_handler_t _rolls_changed_handler = NULL
 

Typedef Documentation

◆ _empty_rolls_t

◆ _relocation_t

typedef struct _relocation_t _relocation_t

Function Documentation

◆ _collect_empty_roll()

static void _collect_empty_roll ( void user_data,
const int32_t  id,
const char *  folder 
)
static

Definition at line 266 of file film.c.

References folder, _empty_rolls_t::ids, and r.

Referenced by dt_film_remove_empty().

◆ _collect_relocation()

static void _collect_relocation ( void user_data,
const int32_t  id,
const char *  folder 
)
static

Definition at line 281 of file film.c.

References folder, and r.

Referenced by dt_film_relocate().

◆ _record_folder_status()

static void _record_folder_status ( void user_data,
const int32_t  id,
const char *  folder 
)
static

Definition at line 403 of file film.c.

References dt_film_repository_folder_status_set(), folder, and void().

Referenced by dt_film_set_folder_status().

◆ dt_film_cleanup()

◆ dt_film_get_id()

int32_t dt_film_get_id ( const char *  folder)

get id associated with filmroll

Definition at line 108 of file film.c.

References dt_film_repository_find_by_folder(), and folder.

Referenced by _folders_root_collapse_path(), _is_in_library_by_path(), and dt_film_new().

◆ dt_film_get_image_ids()

GList * dt_film_get_image_ids ( const int  filmid)

gets all image ids in film. the returned GList has to be freed with g_list_free().

Definition at line 398 of file film.c.

References dt_film_repository_get_image_ids().

Referenced by main().

◆ dt_film_import()

int dt_film_import ( const char *  dirname)

import new film and all images in this directory as a background task(non-recursive, existing films/images are respected).

Definition at line 187 of file film.c.

References dt_film_t::dir, dt_film_t::dirname, dt_control_add_job(), dt_control_get_global(), dt_film_cleanup(), dt_film_import1_create(), dt_film_init(), dt_film_is_empty(), dt_film_new(), dt_film_remove(), dt_free, DT_JOB_QUEUE_USER_BG, error(), dt_film_t::id, and dt_film_t::last_loaded.

Referenced by dt_load_from_string(), and main().

◆ dt_film_init()

◆ dt_film_is_empty()

gboolean dt_film_is_empty ( const int  id)

checks if film is empty

Definition at line 333 of file film.c.

References dt_film_repository_has_images().

Referenced by _film_import1(), dt_film_import(), and dt_film_import1_run().

◆ dt_film_new()

◆ dt_film_notify_rolls_changed()

void dt_film_notify_rolls_changed ( void  )

State that the film-roll list changed.

Definition at line 247 of file film.c.

References _rolls_changed_handler.

Referenced by _pop_undo(), and dt_film_remove().

◆ dt_film_open()

int dt_film_open ( const int32_t  id)

◆ dt_film_relocate()

void dt_film_relocate ( const char *  old_path,
const char *  new_path 
)

relocate every film roll located under old_path so it sits under new_path (database only, does not move files on disk). Used by the library module to fix moved folders.

Definition at line 380 of file film.c.

References _collect_relocation(), dt_film_repository_foreach_under(), dt_film_repository_set_folder(), f, _relocation_t::folders, i, _relocation_t::ids, and IS_NULL_PTR.

Referenced by _act_folders_relocate().

◆ dt_film_remove()

◆ dt_film_remove_directories()

void dt_film_remove_directories ( const GList *  dirs)

rmdir() every path in dirs. The list is NOT freed. Call once the user has agreed.

Definition at line 253 of file film.c.

Referenced by _ask_and_delete().

◆ dt_film_remove_empty()

◆ dt_film_set_confirm_rmdir_handler()

void dt_film_set_confirm_rmdir_handler ( dt_film_confirm_rmdir_handler_t  handler)

Install the handler that asks the user about empty directories. NULL removes it.

Definition at line 233 of file film.c.

References _confirm_rmdir_handler.

Referenced by dt_film_gui_register_handlers().

◆ dt_film_set_folder_status()

void dt_film_set_folder_status ( )

◆ dt_film_set_query()

void dt_film_set_query ( const int32_t  id)

constructs the lighttable/query setting for this film, respecting stars and filters.

Definition at line 94 of file film.c.

References DT_COLLECTION_CHANGE_NEW_QUERY, dt_collection_get_global(), DT_COLLECTION_PROP_UNDEF, dt_collection_update_query(), dt_conf_set_int(), dt_conf_set_string(), dt_film_repository_get_folder(), dt_free, and folder.

Referenced by dt_film_open().

◆ dt_film_set_rolls_changed_handler()

void dt_film_set_rolls_changed_handler ( dt_film_rolls_changed_handler_t  handler)

Install the handler, or NULL to remove it.

Definition at line 242 of file film.c.

References _rolls_changed_handler.

Referenced by dt_film_gui_register_handlers().

Variable Documentation

◆ _confirm_rmdir_handler

dt_film_confirm_rmdir_handler_t _confirm_rmdir_handler = NULL
static

Definition at line 231 of file film.c.

Referenced by dt_film_remove_empty(), and dt_film_set_confirm_rmdir_handler().

◆ _rolls_changed_handler

dt_film_rolls_changed_handler_t _rolls_changed_handler = NULL
static

Definition at line 240 of file film.c.

Referenced by dt_film_notify_rolls_changed(), and dt_film_set_rolls_changed_handler().