add 1:1 convert, add es.po: thx sergio, cwdw zoom tweak, add done beep pots, bd forma...
[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), ys20 = yS(20), 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         add_subwindow(title = new BC_Title(x2, y, _("Port:")));
134         int x3 = x2 + title->get_w() + margin;
135         AndroidPort *android_port = new AndroidPort(pwindow, x3, y);
136         add_subwindow(android_port);
137         y += title->get_h() + ys10;
138         add_subwindow(title = new BC_Title(x2, y, _("PIN:")));
139         AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y);
140         add_subwindow(android_pin);
141         y += title->get_h() + ys20;
142
143         ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y);
144         add_subwindow(shbtn_prefs);
145         y += shbtn_prefs->get_h() + ys20;
146
147         add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x2, y));
148         y += reload_plugins->get_h() + ys10;
149
150         add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:")));
151         y += title->get_h() + ys10;
152         PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this, x2, y, get_w()-x2-xs30);
153         add_subwindow(lv2_path_text);
154         y += xs30;
155
156         y2 = y;
157         x = x0;  y = y1 + ys35;
158         add_subwindow(file_probes = new PrefsFileProbes(pwindow, this, x, y));
159         y += ys30;
160
161         PrefsTrapSigSEGV *trap_segv = new PrefsTrapSigSEGV(this, x, y);
162         add_subwindow(trap_segv);
163         x1 = x + trap_segv->get_w() + xs10;
164         add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED));
165         y += ys30;
166
167         PrefsTrapSigINTR *trap_intr = new PrefsTrapSigINTR(this, x, y);
168         add_subwindow(trap_intr);
169         add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED));
170         y += ys30;
171
172         yuv420p_dvdlace = new PrefsYUV420P_DVDlace(pwindow, this, x, y);
173         add_subwindow(yuv420p_dvdlace);
174         y += ys30;
175
176         add_subwindow(title = new BC_Title(x1=x, y + ys5, _("Min DB for meter:")));
177         x1 += title->get_w() + xs4;
178         sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
179         add_subwindow(min_db = new MeterMinDB(pwindow, string, x1, y));
180         x1 += min_db->get_w() + xs4;
181         add_subwindow(title = new BC_Title(x1, y + ys5, _("Max:")));
182         x1 += title->get_w() + xs4;
183         sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
184         add_subwindow(max_db = new MeterMaxDB(pwindow, string, x1, y));
185         y += ys30;
186
187         StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow,
188                 pwindow->thread->edl->session->si_useduration, x, y);
189         add_subwindow(use_stduration);
190         x1 = x + use_stduration->get_w() + xs10;
191         StillImageDuration *stduration = new StillImageDuration(pwindow, x1, y);
192         add_subwindow(stduration);
193         x1 += stduration->get_w() + xs10;
194         add_subwindow(new BC_Title(x1, y, _("Seconds")));
195         y += ys30;
196
197         PrefsAutostartLV2UI *autostart_lv2ui = new PrefsAutostartLV2UI(x, y,pwindow);
198         add_subwindow(autostart_lv2ui);
199         y += autostart_lv2ui->get_h() + ys10;
200
201         if( y2 > y ) y = y2;
202         x = x0;
203         add_subwindow(new BC_Bar(xs5, y, get_w() - xs10));
204         y += ys5;
205
206         add_subwindow(new BC_Title(x, y, _("Index files:"), LARGEFONT, resources->text_default));
207         y += ys30;
208
209         add_subwindow(new BC_Title(x, y + ys5,
210                 _("Index files go here:"), MEDIUMFONT, resources->text_default));
211         x1 = x + xS(230);
212         add_subwindow(ipathtext = new IndexPathText(x1, y, pwindow,
213                 pwindow->thread->preferences->index_directory));
214         x1 +=  ipathtext->get_w();
215         add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext, x1, y,
216                 pwindow->thread->preferences->index_directory,
217                 _("Index Path"), _("Select the directory for index files"), 1));
218
219         y += ys30;
220         add_subwindow(new BC_Title(x, y + ys5, _("Size of index file in KB:"),
221                 MEDIUMFONT, resources->text_default));
222         sprintf(string, "%jd", pwindow->thread->preferences->index_size/1024);
223         add_subwindow(isize = new IndexSize(x + xS(230), y, pwindow, string));
224         add_subwindow(new ScanCommercials(pwindow, xS(400),y));
225
226         y += ys30;
227         add_subwindow(new BC_Title(x, y + ys5, _("Number of index files to keep:"),
228                 MEDIUMFONT, resources->text_default));
229         sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count);
230         add_subwindow(icount = new IndexCount(x + xS(230), y, pwindow, string));
231         add_subwindow(del_indexes = new DeleteAllIndexes(mwindow, pwindow, xS(400), y,
232                 _("Delete existing indexes"), "[*.idx][*.toc][*.mkr]"));
233         y += ys30;
234         add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x, y));
235         add_subwindow(del_clipngs = new DeleteAllIndexes(mwindow, pwindow, xS(400), y,
236                 _("Delete clip thumbnails"), "clip_*.png"));
237 }
238
239 const char* InterfacePrefs::behavior_to_text(int mode)
240 {
241         switch( mode ) {
242         case MOVE_RIPPLE: return _(MOVE_RIPPLE_TITLE);
243         case MOVE_ROLL: return _(MOVE_ROLL_TITLE);
244         case MOVE_SLIP: return _(MOVE_SLIP_TITLE);
245         case MOVE_SLIDE: return _(MOVE_SLIDE_TITLE);
246         case MOVE_EDGE: return _(MOVE_EDGE_TITLE);
247         case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
248         }
249         return "";
250 }
251
252 IndexPathText::IndexPathText(int x, int y, PreferencesWindow *pwindow, char *text)
253  : BC_TextBox(x, y, xS(240), 1, text)
254 {
255         this->pwindow = pwindow;
256 }
257
258 IndexPathText::~IndexPathText() {}
259
260 int IndexPathText::handle_event()
261 {
262         strcpy(pwindow->thread->preferences->index_directory, get_text());
263         return 1;
264 }
265
266
267
268
269 IndexSize::IndexSize(int x, int y, PreferencesWindow *pwindow, char *text)
270  : BC_TextBox(x, y, xS(100), 1, text)
271 {
272         this->pwindow = pwindow;
273 }
274
275 int IndexSize::handle_event()
276 {
277         long result;
278
279         result = atol(get_text()) * 1024;
280         if( result < 65536 ) result = 65536;
281         //if(result < 500000) result = 500000;
282         pwindow->thread->preferences->index_size = result;
283         return 0;
284 }
285
286
287
288 IndexCount::IndexCount(int x, int y, PreferencesWindow *pwindow, char *text)
289  : BC_TextBox(x, y, 100, 1, text)
290 {
291         this->pwindow = pwindow;
292 }
293
294 int IndexCount::handle_event()
295 {
296         long result;
297
298         result = atol(get_text());
299         if(result < 1) result = 1;
300         pwindow->thread->preferences->index_count = result;
301         return 0;
302 }
303
304
305
306 IndexFFMPEGMarkerFiles::IndexFFMPEGMarkerFiles(InterfacePrefs *iface_prefs, int x, int y)
307  : BC_CheckBox(x, y,
308         iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes,
309         _("build ffmpeg marker indexes"))
310 {
311         this->iface_prefs = iface_prefs;
312 }
313 IndexFFMPEGMarkerFiles::~IndexFFMPEGMarkerFiles()
314 {
315 }
316
317 int IndexFFMPEGMarkerFiles::handle_event()
318 {
319         iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes = get_value();
320         return 1;
321 }
322
323
324 ViewBehaviourText::ViewBehaviourText(int x, int y, const char *text, PreferencesWindow *pwindow,
325         int *output)
326  : BC_PopupMenu(x, y, xS(250), text)
327 {
328         this->output = output;
329 }
330
331 ViewBehaviourText::~ViewBehaviourText()
332 {
333 }
334
335 int ViewBehaviourText::handle_event()
336 {
337         return 0;
338 }
339
340 void ViewBehaviourText::create_objects()
341 {
342         for( int mode=0; mode<=EDIT_HANDLE_MODES; ++mode )
343                 add_item(new ViewBehaviourItem(this,
344                         InterfacePrefs::behavior_to_text(mode), mode));
345 }
346
347
348 ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup,
349                 const char *text, int behaviour)
350  : BC_MenuItem(text)
351 {
352         this->popup = popup;
353         this->behaviour = behaviour;
354 }
355
356 ViewBehaviourItem::~ViewBehaviourItem()
357 {
358 }
359
360 int ViewBehaviourItem::handle_event()
361 {
362         popup->set_text(get_text());
363         *(popup->output) = behaviour;
364         return 1;
365 }
366
367
368 MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y)
369  : BC_TextBox(x, y, xS(50), 1, text)
370 {
371         this->pwindow = pwindow;
372 }
373
374 int MeterMinDB::handle_event()
375 {
376         pwindow->thread->redraw_meters = 1;
377         pwindow->thread->edl->session->min_meter_db = atol(get_text());
378         return 0;
379 }
380
381
382 MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y)
383  : BC_TextBox(x, y, xS(50), 1, text)
384 {
385         this->pwindow = pwindow;
386 }
387
388 int MeterMaxDB::handle_event()
389 {
390         pwindow->thread->redraw_meters = 1;
391         pwindow->thread->edl->session->max_meter_db = atol(get_text());
392         return 0;
393 }
394
395
396 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
397  : BC_CheckBox(x,
398         y,
399         pwindow->thread->preferences->scan_commercials,
400         _("Scan for commercials during toc build"))
401 {
402         this->pwindow = pwindow;
403 }
404 int ScanCommercials::handle_event()
405 {
406         pwindow->thread->preferences->scan_commercials = get_value();
407         return 1;
408 }
409
410
411 AndroidRemote::AndroidRemote(PreferencesWindow *pwindow, int x, int y)
412  : BC_CheckBox(x, y,
413         pwindow->thread->preferences->android_remote,
414         _("Android Remote Control"))
415 {
416         this->pwindow = pwindow;
417 }
418 int AndroidRemote::handle_event()
419 {
420         pwindow->thread->preferences->android_remote = get_value();
421         return 1;
422 }
423
424 AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y)
425  : BC_TextBox(x, y, xS(240), 1, pwindow->thread->preferences->android_pin)
426 {
427         this->pwindow = pwindow;
428 }
429
430 int AndroidPIN::handle_event()
431 {
432         char *txt = pwindow->thread->preferences->android_pin;
433         int len = sizeof(pwindow->thread->preferences->android_pin);
434         strncpy(txt, get_text(), len);
435         return 1;
436 }
437
438
439 AndroidPort::AndroidPort(PreferencesWindow *pwindow, int x, int y)
440  : BC_TextBox(x, y, xS(72), 1, pwindow->thread->preferences->android_port)
441 {
442         this->pwindow = pwindow;
443 }
444
445 int AndroidPort::handle_event()
446 {
447         unsigned short port = atoi(get_text());
448         if( port < 1024 ) port = 1024;
449         pwindow->thread->preferences->android_port = port;
450         char str[BCSTRLEN];
451         sprintf(str,"%u",port);
452         update(str);
453         return 1;
454 }
455
456 int InterfacePrefs::start_shbtn_dialog()
457 {
458         if( !shbtn_dialog )
459                 shbtn_dialog = new ShBtnEditDialog(pwindow);
460         shbtn_dialog->start();
461         return 1;
462 }
463
464 ShBtnPrefs::ShBtnPrefs(PreferencesWindow *pwindow, InterfacePrefs *iface_prefs, int x, int y)
465  : BC_GenericButton(x, y, _("Shell Commands"))
466 {
467         this->pwindow = pwindow;
468         this->iface_prefs = iface_prefs;
469         set_tooltip(_("Main Menu Shell Commands"));
470 }
471
472 int ShBtnPrefs::handle_event()
473 {
474         return iface_prefs->start_shbtn_dialog();
475 }
476
477
478 StillImageUseDuration::StillImageUseDuration(PreferencesWindow *pwindow, int value, int x, int y)
479  : BC_CheckBox(x, y, value, _("Import images with a duration of"))
480 {
481         this->pwindow = pwindow;
482 }
483
484 int StillImageUseDuration::handle_event()
485 {
486         pwindow->thread->edl->session->si_useduration = get_value();
487         return 1;
488 }
489
490 StillImageDuration::StillImageDuration(PreferencesWindow *pwindow, int x, int y)
491  : BC_TextBox(x, y, xS(70), 1, pwindow->thread->edl->session->si_duration)
492 {
493         this->pwindow = pwindow;
494 }
495 int StillImageDuration::handle_event()
496 {
497         pwindow->thread->edl->session->si_duration = atof(get_text());
498         return 1;
499 }
500
501
502 HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
503  : BC_MenuItem(popup->hairline_to_string(hairline))
504 {
505         this->popup = popup;
506         this->hairline = hairline;
507 }
508
509 HairlineItem::~HairlineItem()
510 {
511 }
512
513 int HairlineItem::handle_event()
514 {
515         popup->pwindow->thread->redraw_overlays = 1;
516         popup->set_text(get_text());
517         *(popup->output) = hairline;
518         return 1;
519 }
520
521
522 KeyframeReticle::KeyframeReticle(PreferencesWindow *pwindow,
523         InterfacePrefs *iface_prefs, int x, int y, int *output)
524  : BC_PopupMenu(x, y, xS(220), hairline_to_string(*output))
525 {
526         this->pwindow = pwindow;
527         this->iface_prefs = iface_prefs;
528         this->output = output;
529 }
530
531 KeyframeReticle::~KeyframeReticle()
532 {
533 }
534
535 const char *KeyframeReticle::hairline_to_string(int type)
536 {
537         switch( type ) {
538         case HAIRLINE_NEVER:    return _("Never");
539         case HAIRLINE_DRAGGING: return _("Dragging");
540         case HAIRLINE_ALWAYS:   return _("Always");
541         }
542         return _("Unknown");
543 }
544
545 void KeyframeReticle::create_objects()
546 {
547         add_item(new HairlineItem(this, HAIRLINE_NEVER));
548         add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
549         add_item(new HairlineItem(this, HAIRLINE_ALWAYS));
550 }
551
552 PrefsTrapSigSEGV::PrefsTrapSigSEGV(InterfacePrefs *subwindow, int x, int y)
553  : BC_CheckBox(x, y,
554         subwindow->pwindow->thread->preferences->trap_sigsegv,
555         _("trap sigSEGV"))
556 {
557         this->subwindow = subwindow;
558 }
559 PrefsTrapSigSEGV::~PrefsTrapSigSEGV()
560 {
561 }
562 int PrefsTrapSigSEGV::handle_event()
563 {
564         subwindow->pwindow->thread->preferences->trap_sigsegv = get_value();
565         return 1;
566 }
567
568 PrefsTrapSigINTR::PrefsTrapSigINTR(InterfacePrefs *subwindow, int x, int y)
569  : BC_CheckBox(x, y,
570         subwindow->pwindow->thread->preferences->trap_sigintr,
571         _("trap sigINT"))
572 {
573         this->subwindow = subwindow;
574 }
575 PrefsTrapSigINTR::~PrefsTrapSigINTR()
576 {
577 }
578 int PrefsTrapSigINTR::handle_event()
579 {
580         subwindow->pwindow->thread->preferences->trap_sigintr = get_value();
581         return 1;
582 }
583
584
585 void InterfacePrefs::start_probe_dialog()
586 {
587         if( !file_probe_dialog )
588                 file_probe_dialog = new FileProbeDialog(pwindow);
589         file_probe_dialog->start();
590 }
591
592 PrefsFileProbes::PrefsFileProbes(PreferencesWindow *pwindow,
593                 InterfacePrefs *subwindow, int x, int y)
594  : BC_GenericButton(x, y, _("Probe Order"))
595 {
596         this->pwindow = pwindow;
597         this->subwindow = subwindow;
598         set_tooltip(_("File Open Probe Ordering"));
599 }
600
601 int PrefsFileProbes::handle_event()
602 {
603         subwindow->start_probe_dialog();
604         return 1;
605 }
606
607
608 PrefsYUV420P_DVDlace::PrefsYUV420P_DVDlace(PreferencesWindow *pwindow,
609         InterfacePrefs *subwindow, int x, int y)
610  : BC_CheckBox(x, y, pwindow->thread->preferences->dvd_yuv420p_interlace,
611         _("Use yuv420p dvd interlace format"))
612 {
613         this->pwindow = pwindow;
614         this->subwindow = subwindow;
615 }
616
617 int PrefsYUV420P_DVDlace::handle_event()
618 {
619         pwindow->thread->preferences->dvd_yuv420p_interlace = get_value();
620         return 1;
621 }
622
623
624 SnapshotPathText::SnapshotPathText(PreferencesWindow *pwindow,
625         InterfacePrefs *subwindow, int x, int y, int w)
626  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->snapshot_path)
627 {
628         this->pwindow = pwindow;
629         this->subwindow = subwindow;
630 }
631
632 SnapshotPathText::~SnapshotPathText()
633 {
634 }
635
636 int SnapshotPathText::handle_event()
637 {
638         strcpy(pwindow->thread->preferences->snapshot_path, get_text());
639         return 1;
640 }
641
642 PrefsAutostartLV2UI::PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow)
643  : BC_CheckBox(x, y,
644         pwindow->thread->preferences->autostart_lv2ui, _("Auto start lv2 gui"))
645 {
646         this->pwindow = pwindow;
647 }
648 int PrefsAutostartLV2UI::handle_event()
649 {
650         pwindow->thread->preferences->autostart_lv2ui = get_value();
651         return 1;
652 }
653
654 PrefsReloadPlugins::PrefsReloadPlugins(PreferencesWindow *pwindow,
655         InterfacePrefs *iface_prefs, int x, int y)
656  : BC_GenericButton(x, y, _("Reload plugin index"))
657 {
658         this->pwindow = pwindow;
659         this->iface_prefs = iface_prefs;
660 }
661
662 int PrefsReloadPlugins::handle_event()
663 {
664         pwindow->thread->reload_plugins = 1;
665         text_color(get_resources()->button_highlighted);
666         draw_face(1);
667         return 1;
668 }
669
670 PrefsLV2PathText::PrefsLV2PathText(PreferencesWindow *pwindow,
671         InterfacePrefs *subwindow, int x, int y, int w)
672  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->lv2_path)
673 {
674         this->pwindow = pwindow;
675         this->subwindow = subwindow;
676 }
677
678 PrefsLV2PathText::~PrefsLV2PathText()
679 {
680 }
681
682 int PrefsLV2PathText::handle_event()
683 {
684         strcpy(pwindow->thread->preferences->lv2_path, get_text());
685         return 1;
686 }
687