no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / interfaceprefs.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "deleteallindexes.h"
23 #include "edl.h"
24 #include "edlsession.h"
25 #include "file.h"
26 #include "filesystem.h"
27 #include "language.h"
28 #include "mwindow.h"
29 #include "preferences.h"
30 #include "preferencesthread.h"
31 #include "probeprefs.h"
32 #include "interfaceprefs.h"
33 #include "shbtnprefs.h"
34 #include "theme.h"
35
36 #define MOVE_RIPPLE_TITLE N_("All Edits (ripple)")
37 #define MOVE_ROLL_TITLE   N_("One Edit  (roll)")
38 #define MOVE_SLIP_TITLE   N_("Src Only  (slip)")
39 #define MOVE_SLIDE_TITLE  N_("Move Edit (slide)")
40 #define MOVE_EDGE_TITLE   N_("Drag Edge (edge)")
41 #define MOVE_EDITS_DISABLED_TITLE N_("No effect")
42
43
44 InterfacePrefs::InterfacePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
45  : PreferencesDialog(mwindow, pwindow)
46 {
47         min_db = 0;
48         max_db = 0;
49         shbtn_dialog = 0;
50         file_probe_dialog = 0;
51 }
52
53 InterfacePrefs::~InterfacePrefs()
54 {
55         delete min_db;
56         delete max_db;
57         delete shbtn_dialog;
58         delete file_probe_dialog;
59 }
60
61
62 void InterfacePrefs::create_objects()
63 {
64         int xs4 = xS(4), xs5 = xS(5), xs10 = xS(10), xs30 = xS(30);
65         int ys5 = yS(5), ys10 = yS(10), ys30 = yS(30), ys35 = yS(35);
66         BC_Resources *resources = BC_WindowBase::get_resources();
67         int margin = mwindow->theme->widget_border;
68         char string[BCTEXTLEN];
69         int x0 = mwindow->theme->preferencesoptions_x;
70         int y0 = mwindow->theme->preferencesoptions_y;
71         int x = x0, y = y0;
72
73         add_subwindow(new BC_Title(x, y, _("Editing:"), LARGEFONT,
74                 resources->text_default));
75         y += ys35;
76
77         int x2 = get_w()/2, y2 = y;
78         x = x2;
79         BC_Title *title;
80         add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
81         y += title->get_h() + ys5;
82         keyframe_reticle = new KeyframeReticle(pwindow, this, x, y,
83                 &pwindow->thread->preferences->keyframe_reticle);
84         add_subwindow(keyframe_reticle);
85         keyframe_reticle->create_objects();
86
87         y += ys30;
88         add_subwindow(title = new BC_Title(x, y, _("Snapshot path:")));
89         y += title->get_h() + ys5;
90         add_subwindow(snapshot_path = new SnapshotPathText(pwindow, this, x, y, get_w()-x-xs30));
91
92         x = x0;  y = y2;
93         add_subwindow(title = new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
94         y += title->get_h() + ys10;
95         add_subwindow(new BC_Title(x, y, _("Button 1:")));
96         int x1 = x + xS(100);
97
98         ViewBehaviourText *text;
99         add_subwindow(text = new ViewBehaviourText(x1, y - ys5,
100                 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]),
101                         pwindow,
102                         &(pwindow->thread->edl->session->edit_handle_mode[0])));
103         text->create_objects();
104         y += ys30;
105         add_subwindow(new BC_Title(x, y, _("Button 2:")));
106         add_subwindow(text = new ViewBehaviourText(x1,
107                 y - ys5,
108                 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]),
109                         pwindow,
110                         &(pwindow->thread->edl->session->edit_handle_mode[1])));
111         text->create_objects();
112         y += ys30;
113         add_subwindow(new BC_Title(x, y, _("Button 3:")));
114         add_subwindow(text = new ViewBehaviourText(x1, y - ys5,
115                 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]),
116                         pwindow,
117                         &(pwindow->thread->edl->session->edit_handle_mode[2])));
118         text->create_objects();
119         y += text->get_h() + ys30;
120
121         x = x0;
122         add_subwindow(new BC_Bar(xs5, y, get_w() - xs10));
123         y += ys5;
124         add_subwindow(new BC_Title(x, y, _("Operation:"), LARGEFONT,
125                 resources->text_default));
126
127         int y1 = y;
128         y += yS(15);
129
130         AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y);
131         add_subwindow(android_remote);
132         y += android_remote->get_h() + ys10;
133         int x3 = x2;
134         add_subwindow(title = new BC_Title(x3, y, _("Port:")));
135         x3 += title->get_w() + margin;
136         AndroidPort *android_port = new AndroidPort(pwindow, x3, y);
137         add_subwindow(android_port);
138         x3 += android_port->get_w() + 2*margin;
139         add_subwindow(title = new BC_Title(x3, y, _("PIN:")));
140         x3 += title->get_w() + margin;
141         AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y);
142         add_subwindow(android_pin);
143         y += android_port->get_h() + 3*margin;
144
145         ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y);
146         add_subwindow(shbtn_prefs);
147         x3 = x2 + shbtn_prefs->get_w() + 2*margin;
148         add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x3, y));
149         y += reload_plugins->get_h() + 3*margin;
150
151         add_subwindow(title = new BC_Title(x2, y, _("Nested Proxy Path:")));
152         y += title->get_h() + ys10;
153         PrefsNestedProxyPath *nested_proxy_path = new PrefsNestedProxyPath(pwindow, this,
154                         x2, y, get_w()-x2-xs30);
155         add_subwindow(nested_proxy_path);
156         y += xs30;
157
158         add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:")));
159         y += title->get_h() + ys10;
160         PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this,
161                         x2, y, get_w()-x2-xs30);
162         add_subwindow(lv2_path_text);
163         y += xs30;
164
165         y2 = y;
166         x = x0;  y = y1 + ys35;
167         add_subwindow(file_probes = new PrefsFileProbes(pwindow, this, x, y));
168         y += ys30;
169
170         PrefsTrapSigSEGV *trap_segv = new PrefsTrapSigSEGV(this, x, y);
171         add_subwindow(trap_segv);
172         x1 = x + trap_segv->get_w() + xs10;
173         add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED));
174         y += ys30;
175
176         PrefsTrapSigINTR *trap_intr = new PrefsTrapSigINTR(this, x, y);
177         add_subwindow(trap_intr);
178         add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED));
179         y += ys30;
180
181         yuv420p_dvdlace = new PrefsYUV420P_DVDlace(pwindow, this, x, y);
182         add_subwindow(yuv420p_dvdlace);
183         y += ys30;
184
185         add_subwindow(title = new BC_Title(x1=x, y + ys5, _("Min DB for meter:")));
186         x1 += title->get_w() + xs4;
187         sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
188         add_subwindow(min_db = new MeterMinDB(pwindow, string, x1, y));
189         x1 += min_db->get_w() + xs4;
190         add_subwindow(title = new BC_Title(x1, y + ys5, _("Max:")));
191         x1 += title->get_w() + xs4;
192         sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
193         add_subwindow(max_db = new MeterMaxDB(pwindow, string, x1, y));
194         y += ys30;
195
196         StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow,
197                 pwindow->thread->edl->session->si_useduration, x, y);
198         add_subwindow(use_stduration);
199         x1 = x + use_stduration->get_w() + xs10;
200         StillImageDuration *stduration = new StillImageDuration(pwindow, x1, y);
201         add_subwindow(stduration);
202         x1 += stduration->get_w() + xs10;
203         add_subwindow(new BC_Title(x1, y, _("Seconds")));
204         y += ys30;
205
206         PrefsAutostartLV2UI *autostart_lv2ui = new PrefsAutostartLV2UI(x, y,pwindow);
207         add_subwindow(autostart_lv2ui);
208         y += autostart_lv2ui->get_h() + ys10;
209
210         if( y2 > y ) y = y2;
211         x = x0;
212         add_subwindow(new BC_Bar(xs5, y, get_w() - xs10));
213         y += ys5;
214
215         add_subwindow(new BC_Title(x, y, _("Index files:"), LARGEFONT, resources->text_default));
216         y += ys30;
217
218         add_subwindow(new BC_Title(x, y + ys5,
219                 _("Index files go here:"), MEDIUMFONT, resources->text_default));
220         x1 = x + xS(230);
221         add_subwindow(ipathtext = new IndexPathText(x1, y, pwindow,
222                 pwindow->thread->preferences->index_directory));
223         x1 +=  ipathtext->get_w();
224         add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext, x1, y,
225                 pwindow->thread->preferences->index_directory,
226                 _("Index Path"), _("Select the directory for index files"), 1));
227
228         y += ys30;
229         add_subwindow(new BC_Title(x, y + ys5, _("Size of index file in KB:"),
230                 MEDIUMFONT, resources->text_default));
231         sprintf(string, "%jd", pwindow->thread->preferences->index_size/1024);
232         add_subwindow(isize = new IndexSize(x + xS(230), y, pwindow, string));
233         add_subwindow(new ScanCommercials(pwindow, xS(400),y));
234
235         y += ys30;
236         add_subwindow(new BC_Title(x, y + ys5, _("Number of index files to keep:"),
237                 MEDIUMFONT, resources->text_default));
238         sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count);
239         add_subwindow(icount = new IndexCount(x + xS(230), y, pwindow, string));
240         add_subwindow(del_indexes = new DeleteAllIndexes(mwindow, pwindow, xS(400), y,
241                 _("Delete existing indexes"), "[*.idx][*.toc][*.mkr]"));
242         y += ys30;
243         add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x, y));
244         add_subwindow(del_clipngs = new DeleteAllIndexes(mwindow, pwindow, xS(400), y,
245                 _("Delete clip thumbnails"), "clip_*.png"));
246 }
247
248 const char* InterfacePrefs::behavior_to_text(int mode)
249 {
250         switch( mode ) {
251         case MOVE_RIPPLE: return _(MOVE_RIPPLE_TITLE);
252         case MOVE_ROLL: return _(MOVE_ROLL_TITLE);
253         case MOVE_SLIP: return _(MOVE_SLIP_TITLE);
254         case MOVE_SLIDE: return _(MOVE_SLIDE_TITLE);
255         case MOVE_EDGE: return _(MOVE_EDGE_TITLE);
256         case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
257         }
258         return "";
259 }
260
261 IndexPathText::IndexPathText(int x, int y, PreferencesWindow *pwindow, char *text)
262  : BC_TextBox(x, y, xS(240), 1, text)
263 {
264         this->pwindow = pwindow;
265 }
266
267 IndexPathText::~IndexPathText() {}
268
269 int IndexPathText::handle_event()
270 {
271         strcpy(pwindow->thread->preferences->index_directory, get_text());
272         return 1;
273 }
274
275
276
277
278 IndexSize::IndexSize(int x, int y, PreferencesWindow *pwindow, char *text)
279  : BC_TextBox(x, y, xS(100), 1, text)
280 {
281         this->pwindow = pwindow;
282 }
283
284 int IndexSize::handle_event()
285 {
286         long result;
287
288         result = atol(get_text()) * 1024;
289         if( result < 65536 ) result = 65536;
290         //if(result < 500000) result = 500000;
291         pwindow->thread->preferences->index_size = result;
292         return 0;
293 }
294
295
296
297 IndexCount::IndexCount(int x, int y, PreferencesWindow *pwindow, char *text)
298  : BC_TextBox(x, y, 100, 1, text)
299 {
300         this->pwindow = pwindow;
301 }
302
303 int IndexCount::handle_event()
304 {
305         long result;
306
307         result = atol(get_text());
308         if(result < 1) result = 1;
309         pwindow->thread->preferences->index_count = result;
310         return 0;
311 }
312
313
314
315 IndexFFMPEGMarkerFiles::IndexFFMPEGMarkerFiles(InterfacePrefs *iface_prefs, int x, int y)
316  : BC_CheckBox(x, y,
317         iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes,
318         _("build ffmpeg marker indexes"))
319 {
320         this->iface_prefs = iface_prefs;
321 }
322 IndexFFMPEGMarkerFiles::~IndexFFMPEGMarkerFiles()
323 {
324 }
325
326 int IndexFFMPEGMarkerFiles::handle_event()
327 {
328         iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes = get_value();
329         return 1;
330 }
331
332
333 ViewBehaviourText::ViewBehaviourText(int x, int y, const char *text, PreferencesWindow *pwindow,
334         int *output)
335  : BC_PopupMenu(x, y, xS(250), text)
336 {
337         this->output = output;
338 }
339
340 ViewBehaviourText::~ViewBehaviourText()
341 {
342 }
343
344 int ViewBehaviourText::handle_event()
345 {
346         return 0;
347 }
348
349 void ViewBehaviourText::create_objects()
350 {
351         for( int mode=0; mode<=EDIT_HANDLE_MODES; ++mode )
352                 add_item(new ViewBehaviourItem(this,
353                         InterfacePrefs::behavior_to_text(mode), mode));
354 }
355
356
357 ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup,
358                 const char *text, int behaviour)
359  : BC_MenuItem(text)
360 {
361         this->popup = popup;
362         this->behaviour = behaviour;
363 }
364
365 ViewBehaviourItem::~ViewBehaviourItem()
366 {
367 }
368
369 int ViewBehaviourItem::handle_event()
370 {
371         popup->set_text(get_text());
372         *(popup->output) = behaviour;
373         return 1;
374 }
375
376
377 MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y)
378  : BC_TextBox(x, y, xS(50), 1, text)
379 {
380         this->pwindow = pwindow;
381 }
382
383 int MeterMinDB::handle_event()
384 {
385         pwindow->thread->redraw_meters = 1;
386         pwindow->thread->edl->session->min_meter_db = atol(get_text());
387         return 0;
388 }
389
390
391 MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y)
392  : BC_TextBox(x, y, xS(50), 1, text)
393 {
394         this->pwindow = pwindow;
395 }
396
397 int MeterMaxDB::handle_event()
398 {
399         pwindow->thread->redraw_meters = 1;
400         pwindow->thread->edl->session->max_meter_db = atol(get_text());
401         return 0;
402 }
403
404
405 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
406  : BC_CheckBox(x,
407         y,
408         pwindow->thread->preferences->scan_commercials,
409         _("Scan for commercials during toc build"))
410 {
411         this->pwindow = pwindow;
412 }
413 int ScanCommercials::handle_event()
414 {
415         pwindow->thread->preferences->scan_commercials = get_value();
416         return 1;
417 }
418
419
420 AndroidRemote::AndroidRemote(PreferencesWindow *pwindow, int x, int y)
421  : BC_CheckBox(x, y,
422         pwindow->thread->preferences->android_remote,
423         _("Android Remote Control"))
424 {
425         this->pwindow = pwindow;
426 }
427 int AndroidRemote::handle_event()
428 {
429         pwindow->thread->preferences->android_remote = get_value();
430         return 1;
431 }
432
433 AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y)
434  : BC_TextBox(x, y, xS(180), 1, pwindow->thread->preferences->android_pin)
435 {
436         this->pwindow = pwindow;
437 }
438
439 int AndroidPIN::handle_event()
440 {
441         char *txt = pwindow->thread->preferences->android_pin;
442         int len = sizeof(pwindow->thread->preferences->android_pin);
443         strncpy(txt, get_text(), len);
444         return 1;
445 }
446
447
448 AndroidPort::AndroidPort(PreferencesWindow *pwindow, int x, int y)
449  : BC_TextBox(x, y, xS(72), 1, pwindow->thread->preferences->android_port)
450 {
451         this->pwindow = pwindow;
452 }
453
454 int AndroidPort::handle_event()
455 {
456         unsigned short port = atoi(get_text());
457         if( port < 1024 ) port = 1024;
458         pwindow->thread->preferences->android_port = port;
459         char str[BCSTRLEN];
460         sprintf(str,"%u",port);
461         update(str);
462         return 1;
463 }
464
465 int InterfacePrefs::start_shbtn_dialog()
466 {
467         if( !shbtn_dialog )
468                 shbtn_dialog = new ShBtnEditDialog(pwindow);
469         shbtn_dialog->start();
470         return 1;
471 }
472
473 ShBtnPrefs::ShBtnPrefs(PreferencesWindow *pwindow, InterfacePrefs *iface_prefs, int x, int y)
474  : BC_GenericButton(x, y, _("Shell Commands"))
475 {
476         this->pwindow = pwindow;
477         this->iface_prefs = iface_prefs;
478         set_tooltip(_("Main Menu Shell Commands"));
479 }
480
481 int ShBtnPrefs::handle_event()
482 {
483         return iface_prefs->start_shbtn_dialog();
484 }
485
486
487 StillImageUseDuration::StillImageUseDuration(PreferencesWindow *pwindow, int value, int x, int y)
488  : BC_CheckBox(x, y, value, _("Import images with a duration of"))
489 {
490         this->pwindow = pwindow;
491 }
492
493 int StillImageUseDuration::handle_event()
494 {
495         pwindow->thread->edl->session->si_useduration = get_value();
496         return 1;
497 }
498
499 StillImageDuration::StillImageDuration(PreferencesWindow *pwindow, int x, int y)
500  : BC_TextBox(x, y, xS(70), 1, pwindow->thread->edl->session->si_duration)
501 {
502         this->pwindow = pwindow;
503 }
504 int StillImageDuration::handle_event()
505 {
506         pwindow->thread->edl->session->si_duration = atof(get_text());
507         return 1;
508 }
509
510
511 HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
512  : BC_MenuItem(popup->hairline_to_string(hairline))
513 {
514         this->popup = popup;
515         this->hairline = hairline;
516 }
517
518 HairlineItem::~HairlineItem()
519 {
520 }
521
522 int HairlineItem::handle_event()
523 {
524         popup->pwindow->thread->redraw_overlays = 1;
525         popup->set_text(get_text());
526         *(popup->output) = hairline;
527         return 1;
528 }
529
530
531 KeyframeReticle::KeyframeReticle(PreferencesWindow *pwindow,
532         InterfacePrefs *iface_prefs, int x, int y, int *output)
533  : BC_PopupMenu(x, y, xS(220), hairline_to_string(*output))
534 {
535         this->pwindow = pwindow;
536         this->iface_prefs = iface_prefs;
537         this->output = output;
538 }
539
540 KeyframeReticle::~KeyframeReticle()
541 {
542 }
543
544 const char *KeyframeReticle::hairline_to_string(int type)
545 {
546         switch( type ) {
547         case HAIRLINE_NEVER:    return _("Never");
548         case HAIRLINE_DRAGGING: return _("Dragging");
549         case HAIRLINE_ALWAYS:   return _("Always");
550         }
551         return _("Unknown");
552 }
553
554 void KeyframeReticle::create_objects()
555 {
556         add_item(new HairlineItem(this, HAIRLINE_NEVER));
557         add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
558         add_item(new HairlineItem(this, HAIRLINE_ALWAYS));
559 }
560
561 PrefsTrapSigSEGV::PrefsTrapSigSEGV(InterfacePrefs *subwindow, int x, int y)
562  : BC_CheckBox(x, y,
563         subwindow->pwindow->thread->preferences->trap_sigsegv,
564         _("trap sigSEGV"))
565 {
566         this->subwindow = subwindow;
567 }
568 PrefsTrapSigSEGV::~PrefsTrapSigSEGV()
569 {
570 }
571 int PrefsTrapSigSEGV::handle_event()
572 {
573         subwindow->pwindow->thread->preferences->trap_sigsegv = get_value();
574         return 1;
575 }
576
577 PrefsTrapSigINTR::PrefsTrapSigINTR(InterfacePrefs *subwindow, int x, int y)
578  : BC_CheckBox(x, y,
579         subwindow->pwindow->thread->preferences->trap_sigintr,
580         _("trap sigINT"))
581 {
582         this->subwindow = subwindow;
583 }
584 PrefsTrapSigINTR::~PrefsTrapSigINTR()
585 {
586 }
587 int PrefsTrapSigINTR::handle_event()
588 {
589         subwindow->pwindow->thread->preferences->trap_sigintr = get_value();
590         return 1;
591 }
592
593
594 void InterfacePrefs::start_probe_dialog()
595 {
596         if( !file_probe_dialog )
597                 file_probe_dialog = new FileProbeDialog(pwindow);
598         file_probe_dialog->start();
599 }
600
601 PrefsFileProbes::PrefsFileProbes(PreferencesWindow *pwindow,
602                 InterfacePrefs *subwindow, int x, int y)
603  : BC_GenericButton(x, y, _("Probe Order"))
604 {
605         this->pwindow = pwindow;
606         this->subwindow = subwindow;
607         set_tooltip(_("File Open Probe Ordering"));
608 }
609
610 int PrefsFileProbes::handle_event()
611 {
612         subwindow->start_probe_dialog();
613         return 1;
614 }
615
616
617 PrefsYUV420P_DVDlace::PrefsYUV420P_DVDlace(PreferencesWindow *pwindow,
618         InterfacePrefs *subwindow, int x, int y)
619  : BC_CheckBox(x, y, pwindow->thread->preferences->dvd_yuv420p_interlace,
620         _("Use yuv420p dvd interlace format"))
621 {
622         this->pwindow = pwindow;
623         this->subwindow = subwindow;
624 }
625
626 int PrefsYUV420P_DVDlace::handle_event()
627 {
628         pwindow->thread->preferences->dvd_yuv420p_interlace = get_value();
629         return 1;
630 }
631
632
633 SnapshotPathText::SnapshotPathText(PreferencesWindow *pwindow,
634         InterfacePrefs *subwindow, int x, int y, int w)
635  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->snapshot_path)
636 {
637         this->pwindow = pwindow;
638         this->subwindow = subwindow;
639 }
640
641 SnapshotPathText::~SnapshotPathText()
642 {
643 }
644
645 int SnapshotPathText::handle_event()
646 {
647         strcpy(pwindow->thread->preferences->snapshot_path, get_text());
648         return 1;
649 }
650
651 PrefsAutostartLV2UI::PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow)
652  : BC_CheckBox(x, y,
653         pwindow->thread->preferences->autostart_lv2ui, _("Auto start lv2 gui"))
654 {
655         this->pwindow = pwindow;
656 }
657 int PrefsAutostartLV2UI::handle_event()
658 {
659         pwindow->thread->preferences->autostart_lv2ui = get_value();
660         return 1;
661 }
662
663 PrefsReloadPlugins::PrefsReloadPlugins(PreferencesWindow *pwindow,
664         InterfacePrefs *iface_prefs, int x, int y)
665  : BC_GenericButton(x, y, _("Reload plugin index"))
666 {
667         this->pwindow = pwindow;
668         this->iface_prefs = iface_prefs;
669 }
670
671 int PrefsReloadPlugins::handle_event()
672 {
673         pwindow->thread->reload_plugins = 1;
674         text_color(get_resources()->button_highlighted);
675         draw_face(1);
676         return 1;
677 }
678
679 PrefsLV2PathText::PrefsLV2PathText(PreferencesWindow *pwindow,
680         InterfacePrefs *subwindow, int x, int y, int w)
681  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->lv2_path)
682 {
683         this->pwindow = pwindow;
684         this->subwindow = subwindow;
685 }
686
687 PrefsLV2PathText::~PrefsLV2PathText()
688 {
689 }
690
691 int PrefsLV2PathText::handle_event()
692 {
693         strcpy(pwindow->thread->preferences->lv2_path, get_text());
694         return 1;
695 }
696
697 PrefsNestedProxyPath::PrefsNestedProxyPath(PreferencesWindow *pwindow,
698         InterfacePrefs *subwindow, int x, int y, int w)
699  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->nested_proxy_path)
700 {
701         this->pwindow = pwindow;
702         this->subwindow = subwindow;
703 }
704
705 PrefsNestedProxyPath::~PrefsNestedProxyPath()
706 {
707 }
708
709 int PrefsNestedProxyPath::handle_event()
710 {
711         strcpy(pwindow->thread->preferences->nested_proxy_path, get_text());
712         return 1;
713 }
714