$(OBJDIR)/shuttle.o: shuttle.C shuttle_keys.h
shuttle_keys.h: /usr/include/X11/keysymdef.h
- sed < /usr/include/X11/keysymdef.h > shuttle_keys.h -f shuttle.sed
+ sed -n < /usr/include/X11/keysymdef.h > shuttle_keys.h -f shuttle.sed
$(OBJDIR)/lv2ui: $(LV2OBJS)
@echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
copy_edl->copy_all(edl);
FileXML file;
double start = 0, end = edl->tracks->total_length();
- copy_edl->copy(start, end, 1, &file, "", 1);
+ copy_edl->copy(COPY_EDL, start, end, &file, "", 1);
copy_edl->remove_user();
const char *file_string = file.string();
long file_length = strlen(file_string);
// The string is not terminated in this call.
int EDL::save_xml(FileXML *file, const char *output_path)
{
- copy(1, file, output_path, 0);
+ copy(COPY_EDL, file, output_path, 0);
return 0;
}
}
}
-int EDL::copy_assets(double start,
- double end,
- FileXML *file,
- int all,
- const char *output_path)
+int EDL::copy_assets(int copy_flags, double start, double end,
+ FileXML *file, const char *output_path)
{
ArrayList<Asset*> asset_list;
Track* current;
file->append_newline();
// Copy everything for a save
- if( all ) {
+ if( (copy_flags & COPY_ALL_ASSETS) ) {
for( Asset *asset=assets->first; asset; asset=asset->next ) {
asset_list.append(asset);
}
}
- else {
+ if( (copy_flags & COPY_USED_ASSETS) ) {
// Copy just the ones being used.
for( current = tracks->first; current; current = NEXT ) {
if( !current->record ) continue;
}
-int EDL::copy(double start, double end, int all,
+int EDL::copy(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it)
{
file->tag.set_title("EDL");
file->tag.set_property("VERSION", CINELERRA_VERSION);
// Save path for restoration of the project title from a backup.
if( this->path[0] ) file->tag.set_property("PATH", path);
- return copy(start, end, all,
- "/EDL", file, output_path, rewind_it);
+ return copy_xml(copy_flags, start, end, file, "/EDL", output_path, rewind_it);
}
-int EDL::copy(int all, FileXML *file, const char *output_path, int rewind_it)
+int EDL::copy(int copy_flags, FileXML *file, const char *output_path, int rewind_it)
{
- return copy(0, tracks->total_length(), all, file, output_path, rewind_it);
+ return copy(copy_flags, 0., tracks->total_length(),
+ file, output_path, rewind_it);
}
-int EDL::copy_clip(double start, double end, int all,
+int EDL::copy_clip(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it)
{
file->tag.set_title("CLIP_EDL");
- return copy(start, end, all,
- "/CLIP_EDL", file, output_path, rewind_it);
+ return copy_xml(copy_flags, start, end, file, "/CLIP_EDL", output_path, rewind_it);
}
-int EDL::copy_clip(int all, FileXML *file, const char *output_path, int rewind_it)
+int EDL::copy_clip(int copy_flags, FileXML *file, const char *output_path, int rewind_it)
{
- return copy_clip(0, tracks->total_length(), all, file, output_path, rewind_it);
+ return copy_clip(copy_flags, 0., tracks->total_length(),
+ file, output_path, rewind_it);
}
-int EDL::copy_nested_edl(double start, double end, int all,
+int EDL::copy_nested(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it)
{
file->tag.set_title("NESTED_EDL");
if( this->path[0] ) file->tag.set_property("PATH", path);
- return copy(start, end, all,
- "/NESTED_EDL", file, output_path, rewind_it);
+ return copy_xml(copy_flags, start, end, file, "/NESTED_EDL", output_path, rewind_it);
}
-int EDL::copy_nested_edl(int all, FileXML *file, const char *output_path, int rewind_it)
+int EDL::copy_nested(int copy_flags, FileXML *file, const char *output_path, int rewind_it)
{
- return copy_nested_edl(0, tracks->total_length(), all, file, output_path, rewind_it);
+ return copy_nested(copy_flags, 0., tracks->total_length(),
+ file, output_path, rewind_it);
}
-int EDL::copy_vwindow_edl(double start, double end, int all,
+int EDL::copy_vwindow(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it)
{
file->tag.set_title("VWINDOW_EDL");
- return copy(start, end, all,
- "/VWINDOW_EDL", file, output_path, rewind_it);
+ return copy_xml(copy_flags, start, end, file, "/VWINDOW_EDL", output_path, rewind_it);
}
-int EDL::copy_vwindow_edl(int all, FileXML *file, const char *output_path, int rewind_it)
+int EDL::copy_vwindow(int copy_flags, FileXML *file, const char *output_path, int rewind_it)
{
- return copy_vwindow_edl(0, tracks->total_length(), all, file, output_path, rewind_it);
+ return copy_vwindow(copy_flags, 0., tracks->total_length(),
+ file, output_path, rewind_it);
}
-
-int EDL::copy(double start, double end, int all,
- const char *closer, FileXML *file,
- const char *output_path, int rewind_it)
+int EDL::copy_xml(int copy_flags, double start, double end,
+ FileXML *file, const char *closer, const char *output_path,
+ int rewind_it)
{
file->append_tag();
file->append_newline();
// Set clipboard samples only if copying to clipboard
- if( !all ) {
+ if( (copy_flags & COPY_LENGTH) ) {
file->tag.set_title("CLIPBOARD");
file->tag.set_property("LENGTH", end - start);
file->append_tag();
//printf("EDL::copy 1\n");
// Sessions
- local_session->save_xml(file, start);
-
-//printf("EDL::copy 1\n");
+ if( (copy_flags & COPY_LOCAL_SESSION) )
+ local_session->save_xml(file, start);
// Top level stuff.
-// if(!parent_edl)
- {
// Need to copy all this from child EDL if pasting is desired.
-// Session
+
+ if( (copy_flags & COPY_SESSION) )
session->save_xml(file);
+
+ if( (copy_flags & COPY_VIDEO_CONFIG) )
session->save_video_config(file);
+
+ if( (copy_flags & COPY_AUDIO_CONFIG) )
session->save_audio_config(file);
+
+ if( (copy_flags & COPY_FOLDERS) )
folders.save_xml(file);
- if( !parent_edl )
- copy_assets(start, end, file, all, output_path);
+ if( (copy_flags & (COPY_ALL_ASSETS | COPY_USED_ASSETS)) )
+ copy_assets(copy_flags, start, end, file, output_path);
+ if( (copy_flags & COPY_NESTED_EDL) ) {
for( int i=0; i<nested_edls.size(); ++i )
- nested_edls[i]->copy_nested_edl(0, tracks->total_length(), 1,
+ nested_edls[i]->copy_nested(copy_flags,
file, output_path, 0);
-
+ }
// Clips
-// Don't want this if using clipboard
- if( all ) {
- for( int i=0; i<total_vwindow_edls(); ++i )
- get_vwindow_edl(i)->copy_vwindow_edl(1, file, output_path, 0);
+ if( (copy_flags & COPY_CLIPS) ) {
+ for( int i=0; i<clips.size(); ++i )
+ clips[i]->copy_clip(copy_flags, file, output_path, 0);
+ }
- for( int i=0; i<clips.size(); ++i )
- clips[i]->copy_clip(1, file, output_path, 0);
+ if( (copy_flags & COPY_VWINDOWS) ) {
+ for( int i=0; i<total_vwindow_edls(); ++i )
+ get_vwindow_edl(i)->copy_vwindow(copy_flags,
+ file, output_path, 0);
+ }
- mixers.save(file);
- }
+ if( (copy_flags & COPY_MIXERS) )
+ mixers.save(file);
- file->append_newline();
- file->append_newline();
- }
+ file->append_newline();
+ file->append_newline();
+
+ if( (copy_flags & COPY_LABELS) )
+ labels->copy(start, end, file);
- labels->copy(start, end, file);
- tracks->copy(start, end, all, file, output_path);
+ tracks->copy(copy_flags, start, end, file, output_path);
// terminate file
file->tag.set_title(closer);
void rechannel();
void resample(double old_rate, double new_rate, int data_type);
- int copy(double start, double end, int all,
+ int copy(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it);
- int copy(int all, FileXML *file, const char *output_path, int rewind_it);
+ int copy(int copy_flags, FileXML *file, const char *output_path,
+ int rewind_it);
- int copy_clip(double start, double end, int all,
+ int copy_clip(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it);
- int copy_clip(int all, FileXML *file, const char *output_path, int rewind_it);
+ int copy_clip(int copy_flags, FileXML *file, const char *output_path,
+ int rewind_it);
- int copy_nested_edl(double start, double end, int all,
+ int copy_nested(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it);
- int copy_nested_edl(int all, FileXML *file, const char *output_path, int rewind_it);
+ int copy_nested(int copy_flags, FileXML *file, const char *output_path,
+ int rewind_it);
- int copy_vwindow_edl(double start, double end, int all,
+ int copy_vwindow(int copy_flags, double start, double end,
FileXML *file, const char *output_path, int rewind_it);
- int copy_vwindow_edl(int all, FileXML *file, const char *output_path, int rewind_it);
+ int copy_vwindow(int copy_flags, FileXML *file, const char *output_path,
+ int rewind_it);
+
+ int copy_xml(int copy_flags, double start, double end,
+ FileXML *file, const char *closer, const char *output_path,
+ int rewind_it);
void copy_tracks(EDL *edl);
// Copies project path, folders, EDLSession, and LocalSession from edl argument.
int edit_labels, int edit_plugins, int edit_autos);
// Editing functions
- int copy_assets(double start, double end,
- FileXML *file, int all, const char *output_path);
- int copy(double start, double end, int all,
- const char *closer, FileXML *file,
- const char *output_path, int rewind_it);
+ int copy_assets(int copy_flags, double start, double end,
+ FileXML *file, const char *output_path);
void copy_indexables(EDL *edl);
EDL *new_nested(EDL *edl, const char *path);
EDL *create_nested_clip(EDL *nested);
#define LOAD_ASSETS 0x00000080
#define LOAD_SESSION 0x00000100
+// Copy flags
+#define COPY_ALL 0x00000001
+#define COPY_LENGTH 0x00000002
+#define COPY_LOCAL_SESSION 0x00000004
+#define COPY_SESSION 0x00000008
+#define COPY_VIDEO_CONFIG 0x00000010
+#define COPY_AUDIO_CONFIG 0x00000020
+#define COPY_FOLDERS 0x00000040
+#define COPY_ALL_ASSETS 0x00000080
+#define COPY_USED_ASSETS 0x00000100
+#define COPY_NESTED_EDL 0x00000200
+#define COPY_CLIPS 0x00000400
+#define COPY_VWINDOWS 0x00000800
+#define COPY_MIXERS 0x00001000
+#define COPY_LABELS 0x00002000
+#define COPY_EDITS 0x00004000
+#define COPY_AUTOS 0x00008000
+#define COPY_PLUGINS 0x00010000
+
+#define COPY_ALWAYS ( \
+ COPY_LOCAL_SESSION | \
+ COPY_SESSION | \
+ COPY_VIDEO_CONFIG | \
+ COPY_AUDIO_CONFIG | \
+ COPY_FOLDERS | \
+ COPY_NESTED_EDL )
+
+#define COPY_TRACKS ( \
+ COPY_EDITS | \
+ COPY_AUTOS | \
+ COPY_PLUGINS )
+
+#define COPY_EDL ( \
+ COPY_ALL | \
+ COPY_ALWAYS | \
+ COPY_ALL_ASSETS | \
+ COPY_CLIPS | \
+ COPY_VWINDOWS | \
+ COPY_MIXERS | \
+ COPY_LABELS | \
+ COPY_TRACKS )
+
+#define COPY_CLIPBOARD ( \
+ COPY_LENGTH | \
+ COPY_ALWAYS | \
+ COPY_USED_ASSETS | \
+ COPY_LABELS | \
+ COPY_TRACKS )
#define EDITING_MODES 2
void clear_labels();
int clear_labels(double start, double end);
void concatenate_tracks();
+ int copy_flags(int copy_flags=COPY_CLIPBOARD);
void copy();
int copy(double start, double end);
void cut();
}
+int MWindow::copy_flags(int copy_flags)
+{
+ if( !edl->session->labels_follow_edits )
+ copy_flags &= ~COPY_LABELS;
+ if( !edl->session->autos_follow_edits )
+ copy_flags &= ~COPY_AUTOS;
+ if( !edl->session->plugins_follow_edits )
+ copy_flags &= ~COPY_PLUGINS;
+ return copy_flags;
+}
+
void MWindow::copy()
{
copy(edl->local_session->get_selectionstart(),
if( start == end ) return 1;
FileXML file;
- edl->copy(start, end, 0, &file, "", 1);
+ edl->copy(copy_flags(), start, end, &file, "", 1);
const char *file_string = file.string();
long file_length = strlen(file_string);
gui->to_clipboard(file_string, file_length, BC_PRIMARY_SELECTION);
edl->session->autos_follow_edits,
edl->session->plugins_follow_edits);
if( !new_edl ) return;
- double length = new_edl->tracks->total_length();
FileXML file;
- new_edl->copy(0, length, 1, &file, "", 1);
+ new_edl->copy(COPY_EDL, &file, "", 1);
const char *file_string = file.string();
long file_length = strlen(file_string);
gui->to_clipboard(file_string, file_length, BC_PRIMARY_SELECTION);
overwrite_len = dst_len;
}
- source->copy(src_start, src_start + overwrite_len, 0, &file, "", 1);
+ source->copy(copy_flags(), src_start, src_start + overwrite_len, &file, "", 1);
// HACK around paste_edl get_start/endselection on its own
// so we need to clear only when not using both io points
if( load_mode == LOADMODE_CONCATENATE ||
load_mode == LOADMODE_PASTE ||
load_mode == LOADMODE_NESTED ) {
-//PRINT_TRACE
-
-// The point of this is to shift forward labels after the selection so they can
-// then be shifted back to their original locations without recursively
-// shifting back every paste.
- if( (load_mode == LOADMODE_PASTE || load_mode == LOADMODE_NESTED) &&
- edl->session->labels_follow_edits )
- edl->labels->clear(edl->local_session->get_selectionstart(),
- edl->local_session->get_selectionend(), 1);
-
Track *current = first_track ? first_track : edl->tracks->first;
for( ; current; current=NEXT ) {
if( current->record ) {
}
}
//PRINT_TRACE
-
}
//PRINT_TRACE
int destination_track = 0;
src->outpoint_valid() ? src->get_outpoint() :
src->inpoint_valid() ? source->tracks->total_length() :
src->get_selectionend();
- source->copy(source_start, source_end, 1, &file, "", 1);
+ source->copy(COPY_EDL, source_start, source_end, &file, "", 1);
//file.dump();
double start = edl->local_session->get_selectionstart();
//double end = edl->local_session->get_selectionend();
}
// Don't copy all since we don't want the clips twice.
- edl->copy(start, end, 0, &file, "", 1);
+ edl->copy(copy_flags(), start, end, &file, "", 1);
EDL *new_edl = new EDL(edl);
new_edl->create_objects();
copy_edl->copy_all(edl);
FileXML file;
double start = 0, end = edl->tracks->total_length();
- copy_edl->copy(start, end, 1, &file, "", 1);
+ copy_edl->copy(COPY_EDL, start, end, &file, "", 1);
copy_edl->remove_user();
const char *file_string = file.string();
long file_length = strlen(file_string);
-/^\#ifdef/p
-/^\#endif/p
-/^\#define/!d
-s/^\#define //
-s/^\([^[:space:]]*\).*$/{ "\1", \1 }, /
+:n1 # just if these
+s/^#ifdef XK_MISCELLANY\>.*//p; t n2
+s/^#ifdef XK_XKB_KEYS\>.*//p; t n2
+s/^#ifdef XK_LATIN1\>.*//p; t n2
+n; b n1
+:n2 # until endif
+s/^#endif\>.*//p; t n1
+s/^#define \([^[:space:]]*\).*$/{ "\1", \1 }, /p
+n; b n2
-int Track::copy(double start,
- double end,
- FileXML *file,
- const char *output_path)
+int Track::copy(int copy_flags, double start, double end,
+ FileXML *file, const char *output_path)
{
// Use a copy of the selection in converted units
// So copy_automation doesn't reconvert.
// file->append_tag();
// file->append_newline();
- edits->copy(start_unit, end_unit, file, output_path);
-
- AutoConf auto_conf;
- auto_conf.set_all(1);
- automation->copy(start_unit, end_unit, file, 0, 0);
+ if( (copy_flags & COPY_EDITS) )
+ edits->copy(start_unit, end_unit, file, output_path);
+ if( (copy_flags & COPY_AUTOS) ) {
+ AutoConf auto_conf;
+ auto_conf.set_all(1);
+ automation->copy(start_unit, end_unit, file, 0, 0);
+ }
- for(int i = 0; i < plugin_set.total; i++)
- {
- plugin_set.values[i]->copy(start_unit, end_unit, file);
+ if( (copy_flags & COPY_PLUGINS) ) {
+ for( int i=0; i<plugin_set.total; ++i )
+ plugin_set.values[i]->copy(start_unit, end_unit, file);
}
copy_derived(start_unit, end_unit, file);
virtual int dump(FILE *fp);
// ===================================== editing
- int copy(double start, double end,
+ int copy(int copy_flags, double start, double end,
FileXML *file, const char *output_path = "");
- int copy_assets(double start,
- double end,
- ArrayList<Asset*> *asset_list);
+ int copy_assets(double start, double end, ArrayList<Asset*> *asset_list);
virtual int copy_derived(int64_t start, int64_t end, FileXML *file) { return 0; };
virtual int paste_derived(int64_t start, int64_t end,
int64_t total_length, FileXML *file, int ¤t_channel) { return 0; };
void copy_from(Tracks *tracks);
// ================================== EDL editing
- int copy(double start,
- double end,
- int all,
- FileXML *file,
- const char *output_path = "");
-
+ int copy(int copy_flags, double start, double end,
+ FileXML *file, const char *output_path = "");
-
- int copy_assets(FileXML *xml,
- double start,
- double end,
- int all);
+ int copy_assets(int copy_flags, FileXML *xml, double start, double end);
int blade(double position);
int clear(double start, double end, int clear_plugins, int edit_autos);
void clear_automation(double selectionstart,
}
FileXML track_xml;
- source_track->copy(source_start, source_end, &track_xml, "");
+ source_track->copy(COPY_TRACKS, source_start, source_end, &track_xml, "");
if( !track_xml.read_tag() )
clip_track->load(&track_xml, 0, LOAD_ALL);
// =========================================== EDL editing
-int Tracks::copy(double start,
- double end,
- int all,
- FileXML *file,
- const char *output_path)
+int Tracks::copy(int copy_flags, double start, double end,
+ FileXML *file, const char *output_path)
{
-// nothing selected
- if(start == end && !all) return 1;
-
- Track* current;
-
- for(current = first;
- current;
- current = NEXT)
- {
- if(current->record || all)
- {
- current->copy(start, end, file,output_path);
- }
+ int all = (copy_flags & COPY_ALL) ? 1 : 0;
+// if nothing selected
+ if( start == end && !all ) return 1;
+ for( Track *track=first; track; track=track->next ) {
+ if( track->record || all )
+ track->copy(copy_flags, start, end, file, output_path);
}
-
return 0;
}
copy_edl->create_objects();
copy_edl->copy_all(edl);
FileXML file;
- copy_edl->copy(start, end, 0, &file, "", 1);
+ copy_edl->copy(COPY_CLIPBOARD, start, end, &file, "", 1);
copy_edl->remove_user();
const char *file_string = file.string();
long file_length = strlen(file_string);
SampleZoomPanel::SampleZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
: ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_sample,
- x, y, 110, MIN_ZOOM_TIME, MAX_ZOOM_TIME, ZOOM_TIME)
+ x, y, 130, MIN_ZOOM_TIME, MAX_ZOOM_TIME, ZOOM_TIME)
{
this->mwindow = mwindow;
this->zoombar = zoombar;
AmpZoomPanel::AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
: ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_y,
- x, y, 80, MIN_AMP_ZOOM, MAX_AMP_ZOOM, ZOOM_LONG)
+ x, y, 100, MIN_AMP_ZOOM, MAX_AMP_ZOOM, ZOOM_LONG)
{
this->mwindow = mwindow;
this->zoombar = zoombar;
TrackZoomPanel::TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
: ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_track,
- x, y, 70, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG)
+ x, y, 90, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG)
{
this->mwindow = mwindow;
this->zoombar = zoombar;