- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
The precise terms and conditions for copying, distribution and
modification follow.
-\f
- GNU GENERAL PUBLIC LICENSE
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-\f
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-\f
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-\f
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-\f
- How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
-
-Also:
-
-cinfinity icons (c) by "sam" are licensed under a
-Creative Commons Attribution 4.0 International License.
-see: <http://creativecommons.org/licenses/by/4.0/>.
-
UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1);
add_subwindow(tip_win);
y1 += tip_win->get_h() + 5;
+ AutocolorAssets *autocolor_assets = new AutocolorAssets(pwindow, x1, y1);
+ add_subwindow(autocolor_assets);
+ y1 += autocolor_assets->get_h() + 5;
UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1);
add_subwindow(idx_win);
y1 += idx_win->get_h() + 5;
return 1;
}
+AutocolorAssets::AutocolorAssets(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->autocolor_assets,
+ _("Autocolor assets"))
+{
+ this->pwindow = pwindow;
+}
+
+int AutocolorAssets::handle_event()
+{
+ pwindow->thread->preferences->autocolor_assets = get_value();
+ return 1;
+}
+
HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex)
: BC_TextBox(x, y, 80, 1, hex)
{
PreferencesWindow *pwindow;
};
+class AutocolorAssets : public BC_CheckBox
+{
+public:
+ AutocolorAssets(PreferencesWindow *pwindow, int x, int y);
+ int handle_event();
+ PreferencesWindow *pwindow;
+};
+
class HighlightInverseColor : public BC_TextBox
{
public:
{
this->title = title;
this->do_alpha = do_alpha;
- this->do_okcancel = 0;
+ this->ok_cancel = 0;
this->output = this->orig_color = BLACK;
this->alpha = this->orig_alpha = 255;
}
close_window();
}
-void ColorPicker::start_window(int output, int alpha, int do_okcancel)
+void ColorPicker::start_window(int output, int alpha, int ok_cancel)
{
if( running() ) {
ColorWindow *gui = (ColorWindow *)get_gui();
this->orig_alpha = alpha;
this->output = output;
this->alpha = alpha;
- this->do_okcancel = do_okcancel;
+ this->ok_cancel = ok_cancel;
start();
}
int x = display_info.get_abs_cursor_x() + 25;
int y = display_info.get_abs_cursor_y() - 100;
int w = 540, h = 330;
- if( do_okcancel )
+ if( ok_cancel )
h += bmax(BC_OKButton::calculate_h(),BC_CancelButton::calculate_h());
int root_w = display_info.get_root_w(), root_h = display_info.get_root_h();
if( x+w > root_w ) x = root_w - w;
int ColorPicker::handle_new_color(int output, int alpha)
{
printf("ColorPicker::handle_new_color undefined.\n");
- return 0;
+ return 1;
}
aph_a = new PaletteAPH(this, x,y+=40, aph, 0, 1);
aph_a->create_objects(); aph_a->set_tooltip(_("Alpha"));
}
- if( thread->do_okcancel ) {
+ if( thread->ok_cancel ) {
add_tool(new BC_OKButton(this));
add_tool(new BC_CancelButton(this));
}
+ thread->create_objects(this);
update_display();
update_history();
int ColorWindow::close_event()
{
- set_done(thread->do_okcancel ? 1 : 0);
+ set_done(thread->ok_cancel ? 1 : 0);
return 1;
}
return result;
}
+
+ColorButton::ColorButton(const char *title,
+ int x, int y, int w, int h,
+ int color, int alpha, int ok_cancel)
+ : BC_Button(x, y, w, vframes)
+{
+ this->title = title;
+ this->color = this->orig_color = color;
+ this->alpha = this->orig_alpha = alpha;
+ this->ok_cancel = ok_cancel;
+
+ for( int i=0; i<3; ++i ) {
+ vframes[i] = new VFrame(w, h, BC_RGBA8888);
+ vframes[i]->clear_frame();
+ }
+ color_picker = 0;
+ color_thread = 0;
+}
+
+ColorButton::~ColorButton()
+{
+ delete color_thread;
+ delete color_picker;
+ for( int i=0; i<3; ++i )
+ delete vframes[i];
+}
+
+void ColorButton::set_color(int color)
+{
+ printf("ColorButton::set_color %06x\n", color);
+}
+void ColorButton::handle_done_event(int result)
+{
+ color_thread->stop();
+}
+int ColorButton::handle_new_color(int color, int alpha)
+{
+ printf("ColorButton::handle_new_color %02x%06x\n", alpha, color);
+ return 1;
+}
+
+int ColorButton::handle_event()
+{
+ unlock_window();
+ delete color_picker;
+ color_picker = new ColorButtonPicker(this);
+ orig_color = color; orig_alpha = alpha;
+ color_picker->start_window(color, alpha, ok_cancel);
+ if( !color_thread )
+ color_thread = new ColorButtonThread(this);
+ color_thread->start();
+ lock_window("ColorButtonButton::start_color_thread");
+ return 1;
+}
+
+void ColorButton::close_picker()
+{
+ if( color_thread ) color_thread->stop();
+ delete color_thread; color_thread = 0;
+ delete color_picker; color_picker = 0;
+}
+
+void ColorButton::update_gui(int color)
+{
+ set_color(color);
+ draw_face();
+}
+
+ColorButtonPicker::ColorButtonPicker(ColorButton *color_button)
+ : ColorPicker(color_button->alpha >= 0 ? 1 : 0, color_button->title)
+{
+ this->color_button = color_button;
+}
+
+ColorButtonPicker::~ColorButtonPicker()
+{
+}
+
+void ColorButtonPicker::handle_done_event(int result)
+{
+ color_button->color_thread->stop();
+ color_button->handle_done_event(result);
+}
+
+int ColorButtonPicker::handle_new_color(int color, int alpha)
+{
+ color_button->color = color;
+ color_button->color_thread->update_lock->unlock();
+ color_button->handle_new_color(color, alpha);
+ return 1;
+}
+
+void ColorButtonPicker::update_gui()
+{
+ color_button->lock_window("ColorButtonPicker::update_gui");
+ color_button->update_gui(color_button->color);
+ color_button->unlock_window();
+}
+
+ColorButtonThread::ColorButtonThread(ColorButton *color_button)
+ : Thread(1, 0, 0)
+{
+ this->color_button = color_button;
+ this->update_lock = new Condition(0,"ColorButtonThread::update_lock");
+ done = 1;
+}
+
+ColorButtonThread::~ColorButtonThread()
+{
+ stop();
+ delete update_lock;
+}
+
+void ColorButtonThread::start()
+{
+ if( done ) {
+ done = 0;
+ Thread::start();
+ }
+}
+
+void ColorButtonThread::stop()
+{
+ if( !done ) {
+ done = 1;
+ update_lock->unlock();
+ join();
+ }
+}
+
+void ColorButtonThread::run()
+{
+ ColorButtonPicker *color_picker = color_button->color_picker;
+ color_picker->update_gui();
+ while( !done ) {
+ update_lock->lock("ColorButtonThread::run");
+ if( done ) break;
+ color_picker->update_gui();
+ }
+}
+
+
+ColorBoxButton::ColorBoxButton(const char *title,
+ int x, int y, int w, int h,
+ int color, int alpha, int ok_cancel)
+ : ColorButton(title, x, y, w, h, color, alpha, ok_cancel)
+{
+}
+ColorBoxButton::~ColorBoxButton()
+{
+}
+
+int ColorBoxButton::handle_new_color(int color, int alpha)
+{
+ return ColorButton::handle_new_color(color, alpha);
+}
+void ColorBoxButton::handle_done_event(int result)
+{
+ ColorButton::handle_done_event(result);
+}
+void ColorBoxButton::create_objects()
+{
+ update_gui(color);
+}
+
+void ColorBoxButton::set_color(int color)
+{
+ this->color = color;
+ int r = (color>>16) & 0xff;
+ int g = (color>> 8) & 0xff;
+ int b = (color>> 0) & 0xff;
+ int color_model = vframes[0]->get_color_model();
+ int bpp = BC_CModels::calculate_pixelsize(color_model);
+ for( int i=0; i<3; ++i ) {
+ VFrame *vframe = vframes[i];
+ int ww = vframe->get_w(), hh = vframe->get_h();
+ uint8_t **rows = vframe->get_rows();
+ int rr = r, gg = g, bb = b;
+ switch( i ) {
+ case BUTTON_UP:
+ break;
+ case BUTTON_UPHI:
+ if( (rr+=48) > 0xff ) rr = 0xff;
+ if( (gg+=48) > 0xff ) gg = 0xff;
+ if( (bb+=48) > 0xff ) bb = 0xff;
+ break;
+ case BUTTON_DOWNHI:
+ if( (rr-=48) < 0x00 ) rr = 0x00;
+ if( (gg-=48) < 0x00 ) gg = 0x00;
+ if( (bb-=48) < 0x00 ) bb = 0x00;
+ break;
+ }
+ for( int y=0; y<hh; ++y ) {
+ uint8_t *rp = rows[y];
+ for( int x=0; x<ww; ++x ) {
+ rp[0] = rr; rp[1] = gg; rp[2] = bb;
+ if( bpp > 3 ) rp[3] = 0xff;
+ rp += bpp;
+ }
+ }
+ }
+ set_images(vframes);
+}
+
+ColorCircleButton::ColorCircleButton(const char *title,
+ int x, int y, int w, int h,
+ int color, int alpha, int ok_cancel)
+ : ColorButton(title, x, y, w, h, color, alpha, ok_cancel)
+{
+}
+ColorCircleButton::~ColorCircleButton()
+{
+}
+int ColorCircleButton::handle_new_color(int color, int alpha)
+{
+ return ColorButton::handle_new_color(color, alpha);
+}
+void ColorCircleButton::handle_done_event(int result)
+{
+ ColorButton::handle_done_event(result);
+}
+void ColorCircleButton::create_objects()
+{
+ update_gui(color);
+}
+
+void ColorCircleButton::set_color(int color)
+{
+ this->color = color;
+ int r = (color>>16) & 0xff;
+ int g = (color>>8) & 0xff;
+ int b = (color>>0) & 0xff;
+ for( int i=0; i<3; ++i ) {
+ VFrame *vframe = vframes[i];
+ int ww = vframe->get_w(), hh = vframe->get_h();
+ int cx = (ww+1)/2, cy = hh/2;
+ double cc = (cx*cx + cy*cy) / 4.;
+ uint8_t *bp = vframe->get_data(), *dp = bp;
+ uint8_t *ep = dp + vframe->get_data_size();
+ int rr = r, gg = g, bb = b;
+ int bpl = vframe->get_bytes_per_line();
+ switch( i ) {
+ case BUTTON_UP:
+ break;
+ case BUTTON_UPHI:
+ if( (rr+=48) > 0xff ) rr = 0xff;
+ if( (gg+=48) > 0xff ) gg = 0xff;
+ if( (bb+=48) > 0xff ) bb = 0xff;
+ break;
+ case BUTTON_DOWNHI:
+ if( (rr-=48) < 0x00 ) rr = 0x00;
+ if( (gg-=48) < 0x00 ) gg = 0x00;
+ if( (bb-=48) < 0x00 ) bb = 0x00;
+ break;
+ }
+ while( dp < ep ) {
+ int yy = (dp-bp) / bpl, xx = ((dp-bp) % bpl) >> 2;
+ int dy = cy - yy, dx = cx - xx;
+ double s = dx*dx + dy*dy - cc;
+ double ss = s < 0 ? 1 : s >= cc ? 0 : 1 - s/cc;
+ int aa = ss * 0xff;
+ *dp++ = rr; *dp++ = gg; *dp++ = bb; *dp++ = aa;
+ }
+ }
+ set_images(vframes);
+}
+
#include "bctextbox.h"
#include "bcsubwindow.h"
#include "clip.h"
+#include "colorpicker.inc"
#include "condition.inc"
#include "guicast.h"
#include "mutex.inc"
#define PALLETTE_HISTORY_SIZE 16
-class ColorWindow;
-class PaletteWheel;
-class PaletteWheelValue;
-class PaletteOutput;
-class PaletteHue;
-class PaletteSat;
-class PaletteVal;
-class PaletteRed;
-class PaletteGrn;
-class PaletteBlu;
-class PaletteLum;
-class PaletteCr;
-class PaletteCb;
-class PaletteAlpha;
-class PaletteHSV;
-class PaletteRGB;
-class PaletteYUV;
-class PaletteAPH;
-class PaletteHexButton;
-class PaletteHex;
-class PaletteGrabButton;
-class PaletteHistory;
class ColorPicker : public BC_DialogThread
{
ColorPicker(int do_alpha = 0, const char *title = 0);
~ColorPicker();
- void start_window(int output, int alpha, int do_okcancel=0);
+ void start_window(int output, int alpha, int ok_cancel=0);
virtual int handle_new_color(int output, int alpha);
void update_gui(int output, int alpha);
BC_Window* new_gui();
+ virtual void create_objects(ColorWindow *gui) {}
int orig_color, orig_alpha;
int output, alpha;
- int do_alpha, do_okcancel;
+ int do_alpha, ok_cancel;
const char *title;
};
int button_down;
};
+class ColorButton : public BC_Button
+{
+public:
+ ColorButton(const char *title,
+ int x, int y, int w, int h,
+ int color, int alpha, int ok_cancel);
+ ~ColorButton();
+
+ virtual void set_color(int color);
+ virtual int handle_new_color(int color, int alpha);
+ virtual void handle_done_event(int result);
+
+ void close_picker();
+ void update_gui(int color);
+ int handle_event();
+
+ const char *title;
+ int color, alpha, ok_cancel;
+ int orig_color, orig_alpha;
+
+ VFrame *vframes[3];
+ ColorButtonPicker *color_picker;
+ ColorButtonThread *color_thread;
+};
+
+class ColorButtonPicker : public ColorPicker
+{
+public:
+ ColorButtonPicker(ColorButton *color_button);
+ ~ColorButtonPicker();
+ int handle_new_color(int color, int alpha);
+ void handle_done_event(int result);
+ void update_gui();
+
+ ColorButton *color_button;
+};
+
+class ColorButtonThread : public Thread
+{
+public:
+ ColorButtonThread(ColorButton *color_button);
+ ~ColorButtonThread();
+
+ void start();
+ void stop();
+ void run();
+
+ ColorButton *color_button;
+ Condition *update_lock;
+ int done;
+};
+
+class ColorBoxButton : public ColorButton
+{
+public:
+ ColorBoxButton(const char *title,
+ int x, int y, int w, int h,
+ int color, int alpha, int ok_cancel);
+ ~ColorBoxButton();
+ void create_objects();
+
+ virtual int handle_new_color(int color, int alpha);
+ virtual void handle_done_event(int result);
+ void set_color(int color);
+};
+
+class ColorCircleButton : public ColorButton
+{
+public:
+ ColorCircleButton(const char *title,
+ int x, int y, int w, int h,
+ int color, int alpha, int ok_cancel);
+ ~ColorCircleButton();
+ void create_objects();
+
+ virtual int handle_new_color(int color, int alpha);
+ virtual void handle_done_event(int result);
+ void set_color(int color);
+};
+
#endif
#define COLORPICKER_INC
class ColorPicker;
+class ColorWindow;
+class PaletteWheel;
+class PaletteWheelValue;
+class PaletteOutput;
+class PaletteHue;
+class PaletteSat;
+class PaletteVal;
+class PaletteRed;
+class PaletteGrn;
+class PaletteBlu;
+class PaletteAlpha;
+class PaletteLum;
+class PaletteCr;
+class PaletteCb;
+class PaletteNum;
+class PaletteRGB;
+class PaletteYUV;
+class PaletteHSV;
+class PaletteAPH;
+class PaletteHexButton;
+class PaletteHex;
+class PaletteGrabButton;
+class PaletteHistory;
+class ColorButton;
+class ColorButtonPicker;
+class ColorButtonThread;
+class ColorBoxButton;
+class ColorCircleButton;
#endif
is_selected = 0;
hard_left = 0;
hard_right = 0;
+ color = -1;
}
Indexable* Edit::get_source()
file->tag.set_property("LENGTH", length_in_selection);
file->tag.set_property("HARD_LEFT", hard_left);
file->tag.set_property("HARD_RIGHT", hard_right);
+ file->tag.set_property("COLOR", color);
if(user_title[0]) file->tag.set_property("USER_TITLE", user_title);
//printf("Edit::copy 5\n");
this->length = edit->length;
this->hard_left = edit->hard_left;
this->hard_right = edit->hard_right;
+ this->color = edit->color;
strcpy (this->user_title, edit->user_title);
if(edit->transition)
this->startsource == edit.startsource &&
this->startproject == edit.startproject &&
this->length == edit.length &&
- this->hard_left == edit.hard_left &&
- this->hard_right == edit.hard_right &&
this->transition == edit.transition &&
this->channel == edit.channel);
return result;
asset,
asset ? asset->path : "");
fflush(fp);
- fprintf(fp," channel %d\n", channel);
+ fprintf(fp," channel %d, color %08x\n", channel, color);
if(transition)
{
fprintf(fp," TRANSITION %p\n", transition);
length = file->tag.get_property("LENGTH", (int64_t)0);
hard_left = file->tag.get_property("HARD_LEFT", (int64_t)0);
hard_right = file->tag.get_property("HARD_RIGHT", (int64_t)0);
+ color = file->tag.get_property("COLOR", (int64_t)-1);
user_title[0] = 0;
file->tag.get_property("USER_TITLE", user_title);
this->startproject = startproject;
return 0;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
int Edit::popup_transition(float view_start, float zoom_units, int cursor_x, int cursor_y)
{
int64_t left, right, left_unit, right_unit;
}
}
+int Edit::get_hash_color()
+{
+ Indexable *idxbl = asset ? (Indexable*)asset : (Indexable*)nested_edl;
+ if( !idxbl ) return -1;
+ int v = 0;
+ for( uint8_t *bp=(uint8_t*)idxbl->path; *bp; ++bp ) v += *bp;
+ int color = 0x303030;
+ if( v & 0x01 ) color ^= 0x000040;
+ if( v & 0x02 ) color ^= 0x004000;
+ if( v & 0x04 ) color ^= 0x400000;
+ if( v & 0x08 ) color ^= 0x080000;
+ if( v & 0x10 ) color ^= 0x000800;
+ if( v & 0x20 ) color ^= 0x000008;
+ if( v & 0x40 ) color ^= 0x202020;
+ if( v & 0x80 ) color ^= 0x101010;
+ return color;
+}
+
int is_plugin, is_selected;
// edge cannot be optimized
int hard_left, hard_right;
-
+// title bar color
+ int color;
// Transition if one is present at the beginning of this edit
// This stores the length of the transition
Transition *transition;
float zoom_units) { return 0; }
virtual int64_t get_source_end(int64_t default_);
void get_title(char *title);
+// edit title bar color
+ int get_title_color();
+// default edit title bar color
+ int get_hash_color();
int dump(FILE *fp=stdout);
virtual int dump_derived() { return 0; }
#include "mwindowgui.h"
#include "plugindialog.h"
#include "resizetrackthread.h"
+#include "theme.h"
#include "track.h"
#include "tracks.h"
#include "trackcanvas.h"
add_item(new EditPopupPaste(mwindow, this));
add_item(new EditPopupOverwrite(mwindow, this));
add_item(new EditPopupFindAsset(mwindow, this));
- add_item(new EditPopupTitle(mwindow, this));
add_item(new EditPopupShow(mwindow, this));
+ add_item(new EditPopupUserTitle(mwindow, this));
+ add_item(new EditPopupTitleColor(mwindow, this));
}
int EditPopup::activate_menu(Track *track, Edit *edit,
}
-EditPopupTitle::EditPopupTitle(MWindow *mwindow, EditPopup *popup)
+EditPopupUserTitle::EditPopupUserTitle(MWindow *mwindow, EditPopup *popup)
: BC_MenuItem(_("User title..."))
{
this->mwindow = mwindow;
this->popup = popup;
- dialog_thread = new EditTitleDialogThread(this);
+ dialog_thread = new EditUserTitleDialogThread(this);
}
-EditPopupTitle::~EditPopupTitle()
+EditPopupUserTitle::~EditPopupUserTitle()
{
delete dialog_thread;
}
-int EditPopupTitle::handle_event()
+int EditPopupUserTitle::handle_event()
{
if( popup->edit ) {
dialog_thread->close_window();
return 1;
}
-void EditTitleDialogThread::start(int wx, int wy)
+void EditUserTitleDialogThread::start(int wx, int wy)
{
this->wx = wx; this->wy = wy;
BC_DialogThread::start();
}
-EditTitleDialogThread::EditTitleDialogThread(EditPopupTitle *edit_title)
+EditUserTitleDialogThread::EditUserTitleDialogThread(EditPopupUserTitle *edit_title)
{
this->edit_title = edit_title;
window = 0;
}
-EditTitleDialogThread::~EditTitleDialogThread()
+EditUserTitleDialogThread::~EditUserTitleDialogThread()
{
close_window();
}
-BC_Window* EditTitleDialogThread::new_gui()
+BC_Window* EditUserTitleDialogThread::new_gui()
{
MWindow *mwindow = edit_title->mwindow;
EditPopup *popup = edit_title->popup;
- window = new EditPopupTitleWindow(mwindow, popup, wx, wy);
+ window = new EditPopupUserTitleWindow(mwindow, popup, wx, wy);
window->create_objects();
return window;
}
-void EditTitleDialogThread::handle_close_event(int result)
+void EditUserTitleDialogThread::handle_close_event(int result)
{
window = 0;
}
-void EditTitleDialogThread::handle_done_event(int result)
+void EditUserTitleDialogThread::handle_done_event(int result)
{
if( result ) return;
MWindow *mwindow = edit_title->mwindow;
EditPopup *popup = edit_title->popup;
strcpy(popup->edit->user_title, window->title_text->get_text());
- mwindow->gui->lock_window("EditTitleDialogThread::handle_done_event");
+ mwindow->gui->lock_window("EditUserTitleDialogThread::handle_done_event");
mwindow->gui->draw_canvas(1, 0);
mwindow->gui->flash_canvas(1);
mwindow->gui->unlock_window();
}
-EditPopupTitleWindow::EditPopupTitleWindow(MWindow *mwindow,
+EditPopupUserTitleWindow::EditPopupUserTitleWindow(MWindow *mwindow,
EditPopup *popup, int wx, int wy)
: BC_Window(_(PROGRAM_NAME ": Set edit title"), wx, wy,
300, 130, 300, 130, 0, 0, 1)
strcpy(new_text, !popup->edit ? "" : popup->edit->user_title);
}
-EditPopupTitleWindow::~EditPopupTitleWindow()
+EditPopupUserTitleWindow::~EditPopupUserTitleWindow()
{
}
-void EditPopupTitleWindow::create_objects()
+void EditPopupUserTitleWindow::create_objects()
{
- lock_window("EditPopupTitleWindow::create_objects");
- int x = 10, y = 10;
- add_subwindow(new BC_Title(x, y, _("User title:")));
- title_text = new EditPopupTitleText(this, mwindow, x+15, y+20, new_text);
+ lock_window("EditPopupUserTitleWindow::create_objects");
+ int x = 10, y = 10, x1;
+ BC_Title *title = new BC_Title(x1=x, y, _("User title:"));
+ add_subwindow(title); x1 += title->get_w() + 10;
+ title_text = new EditPopupUserTitleText(this, mwindow, x1, y, new_text);
add_subwindow(title_text);
+
add_tool(new BC_OKButton(this));
add_tool(new BC_CancelButton(this));
}
-EditPopupTitleText::EditPopupTitleText(EditPopupTitleWindow *window,
+EditPopupUserTitleText::EditPopupUserTitleText(EditPopupUserTitleWindow *window,
MWindow *mwindow, int x, int y, const char *text)
- : BC_TextBox(x, y, 250, 1, text)
+ : BC_TextBox(x, y, window->get_w()-x-15, 1, text)
{
this->window = window;
this->mwindow = mwindow;
}
-EditPopupTitleText::~EditPopupTitleText()
+EditPopupUserTitleText::~EditPopupUserTitleText()
{
}
-int EditPopupTitleText::handle_event()
+int EditPopupUserTitleText::handle_event()
{
if( get_keypress() == RETURN )
window->set_done(0);
}
+EditPopupTitleColor::EditPopupTitleColor(MWindow *mwindow, EditPopup *popup)
+ : BC_MenuItem(_("Bar Color..."))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+ color_picker = 0;
+}
+EditPopupTitleColor::~EditPopupTitleColor()
+{
+ delete color_picker;
+}
+
+int EditPopupTitleColor::handle_event()
+{
+ if( popup->edit ) {
+ int color = popup->mwindow->get_title_color(popup->edit);
+ if( color < 0 ) color = popup->mwindow->theme->get_color_title_bg();
+ delete color_picker;
+ color_picker = new EditTitleColorPicker(popup);
+ color_picker->start_window(color, -1, 1);
+ }
+ return 1;
+}
+
+EditTitleColorDefault::EditTitleColorDefault(
+ EditTitleColorPicker *color_picker, int x, int y)
+ : BC_GenericButton(x, y, _("default"))
+{
+ this->color_picker = color_picker;
+}
+
+int EditTitleColorDefault::handle_event()
+{
+ int color = color_picker->popup->mwindow->theme->get_color_title_bg();
+ color_picker->update_gui(color, -1);
+ return 1;
+}
+
+EditTitleColorPicker::EditTitleColorPicker(EditPopup *popup)
+ : ColorPicker(0, _("Bar Color"))
+{
+ this->popup = popup;
+ color = -1;
+}
+EditTitleColorPicker::~EditTitleColorPicker()
+{
+}
+void EditTitleColorPicker::create_objects(ColorWindow *gui)
+{
+ int y = gui->get_h() - BC_CancelButton::calculate_h() - 50;
+ int x = gui->get_w() - BC_GenericButton::calculate_w(gui, _("default")) - 15;
+ gui->add_subwindow(new EditTitleColorDefault(this, x, y));
+}
+
+int EditTitleColorPicker::handle_new_color(int color, int alpha)
+{
+ this->color = color;
+ return 1;
+}
+
+void EditTitleColorPicker::handle_done_event(int result)
+{
+ if( !result ) {
+ EDL *edl = popup->mwindow->edl;
+ int count = 0;
+ for( Track *track=edl->tracks->first; track; track=track->next ) {
+ if( !track->record ) continue;
+ for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+ if( !edit->is_selected ) continue;
+ edit->color = color;
+ ++count;
+ }
+ }
+ if( count )
+ edl->tracks->clear_selected_edits();
+ else
+ popup->edit->color = color;
+ }
+ MWindowGUI *mwindow_gui = popup->mwindow->gui;
+ mwindow_gui->lock_window("GWindowColorUpdate::run");
+ mwindow_gui->draw_trackmovement();
+ mwindow_gui->unlock_window();
+}
+
+
EditPopupShow::EditPopupShow(MWindow *mwindow, EditPopup *popup)
: BC_MenuItem(_("Show edit"))
{
#include "guicast.h"
#include "edit.inc"
+#include "colorpicker.h"
#include "editpopup.inc"
#include "mwindow.inc"
#include "mwindowgui.inc"
EditPopup *popup;
};
-class EditPopupTitle : public BC_MenuItem
+class EditPopupUserTitle : public BC_MenuItem
{
public:
- EditPopupTitle(MWindow *mwindow, EditPopup *popup);
- ~EditPopupTitle();
+ EditPopupUserTitle(MWindow *mwindow, EditPopup *popup);
+ ~EditPopupUserTitle();
int handle_event();
MWindow *mwindow;
EditPopup *popup;
- EditTitleDialogThread *dialog_thread;
+ EditUserTitleDialogThread *dialog_thread;
};
-class EditTitleDialogThread : public BC_DialogThread
+class EditPopupUserTitleText : public BC_TextBox
{
public:
- EditTitleDialogThread(EditPopupTitle *edit_title);
- ~EditTitleDialogThread();
- BC_Window* new_gui();
- void start(int wx, int wy);
+ EditPopupUserTitleText(EditPopupUserTitleWindow *window,
+ MWindow *mwindow, int x, int y, const char *text);
+ ~EditPopupUserTitleText();
+ int handle_event();
+
+ MWindow *mwindow;
+ EditPopupUserTitleWindow *window;
+};
+
+class EditPopupUserTitleWindow : public BC_Window
+{
+public:
+ EditPopupUserTitleWindow(MWindow *mwindow, EditPopup *popup, int wx, int wy);
+ ~EditPopupUserTitleWindow();
+
+ void create_objects();
+ void handle_close_event(int result);
+
+ EditPopupUserTitleText *title_text;
+ MWindow *mwindow;
+ EditPopup *popup;
+ char new_text[BCTEXTLEN];
+};
+
+class EditUserTitleDialogThread : public BC_DialogThread
+{
+public:
+ EditUserTitleDialogThread(EditPopupUserTitle *edit_title);
+ ~EditUserTitleDialogThread();
+
void handle_close_event(int result);
void handle_done_event(int result);
+ BC_Window* new_gui();
+ void start(int wx, int wy);
int wx, wy;
- EditPopupTitle *edit_title;
- EditPopupTitleWindow *window;
+ EditPopupUserTitle *edit_title;
+ EditPopupUserTitleWindow *window;
};
-class EditPopupTitleText : public BC_TextBox
+
+class EditPopupTitleColor : public BC_MenuItem
{
public:
- EditPopupTitleText(EditPopupTitleWindow *window,
- MWindow *mwindow, int x, int y, const char *text);
- ~EditPopupTitleText();
+ EditPopupTitleColor(MWindow *mwindow, EditPopup *popup);
+ ~EditPopupTitleColor();
+
int handle_event();
MWindow *mwindow;
- EditPopupTitleWindow *window;
+ EditPopup *popup;
+ EditTitleColorPicker *color_picker;
};
-class EditPopupTitleWindow : public BC_Window
+class EditTitleColorDefault : public BC_GenericButton
{
public:
- EditPopupTitleWindow(MWindow *mwindow, EditPopup *popup, int wx, int wy);
- ~EditPopupTitleWindow();
+ EditTitleColorDefault(EditTitleColorPicker *color_picker, int x, int y);
+ int handle_event();
- void create_objects();
- void handle_close_event(int result);
+ EditTitleColorPicker *color_picker;
+};
+
+class EditTitleColorPicker : public ColorPicker
+{
+public:
+ EditTitleColorPicker(EditPopup *popup);
+ ~EditTitleColorPicker();
+ void create_objects(ColorWindow *gui);
+ int handle_new_color(int color, int alpha);
+ void handle_done_event(int result);
- EditPopupTitleText *title_text;
- MWindow *mwindow;
EditPopup *popup;
- char new_text[BCTEXTLEN];
+ int color;
};
class EditPopupPaste;
class EditPopupOverwrite;
class EditPopupFindAsset;
-class EditPopupTitle;
-class EditTitleDialogThread;
-class EditPopupTitleText;
-class EditPopupTitleWindow;
+class EditPopupUserTitle;
+class EditPopupUserTitleText;
+class EditPopupUserTitleWindow;
+class EditUserTitleDialogThread;
+class EditPopupTitleColor;
+class EditTitleColorPicker;
class EditPopupShow;
class EditShowDialogThread;
class EditPopupShowText;
w, h, w, h, 0, 0, 1)
{
this->mwindow = mwindow;
- color_thread = 0;
camera_xyz = 0;
projector_xyz = 0;
}
GWindowGUI::~GWindowGUI()
{
- delete color_thread;
-}
-
-void GWindowGUI::start_color_thread(GWindowColorButton *color_button)
-{
- unlock_window();
- delete color_thread;
- color_thread = new GWindowColorThread(this, color_button);
- int color = auto_colors[color_button->auto_toggle->info->ref];
- color_thread->start(color);
- lock_window("GWindowGUI::start_color_thread");
}
const char *GWindowGUI::non_auto_text[NON_AUTOMATION_TOTAL] =
*w += 20;
}
-GWindowColorButton::GWindowColorButton(GWindowToggle *auto_toggle, int x, int y, int w)
- : BC_Button(x, y, w, vframes)
+GWindowColorButton::GWindowColorButton(GWindowToggle *auto_toggle,
+ int x, int y, int w, int color)
+ : ColorCircleButton(auto_toggle->caption, x, y, w, w, color, -1, 1)
{
this->auto_toggle = auto_toggle;
- this->color = 0;
- for( int i=0; i<3; ++i ) {
- vframes[i] = new VFrame(w, w, BC_RGBA8888);
- vframes[i]->clear_frame();
- }
+ this->color = color;
}
GWindowColorButton::~GWindowColorButton()
{
- for( int i=0; i<3; ++i )
- delete vframes[i];
}
-void GWindowColorButton::set_color(int color)
+int GWindowColorButton::handle_new_color(int color, int alpha)
{
this->color = color;
- int r = (color>>16) & 0xff;
- int g = (color>>8) & 0xff;
- int b = (color>>0) & 0xff;
- for( int i=0; i<3; ++i ) {
- VFrame *vframe = vframes[i];
- int ww = vframe->get_w(), hh = vframe->get_h();
- int cx = (ww+1)/2, cy = hh/2;
- double cc = (cx*cx + cy*cy) / 4.;
- uint8_t *bp = vframe->get_data(), *dp = bp;
- uint8_t *ep = dp + vframe->get_data_size();
- int rr = r, gg = g, bb = b;
- int bpl = vframe->get_bytes_per_line();
- switch( i ) {
- case BUTTON_UP:
- break;
- case BUTTON_UPHI:
- if( (rr+=48) > 0xff ) rr = 0xff;
- if( (gg+=48) > 0xff ) gg = 0xff;
- if( (bb+=48) > 0xff ) bb = 0xff;
- break;
- case BUTTON_DOWNHI:
- if( (rr-=48) < 0x00 ) rr = 0x00;
- if( (gg-=48) < 0x00 ) gg = 0x00;
- if( (bb-=48) < 0x00 ) bb = 0x00;
- break;
- }
- while( dp < ep ) {
- int yy = (dp-bp) / bpl, xx = ((dp-bp) % bpl) >> 2;
- int dy = cy - yy, dx = cx - xx;
- double s = dx*dx + dy*dy - cc;
- double ss = s < 0 ? 1 : s >= cc ? 0 : 1 - s/cc;
- int aa = ss * 0xff;
- *dp++ = rr; *dp++ = gg; *dp++ = bb; *dp++ = aa;
- }
- }
- set_images(vframes);
-}
-
-void GWindowColorButton::update_gui(int color)
-{
- set_color(color);
- draw_face();
-}
-
-GWindowColorThread::GWindowColorThread(GWindowGUI *gui, GWindowColorButton *color_button)
- : ColorPicker(0, color_button->auto_toggle->caption)
-{
- this->gui = gui;
- this->color_button = color_button;
- this->color = 0;
- color_update = new GWindowColorUpdate(this);
-}
-
-GWindowColorThread::~GWindowColorThread()
-{
- delete color_update;
-}
-
-void GWindowColorThread::start(int color)
-{
- start_window(color, 0, 1);
- color_update->start();
+ color_thread->update_lock->unlock();
+ return 1;
}
-void GWindowColorThread::handle_done_event(int result)
+void GWindowColorButton::handle_done_event(int result)
{
- color_update->stop();
- int ref = color_button->auto_toggle->info->ref;
+ ColorCircleButton::handle_done_event(result);
+ int ref = auto_toggle->info->ref;
+ GWindowGUI *gui = auto_toggle->gui;
gui->lock_window("GWindowColorThread::handle_done_event");
if( !result ) {
GWindowGUI::auto_colors[ref] = color;
- color_button->auto_toggle->update_gui(color);
+ auto_toggle->update_gui(color);
gui->save_defaults();
}
else {
color = GWindowGUI::auto_colors[ref];
- color_button->update_gui(color);
+ update_gui(color);
}
gui->unlock_window();
MWindowGUI *mwindow_gui = gui->mwindow->gui;
mwindow_gui->unlock_window();
}
-int GWindowColorThread::handle_new_color(int color, int alpha)
-{
- this->color = color;
- color_update->update_lock->unlock();
- return 1;
-}
-
-void GWindowColorThread::update_gui()
-{
- gui->lock_window("GWindowColorThread::update_gui");
- color_button->update_gui(color);
- gui->unlock_window();
-}
-
-GWindowColorUpdate::GWindowColorUpdate(GWindowColorThread *color_thread)
- : Thread(1, 0, 0)
-{
- this->color_thread = color_thread;
- this->update_lock = new Condition(0,"GWindowColorUpdate::update_lock");
- done = 1;
-}
-
-GWindowColorUpdate::~GWindowColorUpdate()
-{
- stop();
- delete update_lock;
-}
-
-void GWindowColorUpdate::start()
-{
- if( done ) {
- done = 0;
- Thread::start();
- }
-}
-
-void GWindowColorUpdate::stop()
-{
- if( !done ) {
- done = 1;
- update_lock->unlock();
- join();
- }
-}
-
-void GWindowColorUpdate::run()
-{
- while( !done ) {
- update_lock->lock("GWindowColorUpdate::run");
- if( done ) break;
- color_thread->update_gui();
- }
-}
-
-
-int GWindowColorButton::handle_event()
-{
- GWindowGUI *gui = auto_toggle->gui;
- gui->start_color_thread(this);
- return 1;
-}
void GWindowGUI::create_objects()
{
if( !vframe ) {
int wh = toggle->get_h() - 4;
GWindowColorButton *color_button =
- new GWindowColorButton(toggle, get_w()-wh-10, y+2, wh);
+ new GWindowColorButton(toggle, get_w()-wh-10, y+2, wh, color);
add_tool(color_button);
- color_button->set_color(color);
- color_button->draw_face();
+ color_button->create_objects();
}
else
draw_vframe(vframe, get_w()-vframe->get_w()-10, y);
int GWindowGUI::close_event()
{
- delete color_thread; color_thread = 0;
hide_window();
mwindow->session->show_gwindow = 0;
unlock_window();
int translation_event();
int close_event();
int keypress_event();
- void start_color_thread(GWindowColorButton *color_button);
void update_toggles(int use_lock);
void toggle_camera_xyz();
void toggle_projector_xyz();
MWindow *mwindow;
GWindowToggle *toggles[NONAUTOTOGGLES_COUNT + AUTOMATION_TOTAL];
- GWindowColorThread *color_thread;
GWindowToggle *camera_xyz, *projector_xyz;
};
GWindowColorButton *color_button;
};
-class GWindowColorButton : public BC_Button
+class GWindowColorButton : public ColorCircleButton
{
public:
- GWindowColorButton(GWindowToggle *auto_toggle, int x, int y, int w);
+ GWindowColorButton(GWindowToggle *auto_toggle,
+ int x, int y, int w, int color);
~GWindowColorButton();
-
- void set_color(int color);
- void update_gui(int color);
- int handle_event();
-
- int color;
- VFrame *vframes[3];
- GWindowToggle *auto_toggle;
-};
-
-class GWindowColorThread : public ColorPicker
-{
-public:
- GWindowColorThread(GWindowGUI *gui, GWindowColorButton *color_button);
- ~GWindowColorThread();
- void start(int color);
int handle_new_color(int color, int alpha);
- void update_gui();
void handle_done_event(int result);
- GWindowGUI *gui;
- int color;
- GWindowColorButton *color_button;
- GWindowColorUpdate *color_update;
-};
-
-class GWindowColorUpdate : public Thread
-{
-public:
- GWindowColorUpdate(GWindowColorThread *color_thread);
- ~GWindowColorUpdate();
-
- void start();
- void stop();
- void run();
-
- int done;
- Condition *update_lock;
- GWindowColorThread *color_thread;
+ GWindowToggle *auto_toggle;
};
#endif
keyframe_gui_lock->unlock();
}
+int MWindow::get_title_color(Edit *edit)
+{
+ int color = edit->color;
+ if( color < 0 && preferences->autocolor_assets )
+ color = edit->get_hash_color();
+ return color;
+}
+
void MWindow::update_keyframe_guis()
{
// Send new configuration to keyframe GUI's
void hide_keyframe_guis();
void hide_keyframe_gui(Plugin *plugin);
void update_keyframe_guis();
-
+ int get_title_color(Edit *edit);
// ============================= editing commands ========================
result = 1;
break;
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- case KEY_F11:
- case KEY_F12:
+ case KEY_F1 ... KEY_F12:
resend_event(mwindow->cwindow->gui);
return 1;
}
highlight_inverse = 0xffffff;
yuv_color_space = BC_COLORS_BT601;
yuv_color_range = BC_COLORS_JPEG;
+ autocolor_assets = 0;
// Default brender asset
brender_asset = new Asset;
highlight_inverse = that->highlight_inverse;
yuv_color_space = that->yuv_color_space;
yuv_color_range = that->yuv_color_range;
+ autocolor_assets = that->autocolor_assets;
renderfarm_nodes.remove_all_objects();
renderfarm_ports.remove_all();
renderfarm_enabled.remove_all();
highlight_inverse = defaults->get("HIGHLIGHT_INVERSE", highlight_inverse);
yuv_color_space = defaults->get("YUV_COLOR_SPACE", yuv_color_space);
yuv_color_range = defaults->get("YUV_COLOR_RANGE", yuv_color_range);
+ autocolor_assets = defaults->get("AUTOCOLOR_ASSETS", autocolor_assets);
use_brender = defaults->get("USE_BRENDER", use_brender);
brender_fragment = defaults->get("BRENDER_FRAGMENT", brender_fragment);
cache_size = defaults->get("CACHE_SIZE", cache_size);
defaults->update("HIGHLIGHT_INVERSE", highlight_inverse);
defaults->update("YUV_COLOR_SPACE", yuv_color_space);
defaults->update("YUV_COLOR_RANGE", yuv_color_range);
+ defaults->update("AUTOCOLOR_ASSETS", autocolor_assets);
brender_asset->save_defaults(defaults, "BRENDER_", 1, 1, 1, 0, 0);
defaults->update("USE_BRENDER", use_brender);
defaults->update("BRENDER_FRAGMENT", brender_fragment);
// yuv color space/range
int yuv_color_space;
int yuv_color_range;
-
+// autocolor asset edit title
+ int autocolor_assets;
// Default positions for channels
int channel_positions[MAXCHANNELS][MAXCHANNELS];
(*this_aconfig != *aconfig) || (*this_vconfig != *vconfig) ||
!preferences->brender_asset->equivalent(*mwindow->preferences->brender_asset, 0, 1, edl);
+ if( preferences->autocolor_assets != mwindow->preferences->autocolor_assets )
+ redraw_indexes = 1;
+
if( preferences->yuv_color_space != mwindow->preferences->yuv_color_space ||
preferences->yuv_color_range != mwindow->preferences->yuv_color_range ) {
YUV::yuv.yuv_set_colors(
//printf("PreferencesThread::apply_settings 10\n");
}
- if(redraw_times || redraw_overlays)
+ if(redraw_indexes)
{
mwindow->gui->lock_window("PreferencesThread::apply_settings 4");
+ mwindow->gui->draw_trackmovement();
+ mwindow->gui->unlock_window();
+ }
+
+ if(redraw_times || redraw_overlays || redraw_indexes)
+ {
+ mwindow->gui->lock_window("PreferencesThread::apply_settings 5");
mwindow->gui->flush();
mwindow->gui->unlock_window();
}
#include "localsession.h"
#include "mwindow.h"
#include "mwindowgui.h"
+#include "preferences.h"
#include "renderengine.h"
#include "resourcethread.h"
#include "resourcepixmap.h"
SET_TRACE
}
+
+VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color, int bg_color)
+{
+ if( color < 0 || color == bg_color ) return title_bg;
+ int colormodel = title_bg->get_color_model();
+ int bpp = BC_CModels::calculate_pixelsize(colormodel);
+ int tw = title_bg->get_w(), th = title_bg->get_h();
+ VFrame *title_bar = new VFrame(tw, th, colormodel);
+ uint8_t br = (bg_color>>16), cr = (color>>16);
+ uint8_t bg = (bg_color>>8), cg = (color>>8);
+ uint8_t bb = (bg_color>>0), cb = (color>>0);
+ int dr = cr-br, dg = cg-bg, db = cb-bb;
+ uint8_t **bar_rows = title_bar->get_rows();
+ uint8_t **rows = title_bg->get_rows();
+ for( int y=0; y<th; ++y ) {
+ uint8_t *bp = rows[y], *cp = bar_rows[y];
+ for( int x=0; x<tw; ++x ) {
+ *cp++ = *bp++ + dr;
+ *cp++ = *bp++ + dg;
+ *cp++ = *bp++ + db;
+ if( bpp > 3 ) *cp++ = *bp++;
+ }
+ }
+ return title_bar;
+}
+
void ResourcePixmap::draw_title(TrackCanvas *canvas,
Edit *edit, int64_t edit_x, int64_t edit_w,
int64_t pixmap_x, int64_t pixmap_w)
if( x < 0 ) { w -= -x; x = 0; }
if( w > pixmap_w ) w -= w - pixmap_w;
- canvas->draw_3segmenth(x, 0, w, total_x, total_w,
- mwindow->theme->get_image("title_bg_data"), this);
+ VFrame *title_bg = mwindow->theme->get_image("title_bg_data");
+ VFrame *title_bar = title_bg;
+ int color = mwindow->get_title_color(edit), bg_color = -1;
+ if( color >= 0 ) {
+ bg_color = mwindow->theme->get_color_title_bg();
+ if( bg_color == color ) color = -1;
+ }
+ if( color >= 0 && color != bg_color )
+ title_bar = change_title_color(title_bg, color, bg_color);
+ canvas->draw_3segmenth(x, 0, w, total_x, total_w, title_bar, this);
+ if( title_bar != title_bg ) delete title_bar;
// if( total_x > -BC_INFINITY ) {
char title[BCTEXTLEN];
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
void ResourcePixmap::draw_audio_source(TrackCanvas *canvas, Edit *edit, int x, int w)
{
w++;
// Called by ResourceThread to update pixmap
void draw_wave(TrackCanvas *canvas,
int x, double high, double low);
+ VFrame *change_title_color(VFrame *title_bg,
+ int color, int bg_color);
void draw_title(TrackCanvas *canvas,
Edit *edit, int64_t edit_x, int64_t edit_w,
int64_t pixmap_x, int64_t pixmap_w);
}
-
-
-
+int Theme::get_color_title_bg()
+{
+ VFrame *title_bg = get_image("title_bg_data");
+ int tw = title_bg->get_w(), th = title_bg->get_h();
+ int colormodel = title_bg->get_color_model();
+ int bpp = BC_CModels::calculate_pixelsize(colormodel);
+ uint8_t **rows = title_bg->get_rows();
+ int cx = tw / 2, cy = th / 2;
+ uint8_t *bp = rows[cy] + cx * bpp;
+ int br = bp[0], bg = bp[1], bb = bp[2];
+ int color = (br<<16) | (bg<<8) | (bb<<0);
+ return color;
+}
virtual void draw_setformat_bg(SetFormatWindow *window);
virtual void build_menus();
+ virtual int get_color_title_bg();
// unsigned char* get_image(char *title);
void flush_images();
<td align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4><br></font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><b><font face="Liberation Serif" size=4> Drag/Drop</font></b></td>
+ <td align="left"><font face="Liberation Serif" size=4>Clear Select</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-Shift-A</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delselect all selected edits</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><b><font face="Liberation Serif" size=4> Edits </font></b></td>
+ <td align="left"><font face="Liberation Serif" size=4>Copy</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-c</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Copy selected edits into copy buffer</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Cut</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-x</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delete selected edits/put in buffer/collapse</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Mute </font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-m</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delete selected edits/put in buffer/insert space</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Copy Pack</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-Shift-C</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Copy selected edits and pack together</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Cut Pack</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-z</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delete selected edits/put in buffer/collapse</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Mute Pack</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-Shift-M</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delete selected edits/put in buffer/insert space</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Paste</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-v</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Paste (splice) buffer at insertion point or reticle</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Overwrite</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl-b</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Paste (overwrite) buffer at insertion pt/reticle</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Ctrl and Drag</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Move a single edit elsewhere</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ </tr>
<tr>
<td height="26" align="left"><b><font face="Liberation Serif" size=4> FFMpeg probes early</font></b></td>
<td align="left"><font face="Liberation Serif" size=4>- FFMPEG early</font></td>
Name=cin
Comment=MultiMedia Editor
Comment[fr]=Éditeur multimédia
-Categories=AudioVideo;AudioVideoEditing;X-Multimedia;
+Categories=AudioVideo;AudioVideoEditing;
+Encoding=UTF-8
Exec=cin
Icon=cin
Terminal=false
F_entropy: Measure video frames entropy.
F_erosion: Applies erosion effect.
F_fade: Fade in/out input video.
-F_fftdnoiz: Denoise rames using 3D FFT.
+F_fftdnoiz: Denoise frames using 3D FFT.
F_fftfilt: Apply arbitrary expressions to pixels in frequency domain.
F_field: Extract a field from the input video.
F_fieldorder: Set the field order.
F_flanger: Applies a flanging effect to the audio.
F_haas: Apply Haas Stereo Enhancer for a more natural sounding pan effect
or more clarity in the center of the mix. With this filter
- applied to mono signals it give some directionality and stretches
- its stereo image
+ applied to mono signals it gives some directionality and stretches
+ its stereo image.
F_highpass: Applies a high-pass filter with 3dB point frequency.
F_hilbert: Generate a Hilbert transform FIR coefficients.
F_loudnorm: EBU R128 loudness normalization.
}
-SketcherCurveColor::SketcherCurveColor(SketcherWindow *gui, int x, int y, int w, int h)
- : BC_Button(x, y, w, vframes)
+SketcherCurveColor::SketcherCurveColor(SketcherWindow *gui,
+ int x, int y, int w, int h, int color, int alpha)
+ : ColorBoxButton(_("Curve Color"), x, y, w, h, color, alpha, 1)
{
this->gui = gui;
this->color = CV_COLOR;
delete vframes[i];
}
-void SketcherCurveColor::set_color(int color)
+void SketcherCurveColor::handle_done_event(int result)
{
- this->color = color;
- int r = (color>>16) & 0xff;
- int g = (color>>8) & 0xff;
- int b = (color>>0) & 0xff;
- for( int i=0; i<3; ++i ) {
- VFrame *vframe = vframes[i];
- int ww = vframe->get_w(), hh = vframe->get_h();
- uint8_t **rows = vframe->get_rows();
- int rr = r, gg = g, bb = b;
- switch( i ) {
- case BUTTON_UP:
- break;
- case BUTTON_UPHI:
- if( (rr+=48) > 0xff ) rr = 0xff;
- if( (gg+=48) > 0xff ) gg = 0xff;
- if( (bb+=48) > 0xff ) bb = 0xff;
- break;
- case BUTTON_DOWNHI:
- if( (rr-=48) < 0x00 ) rr = 0x00;
- if( (gg-=48) < 0x00 ) gg = 0x00;
- if( (bb-=48) < 0x00 ) bb = 0x00;
- break;
- }
- for( int y=0; y<hh; ++y ) {
- uint8_t *rp = rows[y];
- for( int x=0; x<ww; ++x ) {
- *rp++ = rr; *rp++ = gg; *rp++ = bb;
- }
- }
- }
- set_images(vframes);
-}
-
-void SketcherCurveColor::update_gui(int color)
-{
- set_color(color);
- draw_face();
-}
-
-int SketcherCurveColor::handle_event()
-{
- gui->start_color_thread(this);
- return 1;
-}
-
-SketcherCurveColorPicker::SketcherCurveColorPicker(SketcherWindow *gui, SketcherCurveColor *color_button)
- : ColorPicker(1, _("Color"))
-{
- this->gui = gui;
- this->color_button = color_button;
- this->color = CV_COLOR;
- color_update = new SketcherCurveColorThread(this);
-}
-
-SketcherCurveColorPicker::~SketcherCurveColorPicker()
-{
- delete color_update;
-}
-
-void SketcherCurveColorPicker::start(int color)
-{
- this->color = color;
- int alpha = (~color>>24) & 0xff;
- start_window(color & 0xffffff, alpha, 1);
- color_update->start();
-}
-
-void SketcherCurveColorPicker::handle_done_event(int result)
-{
- color_update->stop();
- gui->lock_window("SketcherCurveColorPicker::handle_done_event");
- if( result ) { color = orig_color | (~orig_alpha<<24); }
- color_button->update_gui(color);
- gui->unlock_window();
+ if( result ) color = orig_color | (~orig_alpha<<24);
SketcherConfig &config = gui->plugin->config;
int ci = config.cv_selected;
if( ci >= 0 && ci < config.curves.size() ) {
}
}
-int SketcherCurveColorPicker::handle_new_color(int color, int alpha)
+int SketcherCurveColor::handle_new_color(int color, int alpha)
{
- this->color = color | (~alpha<<24);
- color_update->update_lock->unlock();
- return 1;
-}
-
-void SketcherCurveColorPicker::update_gui()
-{
- gui->lock_window("SketcherCurveColorPicker::update_gui");
- color_button->update_gui(color);
+ color |= ~alpha<<24; this->color = color;
+ gui->lock_window("SketcherCurveColor::update_gui");
+ update_gui(color);
SketcherConfig &config = gui->plugin->config;
int ci = config.cv_selected;
if( ci >= 0 ) {
gui->send_configure_change();
}
gui->unlock_window();
-}
-
-SketcherCurveColorThread::SketcherCurveColorThread(SketcherCurveColorPicker *color_picker)
- : Thread(1, 0, 0)
-{
- this->color_picker = color_picker;
- this->update_lock = new Condition(0,"SketcherCurveColorThread::update_lock");
- done = 1;
-}
-
-SketcherCurveColorThread::~SketcherCurveColorThread()
-{
- stop();
- delete update_lock;
-}
-
-void SketcherCurveColorThread::start()
-{
- if( done ) {
- done = 0;
- Thread::start();
- }
-}
-
-void SketcherCurveColorThread::stop()
-{
- if( !done ) {
- done = 1;
- update_lock->unlock();
- join();
- }
-}
-
-void SketcherCurveColorThread::run()
-{
- while( !done ) {
- update_lock->lock("SketcherCurveColorThread::run");
- if( done ) break;
- color_picker->update_gui();
- }
+ return 1;
}
this->plugin = plugin;
this->title_pen = 0; this->curve_pen = 0;
this->title_color = 0; this->curve_color = 0;
- this->color_picker = 0; this->drag = 0;
+ this->drag = 0;
this->new_curve = 0; this->del_curve = 0;
this->curve_up = 0; this->curve_dn = 0;
this->title_x = 0; this->point_x = 0;
delete curve_width;
delete point_x;
delete point_y;
- delete color_picker;
}
void SketcherWindow::create_objects()
curve_pen = new SketcherCurvePen(this, x1, y, cv->pen);
add_subwindow(curve_pen); dy = bmax(dy,curve_pen->get_h());
curve_pen->create_objects();
- curve_color = new SketcherCurveColor(this, x2, y, COLOR_W, COLOR_H);
+ curve_color = new SketcherCurveColor(this, x2, y, COLOR_W, COLOR_H,
+ cv->color&0xffffff, (~cv->color>>24)&0xff);
add_subwindow(curve_color); dy = bmax(dy,curve_color->get_h());
- curve_color->set_color(cv->color);
- curve_color->draw_face();
y += dy + margin; dy = 0;
curve_list->update(ci);
void SketcherWindow::done_event(int result)
{
- delete color_picker; color_picker = 0;
}
void SketcherWindow::send_configure_change()
return 0;
}
-void SketcherWindow::start_color_thread(SketcherCurveColor *color_button)
-{
- unlock_window();
- delete color_picker;
- color_picker = new SketcherCurveColorPicker(this, color_button);
- int color = CV_COLOR, ci = plugin->config.cv_selected;
- if( ci >= 0 && ci < plugin->config.curves.size() ) {
- SketcherCurve *cv = plugin->config.curves[ci];
- color = cv->color;
- }
- color_picker->start(color);
- lock_window("SketcherWindow::start_color_thread");
-}
-
SketcherCurveList::SketcherCurveList(SketcherWindow *gui, Sketcher *plugin, int x, int y)
: BC_ListBox(x, y, 360, 130, LISTBOX_TEXT)
class SketcherCurvePenItem;
class SketcherCurvePen;
class SketcherCurveColor;
-class SketcherCurveColorPicker;
-class SketcherCurveColorThread;
class SketcherNewCurve;
class SketcherDelCurve;
class SketcherCurveUp;
int pen;
};
-class SketcherCurveColor : public BC_Button
+class SketcherCurveColor : public ColorBoxButton
{
public:
- SketcherCurveColor(SketcherWindow *gui, int x, int y, int w, int h);
+ SketcherCurveColor(SketcherWindow *gui,
+ int x, int y, int w, int h, int color, int alpha);
~SketcherCurveColor();
- void set_color(int color);
- void update_gui(int color);
- int handle_event();
-
- int color;
- VFrame *vframes[3];
- SketcherWindow *gui;
-};
-
-class SketcherCurveColorPicker : public ColorPicker
-{
-public:
- SketcherCurveColorPicker(SketcherWindow *gui, SketcherCurveColor *curve_color);
- ~SketcherCurveColorPicker();
- void start(int color);
int handle_new_color(int color, int alpha);
- void update_gui();
void handle_done_event(int result);
- SketcherWindow *gui;
int color;
- SketcherCurveColor *color_button;
- SketcherCurveColorThread *color_update;
-};
-
-class SketcherCurveColorThread : public Thread
-{
-public:
- SketcherCurveColorThread(SketcherCurveColorPicker *color_picker);
- ~SketcherCurveColorThread();
-
- void start();
- void stop();
- void run();
-
- SketcherCurveColorPicker *color_picker;
- int done;
- Condition *update_lock;
+ VFrame *vframes[3];
+ SketcherWindow *gui;
};
class SketcherNewCurve : public BC_GenericButton
void create_objects();
void done_event(int result);
void update_gui();
- void start_color_thread(SketcherCurveColor *curve_color);
int grab_event(XEvent *event);
int do_grab_event(XEvent *event);
int grab_button_press(XEvent *event);
SketcherCurveType *curve_type;
SketcherCurvePen *curve_pen;
SketcherCurveColor *curve_color;
- SketcherCurveColorPicker *color_picker;
SketcherNewCurve *new_curve;
SketcherDelCurve *del_curve;
SketcherCurveUp *curve_up;
window->lock_window("TitleMain::update_gui");
window->update();
window->unlock_window();
- window->color_thread->update_gui(config.color, 0);
}
}
}
fonts_popup = 0;
png_popup = 0;
- color_x = color_y = 0;
- outline_color_x = outline_color_y = 0;
drag_dx = drag_dy = dragging = 0;
cur_ibeam = -1;
encoding_title = 0;
encoding = 0;
color_button = 0;
- color_thread = 0;
+ outline_button = 0;
color_popup = 0;
- outline_color_button = 0;
- outline_color_thread = 0;
motion_title = 0;
motion = 0;
line_pitch = 0;
void TitleWindow::done_event(int result)
{
drag->drag_deactivate();
- delete color_thread; color_thread = 0;
- delete outline_color_thread; outline_color_thread = 0;
delete color_popup; color_popup = 0;
delete png_popup; png_popup = 0;
TitleWindow::~TitleWindow()
{
- delete color_thread;
- delete outline_color_thread;
delete color_popup;
delete png_popup;
for( int i=0; i<fonts.size(); ++i )
sizes.remove_all_objects();
delete timecode_format;
- delete color_thread;
delete title_x;
delete title_y;
}
x += w1 + margin;
y2 = y + speed->get_h() + 10;
- color_x = x3; color_y = y = y1;
- color_thread = new TitleColorThread(client, this, 0);
- x1 = color_x + COLOR_W + 2*margin;
- y1 = color_y + 5;
+ add_tool(color_button_title = new BC_Title(x3, y1+10, _("Color:")));
+ x1 = x3 + color_button_title->get_w() + 30;
add_tool(color_button = new TitleColorButton(client, this, x1, y1));
- y += COLOR_H + 5;
- outline_color_x = x3; outline_color_y = y;
- outline_color_thread = new TitleColorThread(client, this, 1);
- y1 = outline_color_y + 5;
- add_tool(outline_color_button = new TitleOutlineColorButton(client, this, x1, y1));
+ y1 += color_button->get_h() + 10;
+ add_tool(outline_button_title = new BC_Title(x3, y1+10, _("Outline:")));
+ add_tool(outline_button = new TitleOutlineColorButton(client, this, x1, y1));
x = 10; y = y2;
add_tool(outline_title = new BC_Title(x, y, _("Outline:")));
pitch_title->reposition_window(pitch_title->get_x(), pitch_title->get_y());
pitch->reposition_window(pitch->get_x(), pitch->get_y());
+ color_button_title->reposition_window(color_button_title->get_x(), color_button_title->get_y());
color_button->reposition_window(color_button->get_x(), color_button->get_y());
- outline_color_button->reposition_window(outline_color_button->get_x(), outline_color_button->get_y());
+ outline_button_title->reposition_window(outline_button_title->get_x(), outline_button_title->get_y());
+ outline_button->reposition_window(outline_button->get_x(), outline_button->get_y());
motion_title->reposition_window(motion_title->get_x(), motion_title->get_y());
motion->reposition_window(motion->get_x(), motion->get_y());
loop->reposition_window(loop->get_x(), loop->get_y());
void TitleWindow::update_color()
{
-//printf("TitleWindow::update_color %x\n", client->config.color);
- set_color(client->config.color);
- draw_box(color_x, color_y, COLOR_W, COLOR_H);
- flash(color_x, color_y, COLOR_W, COLOR_H);
- set_color(client->config.outline_color);
- draw_box(outline_color_x, outline_color_y, COLOR_W, COLOR_H);
- set_color(BLACK);
- draw_rectangle(color_x, color_y, COLOR_W, COLOR_H);
- draw_rectangle(outline_color_x, outline_color_y, COLOR_W, COLOR_H);
- flash(outline_color_x, outline_color_y, COLOR_W, COLOR_H);
+ color_button->update_gui(client->config.color);
+ outline_button->update_gui(client->config.outline_color);
}
void TitleWindow::update_justification()
}
TitleColorButton::TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_GenericButton(x, y, _("Text Color..."))
+ : ColorCircleButton(_("Text Color"), x, y, COLOR_W, COLOR_H,
+ client->config.color, client->config.alpha, 1)
{
this->client = client;
this->window = window;
}
-int TitleColorButton::handle_event()
+int TitleColorButton::handle_new_color(int output, int alpha)
{
- window->color_thread->start_window(client->config.color,
- client->config.alpha, 1);
+ client->config.color = output;
+ client->config.alpha = alpha;
+ window->send_configure_change();
return 1;
}
+void TitleColorButton::handle_done_event(int result)
+{
+ if( result ) {
+ handle_new_color(orig_color, orig_alpha);
+ update_gui(orig_color);
+ }
+}
+
TitleOutlineColorButton::TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_GenericButton(x, y, _("Outline color..."))
+ : ColorCircleButton(_("Outline Color"), x, y, COLOR_W, COLOR_H,
+ client->config.outline_color, client->config.outline_alpha, 1)
{
this->client = client;
this->window = window;
}
-int TitleOutlineColorButton::handle_event()
+int TitleOutlineColorButton::handle_new_color(int output, int alpha)
{
- window->outline_color_thread->start_window(client->config.outline_color,
- client->config.outline_alpha, 1);
+ client->config.outline_color = output;
+ client->config.outline_alpha = alpha;
+ window->send_configure_change();
return 1;
}
+void TitleOutlineColorButton::handle_done_event(int result)
+{
+ if( result ) {
+ handle_new_color(orig_color, orig_alpha);
+ update_gui(orig_color);
+ }
+}
TitleMotion::TitleMotion(TitleMain *client, TitleWindow *window, int x, int y)
return 1;
}
-
-
-TitleColorThread::TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline)
- : ColorPicker(1, is_outline? _("Outline Color") : _("Text Color"))
-{
- this->client = client;
- this->window = window;
- this->is_outline = is_outline;
-}
-
-int TitleColorThread::handle_new_color(int output, int alpha)
-{
- if( is_outline ) {
- client->config.outline_color = output;
- client->config.outline_alpha = alpha;
- }
- else {
- client->config.color = output;
- client->config.alpha = alpha;
- }
-
- window->lock_window("TitleColorThread::handle_new_color");
- window->update_color();
- window->flush();
- window->unlock_window();
-
- window->send_configure_change();
- return 1;
-}
-
-void TitleColorThread::handle_done_event(int result)
-{
- if( result ) {
- client->config.color = orig_color;
- client->config.alpha = orig_alpha;
- handle_new_color(orig_color, orig_alpha);
- window->update_color();
- window->send_configure_change();
- }
-}
-
TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y)
: DragCheckBox(client->server->mwindow, x, y, _("Drag"), &client->config.drag,
client->config.title_x, client->config.title_y,
#include "guicast.h"
-class TitleThread;
class TitleWindow;
-class TitleInterlace;
#include "colorpicker.h"
#include "dragcheckbox.h"
class TitleRight;class TitleTop;
class TitleMid;
class TitleBottom;
-class TitleColorThread;
class TitleSpeed;
class TitleTimecode;
class TitleTimecodeFormat;
TitlePitch *pitch;
BC_Title *encoding_title;
TitleEncoding *encoding;
+ BC_Title *color_button_title;
TitleColorButton *color_button;
- TitleColorThread *color_thread;
- TitleOutlineColorButton *outline_color_button;
- TitleColorThread *outline_color_thread;
+ BC_Title *outline_button_title;
+ TitleOutlineColorButton *outline_button;
BC_Title *motion_title;
TitleMotion *motion;
TitleLinePitch *line_pitch;
TitleWindow *window;
};
-class TitleColorButton : public BC_GenericButton
+class TitleColorButton : public ColorCircleButton
{
public:
TitleColorButton(TitleMain *client, TitleWindow *window, int x, int y);
- int handle_event();
+ int handle_new_color(int output, int alpha);
+ void handle_done_event(int result);
TitleMain *client;
TitleWindow *window;
};
-class TitleOutlineColorButton : public BC_GenericButton
+class TitleOutlineColorButton : public ColorCircleButton
{
public:
TitleOutlineColorButton(TitleMain *client, TitleWindow *window, int x, int y);
- int handle_event();
+ int handle_new_color(int output, int alpha);
+ void handle_done_event(int result);
TitleMain *client;
TitleWindow *window;
};
TitleMain *client;
TitleWindow *window;
};
-class TitleColorThread : public ColorPicker
-{
-public:
- TitleColorThread(TitleMain *client, TitleWindow *window, int is_outline);
- virtual int handle_new_color(int output, int alpha);
- void handle_done_event(int result);
- TitleMain *client;
- TitleWindow *window;
- int is_outline;
-};
class TitleBackground : public BC_CheckBox
{
public: