#!/bin/bash
( ./autogen.sh
- ./configure --with-single-user
+ ./configure --with-single-user --with-booby
make && make install ) 2>&1 | tee log
mv Makefile Makefile.cfg
cp Makefile.devel Makefile
{
fprintf(fp," EDIT %p\n", this); fflush(fp);
fprintf(fp," nested_edl=%p %s asset=%p %s\n",
- nested_edl,
- nested_edl ? nested_edl->path : "",
- asset,
- asset ? asset->path : "");
+ nested_edl, nested_edl ? nested_edl->path : "",
+ asset, asset ? asset->path : "");
fflush(fp);
- fprintf(fp," channel %d, color %08x, group_id %d, is_selected %d\n",
- channel, color, group_id, is_selected);
- if(transition)
- {
+ fprintf(fp," channel %d, color %08x, hard lt/rt %d/%d"
+ " group_id %d, is_selected %d\n",
+ channel, color, hard_left, hard_right, group_id, is_selected);
+ if( transition ) {
fprintf(fp," TRANSITION %p\n", transition);
transition->dump(fp);
}
- fprintf(fp," startsource %jd startproject %jd hard lt/rt %d/%d length %jd\n",
- startsource, startproject, hard_left, hard_right, length); fflush(fp);
+ fprintf(fp," startsource %jd startproject %jd length %jd\n",
+ startsource, startproject, length);
+ fflush(fp);
return 0;
}
startproject += difference;
}
+void Edit::trim(int64_t difference)
+{
+ length += difference;
+ if( startproject < 0 ) {
+ if( (startsource+=startproject) < 0 ) startsource = 0;
+ if( (length+=startproject) < 0 ) length = 0;
+ startproject = 0;
+ }
+ if( startsource < 0 )
+ startsource = 0;
+ int64_t src_len = get_source_end(INT64_MAX);
+ if( startsource + length > src_len ) {
+ length = src_len - startsource;
+ if( length < 0 ) length = 0;
+ }
+ if( length < 0 )
+ length = 0;
+}
int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition,
- int edit_edits, int edit_labels, int edit_plugins, int edit_autos,
- Edits *trim_edits)
+ int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits)
{
- int64_t startproject = this->startproject;
- int64_t startsource = this->startsource;
- int64_t length = this->length;
- int64_t source_len = get_source_end(startsource + length);
int64_t cut_length = newposition - oldposition;
- source_len -= cut_length;
+ if( !cut_length ) return 0;
+ int64_t start = startproject, end = start + length;
+ Edit *prev = this->previous, *next = this->next;
+ int edits_moved = 0, rest_moved = 0;
switch( edit_mode ) {
- case MOVE_EDGE:
+ case MOVE_RIPPLE:
+ edits_moved = rest_moved = 1;
+ if( prev ) prev->trim(cut_length);
+ for( Edit *edit=this; edit; edit=edit->next )
+ edit->startproject += cut_length;
+ break;
+ case MOVE_ROLL:
+ if( prev ) prev->trim(cut_length);
startproject += cut_length;
startsource += cut_length;
length -= cut_length;
break;
- case MOVE_MEDIA:
- startsource += cut_length;
+ case MOVE_SLIP:
+ edits_moved = 1;
+ startsource -= cut_length;
break;
- case MOVE_EDGE_MEDIA:
+ case MOVE_SLIDE:
+ edits_moved = 1;
+ if( prev ) prev->trim(cut_length);
startproject += cut_length;
- length -= cut_length;
+ if( next ) {
+ next->startproject += cut_length;
+ next->startsource += cut_length;
+ next->trim(-cut_length);
+ }
break;
- }
-
- if( startproject < 0 ) {
- startsource += startproject;
- length += startproject;
- startproject = 0;
- }
- if( startsource < 0 )
- startsource = 0;
- if( length > source_len )
- length = source_len;
- if( length < 0 )
- length = 0;
-
- int64_t start = this->startproject;
- int64_t end = start + this->length;
- if( edit_labels ) {
- double cut_len = track->from_units(cut_length);
- double start_pos = edits->track->from_units(start);
- edits->edl->labels->insert(start_pos, cut_len);
- double end_pos = edits->track->from_units(end);
- edits->edl->labels->insert(end_pos + cut_len, -cut_len);
- }
- if( edit_autos ) {
- edits->shift_keyframes_recursive(start, cut_length);
- edits->shift_keyframes_recursive(end + cut_length, -cut_length);
- }
- if( edit_plugins ) {
- edits->shift_effects_recursive(start, cut_length, 1);
- edits->shift_effects_recursive(end + cut_length, -cut_length, 1);
- }
- if( !edit_edits && startproject < start ) {
- edits->clear(startproject, start);
- cut_length = start - startproject;
+ case MOVE_EDGE:
+ edits_moved = rest_moved = 1;
+ startsource -= cut_length;
+ length += cut_length;
for( Edit *edit=next; edit; edit=edit->next )
edit->startproject += cut_length;
+ break;
}
+ trim(0);
- this->startproject = startproject;
- this->startsource = startsource;
- this->length = length;
-
- return 0;
+ return follow_edits(start, end, cut_length, edits_moved, rest_moved,
+ edit_labels, edit_autos, edit_plugins, trim_edits);
}
int Edit::shift_end(int edit_mode, int64_t newposition, int64_t oldposition,
- int edit_edits, int edit_labels, int edit_plugins, int edit_autos,
- Edits *trim_edits)
+ int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits)
{
- int64_t startproject = this->startproject;
- int64_t startsource = this->startsource;
- int64_t length = this->length;
- int64_t source_len = get_source_end(startsource + length);
int64_t cut_length = newposition - oldposition;
- source_len += cut_length;
+ if( !cut_length ) return 0;
+ int64_t start = startproject, end = start + length;
+ Edit *prev = this->previous, *next = this->next;
+ int edits_moved = 0, rest_moved = 0;
switch( edit_mode ) {
- case MOVE_EDGE:
+ case MOVE_RIPPLE:
+ rest_moved = 1;
length += cut_length;
+ for( Edit *edit=next; edit; edit=edit->next )
+ edit->startproject += cut_length;
break;
- case MOVE_MEDIA:
- startsource += cut_length;
+ case MOVE_ROLL:
+ length += cut_length;
+ if( next ) {
+ next->startproject += cut_length;
+ next->startsource += cut_length;
+ next->trim(-cut_length);
+ }
break;
- case MOVE_EDGE_MEDIA:
+ case MOVE_SLIP:
+ edits_moved = 1;
startsource -= cut_length;
- length += cut_length;
+ break;
+ case MOVE_SLIDE:
+ edits_moved = 1;
+ if( prev ) prev->trim(cut_length);
+ startproject += cut_length;
+ if( next ) {
+ next->startproject += cut_length;
+ next->startsource += cut_length;
+ next->trim(-cut_length);
+ }
+ break;
+ case MOVE_EDGE:
+ edits_moved = 1;
+ if( prev ) prev->trim(cut_length);
+ startproject += cut_length;
+ length -= cut_length;
break;
}
- if( startproject < 0 ) {
- startsource += startproject;
- length += startproject;
- startproject = 0;
- }
- if( startsource < 0 )
- startsource = 0;
- if( length > source_len )
- length = source_len;
- if( length < 0 )
- length = 0;
+ trim(0);
- int64_t start = this->startproject;
- int64_t end = start + this->length;
- if( edit_labels ) {
- double cut_len = track->from_units(cut_length);
- double end_pos = edits->track->from_units(end);
- if( cut_len < 0 )
- edits->edl->labels->clear(end_pos + cut_len, end_pos, 1);
- else
- edits->edl->labels->insert(end_pos, cut_len);
+ return follow_edits(start, end, cut_length, edits_moved, rest_moved,
+ edit_labels, edit_autos, edit_plugins, trim_edits);
+}
+
+int Edit::follow_edits(int64_t start, int64_t end, int64_t cut_length,
+ int edits_moved, int rest_moved, int edit_labels, int edit_autos,
+ int edit_plugins, Edits *trim_edits)
+{
+ if( edits_moved && rest_moved ) {
+ if( edit_labels ) {
+ double cut_len = track->from_units(cut_length);
+ double start_pos = edits->track->from_units(start);
+ if( cut_len < 0 )
+ edits->edl->labels->clear(start_pos + cut_len, start_pos, 1);
+ else if( cut_len > 0 )
+ edits->edl->labels->insert(start_pos, cut_len);
+ }
+ if( cut_length < 0 )
+ track->clear(start + cut_length, start,
+ 0, 0, edit_autos, edit_plugins, trim_edits);
+ else if( cut_length > 0 ) {
+ if( edit_autos )
+ track->shift_keyframes(start, cut_length);
+ if( edit_plugins )
+ track->shift_effects(start, cut_length, 1, trim_edits);
+ }
}
- Track *track = edits->track;
- if( cut_length < 0 )
- track->clear(end+cut_length, end,
- 0, 0, edit_autos, edit_plugins, trim_edits);
- else if( cut_length > 0 ) {
- if( edit_autos )
- track->shift_keyframes(end, cut_length);
- if( edit_plugins )
- track->shift_effects(end, cut_length, 1, trim_edits);
+ else if( edits_moved ) {
+ if( edit_labels ) {
+ double cut_len = track->from_units(cut_length);
+ double start_pos = edits->track->from_units(start);
+ edits->edl->labels->insert(start_pos, cut_len);
+ double end_pos = edits->track->from_units(end);
+ edits->edl->labels->insert(end_pos + cut_len, -cut_len);
+ }
+ if( edit_autos ) {
+ if( cut_length > 0 ) {
+ track->clear(end, end+cut_length, 0, 0, 0, 1, 0);
+ track->shift_keyframes(start, cut_length);
+ }
+ else if( cut_length < 0 ) {
+ track->clear(start+cut_length, start, 0, 0, 0, 1, 0);
+ track->shift_keyframes(end+cut_length, -cut_length);
+ }
+ }
+ if( edit_plugins ) {
+ if( cut_length > 0 ) {
+ track->clear(end, end+cut_length, 0, 0, 1, 0, 0);
+ track->shift_effects(start, cut_length, 1, 0);
+ }
+ else if( cut_length < 0 ) {
+ track->clear(start+cut_length, start, 0, 0, 1, 0, 0);
+ track->shift_effects(end+cut_length, -cut_length, 1, 0);
+ }
+ }
}
-
- int64_t new_end = startproject + length;
- if( edit_edits ) {
- cut_length = new_end - end;
- for( Edit* edit=next; edit; edit=edit->next )
- edit->startproject += cut_length;
+ else if( rest_moved ) {
+ if( edit_labels ) {
+ double cut_len = track->from_units(cut_length);
+ double end_pos = edits->track->from_units(end);
+ if( cut_len < 0 )
+ edits->edl->labels->clear(end_pos + cut_len, end_pos, 1);
+ else if( cut_len > 0 )
+ edits->edl->labels->insert(end_pos, cut_len);
+ }
+ if( cut_length < 0 )
+ track->clear(end + cut_length, end,
+ 0, 0, edit_autos, edit_plugins, trim_edits);
+ else if( cut_length > 0 ) {
+ if( edit_autos )
+ track->shift_keyframes(end, cut_length);
+ if( edit_plugins )
+ track->shift_effects(end, cut_length, 1, trim_edits);
+ }
}
- else if( new_end > end )
- edits->clear(end, new_end);
-
- this->startproject = startproject;
- this->startsource = startsource;
- this->length = length;
-
return 0;
}
+
int Edit::popup_transition(float view_start, float zoom_units, int cursor_x, int cursor_y)
{
int64_t left, right, left_unit, right_unit;
// Shift in time
virtual void shift(int64_t difference);
+
+ void trim(int64_t difference);
int shift_start(int edit_mode, int64_t newposition, int64_t oldposition,
- int edit_edits, int edit_labels, int edit_plugins, int edit_autos,
- Edits *trim_edits);
+ int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits);
int shift_end(int edit_mode, int64_t newposition, int64_t oldposition,
- int edit_edits, int edit_labels, int edit_plugins, int edit_autos,
- Edits *trim_edits);
+ int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits);
+ int follow_edits(int64_t start, int64_t end, int64_t cut_length,
+ int edits_moved, int rest_moved, int edit_labels, int edit_autos,
+ int edit_plugins, Edits *trim_edits);
void insert_transition(char *title);
void detach_transition();
Transition *transition;
Edits *edits;
-
Track *track;
// points to an object in edl->assets if set
double delta = newposition - oldposition;
oldposition = track->from_units(current_edit->startproject);
if( group_id > 0 ) newposition = oldposition + delta;
- result = 1;
-// dont move stuff if media playback does not shift in time
- if( edit_mode != MOVE_MEDIA && edit_mode != MOVE_EDGE_MEDIA ) {
- edit_labels = 0;
- edit_plugins = 0;
- edit_autos = 0;
- }
current_edit->shift_start(edit_mode,
track->to_units(newposition, 0), track->to_units(oldposition, 0),
- 0, edit_labels, edit_plugins, edit_autos,
- trim_edits);
+ edit_labels, edit_autos, edit_plugins, trim_edits);
+ result = 1;
}
if(!result) current_edit = current_edit->next;
current_edit->shift_end(edit_mode,
track->to_units(newposition, 0), track->to_units(oldposition, 0),
- edit_edits, edit_labels, edit_plugins, edit_autos, trim_edits);
+ edit_labels, edit_autos, edit_plugins, trim_edits);
}
if(!result) current_edit = current_edit->next;
}
}
-
void EDL::modify_edithandles(double oldposition, double newposition,
int currentend, int handle_mode, int edit_labels,
int edit_plugins, int edit_autos, int group_id)
tracks->modify_edithandles(oldposition, newposition,
currentend, handle_mode, edit_labels,
edit_plugins, edit_autos, group_id);
- labels->modify_handles(oldposition, newposition,
- currentend, handle_mode, edit_labels);
}
void EDL::modify_pluginhandles(double oldposition, double newposition,
// default for left button
-#define MOVE_EDGE 0
// default for middle button
-#define MOVE_MEDIA 1
// default for right button
-#define MOVE_EDGE_MEDIA 2
-
-#define MOVE_EDITS_DISABLED 3
-#define EDIT_HANDLE_MODES 3
+#define MOVE_RIPPLE 0
+#define MOVE_ROLL 1
+#define MOVE_SLIP 2
+#define MOVE_SLIDE 3
+#define MOVE_EDGE 4
+#define MOVE_EDITS_DISABLED 5
+#define EDIT_HANDLE_MODES 5
// AWindow folders
#define AW_NO_FOLDER -1
strcpy(default_atransition, INIT_ATRANSITION);
strcpy(default_vtransition, INIT_VTRANSITION);
default_transition_length = 1.0;
- edit_handle_mode[0] = MOVE_EDGE;
- edit_handle_mode[1] = MOVE_MEDIA;
- edit_handle_mode[2] = MOVE_EDGE_MEDIA;
+ edit_handle_mode[0] = MOVE_RIPPLE;
+ edit_handle_mode[1] = MOVE_ROLL;
+ edit_handle_mode[2] = MOVE_SLIP;
editing_mode = EDITING_IBEAM;
enable_duplex = 1;
folderlist_format = FOLDERS_ICONS;
sprintf(default_vtransition, INIT_VTRANSITION);
defaults->get("DEFAULT_VTRANSITION", default_vtransition);
default_transition_length = defaults->get("DEFAULT_TRANSITION_LENGTH", (double)1);
- edit_handle_mode[0] = defaults->get("EDIT_HANDLE_MODE0", MOVE_EDGE);
- edit_handle_mode[1] = defaults->get("EDIT_HANDLE_MODE1", MOVE_MEDIA);
- edit_handle_mode[2] = defaults->get("EDIT_HANDLE_MODE2", MOVE_EDGE_MEDIA);
+ edit_handle_mode[0] = defaults->get("EDIT_HANDLE_MODE0", MOVE_RIPPLE);
+ edit_handle_mode[1] = defaults->get("EDIT_HANDLE_MODE1", MOVE_ROLL);
+ edit_handle_mode[2] = defaults->get("EDIT_HANDLE_MODE2", MOVE_SLIP);
editing_mode = defaults->get("EDITING_MODE", EDITING_IBEAM);
enable_duplex = defaults->get("ENABLE_DUPLEX", 1);
folderlist_format = defaults->get("FOLDERLIST_FORMAT", FOLDERS_TEXT);
#include "shbtnprefs.h"
#include "theme.h"
-#if 0
-N_("Drag all following edits")
-N_("Drag only one edit")
-N_("Drag source only")
-N_("No effect")
-#endif
-
-#define MOVE_EDGE_TITLE N_("Drag edge only")
-#define MOVE_MEDIA_TITLE N_("Drag media only")
-#define MOVE_EDGE_MEDIA_TITLE N_("Drag edge and media")
+#define MOVE_RIPPLE_TITLE N_("All Edits (ripple)")
+#define MOVE_ROLL_TITLE N_("One Edit (roll)")
+#define MOVE_SLIP_TITLE N_("Src Only (slip)")
+#define MOVE_SLIDE_TITLE N_("Move Edit (slide)")
+#define MOVE_EDGE_TITLE N_("Drag Edge (edge)")
#define MOVE_EDITS_DISABLED_TITLE N_("No effect")
+
InterfacePrefs::InterfacePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
: PreferencesDialog(mwindow, pwindow)
{
add_subwindow(snapshot_path = new SnapshotPathText(pwindow, this, x, y, get_w()-x-30));
x = x0; y = y2;
- add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
- y += 25;
+ add_subwindow(title = new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
+ y += title->get_h() + 10;
add_subwindow(new BC_Title(x, y, _("Button 1:")));
-
int x1 = x + 100;
+
ViewBehaviourText *text;
add_subwindow(text = new ViewBehaviourText(x1, y - 5,
behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]),
const char* InterfacePrefs::behavior_to_text(int mode)
{
- switch(mode) {
- case MOVE_EDGE: return _(MOVE_EDGE_TITLE);
- case MOVE_MEDIA: return _(MOVE_MEDIA_TITLE);
- case MOVE_EDGE_MEDIA: return _(MOVE_EDGE_MEDIA_TITLE);
- case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
- default: return "";
+ switch( mode ) {
+ case MOVE_RIPPLE: return _(MOVE_RIPPLE_TITLE);
+ case MOVE_ROLL: return _(MOVE_ROLL_TITLE);
+ case MOVE_SLIP: return _(MOVE_SLIP_TITLE);
+ case MOVE_SLIDE: return _(MOVE_SLIDE_TITLE);
+ case MOVE_EDGE: return _(MOVE_EDGE_TITLE);
+ case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
}
+ return "";
}
IndexPathText::IndexPathText(int x, int y, PreferencesWindow *pwindow, char *text)
ViewBehaviourText::ViewBehaviourText(int x, int y, const char *text, PreferencesWindow *pwindow,
int *output)
- : BC_PopupMenu(x, y, 200, text)
+ : BC_PopupMenu(x, y, 250, text)
{
this->output = output;
}
void ViewBehaviourText::create_objects()
{
- add_item(new ViewBehaviourItem(this, _(MOVE_EDGE_TITLE), MOVE_EDGE));
- add_item(new ViewBehaviourItem(this, _(MOVE_MEDIA_TITLE), MOVE_MEDIA));
- add_item(new ViewBehaviourItem(this, _(MOVE_EDGE_MEDIA_TITLE), MOVE_EDGE_MEDIA));
- add_item(new ViewBehaviourItem(this, _(MOVE_EDITS_DISABLED_TITLE), MOVE_EDITS_DISABLED));
+ for( int mode=0; mode<=EDIT_HANDLE_MODES; ++mode )
+ add_item(new ViewBehaviourItem(this,
+ InterfacePrefs::behavior_to_text(mode), mode));
}
-ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup, char *text, int behaviour)
+ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup,
+ const char *text, int behaviour)
: BC_MenuItem(text)
{
this->popup = popup;
void create_objects();
// must delete each derived class
int update(int new_value);
- const char* behavior_to_text(int mode);
+ static const char* behavior_to_text(int mode);
int start_shbtn_dialog();
void start_probe_dialog();
class ViewBehaviourItem : public BC_MenuItem
{
public:
- ViewBehaviourItem(ViewBehaviourText *popup, char *text, int behaviour);
+ ViewBehaviourItem(ViewBehaviourText *popup, const char *text, int behaviour);
~ViewBehaviourItem();
int handle_event();
return 0;
}
-int Labels::modify_handles(double oldposition, double newposition,
- int currentend, int handle_mode, int edit_labels)
+int Labels::modify_handles(double oldposition, double newposition, int currentend)
{
- if( edit_labels && handle_mode == MOVE_EDGE ) {
- if( !currentend ) { // left handle
- if( newposition < oldposition )
- insert(oldposition, oldposition - newposition); // shift all labels right
- else
- clear(oldposition, newposition); // clear selection
- }
- else { // right handle
- if( newposition < oldposition )
- clear(newposition, oldposition);
- else
- insert(oldposition, newposition - oldposition);
- }
+ if( !currentend ) { // left handle
+ if( newposition < oldposition )
+ insert(oldposition, oldposition - newposition); // shift all labels right
+ else
+ clear(oldposition, newposition); // clear selection
+ }
+ else { // right handle
+ if( newposition < oldposition )
+ clear(newposition, oldposition);
+ else
+ insert(oldposition, newposition - oldposition);
}
return 0;
}
// Always add label without toggling
void insert_label(double position);
- int modify_handles(double oldposition,
- double newposition,
- int currentend,
- int handle_mode,
- int edit_labels);
+ int modify_handles(double oldposition, double newposition, int currentend);
int copy(double start, double end, FileXML *xml);
int copy_length(long start, long end); // return number of Labels in selection
Label *add_label(double position);
int MWindow::modify_edithandles()
{
undo->update_undo_before();
+ int handle_mode = edl->session->edit_handle_mode[session->drag_button];
edl->modify_edithandles(session->drag_start,
- session->drag_position,
- session->drag_handle,
- edl->session->edit_handle_mode[session->drag_button],
+ session->drag_position, session->drag_handle, handle_mode,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
session->drag_edit->group_id);
-
finish_modify_handles();
//printf("MWindow::modify_handles 1\n");
return 0;
void MWindow::finish_modify_handles()
{
int edit_mode = edl->session->edit_handle_mode[session->drag_button];
- if( edit_mode != MOVE_MEDIA ) {
- double position = session->drag_position ;
- if( position < 0 ) position = 0;
+ double position = -1;
+ switch( edit_mode ) {
+ case MOVE_RIPPLE:
+ case MOVE_ROLL:
+ case MOVE_SLIDE:
+ position = session->drag_position;
+ break;
+ case MOVE_SLIP:
+ case MOVE_EDGE:
+ position = session->drag_start;
+ break;
+ }
+ if( position >= 0 ) {
edl->local_session->set_selectionstart(position);
edl->local_session->set_selectionend(position);
}
edl->create_objects();
edl->copy_all(mwindow->edl);
MainSession *session = mwindow->session;
- int edit_mode = mwindow->edl->session->edit_handle_mode[session->drag_button];
+ int handle_mode = mwindow->edl->session->edit_handle_mode[session->drag_button];
edl->modify_edithandles(session->drag_start,
- session->drag_position,
- session->drag_handle,
- edit_mode,
+ session->drag_position, session->drag_handle, handle_mode,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
!session->drag_edit ? 0 : session->drag_edit->group_id);
- double position = edit_mode == MOVE_EDGE || edit_mode == MOVE_EDGE_MEDIA ?
- session->drag_position : session->drag_start ;
+
+ double position = -1;
+ switch( handle_mode ) {
+ case MOVE_RIPPLE:
+ case MOVE_ROLL:
+ case MOVE_SLIDE:
+ position = session->drag_position;
+ break;
+ case MOVE_SLIP:
+ case MOVE_EDGE:
+ position = session->drag_start;
+ break;
+ }
+
+ if( position < 0 ) position = 0;
Track *track = session->drag_handle_track();
int64_t pos = track->to_units(position, 0);
render_handle_frame(edl, pos, shift_down() ? 0 :
// Go in using the edit handle interface
int64_t starting_length = current_edit->length;
- current_edit->shift_end(MOVE_EDGE,
+ current_edit->shift_end(MOVE_RIPPLE,
current_edit->startproject + length_units,
current_edit->startproject + current_edit->length,
- 1, 0,
- edl->session->plugins_follow_edits,
+ 0,
edl->session->autos_follow_edits,
+ edl->session->plugins_follow_edits,
0);
int64_t ending_length = current_edit->length;
edl->labels->modify_handles(
current_track->from_units(current_edit->startproject + starting_length),
current_track->from_units(current_edit->startproject + ending_length),
- 1, MOVE_EDGE, 1);
+ 1);
}
// Go in using the edit handle interface
int64_t starting_length = current_edit->length;
- current_edit->shift_end(MOVE_EDGE,
+ current_edit->shift_end(MOVE_RIPPLE,
current_edit->startproject + length_units,
current_edit->startproject + current_edit->length,
- 1, 0,
- edl->session->plugins_follow_edits,
+ 0,
edl->session->autos_follow_edits,
+ edl->session->plugins_follow_edits,
0);
int64_t ending_length = current_edit->length;
edl->labels->modify_handles(
current_track->from_units(current_edit->startproject + starting_length),
current_track->from_units(current_edit->startproject + ending_length),
- 1, MOVE_EDGE, 1);
+ 1);
}
track->modify_edithandles(oldposition, newposition,
currentend, handle_mode, edit_labels,
edit_plugins, edit_autos, group_id);
+// labels follow first armed track
+ edit_labels = 0;
}
return 0;
}
trace_locks = 0;
while( lock_table.last ) {
lock_item *p = (lock_item*)lock_table.last;
+ lock_table.remove_pointer(p);
p->info->trace = 0;
- lock_table.remove_pointer(p); lock_free.append(p);
+ lock_free.append(p);
}
lock_free.clear();
lock_table.unlock();
p = (lock_item*)lock_table.last;
while( p && p->id != table_id ) p = (lock_item*)p->previous;
}
- else
- info->trace = 0;
- if( p ) { lock_table.remove_pointer(p); lock_free.append(p); }
+ if( p ) {
+ if( p->list == &lock_table ) {
+ lock_table.remove_pointer(p);
+ info->trace = 0;
+ lock_free.append(p);
+ }
+ else
+ printf("unset_lock2: free lock_item in lock_table %p\n", p);
+ }
lock_table.unlock();
}
p = (lock_item*)lock_table.last;
while( p && ( p->info!=info || !p->is_owner ) ) p = (lock_item*)p->previous;
}
- else
- info->trace = 0;
- if( p ) { lock_table.remove_pointer(p); lock_free.append(p); }
+ info->trace = 0;
+ if( p ) {
+ if( p->list == &lock_table ) {
+ lock_table.remove_pointer(p);
+ info->trace = 0;
+ lock_free.append(p);
+ }
+ else
+ printf("unset_lock: free lock_item in lock_table %p\n", p);
+ }
lock_table.unlock();
}
{
if( !global_trace || !trace_locks ) return;
lock_table.lock();
+ info->trace = 0;
lock_item *p = (lock_item*)lock_table.first;
while( p ) {
lock_item *lp = p; p = (lock_item*)p->next;
if( lp->info != info ) continue;
- lock_table.remove_pointer(lp); lock_free.append(lp);
+ lock_table.remove_pointer(lp);
+ lock_free.append(lp);
}
lock_table.unlock();
}
while( p ) {
lock_item *lp = p; p = (lock_item*)p->next;
if( lp->tid != tid ) continue;
- lock_table.remove_pointer(lp); lock_free.append(lp);
+ lock_table.remove_pointer(lp);
+ lp->info->trace = 0;
+ lock_free.append(lp);
}
lock_table.unlock();
}
fprintf(fp," %p %s %s %p%s\n", p->info, p->title,
p->loc, (void*)p->tid, p->is_owner ? " *" : "");
}
+ int64_t lock_total = lock_table.total();
+ int64_t free_total = lock_free.total();
+ printf("lock_items: %jd\n", lock_total);
+ printf("lock_frees: %jd\n", free_total);
+ int64_t missed_locks = lock_table.size - (lock_total + free_total);
+ if( missed_locks )
+ printf("miss locks: %jd\n", missed_locks);
#endif
}
// if ants are running, run one more pane update to hide them (gui
// is already marked as closed)
- if(server && server->mwindow && ants_counter>0)
- server->mwindow->sync_parameters();
+ //if(server && server->mwindow && ants_counter>0)
+ // server->mwindow->sync_parameters();
delete engine;
}
void BluebananaMain::read_data(KeyFrame *keyframe){
- FileXML input;
+
int result = 0;
-
+{ FileXML input; // release xbuf-shared_lock before nonaauto
input.set_shared_input(keyframe->xbuf);
while(!result){
}
}
-
+}
load_nonauto();
}
int64_t start_position,
double frame_rate){
ants_counter++;
-
SET_TRACE
load_configuration();
this->frame = frame;
class OilEffect;
-
+class OilWindow;
+class OilReset;
class OilConfig
{
public:
OilConfig();
+ void reset();
+
void copy_from(OilConfig &src);
int equivalent(OilConfig &src);
void interpolate(OilConfig &prev,
OilEffect *plugin;
};
+class OilReset : public BC_GenericButton
+{
+public:
+ OilReset(OilEffect *plugin, OilWindow *window, int x, int y);
+ ~OilReset();
+ int handle_event();
+ OilEffect *plugin;
+ OilWindow *window;
+};
+
+
class OilWindow : public PluginClientWindow
{
public:
OilWindow(OilEffect *plugin);
~OilWindow();
void create_objects();
-
+ void update();
OilEffect *plugin;
OilRadius *radius;
OilIntensity *intensity;
+ OilReset *reset;
};
-
-
OilConfig::OilConfig()
+{
+ reset();
+}
+
+void OilConfig::reset()
{
radius = 5;
use_intensity = 0;
}
+OilReset::OilReset(OilEffect *plugin, OilWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+OilReset::~OilReset()
+{
+}
+int OilReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
OilWindow::OilWindow(OilEffect *plugin)
: PluginClientWindow(plugin,
300,
- 160,
+ 120,
300,
- 160,
+ 120,
0)
{
this->plugin = plugin;
add_subwindow(radius = new OilRadius(plugin, x + 70, y));
y += 40;
add_subwindow(intensity = new OilIntensity(plugin, x, y));
+ y += 40;
+ add_subwindow(reset = new OilReset(plugin, this, x, y));
show_window();
flush();
}
-
+// for Reset button
+void OilWindow::update()
+{
+ radius->update(plugin->config.radius);
+ intensity->update(plugin->config.use_intensity);
+}
*
*/
-#include "bcdisplayinfo.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "guicast.h"
-#include "language.h"
-#include "bccolors.h"
-#include "pluginvclient.h"
-#include "vframe.h"
-
-#include <stdint.h>
-#include <string.h>
-
-
-class RGBShiftEffect;
-
-
-class RGBShiftConfig
-{
-public:
- RGBShiftConfig();
-
- void copy_from(RGBShiftConfig &src);
- int equivalent(RGBShiftConfig &src);
- void interpolate(RGBShiftConfig &prev,
- RGBShiftConfig &next,
- long prev_frame,
- long next_frame,
- long current_frame);
-
- int r_dx, r_dy, g_dx, g_dy, b_dx, b_dy;
-};
-
-class RGBShiftLevel : public BC_ISlider
-{
-public:
- RGBShiftLevel(RGBShiftEffect *plugin, int *output, int x, int y);
- int handle_event();
- RGBShiftEffect *plugin;
- int *output;
-};
-
-class RGBShiftWindow : public PluginClientWindow
-{
-public:
- RGBShiftWindow(RGBShiftEffect *plugin);
- void create_objects();
- RGBShiftLevel *r_dx, *r_dy, *g_dx, *g_dy, *b_dx, *b_dy;
- RGBShiftEffect *plugin;
-};
-
-
-
-class RGBShiftEffect : public PluginVClient
-{
- VFrame *temp_frame;
-public:
- RGBShiftEffect(PluginServer *server);
- ~RGBShiftEffect();
-
-
- PLUGIN_CLASS_MEMBERS(RGBShiftConfig)
- int process_realtime(VFrame *input, VFrame *output);
- int is_realtime();
- void save_data(KeyFrame *keyframe);
- void read_data(KeyFrame *keyframe);
- void update_gui();
-};
-
-
+#include "rgbshift.h"
-
RGBShiftConfig::RGBShiftConfig()
+{
+ reset();
+}
+
+void RGBShiftConfig::reset()
{
r_dx = r_dy = 0;
g_dx = g_dy = 0;
}
+RGBShiftReset::RGBShiftReset(RGBShiftEffect *plugin, RGBShiftWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+RGBShiftReset::~RGBShiftReset()
+{
+}
+int RGBShiftReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
+
+
RGBShiftWindow::RGBShiftWindow(RGBShiftEffect *plugin)
- : PluginClientWindow(plugin, 300, 200, 300, 200, 0)
+ : PluginClientWindow(plugin, 300, 230, 300, 230, 0)
{
this->plugin = plugin;
}
add_subwindow(new BC_Title(x, y, _("B_dy:")));
add_subwindow(b_dy = new RGBShiftLevel(plugin, &plugin->config.b_dy, x1, y));
+ y += 40;
+ add_subwindow(reset = new RGBShiftReset(plugin, this, x, y));
+
show_window();
flush();
}
-
+// for Reset button
+void RGBShiftWindow::update()
+{
+ 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);
+}
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef RGBSHIFT_H
+#define RGBSHIFT_H
+
+
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "guicast.h"
+#include "language.h"
+#include "bccolors.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+#include <stdint.h>
+#include <string.h>
+
+
+class RGBShiftEffect;
+class RGBShiftWindow;
+class RGBShiftReset;
+
+
+class RGBShiftConfig
+{
+public:
+ RGBShiftConfig();
+
+ void reset();
+ void copy_from(RGBShiftConfig &src);
+ int equivalent(RGBShiftConfig &src);
+ void interpolate(RGBShiftConfig &prev,
+ RGBShiftConfig &next,
+ long prev_frame,
+ long next_frame,
+ long current_frame);
+
+ int r_dx, r_dy, g_dx, g_dy, b_dx, b_dy;
+};
+
+class RGBShiftLevel : public BC_ISlider
+{
+public:
+ RGBShiftLevel(RGBShiftEffect *plugin, int *output, int x, int y);
+ int handle_event();
+ RGBShiftEffect *plugin;
+ int *output;
+};
+
+class RGBShiftReset : public BC_GenericButton
+{
+public:
+ RGBShiftReset(RGBShiftEffect *plugin, RGBShiftWindow *window, int x, int y);
+ ~RGBShiftReset();
+ int handle_event();
+ RGBShiftEffect *plugin;
+ RGBShiftWindow *window;
+};
+
+class RGBShiftWindow : public PluginClientWindow
+{
+public:
+ RGBShiftWindow(RGBShiftEffect *plugin);
+ void create_objects();
+ void update();
+ RGBShiftLevel *r_dx, *r_dy, *g_dx, *g_dy, *b_dx, *b_dy;
+ RGBShiftEffect *plugin;
+ RGBShiftReset *reset;
+};
+
+
+
+class RGBShiftEffect : public PluginVClient
+{
+ VFrame *temp_frame;
+public:
+ RGBShiftEffect(PluginServer *server);
+ ~RGBShiftEffect();
+
+
+ PLUGIN_CLASS_MEMBERS(RGBShiftConfig)
+ int process_realtime(VFrame *input, VFrame *output);
+ int is_realtime();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+ void update_gui();
+};
+
+#endif
*
*/
-#include "affine.h"
-#include "bcdisplayinfo.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "guicast.h"
-#include "language.h"
-#include "pluginvclient.h"
-#include "rotateframe.h"
-#include "vframe.h"
-
-
-#include <string.h>
-
+#include "rotate.h"
#define MAXANGLE 360
-
-class RotateEffect;
-class RotateWindow;
-
-
-class RotateConfig
-{
-public:
- RotateConfig();
-
- int equivalent(RotateConfig &that);
- void copy_from(RotateConfig &that);
- void interpolate(RotateConfig &prev,
- RotateConfig &next,
- long prev_frame,
- long next_frame,
- long current_frame);
-
- float angle;
- float pivot_x;
- float pivot_y;
- int draw_pivot;
-// int bilinear;
-};
-
-class RotateToggle : public BC_Radial
-{
-public:
- RotateToggle(RotateWindow *window,
- RotateEffect *plugin,
- int init_value,
- int x,
- int y,
- int value,
- const char *string);
- int handle_event();
-
- RotateEffect *plugin;
- RotateWindow *window;
- int value;
-};
-
-class RotateDrawPivot : public BC_CheckBox
-{
-public:
- RotateDrawPivot(RotateWindow *window,
- RotateEffect *plugin,
- int x,
- int y);
- int handle_event();
- RotateEffect *plugin;
- RotateWindow *window;
- int value;
-};
-
-class RotateInterpolate : public BC_CheckBox
-{
-public:
- RotateInterpolate(RotateEffect *plugin, int x, int y);
- int handle_event();
- RotateEffect *plugin;
-};
-
-class RotateFine : public BC_FPot
-{
-public:
- RotateFine(RotateWindow *window,
- RotateEffect *plugin,
- int x,
- int y);
- int handle_event();
-
- RotateEffect *plugin;
- RotateWindow *window;
-};
-
-class RotateX : public BC_FPot
-{
-public:
- RotateX(RotateWindow *window,
- RotateEffect *plugin,
- int x,
- int y);
- int handle_event();
- RotateEffect *plugin;
- RotateWindow *window;
-};
-
-class RotateY : public BC_FPot
-{
-public:
- RotateY(RotateWindow *window,
- RotateEffect *plugin,
- int x,
- int y);
- int handle_event();
- RotateEffect *plugin;
- RotateWindow *window;
-};
-
-
-class RotateText : public BC_TextBox
-{
-public:
- RotateText(RotateWindow *window,
- RotateEffect *plugin,
- int x,
- int y);
- int handle_event();
-
- RotateEffect *plugin;
- RotateWindow *window;
-};
-
-class RotateWindow : public PluginClientWindow
-{
-public:
- RotateWindow(RotateEffect *plugin);
-
- void create_objects();
-
- int update();
- int update_fine();
- int update_text();
- int update_toggles();
-
- RotateEffect *plugin;
- RotateToggle *toggle0;
- RotateToggle *toggle90;
- RotateToggle *toggle180;
- RotateToggle *toggle270;
- RotateDrawPivot *draw_pivot;
- RotateFine *fine;
- RotateText *text;
- RotateX *x;
- RotateY *y;
-// RotateInterpolate *bilinear;
-};
-
-
-
-
-class RotateEffect : public PluginVClient
-{
-public:
- RotateEffect(PluginServer *server);
- ~RotateEffect();
-
- PLUGIN_CLASS_MEMBERS(RotateConfig)
- int process_buffer(VFrame *frame,
- int64_t start_position,
- double frame_rate);
- int is_realtime();
- void update_gui();
- void save_data(KeyFrame *keyframe);
- void read_data(KeyFrame *keyframe);
- int handle_opengl();
-
- AffineEngine *engine;
- int need_reconfigure;
-};
-
-
-
-
-
-
-
REGISTER_PLUGIN(RotateEffect)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
RotateConfig::RotateConfig()
{
- angle = 0;
- pivot_x = 50;
- pivot_y = 50;
+ reset();
+}
+
+void RotateConfig::reset()
+{
+ angle = 0.0;
+ pivot_x = 50.0;
+ pivot_y = 50.0;
draw_pivot = 0;
}
{
this->value = value;
this->plugin = plugin;
- this->window = window;
+ this->window = window;
}
int RotateToggle::handle_event()
{
plugin->config.angle = (float)value;
- window->update();
+ window->update();
plugin->send_configure_change();
return 1;
}
: BC_CheckBox(x, y, plugin->config.draw_pivot, _("Draw pivot"))
{
this->plugin = plugin;
- this->window = window;
+ this->window = window;
}
int RotateDrawPivot::handle_event()
int y)
: BC_TextBox(x,
y,
- 100,
+ 90,
1,
(float)plugin->config.angle)
{
}
+RotateReset::RotateReset(RotateEffect *plugin, RotateWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+RotateReset::~RotateReset()
+{
+}
+int RotateReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
add_tool(fine = new RotateFine(this, plugin, x, y));
y += fine->get_h() + 10;
add_tool(text = new RotateText(this, plugin, x, y));
- y += 30;
+ y += 25;
add_tool(new BC_Title(x, y, _("Degrees")));
x += this->x->get_w() + 10;
add_subwindow(this->y = new RotateY(this, plugin, x, y));
+// y += this->y->get_h() + 10;
x = 10;
- y += this->y->get_h() + 10;
add_subwindow(draw_pivot = new RotateDrawPivot(this, plugin, x, y));
+ y += 60;
+ add_subwindow(reset = new RotateReset(plugin, this, x, y));
show_window();
-
-
-
}
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef ROTATE_H
+#define ROTATE_H
+
+
+
+#include "affine.h"
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "guicast.h"
+#include "language.h"
+#include "pluginvclient.h"
+#include "rotateframe.h"
+#include "vframe.h"
+
+
+#include <string.h>
+
+
+class RotateEffect;
+class RotateWindow;
+
+
+class RotateConfig
+{
+public:
+ RotateConfig();
+
+ void reset();
+ int equivalent(RotateConfig &that);
+ void copy_from(RotateConfig &that);
+ void interpolate(RotateConfig &prev,
+ RotateConfig &next,
+ long prev_frame,
+ long next_frame,
+ long current_frame);
+
+ float angle;
+ float pivot_x;
+ float pivot_y;
+ int draw_pivot;
+// int bilinear;
+};
+
+class RotateToggle : public BC_Radial
+{
+public:
+ RotateToggle(RotateWindow *window,
+ RotateEffect *plugin,
+ int init_value,
+ int x,
+ int y,
+ int value,
+ const char *string);
+ int handle_event();
+
+ RotateEffect *plugin;
+ RotateWindow *window;
+ int value;
+};
+
+class RotateDrawPivot : public BC_CheckBox
+{
+public:
+ RotateDrawPivot(RotateWindow *window,
+ RotateEffect *plugin,
+ int x,
+ int y);
+ int handle_event();
+ RotateEffect *plugin;
+ RotateWindow *window;
+ int value;
+};
+
+class RotateInterpolate : public BC_CheckBox
+{
+public:
+ RotateInterpolate(RotateEffect *plugin, int x, int y);
+ int handle_event();
+ RotateEffect *plugin;
+};
+
+class RotateFine : public BC_FPot
+{
+public:
+ RotateFine(RotateWindow *window,
+ RotateEffect *plugin,
+ int x,
+ int y);
+ int handle_event();
+
+ RotateEffect *plugin;
+ RotateWindow *window;
+};
+
+class RotateX : public BC_FPot
+{
+public:
+ RotateX(RotateWindow *window,
+ RotateEffect *plugin,
+ int x,
+ int y);
+ int handle_event();
+ RotateEffect *plugin;
+ RotateWindow *window;
+};
+
+class RotateY : public BC_FPot
+{
+public:
+ RotateY(RotateWindow *window,
+ RotateEffect *plugin,
+ int x,
+ int y);
+ int handle_event();
+ RotateEffect *plugin;
+ RotateWindow *window;
+};
+
+
+class RotateText : public BC_TextBox
+{
+public:
+ RotateText(RotateWindow *window,
+ RotateEffect *plugin,
+ int x,
+ int y);
+ int handle_event();
+
+ RotateEffect *plugin;
+ RotateWindow *window;
+};
+
+class RotateReset : public BC_GenericButton
+{
+public:
+ RotateReset(RotateEffect *plugin, RotateWindow *window, int x, int y);
+ ~RotateReset();
+ int handle_event();
+ RotateEffect *plugin;
+ RotateWindow *window;
+};
+
+
+class RotateWindow : public PluginClientWindow
+{
+public:
+ RotateWindow(RotateEffect *plugin);
+
+ void create_objects();
+
+ int update();
+ int update_fine();
+ int update_text();
+ int update_toggles();
+
+ RotateEffect *plugin;
+ RotateToggle *toggle0;
+ RotateToggle *toggle90;
+ RotateToggle *toggle180;
+ RotateToggle *toggle270;
+ RotateDrawPivot *draw_pivot;
+ RotateFine *fine;
+ RotateText *text;
+ RotateX *x;
+ RotateY *y;
+// RotateInterpolate *bilinear;
+ RotateReset *reset;
+};
+
+
+
+
+class RotateEffect : public PluginVClient
+{
+public:
+ RotateEffect(PluginServer *server);
+ ~RotateEffect();
+
+ PLUGIN_CLASS_MEMBERS(RotateConfig)
+ int process_buffer(VFrame *frame,
+ int64_t start_position,
+ double frame_rate);
+ int is_realtime();
+ void update_gui();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+ int handle_opengl();
+
+ AffineEngine *engine;
+ int need_reconfigure;
+};
+
+#endif
*
*/
-#include "bcdisplayinfo.h"
-#include "affine.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "guicast.h"
-#include "keyframe.h"
-#include "language.h"
-#include "pluginvclient.h"
-#include "vframe.h"
-
-#include <math.h>
-#include <string.h>
-#include <stdint.h>
-
-
-class Rumbler;
-class RumblerConfig;
-class RumblerRate;
-class RumblerSeq;
-class RumblerWindow;
-
-
-class RumblerConfig
-{
-public:
- RumblerConfig();
- float time_rumble, time_rate;
- float space_rumble, space_rate;
- int sequence;
- void copy_from(RumblerConfig &that);
- int equivalent(RumblerConfig &that);
- void interpolate(RumblerConfig &prev, RumblerConfig &next,
- int64_t prev_frame, int64_t next_frame, int64_t current_frame);
-};
-
-class RumblerRate : public BC_TextBox
-{
-public:
- RumblerRate(Rumbler *plugin, RumblerWindow *gui,
- float &value, int x, int y);
- int handle_event();
- Rumbler *plugin;
- RumblerWindow *gui;
- float *value;
-};
-
-class RumblerSeq : public BC_TextBox
-{
-public:
- RumblerSeq(Rumbler *plugin, RumblerWindow *gui,
- int &value, int x, int y);
- int handle_event();
- Rumbler *plugin;
- RumblerWindow *gui;
- int *value;
-};
-
-
-class RumblerWindow : public PluginClientWindow
-{
-public:
- RumblerWindow(Rumbler *plugin);
- ~RumblerWindow();
- void create_objects();
-
- Rumbler *plugin;
- RumblerRate *time_rumble, *time_rate;
- RumblerRate *space_rumble, *space_rate;
- RumblerSeq *seq;
-};
-
-class Rumbler : public PluginVClient
-{
-public:
- Rumbler(PluginServer *server);
- ~Rumbler();
+#include "rumbler.h"
- PLUGIN_CLASS_MEMBERS(RumblerConfig)
- int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
- int is_realtime();
- void save_data(KeyFrame *keyframe);
- void read_data(KeyFrame *keyframe);
- void update_gui();
- int handle_opengl();
- static double rumble(int64_t seq, double cur, double per, double amp);
-
- VFrame *input, *output, *temp;
- float x1,y1, x2,y2, x3,y3, x4,y4;
- AffineEngine *engine;
-};
RumblerConfig::RumblerConfig()
+{
+ reset();
+}
+
+void RumblerConfig::reset()
{
time_rumble = 10;
time_rate = 1.;
}
RumblerWindow::RumblerWindow(Rumbler *plugin)
- : PluginClientWindow(plugin, 300, 120, 300, 120, 0)
+ : PluginClientWindow(plugin, 300, 150, 300, 150, 0)
{
this->plugin = plugin;
}
y += title->get_h() + 10;
add_subwindow(title = new BC_Title(x, y, _("seq:")));
add_subwindow(seq = new RumblerSeq(plugin, this, plugin->config.sequence, x1, y));
+ y += 35;
+ add_subwindow(reset = new RumblerReset(plugin, this, x, y));
show_window();
flush();
}
+// for Reset button
+void RumblerWindow::update()
+{
+ time_rumble->update(plugin->config.time_rumble);
+ time_rate->update(plugin->config.time_rate);
+ space_rumble->update(plugin->config.space_rumble);
+ space_rate->update(plugin->config.space_rate);
+ seq->update((int64_t)(plugin->config.sequence));
+}
+
RumblerRate::RumblerRate(Rumbler *plugin, RumblerWindow *gui,
float &value, int x, int y)
}
+RumblerReset::RumblerReset(Rumbler *plugin, RumblerWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+RumblerReset::~RumblerReset()
+{
+}
+int RumblerReset::handle_event()
+{
+ plugin->config.reset();
+ gui->update();
+ plugin->send_configure_change();
+ return 1;
+}
+
+
REGISTER_PLUGIN(Rumbler)
Rumbler::Rumbler(PluginServer *server)
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef RUMBLER_H
+#define RUMBLER_H
+
+#include "bcdisplayinfo.h"
+#include "affine.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "guicast.h"
+#include "keyframe.h"
+#include "language.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+#include <math.h>
+#include <string.h>
+#include <stdint.h>
+
+
+class Rumbler;
+class RumblerConfig;
+class RumblerRate;
+class RumblerSeq;
+class RumblerWindow;
+class RumblerReset;
+
+
+class RumblerConfig
+{
+public:
+ RumblerConfig();
+ void reset();
+ float time_rumble, time_rate;
+ float space_rumble, space_rate;
+ int sequence;
+ void copy_from(RumblerConfig &that);
+ int equivalent(RumblerConfig &that);
+ void interpolate(RumblerConfig &prev, RumblerConfig &next,
+ int64_t prev_frame, int64_t next_frame, int64_t current_frame);
+};
+
+class RumblerRate : public BC_TextBox
+{
+public:
+ RumblerRate(Rumbler *plugin, RumblerWindow *gui,
+ float &value, int x, int y);
+ int handle_event();
+ Rumbler *plugin;
+ RumblerWindow *gui;
+ float *value;
+};
+
+class RumblerSeq : public BC_TextBox
+{
+public:
+ RumblerSeq(Rumbler *plugin, RumblerWindow *gui,
+ int &value, int x, int y);
+ int handle_event();
+ Rumbler *plugin;
+ RumblerWindow *gui;
+ int *value;
+};
+
+class RumblerReset : public BC_GenericButton
+{
+public:
+ RumblerReset(Rumbler *plugin, RumblerWindow *gui, int x, int y);
+ ~RumblerReset();
+ int handle_event();
+ Rumbler *plugin;
+ RumblerWindow *gui;
+};
+
+
+class RumblerWindow : public PluginClientWindow
+{
+public:
+ RumblerWindow(Rumbler *plugin);
+ ~RumblerWindow();
+ void create_objects();
+ void update();
+
+ Rumbler *plugin;
+ RumblerRate *time_rumble, *time_rate;
+ RumblerRate *space_rumble, *space_rate;
+ RumblerSeq *seq;
+ RumblerReset *reset;
+};
+
+class Rumbler : public PluginVClient
+{
+public:
+ Rumbler(PluginServer *server);
+ ~Rumbler();
+
+ PLUGIN_CLASS_MEMBERS(RumblerConfig)
+
+ int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
+ int is_realtime();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+ void update_gui();
+ int handle_opengl();
+ static double rumble(int64_t seq, double cur, double per, double amp);
+
+ VFrame *input, *output, *temp;
+ float x1,y1, x2,y2, x3,y3, x4,y4;
+ AffineEngine *engine;
+};
+
+#endif
*
*/
-#include "bcdisplayinfo.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "guicast.h"
-#include "language.h"
-#include "pluginvclient.h"
-#include "vframe.h"
+#include "shiftinterlace.h"
-#include <stdint.h>
-#include <string.h>
-
-
-
-
-
-
-
-class ShiftInterlaceWindow;
-class ShiftInterlaceMain;
-
-class ShiftInterlaceConfig
-{
-public:
- ShiftInterlaceConfig();
-
- int equivalent(ShiftInterlaceConfig &that);
- void copy_from(ShiftInterlaceConfig &that);
- void interpolate(ShiftInterlaceConfig &prev,
- ShiftInterlaceConfig &next,
- long prev_frame,
- long next_frame,
- long current_frame);
-
-
- int odd_offset;
- int even_offset;
-};
-
-
-class ShiftInterlaceOdd : public BC_ISlider
-{
-public:
- ShiftInterlaceOdd(ShiftInterlaceMain *plugin, int x, int y);
- int handle_event();
- ShiftInterlaceMain *plugin;
-};
-
-class ShiftInterlaceEven : public BC_ISlider
-{
-public:
- ShiftInterlaceEven(ShiftInterlaceMain *plugin, int x, int y);
- int handle_event();
- ShiftInterlaceMain *plugin;
-};
-
-class ShiftInterlaceWindow : public PluginClientWindow
-{
-public:
- ShiftInterlaceWindow(ShiftInterlaceMain *plugin);
-
- void create_objects();
-
- ShiftInterlaceOdd *odd_offset;
- ShiftInterlaceEven *even_offset;
- ShiftInterlaceMain *plugin;
-};
-
-
-
-
-
-
-class ShiftInterlaceMain : public PluginVClient
-{
-public:
- ShiftInterlaceMain(PluginServer *server);
- ~ShiftInterlaceMain();
-
-// required for all realtime plugins
- PLUGIN_CLASS_MEMBERS(ShiftInterlaceConfig)
- int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
- int is_realtime();
- void update_gui();
- void save_data(KeyFrame *keyframe);
- void read_data(KeyFrame *keyframe);
-
-
- void shift_row(VFrame *input_frame,
- VFrame *output_frame,
- int offset,
- int row);
-
-
-};
-
-
PluginClient* new_plugin(PluginServer *server)
ShiftInterlaceConfig::ShiftInterlaceConfig()
+{
+ reset();
+}
+
+void ShiftInterlaceConfig::reset()
{
odd_offset = 0;
even_offset = 0;
ShiftInterlaceWindow::ShiftInterlaceWindow(ShiftInterlaceMain *plugin)
: PluginClientWindow(plugin,
310,
- 100,
+ 110,
310,
- 100,
+ 110,
0)
{
this->plugin = plugin;
y += margin;
add_subwindow(new BC_Title(x, y, _("Even offset:")));
add_subwindow(even_offset = new ShiftInterlaceEven(plugin, x + 90, y));
-
+ y += 40;
+ add_subwindow(reset = new ShiftInterlaceReset(plugin, this, x, y));
show_window();
flush();
}
+// for Reset button
+void ShiftInterlaceWindow::update()
+{
+ odd_offset->update(plugin->config.odd_offset);
+ even_offset->update(plugin->config.even_offset);
+}
+
ShiftInterlaceOdd::ShiftInterlaceOdd(ShiftInterlaceMain *plugin, int x, int y)
+ShiftInterlaceReset::ShiftInterlaceReset(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+ShiftInterlaceReset::~ShiftInterlaceReset()
+{
+}
+int ShiftInterlaceReset::handle_event()
+{
+ plugin->config.reset();
+ gui->update();
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef SHIFTINTERLACE_H
+#define SHIFTINTERLACE_H
+
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "guicast.h"
+#include "language.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+
+
+#include <stdint.h>
+#include <string.h>
+
+
+
+
+
+
+
+class ShiftInterlaceWindow;
+class ShiftInterlaceMain;
+
+class ShiftInterlaceConfig
+{
+public:
+ ShiftInterlaceConfig();
+
+ void reset();
+ int equivalent(ShiftInterlaceConfig &that);
+ void copy_from(ShiftInterlaceConfig &that);
+ void interpolate(ShiftInterlaceConfig &prev,
+ ShiftInterlaceConfig &next,
+ long prev_frame,
+ long next_frame,
+ long current_frame);
+
+
+ int odd_offset;
+ int even_offset;
+};
+
+
+class ShiftInterlaceOdd : public BC_ISlider
+{
+public:
+ ShiftInterlaceOdd(ShiftInterlaceMain *plugin, int x, int y);
+ int handle_event();
+ ShiftInterlaceMain *plugin;
+};
+
+class ShiftInterlaceEven : public BC_ISlider
+{
+public:
+ ShiftInterlaceEven(ShiftInterlaceMain *plugin, int x, int y);
+ int handle_event();
+ ShiftInterlaceMain *plugin;
+};
+
+class ShiftInterlaceReset : public BC_GenericButton
+{
+public:
+ ShiftInterlaceReset(ShiftInterlaceMain *plugin, ShiftInterlaceWindow *gui, int x, int y);
+ ~ShiftInterlaceReset();
+ int handle_event();
+ ShiftInterlaceMain *plugin;
+ ShiftInterlaceWindow *gui;
+};
+
+class ShiftInterlaceWindow : public PluginClientWindow
+{
+public:
+ ShiftInterlaceWindow(ShiftInterlaceMain *plugin);
+
+ void create_objects();
+ void update();
+
+ ShiftInterlaceOdd *odd_offset;
+ ShiftInterlaceEven *even_offset;
+ ShiftInterlaceMain *plugin;
+ ShiftInterlaceReset *reset;
+};
+
+
+
+
+
+
+class ShiftInterlaceMain : public PluginVClient
+{
+public:
+ ShiftInterlaceMain(PluginServer *server);
+ ~ShiftInterlaceMain();
+
+// required for all realtime plugins
+ PLUGIN_CLASS_MEMBERS(ShiftInterlaceConfig)
+ int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
+ int is_realtime();
+ void update_gui();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+
+
+ void shift_row(VFrame *input_frame,
+ VFrame *output_frame,
+ int offset,
+ int row);
+
+
+};
+
+#endif
SwapConfig::SwapConfig()
+{
+ reset_Config();
+}
+
+void SwapConfig::reset_Config()
{
red = RED_SRC;
green = GREEN_SRC;
blue = BLUE_SRC;
- alpha = ALPHA_SRC;
+ alpha = ALPHA_SRC;
}
SwapWindow::SwapWindow(SwapMain *plugin)
: PluginClientWindow(plugin,
250,
- 170,
+ 200,
250,
- 170,
+ 200,
0)
{
this->plugin = plugin;
add_subwindow(alpha = new SwapMenu(plugin, &(plugin->config.alpha), x, y));
alpha->create_objects();
+ y += 40;
+ add_subwindow(reset = new SwapReset(plugin, this, x, y));
+
show_window();
flush();
}
-
SwapMenu::SwapMenu(SwapMain *client, int *output, int x, int y)
: BC_PopupMenu(x, y, 150, client->output_to_text(*output))
{
-
+SwapReset::SwapReset(SwapMain *plugin, SwapWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+SwapReset::~SwapReset()
+{
+}
+int SwapReset::handle_event()
+{
+ plugin->config.reset_Config();
+ plugin->send_configure_change();
+ plugin->update_gui();
+ return 1;
+}
class SwapMain;
+class SwapWindow;
+class SwapReset;
#define RED_SRC 0
#define GREEN_SRC 1
public:
SwapConfig();
+ void reset_Config();
int equivalent(SwapConfig &that);
void copy_from(SwapConfig &that);
char *title;
};
+
+class SwapReset : public BC_GenericButton
+{
+public:
+ SwapReset(SwapMain *plugin, SwapWindow *gui, int x, int y);
+ ~SwapReset();
+ int handle_event();
+ SwapMain *plugin;
+ SwapWindow *gui;
+};
+
+
class SwapWindow : public PluginClientWindow
{
public:
SwapWindow(SwapMain *plugin);
~SwapWindow();
-
void create_objects();
SwapMain *plugin;
SwapMenu *green;
SwapMenu *blue;
SwapMenu *alpha;
+ SwapReset *reset;
};
SwapFramesConfig::SwapFramesConfig()
+{
+ reset();
+}
+
+void SwapFramesConfig::reset()
{
on = 1;
swap_even = 1;
+
+SwapFramesReset::SwapFramesReset(SwapFrames *plugin, SwapFramesWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->gui = gui;
+}
+SwapFramesReset::~SwapFramesReset()
+{
+}
+int SwapFramesReset::handle_event()
+{
+ plugin->config.reset();
+ gui->update();
+ plugin->send_configure_change();
+ return 1;
+}
+
+
+
+
+
SwapFramesWindow::SwapFramesWindow(SwapFrames *plugin)
: PluginClientWindow(plugin,
260,
- 130,
+ 135,
260,
- 130,
+ 135,
0)
{
this->plugin = plugin;
this,
x,
y));
+
+ y += 35;
+ add_subwindow(reset = new SwapFramesReset(plugin, this, x, y));
+
show_window();
}
-
+// for Reset button
+void SwapFramesWindow::update()
+{
+ on->update(plugin->config.swap_even);
+ swap_even->update(plugin->config.swap_even);
+ swap_odd->update(!plugin->config.swap_even);
+}
class SwapFrames;
class SwapFramesWindow;
+class SwapFramesReset;
class SwapFramesConfig
{
public:
SwapFramesConfig();
+ void reset();
int equivalent(SwapFramesConfig &that);
void copy_from(SwapFramesConfig &that);
void interpolate(SwapFramesConfig &prev,
SwapFrames *plugin;
};
+class SwapFramesReset : public BC_GenericButton
+{
+public:
+ SwapFramesReset(SwapFrames *plugin, SwapFramesWindow *gui, int x, int y);
+ ~SwapFramesReset();
+ int handle_event();
+ SwapFrames *plugin;
+ SwapFramesWindow *gui;
+};
+
class SwapFramesWindow : public PluginClientWindow
{
public:
SwapFramesWindow(SwapFrames *plugin);
void create_objects();
+ void update();
SwapFramesOn *on;
SwapFramesEven *swap_even;
SwapFramesOdd *swap_odd;
SwapFrames *plugin;
+ SwapFramesReset *reset;
};
REGISTER_PLUGIN(TranslateMain)
TranslateConfig::TranslateConfig()
+{
+ reset();
+}
+
+void TranslateConfig::reset()
{
in_x = 0;
in_y = 0;
out_h = 480;
}
+
int TranslateConfig::equivalent(TranslateConfig &that)
{
return EQUIV(in_x, that.in_x) &&
{
public:
TranslateConfig();
+ void reset();
int equivalent(TranslateConfig &that);
void copy_from(TranslateConfig &that);
void interpolate(TranslateConfig &prev,
TranslateWin::TranslateWin(TranslateMain *client)
: PluginClientWindow(client,
300,
- 220,
+ 250,
300,
- 220,
+ 250,
0)
{
this->client = client;
y += 20;
in_h = new TranslateCoord(this, client, x, y, &client->config.in_h);
in_h->create_objects();
- y += 30;
+ y += 40;
+ add_tool(reset = new TranslateReset(client, this, x, y));
x += 150;
y = 10;
out_h->create_objects();
y += 30;
-
-
show_window();
flush();
}
+void TranslateWin::update()
+{
+ in_x->update((int64_t)client->config.in_x);
+ in_y->update((int64_t)client->config.in_y);
+ in_w->update((int64_t)client->config.in_w);
+ in_h->update((int64_t)client->config.in_h);
+ out_x->update((int64_t)client->config.out_x);
+ out_y->update((int64_t)client->config.out_y);
+ out_y->update((int64_t)client->config.out_y);
+ out_w->update((int64_t)client->config.out_w);
+ out_h->update((int64_t)client->config.out_h);
+}
+
TranslateCoord::TranslateCoord(TranslateWin *win,
return 1;
}
-
+TranslateReset::TranslateReset(TranslateMain *client, TranslateWin *win, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->client = client;
+ this->win = win;
+}
+TranslateReset::~TranslateReset()
+{
+}
+int TranslateReset::handle_event()
+{
+ client->config.reset();
+ win->update();
+ client->send_configure_change();
+ return 1;
+}
class TranslateThread;
class TranslateWin;
+class TranslateReset;
#include "filexml.h"
#include "mutex.h"
~TranslateWin();
void create_objects();
+ void update();
TranslateCoord *in_x, *in_y, *in_w, *in_h, *out_x, *out_y, *out_w, *out_h;
TranslateMain *client;
+ TranslateReset *reset;
};
class TranslateCoord : public BC_TumbleTextBox
float *value;
};
+class TranslateReset : public BC_GenericButton
+{
+public:
+ TranslateReset(TranslateMain *client, TranslateWin *win, int x, int y);
+ ~TranslateReset();
+ int handle_event();
+ TranslateMain *client;
+ TranslateWin *win;
+};
#endif
UnsharpConfig::UnsharpConfig()
+{
+ reset();
+}
+
+void UnsharpConfig::reset()
{
radius = 5;
amount = 0.5;
{
public:
UnsharpConfig();
+ void reset();
int equivalent(UnsharpConfig &that);
void copy_from(UnsharpConfig &that);
UnsharpWindow::UnsharpWindow(UnsharpMain *plugin)
- : PluginClientWindow(plugin, 285, 160, 285, 160, 0)
+ : PluginClientWindow(plugin, 285, 170, 285, 170, 0)
{
this->plugin = plugin;
}
void UnsharpWindow::create_objects()
{
- int x = 10, y = 10;
+ int x = 10, y = 10, x1 = 90;
BC_Title *title;
add_subwindow(title = new BC_Title(x, y + 10, _("Radius:")));
- add_subwindow(radius = new UnsharpRadius(plugin,
- x + title->get_w() + 10,
- y));
+ add_subwindow(radius = new UnsharpRadius(plugin, x + x1, y));
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Amount:")));
- add_subwindow(amount = new UnsharpAmount(plugin,
- x + title->get_w() + 10,
- y));
+ add_subwindow(amount = new UnsharpAmount(plugin, x + x1, y));
y += 40;
add_subwindow(title = new BC_Title(x, y + 10, _("Threshold:")));
- add_subwindow(threshold = new UnsharpThreshold(plugin,
- x + title->get_w() + 10,
- y));
+ add_subwindow(threshold = new UnsharpThreshold(plugin, x + x1, y));
+
+ y += 50;
+ add_subwindow(reset = new UnsharpReset(plugin, this, x, y));
show_window();
flush();
return 1;
}
-
+UnsharpReset::UnsharpReset(UnsharpMain *plugin, UnsharpWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+UnsharpReset::~UnsharpReset()
+{
+}
+int UnsharpReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
UnsharpMain *plugin;
};
+class UnsharpReset : public BC_GenericButton
+{
+public:
+ UnsharpReset(UnsharpMain *plugin, UnsharpWindow *window, int x, int y);
+ ~UnsharpReset();
+ int handle_event();
+ UnsharpMain *plugin;
+ UnsharpWindow *window;
+};
+
class UnsharpWindow : public PluginClientWindow
{
public:
UnsharpAmount *amount;
UnsharpThreshold *threshold;
UnsharpMain *plugin;
+ UnsharpReset *reset;
};
class YUVEffect;
+class YUVWindow;
+class YUVReset;
class YUVConfig
{
public:
YUVConfig();
+ void reset();
void copy_from(YUVConfig &src);
int equivalent(YUVConfig &src);
float *output;
};
+class YUVReset : public BC_GenericButton
+{
+public:
+ YUVReset(YUVEffect *plugin, YUVWindow *window, int x, int y);
+ ~YUVReset();
+ int handle_event();
+ YUVEffect *plugin;
+ YUVWindow *window;
+};
+
class YUVWindow : public PluginClientWindow
{
public:
YUVWindow(YUVEffect *plugin);
void create_objects();
+ void update();
YUVLevel *y, *u, *v;
YUVEffect *plugin;
+ YUVReset *reset;
};
YUVConfig::YUVConfig()
+{
+ reset();
+}
+
+void YUVConfig::reset()
{
y = 0;
u = 0;
}
+YUVReset::YUVReset(YUVEffect *plugin, YUVWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+YUVReset::~YUVReset()
+{
+}
+int YUVReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
+
+
YUVWindow::YUVWindow(YUVEffect *plugin)
: PluginClientWindow(plugin,
260,
- 100,
+ 135,
260,
- 100,
+ 135,
0)
{
this->plugin = plugin;
void YUVWindow::create_objects()
{
- int x = 10, y = 10, x1 = 50;
+ int x = 10, y = 10, x1 = 40;
add_subwindow(new BC_Title(x, y, _("Y:")));
add_subwindow(this->y = new YUVLevel(plugin, &plugin->config.y, x1, y));
y += 30;
y += 30;
add_subwindow(new BC_Title(x, y, _("V:")));
add_subwindow(v = new YUVLevel(plugin, &plugin->config.v, x1, y));
+ y += 35;
+ add_subwindow(reset = new YUVReset(plugin, this, x, y));
show_window();
flush();
}
-
+// for Reset button
+void YUVWindow::update()
+{
+ this->y->update(plugin->config.y);
+ u->update(plugin->config.u);
+ v->update(plugin->config.v);
+}
yuv411Config::yuv411Config()
+{
+ reset();
+}
+
+void yuv411Config::reset()
{
int_horizontal = 0;
avg_vertical = 0;
{
public:
yuv411Config();
+ void reset();
+
void copy_from(yuv411Config &that);
int equivalent(yuv411Config &that);
void interpolate(yuv411Config &prev, yuv411Config &next,
#include "language.h"
yuv411Window::yuv411Window(yuv411Main *client)
- : PluginClientWindow(client, 250, 220, 250, 220, 0)
+ : PluginClientWindow(client, 250, 255, 250, 255, 0)
{
this->client = client;
}
add_subwindow(new BC_Title(x, y, _("Bias:")));
add_subwindow(bias=new yuv411Bias(client,x1,y));
y += 30;
+ add_subwindow(reset = new yuv411Reset(client, this, x, y+35));
show_window();
flush();
yuv_warning->hide_window();
}
+void yuv411Window::update()
+{
+ avg_vertical->update(client->config.avg_vertical);
+ int_horizontal->update(client->config.int_horizontal);
+ inpainting->update(client->config.inpainting);
+ offset->update(client->config.offset);
+ thresh->update(client->config.thresh);
+ bias->update(client->config.bias);
+}
+
int yuv411Window::close_event()
{
set_done(1);
return 1;
}
+yuv411Reset::yuv411Reset(yuv411Main *client, yuv411Window *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->client = client;
+ this->window = window;
+}
+yuv411Reset::~yuv411Reset()
+{
+}
+int yuv411Reset::handle_event()
+{
+ client->config.reset();
+ window->update();
+ window->update_enables();
+ client->send_configure_change();
+ return 1;
+}
+
+
void yuv411Window::update_enables()
{
yuv411Config &config = client->config;
class yuv411Offset;
class yuv411Thresh;
class yuv411Bias;
+class yuv411Reset;
class yuv411Window : public PluginClientWindow
{
~yuv411Window();
void create_objects();
+ void update();
int close_event();
void update_enables();
void show_warning(int warn);
yuv411Thresh *thresh;
yuv411Bias *bias;
BC_Title *yuv_warning;
+ yuv411Reset *reset;
};
class yuv411Toggle : public BC_CheckBox
yuv411Main *client;
};
+class yuv411Reset : public BC_GenericButton
+{
+public:
+ yuv411Reset(yuv411Main *client, yuv411Window *window, int x, int y);
+ ~yuv411Reset();
+ int handle_event();
+ yuv411Main *client;
+ yuv411Window *window;
+};
+
#endif
*
*/
-#include "bcdisplayinfo.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "guicast.h"
-#include "language.h"
-#include "bccolors.h"
-#include "pluginvclient.h"
-#include "vframe.h"
-
-#include <stdint.h>
-#include <string.h>
-
-
-class YUVShiftEffect;
-
-
-class YUVShiftConfig
-{
-public:
- YUVShiftConfig();
-
- void copy_from(YUVShiftConfig &src);
- int equivalent(YUVShiftConfig &src);
- void interpolate(YUVShiftConfig &prev,
- YUVShiftConfig &next,
- long prev_frame,
- long next_frame,
- long current_frame);
-
- int y_dx, y_dy, u_dx, u_dy, v_dx, v_dy;
-};
-
-class YUVShiftLevel : public BC_ISlider
-{
-public:
- YUVShiftLevel(YUVShiftEffect *plugin, int *output, int x, int y);
- int handle_event();
- YUVShiftEffect *plugin;
- int *output;
-};
-
-class YUVShiftWindow : public PluginClientWindow
-{
-public:
- YUVShiftWindow(YUVShiftEffect *plugin);
- void create_objects();
- YUVShiftLevel *y_dx, *y_dy, *u_dx, *u_dy, *v_dx, *v_dy;
- YUVShiftEffect *plugin;
-};
-
-
-
-class YUVShiftEffect : public PluginVClient
-{
- VFrame *temp_frame;
-public:
- YUVShiftEffect(PluginServer *server);
- ~YUVShiftEffect();
-
-
- PLUGIN_CLASS_MEMBERS(YUVShiftConfig)
- int process_realtime(VFrame *input, VFrame *output);
- int is_realtime();
- void save_data(KeyFrame *keyframe);
- void read_data(KeyFrame *keyframe);
- void update_gui();
-};
-
-
+#include "yuvshift.h"
-
YUVShiftConfig::YUVShiftConfig()
+{
+ reset();
+}
+
+void YUVShiftConfig::reset()
{
y_dx = y_dy = 0;
u_dx = u_dy = 0;
}
+YUVShiftReset::YUVShiftReset(YUVShiftEffect *plugin, YUVShiftWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+ this->plugin = plugin;
+ this->window = window;
+}
+YUVShiftReset::~YUVShiftReset()
+{
+}
+int YUVShiftReset::handle_event()
+{
+ plugin->config.reset();
+ window->update();
+ plugin->send_configure_change();
+ return 1;
+}
+
+
YUVShiftWindow::YUVShiftWindow(YUVShiftEffect *plugin)
- : PluginClientWindow(plugin, 300, 200, 300, 200, 0)
+ : PluginClientWindow(plugin, 300, 230, 300, 230, 0)
{
this->plugin = plugin;
}
add_subwindow(new BC_Title(x, y, _("V_dy:")));
add_subwindow(v_dy = new YUVShiftLevel(plugin, &plugin->config.v_dy, x1, y));
+ y += 40;
+ add_subwindow(reset = new YUVShiftReset(plugin, this, x, y));
+
show_window();
flush();
}
-
+// for Reset button
+void YUVShiftWindow::update()
+{
+ 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);
+}
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef YUVSHIFT_H
+#define YUVSHIFT_H
+
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "guicast.h"
+#include "language.h"
+#include "bccolors.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+#include <stdint.h>
+#include <string.h>
+
+
+class YUVShiftEffect;
+class YUVShiftWindow;
+class YUVShiftReset;
+
+
+class YUVShiftConfig
+{
+public:
+ YUVShiftConfig();
+
+ void reset();
+ void copy_from(YUVShiftConfig &src);
+ int equivalent(YUVShiftConfig &src);
+ void interpolate(YUVShiftConfig &prev,
+ YUVShiftConfig &next,
+ long prev_frame,
+ long next_frame,
+ long current_frame);
+
+ int y_dx, y_dy, u_dx, u_dy, v_dx, v_dy;
+};
+
+class YUVShiftLevel : public BC_ISlider
+{
+public:
+ YUVShiftLevel(YUVShiftEffect *plugin, int *output, int x, int y);
+ int handle_event();
+ YUVShiftEffect *plugin;
+ int *output;
+};
+
+class YUVShiftReset : public BC_GenericButton
+{
+public:
+ YUVShiftReset(YUVShiftEffect *plugin, YUVShiftWindow *window, int x, int y);
+ ~YUVShiftReset();
+ int handle_event();
+ YUVShiftEffect *plugin;
+ YUVShiftWindow *window;
+};
+
+class YUVShiftWindow : public PluginClientWindow
+{
+public:
+ YUVShiftWindow(YUVShiftEffect *plugin);
+ void create_objects();
+ void update();
+ YUVShiftLevel *y_dx, *y_dy, *u_dx, *u_dy, *v_dx, *v_dy;
+ YUVShiftEffect *plugin;
+ YUVShiftReset *reset;
+};
+
+
+
+class YUVShiftEffect : public PluginVClient
+{
+ VFrame *temp_frame;
+public:
+ YUVShiftEffect(PluginServer *server);
+ ~YUVShiftEffect();
+
+
+ PLUGIN_CLASS_MEMBERS(YUVShiftConfig)
+ int process_realtime(VFrame *input, VFrame *output);
+ int is_realtime();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+ void update_gui();
+};
+
+#endif