#define PALETTE_DATA "palette.dat"
-ColorThread::ColorThread(int do_alpha, const char *title)
+ColorPicker::ColorPicker(int do_alpha, const char *title)
: BC_DialogThread()
{
this->title = title;
this->alpha = 255;
}
-ColorThread::~ColorThread()
+ColorPicker::~ColorPicker()
{
close_window();
}
-void ColorThread::start_window(int output, int alpha, int do_okcancel)
+void ColorPicker::start_window(int output, int alpha, int do_okcancel)
{
if( running() ) {
ColorWindow *gui = (ColorWindow *)get_gui();
if( gui ) {
- gui->lock_window("ColorThread::start_window");
+ gui->lock_window("ColorPicker::start_window");
gui->raise_window(1);
gui->unlock_window();
}
start();
}
-BC_Window* ColorThread::new_gui()
+BC_Window* ColorPicker::new_gui()
{
char window_title[BCTEXTLEN];
strcpy(window_title, _(PROGRAM_NAME ": "));
return gui;
}
-void ColorThread::update_gui(int output, int alpha)
+void ColorPicker::update_gui(int output, int alpha)
{
ColorWindow *gui = (ColorWindow *)get_gui();
if( !gui ) return;
gui->unlock_window();
}
-int ColorThread::handle_new_color(int output, int alpha)
+int ColorPicker::handle_new_color(int output, int alpha)
{
- printf("ColorThread::handle_new_color undefined.\n");
+ printf("ColorPicker::handle_new_color undefined.\n");
return 0;
}
-ColorWindow::ColorWindow(ColorThread *thread, int x, int y, int w, int h, const char *title)
+ColorWindow::ColorWindow(ColorPicker *thread, int x, int y, int w, int h, const char *title)
: BC_Window(title, x, y, w, h, w, h, 0, 0, 1)
{
this->thread = thread;
class PaletteGrabButton;
class PaletteHistory;
-class ColorThread : public BC_DialogThread
+class ColorPicker : public BC_DialogThread
{
public:
- ColorThread(int do_alpha = 0, const char *title = 0);
- ~ColorThread();
+ ColorPicker(int do_alpha = 0, const char *title = 0);
+ ~ColorPicker();
void start_window(int output, int alpha, int do_okcancel=0);
virtual int handle_new_color(int output, int alpha);
class ColorWindow : public BC_Window
{
public:
- ColorWindow(ColorThread *thread, int x, int y, int w, int h, const char *title);
+ ColorWindow(ColorPicker *thread, int x, int y, int w, int h, const char *title);
~ColorWindow();
void create_objects();
void update_rgb_hex(const char *hex);
int rgb888();
- ColorThread *thread;
+ ColorPicker *thread;
PaletteWheel *wheel;
PaletteWheelValue *wheel_value;
PaletteOutput *output;
class ColorPicker;
-class ColorThread;
-
#endif
}
GWindowColorThread::GWindowColorThread(GWindowColorButton *color_button)
- : ColorThread(0, color_button->auto_toggle->caption)
+ : ColorPicker(0, color_button->auto_toggle->caption)
{
this->color = 0;
this->color_button = color_button;
int GWindowGUI::close_event()
{
+ delete color_thread; color_thread = 0;
hide_window();
mwindow->session->show_gwindow = 0;
unlock_window();
GWindowToggle *auto_toggle;
};
-class GWindowColorThread : public ColorThread
+class GWindowColorThread : public ColorPicker
{
public:
GWindowColorThread(GWindowColorButton *color_button);
// Read the file format & index state.
if(test_indexable->is_asset)
{
- Asset asset, *test_asset = (Asset *)test_indexable;
- asset.read(&xml);
+ Asset *test_asset = (Asset *)test_indexable;
+ Asset *asset = new Asset;
+ asset->read(&xml);
+ int ret = 0;
//printf("IndexFile::read_info %d %f\n", __LINE__, asset->get_frame_rate());
- if( asset.format == FILE_UNKNOWN ||
- test_asset->format != asset.format )
- {
+ if( asset->format == FILE_UNKNOWN ||
+ test_asset->format != asset->format ) {
if(debug) printf("IndexFile::read_info %d\n", __LINE__);
- return 1;
+ ret = 1;
}
+ asset->remove_user();
+ if( ret ) return ret;
}
else
{
renderfarm_job_count = 20;
project_smp = processors = calculate_processors(0);
real_processors = calculate_processors(1);
- ffmpeg_early_probe = 0;
+ ffmpeg_early_probe = 1;
ffmpeg_marker_indexes = 1;
warn_indexes = 1;
warn_version = 1;
sample->flash();
}
+void ChromaKeyWindow::done_event(int result)
+{
+ color_thread->close_window();
+}
+
ChromaKeyColorThread::ChromaKeyColorThread(ChromaKey *plugin, ChromaKeyWindow *gui)
- : ColorThread(1, _("Inner color"))
+ : ColorPicker(1, _("Inner color"))
{
this->plugin = plugin;
this->gui = gui;
};
-class ChromaKeyColorThread : public ColorThread
+class ChromaKeyColorThread : public ColorPicker
{
public:
ChromaKeyColorThread(ChromaKey *plugin, ChromaKeyWindow *gui);
void create_objects();
void update_sample();
+ void done_event(int result);
ChromaKeyColor *color;
ChromaKeyThreshold *threshold;
sample->flash ();
}
+void ChromaKeyWindow::done_event(int result)
+{
+ color_thread->close_window();
+}
ChromaKeyColor::ChromaKeyColor (ChromaKeyHSV * plugin,
ChromaKeyColorThread::ChromaKeyColorThread (ChromaKeyHSV * plugin, ChromaKeyWindow * gui)
- : ColorThread (1, _("Inner color"))
+ : ColorPicker (1, _("Inner color"))
{
this->plugin = plugin;
this->gui = gui;
};
-class ChromaKeyColorThread : public ColorThread
+class ChromaKeyColorThread : public ColorPicker
{
public:
ChromaKeyColorThread(ChromaKeyHSV *plugin, ChromaKeyWindow *gui);
void create_objects();
void update_sample();
+ void done_event(int result);
ChromaKeyColor *color;
ChromaKeyUseColorPicker *use_colorpicker;
flash(out_color_x, out_color_y, COLOR_W, COLOR_H);
}
+void GradientWindow::done_event(int result)
+{
+ in_color_thread->close_window();
+ out_color_thread->close_window();
+}
+
GradientInColorThread::GradientInColorThread(GradientMain *plugin,
GradientWindow *window)
- : ColorThread(1, _("Inner color"))
+ : ColorPicker(1, _("Inner color"))
{
this->plugin = plugin;
this->window = window;
GradientOutColorThread::GradientOutColorThread(GradientMain *plugin,
GradientWindow *window)
- : ColorThread(1, _("Outer color"))
+ : ColorPicker(1, _("Outer color"))
{
this->plugin = plugin;
this->window = window;
};
-class GradientInColorThread : public ColorThread
+class GradientInColorThread : public ColorPicker
{
public:
GradientInColorThread(GradientMain *plugin, GradientWindow *window);
};
-class GradientOutColorThread : public ColorThread
+class GradientOutColorThread : public ColorPicker
{
public:
GradientOutColorThread(GradientMain *plugin, GradientWindow *window);
void update_in_color();
void update_out_color();
void update_shape();
+ void done_event(int result);
GradientMain *plugin;
BC_Title *angle_title;
ThresholdLowColorThread::ThresholdLowColorThread(ThresholdMain *plugin, ThresholdWindow *window)
- : ColorThread(1, _("Low color"))
+ : ColorPicker(1, _("Low color"))
{
this->plugin = plugin;
this->window = window;
ThresholdMidColorThread::ThresholdMidColorThread(ThresholdMain *plugin, ThresholdWindow *window)
- : ColorThread(1, _("Mid color"))
+ : ColorPicker(1, _("Mid color"))
{
this->plugin = plugin;
this->window = window;
ThresholdHighColorThread::ThresholdHighColorThread(ThresholdMain *plugin, ThresholdWindow *window)
- : ColorThread(1, _("High color"))
+ : ColorPicker(1, _("High color"))
{
this->plugin = plugin;
this->window = window;
flash(high_color_x, high_color_y, COLOR_W, COLOR_H);
}
+void ThresholdWindow::done_event(int result)
+{
+ low_color_thread->close_window();
+ mid_color_thread->close_window();
+ high_color_thread->close_window();
+}
+
ThresholdWindow *window;
};
-class ThresholdLowColorThread : public ColorThread
+class ThresholdLowColorThread : public ColorPicker
{
public:
ThresholdLowColorThread(ThresholdMain *plugin, ThresholdWindow *window);
ThresholdWindow *window;
};
-class ThresholdMidColorThread : public ColorThread
+class ThresholdMidColorThread : public ColorPicker
{
public:
ThresholdMidColorThread(ThresholdMain *plugin, ThresholdWindow *window);
ThresholdWindow *window;
};
-class ThresholdHighColorThread : public ColorThread
+class ThresholdHighColorThread : public ColorPicker
{
public:
ThresholdHighColorThread(ThresholdMain *plugin, ThresholdWindow *window);
void update_low_color();
void update_mid_color();
void update_high_color();
+ void done_event(int result);
ThresholdMain *plugin;
ThresholdMin *min;
TitleColorThread::TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline)
- : ColorThread(1, is_outline? _("Outline Color") : _("Text Color"))
+ : ColorPicker(1, is_outline? _("Outline Color") : _("Text Color"))
{
this->client = client;
this->window = window;
}
TitleColorPopup::TitleColorPopup(TitleMain *client, TitleWindow *window)
- : ColorThread(0, _("Color"))
+ : ColorPicker(0, _("Color"))
{
this->client = client;
this->window = window;
TitleMain *client;
TitleWindow *window;
};
-class TitleColorThread : public ColorThread
+class TitleColorThread : public ColorPicker
{
public:
TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
TitleWindow *window;
};
-class TitleColorPopup : public ColorThread
+class TitleColorPopup : public ColorPicker
{
public:
TitleColorPopup(TitleMain *client, TitleWindow *window);