confirm prefs update, fix bg_pixmap sz, plugin layout tweaks
authorGood Guy <good1.2guy@gmail.com>
Fri, 25 Oct 2019 00:29:58 +0000 (18:29 -0600)
committerGood Guy <good1.2guy@gmail.com>
Fri, 25 Oct 2019 00:29:58 +0000 (18:29 -0600)
37 files changed:
cinelerra-5.1/cinelerra/gwindowgui.C
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/cinelerra/preferencesthread.h
cinelerra-5.1/cinelerra/preferencesthread.inc
cinelerra-5.1/cinelerra/question.C
cinelerra-5.1/cinelerra/render.C
cinelerra-5.1/guicast/bctheme.C
cinelerra-5.1/guicast/bctheme.h
cinelerra-5.1/guicast/vframe.C
cinelerra-5.1/plugins/audioscope/audioscope.C
cinelerra-5.1/plugins/compressor/compressor.C
cinelerra-5.1/plugins/delayaudio/delayaudio.C
cinelerra-5.1/plugins/denoise/denoise.C
cinelerra-5.1/plugins/graphic/graphic.C
cinelerra-5.1/plugins/loopaudio/loopaudio.C
cinelerra-5.1/plugins/overlayaudio/overlayaudio.C
cinelerra-5.1/plugins/parametric/parametric.C
cinelerra-5.1/plugins/pitch/pitch.C
cinelerra-5.1/plugins/removegaps/removegaps.C
cinelerra-5.1/plugins/resamplert/resamplert.C
cinelerra-5.1/plugins/synthesizer/synthesizer.C
cinelerra-5.1/plugins/synthesizer/synthesizer.h
cinelerra-5.1/plugins/synthesizer/synthesizer.inc
cinelerra-5.1/plugins/synthesizer/synthwindow.inc
cinelerra-5.1/plugins/theme_blond/blondtheme.C
cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C
cinelerra-5.1/plugins/theme_blue/bluetheme.C
cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C
cinelerra-5.1/plugins/theme_bright/brighttheme.C
cinelerra-5.1/plugins/theme_cakewalk/cakewalk.C
cinelerra-5.1/plugins/theme_hulk/hulktheme.C
cinelerra-5.1/plugins/theme_neophyte/neophyte.C
cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C
cinelerra-5.1/plugins/theme_suv/suv.C
cinelerra-5.1/plugins/theme_unflat/unflattheme.C
cinelerra-5.1/plugins/timestretchrt/timestretchrt.C
cinelerra-5.1/plugins/yuv411/yuv411win.C

index 3bcb853..bc25071 100644 (file)
@@ -268,6 +268,7 @@ void GWindowGUI::create_objects()
                        }
                        if( !vframe ) {
                                int wh = toggle->get_h() - yS(4);
+                               if( wh < 1 ) wh = 1;
                                GWindowColorButton *color_button =
                                        new GWindowColorButton(toggle, get_w()-wh-ys10, y+yS(2), wh, color);
                                add_tool(color_button);
index 23494e7..e273813 100644 (file)
@@ -52,7 +52,9 @@
 #include "playbackengine.h"
 #include "playbackprefs.h"
 #include "preferences.h"
+#include "record.h"
 #include "recordprefs.h"
+#include "render.h"
 #include "shbtnprefs.h"
 #include "theme.h"
 #include "trackcanvas.h"
@@ -100,10 +102,12 @@ PreferencesThread::PreferencesThread(MWindow *mwindow)
        this->mwindow = mwindow;
        window = 0;
        thread_running = 0;
+       confirm_dialog = 0;
 }
 
 PreferencesThread::~PreferencesThread()
 {
+       delete confirm_dialog;
        close_window();
 }
 
@@ -364,6 +368,23 @@ int PreferencesThread::apply_settings()
        return 0;
 }
 
+const char *PreferencesThread::busy()
+{
+       if( mwindow->render->thread->running() )
+               return _("render");
+        Record *record = mwindow->gui->record;
+       if( record->capturing || record->recording || record->writing_file )
+               return _("record");
+       return 0;
+}
+
+void PreferencesThread::confirm_update(const char *reason, int close)
+{
+       delete confirm_dialog;
+       confirm_dialog = new PreferencesConfirmDialog(this, reason, close);
+       confirm_dialog->start();
+}
+
 const char* PreferencesThread::category_to_text(int category)
 {
        PlaybackConfig *playback_config = edl->session->playback_config;
@@ -630,8 +651,13 @@ PreferencesApply::PreferencesApply(MWindow *mwindow, PreferencesThread *thread)
 }
 int PreferencesApply::handle_event()
 {
-       thread->apply_settings();
-       mwindow->save_defaults();
+       const char *reason = thread->busy();
+       if( reason )
+               thread->confirm_update(reason, 0);
+       else {
+               thread->apply_settings();
+               mwindow->save_defaults();
+       }
        return 1;
 }
 int PreferencesApply::resize_event(int w, int h)
