Project

General

Profile

Feature #8401

re-organize module loading

Added by Johannes Hanika about 7 years ago. Updated almost 7 years ago.

Status:
Fixed
Priority:
High
Category:
General
Target version:
Start date:
Due date:
% Done:

100%

Affected Version:
System:
bitness:
64-bit
hardware architecture:
amd64/x86

Description

module loading should be re-organized as follows:

modules should be loaded once on startup, initing a global list of darkroom/lighttable/etc plugins (darkroom are most important).

these modules would then spawn instances (we need to split dt_iop_module_t), which contain all the parameters and gui data.

this is good, because:

- modules would only need to load once, not every time a thumbnail is created (=> faster import)

- we could access trivial stuff (translated plugin names) without creating a develop_t.

History

#1 Updated by oliviertoulouse - about 7 years ago

As a reminder: once this ticket is closed, see #8397 to display localized plugins names in tooltips when hovering "yin-yang".

#2 Updated by oliviertoulouse - about 7 years ago

As a reminder (to be confirmed): this should also lead to solve #8366 (and #132) as the button in lighttable would become a link to a preset from an already loaded module...?

#3 Updated by Johannes Hanika about 7 years ago

pushed the initial code splitting.

tickets #8366 and #132 will need a bit more care though. also #8397 i didn't touch yet. functions can be accessed via darktable.iop (GList of dt_iop_modules_so_t containing all the loaded callbacks).

#4 Updated by calca - about 7 years ago

bug:

dt_gui_presets_add_generic(_("linear"), self->op, &p, self->params_size, 1);

crash git DT :(

#5 Updated by Johannes Hanika about 7 years ago

calca, you need to make clean your modules.

#6 Updated by calca - about 7 years ago

jhanika, on this machine work fine. tnx

#7 Updated by calca - about 7 years ago

clean build, from master.

(old library.db)
edit image
select preset in tone curve and nothing happens (curve don't change).

save a new preset.
change tone curve
select a new preset, curve updated.

i tested others modules and seam work correctly

#8 Updated by calca - about 7 years ago

this can help

sqlite3 error: /media/Archives/Projects/darktable.git/darktable/src/gui/presets.c:79, function dt_gui_presets_add_generic(): string or blob too big

#9 Updated by Johannes Hanika about 7 years ago

actually most module->init() (which are now still called for every time an image is entered into develop_t) do dt_opencl_create_kernel calls, which might be slow.

so module->init() and module->cleanup() might be executed only once? or maybe split them into init_global()?

or let module->gui_init() do the image dependent initialization (default enabled and hide_enable_button etc)?

#10 Updated by calca - about 7 years ago

i thinks about default preset.

it's necessary put that preset on library.db?
user can edit/delete preset and anytime DT starts preset will be remove and added. (i understand correctly from the code?)

it's possible create a preset.db on data folder and only read from there on gui_init()?

#11 Updated by calca - about 7 years ago

ops, 'can edit' => cant' edit

#12 Updated by Johannes Hanika almost 7 years ago

this has been solved by module->init_global() and ->cleanup_global() callbacks which also init the opencl kernels.

Also available in: Atom PDF