'libvpx' 'libx11' 'libxau' 'libxcb' 'libxcomposite' 'libxcursor'
'libxdamage' 'libxdmcp' 'libxext' 'libxfixes' 'libxft' 'libxi'
'libxinerama' 'libxrandr' 'libxrender' 'libxv' 'numactl' 'opus'
- 'pango' 'pcre' 'pixman' 'xz' 'zlib' 'xorg-server' 'libva'
+ 'pango' 'pcre' 'pixman' 'xz' 'zlib' 'xorg-server'
'xorg-fonts-misc' 'ttf-dejavu' 'inkscape' 'dvdauthor' 'udftools' )
makedepends=( 'autoconf' 'automake' 'yasm' 'nasm' 'cmake' 'libtool'
@g++ $(CFLAGS) shudmp.C -o $@ -lusb-1.0
clean:
- rm -rf $(OBJDIR)
+ rm -rf $(OBJDIR) tags
rm -f shuttle_keys.h
-
tags:
ctags -R -h default --langmap=c:+.inc . ../guicast/ ../libzmpeg3 ../plugins ../thirdparty/ffmpeg-*
$(OBJDIR)/pluginlv2ui.o $(OBJDIR)/lv2ui.o:
$(CXX) `cat $(OBJDIR)/c_flags` $(GTK2_INCS) -DMSGQUAL=$* -c $< -o $@
-$(OBJDIR)/shuttle.o: shuttle.C shuttle_keys.h
-shuttle_keys.h: /usr/include/X11/keysymdef.h
- sed -n < /usr/include/X11/keysymdef.h > shuttle_keys.h -f shuttle.sed
-
$(OBJDIR)/lv2ui: $(LV2OBJS)
@echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
@$(CXX) `cat $(OBJDIR)/c_flags` $^ -o $@ $(LIBS) $(GTK2_LIBS)
install: install-lv2ui
endif
+ifneq ($(WANT_SHUTTLE),no)
+$(OBJDIR)/shuttle.o: shuttle.C shuttle_keys.h
+shuttle_keys.h: /usr/include/X11/keysymdef.h
+ sed -n < /usr/include/X11/keysymdef.h > shuttle_keys.h -f shuttle.sed
+endif
+
$(OBJDIR)/pluginlv2gui.o: pluginlv2gui.C
$(CXX) `cat $(OBJDIR)/c_flags` $(GTK2_INCS) -DMSGQUAL=$* -c $< -o $@
case AW_CLIP_FOLDER:
if( get_buttonpress() == LEFT_BUTTON ) {
AssetVIcon *vicon = 0;
- if( !gui->vicon_thread->vicon )
+ AssetVIconThread *avt = gui->vicon_thread;
+ if( !avt->vicon && gui->vicon_drawing != AVICON_NO_PLAY )
vicon = item->vicon;
gui->vicon_thread->set_view_popup(vicon, ASSET_VIEW_ICON);
}
get_canvas()->unlock_window();
get_canvas()->flush();
get_canvas()->sync_display();
- mwindow->playback_3d->finish_output();
+// this code is to idle rendering before drawing overlays on refresh frame
+// if this is not done, occationally opengl finishs late, and overwrites
+// the x11 refresh frame and the overlay is not visible. Rarely happens.
+// bug in gl libs may segv if glfinish is called, workaround is no finish
+ static int cin_finish = -1;
+ if( cin_finish < 0 ) {
+ const char *cp = getenv("CIN_FINISH");
+ cin_finish = !cp ? 1 : atoi(cp);
+ }
+ if( cin_finish )
+ mwindow->playback_3d->finish_output();
get_canvas()->lock_window("CWindowCanvas::draw_refresh");
}
if( refresh_frame && refresh_frame->get_w()>0 && refresh_frame->get_h()>0 ) {
zwindows_lock->lock("MWindow::get_mixer");
if( !mixer ) mixer = edl->mixers.new_mixer();
ZWindow *zwindow = 0;
- for( int i=0; !zwindow && i<zwindows.size(); ++i )
- if( zwindows[i]->idx < 0 ) zwindow = zwindows[i];
+ for( int i=0; !zwindow && i<zwindows.size(); ++i ) {
+ ZWindow *zwdw = zwindows[i];
+ if( zwdw->running() ) continue;
+ if( zwdw->idx >= 0 ) continue;
+ zwindow = zwindows[i];
+ }
if( !zwindow )
zwindows.append(zwindow = new ZWindow(this));
zwindow->idx = mixer->idx;
for( int i=zwindows.size(); --i>=0; ) {
ZWindow *zwindow = zwindows[i];
if( zwindow->idx < 0 ) continue;
+ zwindow->idx = -1;
zwindow->destroy = destroy;
ZWindowGUI *zgui = zwindow->zgui;
zgui->lock_window("MWindow::select_zwindow 0");
edl->local_session->loop_playback = 0;
edl->local_session->set_selectionstart(0);
edl->local_session->set_selectionend(0);
+ edl->local_session->unset_inpoint();
+ edl->local_session-> unset_outpoint();
set_brender_active(0, 0);
fit_selection();
goto_start();
OverlayKernel::~OverlayKernel()
{
- if(lookup) delete [] lookup;
+ delete [] lookup;
}
OverlayFrame::OverlayFrame(int cpus)
OverlayFrame::~OverlayFrame()
{
- if(temp_frame) delete temp_frame;
-
- if(direct_engine) delete direct_engine;
- if(nn_engine) delete nn_engine;
- if(sample_engine) delete sample_engine;
-
- if(kernel[NEAREST_NEIGHBOR]) delete kernel[NEAREST_NEIGHBOR];
- if(kernel[BILINEAR]) delete kernel[BILINEAR];
- if(kernel[BICUBIC]) delete kernel[BICUBIC];
- if(kernel[LANCZOS]) delete kernel[LANCZOS];
+ delete direct_engine;
+ delete nn_engine;
+ delete sample_engine;
+ delete temp_frame;
+ delete kernel[NEAREST_NEIGHBOR];
+ delete kernel[BILINEAR];
+ delete kernel[BICUBIC];
+ delete kernel[LANCZOS];
}
static float epsilon_snap(float f)
void PlaybackEngine::delete_render_engine()
{
renderengine_lock->lock("PlaybackEngine::delete_render_engine");
- delete render_engine; render_engine = 0;
+ if( render_engine ) {
+ render_engine->interrupt_playback();
+ render_engine->wait_done();
+ delete render_engine; render_engine = 0;
+ }
renderengine_lock->unlock();
}
}
total_sizes = 1;
- int orig_w = mwindow->edl->session->output_w * orig_scale;
- int orig_h = mwindow->edl->session->output_h * orig_scale;
-
if( !use_scaler ) {
// w,h should stay even for yuv
int ow = orig_w, oh = orig_h;
ProxyFarm engine(mwindow, this, &needed_idxbls, &needed_proxies);
engine.process_packages();
-printf("failed=%d canceled=%d\n", failed, progress->is_cancelled());
+printf("proxy: failed=%d canceled=%d\n", failed, progress->is_cancelled());
// stop progress bar
canceled = progress->is_cancelled();
dialog->auto_scale = mwindow->edl->session->proxy_auto_scale;
dialog->beep = mwindow->edl->session->proxy_beep;
dialog->new_scale = dialog->orig_scale;
+ dialog->orig_w = mwindow->edl->session->output_w;
+ dialog->orig_h = mwindow->edl->session->output_h;
+ if( !dialog->use_scaler ) {
+ dialog->orig_w *= dialog->orig_scale;
+ dialog->orig_h *= dialog->orig_scale;
+ }
int x = margin;
int y = margin+10;
add_subwindow(text = new BC_Title(x, y, _("Scale factor:")));
x += text->get_w() + margin;
- int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0]));
+ int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+15);
add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, ""));
scale_factor->update_sizes();
x += scale_factor->get_w() + margin;
void ProxyWindow::update()
{
char string[BCSTRLEN];
- int orig_w = mwindow->edl->session->output_w * dialog->orig_scale;
- int orig_h = mwindow->edl->session->output_h * dialog->orig_scale;
- int new_w = orig_w / dialog->new_scale;
+ int new_w = dialog->orig_w / dialog->new_scale;
if( new_w & 1 ) ++new_w;
- int new_h = orig_h / dialog->new_scale;
+ int new_h = dialog->orig_h / dialog->new_scale;
if( new_h & 1 ) ++new_h;
sprintf(string, "%dx%d", new_w, new_h);
new_dimensions->update(string);
for( int i = 0; i < dialog->total_sizes; i++ ) {
if( !strcmp(get_text(), pwindow->dialog->size_text[i]) ) {
dialog->new_scale = pwindow->dialog->size_factors[i];
- if( dialog->new_scale == 1 ) dialog->use_scaler = 0;
pwindow->update();
break;
}
Asset *asset;
ProxyRender *proxy_render;
- int new_scale;
- int orig_scale;
- int use_scaler;
- int auto_scale;
+ int orig_scale, new_scale;
+ int use_scaler, auto_scale;
+ int orig_w, orig_h;
int beep;
char *size_text[MAX_SIZES];
int size_factors[MAX_SIZES];
VirtualVConsole::~VirtualVConsole()
{
- if(output_temp)
- {
- delete output_temp;
- }
+ delete output_temp;
}
VDeviceBase* VirtualVConsole::get_vdriver()
track, parent_node)
{
//VRender *vrender = ((VirtualVConsole*)vconsole)->vrender;
- fader = new FadeEngine(renderengine->preferences->processors);
+ //fader = new FadeEngine(renderengine->preferences->processors);
masker = new MaskEngine(renderengine->preferences->processors);
alpha = 1;
}
VirtualVNode::~VirtualVNode()
{
- delete fader;
+ //delete fader;
delete masker;
}
int use_opengl);
float alpha;
- FadeEngine *fader;
+// FadeEngine *fader;
MaskEngine *masker;
};
VModule::~VModule()
{
- if(overlay_temp) delete overlay_temp;
- if(input_temp) delete input_temp;
- if(transition_temp) delete transition_temp;
+ if( overlay_temp ) delete overlay_temp;
+ if( input_temp ) delete input_temp;
+ if( transition_temp ) delete transition_temp;
delete masker;
}
CICache* VModule::get_cache()
{
- if(renderengine)
+ if( renderengine )
return renderengine->get_vcache();
else
return cache;
}
-
-
-
-
int VModule::import_frame(VFrame *output, VEdit *current_edit,
int64_t input_position, double frame_rate, int direction, int use_opengl)
{
int64_t input_position_project = Units::to_int64(input_position *
edl_rate / frame_rate + 0.001);
- if(!output) printf("VModule::import_frame %d output=%p\n", __LINE__, output);
+ if( !output ) printf("VModule::import_frame %d output=%p\n", __LINE__, output);
//output->dump_params();
- if(debug) printf("VModule::import_frame %d this=%p input_position=%lld direction=%d\n",
+ if( debug ) printf("VModule::import_frame %d this=%p input_position=%lld direction=%d\n",
__LINE__, this, (long long)input_position, direction);
// Convert to position corrected for direction
direction_position = input_position;
- if(direction == PLAY_REVERSE) {
+ if( direction == PLAY_REVERSE ) {
if( direction_position > 0 ) direction_position--;
if( input_position_project > 0 ) input_position_project--;
}
- if(!output) printf("VModule::import_frame %d output=%p\n", __LINE__, output);
+ if( !output ) printf("VModule::import_frame %d output=%p\n", __LINE__, output);
VDeviceX11 *x11_device = 0;
- if(use_opengl)
- {
- if(renderengine && renderengine->video)
- {
+ if( use_opengl ) {
+ if( renderengine && renderengine->video ) {
x11_device = (VDeviceX11*)renderengine->video->get_output_base();
output->set_opengl_state(VFrame::RAM);
- if(!x11_device) use_opengl = 0;
+ if( !x11_device ) use_opengl = 0;
}
}
- if(!output) printf("VModule::import_frame %d output=%p x11_device=%p nested_edl=%p\n",
+ if( !output ) printf("VModule::import_frame %d output=%p x11_device=%p nested_edl=%p\n",
__LINE__, output, x11_device, nested_edl);
- if(debug) printf("VModule::import_frame %d current_edit=%p\n",
+ if( debug ) printf("VModule::import_frame %d current_edit=%p\n",
__LINE__, current_edit);
// Load frame into output
// Create objects for nested EDL
- if(current_edit && current_edit->nested_edl) {
+ if( current_edit && current_edit->nested_edl ) {
int command;
- if(debug) printf("VModule::import_frame %d nested_edl=%p current_edit->nested_edl=%p\n",
+ if( debug ) printf("VModule::import_frame %d nested_edl=%p current_edit->nested_edl=%p\n",
__LINE__, nested_edl, current_edit->nested_edl);
// Convert requested direction to command
if( renderengine->command->command == CURRENT_FRAME ||
- renderengine->command->command == LAST_FRAME )
- {
+ renderengine->command->command == LAST_FRAME ) {
command = renderengine->command->command;
}
else
- if(direction == PLAY_REVERSE)
- {
- if(renderengine->command->single_frame())
+ if( direction == PLAY_REVERSE ) {
+ if( renderengine->command->single_frame() )
command = SINGLE_FRAME_REWIND;
else
command = NORMAL_REWIND;
}
- else
- {
- if(renderengine->command->single_frame())
+ else {
+ if( renderengine->command->single_frame() )
command = SINGLE_FRAME_FWD;
else
command = NORMAL_FWD;
}
- if(!nested_edl || nested_edl->id != current_edit->nested_edl->id)
- {
+ if( !nested_edl || nested_edl->id != current_edit->nested_edl->id ) {
nested_edl = current_edit->nested_edl;
- if(nested_renderengine)
- {
+ if( nested_renderengine ) {
delete nested_renderengine;
nested_renderengine = 0;
}
- if(!nested_command)
- {
+ if( !nested_command ) {
nested_command = new TransportCommand;
}
- if(!nested_renderengine)
- {
+ if( !nested_renderengine ) {
nested_command->command = command;
nested_command->get_edl()->copy_all(nested_edl);
nested_command->change_type = CHANGE_ALL;
nested_renderengine->arm_command(nested_command);
}
}
- else
- {
+ else {
// Update nested command
nested_renderengine->command->command = command;
// Update nested video driver for opengl
nested_renderengine->video = renderengine->video;
}
- else
- {
+ else {
nested_edl = 0;
}
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
if( output ) {
if( use_opengl )
else
printf("VModule::import_frame %d output=%p\n", __LINE__, output);
- if(current_edit &&
+ if( current_edit &&
(current_edit->asset ||
- (current_edit->nested_edl && nested_renderengine->vrender)))
- {
+ (current_edit->nested_edl && nested_renderengine->vrender)) ) {
File *file = 0;
//printf("VModule::import_frame %d cache=%p\n", __LINE__, get_cache());
}
// File found
- if(file || nested_edl)
- {
+ if( file || nested_edl ) {
// Make all positions based on requested frame rate.
int64_t edit_startproject = Units::to_int64(current_edit->startproject *
frame_rate /
// apply speed curve to source position so the timeline agrees with the playback
- if(track->has_speed())
- {
+ if( track->has_speed() ) {
// integrate position from start of edit.
double speed_position = edit_startsource;
FloatAutos *speed_autos = (FloatAutos*)track->automation->autos[AUTOMATION_SPEED];
int asset_w;
int asset_h;
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
// maybe apply speed curve here, so timeline reflects actual playback
// if we hit the end of stream, freeze at last frame
uint64_t max_position = 0;
- if(file)
- {
+ if( file ) {
max_position = Units::to_int64((double)file->get_video_length() *
frame_rate /
current_edit->asset->frame_rate - 1);
}
- else
- {
+ else {
max_position = Units::to_int64(nested_edl->tracks->total_length() *
frame_rate - 1);
}
- if(position > max_position) position = max_position;
+ if( position > max_position ) position = max_position;
else
- if(position < 0) position = 0;
+ if( position < 0 ) position = 0;
int use_cache = renderengine &&
renderengine->command->single_frame();
//// renderengine->command->realtime &&
// renderengine->get_edl()->session->video_asynchronous;
- if(file)
- {
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
-// if(use_asynchronous)
+ if( file ) {
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
+// if( use_asynchronous )
// file->start_video_decode_thread();
// else
file->stop_video_thread();
asset_h = current_edit->asset->height;
//printf("VModule::import_frame %d normalized_position=%lld\n", __LINE__, normalized_position);
}
- else
- {
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
+ else {
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
asset_w = nested_edl->session->output_w;
asset_h = nested_edl->session->output_h;
// Get source position in nested frame rate in direction of playback.
nested_position = Units::to_int64(position *
nested_edl->session->frame_rate /
frame_rate);
- if(direction == PLAY_REVERSE)
+ if( direction == PLAY_REVERSE )
nested_position++;
}
// Auto scale if required
- if(output->get_params()->get("AUTOSCALE", 0))
- {
+ if( output->get_params()->get("AUTOSCALE", 0) ) {
float autoscale_w = output->get_params()->get("AUTOSCALE_W", 1024);
float autoscale_h = output->get_params()->get("AUTOSCALE_H", 1024);
float x_scale = autoscale_w / asset_w;
in_w = asset_w;
in_h = asset_h;
- if(x_scale < y_scale)
- {
+ if( x_scale < y_scale ) {
out_w = in_w * x_scale;
out_h = in_h * x_scale;
}
- else
- {
+ else {
out_w = in_w * y_scale;
out_h = in_h * y_scale;
}
out_x = track->track_w / 2 - out_w / 2;
out_y = track->track_h / 2 - out_h / 2;
}
- else
+ else {
// Apply camera
- {
((VTrack*)track)->calculate_input_transfer(asset_w,
- asset_h,
- input_position_project,
- direction,
- in_x,
- in_y,
- in_w,
- in_h,
- out_x,
- out_y,
- out_w,
- out_h);
+ asset_h, input_position_project, direction,
+ in_x, in_y, in_w, in_h,
+ out_x, out_y, out_w, out_h);
}
// printf("VModule::import_frame %d %f %d %f %d\n",
-// __LINE__,
-// in_w,
-// asset_w,
-// in_h,
-// asset_h);
+// __LINE__, in_w, asset_w, in_h, asset_h);
//
// printf("VModule::import_frame 1 [ilace] Project: mode (%d) Asset: autofixoption (%d), mode (%d), method (%d)\n",
// get_edl()->session->interlace_mode,
// printf("VModule::import_frame 1 [ilace] Compensating by using: '%s'\n",string);
// Compensate for the said interlacing...
- switch (interlace_fixmethod) {
+ switch( interlace_fixmethod ) {
case ILACE_FIXMETHOD_NONE:
break;
!EQUIV(out_w, track->track_w) ||
!EQUIV(out_h, track->track_h) ||
!EQUIV(in_w, asset_w) ||
- !EQUIV(in_h, asset_h))
- {
+ !EQUIV(in_h, asset_h)) {
//printf("VModule::import_frame %d file -> temp -> output\n", __LINE__);
-
-
-
-
// Get temporary input buffer
VFrame **input = 0;
// Realtime playback
- if(commonrender)
- {
+ if( commonrender ) {
VRender *vrender = (VRender*)commonrender;
//printf("VModule::import_frame %d vrender->input_temp=%p\n", __LINE__, vrender->input_temp);
input = &vrender->input_temp;
}
- else
+ else {
// Menu effect
- {
input = &input_temp;
}
- if((*input) &&
- ((*input)->get_w() != asset_w ||
- (*input)->get_h() != asset_h))
- {
+ if( (*input) &&
+ ((*input)->get_w() != asset_w ||
+ (*input)->get_h() != asset_h) ) {
delete (*input);
(*input) = 0;
}
-
-
-
-
- if(!(*input))
- {
+ if( !(*input) ) {
(*input) =
new VFrame(asset_w, asset_h,
get_edl()->session->color_model);
}
-
-
-
(*input)->copy_stacks(output);
// file -> temp
// Cache for single frame only
- if(file)
- {
- if(debug) printf("VModule::import_frame %d this=%p file=%s\n",
+ if( file ) {
+ if( debug ) printf("VModule::import_frame %d this=%p file=%s\n",
__LINE__,
this,
current_edit->asset->path);
- if(use_cache) file->set_cache_frames(1);
+ if( use_cache ) file->set_cache_frames(1);
result = file->read_frame((*input));
- if(use_cache) file->set_cache_frames(0);
+ if( use_cache ) file->set_cache_frames(0);
(*input)->set_opengl_state(VFrame::RAM);
}
else
- if(nested_edl)
- {
+ if( nested_edl ) {
// If the colormodels differ, change input to nested colormodel
int nested_cmodel = nested_renderengine->get_edl()->session->color_model;
int current_cmodel = output->get_color_model();
int output_h = output->get_h();
VFrame *input2 = (*input);
- if(nested_cmodel != current_cmodel)
- {
+ if( nested_cmodel != current_cmodel ) {
// If opengl, input -> input -> output
- if(use_opengl)
- {
- }
- else
- {
+ if( use_opengl ) { }
+ else {
// If software, input2 -> input -> output
// Use output as a temporary.
input2 = output;
}
- if(debug) printf("VModule::import_frame %d this=%p nested_cmodel=%d\n",
+ if( debug ) printf("VModule::import_frame %d this=%p nested_cmodel=%d\n",
__LINE__,
this,
nested_cmodel);
input2->dump();
- input2->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- (*input)->get_w(),
- (*input)->get_h(),
- nested_cmodel,
- -1);
+ input2->reallocate(0, -1, 0, 0, 0,
+ (*input)->get_w(), (*input)->get_h(),
+ nested_cmodel, -1);
input2->dump();
}
- if(debug) printf("VModule::import_frame %d this=%p nested_edl=%s input2=%p\n",
- __LINE__,
- this,
- nested_edl->path,
- input2);
+ if( debug ) printf("VModule::import_frame %d this=%p nested_edl=%s input2=%p\n",
+ __LINE__, this, nested_edl->path, input2);
result = nested_renderengine->vrender->process_buffer(
- input2,
- nested_position,
- use_opengl);
+ input2, nested_position, use_opengl);
- if(debug) printf("VModule::import_frame %d this=%p nested_edl=%s\n",
+ if( debug ) printf("VModule::import_frame %d this=%p nested_edl=%s\n",
__LINE__,
this,
nested_edl->path);
- if(nested_cmodel != current_cmodel)
- {
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
- if(use_opengl)
- {
+ if( nested_cmodel != current_cmodel ) {
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
+ if( use_opengl ) {
// Change colormodel in hardware.
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
x11_device->convert_cmodel(input2,
current_cmodel);
// The converted color model is now in hardware, so return the input2 buffer
// to the expected color model.
- input2->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- (*input)->get_w(),
- (*input)->get_h(),
- current_cmodel,
- -1);
+ input2->reallocate(0, -1, 0, 0, 0,
+ (*input)->get_w(), (*input)->get_h(),
+ current_cmodel, -1);
}
- else
- {
+ else {
// Transfer from input2 to input
-if(debug) printf("VModule::import_frame %d nested_cmodel=%d current_cmodel=%d input2=%p input=%p output=%p\n",
-__LINE__,
-nested_cmodel,
-current_cmodel,
-input2,
-(*input),
-output);
- BC_CModels::transfer((*input)->get_rows(),
- input2->get_rows(),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- input2->get_w(),
- input2->get_h(),
- 0,
- 0,
- (*input)->get_w(),
- (*input)->get_h(),
- nested_cmodel,
- current_cmodel,
- 0,
- input2->get_w(),
- (*input)->get_w());
+if( debug ) printf("VModule::import_frame %d nested_cmodel=%d current_cmodel=%d input2=%p input=%p output=%p\n",
+ __LINE__, nested_cmodel, current_cmodel, input2, (*input), output);
+ BC_CModels::transfer((*input)->get_rows(), input2->get_rows(),
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, input2->get_w(), input2->get_h(),
+ 0, 0, (*input)->get_w(), (*input)->get_h(),
+ nested_cmodel, current_cmodel, 0,
+ input2->get_w(), (*input)->get_w());
//printf("VModule::import_frame %d\n", __LINE__);
// input2 was the output buffer, so it must be restored
- input2->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- output_w,
- output_h,
- current_cmodel,
- -1);
+ input2->reallocate(0, -1, 0, 0, 0,
+ output_w, output_h, current_cmodel, -1);
//printf("VModule::import_frame %d\n", __LINE__);
}
}
OverlayFrame *overlayer = 0;
// OpenGL playback uses hardware
- if(use_opengl)
- {
+ if( use_opengl ) {
//printf("VModule::import_frame %d\n", __LINE__);
}
- else
+ else if( commonrender ) {
// Realtime playback
- if(commonrender)
- {
VRender *vrender = (VRender*)commonrender;
overlayer = vrender->overlayer;
}
- else
+ else {
// Menu effect
- {
- if(!plugin_array)
+ if( !plugin_array )
printf("VModule::import_frame neither plugin_array nor commonrender is defined.\n");
- if(!overlay_temp)
- {
+ if( !overlay_temp ) {
overlay_temp = new OverlayFrame(plugin_array->mwindow->preferences->processors);
}
overlayer = overlay_temp;
}
// printf("VModule::import_frame 1 %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f\n",
-// in_x,
-// in_y,
-// in_w,
-// in_h,
-// out_x,
-// out_y,
-// out_w,
-// out_h);
+// in_x, in_y, in_w, in_h, out_x, out_y, out_w, out_h);
// temp -> output
-// for(int j = 0; j < output->get_w() * 3 * 5; j++)
+// for( int j = 0; j < output->get_w() * 3 * 5; j++ )
// output->get_rows()[0][j] = 255;
- if(use_opengl)
- {
- x11_device->do_camera(output,
- (*input),
- in_x,
- in_y,
- in_x + in_w,
- in_y + in_h,
- out_x,
- out_y,
- out_x + out_w,
- out_y + out_h);
-if(debug) printf("VModule::import_frame %d %d %d\n",
-__LINE__,
-output->get_opengl_state(),
-(*input)->get_opengl_state());
+ if( use_opengl ) {
+ x11_device->do_camera(output, (*input),
+ in_x, in_y, in_x + in_w, in_y + in_h,
+ out_x, out_y, out_x + out_w, out_y + out_h);
+if( debug ) printf("VModule::import_frame %d %d %d\n",
+ __LINE__, output->get_opengl_state(), (*input)->get_opengl_state());
}
- else
- {
-
-
-
+ else {
output->clear_frame();
-
-
// get_cache()->check_in(current_edit->asset);
// return;
// TRANSFER_REPLACE is the fastest transfer mode but it has the disadvantage
// of producing green borders in floating point translation of YUV
int mode = TRANSFER_REPLACE;
- if(get_edl()->session->interpolation_type != NEAREST_NEIGHBOR &&
- BC_CModels::is_yuv(output->get_color_model()))
+ if( get_edl()->session->interpolation_type != NEAREST_NEIGHBOR &&
+ BC_CModels::is_yuv(output->get_color_model()) )
mode = TRANSFER_NORMAL;
- if(debug) printf("VModule::import_frame %d temp -> output\n", __LINE__);
- overlayer->overlay(output,
- (*input),
- in_x,
- in_y,
- in_x + in_w,
- in_y + in_h,
- out_x,
- out_y,
- out_x + out_w,
- out_y + out_h,
- 1,
- mode,
- get_edl()->session->interpolation_type);
+ if( debug ) printf("VModule::import_frame %d temp -> output\n", __LINE__);
+ overlayer->overlay(output, (*input),
+ in_x, in_y, in_x + in_w, in_y + in_h,
+ out_x, out_y, out_x + out_w, out_y + out_h,
+ 1, mode, get_edl()->session->interpolation_type);
}
result = 1;
//(*input)->dump_params();
//output->dump_params();
}
- else
+ else {
// file -> output
- {
- if(debug) printf("VModule::import_frame %d file -> output nested_edl=%p file=%p\n",
- __LINE__,
- nested_edl,
- file);
- if(nested_edl)
- {
+ if( debug ) printf("VModule::import_frame %d file -> output nested_edl=%p file=%p\n",
+ __LINE__, nested_edl, file);
+ if( nested_edl ) {
VFrame **input = &output;
// If colormodels differ, reallocate output in nested colormodel.
int nested_cmodel = nested_renderengine->get_edl()->session->color_model;
int current_cmodel = output->get_color_model();
-if(debug) printf("VModule::import_frame %d nested_cmodel=%d current_cmodel=%d\n",
+if( debug ) printf("VModule::import_frame %d nested_cmodel=%d current_cmodel=%d\n",
__LINE__,
nested_cmodel,
current_cmodel);
- if(nested_cmodel != current_cmodel)
- {
- if(use_opengl)
- {
- }
- else
- {
- if(commonrender)
- {
+ if( nested_cmodel != current_cmodel ) {
+ if( use_opengl ) { }
+ else {
+ if( commonrender ) {
input = &((VRender*)commonrender)->input_temp;
}
- else
- {
+ else {
input = &input_temp;
}
- if(!(*input)) (*input) = new VFrame;
+ if( !(*input) ) (*input) = new VFrame;
}
- (*input)->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- output->get_w(),
- output->get_h(),
- nested_cmodel,
- -1);
-if(debug) printf("VModule::import_frame %d\n",
-__LINE__);
+ (*input)->reallocate(0, -1, 0, 0, 0,
+ output->get_w(), output->get_h(),
+ nested_cmodel, -1);
+if( debug ) printf("VModule::import_frame %d\n", __LINE__);
//(*input)->dump();
//(*input)->clear_frame();
}
-if(debug) printf("VModule::import_frame %d %p %p\n",
-__LINE__,
-(*input)->get_rows(),
-(*input));
+if( debug ) printf("VModule::import_frame %d %p %p\n",
+ __LINE__, (*input)->get_rows(), (*input));
result = nested_renderengine->vrender->process_buffer(
- (*input),
- nested_position,
- use_opengl);
-if(debug) printf("VModule::import_frame %d\n",
+ (*input), nested_position, use_opengl);
+if( debug ) printf("VModule::import_frame %d\n",
__LINE__);
// If colormodels differ, change colormodels in opengl if possible.
// Swap output for temp if not possible.
- if(nested_cmodel != current_cmodel)
- {
- if(use_opengl)
- {
+ if( nested_cmodel != current_cmodel ) {
+ if( use_opengl ) {
x11_device->convert_cmodel(output,
current_cmodel);
// The color model was changed in place, so return output buffer
- output->reallocate(0,
- -1,
- 0,
- 0,
- 0,
- output->get_w(),
- output->get_h(),
- current_cmodel,
- -1);
+ output->reallocate(0, -1, 0, 0, 0,
+ output->get_w(), output->get_h(),
+ current_cmodel, -1);
}
- else
- {
+ else {
// Transfer from temporary to output
-if(debug) printf("VModule::import_frame %d %d %d %d %d %d %d\n",
-__LINE__,
-(*input)->get_w(),
-(*input)->get_h(),
-output->get_w(),
-output->get_h(),
-nested_cmodel,
-current_cmodel);
- BC_CModels::transfer(output->get_rows(),
- (*input)->get_rows(),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- (*input)->get_w(),
- (*input)->get_h(),
- 0,
- 0,
- output->get_w(),
- output->get_h(),
- nested_cmodel,
- current_cmodel,
- 0,
- (*input)->get_w(),
- output->get_w());
+if( debug ) printf("VModule::import_frame %d %d %d %d %d %d %d\n",
+ __LINE__, (*input)->get_w(), (*input)->get_h(),
+ output->get_w(), output->get_h(), nested_cmodel, current_cmodel);
+ BC_CModels::transfer(output->get_rows(), (*input)->get_rows(),
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, (*input)->get_w(), (*input)->get_h(),
+ 0, 0, output->get_w(), output->get_h(),
+ nested_cmodel, current_cmodel, 0,
+ (*input)->get_w(), output->get_w());
}
}
-
}
- else
- if(file)
- {
+ else if( file ) {
// Cache single frames
//memset(output->get_rows()[0], 0xff, 1024);
- if(use_cache) file->set_cache_frames(1);
+ if( use_cache ) file->set_cache_frames(1);
result = file->read_frame(output);
- if(use_cache) file->set_cache_frames(0);
+ if( use_cache ) file->set_cache_frames(0);
output->set_opengl_state(VFrame::RAM);
}
}
- if(file)
- {
+ if( file ) {
get_cache()->check_in(current_edit->asset);
file = 0;
}
}
- else
+ else {
// Source not found
- {
result = 1;
}
// get_cache());
}
- else
+ else {
// Source is silence
- {
- if(debug) printf("VModule::import_frame %d\n", __LINE__);
- if(use_opengl)
- {
+ if( debug ) printf("VModule::import_frame %d\n", __LINE__);
+ if( use_opengl ) {
x11_device->clear_input(output);
}
- else
- {
+ else {
output->clear_frame();
}
}
- if(debug) printf("VModule::import_frame %d done\n", __LINE__);
+ if( debug ) printf("VModule::import_frame %d done\n", __LINE__);
return result;
}
-
int VModule::render(VFrame *output,
- int64_t start_position,
- int direction,
- double frame_rate,
- int use_nudge,
- int debug_render,
- int use_opengl)
+ int64_t start_position, int direction, double frame_rate,
+ int use_nudge, int debug_render, int use_opengl)
{
int result = 0;
double edl_rate = get_edl()->session->frame_rate;
//printf("VModule::render %d %ld\n", __LINE__, start_position);
- if(use_nudge) start_position += Units::to_int64(track->nudge *
+ if( use_nudge ) start_position += Units::to_int64(track->nudge *
frame_rate / edl_rate);
int64_t start_position_project = Units::to_int64(start_position *
edl_rate / frame_rate + 0.5);
- update_transition(start_position_project,
- direction);
+ update_transition(start_position_project, direction);
VEdit* current_edit = (VEdit*)track->edits->editof(start_position_project,
- direction,
- 0);
+ direction, 0);
VEdit* previous_edit = 0;
//printf("VModule::render %d %p %ld %d\n", __LINE__, current_edit, start_position_project, direction);
- if(debug_render)
+ if( debug_render )
printf(" VModule::render %d %d %jd %s transition=%p opengl=%d current_edit=%p output=%p\n",
- __LINE__,
- use_nudge,
- start_position_project,
- track->title,
- transition,
- use_opengl,
- current_edit,
- output);
-
- if(!current_edit)
- {
+ __LINE__, use_nudge, start_position_project, track->title,
+ transition, use_opengl, current_edit, output);
+
+ if( !current_edit ) {
output->clear_frame();
// We do not apply mask here, since alpha is 0, and neither substracting nor multypling changes it
// Another mask mode - "addition" should be added to be able to create mask from empty frames
// Process transition
- if(transition && transition->on)
- {
+ if( transition && transition->on ) {
// Get temporary buffer
VFrame **transition_input = 0;
- if(commonrender)
- {
+ if( commonrender ) {
VRender *vrender = (VRender*)commonrender;
transition_input = &vrender->transition_temp;
}
- else
- {
+ else {
transition_input = &transition_temp;
}
- if((*transition_input) &&
+ if( (*transition_input) &&
((*transition_input)->get_w() != track->track_w ||
- (*transition_input)->get_h() != track->track_h))
- {
+ (*transition_input)->get_h() != track->track_h) ) {
delete (*transition_input);
(*transition_input) = 0;
}
// Load incoming frame
- if(!(*transition_input))
- {
+ if( !(*transition_input) ) {
(*transition_input) =
new VFrame(track->track_w, track->track_h,
get_edl()->session->color_model);
//printf("VModule::render %d\n", __LINE__);
result = import_frame((*transition_input),
- current_edit,
- start_position,
- frame_rate,
- direction,
- use_opengl);
+ current_edit, start_position, frame_rate,
+ direction, use_opengl);
// Load transition buffer
previous_edit = (VEdit*)current_edit->previous;
result |= import_frame(output,
- previous_edit,
- start_position,
- frame_rate,
- direction,
- use_opengl);
-//printf("VModule::render %d\n", __LINE__);
-
-// printf("VModule::render %d %p %p %p %p\n",
-// __LINE__,
-// (*transition_input),
-// (*transition_input)->get_pbuffer(),
-// output,
-// output->get_pbuffer());
-
+ previous_edit, start_position, frame_rate,
+ direction, use_opengl);
+//printf("VModule::render %d %p %p %p %p\n", __LINE__,
+// (*transition_input), (*transition_input)->get_pbuffer(),
+// output, output->get_pbuffer());
// Execute plugin with transition_input and output here
- if(renderengine)
+ if( renderengine )
transition_server->set_use_opengl(use_opengl, renderengine->video);
- transition_server->process_transition((*transition_input),
- output,
+ transition_server->process_transition((*transition_input), output,
(direction == PLAY_FORWARD) ?
(start_position_project - current_edit->startproject) :
(start_position_project - current_edit->startproject - 1),
transition->length);
}
- else
- {
+ else {
// Load output buffer
result = import_frame(output,
- current_edit,
- start_position,
- frame_rate,
- direction,
- use_opengl);
+ current_edit, start_position, frame_rate,
+ direction, use_opengl);
}
Auto *current = 0;
if( keyframe->apply_before_plugins ) {
VDeviceX11 *x11_device = 0;
- if(use_opengl && renderengine && renderengine->video) {
+ if( use_opengl && renderengine && renderengine->video ) {
x11_device = (VDeviceX11*)renderengine->video->get_output_base();
if( !x11_device->can_mask(mask_position, keyframe_set) )
use_opengl = 0;
}
-
-
-
-
void VModule::create_objects()
{
Module::create_objects();
}
-
-
-
-
-
VRender::~VRender()
{
- if(input_temp) delete input_temp;
- if(transition_temp) delete transition_temp;
- if(overlayer) delete overlayer;
+ renderengine->wait_done();
+ delete overlayer;
+ delete input_temp;
+ delete transition_temp;
}
void ZWindow::handle_done_event(int result)
{
+ idx = -1;
+ stop_playback(1);
if( destroy )
mwindow->del_mixer(this);
- idx = -1;
}
void ZWindow::handle_close_event(int result)
{
CHECK_LIB([audiofile], [audiofile], [afOpenFile])
CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
+CHECK_WANT([SHUTTLE], [yes], [shuttle dev support], [
+ CHECK_HEADERS([keysyms], [x11 keysym defs], [X11/keysymdef.h])])
+if test "x$WANT_SHUTTLE" = "xno"; then
+ WANT_SHUTTLE_USB="no"
+fi
CHECK_WANT([SHUTTLE_USB], [yes], [use libusb-1.0], [
CHECK_LIB([libusbx], [usb-1.0], [libusb_init])
CHECK_HEADERS([libusbx], [libusb headers], [libusb-1.0/libusb.h])])
$(OBJDIR)/db.a: $(OBJECTS)
ar rcs $@ $(OBJECTS)
- ctags -R .
s.C: $(OBJDIR)/xsch sch.txt
$(OBJDIR)/xsch < sch.txt
idet
il
inflate
-interlace
+#interlace ###Operation not permitted, use tinterlace
#interleave ###Operation not permitted
#join
kerndeint
gui = 0;
startup_lock = new Condition(1, "BC_DialogThread::startup_lock");
window_lock = new Mutex("BC_DialogThread::window_lock");
+ active_lock = new Mutex("BC_DialogThread::active_lock");
}
BC_DialogThread::~BC_DialogThread()
delete startup_lock;
delete window_lock;
+ delete active_lock;
}
void BC_DialogThread::lock_dialog(const char *location)
void BC_DialogThread::run()
{
+ active_lock->lock("BC_DialogThread::run");
gui = new_gui();
startup_lock->unlock();
int result = gui->run_window();
window_lock->unlock();
handle_close_event(result);
+ active_lock->unlock();
}
BC_Window* BC_DialogThread::new_gui()
join();
}
-
+void BC_DialogThread::join()
+{
+ if( !running() ) return;
+ active_lock->lock("BC_DialogThread::join");
+ active_lock->unlock();
+}
// Called by user to close the GUI from outside the thread
void close_window();
-
+ void join();
private:
BC_Window *gui;
Condition *startup_lock;
Mutex *window_lock;
+ Mutex *active_lock;
};
-
-
-
-
-
-
-
#endif
int x1, y1, x2, y2, x3;
XPoint point[3];
- x1 = x; x2 = x + w / 2; x3 = x + w - 1;
- y1 = y; y2 = y + h - 1;
+ x1 = x+1; x2 = x + w/2; x3 = x+w-1;
+ y1 = y; y2 = y+h-1;
- point[0].x = x2; point[0].y = y2; point[1].x = x3;
- point[1].y = y1; point[2].x = x1; point[2].y = y1;
+ point[0].x = x2; point[0].y = y2;
+ point[1].x = x3; point[1].y = y1;
+ point[2].x = x1; point[2].y = y1;
XFillPolygon(top_level->display,
pixmap->opaque_pixmap,
3,
Nonconvex,
CoordModeOrigin);
+ draw_line(x1,y1, x3,y1);
}
void BC_WindowBase::draw_triangle_up(int x, int y, int w, int h,
. color, font, alpha, size, png, bold, italic, blink,
. ul, caps, sup(super/sub script), fixed, nudge.
Special characters are <, >, \, /, # (see manual).
+Tracer: Trace an outline of an object for a mask like operation.
Translate: Allows displacing, cropping and/or scaling video
horizontally/vertically.
Unsharp: Applies a traditional darkroom technique, unsharp
BrightnessConfig::BrightnessConfig()
{
- reset();
+ reset(0);
}
-void BrightnessConfig::reset()
-
+void BrightnessConfig::reset(int clear)
{
- brightness = 0;
- contrast = 0;
- luma = 1;
+ switch(clear) {
+ case RESET_CONTRAST : contrast = 0;
+ break;
+ case RESET_BRIGHTNESS : brightness = 0;
+ break;
+ case RESET_ALL :
+ default:
+ brightness = 0;
+ contrast = 0;
+ luma = 1;
+ break;
+ }
}
int BrightnessConfig::equivalent(BrightnessConfig &that)
BrightnessConfig();
int equivalent(BrightnessConfig &that);
- void reset();
+ void reset(int clear);
void copy_from(BrightnessConfig &that);
void interpolate(BrightnessConfig &prev,
BrightnessConfig &next,
BrightnessWindow::BrightnessWindow(BrightnessMain *client)
- : PluginClientWindow(client,
- 330,
- 160,
- 330,
- 160,
- 0)
+ : PluginClientWindow(client, 370, 155, 370, 155, 0)
{
this->client = client;
}
void BrightnessWindow::create_objects()
{
- int x = 10, y = 10;
+ int x = 10, y = 10, x1 = x + 90;
+ int x2 = 0; int clrBtn_w = 50;
+
add_tool(new BC_Title(x, y, _("Brightness/Contrast")));
y += 25;
add_tool(new BC_Title(x, y,_("Brightness:")));
add_tool(brightness = new BrightnessSlider(client,
&(client->config.brightness),
- x + 80,
+ x1,
y,
1));
+ x2 = x1 + brightness->get_w() + 10;
+ add_subwindow(brightnessClr = new BrightnessSliderClr(client, this, x2, y, clrBtn_w, 1));
y += 25;
add_tool(new BC_Title(x, y, _("Contrast:")));
add_tool(contrast = new BrightnessSlider(client,
&(client->config.contrast),
- x + 80,
+ x1,
y,
0));
+
+ add_subwindow(contrastClr = new BrightnessSliderClr(client, this, x2, y, clrBtn_w, 0));
y += 30;
add_tool(luma = new BrightnessLuma(client,
x,
}
// for Reset button
-void BrightnessWindow::update()
+void BrightnessWindow::update_gui(int clear)
{
- brightness->update(client->config.brightness);
- contrast->update(client->config.contrast);
- luma->update(client->config.luma);
+ switch(clear) {
+ case RESET_CONTRAST : contrast->update(client->config.contrast);
+ break;
+ case RESET_BRIGHTNESS: brightness->update(client->config.brightness);
+ break;
+ case RESET_ALL :
+ default:
+ brightness->update(client->config.brightness);
+ contrast->update(client->config.contrast);
+ luma->update(client->config.luma);
+ break;
+ }
}
BrightnessSlider::BrightnessSlider(BrightnessMain *client,
}
int BrightnessReset::handle_event()
{
- client->config.reset();
- window->update();
+ client->config.reset(RESET_ALL); // clear=0 ==> reset all
+ window->update_gui(RESET_ALL);
+ client->send_configure_change();
+ return 1;
+}
+
+BrightnessSliderClr::BrightnessSliderClr(BrightnessMain *client, BrightnessWindow *window, int x, int y, int w, int is_brightness)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->client = client;
+ this->window = window;
+ this->is_brightness = is_brightness;
+}
+BrightnessSliderClr::~BrightnessSliderClr()
+{
+}
+int BrightnessSliderClr::handle_event()
+{
+ // is_brightness==0 means Contrast slider ==> "clear=1"
+ // is_brightness==1 means Brightness slider ==> "clear=2"
+ client->config.reset(is_brightness + 1);
+ window->update_gui(is_brightness + 1);
client->send_configure_change();
return 1;
}
#ifndef BRIGHTNESSWINDOW_H
#define BRIGHTNESSWINDOW_H
+#include "brightness.h"
+#include "guicast.h"
+#include "mutex.h"
+#include "pluginvclient.h"
+#include "thread.h"
+
+#define RESET_ALL 0
+#define RESET_CONTRAST 1
+#define RESET_BRIGHTNESS 2
class BrightnessThread;
class BrightnessWindow;
class BrightnessSlider;
class BrightnessLuma;
class BrightnessReset;
-
-#include "brightness.h"
-#include "guicast.h"
-#include "mutex.h"
-#include "pluginvclient.h"
-#include "thread.h"
+class BrightnessSliderClr;
class BrightnessWindow : public PluginClientWindow
public:
BrightnessWindow(BrightnessMain *client);
~BrightnessWindow();
- void update();
+ void update_gui(int clear);
void create_objects();
BrightnessMain *client;
BrightnessSlider *contrast;
BrightnessLuma *luma;
BrightnessReset *reset;
+ BrightnessSliderClr *brightnessClr;
+ BrightnessSliderClr *contrastClr;
};
class BrightnessSlider : public BC_FSlider
BrightnessWindow *window;
};
+class BrightnessSliderClr : public BC_GenericButton
+{
+public:
+ BrightnessSliderClr(BrightnessMain *client, BrightnessWindow *window, int x, int y, int w, int is_brightness);
+ ~BrightnessSliderClr();
+ int handle_event();
+ BrightnessMain *client;
+ BrightnessWindow *window;
+ int is_brightness;
+};
+
#endif
ColorBalanceConfig::ColorBalanceConfig()
{
- cyan = 0;
- magenta = 0;
- yellow = 0;
- lock_params = 0;
- preserve = 0;
+ reset(RESET_ALL);
+}
+
+void ColorBalanceConfig::reset(int clear)
+{
+ switch(clear) {
+ case RESET_CYAN : cyan = 0;
+ break;
+ case RESET_MAGENTA : magenta = 0;
+ break;
+ case RESET_YELLOW : yellow = 0;
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ cyan = 0;
+ magenta = 0;
+ yellow = 0;
+ lock_params = 0;
+ preserve = 0;
+ break;
+ }
}
int ColorBalanceConfig::equivalent(ColorBalanceConfig &that)
{
public:
ColorBalanceConfig();
+ void reset(int clear);
int equivalent(ColorBalanceConfig &that);
void copy_from(ColorBalanceConfig &that);
ColorBalanceWindow::ColorBalanceWindow(ColorBalanceMain *client)
- : PluginClientWindow(client,
- 330,
- 250,
- 330,
- 250,
- 0)
+ : PluginClientWindow(client, 400, 210, 400, 210, 0)
{
this->client = client;
}
void ColorBalanceWindow::create_objects()
{
int x = 10, y = 10;
+ int clrBtn_w = 50;
+ int x1 = 400 - clrBtn_w - 10; // (window_width - clrBtn_width - margin_rx)
+
add_tool(new BC_Title(x, y, _("Color Balance")));
y += 25;
add_tool(new BC_Title(x, y, _("Cyan")));
add_tool(cyan = new ColorBalanceSlider(client, &(client->config.cyan), x + 70, y));
- add_tool(new BC_Title(x + 270, y, _("Red")));
+ add_tool(new BC_Title(x + 280, y, _("Red")));
+ add_subwindow(cyanClr = new ColorBalanceSliderClr(client, this, x1, y, clrBtn_w, 1));
+
y += 25;
add_tool(new BC_Title(x, y, _("Magenta")));
add_tool(magenta = new ColorBalanceSlider(client, &(client->config.magenta), x + 70, y));
- add_tool(new BC_Title(x + 270, y, _("Green")));
+ add_tool(new BC_Title(x + 280, y, _("Green")));
+ add_subwindow(magentaClr = new ColorBalanceSliderClr(client, this, x1, y, clrBtn_w, 2));
+
y += 25;
add_tool(new BC_Title(x, y, _("Yellow")));
add_tool(yellow = new ColorBalanceSlider(client, &(client->config.yellow), x + 70, y));
- add_tool(new BC_Title(x + 270, y, _("Blue")));
+ add_tool(new BC_Title(x + 280, y, _("Blue")));
+ add_subwindow(yellowClr = new ColorBalanceSliderClr(client, this, x1, y, clrBtn_w, 3));
+
y += 25;
- add_tool(preserve = new ColorBalancePreserve(client, x + 70, y));
+ add_tool(preserve = new ColorBalancePreserve(client, x, y));
y += preserve->get_h() + 10;
- add_tool(lock_params = new ColorBalanceLock(client, x + 70, y));
- y += lock_params->get_h() + 10;
- add_tool(new ColorBalanceWhite(client, this, x, y));
- y += lock_params->get_h() + 10;
+ add_tool(lock_params = new ColorBalanceLock(client, x, y));
+
+ y += lock_params->get_h() + 15;
add_tool(new ColorBalanceReset(client, this, x, y));
+ add_tool(new ColorBalanceWhite(client, this, int(400 / 2), y));
show_window();
flush();
}
-void ColorBalanceWindow::update()
+void ColorBalanceWindow::update_gui(int clear)
{
- cyan->update((int64_t)client->config.cyan);
- magenta->update((int64_t)client->config.magenta);
- yellow->update((int64_t)client->config.yellow);
+ switch(clear) {
+ case RESET_CYAN : cyan->update((int64_t)client->config.cyan);
+ break;
+ case RESET_MAGENTA : magenta->update((int64_t)client->config.magenta);
+ break;
+ case RESET_YELLOW : yellow->update((int64_t)client->config.yellow);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ cyan->update((int64_t)client->config.cyan);
+ magenta->update((int64_t)client->config.magenta);
+ yellow->update((int64_t)client->config.yellow);
+ preserve->update(client->config.preserve);
+ lock_params->update(client->config.lock_params);
+ break;
+ }
}
plugin->config.cyan = plugin->calculate_slider(r_factor);
plugin->config.magenta = plugin->calculate_slider(g_factor);
plugin->config.yellow = plugin->calculate_slider(b_factor);
- gui->update();
+ gui->update_gui(RESET_DEFAULT_SETTINGS);
plugin->send_configure_change();
return 1;
int ColorBalanceReset::handle_event()
{
- plugin->config.cyan = 0;
- plugin->config.magenta = 0;
- plugin->config.yellow = 0;
- gui->update();
+ plugin->config.reset(RESET_ALL);
+ gui->update_gui(RESET_ALL);
plugin->send_configure_change();
return 1;
}
+ColorBalanceSliderClr::ColorBalanceSliderClr(ColorBalanceMain *plugin,
+ ColorBalanceWindow *gui, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+ this->clear = clear;
+}
+ColorBalanceSliderClr::~ColorBalanceSliderClr()
+{
+}
+int ColorBalanceSliderClr::handle_event()
+{
+ plugin->config.reset(clear);
+ gui->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
+
#ifndef COLORBALANCEWINDOW_H
#define COLORBALANCEWINDOW_H
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_CYAN 1
+#define RESET_MAGENTA 2
+#define RESET_YELLOW 3
class ColorBalanceThread;
class ColorBalanceWindow;
class ColorBalanceLock;
class ColorBalanceWhite;
class ColorBalanceReset;
+class ColorBalanceSliderClr;
#include "filexml.h"
#include "guicast.h"
~ColorBalanceWindow();
void create_objects();
- void update();
+ void update_gui(int clear);
ColorBalanceMain *client;
ColorBalanceSlider *cyan;
ColorBalanceSlider *magenta;
ColorBalanceSlider *yellow;
- ColorBalanceLock *lock_params;
- ColorBalancePreserve *preserve;
+ ColorBalanceLock *lock_params;
+ ColorBalancePreserve *preserve;
ColorBalanceWhite *use_eyedrop;
ColorBalanceReset *reset;
+ ColorBalanceSliderClr *cyanClr;
+ ColorBalanceSliderClr *magentaClr;
+ ColorBalanceSliderClr *yellowClr;
};
class ColorBalanceSlider : public BC_ISlider
ColorBalanceMain *client;
float *output;
- float old_value;
+ float old_value;
char string[BCTEXTLEN];
};
ColorBalanceWindow *gui;
};
+class ColorBalanceSliderClr : public BC_GenericButton
+{
+public:
+ ColorBalanceSliderClr(ColorBalanceMain *plugin, ColorBalanceWindow *gui, int x, int y, int w, int clear);
+ ~ColorBalanceSliderClr();
+ int handle_event();
+ ColorBalanceMain *plugin;
+ ColorBalanceWindow *gui;
+ int clear;
+};
+
#endif
HueConfig::HueConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void HueConfig::reset()
+void HueConfig::reset(int clear)
{
- hue = saturation = value = 0;
+ switch(clear) {
+ case RESET_HUV : hue = 0;
+ break;
+ case RESET_SAT : saturation = 0;
+ break;
+ case RESET_VAL : value = 0;
+ break;
+ case RESET_ALL :
+ default:
+ hue = saturation = value = 0;
+ break;
+ }
}
void HueConfig::copy_from(HueConfig &src)
}
int HueReset::handle_event()
{
- plugin->config.reset();
- gui->update();
+ plugin->config.reset(RESET_ALL); // clear=0 ==> reset all
+ gui->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+HueSliderClr::HueSliderClr(HueEffect *plugin, HueWindow *gui, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+ this->clear = clear;
+}
+HueSliderClr::~HueSliderClr()
+{
+}
+int HueSliderClr::handle_event()
+{
+ // clear==1 ==> Hue slider
+ // clear==2 ==> Saturation slider
+ // clear==3 ==> Value slider
+ plugin->config.reset(clear);
+ gui->update_gui(clear);
plugin->send_configure_change();
return 1;
}
HueWindow::HueWindow(HueEffect *plugin)
- : PluginClientWindow(plugin, 345, 145, 345, 145, 0)
+ : PluginClientWindow(plugin, 370, 140, 370, 140, 0)
{
this->plugin = plugin;
}
void HueWindow::create_objects()
{
int x = 10, y = 10, x1 = 100;
+ int x2 = 0; int clrBtn_w = 50;
+
add_subwindow(new BC_Title(x, y, _("Hue:")));
add_subwindow(hue = new HueSlider(plugin, x1, y, 200));
+ x2 = x1 + hue->get_w() + 10;
+ add_subwindow(hueClr = new HueSliderClr(plugin, this, x2, y, clrBtn_w, RESET_HUV));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Saturation:")));
add_subwindow(saturation = new SaturationSlider(plugin, x1, y, 200));
+ add_subwindow(satClr = new HueSliderClr(plugin, this, x2, y, clrBtn_w, RESET_SAT));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Value:")));
add_subwindow(value = new ValueSlider(plugin, x1, y, 200));
+ add_subwindow(valClr = new HueSliderClr(plugin, this, x2, y, clrBtn_w, RESET_VAL));
+
y += 40;
add_subwindow(reset = new HueReset(plugin, this, x, y));
show_window();
// for Reset button
-void HueWindow::update()
+void HueWindow::update_gui(int clear)
{
- hue->update(plugin->config.hue);
- saturation->update(plugin->config.saturation);
- value->update(plugin->config.value);
+ switch(clear) {
+ case RESET_HUV : hue->update(plugin->config.hue);
+ break;
+ case RESET_SAT : saturation->update(plugin->config.saturation);
+ break;
+ case RESET_VAL : value->update(plugin->config.value);
+ break;
+ case RESET_ALL :
+ default:
+ hue->update(plugin->config.hue);
+ saturation->update(plugin->config.saturation);
+ value->update(plugin->config.value);
+ break;
+ }
}
class HueEffect;
class HueWindow;
class HueReset;
+class HueSliderClr;
#define MINHUE -180
#define MAXHUE 180
#define MINVALUE -100
#define MAXVALUE 100
-
-
-
+#define RESET_ALL 0
+#define RESET_HUV 1
+#define RESET_SAT 2
+#define RESET_VAL 3
class HueConfig
void copy_from(HueConfig &src);
int equivalent(HueConfig &src);
- void reset();
+ void reset(int clear);
void interpolate(HueConfig &prev,
HueConfig &next,
long prev_frame,
HueWindow *gui;
};
+class HueSliderClr : public BC_GenericButton
+{
+public:
+ HueSliderClr(HueEffect *plugin, HueWindow *gui, int x, int y, int w, int clear);
+ ~HueSliderClr();
+ int handle_event();
+ HueEffect *plugin;
+ HueWindow *gui;
+ int clear;
+};
+
class HueWindow : public PluginClientWindow
{
public:
HueWindow(HueEffect *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
HueEffect *plugin;
HueSlider *hue;
SaturationSlider *saturation;
ValueSlider *value;
HueReset *reset;
+ HueSliderClr *hueClr;
+ HueSliderClr *satClr;
+ HueSliderClr *valClr;
};
LinearBlurConfig::LinearBlurConfig()
{
- reset();
-}
-
-void LinearBlurConfig::reset()
-{
- radius = 10;
- angle = 0;
- steps = 10;
- r = 1;
- g = 1;
- b = 1;
- a = 1;
+ reset(RESET_DEFAULT_SETTINGS);
+}
+
+void LinearBlurConfig::reset(int clear)
+{
+ switch(clear) {
+ case RESET_ALL :
+ radius = 0;
+ angle = 0;
+ steps = 1;
+ r = 1;
+ g = 1;
+ b = 1;
+ a = 1;
+ break;
+ case RESET_RADIUS : radius = 0;
+ break;
+ case RESET_ANGLE : angle = 0;
+ break;
+ case RESET_STEPS : steps = 1;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ radius = 10;
+ angle = 0;
+ steps = 10;
+ r = 1;
+ g = 1;
+ b = 1;
+ a = 1;
+ break;
+ }
}
int LinearBlurConfig::equivalent(LinearBlurConfig &that)
LinearBlurWindow::LinearBlurWindow(LinearBlurMain *plugin)
: PluginClientWindow(plugin,
- 230,
+ 280,
320,
- 230,
+ 280,
320,
0)
{
void LinearBlurWindow::create_objects()
{
int x = 10, y = 10;
+ int x1 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
add_subwindow(new BC_Title(x, y, _("Length:")));
y += 20;
add_subwindow(radius = new LinearBlurSize(plugin, x, y, &plugin->config.radius, 0, 100));
+ x1 = x + radius->get_w() + 10;
+ add_subwindow(radiusClr = new LinearBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_RADIUS));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Angle:")));
y += 20;
add_subwindow(angle = new LinearBlurSize(plugin, x, y, &plugin->config.angle, -180, 180));
+ add_subwindow(angleClr = new LinearBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ANGLE));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Steps:")));
y += 20;
add_subwindow(steps = new LinearBlurSize(plugin, x, y, &plugin->config.steps, 1, 200));
+ add_subwindow(stepsClr = new LinearBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_STEPS));
+
y += 30;
add_subwindow(r = new LinearBlurToggle(plugin, x, y, &plugin->config.r, _("Red")));
y += 30;
add_subwindow(a = new LinearBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha")));
y += 40;
add_subwindow(reset = new LinearBlurReset(plugin, this, x, y));
+ add_subwindow(default_settings = new LinearBlurDefaultSettings(plugin, this,
+ (280 - 10 - defaultBtn_w), y, defaultBtn_w));
show_window();
flush();
// for Reset button
-void LinearBlurWindow::update()
-{
- radius->update(plugin->config.radius);
- angle->update(plugin->config.angle);
- steps->update(plugin->config.steps);
- r->update(plugin->config.r);
- g->update(plugin->config.g);
- b->update(plugin->config.b);
- a->update(plugin->config.a);
+void LinearBlurWindow::update_gui(int clear)
+{
+ switch(clear) {
+ case RESET_RADIUS : radius->update(plugin->config.radius);
+ break;
+ case RESET_ANGLE : angle->update(plugin->config.angle);
+ break;
+ case RESET_STEPS : steps->update(plugin->config.steps);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ radius->update(plugin->config.radius);
+ angle->update(plugin->config.angle);
+ steps->update(plugin->config.steps);
+ r->update(plugin->config.r);
+ g->update(plugin->config.g);
+ b->update(plugin->config.b);
+ a->update(plugin->config.a);
+ break;
+ }
}
}
int LinearBlurReset::handle_event()
{
- plugin->config.reset();
- gui->update();
+ plugin->config.reset(RESET_ALL);
+ gui->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+LinearBlurDefaultSettings::LinearBlurDefaultSettings(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+LinearBlurDefaultSettings::~LinearBlurDefaultSettings()
+{
+}
+int LinearBlurDefaultSettings::handle_event()
+{
+ plugin->config.reset(RESET_DEFAULT_SETTINGS);
+ gui->update_gui(RESET_DEFAULT_SETTINGS);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+LinearBlurSliderClr::LinearBlurSliderClr(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+ this->clear = clear;
+}
+LinearBlurSliderClr::~LinearBlurSliderClr()
+{
+}
+int LinearBlurSliderClr::handle_event()
+{
+ // clear==1 ==> Radius slider
+ // clear==2 ==> Angle slider
+ // clear==3 ==> Steps slider
+ plugin->config.reset(clear);
+ gui->update_gui(clear);
plugin->send_configure_change();
return 1;
}
#include "pluginvclient.h"
#include "vframe.h"
-
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_RADIUS 1
+#define RESET_ANGLE 2
+#define RESET_STEPS 3
class LinearBlurMain;
class LinearBlurWindow;
class LinearBlurEngine;
class LinearBlurReset;
-
+class LinearBlurDefaultSettings;
+class LinearBlurSliderClr;
public:
LinearBlurConfig();
- void reset();
+ void reset(int clear);
int equivalent(LinearBlurConfig &that);
void copy_from(LinearBlurConfig &that);
void interpolate(LinearBlurConfig &prev,
LinearBlurWindow *gui;
};
+class LinearBlurDefaultSettings : public BC_GenericButton
+{
+public:
+ LinearBlurDefaultSettings(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y, int w);
+ ~LinearBlurDefaultSettings();
+ int handle_event();
+ LinearBlurMain *plugin;
+ LinearBlurWindow *gui;
+};
+
+class LinearBlurSliderClr : public BC_GenericButton
+{
+public:
+ LinearBlurSliderClr(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y, int w, int clear);
+ ~LinearBlurSliderClr();
+ int handle_event();
+ LinearBlurMain *plugin;
+ LinearBlurWindow *gui;
+ int clear;
+};
+
class LinearBlurWindow : public PluginClientWindow
{
public:
~LinearBlurWindow();
void create_objects();
- void update();
+ void update_gui(int clear);
LinearBlurSize *angle, *steps, *radius;
LinearBlurToggle *r, *g, *b, *a;
LinearBlurMain *plugin;
LinearBlurReset *reset;
+ LinearBlurDefaultSettings *default_settings;
+ LinearBlurSliderClr *radiusClr;
+ LinearBlurSliderClr *angleClr;
+ LinearBlurSliderClr *stepsClr;
};
{
int x = 10, y = 20;
int x0 = x, x1 = get_w()/2;
- add_subwindow(sample_steps = new Motion51SampleSteps(plugin, x0=x, y, 72));
+ add_subwindow(sample_steps = new Motion51SampleSteps(plugin, x0=x, y, 120));
BC_Title *title = new BC_Title(x0+=sample_steps->get_w()+10, y, _("Samples"));
add_subwindow(title);
sample_steps->create_objects();
#define WITHIN(a, b, c) ((((a) <= (b)) && ((b) <= (c))) ? 1 : 0)
+#define RESET_ALL 0
+#define RESET_DEPTH 1
+#define RESET_ANGLE 2
class PolarEffect;
class PolarEngine;
class PolarWindow;
class PolarReset;
+class PolarSliderClr;
class PolarConfig
public:
PolarConfig();
- void reset();
+ void reset(int clear);
void copy_from(PolarConfig &src);
int equivalent(PolarConfig &src);
void interpolate(PolarConfig &prev,
PolarWindow *window;
};
+class PolarSliderClr : public BC_GenericButton
+{
+public:
+ PolarSliderClr(PolarEffect *plugin, PolarWindow *window, int x, int y, int w, int clear);
+ ~PolarSliderClr();
+ int handle_event();
+ PolarEffect *plugin;
+ PolarWindow *window;
+ int clear;
+};
+
class PolarWindow : public PluginClientWindow
{
public:
PolarWindow(PolarEffect *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
PolarEffect *plugin;
PolarDepth *depth;
PolarAngle *angle;
PolarReset *reset;
+ PolarSliderClr *depthClr;
+ PolarSliderClr *angleClr;
};
PolarConfig::PolarConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void PolarConfig::reset()
+void PolarConfig::reset(int clear)
{
- angle = 1.0; // 0.0;
- depth = 1.0; // 0.0;
- backwards = 0;
- invert = 0;
- polar_to_rectangular = 1;
+ switch(clear) {
+ case RESET_DEPTH : depth = 1.0;
+ break;
+ case RESET_ANGLE : angle = 1.0;
+ break;
+ case RESET_ALL :
+ default:
+ angle = 1.0;
+ depth = 1.0;
+ backwards = 0;
+ invert = 0;
+ polar_to_rectangular = 1;
+ break;
+ }
}
void PolarConfig::copy_from(PolarConfig &src)
PolarWindow::PolarWindow(PolarEffect *plugin)
: PluginClientWindow(plugin,
- 270,
+ 330,
122,
- 270,
+ 330,
122,
0)
{
void PolarWindow::create_objects()
{
- int x = 10, y = 10;
+ int x = 10, y = 10, x1 = x + 50;
+ int x2 = 0; int clrBtn_w = 50;
+
add_subwindow(new BC_Title(x, y, _("Depth:")));
- add_subwindow(depth = new PolarDepth(plugin, x + 50, y));
+ add_subwindow(depth = new PolarDepth(plugin, x1, y));
+ x2 = x1 + depth->get_w() + 10;
+ add_subwindow(depthClr = new PolarSliderClr(plugin, this, x2, y, clrBtn_w, RESET_DEPTH));
+
y += 40;
add_subwindow(new BC_Title(x, y, _("Angle:")));
- add_subwindow(angle = new PolarAngle(plugin, x + 50, y));
+ add_subwindow(angle = new PolarAngle(plugin, x1, y));
+ add_subwindow(angleClr = new PolarSliderClr(plugin, this, x2, y, clrBtn_w, RESET_ANGLE));
y += 40;
add_subwindow(reset = new PolarReset(plugin, this, x, y));
}
// for Reset button
-void PolarWindow::update()
+void PolarWindow::update_gui(int clear)
{
- depth->update(plugin->config.depth);
- angle->update(plugin->config.angle);
+ switch(clear) {
+ case RESET_DEPTH : depth->update(plugin->config.depth);
+ break;
+ case RESET_ANGLE : angle->update(plugin->config.angle);
+ break;
+ case RESET_ALL :
+ default:
+ depth->update(plugin->config.depth);
+ angle->update(plugin->config.angle);
+ break;
+ }
}
}
int PolarReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+PolarSliderClr::PolarSliderClr(PolarEffect *plugin, PolarWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+PolarSliderClr::~PolarSliderClr()
+{
+}
+int PolarSliderClr::handle_event()
+{
+ // clear==1 ==> Depth slider
+ // clear==2 ==> Angle slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
plugin->send_configure_change();
return 1;
}
RadialBlurConfig::RadialBlurConfig()
{
- reset();
+ reset(RESET_DEFAULT_SETTINGS);
}
-void RadialBlurConfig::reset()
+void RadialBlurConfig::reset(int clear)
{
- x = 50;
- y = 50;
- steps = 10;
- angle = 33;
- r = 1;
- g = 1;
- b = 1;
- a = 1;
+ switch(clear) {
+ case RESET_ALL :
+ x = 50;
+ y = 50;
+ angle = 0;
+ steps = 1;
+ r = 1;
+ g = 1;
+ b = 1;
+ a = 1;
+ break;
+ case RESET_XSLIDER : x = 50;
+ break;
+ case RESET_YSLIDER : y = 50;
+ break;
+ case RESET_ANGLE : angle = 0;
+ break;
+ case RESET_STEPS : steps = 1;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ x = 50;
+ y = 50;
+ angle = 33;
+ steps = 10;
+ r = 1;
+ g = 1;
+ b = 1;
+ a = 1;
+ break;
+ }
}
int RadialBlurConfig::equivalent(RadialBlurConfig &that)
RadialBlurWindow::RadialBlurWindow(RadialBlurMain *plugin)
: PluginClientWindow(plugin,
- 230,
+ 280,
370,
- 230,
+ 280,
370,
0)
{
void RadialBlurWindow::create_objects()
{
int x = 10, y = 10;
+ int x1 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
add_subwindow(new BC_Title(x, y, _("X:")));
y += 20;
add_subwindow(this->x = new RadialBlurSize(plugin, x, y, &plugin->config.x, 0, 100));
+ x1 = x + this->x->get_w() + 10;
+ add_subwindow(xClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_XSLIDER));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Y:")));
y += 20;
add_subwindow(this->y = new RadialBlurSize(plugin, x, y, &plugin->config.y, 0, 100));
+ add_subwindow(yClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_YSLIDER));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Angle:")));
y += 20;
add_subwindow(angle = new RadialBlurSize(plugin, x, y, &plugin->config.angle, 0, 360));
+ add_subwindow(angleClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ANGLE));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Steps:")));
y += 20;
add_subwindow(steps = new RadialBlurSize(plugin, x, y, &plugin->config.steps, 1, 100));
+ add_subwindow(stepsClr = new RadialBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_STEPS));
+
y += 30;
add_subwindow(r = new RadialBlurToggle(plugin, x, y, &plugin->config.r, _("Red")));
y += 30;
add_subwindow(a = new RadialBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha")));
y += 40;
add_subwindow(reset = new RadialBlurReset(plugin, this, x, y));
+ add_subwindow(default_settings = new RadialBlurDefaultSettings(plugin, this,
+ (280 - 10 - defaultBtn_w), y, defaultBtn_w));
show_window();
flush();
}
// for Reset button
-void RadialBlurWindow::update()
+void RadialBlurWindow::update_gui(int clear)
{
- this->x->update(plugin->config.x);
- this->y->update(plugin->config.y);
- angle->update(plugin->config.angle);
- steps->update(plugin->config.steps);
- r->update(plugin->config.r);
- g->update(plugin->config.g);
- b->update(plugin->config.b);
- a->update(plugin->config.a);
+ switch(clear) {
+ case RESET_XSLIDER : this->x->update(plugin->config.x);
+ break;
+ case RESET_YSLIDER : this->y->update(plugin->config.y);
+ break;
+ case RESET_ANGLE : angle->update(plugin->config.angle);
+ break;
+ case RESET_STEPS : steps->update(plugin->config.steps);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ this->x->update(plugin->config.x);
+ this->y->update(plugin->config.y);
+ angle->update(plugin->config.angle);
+ steps->update(plugin->config.steps);
+ r->update(plugin->config.r);
+ g->update(plugin->config.g);
+ b->update(plugin->config.b);
+ a->update(plugin->config.a);
+ break;
+ }
}
}
int RadialBlurReset::handle_event()
{
- plugin->config.reset();
- gui->update();
+ plugin->config.reset(RESET_ALL);
+ gui->update_gui(RESET_ALL);
plugin->send_configure_change();
return 1;
}
+RadialBlurDefaultSettings::RadialBlurDefaultSettings(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+RadialBlurDefaultSettings::~RadialBlurDefaultSettings()
+{
+}
+int RadialBlurDefaultSettings::handle_event()
+{
+ plugin->config.reset(RESET_DEFAULT_SETTINGS);
+ gui->update_gui(RESET_DEFAULT_SETTINGS);
+ plugin->send_configure_change();
+ return 1;
+}
+
+RadialBlurSliderClr::RadialBlurSliderClr(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+ this->clear = clear;
+}
+RadialBlurSliderClr::~RadialBlurSliderClr()
+{
+}
+int RadialBlurSliderClr::handle_event()
+{
+ // clear==1 ==> X slider
+ // clear==2 ==> Y slider
+ // clear==3 ==> Angle slider
+ // clear==4 ==> Steps slider
+ plugin->config.reset(clear);
+ gui->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
#include "pluginvclient.h"
#include "vframe.h"
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_XSLIDER 1
+#define RESET_YSLIDER 2
+#define RESET_ANGLE 3
+#define RESET_STEPS 4
class RadialBlurMain;
class RadialBlurWindow;
class RadialBlurEngine;
class RadialBlurReset;
-
+class RadialBlurDefaultSettings;
+class RadialBlurSliderClr;
public:
RadialBlurConfig();
- void reset();
+ void reset(int clear);
int equivalent(RadialBlurConfig &that);
void copy_from(RadialBlurConfig &that);
void interpolate(RadialBlurConfig &prev,
RadialBlurWindow *gui;
};
+class RadialBlurDefaultSettings : public BC_GenericButton
+{
+public:
+ RadialBlurDefaultSettings(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y, int w);
+ ~RadialBlurDefaultSettings();
+ int handle_event();
+ RadialBlurMain *plugin;
+ RadialBlurWindow *gui;
+};
+
+class RadialBlurSliderClr : public BC_GenericButton
+{
+public:
+ RadialBlurSliderClr(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y, int w, int clear);
+ ~RadialBlurSliderClr();
+ int handle_event();
+ RadialBlurMain *plugin;
+ RadialBlurWindow *gui;
+ int clear;
+};
+
class RadialBlurWindow : public PluginClientWindow
{
public:
~RadialBlurWindow();
void create_objects();
- void update();
+ void update_gui(int clear);
RadialBlurSize *x, *y, *steps, *angle;
RadialBlurToggle *r, *g, *b, *a;
RadialBlurMain *plugin;
RadialBlurReset *reset;
+ RadialBlurDefaultSettings *default_settings;
+ RadialBlurSliderClr *xClr;
+ RadialBlurSliderClr *yClr;
+ RadialBlurSliderClr *angleClr;
+ RadialBlurSliderClr *stepsClr;
};
RGBShiftConfig::RGBShiftConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void RGBShiftConfig::reset()
+void RGBShiftConfig::reset(int clear)
{
- r_dx = r_dy = 0;
- g_dx = g_dy = 0;
- b_dx = b_dy = 0;
+ switch(clear) {
+ case RESET_R_DX : r_dx = 0;
+ break;
+ case RESET_R_DY : r_dy = 0;
+ break;
+ case RESET_G_DX : g_dx = 0;
+ break;
+ case RESET_G_DY : g_dy = 0;
+ break;
+ case RESET_B_DX : b_dx = 0;
+ break;
+ case RESET_B_DY : b_dy = 0;
+ break;
+ case RESET_ALL :
+ default:
+ r_dx = r_dy = 0;
+ g_dx = g_dy = 0;
+ b_dx = b_dy = 0;
+ break;
+ }
}
void RGBShiftConfig::copy_from(RGBShiftConfig &src)
}
int RGBShiftReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+RGBShiftSliderClr::RGBShiftSliderClr(RGBShiftEffect *plugin, RGBShiftWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+RGBShiftSliderClr::~RGBShiftSliderClr()
+{
+}
+int RGBShiftSliderClr::handle_event()
+{
+ // clear==1 ==> r_dx slider --- clear==2 ==> r_dy slider
+ // clear==3 ==> g_dx slider --- clear==4 ==> g_dy slider
+ // clear==5 ==> b_dx slider --- clear==6 ==> b_dy slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
plugin->send_configure_change();
return 1;
}
RGBShiftWindow::RGBShiftWindow(RGBShiftEffect *plugin)
- : PluginClientWindow(plugin, 300, 230, 300, 230, 0)
+ : PluginClientWindow(plugin, 320, 230, 320, 230, 0)
{
this->plugin = plugin;
}
void RGBShiftWindow::create_objects()
{
int x = 10, y = 10, x1 = 50;
+ int x2 = 0; int clrBtn_w = 50;
+
add_subwindow(new BC_Title(x, y, _("R_dx:")));
add_subwindow(r_dx = new RGBShiftLevel(plugin, &plugin->config.r_dx, x1, y));
+ x2 = x1 + r_dx->get_w() + 10;
+ add_subwindow(r_dxClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_R_DX));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("R_dy:")));
add_subwindow(r_dy = new RGBShiftLevel(plugin, &plugin->config.r_dy, x1, y));
+ add_subwindow(r_dyClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_R_DY));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("G_dx:")));
add_subwindow(g_dx = new RGBShiftLevel(plugin, &plugin->config.g_dx, x1, y));
+ add_subwindow(g_dxClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_G_DX));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("G_dy:")));
add_subwindow(g_dy = new RGBShiftLevel(plugin, &plugin->config.g_dy, x1, y));
+ add_subwindow(g_dyClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_G_DY));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("B_dx:")));
add_subwindow(b_dx = new RGBShiftLevel(plugin, &plugin->config.b_dx, x1, y));
+ add_subwindow(b_dxClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_B_DX));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("B_dy:")));
add_subwindow(b_dy = new RGBShiftLevel(plugin, &plugin->config.b_dy, x1, y));
+ add_subwindow(b_dyClr = new RGBShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_B_DY));
y += 40;
add_subwindow(reset = new RGBShiftReset(plugin, this, x, y));
// for Reset button
-void RGBShiftWindow::update()
+void RGBShiftWindow::update_gui(int clear)
{
- r_dx->update(plugin->config.r_dx);
- r_dy->update(plugin->config.r_dy);
- g_dx->update(plugin->config.g_dx);
- g_dy->update(plugin->config.g_dy);
- b_dx->update(plugin->config.b_dx);
- b_dy->update(plugin->config.b_dy);
+ switch(clear) {
+ case RESET_R_DX : r_dx->update(plugin->config.r_dx);
+ break;
+ case RESET_R_DY : r_dy->update(plugin->config.r_dy);
+ break;
+ case RESET_G_DX : g_dx->update(plugin->config.g_dx);
+ break;
+ case RESET_G_DY : g_dy->update(plugin->config.g_dy);
+ break;
+ case RESET_B_DX : b_dx->update(plugin->config.b_dx);
+ break;
+ case RESET_B_DY : b_dy->update(plugin->config.b_dy);
+ break;
+ case RESET_ALL :
+ default:
+ r_dx->update(plugin->config.r_dx);
+ r_dy->update(plugin->config.r_dy);
+ g_dx->update(plugin->config.g_dx);
+ g_dy->update(plugin->config.g_dy);
+ b_dx->update(plugin->config.b_dx);
+ b_dy->update(plugin->config.b_dy);
+ break;
+ }
}
#include <stdint.h>
#include <string.h>
+#define RESET_ALL 0
+#define RESET_R_DX 1
+#define RESET_R_DY 2
+#define RESET_G_DX 3
+#define RESET_G_DY 4
+#define RESET_B_DX 5
+#define RESET_B_DY 6
class RGBShiftEffect;
class RGBShiftWindow;
class RGBShiftReset;
+class RGBShiftSliderClr;
class RGBShiftConfig
public:
RGBShiftConfig();
- void reset();
+ void reset(int clear);
void copy_from(RGBShiftConfig &src);
int equivalent(RGBShiftConfig &src);
void interpolate(RGBShiftConfig &prev,
RGBShiftWindow *window;
};
+class RGBShiftSliderClr : public BC_GenericButton
+{
+public:
+ RGBShiftSliderClr(RGBShiftEffect *plugin, RGBShiftWindow *window, int x, int y, int w, int clear);
+ ~RGBShiftSliderClr();
+ int handle_event();
+ RGBShiftEffect *plugin;
+ RGBShiftWindow *window;
+ int clear;
+};
+
class RGBShiftWindow : public PluginClientWindow
{
public:
RGBShiftWindow(RGBShiftEffect *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
RGBShiftLevel *r_dx, *r_dy, *g_dx, *g_dy, *b_dx, *b_dy;
RGBShiftEffect *plugin;
RGBShiftReset *reset;
+ RGBShiftSliderClr *r_dxClr, *r_dyClr;
+ RGBShiftSliderClr *g_dxClr, *g_dyClr;
+ RGBShiftSliderClr *b_dxClr, *b_dyClr;
};
SharpenConfig::SharpenConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void SharpenConfig::reset()
+void SharpenConfig::reset(int clear)
{
- horizontal = 0;
- interlace = 0;
- sharpness = 50;
- luminance = 0;
+ switch(clear) {
+ case RESET_ALL :
+ sharpness = 0;
+ interlace = 0;
+ horizontal = 0;
+ luminance = 0;
+ break;
+ case RESET_SHARPEN_SLIDER : sharpness = 0;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ sharpness = 50;
+ interlace = 0;
+ horizontal = 0;
+ luminance = 0;
+ break;
+ }
}
void SharpenConfig::copy_from(SharpenConfig &that)
void copy_from(SharpenConfig &that);
int equivalent(SharpenConfig &that);
- void reset();
+ void reset(int clear);
void interpolate(SharpenConfig &prev,
SharpenConfig &next,
long prev_frame,
SharpenWindow::SharpenWindow(SharpenMain *client)
- : PluginClientWindow(client, 230, 195, 230, 195, 0) //195 was 150
+ : PluginClientWindow(client, 280, 190, 280, 190, 0) //195 was 150
{
this->client = client;
}
void SharpenWindow::create_objects()
{
int x = 10, y = 10;
+ int x1 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
+
add_tool(new BC_Title(x, y, _("Sharpness")));
y += 20;
add_tool(sharpen_slider = new SharpenSlider(client, &(client->config.sharpness), x, y));
+ x1 = x + sharpen_slider->get_w() + 10;
+ add_subwindow(sharpen_sliderClr = new SharpenSliderClr(client, this, x1, y, clrBtn_w));
+
y += 30;
add_tool(sharpen_interlace = new SharpenInterlace(client, x, y));
y += 30;
add_tool(sharpen_luminance = new SharpenLuminance(client, x, y));
y += 40;
add_tool(reset = new SharpenReset(client, this, x, y));
+ add_subwindow(default_settings = new SharpenDefaultSettings(client, this,
+ (280 - 10 - defaultBtn_w), y, defaultBtn_w));
+
show_window();
flush();
}
-void SharpenWindow::update()
+void SharpenWindow::update_gui(int clear)
{
- sharpen_slider->update(client->config.sharpness);
- sharpen_interlace->update(client->config.interlace);
- sharpen_horizontal->update(client->config.horizontal);
- sharpen_luminance->update(client->config.luminance);
+ switch(clear) {
+ case RESET_SHARPEN_SLIDER :
+ sharpen_slider->update(client->config.sharpness);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ sharpen_slider->update(client->config.sharpness);
+ sharpen_interlace->update(client->config.interlace);
+ sharpen_horizontal->update(client->config.horizontal);
+ sharpen_luminance->update(client->config.luminance);
+ break;
+ }
}
SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y)
}
int SharpenReset::handle_event()
{
- client->config.reset();
- gui->update();
+ client->config.reset(RESET_ALL);
+ gui->update_gui(RESET_ALL);
+ client->send_configure_change();
+ return 1;
+}
+
+
+SharpenDefaultSettings::SharpenDefaultSettings(SharpenMain *client, SharpenWindow *gui, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->client = client;
+ this->gui = gui;
+}
+SharpenDefaultSettings::~SharpenDefaultSettings()
+{
+}
+int SharpenDefaultSettings::handle_event()
+{
+ client->config.reset(RESET_DEFAULT_SETTINGS);
+ gui->update_gui(RESET_DEFAULT_SETTINGS);
+ client->send_configure_change();
+ return 1;
+}
+
+
+SharpenSliderClr::SharpenSliderClr(SharpenMain *client, SharpenWindow *gui, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->client = client;
+ this->gui = gui;
+}
+SharpenSliderClr::~SharpenSliderClr()
+{
+}
+int SharpenSliderClr::handle_event()
+{
+ client->config.reset(RESET_SHARPEN_SLIDER);
+ gui->update_gui(RESET_SHARPEN_SLIDER);
client->send_configure_change();
return 1;
}
#define SHARPENWINDOW_H
#include "guicast.h"
-
-class SharpenWindow;
-class SharpenInterlace;
-
#include "filexml.h"
#include "mutex.h"
#include "sharpen.h"
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_SHARPEN_SLIDER 1
-
-
-
-
+class SharpenWindow;
+class SharpenInterlace;
class SharpenSlider;
class SharpenHorizontal;
class SharpenLuminance;
class SharpenReset;
+class SharpenDefaultSettings;
+class SharpenSliderClr;
class SharpenWindow : public PluginClientWindow
{
~SharpenWindow();
void create_objects();
- void update();
+ void update_gui(int clear);
SharpenMain *client;
SharpenSlider *sharpen_slider;
SharpenHorizontal *sharpen_horizontal;
SharpenLuminance *sharpen_luminance;
SharpenReset *reset;
+ SharpenDefaultSettings *default_settings;
+ SharpenSliderClr *sharpen_sliderClr;
};
class SharpenSlider : public BC_ISlider
SharpenWindow *gui;
};
+class SharpenDefaultSettings : public BC_GenericButton
+{
+public:
+ SharpenDefaultSettings(SharpenMain *client, SharpenWindow *gui, int x, int y, int w);
+ ~SharpenDefaultSettings();
+ int handle_event();
+ SharpenMain *client;
+ SharpenWindow *gui;
+};
+
+class SharpenSliderClr : public BC_GenericButton
+{
+public:
+ SharpenSliderClr(SharpenMain *client, SharpenWindow *gui, int x, int y, int w);
+ ~SharpenSliderClr();
+ int handle_event();
+ SharpenMain *client;
+ SharpenWindow *gui;
+};
+
#endif
ShiftInterlaceConfig::ShiftInterlaceConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void ShiftInterlaceConfig::reset()
+void ShiftInterlaceConfig::reset(int clear)
{
- odd_offset = 0;
- even_offset = 0;
+ switch(clear) {
+ case RESET_ODD_OFFSET : odd_offset = 0;
+ break;
+ case RESET_EVEN_OFFSET : even_offset = 0;
+ break;
+ case RESET_ALL :
+ default:
+ odd_offset = 0;
+ even_offset = 0;
+ break;
+ }
}
ShiftInterlaceWindow::ShiftInterlaceWindow(ShiftInterlaceMain *plugin)
: PluginClientWindow(plugin,
- 310,
+ 370,
110,
- 310,
+ 370,
110,
0)
{
{
int x = 10, y = 10;
int margin = 30;
+ int x1 = 0; int clrBtn_w = 50;
add_subwindow(new BC_Title(x, y, _("Odd offset:")));
add_subwindow(odd_offset = new ShiftInterlaceOdd(plugin, x + 90, y));
+ x1 = x + 90 + odd_offset->get_w() + 10;
+ add_subwindow(odd_offsetClr = new ShiftInterlaceSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ODD_OFFSET));
+
y += margin;
add_subwindow(new BC_Title(x, y, _("Even offset:")));
add_subwindow(even_offset = new ShiftInterlaceEven(plugin, x + 90, y));
+ add_subwindow(even_offsetClr = new ShiftInterlaceSliderClr(plugin, this, x1, y, clrBtn_w, RESET_EVEN_OFFSET));
+
y += 40;
add_subwindow(reset = new ShiftInterlaceReset(plugin, this, x, y));
show_window();
}
// for Reset button
-void ShiftInterlaceWindow::update()
+void ShiftInterlaceWindow::update_gui(int clear)
{
- odd_offset->update(plugin->config.odd_offset);
- even_offset->update(plugin->config.even_offset);
+ switch(clear) {
+ case RESET_ODD_OFFSET : odd_offset->update(plugin->config.odd_offset);
+ break;
+ case RESET_EVEN_OFFSET : even_offset->update(plugin->config.even_offset);
+ break;
+ case RESET_ALL :
+ default:
+ odd_offset->update(plugin->config.odd_offset);
+ even_offset->update(plugin->config.even_offset);
+ break;
+ }
}
}
int ShiftInterlaceReset::handle_event()
{
- plugin->config.reset();
- gui->update();
+ plugin->config.reset(RESET_ALL);
+ gui->update_gui(RESET_ALL);
plugin->send_configure_change();
return 1;
}
+ShiftInterlaceSliderClr::ShiftInterlaceSliderClr(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+ this->clear = clear;
+}
+ShiftInterlaceSliderClr::~ShiftInterlaceSliderClr()
+{
+}
+int ShiftInterlaceSliderClr::handle_event()
+{
+ // clear==1 ==> Odd slider
+ // clear==2 ==> Even slider
+ plugin->config.reset(clear);
+ gui->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
+
#include <string.h>
-
-
-
+#define RESET_ALL 0
+#define RESET_ODD_OFFSET 1
+#define RESET_EVEN_OFFSET 2
class ShiftInterlaceWindow;
public:
ShiftInterlaceConfig();
- void reset();
+ void reset(int clear);
int equivalent(ShiftInterlaceConfig &that);
void copy_from(ShiftInterlaceConfig &that);
void interpolate(ShiftInterlaceConfig &prev,
ShiftInterlaceWindow *gui;
};
+class ShiftInterlaceSliderClr : public BC_GenericButton
+{
+public:
+ ShiftInterlaceSliderClr(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y, int w, int clear);
+ ~ShiftInterlaceSliderClr();
+ int handle_event();
+ ShiftInterlaceMain *plugin;
+ ShiftInterlaceWindow *gui;
+ int clear;
+};
+
class ShiftInterlaceWindow : public PluginClientWindow
{
public:
ShiftInterlaceWindow(ShiftInterlaceMain *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
ShiftInterlaceOdd *odd_offset;
ShiftInterlaceEven *even_offset;
ShiftInterlaceMain *plugin;
ShiftInterlaceReset *reset;
+ ShiftInterlaceSliderClr *odd_offsetClr, *even_offsetClr;
};
}
SketcherCurvePen::SketcherCurvePen(SketcherWindow *gui, int x, int y, int pen)
- : BC_PopupMenu(x,y,72,_(cv_pen[pen]))
+ : BC_PopupMenu(x,y,100,_(cv_pen[pen]))
{
this->gui = gui;
this->pen = pen;
"Shift=\n"
"None=\n"
"Ctrl=\n"
- "Alt=\n"
+ "Ctrl+Alt=\n"
"Ctrl+Shift="))); dy = bmax(dy, notes0->get_h());
add_subwindow(notes1 = new BC_Title(x+100, y,
_(" LMB\n"
point_list->update(pi);
break;
}
- if( (state & AltMask) ) { // create new curve
+ if( (state & ControlMask) && (state & AltMask) ) { // create new curve
ci = plugin->new_curve(cv->pen, cv->width, curve_color->color);
curve_list->update(ci);
point_list->update(-1);
return 1;
}
if( (state & Button1Mask) ) {
- if( (state & ControlMask) ) { // drag selected point
+ if( (state & ControlMask) && !(state & AltMask) ) { // drag selected point
SketcherPoint *pt = pi >= 0 && pi < points.size() ? points[pi] : 0;
if( pt ) {
point_list->set_point(pi, PT_X, pt->x = output_x);
}
return 1;
}
- if( (state & AltMask) ) { // drag all curves
+ if( (state & ControlMask) && (state & AltMask) ) { // drag all curves
int dx = round(output_x - last_x);
int dy = round(output_y - last_y);
for( int i=0; i<curves.size(); ++i ) {
}
SketcherPointType::SketcherPointType(SketcherWindow *gui, int x, int y, int arc)
- : BC_PopupMenu(x,y,64,_(pt_type[arc]))
+ : BC_PopupMenu(x,y,100,_(pt_type[arc]))
{
this->gui = gui;
this->type = arc;
UnsharpConfig::UnsharpConfig()
{
- reset();
+ reset(RESET_DEFAULT_SETTINGS);
}
-void UnsharpConfig::reset()
+void UnsharpConfig::reset(int clear)
{
- radius = 5;
- amount = 0.5;
- threshold = 0;
+ switch(clear) {
+ case RESET_ALL :
+ radius = 0.1;
+ amount = 0.0;
+ threshold = 0;
+ break;
+ case RESET_RADIUS : radius = 0.1;
+ break;
+ case RESET_AMOUNT : amount = 0.0;
+ break;
+ case RESET_THRESHOLD : threshold = 0;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ radius = 5;
+ amount = 0.5;
+ threshold = 0;
+ break;
+ }
}
int UnsharpConfig::equivalent(UnsharpConfig &that)
if(load_configuration())
{
thread->window->lock_window("UnsharpMain::update_gui");
- ((UnsharpWindow*)thread->window)->update();
+ ((UnsharpWindow*)thread->window)->update_gui(RESET_DEFAULT_SETTINGS);
thread->window->unlock_window();
}
}
{
public:
UnsharpConfig();
- void reset();
+ void reset(int clear);
int equivalent(UnsharpConfig &that);
void copy_from(UnsharpConfig &that);
void UnsharpWindow::create_objects()
{
int x = 10, y = 10, x1 = 90;
+ int x2 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
BC_Title *title;
add_subwindow(title = new BC_Title(x, y + 10, _("Radius:")));
add_subwindow(radius = new UnsharpRadius(plugin, x + x1, y));
+ x2 = 285 - 10 - clrBtn_w;
+ add_subwindow(radiusClr = new UnsharpSliderClr(plugin, this, x2, y + 10, clrBtn_w, RESET_RADIUS));
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Amount:")));
add_subwindow(amount = new UnsharpAmount(plugin, x + x1, y));
+ add_subwindow(amountClr = new UnsharpSliderClr(plugin, this, x2, y + 10, clrBtn_w, RESET_AMOUNT));
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:")));
add_subwindow(threshold = new UnsharpThreshold(plugin, x + x1, y));
+ add_subwindow(thresholdClr = new UnsharpSliderClr(plugin, this, x2, y + 10, clrBtn_w, RESET_THRESHOLD));
y += 50;
add_subwindow(reset = new UnsharpReset(plugin, this, x, y));
+ add_subwindow(default_settings = new UnsharpDefaultSettings(plugin, this,
+ (285 - 10 - defaultBtn_w), y, defaultBtn_w));
show_window();
flush();
}
-void UnsharpWindow::update()
+void UnsharpWindow::update_gui(int clear)
{
- radius->update(plugin->config.radius);
- amount->update(plugin->config.amount);
- threshold->update(plugin->config.threshold);
+ switch(clear) {
+ case RESET_RADIUS : radius->update(plugin->config.radius);
+ break;
+ case RESET_AMOUNT : amount->update(plugin->config.amount);
+ break;
+ case RESET_THRESHOLD : threshold->update(plugin->config.threshold);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ radius->update(plugin->config.radius);
+ amount->update(plugin->config.amount);
+ threshold->update(plugin->config.threshold);
+ break;
+ }
}
}
int UnsharpReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
plugin->send_configure_change();
return 1;
}
+UnsharpDefaultSettings::UnsharpDefaultSettings(UnsharpMain *plugin, UnsharpWindow *window, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+UnsharpDefaultSettings::~UnsharpDefaultSettings()
+{
+}
+int UnsharpDefaultSettings::handle_event()
+{
+ plugin->config.reset(RESET_DEFAULT_SETTINGS);
+ window->update_gui(RESET_DEFAULT_SETTINGS);
+ plugin->send_configure_change();
+ return 1;
+}
+UnsharpSliderClr::UnsharpSliderClr(UnsharpMain *plugin, UnsharpWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+UnsharpSliderClr::~UnsharpSliderClr()
+{
+}
+int UnsharpSliderClr::handle_event()
+{
+ // clear==1 ==> Radius slider
+ // clear==2 ==> Amount slider
+ // clear==3 ==> Threshold slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
#include "unsharp.inc"
#include "unsharpwindow.inc"
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_RADIUS 1
+#define RESET_AMOUNT 2
+#define RESET_THRESHOLD 3
+
+
class UnsharpRadius : public BC_FPot
{
public:
UnsharpWindow *window;
};
+class UnsharpDefaultSettings : public BC_GenericButton
+{
+public:
+ UnsharpDefaultSettings(UnsharpMain *plugin, UnsharpWindow *window, int x, int y, int w);
+ ~UnsharpDefaultSettings();
+ int handle_event();
+ UnsharpMain *plugin;
+ UnsharpWindow *window;
+};
+
+class UnsharpSliderClr : public BC_GenericButton
+{
+public:
+ UnsharpSliderClr(UnsharpMain *plugin, UnsharpWindow *window, int x, int y, int w, int clear);
+ ~UnsharpSliderClr();
+ int handle_event();
+ UnsharpMain *plugin;
+ UnsharpWindow *window;
+ int clear;
+};
+
class UnsharpWindow : public PluginClientWindow
{
public:
~UnsharpWindow();
void create_objects();
- void update();
+ void update_gui(int clear);
UnsharpRadius *radius;
UnsharpAmount *amount;
UnsharpThreshold *threshold;
UnsharpMain *plugin;
UnsharpReset *reset;
+ UnsharpDefaultSettings *default_settings;
+ UnsharpSliderClr *radiusClr;
+ UnsharpSliderClr *amountClr;
+ UnsharpSliderClr *thresholdClr;
};
WaveConfig::WaveConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void WaveConfig::reset()
+void WaveConfig::reset(int clear)
{
- mode = SMEAR;
- reflective = 0;
- amplitude = 10;
- phase = 0;
- wavelength = 10;
+ switch(clear) {
+ case RESET_ALL :
+ mode = SMEAR;
+ reflective = 0;
+ amplitude = 0;
+ phase = 0;
+ wavelength = 0;
+ break;
+ case RESET_AMPLITUDE : amplitude = 0;
+ break;
+ case RESET_PHASE : phase = 0;
+ break;
+ case RESET_WAVELENGTH : wavelength = 0;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ mode = SMEAR;
+ reflective = 0;
+ amplitude = 10;
+ phase = 0;
+ wavelength = 10;
+ break;
+ }
}
void WaveConfig::copy_from(WaveConfig &src)
}
int WaveReset::handle_event()
{
- plugin->config.reset();
- gui->update();
+ plugin->config.reset(RESET_ALL);
+ gui->update_gui(RESET_ALL);
plugin->send_configure_change();
return 1;
}
+WaveDefaultSettings::WaveDefaultSettings(WaveEffect *plugin, WaveWindow *gui, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+WaveDefaultSettings::~WaveDefaultSettings()
+{
+}
+int WaveDefaultSettings::handle_event()
+{
+ plugin->config.reset(RESET_DEFAULT_SETTINGS);
+ gui->update_gui(RESET_DEFAULT_SETTINGS);
+ plugin->send_configure_change();
+ return 1;
+}
-
+WaveSliderClr::WaveSliderClr(WaveEffect *plugin, WaveWindow *gui, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+ this->clear = clear;
+}
+WaveSliderClr::~WaveSliderClr()
+{
+}
+int WaveSliderClr::handle_event()
+{
+ // clear==1 ==> Amplitude slider
+ // clear==2 ==> Phase slider
+ // clear==3 ==> Steps slider
+ plugin->config.reset(clear);
+ gui->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
WaveWindow::WaveWindow(WaveEffect *plugin)
- : PluginClientWindow(plugin, 335, 140, 335, 140, 0)
+ : PluginClientWindow(plugin, 385, 140, 385, 140, 0)
{
this->plugin = plugin;
}
void WaveWindow::create_objects()
{
int x = 10, y = 10, x1 = 115;
+ int x2 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
// add_subwindow(new BC_Title(x, y, _("Mode:")));
// add_subwindow(smear = new WaveSmear(plugin, this, x1, y));
// y += 30;
add_subwindow(new BC_Title(x, y, _("Amplitude:")));
add_subwindow(amplitude = new WaveAmplitude(plugin, x1, y));
+ x2 = x1 + amplitude->get_w() + 10;
+ add_subwindow(amplitudeClr = new WaveSliderClr(plugin, this, x2, y, clrBtn_w, RESET_AMPLITUDE));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Phase:")));
add_subwindow(phase = new WavePhase(plugin, x1, y));
+ add_subwindow(phaseClr = new WaveSliderClr(plugin, this, x2, y, clrBtn_w, RESET_PHASE));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Wavelength:")));
add_subwindow(wavelength = new WaveLength(plugin, x1, y));
+ add_subwindow(wavelengthClr = new WaveSliderClr(plugin, this, x2, y, clrBtn_w, RESET_WAVELENGTH));
+
y += 40;
add_subwindow(reset = new WaveReset(plugin, this, x, y));
+ add_subwindow(default_settings = new WaveDefaultSettings(plugin, this,
+ (385 - 10 - defaultBtn_w), y, defaultBtn_w));
show_window();
flush();
}
// for Reset button
-void WaveWindow::update()
+void WaveWindow::update_gui(int clear)
{
- amplitude->update(plugin->config.amplitude);
- phase->update(plugin->config.phase);
- wavelength->update(plugin->config.wavelength);
+ switch(clear) {
+ case RESET_AMPLITUDE : amplitude->update(plugin->config.amplitude);
+ break;
+ case RESET_PHASE : phase->update(plugin->config.phase);
+ break;
+ case RESET_WAVELENGTH : wavelength->update(plugin->config.wavelength);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ amplitude->update(plugin->config.amplitude);
+ phase->update(plugin->config.phase);
+ wavelength->update(plugin->config.wavelength);
+ break;
+ }
}
#define SMEAR 0
#define BLACKEN 1
-
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_AMPLITUDE 1
+#define RESET_PHASE 2
+#define RESET_WAVELENGTH 3
class WaveEffect;
class WaveWindow;
class WaveReset;
+class WaveDefaultSettings;
+class WaveSliderClr;
class WaveConfig
{
public:
WaveConfig();
- void reset();
+ void reset(int clear);
void copy_from(WaveConfig &src);
int equivalent(WaveConfig &src);
void interpolate(WaveConfig &prev,
WaveWindow *gui;
};
+class WaveDefaultSettings : public BC_GenericButton
+{
+public:
+ WaveDefaultSettings(WaveEffect *plugin, WaveWindow *gui, int x, int y, int w);
+ ~WaveDefaultSettings();
+ int handle_event();
+ WaveEffect *plugin;
+ WaveWindow *gui;
+};
+class WaveSliderClr : public BC_GenericButton
+{
+public:
+ WaveSliderClr(WaveEffect *plugin, WaveWindow *gui, int x, int y, int w, int clear);
+ ~WaveSliderClr();
+ int handle_event();
+ WaveEffect *plugin;
+ WaveWindow *gui;
+ int clear;
+};
~WaveWindow();
void create_objects();
void update_mode();
- void update();
+ void update_gui(int clear);
WaveEffect *plugin;
// WaveSmear *smear;
WavePhase *phase;
WaveLength *wavelength;
WaveReset *reset;
+ WaveDefaultSettings *default_settings;
+ WaveSliderClr *amplitudeClr;
+ WaveSliderClr *phaseClr;
+ WaveSliderClr *wavelengthClr;
};
class WhirlWindow;
class WhirlEngine;
class WhirlReset;
+class WhirlDefaultSettings;
+class WhirlSliderClr;
#define MAXRADIUS 100
#define MAXPINCH 100
-
-
-
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_RADIUS 1
+#define RESET_PINCH 2
+#define RESET_ANGLE 3
class WhirlConfig
{
public:
WhirlConfig();
- void reset();
+ void reset(int clear);
void copy_from(WhirlConfig &src);
int equivalent(WhirlConfig &src);
WhirlWindow *window;
};
+class WhirlDefaultSettings : public BC_GenericButton
+{
+public:
+ WhirlDefaultSettings(WhirlEffect *plugin, WhirlWindow *window, int x, int y, int w);
+ ~WhirlDefaultSettings();
+ int handle_event();
+ WhirlEffect *plugin;
+ WhirlWindow *window;
+};
+
+class WhirlSliderClr : public BC_GenericButton
+{
+public:
+ WhirlSliderClr(WhirlEffect *plugin, WhirlWindow *window, int x, int y, int w, int clear);
+ ~WhirlSliderClr();
+ int handle_event();
+ WhirlEffect *plugin;
+ WhirlWindow *window;
+ int clear;
+};
+
+
class WhirlWindow : public PluginClientWindow
{
public:
WhirlWindow(WhirlEffect *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
WhirlEffect *plugin;
WhirlRadius *radius;
WhirlPinch *pinch;
WhirlAngle *angle;
WhirlReset *reset;
+ WhirlDefaultSettings *default_settings;
+ WhirlSliderClr *radiusClr, *pinchClr, *angleClr;
};
WhirlConfig::WhirlConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void WhirlConfig::reset()
+void WhirlConfig::reset(int clear)
{
- angle = 180.0; // 0.0;
- pinch = 10.0; // 0.0;
- radius = 50.0; // 0.0;
+ switch(clear) {
+ case RESET_ALL :
+ radius = 0.0;
+ pinch = 0.0;
+ angle = 0.0;
+ break;
+ case RESET_RADIUS : radius = 0.0;
+ break;
+ case RESET_PINCH : pinch = 0.0;
+ break;
+ case RESET_ANGLE : angle = 0.0;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ radius = 50.0;
+ pinch = 10.0;
+ angle = 180.0;
+ break;
+ }
}
void WhirlConfig::copy_from(WhirlConfig &src)
WhirlWindow::WhirlWindow(WhirlEffect *plugin)
- : PluginClientWindow(plugin,
- 220,
- 195,
- 220,
- 195,
- 0)
+ : PluginClientWindow(plugin, 280, 195, 280, 195, 0)
{
this->plugin = plugin;
}
void WhirlWindow::create_objects()
{
int x = 10, y = 10;
+ int x1 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
+
add_subwindow(new BC_Title(x, y, _("Radius")));
y += 20;
add_subwindow(radius = new WhirlRadius(plugin, x, y));
+ x1 = x + radius->get_w() + 10;
+ add_subwindow(radiusClr = new WhirlSliderClr(plugin, this, x1, y, clrBtn_w, RESET_RADIUS));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Pinch")));
y += 20;
add_subwindow(pinch = new WhirlPinch(plugin, x, y));
+ add_subwindow(pinchClr = new WhirlSliderClr(plugin, this, x1, y, clrBtn_w, RESET_PINCH));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Angle")));
y += 20;
add_subwindow(angle = new WhirlAngle(plugin, x, y));
+ add_subwindow(angleClr = new WhirlSliderClr(plugin, this, x1, y, clrBtn_w, RESET_ANGLE));
+
y += 35;
add_subwindow(reset = new WhirlReset(plugin, this, x, y));
+ add_subwindow(default_settings = new WhirlDefaultSettings(plugin, this,
+ (280 - 10 - defaultBtn_w), y, defaultBtn_w));
show_window();
flush();
// for Reset button
-void WhirlWindow::update()
+void WhirlWindow::update_gui(int clear)
{
- radius->update(plugin->config.radius);
- pinch->update(plugin->config.pinch);
- angle->update(plugin->config.angle);
+ switch(clear) {
+ case RESET_RADIUS : radius->update(plugin->config.radius);
+ break;
+ case RESET_PINCH : pinch->update(plugin->config.pinch);
+ break;
+ case RESET_ANGLE : angle->update(plugin->config.angle);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ radius->update(plugin->config.radius);
+ pinch->update(plugin->config.pinch);
+ angle->update(plugin->config.angle);
+ break;
+ }
}
}
int WhirlReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
plugin->send_configure_change();
return 1;
}
+WhirlDefaultSettings::WhirlDefaultSettings(WhirlEffect *plugin, WhirlWindow *window, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+WhirlDefaultSettings::~WhirlDefaultSettings()
+{
+}
+int WhirlDefaultSettings::handle_event()
+{
+ plugin->config.reset(RESET_DEFAULT_SETTINGS);
+ window->update_gui(RESET_DEFAULT_SETTINGS);
+ plugin->send_configure_change();
+ return 1;
+}
-
-
+WhirlSliderClr::WhirlSliderClr(WhirlEffect *plugin, WhirlWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+WhirlSliderClr::~WhirlSliderClr()
+{
+}
+int WhirlSliderClr::handle_event()
+{
+ // clear==1 ==> Radius slider
+ // clear==2 ==> Pinch slider
+ // clear==3 ==> Angle slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
#include <stdint.h>
#include <string.h>
+#define RESET_ALL 0
+#define RESET_Y_SLIDER 1
+#define RESET_U_SLIDER 2
+#define RESET_V_SLIDER 3
class YUVEffect;
class YUVWindow;
class YUVReset;
+class YUVSliderClr;
class YUVConfig
{
public:
YUVConfig();
- void reset();
+ void reset(int clear);
void copy_from(YUVConfig &src);
int equivalent(YUVConfig &src);
YUVWindow *window;
};
+class YUVSliderClr : public BC_GenericButton
+{
+public:
+ YUVSliderClr(YUVEffect *plugin, YUVWindow *window, int x, int y, int w, int clear);
+ ~YUVSliderClr();
+ int handle_event();
+ YUVEffect *plugin;
+ YUVWindow *window;
+ int clear;
+};
+
class YUVWindow : public PluginClientWindow
{
public:
YUVWindow(YUVEffect *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
YUVLevel *y, *u, *v;
YUVEffect *plugin;
YUVReset *reset;
+ YUVSliderClr *yClr, *uClr, *vClr;
};
YUVConfig::YUVConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void YUVConfig::reset()
+void YUVConfig::reset(int clear)
{
- y = 0;
- u = 0;
- v = 0;
+ switch(clear) {
+ case RESET_Y_SLIDER : y = 0;
+ break;
+ case RESET_U_SLIDER : u = 0;
+ break;
+ case RESET_V_SLIDER : v = 0;
+ break;
+ case RESET_ALL :
+ default:
+ y = u = v = 0;
+ break;
+ }
}
void YUVConfig::copy_from(YUVConfig &src)
}
int YUVReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+YUVSliderClr::YUVSliderClr(YUVEffect *plugin, YUVWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+YUVSliderClr::~YUVSliderClr()
+{
+}
+int YUVSliderClr::handle_event()
+{
+ // clear==1 ==> Y slider
+ // clear==2 ==> U slider
+ // clear==3 ==> V slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
plugin->send_configure_change();
return 1;
}
YUVWindow::YUVWindow(YUVEffect *plugin)
- : PluginClientWindow(plugin,
- 260,
- 135,
- 260,
- 135,
- 0)
+ : PluginClientWindow(plugin, 310, 135, 310, 135, 0)
{
this->plugin = plugin;
}
void YUVWindow::create_objects()
{
int x = 10, y = 10, x1 = 40;
+ int x2 = 0; int clrBtn_w = 50;
+
add_subwindow(new BC_Title(x, y, _("Y:")));
add_subwindow(this->y = new YUVLevel(plugin, &plugin->config.y, x1, y));
+ x2 = x1 + this->y->get_w() + 10;
+ add_subwindow(yClr = new YUVSliderClr(plugin, this, x2, y, clrBtn_w, RESET_Y_SLIDER));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("U:")));
add_subwindow(u = new YUVLevel(plugin, &plugin->config.u, x1, y));
+ add_subwindow(uClr = new YUVSliderClr(plugin, this, x2, y, clrBtn_w, RESET_U_SLIDER));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("V:")));
add_subwindow(v = new YUVLevel(plugin, &plugin->config.v, x1, y));
+ add_subwindow(vClr = new YUVSliderClr(plugin, this, x2, y, clrBtn_w, RESET_V_SLIDER));
+
y += 35;
add_subwindow(reset = new YUVReset(plugin, this, x, y));
// for Reset button
-void YUVWindow::update()
+void YUVWindow::update_gui(int clear)
{
- this->y->update(plugin->config.y);
- u->update(plugin->config.u);
- v->update(plugin->config.v);
+ switch(clear) {
+ case RESET_Y_SLIDER : this->y->update(plugin->config.y);
+ break;
+ case RESET_U_SLIDER : u->update(plugin->config.u);
+ break;
+ case RESET_V_SLIDER : v->update(plugin->config.v);
+ break;
+ case RESET_ALL :
+ default:
+ this->y->update(plugin->config.y);
+ u->update(plugin->config.u);
+ v->update(plugin->config.v);
+ break;
+ }
}
YUVShiftConfig::YUVShiftConfig()
{
- reset();
+ reset(RESET_ALL);
}
-void YUVShiftConfig::reset()
+void YUVShiftConfig::reset(int clear)
{
- y_dx = y_dy = 0;
- u_dx = u_dy = 0;
- v_dx = v_dy = 0;
+ switch(clear) {
+ case RESET_Y_DX : y_dx = 0;
+ break;
+ case RESET_Y_DY : y_dy = 0;
+ break;
+ case RESET_U_DX : u_dx = 0;
+ break;
+ case RESET_U_DY : u_dy = 0;
+ break;
+ case RESET_V_DX : v_dx = 0;
+ break;
+ case RESET_V_DY : v_dy = 0;
+ break;
+ case RESET_ALL :
+ default:
+ y_dx = y_dy = 0;
+ u_dx = u_dy = 0;
+ v_dx = v_dy = 0;
+ break;
+ }
}
void YUVShiftConfig::copy_from(YUVShiftConfig &src)
}
int YUVShiftReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+YUVShiftSliderClr::YUVShiftSliderClr(YUVShiftEffect *plugin, YUVShiftWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+YUVShiftSliderClr::~YUVShiftSliderClr()
+{
+}
+int YUVShiftSliderClr::handle_event()
+{
+ // clear==1 ==> y_dx slider --- clear==2 ==> y_dy slider
+ // clear==3 ==> u_dx slider --- clear==4 ==> u_dy slider
+ // clear==5 ==> v_dx slider --- clear==6 ==> v_dy slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
plugin->send_configure_change();
return 1;
}
YUVShiftWindow::YUVShiftWindow(YUVShiftEffect *plugin)
- : PluginClientWindow(plugin, 300, 230, 300, 230, 0)
+ : PluginClientWindow(plugin, 320, 230, 320, 230, 0)
{
this->plugin = plugin;
}
void YUVShiftWindow::create_objects()
{
int x = 10, y = 10, x1 = 50;
+ int x2 = 0; int clrBtn_w = 50;
+
add_subwindow(new BC_Title(x, y, _("Y_dx:")));
add_subwindow(y_dx = new YUVShiftLevel(plugin, &plugin->config.y_dx, x1, y));
+ x2 = x1 + y_dx->get_w() + 10;
+ add_subwindow(y_dxClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_Y_DX));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Y_dy:")));
add_subwindow(y_dy = new YUVShiftLevel(plugin, &plugin->config.y_dy, x1, y));
+ add_subwindow(y_dyClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_Y_DY));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("U_dx:")));
add_subwindow(u_dx = new YUVShiftLevel(plugin, &plugin->config.u_dx, x1, y));
+ add_subwindow(u_dxClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_U_DX));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("U_dy:")));
add_subwindow(u_dy = new YUVShiftLevel(plugin, &plugin->config.u_dy, x1, y));
+ add_subwindow(u_dyClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_U_DY));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("V_dx:")));
add_subwindow(v_dx = new YUVShiftLevel(plugin, &plugin->config.v_dx, x1, y));
+ add_subwindow(v_dxClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_V_DX));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("V_dy:")));
add_subwindow(v_dy = new YUVShiftLevel(plugin, &plugin->config.v_dy, x1, y));
+ add_subwindow(v_dyClr = new YUVShiftSliderClr(plugin, this, x2, y, clrBtn_w, RESET_V_DY));
y += 40;
add_subwindow(reset = new YUVShiftReset(plugin, this, x, y));
// for Reset button
-void YUVShiftWindow::update()
+void YUVShiftWindow::update_gui(int clear)
{
- y_dx->update(plugin->config.y_dx);
- y_dy->update(plugin->config.y_dy);
- u_dx->update(plugin->config.u_dx);
- u_dy->update(plugin->config.u_dy);
- v_dx->update(plugin->config.v_dx);
- v_dy->update(plugin->config.v_dy);
+ switch(clear) {
+ case RESET_Y_DX : y_dx->update(plugin->config.y_dx);
+ break;
+ case RESET_Y_DY : y_dy->update(plugin->config.y_dy);
+ break;
+ case RESET_U_DX : u_dx->update(plugin->config.u_dx);
+ break;
+ case RESET_U_DY : u_dy->update(plugin->config.u_dy);
+ break;
+ case RESET_V_DX : v_dx->update(plugin->config.v_dx);
+ break;
+ case RESET_V_DY : v_dy->update(plugin->config.v_dy);
+ break;
+ case RESET_ALL :
+ default:
+ y_dx->update(plugin->config.y_dx);
+ y_dy->update(plugin->config.y_dy);
+ u_dx->update(plugin->config.u_dx);
+ u_dy->update(plugin->config.u_dy);
+ v_dx->update(plugin->config.v_dx);
+ v_dy->update(plugin->config.v_dy);
+ break;
+ }
}
#include <stdint.h>
#include <string.h>
+#define RESET_ALL 0
+#define RESET_Y_DX 1
+#define RESET_Y_DY 2
+#define RESET_U_DX 3
+#define RESET_U_DY 4
+#define RESET_V_DX 5
+#define RESET_V_DY 6
class YUVShiftEffect;
class YUVShiftWindow;
class YUVShiftReset;
+class YUVShiftSliderClr;
class YUVShiftConfig
public:
YUVShiftConfig();
- void reset();
+ void reset(int clear);
void copy_from(YUVShiftConfig &src);
int equivalent(YUVShiftConfig &src);
void interpolate(YUVShiftConfig &prev,
YUVShiftWindow *window;
};
+class YUVShiftSliderClr : public BC_GenericButton
+{
+public:
+ YUVShiftSliderClr(YUVShiftEffect *plugin, YUVShiftWindow *window, int x, int y, int w, int clear);
+ ~YUVShiftSliderClr();
+ int handle_event();
+ YUVShiftEffect *plugin;
+ YUVShiftWindow *window;
+ int clear;
+};
+
class YUVShiftWindow : public PluginClientWindow
{
public:
YUVShiftWindow(YUVShiftEffect *plugin);
void create_objects();
- void update();
+ void update_gui(int clear);
YUVShiftLevel *y_dx, *y_dy, *u_dx, *u_dy, *v_dx, *v_dy;
YUVShiftEffect *plugin;
YUVShiftReset *reset;
+ YUVShiftSliderClr *y_dxClr, *y_dyClr;
+ YUVShiftSliderClr *u_dxClr, *u_dyClr;
+ YUVShiftSliderClr *v_dxClr, *v_dyClr;
};
ZoomBlurConfig::ZoomBlurConfig()
{
- reset();
-}
-
-void ZoomBlurConfig::reset()
-{
- x = 50;
- y = 50;
- radius = 10;
- steps = 10;
- r = 1;
- g = 1;
- b = 1;
- a = 1;
+ reset(RESET_DEFAULT_SETTINGS);
+}
+
+void ZoomBlurConfig::reset(int clear)
+{
+ switch(clear) {
+ case RESET_ALL :
+ x = 50;
+ y = 50;
+ radius = 0;
+ steps = 1;
+ r = 1;
+ g = 1;
+ b = 1;
+ a = 1;
+ break;
+ case RESET_XSLIDER : x = 50;
+ break;
+ case RESET_YSLIDER : y = 50;
+ break;
+ case RESET_RADIUS : radius = 0;
+ break;
+ case RESET_STEPS : steps = 1;
+ break;
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ x = 50;
+ y = 50;
+ radius = 10;
+ steps = 10;
+ r = 1;
+ g = 1;
+ b = 1;
+ a = 1;
+ break;
+ }
}
int ZoomBlurConfig::equivalent(ZoomBlurConfig &that)
ZoomBlurWindow::ZoomBlurWindow(ZoomBlurMain *plugin)
: PluginClientWindow(plugin,
- 230,
+ 280,
370,
- 230,
+ 280,
370,
0)
{
void ZoomBlurWindow::create_objects()
{
int x = 10, y = 10;
+ int x1 = 0; int clrBtn_w = 50;
+ int defaultBtn_w = 100;
add_subwindow(new BC_Title(x, y, _("X:")));
y += 20;
add_subwindow(this->x = new ZoomBlurSize(plugin, x, y, &plugin->config.x, 0, 100));
+ x1 = x + this->x->get_w() + 10;
+ add_subwindow(xClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_XSLIDER));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Y:")));
y += 20;
add_subwindow(this->y = new ZoomBlurSize(plugin, x, y, &plugin->config.y, 0, 100));
+ add_subwindow(yClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_YSLIDER));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Radius:")));
y += 20;
add_subwindow(radius = new ZoomBlurSize(plugin, x, y, &plugin->config.radius, -100, 100));
+ add_subwindow(radiusClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_RADIUS));
+
y += 30;
add_subwindow(new BC_Title(x, y, _("Steps:")));
y += 20;
add_subwindow(steps = new ZoomBlurSize(plugin, x, y, &plugin->config.steps, 1, 100));
+ add_subwindow(stepsClr = new ZoomBlurSliderClr(plugin, this, x1, y, clrBtn_w, RESET_STEPS));
+
y += 30;
add_subwindow(r = new ZoomBlurToggle(plugin, x, y, &plugin->config.r, _("Red")));
y += 30;
add_subwindow(a = new ZoomBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha")));
y += 40;
add_subwindow(reset = new ZoomBlurReset(plugin, this, x, y));
+ add_subwindow(default_settings = new ZoomBlurDefaultSettings(plugin, this,
+ (280 - 10 - defaultBtn_w), y, defaultBtn_w));
show_window();
flush();
}
// for Reset button
-void ZoomBlurWindow::update()
-{
- this->x->update(plugin->config.x);
- this->y->update(plugin->config.x);
- radius->update(plugin->config.radius);
- steps->update(plugin->config.steps);
- r->update(plugin->config.r);
- g->update(plugin->config.g);
- b->update(plugin->config.b);
- a->update(plugin->config.a);
+void ZoomBlurWindow::update_gui(int clear)
+{
+ switch(clear) {
+ case RESET_XSLIDER : this->x->update(plugin->config.x);
+ break;
+ case RESET_YSLIDER : this->y->update(plugin->config.y);
+ break;
+ case RESET_RADIUS : radius->update(plugin->config.radius);
+ break;
+ case RESET_STEPS : steps->update(plugin->config.steps);
+ break;
+ case RESET_ALL :
+ case RESET_DEFAULT_SETTINGS :
+ default:
+ this->x->update(plugin->config.x);
+ this->y->update(plugin->config.x);
+ radius->update(plugin->config.radius);
+ steps->update(plugin->config.steps);
+ r->update(plugin->config.r);
+ g->update(plugin->config.g);
+ b->update(plugin->config.b);
+ a->update(plugin->config.a);
+ break;
+ }
}
}
int ZoomBlurReset::handle_event()
{
- plugin->config.reset();
- window->update();
+ plugin->config.reset(RESET_ALL);
+ window->update_gui(RESET_ALL);
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+ZoomBlurDefaultSettings::ZoomBlurDefaultSettings(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w)
+ : BC_GenericButton(x, y, w, _("Default"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+ZoomBlurDefaultSettings::~ZoomBlurDefaultSettings()
+{
+}
+int ZoomBlurDefaultSettings::handle_event()
+{
+ plugin->config.reset(RESET_DEFAULT_SETTINGS);
+ window->update_gui(RESET_DEFAULT_SETTINGS);
plugin->send_configure_change();
return 1;
}
+ZoomBlurSliderClr::ZoomBlurSliderClr(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w, int clear)
+ : BC_GenericButton(x, y, w, _("⌂"))
+{
+ this->plugin = plugin;
+ this->window = window;
+ this->clear = clear;
+}
+ZoomBlurSliderClr::~ZoomBlurSliderClr()
+{
+}
+int ZoomBlurSliderClr::handle_event()
+{
+ // clear==1 ==> X slider
+ // clear==2 ==> Y slider
+ // clear==3 ==> Radius slider
+ // clear==4 ==> Steps slider
+ plugin->config.reset(clear);
+ window->update_gui(clear);
+ plugin->send_configure_change();
+ return 1;
+}
#include "pluginvclient.h"
#include "vframe.h"
-
+#define RESET_DEFAULT_SETTINGS 10
+#define RESET_ALL 0
+#define RESET_XSLIDER 1
+#define RESET_YSLIDER 2
+#define RESET_RADIUS 3
+#define RESET_STEPS 4
class ZoomBlurMain;
class ZoomBlurWindow;
class ZoomBlurEngine;
class ZoomBlurReset;
-
+class ZoomBlurDefaultSettings;
+class ZoomBlurSliderClr;
public:
ZoomBlurConfig();
- void reset();
+ void reset(int clear);
int equivalent(ZoomBlurConfig &that);
void copy_from(ZoomBlurConfig &that);
void interpolate(ZoomBlurConfig &prev,
~ZoomBlurWindow();
void create_objects();
- void update();
+ void update_gui(int clear);
ZoomBlurSize *x, *y, *radius, *steps;
ZoomBlurToggle *r, *g, *b, *a;
ZoomBlurMain *plugin;
ZoomBlurReset *reset;
+ ZoomBlurDefaultSettings *default_settings;
+ ZoomBlurSliderClr *xClr, *yClr, *radiusClr, *stepsClr;
};
class ZoomBlurReset : public BC_GenericButton
ZoomBlurWindow *window;
};
+class ZoomBlurDefaultSettings : public BC_GenericButton
+{
+public:
+ ZoomBlurDefaultSettings(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w);
+ ~ZoomBlurDefaultSettings();
+ int handle_event();
+ ZoomBlurMain *plugin;
+ ZoomBlurWindow *window;
+};
+
+
+class ZoomBlurSliderClr : public BC_GenericButton
+{
+public:
+ ZoomBlurSliderClr(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y, int w, int clear);
+ ~ZoomBlurSliderClr();
+ int handle_event();
+ ZoomBlurMain *plugin;
+ ZoomBlurWindow *window;
+ int clear;
+};
echo 'exec ./waf configure "$(DS)@"' > ./configure; chmod +x \
./configure; PKG_CONFIG_PATH=$(LV2_PKGCFG) LD_LIBRARY_PATH=$(LV2_LIBPATH)
$(1).cfg_params+=\
- CFLAGS="-I$(call bld_path,lv2) $(foreach f,$(2), $(call inc_path,$(f))) -fPIC "\
+ CFLAGS="-I$(call bld_path,lv2) $(foreach f,$(2), $(call inc_path,$(f))) -fPIC -std=c99"\
LDFLAGS="-lm $(foreach f,$(2), $(call ld_path,$(f),usr/local/lib)) "
$(1).mak_vars=(echo "all:"; echo " ./waf -v build") > $(call bld_path,$(1),Makefile);
$(1).mak_params+=; ( cd $(1)*; ./waf install --destdir=$(call bld_path,$(1)) )