@@ -649,18 +675,24 @@ PreferencesOK::PreferencesOK(MWindow *mwindow, PreferencesThread *thread)
        this->mwindow = mwindow;
        this->thread = thread;
 }
+PreferencesOK::~PreferencesOK()
+{
+}
+
 int PreferencesOK::keypress_event()
 {
-       if(get_keypress() == RETURN)
-       {
-               thread->window->set_done(0);
-               return 1;
-       }
+       if( get_keypress() == RETURN )
+               return handle_event();
        return 0;
 }
+
 int PreferencesOK::handle_event()
 {
-       thread->window->set_done(0);
+       const char *reason = mwindow->restart() ? _("restart") : thread->busy();
+       if( reason )
+               thread->confirm_update(reason, 1);
+       else
+               thread->window->set_done(0);
        return 1;
 }
 int PreferencesOK::resize_event(int w, int h)
@@ -670,6 +702,45 @@ int PreferencesOK::resize_event(int w, int h)
 }
 
 
+PreferencesConfirmDialog::PreferencesConfirmDialog(PreferencesThread *thread,
+               const char *reason, int close)
+{
+       this->thread = thread;
+       this->close = close;
+       sprintf(query, _("Busy: %s in progress. Are you sure?"), reason);
+}
+PreferencesConfirmDialog::~PreferencesConfirmDialog()
+{
+}
+BC_Window *PreferencesConfirmDialog::new_gui()
+{
+       qwindow = new PreferencesConfirmWindow(this);
+       qwindow->create_objects(query, 0);
+       return qwindow;
+}
+void PreferencesConfirmDialog::handle_done_event(int result)
+{
+       if( !result ) return; // no
+       if( !close ) {
+               thread->window->lock_window("PreferencesConfirmDialog::handle_done_event");
+               thread->apply_settings();
+               thread->mwindow->save_defaults();
+               thread->window->unlock_window();
+       }
+       else
+               thread->window->set_done(0);
+}
+
+PreferencesConfirmWindow::PreferencesConfirmWindow(PreferencesConfirmDialog *dialog)
+ : QuestionWindow(dialog->thread->mwindow)
+{
+       this->dialog = dialog;
+}
+PreferencesConfirmWindow::~PreferencesConfirmWindow()
+{
+}
+
+
 PreferencesCancel::PreferencesCancel(MWindow *mwindow, PreferencesThread *thread)
  : BC_GenericButton(thread->window->get_w() - BC_GenericButton::calculate_w(thread->window, _("Cancel")) - xS(10),
        thread->window->get_h() - BC_GenericButton::calculate_h() - yS(10),
index 4cec37e..98f1400 100644 (file)
@@ -27,6 +27,7 @@
 #include "guicast.h"
 #include "mutex.inc"
 #include "mwindow.inc"
+#include "question.h"
 #include "preferences.inc"
 #include "preferencesthread.inc"
 
@@ -59,6 +60,10 @@ public:
        const char* category_to_text(int category);
        int text_to_category(const char *category);
 
+       const char *busy();
+       void confirm_update(const char *reason, int close);
+       PreferencesConfirmDialog *confirm_dialog;
+
        int current_dialog;
        int thread_running;
        int redraw_indexes;
@@ -175,13 +180,40 @@ class PreferencesOK : public BC_GenericButton
 {
 public:
        PreferencesOK(MWindow *mwindow, PreferencesThread *thread);
+       ~PreferencesOK();
        int keypress_event();
        int handle_event();
        int resize_event(int w, int h);
        MWindow *mwindow;
        PreferencesThread *thread;
+       PreferencesConfirmDialog *confirm_dialog;
+};
+
+class PreferencesConfirmDialog : public BC_DialogThread
+{
+public:
+       PreferencesConfirmDialog(PreferencesThread *thread,
+               const char *reason, int close);
+       ~PreferencesConfirmDialog();
+       BC_Window *new_gui();
+       void handle_done_event(int result);
+
+       PreferencesThread *thread;
+       PreferencesConfirmWindow *qwindow;
+       char query[BCTEXTLEN];
+       int close;
 };
 
+class PreferencesConfirmWindow : public QuestionWindow
+{
+public:
+       PreferencesConfirmWindow(PreferencesConfirmDialog *dialog);
+       ~PreferencesConfirmWindow();
+
+       PreferencesConfirmDialog *dialog;
+};
+
+
 class PreferencesCancel : public BC_GenericButton
 {
 public:
index da14e2d..43faada 100644 (file)
 #ifndef PREFERENCESTHREAD_INC
 #define PREFERENCESTHREAD_INC
 
-class PreferencesDialog;
-class PreferencesMenuItem;
+class PreferencesMenuitem;
 class PreferencesThread;
+class PreferencesDialog;
+class PreferencesCategory;
+class PreferencesButton;
 class PreferencesWindow;
+class PreferencesButton;
+class PreferencesCategory;
+class PreferencesApply;
+class PreferencesOK;
+class PreferencesConfirmDialog;
+class PreferencesConfirmWindow;
+class PreferencesCancel;
 
 #endif
index e89b9c0..ccea32c 100644 (file)
@@ -28,7 +28,7 @@
 #include "ctype.h"
 
 #define WIDTH xS(375)
-#define HEIGHT yS(160)
+#define HEIGHT yS(120)
 
 QuestionWindow::QuestionWindow(MWindow *mwindow)
  : BC_Window(_(PROGRAM_NAME ": Question"),
index 015bebd..57e724a 100644 (file)
@@ -222,6 +222,7 @@ Render::Render(MWindow *mwindow)
 
 Render::~Render()
 {
+       stop_operation();
        close_window();
        delete package_lock;
        delete counter_lock;
index c206f25..1ec64c7 100644 (file)
@@ -79,6 +79,17 @@ VFrame* BC_Theme::new_image(const char *path)
        return new_image("", path);
 }
 
+VFrame* BC_Theme::new_image1(const char *title, const char *path)
+{
+       VFrame *existing_image = title[0] ? get_image(title, 0) : 0;
+       if( existing_image ) return existing_image;
+
+       BC_ThemeSet *result = new BC_ThemeSet(1, 0, title);
+       result->data[0] = new VFramePng(get_image_data(path), 1.);
+       add_image_set(result);
+       return result->data[0];
+}
+
 // These create image sets which are stored in the image_sets table.
 VFrame** BC_Theme::new_image_set(const char *title, int total, va_list *args)
 {
index c9addd3..572a77b 100644 (file)
@@ -103,6 +103,8 @@ public:
 // Decompresses image and puts on images table before returning it.
        VFrame* new_image(const char *title, const char *path);
        VFrame* new_image(const char *path);
+// xy_scale = 1
+       VFrame* new_image1(const char *title, const char *path);
 
 
 // These retrieve images based on case sensitive title
index a4a76cc..2932058 100644 (file)
@@ -824,6 +824,8 @@ int VFramePng::read_png(const unsigned char *data, long sz, double xscale, doubl
                return 1;
        }
        int ww = w * xscale, hh = h * yscale;
+       if( ww < 1 ) ww = 1;
+       if( hh < 1 ) hh = 1;
        if( ww != w || hh != h ) {
                VFrame vframe(*this);
                reallocate(NULL, -1, 0, 0, 0, ww, hh, color_model, -1);
index d6defad..356f811 100644 (file)
@@ -132,7 +132,7 @@ AudioScopeWindowSize::AudioScopeWindowSize(AudioScope *plugin,
        char *text)
  : BC_PopupMenu(x,
        y,
-       xS(80),
+       xS(110),
        text)
 {
        this->plugin = plugin;
index 486a498..b167c6e 100644 (file)
@@ -1342,7 +1342,7 @@ int CompressorTrigger::button_press_event()
 CompressorInput::CompressorInput(CompressorEffect *plugin, int x, int y)
  : BC_PopupMenu(x,
        y,
-       xS(100),
+       xS(120),
        CompressorInput::value_to_text(plugin->config.input),
        1)
 {
index 7fa8af6..22c32f6 100644 (file)
@@ -205,7 +205,7 @@ void DelayAudio::update_gui()
 
 
 DelayAudioWindow::DelayAudioWindow(DelayAudio *plugin)
- : PluginClientWindow(plugin, xS(285), yS(80), xS(285), yS(80), 0)
+ : PluginClientWindow(plugin, xS(200), yS(80), xS(200), yS(80), 0)
 {
        this->plugin = plugin;
 }
index 4682740..72c9095 100644 (file)
@@ -754,7 +754,7 @@ void DenoiseConfig::interpolate(DenoiseConfig &prev,
 
 
 DenoiseWindow::DenoiseWindow(DenoiseEffect *plugin)
- : PluginClientWindow(plugin, xS(280), yS(50), xS(280), yS(50), 0)
+ : PluginClientWindow(plugin, xS(200), yS(60), xS(200), yS(60), 0)
 {
        this->plugin = plugin;
 }
index 8dcdf97..16c2f54 100644 (file)
@@ -699,7 +699,7 @@ int GraphicReset::handle_event()
 
 
 GraphicSize::GraphicSize(GraphicGUI *window, GraphicEQ *plugin, int x, int y)
- : BC_PopupMenu(x, y, xS(100), "4096", 1)
+ : BC_PopupMenu(x, y, xS(120), "4096", 1)
 {
        this->plugin = plugin;
        this->window = window;
index 5974c90..dfdaea0 100644 (file)
@@ -103,10 +103,10 @@ LoopAudioConfig::LoopAudioConfig()
 
 LoopAudioWindow::LoopAudioWindow(LoopAudio *plugin)
  : PluginClientWindow(plugin,
-       xS(210),
-       yS(160),
-       xS(200),
-       yS(160),
+       xS(180),
+       yS(65),
+       xS(180),
+       yS(65),
        0)
 {
        this->plugin = plugin;
index 975b3b3..b9c7747 100644 (file)
@@ -185,10 +185,10 @@ const char* OverlayAudioConfig::mode_to_text(int mode)
 
 OverlayAudioWindow::OverlayAudioWindow(OverlayAudio *plugin)
  : PluginClientWindow(plugin,
-       xS(400),
-       yS(100),
-       xS(400),
-       yS(100),
+       xS(300),
+       yS(70),
+       xS(300),
+       yS(70),
        0)
 {
        this->plugin = plugin;
index ddc8522..ceb7b1d 100644 (file)
@@ -360,7 +360,7 @@ int ParametricWetness::handle_event()
 
 
 ParametricSize::ParametricSize(ParametricWindow *window, ParametricEQ *plugin, int x, int y)
- : BC_PopupMenu(x, y, xS(100), "4096", 1)
+ : BC_PopupMenu(x, y, xS(120), "4096", 1)
 {
        this->plugin = plugin;
        this->window = window;
index b858ea2..9f1b1b5 100644 (file)
@@ -465,7 +465,7 @@ int PitchScale::handle_event()
 
 
 PitchSize::PitchSize(PitchWindow *window, PitchEffect *plugin, int x, int y)
- : BC_PopupMenu(x, y, xS(100), "4096", 1)
+ : BC_PopupMenu(x, y, xS(110), "4096", 1)
 {
        this->plugin = plugin;
 }
index 4fff8f2..cfa5304 100644 (file)
@@ -85,9 +85,9 @@ void RemoveGapsConfig::boundaries()
 RemoveGapsWindow::RemoveGapsWindow(RemoveGaps *plugin)
  : PluginClientWindow(plugin,
        xS(320),
-       yS(160),
+       yS(100),
        xS(320),
-       yS(160),
+       yS(100),
        0)
 {
        this->plugin = plugin;
index 27f6027..f0c75d8 100644 (file)
@@ -79,10 +79,10 @@ void ResampleRTConfig::boundaries()
 
 ResampleRTWindow::ResampleRTWindow(ResampleRT *plugin)
  : PluginClientWindow(plugin,
-       xS(210),
-       yS(160),
-       xS(200),
-       yS(160),
+       xS(180),
+       yS(110),
+       xS(180),
+       yS(110),
        0)
 {
        this->plugin = plugin;
index 909b192..72ead06 100644 (file)
@@ -255,9 +255,7 @@ double Synth::solve_eqn(double *output,
                        for(sample = 0; sample < length; sample++)
                        {
                                output[sample] += sin((x + phase_offset) /
-                                       period *
-                                       2 *
-                                       M_PI) * power;
+                                       period * 2 * M_PI) * power;
                                x += step;
                        }
                        break;
@@ -327,25 +325,18 @@ double Synth::get_oscillator_point(float x,
        {
                case DC:
                        return power;
-                       break;
                case SINE:
                        return sin((x + config->phase) * config->freq_factor * 2 * M_PI) * power;
-                       break;
                case SAWTOOTH:
                        return function_sawtooth((x + config->phase) * config->freq_factor) * power;
-                       break;
                case SQUARE:
                        return function_square((x + config->phase) * config->freq_factor) * power;
-                       break;
                case TRIANGLE:
                        return function_triangle((x + config->phase) * config->freq_factor) * power;
-                       break;
                case PULSE:
                        return function_pulse((x + config->phase) * config->freq_factor) * power;
-                       break;
                case NOISE:
                        return function_noise() * power;
-                       break;
        }
        return 0;
 }
@@ -425,11 +416,7 @@ int Synth::overlay_synth(double freq,
 {
        double normalize_constant = 1.0 / get_total_power();
        for(int i = 0; i < config.oscillator_config.total; i++)
-               solve_eqn(output,
-                       length,
-                       freq,
-                       normalize_constant,
-                       i);
+               solve_eqn(output, length, freq, normalize_constant, i);
        return length;
 }
 
@@ -501,39 +488,9 @@ void Synth::delete_freqs()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 SynthWindow::SynthWindow(Synth *synth)
- : PluginClientWindow(synth,
-       synth->window_w,
-       synth->window_h,
-       xS(400),
-       yS(350),
-       1)
+ : PluginClientWindow(synth, synth->window_w, synth->window_h,
+               xS(400), yS(350), 1)
 {
        this->synth = synth;
        white_key[0] = 0;
@@ -675,9 +632,9 @@ void SynthWindow::create_objects()
        black_key[4] = new VFramePng(black_checkedhi_png);
 
 
-       add_subwindow(note_subwindow = new BC_SubWindow(x1,
+       add_subwindow(note_subwindow = new BC_SubWindow(x1+xS(20),
                y,
-               get_w() - x1,
+               get_w() - (x1+xS(20)),
                white_key[0]->get_h() + MARGIN +
                get_text_height(MEDIUMFONT) + MARGIN +
                get_text_height(MEDIUMFONT) + MARGIN));
@@ -687,14 +644,12 @@ void SynthWindow::create_objects()
                note_subwindow->get_y() + note_subwindow->get_h(),
                note_subwindow->get_w()));
 
-       add_subwindow(momentary = new SynthMomentary(this,
-               x1,
+       add_subwindow(momentary = new SynthMomentary(this, x1,
                note_scroll->get_y() + note_scroll->get_h() + MARGIN,
                _("Momentary notes")));
 
 
-       add_subwindow(note_instructions = new BC_Title(
-               x1,
+       add_subwindow(note_instructions = new BC_Title( x1,
                momentary->get_y() + momentary->get_h() + MARGIN,
                _("Ctrl or Shift to select multiple notes.")));
 
@@ -987,7 +942,7 @@ void SynthWindow::update_oscillators()
                {
                        gui = oscillators.values[i];
 
-                       gui->title->reposition_window(gui->title->get_x(), y + 15);
+                       gui->title->reposition_window(gui->title->get_x(), y + yS(15));
 
                        gui->level->reposition_window(gui->level->get_x(), y);
                        gui->level->update(config->level);
@@ -1026,10 +981,7 @@ int SynthWindow::waveform_to_text(char *text, int waveform)
 
 
 SynthMomentary::SynthMomentary(SynthWindow *window, int x, int y, char *text)
- : BC_CheckBox(x,
-       y,
-       window->synth->config.momentary_notes,
-       text)
+ : BC_CheckBox(x, y, window->synth->config.momentary_notes, text)
 {
        this->window = window;
 }
@@ -1044,15 +996,8 @@ int SynthMomentary::handle_event()
 
 
 
-SynthNote::SynthNote(SynthWindow *window,
-       VFrame **images,
-       int number,
-       int x,
-       int y)
- : BC_Toggle(x,
-       y,
-       images,
-       window->synth->freq_exists(keyboard_freqs[number]))
+SynthNote::SynthNote(SynthWindow *window, VFrame **images, int number, int x, int y)
+ : BC_Toggle(x, y, images, window->synth->freq_exists(keyboard_freqs[number]))
 {
        this->window = window;
        this->number = number;
@@ -1237,11 +1182,6 @@ int SynthNote::draw_face(int flash, int flush)
 }
 
 
-
-
-
-
-
 SynthOscGUI::SynthOscGUI(SynthWindow *window, int number)
 {
        this->window = window;
@@ -1260,7 +1200,7 @@ void SynthOscGUI::create_objects(int y)
 {
        char text[BCTEXTLEN];
        sprintf(text, "%d:", number + 1);
-       window->osc_subwindow->add_subwindow(title = new BC_Title(10, y + 15, text));
+       window->osc_subwindow->add_subwindow(title = new BC_Title(xS(10), y+yS(15), text));
 
        window->osc_subwindow->add_subwindow(level = new SynthOscGUILevel(window->synth, this, y));
        window->osc_subwindow->add_subwindow(phase = new SynthOscGUIPhase(window->synth, this, y));
@@ -1271,11 +1211,9 @@ void SynthOscGUI::create_objects(int y)
 
 
 SynthOscGUILevel::SynthOscGUILevel(Synth *synth, SynthOscGUI *gui, int y)
- : BC_FPot(50,
-       y,
+ : BC_FPot(xS(50), y,
        synth->config.oscillator_config.values[gui->number]->level,
-       INFINITYGAIN,
-       0)
+       INFINITYGAIN, 0)
 {
        this->synth = synth;
        this->gui = gui;
@@ -1297,11 +1235,9 @@ int SynthOscGUILevel::handle_event()
 
 
 SynthOscGUIPhase::SynthOscGUIPhase(Synth *synth, SynthOscGUI *gui, int y)
- : BC_IPot(125,
-       y,
+ : BC_IPot(xS(125), y,
        (int64_t)(synth->config.oscillator_config.values[gui->number]->phase * 360),
-       0,
-       360)
+       0, 360)
 {
        this->synth = synth;
        this->gui = gui;
@@ -1323,11 +1259,9 @@ int SynthOscGUIPhase::handle_event()
 
 
 SynthOscGUIFreq::SynthOscGUIFreq(Synth *synth, SynthOscGUI *gui, int y)
- : BC_IPot(200,
-       y,
+ : BC_IPot(xS(200), y,
        (int64_t)(synth->config.oscillator_config.values[gui->number]->freq_factor),
-       1,
-       100)
+       1, 100)
 {
        this->synth = synth;
        this->gui = gui;
@@ -1347,11 +1281,6 @@ int SynthOscGUIFreq::handle_event()
 }
 
 
-
-
-
-
-
 SynthAddOsc::SynthAddOsc(Synth *synth, SynthWindow *window, int x, int y)
  : BC_GenericButton(x, y, _("Add"))
 {
@@ -1372,7 +1301,6 @@ int SynthAddOsc::handle_event()
 }
 
 
-
 SynthDelOsc::SynthDelOsc(Synth *synth, SynthWindow *window, int x, int y)
  : BC_GenericButton(x, y, _("Delete"))
 {
@@ -1393,18 +1321,11 @@ int SynthDelOsc::handle_event()
 }
 
 
-OscScroll::OscScroll(Synth *synth,
-       SynthWindow *window,
-       int x,
-       int y,
-       int h)
- : BC_ScrollBar(x,
-       y,
-       SCROLL_VERT,
-       h,
+OscScroll::OscScroll(Synth *synth, SynthWindow *window,
+               int x, int y, int h)
+ : BC_ScrollBar(x, y, SCROLL_VERT, h,
        synth->config.oscillator_config.total * OSCILLATORHEIGHT,
-       0,
-       window->osc_subwindow->get_h())
+       0, window->osc_subwindow->get_h())
 {
        this->synth = synth;
        this->window = window;
@@ -1422,18 +1343,11 @@ int OscScroll::handle_event()
 
 
 
-NoteScroll::NoteScroll(Synth *synth,
-       SynthWindow *window,
-       int x,
-       int y,
-       int w)
- : BC_ScrollBar(x,
-       y,
-       SCROLL_HORIZ,
-       w,
+NoteScroll::NoteScroll(Synth *synth, SynthWindow *window,
+               int x, int y, int w)
+ : BC_ScrollBar(x, y, SCROLL_HORIZ, w,
        window->white_key[0]->get_w() * TOTALNOTES * 7 / 12 + window->white_key[0]->get_w(),
-       0,
-       window->note_subwindow->get_w())
+       0, window->note_subwindow->get_w())
 {
        this->synth = synth;
        this->window = window;
@@ -1450,18 +1364,6 @@ int NoteScroll::handle_event()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
 SynthClear::SynthClear(Synth *synth, int x, int y)
  : BC_GenericButton(x, y, _("Clear"))
 {
@@ -1479,10 +1381,6 @@ int SynthClear::handle_event()
 }
 
 
-
-
-
-
 SynthWaveForm::SynthWaveForm(Synth *synth, int x, int y, char *text)
  : BC_PopupMenu(x, y, xS(120), text)
 {
@@ -1526,11 +1424,7 @@ int SynthWaveFormItem::handle_event()
 
 
 SynthWetness::SynthWetness(Synth *synth, int x, int y)
- : BC_FPot(x,
-               y,
-               synth->config.wetness,
-               INFINITYGAIN,
-               0)
+ : BC_FPot(x, y, synth->config.wetness, INFINITYGAIN, 0)
 {
        this->synth = synth;
 }
@@ -1595,17 +1489,9 @@ int SynthBaseFreq::handle_event()
 
 
 
-SynthCanvas::SynthCanvas(Synth *synth,
-       SynthWindow *window,
-       int x,
-       int y,
-       int w,
-       int h)
- : BC_SubWindow(x,
-       y,
-       w,
-       h,
-       BLACK)
+SynthCanvas::SynthCanvas(Synth *synth, SynthWindow *window,
+               int x, int y, int w, int h)
+ : BC_SubWindow(x, y, w, h, BLACK)
 {
        this->synth = synth;
        this->window = window;
@@ -1640,12 +1526,6 @@ int SynthCanvas::update()
 }
 
 
-
-
-
-
-
-
 // ======================= level calculations
 SynthLevelZero::SynthLevelZero(Synth *synth)
  : BC_MenuItem(_("Zero"))
@@ -2016,7 +1896,8 @@ int SynthFreqFibonacci::handle_event()
        for(int i = 0; i < synth->config.oscillator_config.total; i++)
        {
                synth->config.oscillator_config.values[i]->freq_factor = last_value1 + last_value2;
-               if(synth->config.oscillator_config.values[i]->freq_factor > 100) synth->config.oscillator_config.values[i]->freq_factor = 100;
+               if(synth->config.oscillator_config.values[i]->freq_factor > 100)
+                       synth->config.oscillator_config.values[i]->freq_factor = 100;
                last_value1 = last_value2;
                last_value2 = synth->config.oscillator_config.values[i]->freq_factor;
        }
index 3529ce9..d8d10bd 100644 (file)
 #include "guicast.h"
 #include "mutex.h"
 #include "pluginaclient.h"
+#include "synthesizer.inc"
 #include "vframe.inc"
 
 
-class Synth;
-class SynthWindow;
-
 // Frequency table for piano
 float keyboard_freqs[] =
 {
@@ -109,12 +107,11 @@ float keyboard_freqs[] =
 
 #define MAX_FREQS 16
 #define TOTALOSCILLATORS 1
-#define OSCILLATORHEIGHT 40
 #define TOTALNOTES ((int)(sizeof(keyboard_freqs) / sizeof(float)))
 #define MIDDLE_C 24
 #define FIRST_TITLE (MIDDLE_C - 12)
 #define LAST_TITLE (MIDDLE_C + 12)
-#define MARGIN 10
+#define MARGIN yS(10)
 
 #define SINE 0
 #define SAWTOOTH 1
index 11f714a..024c704 100644 (file)
@@ -27,6 +27,6 @@
 class Synth;
 class SynthOscillator;
 
-
+#define OSCILLATORHEIGHT yS(40)
 
 #endif
index b8145e1..cddf807 100644 (file)
@@ -22,8 +22,6 @@
 #ifndef SYNTHWINDOW_INC
 #define SYNTHWINDOW_INC
 
-
-
 class SynthThread;
 class SynthOscGUI;
 class SynthOscGUILevel;
@@ -40,7 +38,4 @@ class SynthSubWindow;
 class SynthScroll;
 class SynthClear;
 
-#define OSCILLATORHEIGHT 40
-
-
 #endif
index 0390829..788a4aa 100644 (file)
@@ -935,15 +935,15 @@ void BlondTheme::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 
index 3e11654..de86d4c 100644 (file)
@@ -1244,15 +1244,15 @@ void BlondCVTheme::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 
index 309b0e0..53b6899 100644 (file)
@@ -932,15 +932,15 @@ void BlueDotTheme::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 void BlueDotTheme::build_overlays()
index 8865fec..8f026c6 100644 (file)
@@ -1281,16 +1281,16 @@ void BlueDotTheme::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
 //Graphic Copied from default. Improve!!
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 
index c6a9eb3..613cca7 100644 (file)
@@ -927,15 +927,15 @@ void BrightTheme::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 
index 530b40e..f7d4faf 100644 (file)
@@ -1083,15 +1083,15 @@ void CAKEWALKTHEME::get_vwindow_sizes(VWindowGUI *gui)
 void CAKEWALKTHEME::build_bg_data()
 {
  channel_position_data = new VFramePng(get_image_data("channel_position.png"));
- new_image("resource1024", "resource1024.png");
- new_image("resource512", "resource512.png");
- new_image("resource256", "resource256.png");
- new_image("resource128", "resource128.png");
- new_image("resource64", "resource64.png");
- new_image("resource32", "resource32.png");
- new_image("plugin_bg_data", "plugin_bg.png");
- new_image("title_bg_data", "title_bg.png");
- new_image("vtimebar_bg_data", "vwindow_timebar.png");
+ new_image1("resource1024", "resource1024.png");
+ new_image1("resource512", "resource512.png");
+ new_image1("resource256", "resource256.png");
+ new_image1("resource128", "resource128.png");
+ new_image1("resource64", "resource64.png");
+ new_image1("resource32", "resource32.png");
+ new_image1("plugin_bg_data", "plugin_bg.png");
+ new_image1("title_bg_data", "title_bg.png");
+ new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 void CAKEWALKTHEME::build_overlays()
 {
index e77e343..f75d58b 100644 (file)
@@ -933,15 +933,15 @@ void HULKTHEME::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 
index 019db9d..d30150e 100644 (file)
@@ -1260,15 +1260,15 @@ void NEOPHYTETHEME::build_bg_data()
        // Audio settings
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
        // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 void NEOPHYTETHEME::build_overlays()
index 4e3d6b1..558b14f 100644 (file)
@@ -931,15 +931,15 @@ void PINKLADY::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 void PINKLADY::build_overlays()
index 251d258..91b9c19 100644 (file)
@@ -920,15 +920,15 @@ void SUV::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 
index 8f10237..f835312 100644 (file)
@@ -926,15 +926,15 @@ void UNFLATTHEME::build_bg_data()
        channel_position_data = new VFramePng(get_image_data("channel_position.png"));
 
 // Track bitmaps
-       new_image("resource1024", "resource1024.png");
-       new_image("resource512", "resource512.png");
-       new_image("resource256", "resource256.png");
-       new_image("resource128", "resource128.png");
-       new_image("resource64", "resource64.png");
-       new_image("resource32", "resource32.png");
-       new_image("plugin_bg_data", "plugin_bg.png");
-       new_image("title_bg_data", "title_bg.png");
-       new_image("vtimebar_bg_data", "vwindow_timebar.png");
+       new_image1("resource1024", "resource1024.png");
+       new_image1("resource512", "resource512.png");
+       new_image1("resource256", "resource256.png");
+       new_image1("resource128", "resource128.png");
+       new_image1("resource64", "resource64.png");
+       new_image1("resource32", "resource32.png");
+       new_image1("plugin_bg_data", "plugin_bg.png");
+       new_image1("title_bg_data", "title_bg.png");
+       new_image1("vtimebar_bg_data", "vwindow_timebar.png");
 }
 
 void UNFLATTHEME::build_overlays()
index c84dca4..5deb8c9 100644 (file)
@@ -93,10 +93,10 @@ void TimeStretchRTConfig::boundaries()
 
 TimeStretchRTWindow::TimeStretchRTWindow(TimeStretchRT *plugin)
  : PluginClientWindow(plugin,
-       xS(210),
-       yS(200),
-       xS(200),
-       yS(210),
+       xS(180),
+       yS(160),
+       xS(180),
+       yS(160),
        0)
 {
        this->plugin = plugin;
index 056f68b..271389a 100644 (file)
@@ -3,7 +3,7 @@
 #include "language.h"
 
 yuv411Window::yuv411Window(yuv411Main *client)
- : PluginClientWindow(client, xS(250), yS(255), xS(250), yS(255), 0)
+ : PluginClientWindow(client, xS(260), yS(230), xS(260), yS(230), 0)
 {
        this->client = client;
 }
@@ -15,7 +15,7 @@ yuv411Window::~yuv411Window()
 void yuv411Window::create_objects()
 {
        int xs10 = xS(10), xs90 = xS(90);
-       int ys10 = yS(10), ys30 = yS(30), ys35 = yS(35);
+       int ys10 = yS(10), ys30 = yS(30);
        int x = xs10, y = ys10, x1=xs90;
        add_tool(avg_vertical = new yuv411Toggle(client,
                &(client->config.avg_vertical),
@@ -44,7 +44,7 @@ void yuv411Window::create_objects()
        add_subwindow(new BC_Title(x, y, _("Bias:")));
        add_subwindow(bias=new yuv411Bias(client,x1,y));
        y += ys30;
-       add_subwindow(reset = new yuv411Reset(client, this, x, y+ys35));
+       add_subwindow(reset = new yuv411Reset(client, this, x, y+ys10));
        show_window();
        flush();
 
@@ -87,7 +87,7 @@ int yuv411Toggle::handle_event()
 }
 
 yuv411Offset::yuv411Offset(yuv411Main *client, int x, int y)
- :  BC_FSlider(x, y, 0, xS(100), yS(100), (float)0, (float)2,
+ :  BC_FSlider(x+xS(60), y, 0, xS(100), yS(100), (float)0, (float)2,
             (float)client->config.offset)
 {
        this->client = client;
@@ -101,7 +101,7 @@ int yuv411Offset::handle_event()
 }
 
 yuv411Thresh::yuv411Thresh(yuv411Main *client, int x, int y)
- :  BC_FSlider(x, y, 0, xS(100), yS(100), (float)1, (float)100,
+ :  BC_FSlider(x+xS(60), y, 0, xS(100), yS(100), (float)1, (float)100,
             (float)client->config.thresh)
 {
        this->client = client;
@@ -115,7 +115,7 @@ int yuv411Thresh::handle_event()
 }
 
 yuv411Bias::yuv411Bias(yuv411Main *client, int x, int y)
- :  BC_FSlider(x, y, 0, xS(100), yS(100), (float)0, (float)25,
+ :  BC_FSlider(x+xS(60), y, 0, xS(100), yS(100), (float)0, (float)25,
             (float)client->config.bias)
 {
        this->client = client;