1 // preferences.h
2 // LiVES (lives-exe)
3 // (c) G. Finch (salsaman_lives@gmail.com) 2004 - 2019
4 // released under the GNU GPL 3 or later
5 // see file ../COPYING or www.gnu.org for licensing details
6 
7 #ifndef HAS_LIVES_PREFS_H
8 #define HAS_LIVES_PREFS_H
9 
10 #define PREFS_PANED_POS ((int)(300.*widget_opts.scale))
11 
12 // for mainw->prefs_changed
13 #define PREFS_THEME_CHANGED		(1 << 0)
14 #define PREFS_JACK_CHANGED		(1 << 1)
15 #define PREFS_WORKDIR_CHANGED		(1 << 2)
16 #define PREFS_COLOURS_CHANGED		(1 << 3)
17 #define PREFS_XCOLOURS_CHANGED		(1 << 4)
18 #define PREFS_IMAGES_CHANGED		(1 << 5)
19 #define PREFS_MONITOR_CHANGED		(1 << 6)
20 #define PREFS_NEEDS_REVERT		(1 << 7)
21 
22 #define PULSE_AUDIO_URL "http://www.pulseaudio.org"
23 #define JACK_URL "http://jackaudio.org"
24 
25 typedef struct {
26   char bgcolour[256];
27   boolean stop_screensaver;
28   boolean open_maximised;
29   char theme[64];  ///< the theme name
30 
31   short pb_quality;
32 #define PB_QUALITY_LOW 1
33 #define PB_QUALITY_MED 2  ///< default
34 #define PB_QUALITY_HIGH 3
35 
36   boolean pbq_adaptive;
37 
38   _encoder encoder; ///< from main.h
39 
40   short audio_player;
41 #define AUD_PLAYER_NONE 0
42 #define AUD_PLAYER_SOX 1
43 #define AUD_PLAYER_JACK 2
44 #define AUD_PLAYER_PULSE 3
45 
46   // string forms
47 #define AUDIO_PLAYER_NONE "none"
48 #define AUDIO_PLAYER_SOX "sox"
49 #define AUDIO_PLAYER_JACK "jack"
50 
51 #define AUDIO_PLAYER_PULSE "pulse" ///< used in pref and for external players (e.g -ao pulse, -aplayer pulse)
52 #define AUDIO_PLAYER_PULSE_AUDIO "pulseaudio" ///< used for display, alternate pref and alternate startup opt (-aplayer pulseaudio)
53 
54   char aplayer[512]; // name, eg. "jack","pulse","sox"
55 
56   /// frame quantisation type
57   short q_type;
58 #define Q_FILL 1
59 #define Q_SMOOTH 1
60 
61   char workdir[PATH_MAX];  ///< kept in locale encoding
62 
63   char configfile[PATH_MAX];  ///< kept in locale encoding (config settings) [default ~/.local/config/lives)
64   char config_datadir[PATH_MAX];  ///< kept in locale encoding (general config files) (default ~/.local/share/lives)
65 
66   // utf8 encoding
67   char def_vid_load_dir[PATH_MAX];
68   char def_vid_save_dir[PATH_MAX];
69   char def_audio_dir[PATH_MAX];
70   char def_image_dir[PATH_MAX];
71   char def_proj_dir[PATH_MAX];
72 
73   // locale encoding
74   char prefix_dir[PATH_MAX];
75   char lib_dir[PATH_MAX];
76 
77   char image_type[16];
78   char image_ext[16];
79 
80   uint64_t warning_mask;
81 
82   /// bits 10, 11, 13, 18 and 19 set (off by default)
83   // (should have been done by reversing the sense of these bits, but it is too late now
84 #define DEF_WARNING_MASK 0x000C2C04ul
85 
86   // if these bits are set, we do not show the warning
87 #define WARN_MASK_FPS 	       					(1ul << 0)
88 #define WARN_MASK_FSIZE 	       				(1ul << 1)
89 #define WARN_MASK_UNUSED1ul 	       				(1ul << 2)  ///< was "save_quality"
90 #define WARN_MASK_SAVE_SET 		       			(1ul << 3)
91 #define WARN_MASK_NO_MPLAYER 			       		(1ul << 4)
92 #define WARN_MASK_RENDERED_FX 					(1ul << 5)
93 #define WARN_MASK_NO_ENCODERS 					(1ul << 6)
94 #define WARN_MASK_LAYOUT_MISSING_CLIPS 				(1ul << 7)
95 #define WARN_MASK_LAYOUT_CLOSE_FILE 				(1ul << 8)
96 #define WARN_MASK_LAYOUT_DELETE_FRAMES 				(1ul << 9)
97 
98   /** off by default on a fresh install */
99 #define WARN_MASK_LAYOUT_SHIFT_FRAMES 				(1ul << 10)
100 
101   /** off by default on a fresh install */
102 #define WARN_MASK_LAYOUT_ALTER_FRAMES 				(1ul << 11)
103 #define WARN_MASK_DUPLICATE_SET        				(1ul << 12)
104 
105   /** off by default on a fresh install */
106 #define WARN_MASK_EXIT_MT 		       			(1ul << 13)
107 #define WARN_MASK_DISCARD_SET 					(1ul << 14)
108 #define WARN_MASK_AFTER_DVGRAB 					(1ul << 15)
109 #define WARN_MASK_MT_ACHANS 			       		(1ul << 16)
110 #define WARN_MASK_LAYOUT_DELETE_AUDIO 				(1ul << 17)
111 
112   /** off by default on a fresh install */
113 #define WARN_MASK_LAYOUT_SHIFT_AUDIO 				(1ul << 18)
114 
115   /** off by default on a fresh install */
116 #define WARN_MASK_LAYOUT_ALTER_AUDIO 				(1ul << 19)
117 
118 #define WARN_MASK_MT_NO_JACK 			       		(1ul << 20)
119 #define WARN_MASK_OPEN_YUV4M 					(1ul << 21)
120 #define WARN_MASK_MT_BACKUP_SPACE 				(1ul << 22)
121 #define WARN_MASK_LAYOUT_POPUP 					(1ul << 23)
122 #define WARN_MASK_CLEAN_AFTER_CRASH 				(1ul << 24)
123 #define WARN_MASK_NO_PULSE_CONNECT 				(1ul << 25)
124 #define WARN_MASK_LAYOUT_WIPE 					(1ul << 26)
125 #define WARN_MASK_LAYOUT_GAMMA 					(1ul << 27)
126 #define WARN_MASK_VJMODE_ENTER 					(1ul << 28)
127 #define WARN_MASK_CLEAN_INVALID 		       		(1ul << 29)
128 #define WARN_MASK_LAYOUT_LB	 		       		(1ul << 30)
129 
130   // reserved (on / unset by default)
131 #define WARN_MASK_RSVD_16					(1ul << 31)
132 #define WARN_MASK_RSVD_15					(1ul << 32)
133 #define WARN_MASK_RSVD_14					(1ul << 33)
134 #define WARN_MASK_RSVD_13					(1ul << 34)
135 #define WARN_MASK_RSVD_12					(1ul << 35)
136 #define WARN_MASK_RSVD_11					(1ul << 36)
137 #define WARN_MASK_RSVD_10					(1ul << 37)
138 #define WARN_MASK_RSVD_9					(1ul << 38)
139 #define WARN_MASK_RSVD_8					(1ul << 39)
140 #define WARN_MASK_RSVD_7					(1ul << 40)
141 #define WARN_MASK_RSVD_6					(1ul << 41)
142 #define WARN_MASK_RSVD_5					(1ul << 42)
143 #define WARN_MASK_RSVD_4					(1ul << 43)
144 #define WARN_MASK_RSVD_3					(1ul << 44)
145 #define WARN_MASK_RSVD_2					(1ul << 45)
146 #define WARN_MASK_RSVD_1					(1ul << 46)
147 #define WARN_MASK_RSVD_0					(1ul << 47)
148 
149   // for bits 48 - 63, the sense will be reversed, in case we need anything else off
150   // by default
151 #define WARN_MASK_RSVD_OFF_15					(1ul << 48)
152 #define WARN_MASK_RSVD_OFF_14					(1ul << 49)
153 #define WARN_MASK_RSVD_OFF_13					(1ul << 50)
154 #define WARN_MASK_RSVD_OFF_12					(1ul << 51)
155 #define WARN_MASK_RSVD_OFF_11					(1ul << 52)
156 #define WARN_MASK_RSVD_OFF_10					(1ul << 53)
157 #define WARN_MASK_RSVD_OFF_9					(1ul << 54)
158 #define WARN_MASK_RSVD_OFF_8					(1ul << 55)
159 #define WARN_MASK_RSVD_OFF_7					(1ul << 56)
160 #define WARN_MASK_RSVD_OFF_6					(1ul << 57)
161 #define WARN_MASK_RSVD_OFF_5					(1ul << 58)
162 #define WARN_MASK_RSVD_OFF_4					(1ul << 59)
163 #define WARN_MASK_RSVD_OFF_3					(1ul << 60)
164 #define WARN_MASK_RSVD_OFF_2					(1ul << 61)
165 #define WARN_MASK_RSVD_OFF_1					(1ul << 62)
166 #define WARN_MASK_RSVD_OFF_0					(1ul << 63)
167 
168   char cmd_log[PATH_MAX];
169   char effect_command[PATH_MAX * 2];
170   char video_open_command[PATH_MAX * 2];
171   char audio_play_command[PATH_MAX * 2];
172   char cdplay_device[PATH_MAX];  ///< locale encoding
173   double default_fps;
174   boolean pause_effect_during_preview;
175   boolean open_decorated;
176   int sleep_time;
177   boolean pause_during_pb;
178   boolean fileselmax;
179   boolean show_recent;
180   int warn_file_size;
181   boolean midisynch;
182   int dl_bandwidth;
183   boolean conserve_space;
184   boolean ins_resample;
185   boolean show_tool;
186   short sepwin_type;
187 #define SEPWIN_TYPE_NON_STICKY 0
188 #define SEPWIN_TYPE_STICKY 1
189 
190   boolean show_player_stats;
191   //  boolean show_framecount; - use hide_framebar
192   boolean show_subtitles;
193   boolean loop_recording;
194   boolean discard_tv;
195   boolean save_directories;
196   int rec_opts;
197 #define REC_FRAMES	(1 << 0)
198 #define REC_FPS		(1 << 1)
199 #define REC_EFFECTS	(1 << 2)
200 #define REC_CLIPS	(1 << 3)
201 #define REC_AUDIO	(1 << 4)
202 #define REC_AFTER_PB	(1 << 5)
203 
204   int audio_src;
205 #define AUDIO_SRC_INT 0
206 #define AUDIO_SRC_EXT 1
207 
208   boolean no_bandwidth;
209   boolean osc_udp_started;
210   uint32_t osc_udp_port;
211 
212   boolean omc_noisy; ///< send success/fail
213   boolean omc_events; ///< send other events
214 
215   /// 0 = normal , -1 or 1: fresh install, 2: workdir set, 3: startup tests passed, 4: aud pl chosen, 5: pre interface seln., 100 setup complete
216   short startup_phase;
217   int ocp; ///< open_compression_percent : get/set in prefs
218 
219   boolean antialias;
220 
221   double fps_tolerance;
222 
223   short rte_keys_virtual;
224 
225   boolean show_msg_area;
226 
227   // values for trickplay - TODO: add to prefs dialog
228   double blendchange_amount;
229   int scratchfwd_amount, scratchback_amount;
230   double fpschange_amount;
231 
232   uint32_t jack_opts;
233 #define JACK_OPTS_TRANSPORT_CLIENT	(1 << 0)   ///< jack can start/stop
234 #define JACK_OPTS_TRANSPORT_MASTER	(1 << 1)  ///< transport master
235 #define JACK_OPTS_START_TSERVER		(1 << 2)     ///< start transport server
236 #define JACK_OPTS_NOPLAY_WHEN_PAUSED	(1 << 3) ///< play audio even when transport paused
237 #define JACK_OPTS_START_ASERVER		(1 << 4)     ///< start audio server
238 #define JACK_OPTS_TIMEBASE_START	(1 << 5)    ///< jack sets play start position
239 #define JACK_OPTS_TIMEBASE_CLIENT	(1 << 6)    ///< full timebase client
240 #define JACK_OPTS_TIMEBASE_MASTER	(1 << 7)   ///< timebase master (not implemented yet)
241 #define JACK_OPTS_NO_READ_AUTOCON	(1 << 8)   ///< do not auto con. rd clients when playing ext aud
242 #define JACK_OPTS_TIMEBASE_LSTART	(1 << 9)    ///< LiVES sets play start position
243 
244   char jack_tserver[PATH_MAX];
245   char jack_aserver[PATH_MAX];
246 
247   char *fxdefsfile;
248   char *fxsizesfile;
249   char *vppdefaultsfile;
250 
251   LiVESList *acodec_list;
252   int acodec_list_to_format[AUDIO_CODEC_NONE];
253 
254   volatile uint32_t audio_opts;
255 #define AUDIO_OPTS_FOLLOW_CLIPS		(1 << 0)
256 #define AUDIO_OPTS_FOLLOW_FPS		(1 << 1)
257 
258   boolean event_window_show_frame_events;
259   boolean crash_recovery; ///< TRUE==maintain mainw->recovery file
260 
261   boolean show_rdet; ///< show render details (frame size, encoder type) before saving to file
262 
263   boolean move_effects;
264 
265 #define DEF_MT_UNDO_SIZE 32 ///< MB
266 
267   int mt_undo_buf;
268   boolean mt_enter_prompt;
269 
270   int mt_def_width, mt_def_height;
271   double mt_def_fps;
272 
273   int mt_def_arate, mt_def_achans, mt_def_asamps, mt_def_signed_endian;
274 
275   boolean mt_exit_render;
276   boolean render_prompt;
277   boolean mt_show_ctx;
278   boolean mt_pertrack_audio;
279   int mt_backaudio;
280 
281   int mt_auto_back; ///< time diff to backup (-1 == never, 0 == after every change, > 0 == seconds)
282 
283   /// auto-reload
284   boolean ar_clipset, ar_layout;
285   char ar_clipset_name[128]; ///< locale
286   char ar_layout_name[PATH_MAX];  ///< locale
287 
288   boolean rec_desktop_audio;
289 
290   boolean show_gui;
291   boolean show_splash;
292   boolean show_playwin;
293 
294   boolean osc_start;
295 
296   boolean concat_images;
297 
298   boolean render_audio;
299   boolean normalise_audio;  ///< for future use
300 
301   boolean instant_open;
302   boolean auto_deint;
303   boolean auto_nobord;
304 
305   int gui_monitor;
306   int play_monitor;
307 
308   boolean force_single_monitor;
309 
310   boolean show_urgency_msgs;
311   boolean show_overlay_msgs;
312   boolean render_overlay;
313 
314   /// deprecated
315   int midi_check_rate;
316   int midi_rpt;
317 
318   uint32_t omc_dev_opts;
319 
320   char omc_js_fname[PATH_MAX];  ///< utf8
321   char omc_midi_fname[PATH_MAX]; ///< utf8
322 
323   boolean mouse_scroll_clips;
324 
325   int num_rtaudiobufs;
326 
327   boolean safe_symlinks;
328 
329 #ifdef ALSA_MIDI
330   boolean use_alsa_midi;
331   boolean alsa_midi_dummy;
332 #endif
333 
334   int midi_rcv_channel;
335 
336   int startup_interface;
337 
338 #define STARTUP_CE 0
339 #define STARTUP_MT 1
340 
341   boolean ce_maxspect;
342 
343   boolean lamp_buttons;
344 
345   boolean autoload_subs;
346 
347 #define DEF_REC_STOP_GB 10.
348   double rec_stop_gb;
349 
350   int max_modes_per_key; ///< maximum effect modes per key
351 
352   // autotransitioning in mt
353   int atrans_fx;
354   char def_autotrans[256];
355 
356   int nfx_threads;
357 
358   boolean alpha_post; ///< set to TRUE to force use of post alpha internally
359 
360   boolean stream_audio_out;
361   boolean unstable_fx;
362   boolean letterbox; ///< playback with letterbox
363   boolean letterbox_mt; ///< playback with letterbox (multitrack)
364   boolean enc_letterbox; ///< encode with letterbox
365 
366   boolean force_system_clock; /// < force system clock (rather than soundcard) for timing ( better for high framerates )
367 
368   boolean force64bit;
369 
370   boolean auto_trim_audio;
371   boolean keep_all_audio;
372 
373   /** default 0; 1==use old (bad) behaviour on bigendian machines (r/w bigend ints/doubles); 2==bad reads, good writes */
374   int bigendbug;
375 
376   // these are default values; actual values can be adjusted in Preferences
377 #define DEF_DS_WARN_LEVEL 2500000000  // 2.5 GB
378   uint64_t ds_warn_level; ///< diskspace warn level bytes
379 #define DEF_DS_CRIT_LEVEL 250000000 // 250MB
380   uint64_t ds_crit_level; ///< diskspace critical level bytes
381 
382 #define DEF_DISK_QUOTA 50  /// def 50 GiB
383   uint64_t disk_quota; /// (SOFT LIMIT) max space we can use for all our files (0 means unlimited (up to ds_crtical, HARD LIMIT))
384 
385 #define DEF_MSG_TEXTSIZE 4 // LIVES_FONTSIZE_LARGE (via lives_textsize_to_string())
386 #define DEF_MAX_MSGS 10000
387 
388 #define LIVES_CDISK_LEAVE_ORPHAN_SETS		(1 << 0)
389 #define LIVES_CDISK_LEAVE_BFILES		(1 << 1)
390 #define LIVES_CDISK_REMOVE_ORPHAN_LAYOUTS	(1 << 2)
391 #define LIVES_CDISK_LEAVE_MARKER_FILES		(1 << 3)
392 #define LIVES_CDISK_LEAVE_MISC_FILES		(1 << 4)
393 #define LIVES_CDISK_REMOVE_ORPHAN_CLIPS		(1 << 5) /// ! == recover
394 #define LIVES_CDISK_REMOVE_STALE_RECOVERY	(1 << 6)
395 #define LIVES_CDISK_LEAVE_EMPTY_DIRS		(1 << 7)
396 
397 #define LIVES_CDISK_REMOVE_LOCK_FILES		(1 << 16) ///< not yet implemented - TODO
398 #define LIVES_CDISK_REBUILD_ORDER_FILES		(1 << 17) ///< not yet implemented - TODO
399 
400 #define LIVES_CDISK_SEND_TO_TRASH		(1 << 31)
401 
402   uint32_t clear_disk_opts;
403 
404 #ifdef HAVE_YUV4MPEG
405   char yuvin[PATH_MAX];
406 #endif
407 
408   LiVESList *disabled_decoders;
409 
410   char backend_sync[PATH_MAX * 4];
411   char backend[PATH_MAX * 4];
412 
413   char weed_plugin_path[PATH_MAX];
414   char frei0r_path[PATH_MAX];
415   char ladspa_path[PATH_MAX];
416   char libvis_path[PATH_MAX];
417 
418   boolean present;
419 
420   boolean ce_thumb_mode;
421 
422   boolean show_button_images;
423 
424   boolean push_audio_to_gens;
425 
426   boolean perm_audio_reader;
427 
428   boolean funky_widgets;
429 
430   int max_disp_vtracks;
431 
432   boolean mt_load_fuzzy;
433 
434   boolean hide_framebar;
435 
436   boolean hfbwnp;
437 
438   boolean show_asrc;
439 
440   float ahold_threshold;
441 
442   double screen_gamma;
443 
444   int max_messages;
445   int msg_textsize;
446 
447   double screen_scale;
448 
449   boolean load_rfx_builtin;
450 
451   boolean apply_gamma;
452   boolean use_screen_gamma;
453   boolean btgamma; ///< allows clips to be *stored* with bt709 gamma - CAUTION not backwards compatible, untested
454 
455   boolean show_tooltips;
456 
457   float volume; ///< audio volume level (for jack and pulse)
458 
459   boolean vj_mode; // optimise for VJing (in progress, experimental)
460 
461   boolean allow_easing;
462 
463   boolean show_dev_opts;
464   boolean dev_show_dabg;
465   boolean dev_show_timing;
466 
467   boolean msgs_pbdis;
468 
469   boolean noframedrop;
470 
471   boolean back_compat;
472 
473   char pa_start_opts[255];
474   boolean pa_restart;
475 
476   boolean cb_is_switch;
477 
478   boolean interactive;
479   boolean extra_colours;
480   boolean pref_trash; ///< user prefers trash to delete
481   boolean autoclean; ///< remove temp files on shutdown / startup
482 
483   boolean show_desktop_panel;
484   boolean show_msgs_on_startup;
485   boolean show_disk_quota;
486   double quota_limit;
487 
488   boolean rr_crash;
489   int rr_qmode;
490   boolean rr_super;
491   boolean rr_pre_smooth;
492   boolean rr_qsmooth;
493   int rr_fstate;
494   boolean rr_amicro;
495   boolean rr_ramicro;
496 
497   char def_author[1024]; ///< TODO - add to prefs windo
498 } _prefs;
499 
500 enum {
501   LIST_ENTRY_GUI,
502   LIST_ENTRY_DECODING,
503   LIST_ENTRY_PLAYBACK,
504   LIST_ENTRY_RECORDING,
505   LIST_ENTRY_ENCODING,
506   LIST_ENTRY_EFFECTS,
507   LIST_ENTRY_DIRECTORIES,
508   LIST_ENTRY_WARNINGS,
509   LIST_ENTRY_MISC,
510   LIST_ENTRY_THEMES,
511   LIST_ENTRY_NET,
512   LIST_ENTRY_JACK,
513   LIST_ENTRY_MIDI,
514   LIST_ENTRY_MULTITRACK
515 };
516 
517 enum {
518   LIST_ICON = 0,
519   LIST_ITEM,
520   LIST_NUM,
521   N_COLUMNS
522 };
523 
524 #define PREFWIN_WIDTH (GUI_SCREEN_WIDTH * .9)
525 #define PREFWIN_HEIGHT (GUI_SCREEN_HEIGHT * .9)
526 
527 #define DS_WARN_CRIT_MAX 1000000. ///< MB. (default 1 TB)
528 
529 /// prefs window
530 typedef struct {
531   ulong encoder_ofmt_fn;
532   ulong encoder_name_fn;
533   ulong close_func;
534   LiVESAccelGroup *accel_group;
535 
536   LiVESWidget *prefs_dialog;
537 
538   LiVESWidget *prefs_list;
539   LiVESWidget *prefs_table;
540   LiVESWidget *tlabel;
541   LiVESWidget *vbox_right_gui;
542   LiVESWidget *vbox_right_multitrack;
543   LiVESWidget *vbox_right_decoding;
544   LiVESWidget *vbox_right_playback;
545   LiVESWidget *vbox_right_recording;
546   LiVESWidget *vbox_right_encoding;
547   LiVESWidget *vbox_right_effects;
548   LiVESWidget *table_right_directories;
549   LiVESWidget *vbox_right_warnings;
550   LiVESWidget *vbox_right_misc;
551   LiVESWidget *vbox_right_themes;
552   LiVESWidget *vbox_right_net;
553   LiVESWidget *vbox_right_jack;
554   LiVESWidget *vbox_right_midi;
555   LiVESWidget *scrollw_right_gui;
556   LiVESWidget *scrollw_right_multitrack;
557   LiVESWidget *scrollw_right_decoding;
558   LiVESWidget *scrollw_right_playback;
559   LiVESWidget *scrollw_right_recording;
560   LiVESWidget *scrollw_right_encoding;
561   LiVESWidget *scrollw_right_effects;
562   LiVESWidget *scrollw_right_directories;
563   LiVESWidget *scrollw_right_warnings;
564   LiVESWidget *scrollw_right_misc;
565   LiVESWidget *scrollw_right_themes;
566   LiVESWidget *scrollw_right_net;
567   LiVESWidget *scrollw_right_jack;
568   LiVESWidget *scrollw_right_midi;
569   LiVESWidget *right_shown;
570   LiVESWidget *revertbutton;
571   LiVESWidget *applybutton;
572   LiVESWidget *closebutton;
573   LiVESWidget *stop_screensaver_check;
574   LiVESWidget *open_maximised_check;
575   LiVESWidget *show_tool;
576   LiVESWidget *mouse_scroll;
577   LiVESWidget *fs_max_check;
578   LiVESWidget *recent_check;
579   LiVESWidget *checkbutton_lb; //< letterbox
580   LiVESWidget *checkbutton_lbmt;
581   LiVESWidget *checkbutton_screengamma;
582   LiVESWidget *spinbutton_gamma;
583   LiVESWidget *video_open_entry;
584   LiVESWidget *audio_command_entry;
585   LiVESWidget *vid_load_dir_entry;
586   LiVESWidget *vid_save_dir_entry;
587   LiVESWidget *audio_dir_entry;
588   LiVESWidget *image_dir_entry;
589   LiVESWidget *proj_dir_entry;
590   LiVESWidget *workdir_entry;
591   LiVESWidget *cdplay_entry;
592   LiVESWidget *spinbutton_def_fps;
593   LiVESWidget *pbq_combo;
594   LiVESWidget *pbq_adaptive;
595   LiVESWidget *ofmt_combo;
596   LiVESWidget *audp_combo;
597   LiVESWidget *pa_gens;
598   LiVESWidget *rframes;
599   LiVESWidget *rfps;
600   LiVESWidget *rclips;
601   LiVESWidget *reffects;
602   LiVESWidget *raudio;
603   LiVESWidget *rextaudio;
604   LiVESWidget *rintaudio;
605   LiVESWidget *rdesk_audio;
606   LiVESWidget *rr_crash;
607   LiVESWidget *rr_super;
608   LiVESWidget *rr_combo;
609   LiVESWidget *rr_pre_smooth;
610   LiVESWidget *rr_qsmooth;
611   LiVESWidget *rr_scombo;
612   LiVESWidget *rr_amicro;
613   LiVESWidget *rr_ramicro;
614   LiVESWidget *encoder_combo;
615   LiVESWidget *checkbutton_load_rfx;
616   LiVESWidget *checkbutton_apply_gamma;
617   LiVESWidget *checkbutton_antialias;
618   LiVESWidget *checkbutton_threads;
619   LiVESWidget *spinbutton_warn_ds;
620   LiVESWidget *spinbutton_crit_ds;
621   LiVESWidget *dsl_label;
622   LiVESWidget *dsc_label;
623   LiVESWidget *checkbutton_warn_fps;
624   LiVESWidget *checkbutton_warn_mplayer;
625   LiVESWidget *checkbutton_warn_save_set;
626   LiVESWidget *checkbutton_warn_dup_set;
627   LiVESWidget *checkbutton_warn_rendered_fx;
628   LiVESWidget *checkbutton_warn_encoders;
629   LiVESWidget *checkbutton_warn_layout_clips;
630   LiVESWidget *checkbutton_warn_layout_close;
631   LiVESWidget *checkbutton_warn_layout_delete;
632   LiVESWidget *checkbutton_warn_layout_alter;
633   LiVESWidget *checkbutton_warn_layout_shift;
634   LiVESWidget *checkbutton_warn_layout_adel;
635   LiVESWidget *checkbutton_warn_layout_aalt;
636   LiVESWidget *checkbutton_warn_layout_ashift;
637   LiVESWidget *checkbutton_warn_layout_popup;
638   LiVESWidget *checkbutton_warn_discard_layout;
639   LiVESWidget *checkbutton_warn_after_dvgrab;
640   LiVESWidget *checkbutton_warn_no_pulse;
641   LiVESWidget *checkbutton_warn_layout_wipe;
642   LiVESWidget *checkbutton_warn_layout_gamma;
643   LiVESWidget *checkbutton_warn_layout_lb;
644   LiVESWidget *checkbutton_warn_vjmode_enter;
645   LiVESWidget *checkbutton_show_stats;
646   LiVESWidget *checkbutton_warn_fsize;
647   LiVESWidget *checkbutton_warn_mt_achans;
648   LiVESWidget *checkbutton_warn_mt_no_jack;
649   LiVESWidget *checkbutton_warn_yuv4m_open;
650   LiVESWidget *checkbutton_warn_mt_backup_space;
651   LiVESWidget *checkbutton_warn_after_crash;
652   LiVESWidget *checkbutton_warn_invalid_clip;
653   LiVESWidget *spinbutton_warn_fsize;
654   LiVESWidget *spinbutton_bwidth;
655   LiVESWidget *theme_combo;
656   LiVESWidget *cbutton_fore;
657   LiVESWidget *cbutton_back;
658   LiVESWidget *cbutton_mabf;
659   LiVESWidget *cbutton_mab;
660   LiVESWidget *cbutton_infot;
661   LiVESWidget *cbutton_infob;
662   LiVESWidget *fb_filebutton;
663   LiVESWidget *se_filebutton;
664   LiVESWidget *theme_style2;
665   LiVESWidget *theme_style3;
666   LiVESWidget *theme_style4;
667 
668   LiVESWidget *cbutton_fsur;
669   LiVESWidget *cbutton_evbox;
670   LiVESWidget *cbutton_mtmark;
671   LiVESWidget *cbutton_tlreg;
672   LiVESWidget *cbutton_tcfg;
673   LiVESWidget *cbutton_tcbg;
674   LiVESWidget *cbutton_vidcol;
675   LiVESWidget *cbutton_audcol;
676   LiVESWidget *cbutton_fxcol;
677   LiVESWidget *cbutton_cesel;
678   LiVESWidget *cbutton_ceunsel;
679 
680   LiVESWidget *check_midi;
681   LiVESWidget *ins_speed;
682   LiVESWidget *jpeg;
683   LiVESWidget *mt_enter_prompt;
684   LiVESWidget *spinbutton_ocp;
685   LiVESWidget *nmessages_spin;
686   LiVESWidget *msgs_unlimited;
687   LiVESWidget *msgs_pbdis;
688   LiVESWidget *msg_textsize_combo;
689   LiVESWidget *acodec_combo;
690   LiVESWidget *spinbutton_osc_udp;
691   LiVESWidget *spinbutton_rte_keys;
692   LiVESWidget *spinbutton_nfx_threads;
693   LiVESWidget *enable_OSC;
694   LiVESWidget *enable_OSC_start;
695   LiVESWidget *jack_tserver_entry;
696   LiVESWidget *jack_aserver_entry;
697   LiVESWidget *checkbutton_jack_master;
698   LiVESWidget *checkbutton_jack_client;
699   LiVESWidget *checkbutton_jack_tb_start;
700   LiVESWidget *checkbutton_jack_mtb_start;
701   LiVESWidget *checkbutton_jack_tb_client;
702   LiVESWidget *checkbutton_jack_pwp;
703   LiVESWidget *checkbutton_jack_read_autocon;
704   LiVESWidget *checkbutton_start_tjack;
705   LiVESWidget *checkbutton_start_ajack;
706   LiVESWidget *checkbutton_parestart;
707   LiVESWidget *checkbutton_afollow;
708   LiVESWidget *checkbutton_aclips;
709   LiVESWidget *spinbutton_ext_aud_thresh;
710   LiVESWidget *spinbutton_mt_def_width;
711   LiVESWidget *spinbutton_mt_def_height;
712   LiVESWidget *spinbutton_mt_def_fps;
713   LiVESWidget *spinbutton_mt_undo_buf;
714   LiVESWidget *spinbutton_mt_ab_time;
715   LiVESWidget *spinbutton_max_disp_vtracks;
716   LiVESWidget *spinbutton_rec_gb;
717   LiVESWidget *mt_autoback_every;
718   LiVESWidget *mt_autoback_always;
719   LiVESWidget *mt_autoback_never;
720   LiVESWidget *spinbutton_gmoni;
721   LiVESWidget *spinbutton_pmoni;
722   LiVESWidget *ce_thumbs;
723   LiVESWidget *checkbutton_mt_exit_render;
724   LiVESWidget *pertrack_checkbutton;
725   LiVESWidget *backaudio_checkbutton;
726   LiVESWidget *checkbutton_render_prompt;
727   LiVESWidget *checkbutton_instant_open;
728   LiVESWidget *checkbutton_auto_deint;
729   LiVESWidget *checkbutton_auto_trim;
730   LiVESWidget *checkbutton_nobord;
731   LiVESWidget *checkbutton_concat_images;
732   LiVESWidget *checkbutton_show_asrc;
733   LiVESWidget *checkbutton_show_ttips;
734   LiVESWidget *checkbutton_hfbwnp;
735   LiVESWidget *forcesmon;
736   LiVESWidget *forcesmon_hbox;
737   LiVESWidget *cb_show_msgstart;
738   LiVESWidget *cb_show_quota;
739   LiVESWidget *cb_autoclean;
740   LiVESList *pbq_list;
741   char *audp_name;
742   char *orig_audp_name;
743   ulong audp_entry_func;
744   LiVESWidget *checkbutton_omc_js;
745   LiVESWidget *checkbutton_omc_midi;
746   LiVESWidget *omc_js_entry;
747   LiVESWidget *omc_midi_entry;
748   LiVESWidget *spinbutton_midicr;
749   LiVESWidget *spinbutton_midirpt;
750   LiVESWidget *midichan_combo;
751   LiVESWidget *alsa_midi;
752   LiVESWidget *alsa_midi_dummy;
753   LiVESWidget *button_midid;
754   LiVESWidget *rb_startup_ce;
755   LiVESWidget *rb_startup_mt;
756   LiVESWidget *jack_int_label;
757   LiVESWidget *checkbutton_ce_maxspect;
758   LiVESWidget *checkbutton_button_icons;
759   LiVESWidget *checkbutton_extra_colours;
760   LiVESWidget *workdir_label;
761   LiVESWidget *checkbutton_stream_audio;
762   LiVESWidget *checkbutton_rec_after_pb;
763   LiVESWidget *wpp_entry;
764   LiVESWidget *frei0r_entry;
765   LiVESWidget *ladspa_entry;
766   LiVESWidget *libvis_entry;
767   LiVESWidget *cdda_hbox;
768   LiVESWidget *midi_hbox;
769   LiVESWidget *frameblank_entry;
770   LiVESWidget *sepimg_entry;
771   LiVESWidget *def_author_entry;
772   LiVESWidget *dialog_hpaned;
773   LiVESTreeSelection *selection;
774 
775   boolean ignore_apply; ///< dont light the apply button when thing changes (for external calls), normally FALSE
776   boolean needs_restart;
777 } _prefsw;
778 
779 /// startup overrides from commandline
780 typedef struct {
781   boolean ign_clipset;
782   boolean ign_layout;
783   boolean ign_osc;
784   boolean ign_jackopts;
785   boolean ign_aplayer;
786   boolean ign_asource;
787   boolean ign_stmode;
788   boolean ign_vppdefs;
789   boolean ign_vjmode;
790   boolean ign_dscrit;
791   boolean ign_configfile;
792   boolean ign_config_datadir;
793 } _ign_opts;
794 
795 typedef struct {
796   // if a pref also has an entry in future_prefs, be wary of changing its value
797   // seek to understand why it has a variant value
798 
799   char workdir[PATH_MAX];
800   char theme[64];
801   char vpp_name[64]; ///< new video playback plugin
802 
803   int vpp_fixed_fps_numer;
804   int vpp_fixed_fps_denom;
805 
806   double vpp_fixed_fpsd;
807 
808   int vpp_palette;
809   int vpp_YUV_clamping;
810 
811   int vpp_fwidth;
812   int vpp_fheight;
813 
814   int vpp_argc;
815   int nfx_threads;
816 
817   char **vpp_argv;
818   uint64_t disk_quota;
819 
820   _encoder encoder;
821 
822   boolean show_recent;
823 
824   boolean osc_start;
825   int startup_interface;
826 
827   uint32_t jack_opts;
828   int audio_src;
829 
830   uint32_t audio_opts;
831   short pb_quality;
832   short sepwin_type;
833 
834   LiVESList *disabled_decoders;
835   LiVESList *disabled_decoders_new;
836 
837   volatile float volume; ///< audio volume level (for jack and pulse)
838 
839   boolean vj_mode;
840   boolean ar_clipset;
841 
842   int msg_textsize;
843   boolean pref_trash; ///< user prefers trash to delete (future / present swapped)
844   boolean letterbox_mt;
845 } _future_prefs;
846 
847 _prefs *prefs;
848 _future_prefs *future_prefs;
849 _prefsw *prefsw;
850 
851 void set_acodec_list_from_allowed(_prefsw *, render_details *);
852 void  rdet_acodec_changed(LiVESCombo *acodec_combo, livespointer user_data);
853 
854 void set_vpp(boolean set_in_prefs);
855 
856 _prefsw *create_prefs_dialog(LiVESWidget *saved_dialog);
857 boolean on_prefs_delete_event(LiVESWidget *, LiVESXEvent *, livespointer prefsw);
858 void on_preferences_activate(LiVESMenuItem *, livespointer);
859 void on_prefs_close_clicked(LiVESButton *, livespointer);
860 void on_prefs_revert_clicked(LiVESButton *, livespointer);
861 void on_prefs_apply_clicked(LiVESButton *, livespointer user_data);
862 void on_prefs_page_changed(LiVESTreeSelection *, _prefsw *);
863 void populate_combo_box(LiVESCombo *, LiVESList *data);
864 void set_combo_box_active_string(LiVESCombo *, char *active_str);
865 
866 void prefsw_set_astream_settings(_vid_playback_plugin *, _prefsw *);
867 void prefsw_set_rec_after_settings(_vid_playback_plugin *, _prefsw *);
868 
869 void pref_change_images(void);
870 void pref_change_xcolours(void);
871 void pref_change_colours(void);
872 
873 void apply_button_set_enabled(LiVESWidget *widget, livespointer func_data);
874 
875 // TODO:
876 /*typedef struct {
877   const char *pref_name;
878   int type;
879   } lives_preference;
880 
881   const lives_preference [] = {
882   {PREF_REC_EXT_AUDIO, WEED_SEED_BOOL},
883   };
884 
885   then:
886 
887   widget = lives_standard_widget_for_pref(const char *prefname, const char *label, val, min, max, step, page, dp, box, rb_group_or_combo_list, tooltip);
888 */
889 
890 // NOTE: the following definitions must match with equivalent keys in smogrify
891 
892 #define PREF_REC_EXT_AUDIO "rec_ext_audio"
893 #define PREF_AUDIO_OPTS "audio_opts"
894 #define PREF_SEPWIN_TYPE "sepwin_type"
895 #define PREF_MT_EXIT_RENDER "mt_exit_render"
896 
897 // factories non-cpp
898 #define PREF_SHOW_ASRC "show_audio_src"
899 #define PREF_HFBWNP "hide_framebar_when_not_playing"
900 
901 // normal prefs
902 
903 /////////////////// string values
904 
905 #define PREF_WORKING_DIR "workdir"
906 #define PREF_WORKING_DIR_OLD "tempdir"
907 #define PREF_PREFIX_DIR "prefix_dir" // readonly
908 #define PREF_LIB_DIR "lib_dir" // readonly
909 
910 #define PREF_AUDIO_PLAYER "audio_player"
911 #define PREF_AUDIO_SRC "audio_src"
912 
913 #define PREF_MONITORS "monitors"
914 
915 #define PREF_LADSPA_PATH "ladspa_path"
916 #define PREF_WEED_PLUGIN_PATH "weed_plugin_path"
917 #define PREF_FREI0R_PATH "frei0r_path"
918 #define PREF_LIBVISUAL_PATH "libvis_path"
919 
920 #define PREF_VID_PLAYBACK_PLUGIN "vid_playback_plugin"
921 
922 #define PREF_DEFAULT_IMAGE_TYPE "default_image_format"
923 
924 #define PREF_VIDEO_OPEN_COMMAND "video_open_command"
925 
926 #define PREF_GUI_THEME "gui_theme"
927 
928 #define PREF_ENCODER "encoder"
929 #define PREF_OUTPUT_TYPE "output_type"
930 
931 #define PREF_CDPLAY_DEVICE "cdplay_device"
932 
933 #define PREF_AR_LAYOUT "ar_layout"
934 #define PREF_AR_CLIPSET "ar_clipset"
935 
936 #define PREF_ACTIVE_AUTOTRANS "active_autotrans"
937 
938 #define PREF_SCREEN_SCALE "screen_scale"
939 #define PREF_PASTARTOPTS "pa_start_opts"
940 
941 #define PREF_DEF_AUTHOR "default_author_name"
942 
943 ////////////////////// utf8 values
944 
945 #define PREF_OMC_MIDI_FNAME "omc_midi_fname"
946 #define PREF_OMC_JS_FNAME "omc_js_fname"
947 
948 #define PREF_IMAGE_DIR "image_dir"
949 #define PREF_AUDIO_DIR "audio_dir"
950 
951 #define PREF_PROJ_DIR "proj_dir"
952 
953 #define PREF_VID_SAVE_DIR "vid_save_dir"
954 #define PREF_VID_LOAD_DIR "vid_load_dir"
955 
956 #define PREF_RECENT "recent"
957 
958 /////////////////// integer64 values
959 #define PREF_DS_WARN_LEVEL "ds_warn_level"
960 #define PREF_DS_CRIT_LEVEL "ds_crit_level"
961 #define PREF_DISK_QUOTA "disk_quota"
962 
963 /////////////////// integer32 values
964 #define PREF_STARTUP_PHASE "startup_phase"
965 
966 #define PREF_STARTUP_INTERFACE "startup_interface"
967 
968 #define PREF_LIVES_WARNING_MASK "lives_warning_mask"
969 #define PREF_OPEN_COMPRESSION_PERCENT "open_compression_percent"
970 
971 #define PREF_PB_QUALITY "pb_quality"
972 
973 #define PREF_REC_STOP_GB "rec_stop-gb"
974 
975 #define PREF_NFX_THREADS "nfx_threads"
976 
977 #define PREF_BTGAMMA "experimental_bt709_gamma"
978 #define PREF_USE_SCREEN_GAMMA "use_screen_gamma"
979 #define PREF_SCREEN_GAMMA "screen_gamma"
980 
981 #define PREF_CLEAR_DISK_OPTS "clear_disk_opts"
982 
983 #define PREF_MAX_DISP_VTRACKS "max_disp_vtracks"
984 
985 #define PREF_MAX_MSGS "max_text_messages"
986 #define PREF_MSG_TEXTSIZE "msg_textsize"
987 #define PREF_MSG_PBDIS "msg_disable_during_playback"
988 
989 #define PREF_NOFRAMEDROP "no_framedrop"
990 
991 #define PREF_RTE_KEYS_VIRTUAL "rte_keys_virtual"
992 
993 #define PREF_JACK_OPTS "jack_opts"
994 
995 #define PREF_MIDI_CHECK_RATE "midi_check_rate"
996 #define PREF_MIDI_RPT "midi_rpt"
997 
998 #define PREF_MIDI_RCV_CHANNEL "midi_rcv_channel"
999 
1000 #define PREF_ENCODER_ACODEC "encoder_acodec"
1001 
1002 #define PREF_RECORD_OPTS "record_opts"
1003 
1004 #define PREF_OMC_DEV_OPTS "omc_dev_opts"
1005 #define PREF_OSC_PORT "osc_port"
1006 
1007 #define PREF_MT_DEF_WIDTH "mt_def_width"
1008 #define PREF_MT_DEF_HEIGHT "mt_def_height"
1009 #define PREF_MT_DEF_ARATE "mt_def_arate"
1010 #define PREF_MT_DEF_ACHANS "mt_def_achans"
1011 #define PREF_MT_DEF_ASAMPS "mt_def_asamps"
1012 #define PREF_MT_DEF_SIGNED_ENDIAN "mt_def_signed_endian"
1013 
1014 #define PREF_MT_AUTO_BACK "mt_auto_back"
1015 #define PREF_MT_UNDO_BUF "mt_undo_buf"
1016 
1017 #define PREF_MT_BACKAUDIO "mt_backaudio"
1018 #define PREF_MT_SHOW_CTX "mt_show_ctx"
1019 #define PREF_WARN_FILE_SIZE "warn_file_size"
1020 
1021 #define PREF_DL_BANDWIDTH_K "dl_bandwidth_K"
1022 
1023 #define PREF_SCFWD_AMOUNT "trickplay_scratch_fwd"
1024 #define PREF_SCBACK_AMOUNT "trickplay_scratch_back"
1025 
1026 #define PREF_RRQMODE "recrender_quant_mode"
1027 #define PREF_RRFSTATE "recrender_fx_posn_state"
1028 
1029 ////////// boolean values
1030 #define PREF_SHOW_RECENT_FILES "show_recent_files"
1031 #define PREF_FORCE_SINGLE_MONITOR "force_single_monitor"
1032 #define PREF_STOP_SCREENSAVER "stop_screensaver"
1033 #define PREF_MT_ENTER_PROMPT "mt_enter_prompt"
1034 #define PREF_MT_EXIT_RENDER "mt_exit_render"
1035 #define PREF_RENDER_PROMPT "render_prompt"
1036 #define PREF_MT_PERTRACK_AUDIO "mt_pertrack_audio"
1037 #define PREF_OSC_START "osc_start"
1038 #define PREF_SHOW_TOOLBAR "show_toolbar"
1039 #define PREF_CE_MAXSPECT "ce_maxspect"
1040 #define PREF_OPEN_MAXIMISED "open_maximised"
1041 #define PREF_AUTO_TRIM_PAD_AUDIO "auto_trim_pad_audio"
1042 #define PREF_KEEP_ALL_AUDIO "never_trim_audio"
1043 #define PREF_MOUSE_SCROLL_CLIPS "mouse_scroll_clips"
1044 #define PREF_SHOW_BUTTON_ICONS "show_button_icons"
1045 #define PREF_STREAM_AUDIO_OUT "stream_audio_out"
1046 #define PREF_CE_THUMB_MODE "ce_thumb_mode"
1047 #define PREF_LOAD_RFX_BUILTIN "load_rfx_builtin"
1048 #define PREF_ANTIALIAS "antialias"
1049 #define PREF_FILESEL_MAXIMISED "filesel_maximised"
1050 #define PREF_SHOW_PLAYER_STATS "show_player_stats"
1051 #define PREF_INSTANT_OPEN "instant_open"
1052 #define PREF_MIDISYNCH "midisynch"
1053 #define PREF_AUTO_DEINTERLACE "auto_deinterlace"
1054 #define PREF_AUTO_CUT_BORDERS "auto_cut_borders"
1055 #define PREF_REC_DESKTOP_AUDIO "rec_desktop_audio"
1056 #define PREF_INSERT_RESAMPLE "insert_resample"
1057 #define PREF_CONCAT_IMAGES "concat_images"
1058 #define PREF_SAVE_DIRECTORIES "save_directories"
1059 #define PREF_CONSERVE_SPACE "conserve_space"
1060 #define PREF_PUSH_AUDIO_TO_GENS "push_audio_to_gens"
1061 #define PREF_APPLY_GAMMA "apply_gamma"
1062 #define PREF_SHOW_TOOLTIPS "show_tooltips"
1063 #define PREF_SHOW_URGENCY "show_urgency_messages"
1064 #define PREF_SHOW_OVERLAY_MSGS "show_overlay_messages"
1065 #define PREF_UNSTABLE_FX "allow_unstable_effects"
1066 #define PREF_ALLOW_EASING "allow_easing"
1067 #define PREF_SHOW_DEVOPTS "show_developer_options"
1068 #define PREF_VJMODE "vj_mode_startup"
1069 #define PREF_LETTERBOX "letterbox_ce"
1070 #define PREF_LETTERBOXMT "letterbox_mt"
1071 #define PREF_PARESTART "pa_restart"
1072 #define PREF_PBQ_ADAPTIVE "pb_quality_adaptive"
1073 #define PREF_EXTRA_COLOURS "extra_colours" /// add to prefs window
1074 #define PREF_SHOW_SUBS "show_subtitles" /// add to prefs window
1075 #define PREF_AUTOLOAD_SUBS "autoload_subtitles" /// add to prefs window
1076 #define PREF_AUTOCLEAN_TRASH "autoclean_trash" ///< remove unneeded files on shutdown / startup
1077 #define PREF_PREF_TRASH "prefer_trash" ///< prefer trash to delete
1078 #define PREF_MSG_START "show_msgs_on_startup" /// pop up msgs box on startup
1079 #define PREF_SHOW_QUOTA "show_quota_on_startup" /// pop up quota box on startup
1080 
1081 #define PREF_RRCRASH "recrender_crash_protection" /// option for rendering recordings
1082 #define PREF_RRSUPER "recrender_super" /// option for rendering recordings
1083 #define PREF_RRPRESMOOTH "recrender_presmooth" /// option for rendering recordings
1084 #define PREF_RRQSMOOTH "recrender_qsmooth" /// option for rendering recordings
1085 #define PREF_RRAMICRO "recrender_amicro" /// option for rendering recordings
1086 #define PREF_RRRAMICRO "recrender_rend_amicro" /// option for rendering recordings
1087 
1088 #define PREF_BACK_COMPAT "backwards_compatibility" ///< forces backwards compatibility with earlier versions
1089 
1090 ////////// double values
1091 #define PREF_MT_DEF_FPS "mt_def_fps"
1092 #define PREF_DEFAULT_FPS "default_fps"
1093 
1094 #define PREF_BLEND_AMOUNT "trickplay_blend_change"
1095 #define PREF_FPSCHANGE_AMOUNT "trickplay_fpschange"
1096 
1097 ///////// float values
1098 #define PREF_AHOLD_THRESHOLD "ahold_threshold"
1099 #define PREF_MASTER_VOLUME "master_volume"
1100 
1101 ////////// list values
1102 #define PREF_DISABLED_DECODERS "disabled_decoders"
1103 
1104 boolean pref_factory_bool(const char *prefidx, boolean newval, boolean permanent);
1105 boolean pref_factory_string(const char *prefidx, const char *newval, boolean permanent);
1106 boolean pref_factory_int(const char *prefidx, int newval, boolean permanent);
1107 boolean pref_factory_int64(const char *prefidx, int64_t newval, boolean permanent);
1108 boolean pref_factory_float(const char *prefidx, float newval, boolean permanent);
1109 boolean pref_factory_bitmapped(const char *prefidx, int bitfield, boolean newval, boolean permanent);
1110 boolean pref_factory_string_choice(const char *prefidx, LiVESList *list, const char *strval, boolean permanent);
1111 
1112 boolean has_pref(const char *key);
1113 
1114 LiVESResponseType get_pref_from_file(const char *filename, const char *key, char *val, int maxlen);
1115 
1116 int get_utf8_pref(const char *key, char *val, int maxlen);
1117 LiVESResponseType get_string_pref(const char *key, char *val, int maxlen);
1118 LiVESResponseType get_string_prefd(const char *key, char *val, int maxlen, const char *def);
1119 boolean get_boolean_pref(const char *key);
1120 double get_double_pref(const char *key);
1121 double get_double_prefd(const char *key, double defval);
1122 int get_int_pref(const char *key);
1123 LiVESList *get_list_pref(const char *key);
1124 boolean get_colour_pref(const char *key, lives_colRGBA64_t *lcol);
1125 boolean get_theme_colour_pref(const char *key, lives_colRGBA64_t *lcol);
1126 
1127 boolean get_boolean_prefd(const char *key, boolean defval);
1128 int get_int_prefd(const char *key, int defval);
1129 int64_t get_int64_prefd(const char *key, int64_t defval);
1130 
1131 int delete_pref(const char *key);
1132 
1133 int set_string_pref(const char *key, const char *value);
1134 int set_string_pref_priority(const char *key, const char *value);
1135 int set_utf8_pref(const char *key, const char *value);
1136 int set_boolean_pref(const char *key, boolean value);
1137 int set_double_pref(const char *key, double value);
1138 int set_int_pref(const char *key, int value);
1139 int set_int64_pref(const char *key, int64_t value);
1140 int set_list_pref(const char *key, LiVESList *values);
1141 int set_colour_pref(const char *key, lives_colRGBA64_t *lcol);
1142 void set_theme_pref(const char *themefile, const char *key, const char *value);
1143 void set_theme_colour_pref(const char *themefile, const char *key, lives_colRGBA64_t *lcol);
1144 
1145 boolean apply_prefs(boolean skip_warnings);
1146 void save_future_prefs(void);
1147 
1148 void set_palette_prefs(boolean save);
1149 
1150 void toggle_sets_pref(LiVESWidget *widget, livespointer prefidx);
1151 
1152 // permissions
1153 
1154 #define LIVES_PERM_INVALID 0
1155 #define LIVES_PERM_OSC_PORTS 1
1156 #define LIVES_PERM_DOWNLOAD_LOCAL 2
1157 #define LIVES_PERM_COPY_LOCAL 3
1158 
1159 boolean lives_ask_permission(char **argv, int argc, int offs);
1160 #endif
1161