float change = v - current->get_value();
current->set_value(v);
- if( track->gang && track->record )
+ if( track->is_ganged() && track->is_armed() )
patchbay->synchronize_faders(change, TRACK_AUDIO, track);
mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION);
change_source = 0;
x2, y, xS(80), yS(24), clr_color, clr_alpha));
draw_3d_border(x2-2,y-2, xS(80)+4,xS(24)+4, 1);
cwdw_bg_color->create_objects();
+ x2 += cwdw_bg_color->get_w();
y += ys35;
- x = x1;
- add_subwindow(title = new BC_Title(x, y, _("YUV color space:")));
- x += title->get_w() + margin;
+ add_subwindow(title = new BC_Title(x1, y, _("YUV color space:")));
+ x = x2 - xS(120);
add_subwindow(yuv_color_space = new YuvColorSpace(x, y, pwindow));
yuv_color_space->create_objects();
y += yuv_color_space->get_h() + ys5;
- x = x1;
- add_subwindow(title = new BC_Title(x, y, _("YUV color range:")));
- x += title->get_w() + margin;
+ add_subwindow(title = new BC_Title(x1, y, _("YUV color range:")));
+ x = x2 - xS(100);
add_subwindow(yuv_color_range = new YuvColorRange(x, y, pwindow));
yuv_color_range->create_objects();
y += yuv_color_range->get_h() + ys35;
class YuvColorSpace : public BC_PopupMenu
{
- static const char *color_space[3];
public:
+ static const char *color_space[3];
YuvColorSpace(int x, int y, PreferencesWindow *pwindow);
~YuvColorSpace();
class YuvColorRange : public BC_PopupMenu
{
- static const char *color_range[2];
public:
+ static const char *color_range[2];
YuvColorRange(int x, int y, PreferencesWindow *pwindow);
~YuvColorRange();
if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
- while( file && seq_no >= images.size() ) {
+ while( file && seq_no >= images.size() && !avt->interrupted ) {
int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate;
file->set_video_position(pos,0);
file->set_layer(0);
mwindow->video_cache->check_in(asset);
Thread::yield();
file = 0;
- for( int retries=1000; !file && --retries>=0; usleep(10000) )
+ for( int retries=1000; !file && --retries>=0; usleep(10000) ) {
+ if( avt->interrupted ) return 0;
file = mwindow->video_cache->check_out(asset, mwindow->edl, 0);
+ }
}
if( !file ) { broken = 1; return 0; }
mwindow->video_cache->check_in(asset);
}
+ if( seq_no >= images.size() ) return 0;
return *images[seq_no];
}
double total_length = edl->tracks->total_length();
if( !total_length ) total_length = 1;
for( Track *track=edl->tracks->first; track!=0; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit!=0; edit=edit->next ) {
Indexable *indexable = (Indexable *)edit->asset;
if( !indexable ) indexable = (Indexable *)edit->nested_edl;
Tracks *tracks = mwindow->edl->tracks;
for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
if( vtrk->data_type != TRACK_VIDEO ) continue;
- if( !vtrk->record ) continue;
+ if( !vtrk->is_armed() ) continue;
vtrk->expand_view = 1;
PluginSet *plugin_set = new PluginSet(mwindow->edl, vtrk);
vtrk->plugin_set.append(plugin_set);
Tracks *tracks = mwindow->edl->tracks;
for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
if( vtrk->data_type != TRACK_VIDEO ) continue;
- if( !vtrk->record ) continue;
+ if( !vtrk->is_armed() ) continue;
vtrk->expand_view = 1;
PluginSet *plugin_set = new PluginSet(mwindow->edl, vtrk);
vtrk->plugin_set.append(plugin_set);
if( trk_h < bd_height ) trk_h = bd_height;
for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
if( vtrk->data_type != TRACK_VIDEO ) continue;
- if( !vtrk->record ) continue;
+ if( !vtrk->is_armed() ) continue;
vtrk->track_w = trk_w;
vtrk->track_h = trk_h;
}
max_w = 0; max_h = 0;
int has_deinterlace = 0, has_scale = 0;
for( Track *trk=tracks->first; trk; trk=trk->next ) {
- if( !trk->record ) continue;
+ if( !trk->is_armed() ) continue;
Edits *edits = trk->edits;
switch( trk->data_type ) {
case TRACK_VIDEO:
if( max_h != bd_height ) use_resize_tracks = 1;
}
for( Track *trk=tracks->first; trk && !use_resize_tracks; trk=trk->next ) {
- if( !trk->record ) continue;
+ if( !trk->is_armed() ) continue;
switch( trk->data_type ) {
case TRACK_VIDEO:
if( trk->track_w != max_w ) use_resize_tracks = 1;
Track *track = mwindow->edl->tracks->first;
for( ; track; track=track->next ) {
if( track->data_type != TRACK_VIDEO ) continue;
- if( track->record ) break;
+ if( track->is_armed() ) break;
}
return track;
}
Track *track = mwindow->edl->tracks->first;
for( ; track; track=track->next ) {
if( track->data_type != TRACK_VIDEO ) continue;
- if( track->record && track->get_id() == mask_track_id ) break;
+ if( track->is_armed() && track->get_id() == mask_track_id ) break;
}
return track;
}
0, // use_commerical
0, // use_goto
1, // use_clk2play
- 1) // use_scope
+ 1, // use_scope
+ 0) // use_gang_tracks
{
this->mwindow = mwindow;
this->cwindow = cwindow;
void panel_btn(set_auto_keyframes,(int v), set_auto_keyframes(v))
void panel_btn(set_span_keyframes,(int v), set_span_keyframes(v))
void panel_btn(set_labels_follow_edits,(int v), set_labels_follow_edits(v))
+void panel_btn(set_gang_tracks,(int v), set_gang_tracks(v))
CWindowMeters::CWindowMeters(MWindow *mwindow,
void panel_set_auto_keyframes(int v);
void panel_set_span_keyframes(int v);
void panel_set_labels_follow_edits(int v);
+ void panel_set_gang_tracks(int v);
MWindow *mwindow;
CWindow *cwindow;
if( k >= 0 ) {
track_item = (CWindowMaskItem *)track_items[k];
Track *track = track_item ? mwindow->edl->tracks->get_track_by_id(track_item->id) : 0;
- if( track && track->record ) track_id = track->get_id();
+ if( track && track->is_armed() ) track_id = track->get_id();
}
else
track_id = mwindow->cwindow->mask_track_id;
for( Track *track=mwindow->edl->tracks->first; track; track=track->next ) {
if( track->data_type != TRACK_VIDEO ) continue;
MaskAutos *mask_autos = (MaskAutos*)track->automation->autos[AUTOMATION_MASK];
- int color = !track->record ? RED : mask_autos->first ? high_color : -1;
+ int color = !track->is_armed() ? RED : mask_autos->first ? high_color : -1;
MaskAuto *mask_auto = (MaskAuto*)mask_autos->default_auto;
for( int i=0; color<0 && i<mask_auto->masks.size(); ++i )
if( mask_auto->masks[i]->points.size() > 0 ) color = high_color;
track_item = items[0];
}
Track *track = track_item ? mwindow->edl->tracks->get_track_by_id(track_item->id) : 0;
- int track_id = track_item && track && track->record ? track_item->id : -1;
+ int track_id = track_item && track && track->is_armed() ? track_item->id : -1;
gui->mask_on_track->set_back_color(track_id >= 0 ?
gui->get_resources()->text_background :
gui->get_resources()->text_background_disarmed);
//printf("CWindowMaskGUI::update 1\n");
get_keyframe(track, autos, keyframe, mask, point, 0);
mwindow->cwindow->mask_track_id = track ? track->get_id() : -1;
- mask_on_track->set_back_color(!track || track->record ?
+ mask_on_track->set_back_color(!track || track->is_armed() ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
mask_on_track->update_items();
Tracks *tracks = mwindow->edl->tracks;
for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
if( vtrk->data_type != TRACK_VIDEO ) continue;
- if( !vtrk->record ) continue;
+ if( !vtrk->is_armed() ) continue;
vtrk->expand_view = 1;
PluginSet *plugin_set = new PluginSet(mwindow->edl, vtrk);
vtrk->plugin_set.append(plugin_set);
Tracks *tracks = mwindow->edl->tracks;
for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
if( vtrk->data_type != TRACK_VIDEO ) continue;
- if( !vtrk->record ) continue;
+ if( !vtrk->is_armed() ) continue;
vtrk->expand_view = 1;
PluginSet *plugin_set = new PluginSet(mwindow->edl, vtrk);
vtrk->plugin_set.append(plugin_set);
if( trk_h < dvd_height ) trk_h = dvd_height;
for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
if( vtrk->data_type != TRACK_VIDEO ) continue;
- if( !vtrk->record ) continue;
+ if( !vtrk->is_armed() ) continue;
vtrk->track_w = trk_w;
vtrk->track_h = trk_h;
}
max_w = 0; max_h = 0;
int has_deinterlace = 0, has_scale = 0;
for( Track *trk=tracks->first; trk; trk=trk->next ) {
- if( !trk->record ) continue;
+ if( !trk->is_armed() ) continue;
Edits *edits = trk->edits;
switch( trk->data_type ) {
case TRACK_VIDEO:
if( max_h != dvd_height ) use_resize_tracks = 1;
}
for( Track *trk=tracks->first; trk && !use_resize_tracks; trk=trk->next ) {
- if( !trk->record ) continue;
+ if( !trk->is_armed() ) continue;
switch( trk->data_type ) {
case TRACK_VIDEO:
if( trk->track_w != max_w ) use_resize_tracks = 1;
void Edit::set_selected(int v)
{
- if( group_id )
- edl->tracks->set_group_selected(group_id, v);
+ if( !group_id ) {
+ if( v < 0 ) v = !is_selected ? 1 : 0;
+ int gang = edl->session->gang_tracks != GANG_NONE ? 1 : 0;
+ select_affected_edits(v, gang);
+ }
else
- is_selected = v >= 0 ? v : !is_selected ? 1 : 0;
+ edl->tracks->set_group_selected(group_id, v);
}
+// gang<0: rest of tracks, gang==0: this track, gang>0: to next master
+void Edit::select_affected_edits(int v, int gang)
+{
+ is_selected = v;
+ if( !gang ) return;
+ double position = track->from_units(startproject);
+ for( Track *current=track->next; current; current=current->next ) {
+ if( gang > 0 && current->master ) break;
+ if( !current->is_armed() ) continue;
+ for( Edit *edit=current->edits->first; edit; edit=edit->next ) {
+ if( edit->silence() ) continue;
+ double start = current->from_units(edit->startproject);
+ if( edl->equivalent(start, position) ) {
+ edit->is_selected = v;
+ break;
+ }
+ }
+ }
+}
+
+
void Edit::copy_from(Edit *edit)
{
this->orig_id = edit->orig_id;
// Determine if silence depending on existance of asset or plugin title
virtual int silence();
void set_selected(int v);
+ void select_affected_edits(int v, int gang);
// Media edit information
// Units are native units for the track.
track && !got_it;
track = track->next)
{
- if(track->record)
+ if(track->is_armed())
{
int64_t start_units = track->to_units(start, 0);
int64_t end_units = track->to_units(end, 0);
int use_commercial,
int use_goto,
int use_clk2play,
- int use_scope)
+ int use_scope,
+ int use_gang_tracks)
{
this->window_id = window_id;
this->editing_mode = editing_mode;
this->use_goto = use_goto;
this->use_clk2play = use_clk2play;
this->use_scope = use_scope;
+ this->use_gang_tracks = use_gang_tracks;
this->x = x;
this->y = y;
this->nextlabel = 0;
this->prevedit = 0;
this->nextedit = 0;
+ this->gang_tracks = 0;
this->undo = 0;
this->redo = 0;
this->meter_panel = 0;
mwindow->edl->session->vwindow_click2play ;
click2play->set_value(value);
}
+ if( gang_tracks ) gang_tracks->update(mwindow->edl->session->gang_tracks);
if( meters ) {
if( is_cwindow() ) {
meters->update(mwindow->edl->session->cwindow_meter);
scope_dialog = new EditPanelScopeDialog(mwindow, this);
}
+ if( use_gang_tracks ) {
+ gang_tracks = new EditPanelGangTracks(mwindow, this, x1, y1-yS(1));
+ subwindow->add_subwindow(gang_tracks);
+ x1 += gang_tracks->get_w();
+ }
+
if( use_meters ) {
if( meter_panel ) {
meters = new MeterShow(mwindow, meter_panel, x1, y1);
return 1;
}
+EditPanelGangTracks::EditPanelGangTracks(MWindow *mwindow, EditPanel *panel,
+ int x, int y)
+ : BC_Button(x, y, get_images(mwindow))
+{
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("Gang Tracks"));
+}
+
+EditPanelGangTracks::~EditPanelGangTracks()
+{
+}
+
+VFrame **EditPanelGangTracks::gang_images[TOTAL_GANGS];
+
+VFrame **EditPanelGangTracks::get_images(MWindow *mwindow)
+{
+ gang_images[GANG_NONE] = mwindow->theme->get_image_set("gang0");
+ gang_images[GANG_MEDIA] = mwindow->theme->get_image_set("gang1");
+ gang_images[GANG_CHANNELS] = mwindow->theme->get_image_set("gang2");
+ int gang = mwindow->edl->session->gang_tracks;
+ return gang_images[gang];
+}
+
+void EditPanelGangTracks::update(int gang)
+{
+ set_images(gang_images[gang]);
+ draw_face();
+}
+
+int EditPanelGangTracks::handle_event()
+{
+ int gang = mwindow->edl->session->gang_tracks;
+ switch( gang ) {
+ case GANG_NONE: gang = GANG_CHANNELS; break;
+ case GANG_CHANNELS: gang = GANG_MEDIA; break;
+ case GANG_MEDIA: gang = GANG_NONE; break;
+ }
+ update(gang);
+ panel->panel_set_gang_tracks(gang);
+ return 1;
+}
+
VFrame *output_frame;
};
+class EditPanelGangTracks : public BC_Button
+{
+ static VFrame **gang_images[TOTAL_GANGS];
+public:
+ EditPanelGangTracks(MWindow *mwindow, EditPanel *panel, int x, int y);
+ ~EditPanelGangTracks();
+ VFrame **get_images(MWindow *mwindow);
+ void update(int gang);
+ int handle_event();
+ EditPanel *panel;
+ MWindow *mwindow;
+};
+
+
class EditPanelScope : public BC_Toggle
{
public:
int use_commerical,
int use_goto,
int use_clk2play,
- int use_scope);
+ int use_scope,
+ int use_gang_tracks);
~EditPanel();
void set_meters(MeterPanel *meter_panel);
virtual void panel_set_auto_keyframes(int v) = 0;
virtual void panel_set_span_keyframes(int v) = 0;
virtual void panel_set_labels_follow_edits(int v) = 0;
+ virtual void panel_set_gang_tracks(int mode) = 0;
MWindow *mwindow;
BC_WindowBase *subwindow;
int use_goto;
int use_clk2play;
int use_scope;
+ int use_gang_tracks;
EditFit *fit;
EditFitAutos *fit_autos;
EditNextLabel *nextlabel;
EditPrevEdit *prevedit;
EditNextEdit *nextedit;
+ EditPanelGangTracks *gang_tracks;
EditUndo *undo;
EditRedo *redo;
MeterShow *meters;
class EditPanelScopeGUI;
class EditPanelScopeDialog;
class EditPanelScope;
+class EditPanelMashMixers;
#endif
if( (copy_flags & COPY_USED_ASSETS) ) {
// Copy just the ones being used.
for( current = tracks->first; current; current = NEXT ) {
- if( !current->record ) continue;
+ if( !current->is_armed() ) continue;
current->copy_assets(start, end, &asset_list);
}
}
{
int video_tracks = 0, audio_tracks = 0;
for( Track *track=nested->tracks->first; track!=0; track=track->next ) {
- if( track->data_type == TRACK_VIDEO && track->record ) ++video_tracks;
- if( track->data_type == TRACK_AUDIO && track->record ) ++audio_tracks;
+ if( track->data_type == TRACK_VIDEO && track->is_armed() ) ++video_tracks;
+ if( track->data_type == TRACK_AUDIO && track->is_armed() ) ++audio_tracks;
}
// renderengine properties
if( video_tracks > 0 )
{
int total_pixels = 0;
for( Track *current=tracks->first; current; current=NEXT ) {
+ if( current->is_hidden() ) continue;
total_pixels += current->vertical_span(theme);
}
return total_pixels;
{
int64_t total_pixels = 0;
for( Track *current=tracks->first; current; current=NEXT ) {
+ if( current->is_hidden() ) continue;
int64_t pixels = current->horizontal_span();
if( pixels > total_pixels ) total_pixels = pixels;
}
}
for( ; current && vtrack<layers; current=NEXT ) {
- if( !current->record || current->data_type != TRACK_VIDEO ) continue;
+ if( !current->is_armed() || current->data_type != TRACK_VIDEO ) continue;
current->insert_asset(new_asset, new_nested_edl,
length, position, vtrack++);
}
current = tracks->first;
for( ; current && atrack < channels; current=NEXT ) {
- if( !current->record || current->data_type != TRACK_AUDIO ) continue;
+ if( !current->is_armed() || current->data_type != TRACK_AUDIO ) continue;
current->insert_asset(new_asset, new_nested_edl,
length, position, atrack++);
}
int data_type)
{
for( Track *track=tracks->first; track; track=track->next ) {
- if( track->record && omit_recordable ) continue;
+ if( track->is_armed() && omit_recordable ) continue;
if( track == source || track->data_type != data_type ) continue;
for( int i=0; i<track->plugin_set.size(); ++i ) {
Plugin *plugin = track->get_current_plugin(
int omit_recordable, int data_type)
{
for( Track *current=tracks->first; current; current=NEXT ) {
- if( omit_recordable && current->record ) continue;
+ if( omit_recordable && current->is_armed() ) continue;
if( current == track || current->data_type != data_type ) continue;
module_locations->append(new SharedLocation(tracks->number_of(current), 0));
}
// Test for edit handles after position
for( Track *track=tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
double edit_end = track->from_units(edit->startproject + edit->length);
Units::fix_double(&edit_end);
// Test for edit handles before cursor position
for( Track *track=tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
double edit_end = track->from_units(edit->startproject);
Units::fix_double(&edit_end);
double start = DBL_MAX, end = DBL_MIN;
Track *first_track=0, *last_track = 0;
for( Track *track=tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
int empty = 1;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( !edit->is_selected || edit->silence() ) continue;
new_edl->session->video_tracks = 0;
new_edl->session->audio_tracks = 0;
for( Track *track=tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
if( first_track ) {
if( first_track != track ) continue;
first_track = 0;
first_track = tracks->first;
Track *src = clip->tracks->first;
for( Track *track=first_track; track && src; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
int64_t pos = track->to_units(position, 0);
if( edit_edits ) {
for( Edit *edit=src->edits->first; edit; edit=edit->next ) {
Edit *edit = track->edits->first;
while( edit && !edit->is_selected ) edit = edit->next;
if( !edit ) continue;
- if( !track->record ) { ret = COLLECT_EFFECTS_RECORD; break; }
+ if( !track->is_armed() ) { ret = COLLECT_EFFECTS_RECORD; break; }
Track *new_track = 0;
edl_shared *location = 0;
int64_t start_pos = edit->startproject;
Edit *edit = track->edits->first;
while( edit && !edit->is_selected ) edit = edit->next;
if( !edit ) continue;
- if( !track->record ) return INSERT_EFFECTS_RECORD;
+ if( !track->is_armed() ) return INSERT_EFFECTS_RECORD;
if( track->data_type != new_track->data_type ) return INSERT_EFFECTS_TYPE;
int gtrk = group->tracks->number_of(new_track);
int trk = tracks->number_of(track);
new_track = group->tracks->first;
track = first_track;
for( ; track && new_track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
Edit *edit = track->edits->first;
while( edit && !edit->is_selected ) edit = edit->next;
if( !edit ) continue;
scrub_speed = 2.;
show_assets = 1;
show_titles = 1;
+ gang_tracks = GANG_NONE;
si_useduration = 1;
si_duration = 3;
test_playback_edits = 1;
show_assets = defaults->get("SHOW_ASSETS", 1);
show_titles = defaults->get("SHOW_TITLES", 1);
+ gang_tracks = defaults->get("GANG_TRACKS", GANG_NONE);
// test_playback_edits = defaults->get("TEST_PLAYBACK_EDITS", 1);
time_format = defaults->get("TIME_FORMAT", TIME_HMSF);
nudge_format = defaults->get("NUDGE_FORMAT", 1);
defaults->update("SI_DURATION",si_duration);
defaults->update("SHOW_ASSETS", show_assets);
defaults->update("SHOW_TITLES", show_titles);
+ defaults->update("GANG_TRACKS", gang_tracks);
// defaults->update("TEST_PLAYBACK_EDITS", test_playback_edits);
defaults->update("TIME_FORMAT", time_format);
defaults->update("NUDGE_FORMAT", nudge_format);
safe_regions = file->tag.get_property("SAFE_REGIONS", safe_regions);
show_assets = file->tag.get_property("SHOW_ASSETS", 1);
show_titles = file->tag.get_property("SHOW_TITLES", 1);
+ gang_tracks = file->tag.get_property("GANG_TRACKS", GANG_NONE);
// test_playback_edits = file->tag.get_property("TEST_PLAYBACK_EDITS", test_playback_edits);
time_format = file->tag.get_property("TIME_FORMAT", time_format);
nudge_format = file->tag.get_property("NUDGE_FORMAT", nudge_format);
file->tag.set_property("SAFE_REGIONS", safe_regions);
file->tag.set_property("SHOW_ASSETS", show_assets);
file->tag.set_property("SHOW_TITLES", show_titles);
+ file->tag.set_property("GANG_TRACKS", gang_tracks);
file->tag.set_property("TEST_PLAYBACK_EDITS", test_playback_edits);
file->tag.set_property("TIME_FORMAT", time_format);
file->tag.set_property("NUDGE_FORMAT", nudge_format);
si_duration = session->si_duration;
show_assets = session->show_assets;
show_titles = session->show_titles;
+ gang_tracks = session->gang_tracks;
test_playback_edits = session->test_playback_edits;
time_format = session->time_format;
nudge_format = session->nudge_format;
int show_assets;
// Show titles in resources
int show_titles;
+ int gang_tracks;
// Test for data before rendering a track
int test_playback_edits;
// Format to display times in
#define INIT_ATRANSITION "Crossfade"
#define INIT_VTRANSITION "Dissolve"
+#define GANG_NONE 0
+#define GANG_CHANNELS 1
+#define GANG_MEDIA 2
+#define TOTAL_GANGS 3
class EDLSession;
FloatAuto *current = (FloatAuto*)speed_autos->get_auto_for_editing(position);
float change = v - current->get_value();
current->set_value(v);
- if( track->gang && track->record ) {
+ if( track->is_ganged() && track->is_armed() ) {
TrackCanvas *track_canvas = patch->patchbay->pane->canvas;
track_canvas->fill_ganged_autos(-1, change, track, current);
track_canvas->update_ganged_autos(0, track, current);
}
int ShowVWindow::handle_event()
{
+ mwindow->gui->unlock_window();
mwindow->show_vwindow();
+ mwindow->gui->lock_window("ShowVWindow::handle_event");
return 1;
}
}
int ShowAWindow::handle_event()
{
+ mwindow->gui->unlock_window();
mwindow->show_awindow();
+ mwindow->gui->lock_window("ShowAWindow::handle_event");
return 1;
}
}
int ShowCWindow::handle_event()
{
+ mwindow->gui->unlock_window();
mwindow->show_cwindow();
+ mwindow->gui->lock_window("ShowCWindow::handle_event");
return 1;
}
int ShowGWindow::handle_event()
{
if( mwindow->session->current_operation == NO_OPERATION ) {
+ mwindow->gui->unlock_window();
if( !mwindow->session->show_gwindow )
mwindow->show_gwindow();
else
mwindow->hide_gwindow();
+ mwindow->gui->lock_window("ShowGWindow::handle_event");
set_checked(mwindow->session->show_gwindow);
}
return 1;
}
int ShowLWindow::handle_event()
{
+ mwindow->gui->unlock_window();
mwindow->show_lwindow();
+ mwindow->gui->lock_window("ShowLWindow::handle_event");
return 1;
}
mwindow->has_commercials(), // use_commerical
1, // use_goto
0, // use_clk2play
- 0) // use_scope
+ 0, // use_scope
+ 1) // use_gang_tracks
{
this->mwindow = mwindow;
this->mbuttons = mbuttons;
mwindow->set_labels_follow_edits(v);
}
+void MainEditing::panel_set_gang_tracks(int v)
+{
+ mwindow->set_gang_tracks(v);
+}
+
void panel_set_auto_keyframes(int v);
void panel_set_span_keyframes(int v);
void panel_set_labels_follow_edits(int v);
+ void panel_set_gang_tracks(int v);
MWindow *mwindow;
MButtons *mbuttons;
while( track && track->mixer_id != id ) track = track->next;
if( !track ) continue;
double nudge = mix->nudge;
- int record = track->record; track->record = 1;
+ int armed = track->armed; track->armed = 1;
if( nudge < 0 ) {
track->clear(0, -nudge, 1,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits);
}
- track->record = record;
+ track->armed = armed;
}
}
edl->optimize();
ArrayList<int> track_arms; // ugly
for( Track *track=edl->tracks->first; track; track=track->next ) {
- track_arms.append(track->record);
- track->record = 0;
+ track_arms.append(track->armed);
+ track->armed = 0;
}
for( int m, i=0; (m=ma_gui->mixer_list->get_selection_number(0,i))>=0; ++i ) {
if( m == midx ) continue; // master does not move
while( track && track->mixer_id != id ) track = track->next;
if( !track ) continue;
double nudge = mix->nudge;
- track->record = 1;
+ track->armed = 1;
double position = 0; Track *first_track = 0;
EDL *clip = edl->selected_edits_to_clip(0, &position, &first_track);
if( clip ) {
position += nudge;
edl->paste_edits(clip, first_track, position, 1);
}
- track->record = 0;
+ track->armed = 0;
}
}
int i = 0;
for( Track *track=edl->tracks->first; track; track=track->next )
- track->record = track_arms[i++];
+ track->armed = track_arms[i++];
edl->optimize();
mwindow->update_gui(1);
in_destructor = 0;
speed_edl = 0;
beeper = 0;
+ redraw_tracks = 0;
shuttle = 0;
wintv = 0;
x10tv = 0;
#ifdef HAVE_DVB
gui->channel_info->stop();
#endif
- delete beeper;
- delete create_bd; create_bd = 0;
- delete create_dvd; create_dvd = 0;
+ delete beeper; beeper = 0;
+ delete redraw_tracks; redraw_tracks = 0;
+ delete create_bd; create_bd = 0;
+ delete create_dvd; create_dvd = 0;
#ifdef HAVE_SHUTTLE
delete shuttle; shuttle = 0;
#endif
k = mixer->mixer_ids.size();
while( --k >= 0 && track->get_mixer_id() != mixer->mixer_ids[k] );
if( k >= 0 ) {
- track->record = 1;
+ track->armed = 1;
track->play = track->data_type == TRACK_VIDEO ? 1 : 0;
}
else
- track->record = track->play = 0;
+ track->armed = track->play = 0;
}
zwindow->change_source(mixer_edl);
zwindow->handle_mixer(command, 0,
Mixer *mixer = 0;
ZWindow *zwindow = get_mixer(mixer);
while( track ) {
- track->play = track->record = 0;
+ track->play = track->armed = 0;
if( track->data_type == TRACK_VIDEO ) {
sprintf(track->title, _("Mixer %d"), zwindow->idx);
}
}
}
+void MWindow::set_gang_tracks(int v)
+{
+ edl->session->gang_tracks = v;
+ gui->update(1, 1, 0, 0, 1, 0, 0);
+ gui->flush();
+}
+
+
void MWindow::init_cache()
{
audio_cache = new CICache(preferences);
//check it
for(Track *track=tracks->first; track && !errmsg; track=track->next) {
if( track->data_type != TRACK_VIDEO ) continue;
- if( !track->record ) continue;
+ if( !track->armed ) continue;
if( count > 0 ) { errmsg = _("multiple video tracks"); break; }
++count;
int64_t units_start = track->to_units(start,0);
//run it
for(Track *track=tracks->first; track && !errmsg; track=track->next) {
if( track->data_type != TRACK_VIDEO ) continue;
- if( !track->record ) continue;
+ if( !track->armed ) continue;
int64_t units_start = track->to_units(start,0);
int64_t units_end = track->to_units(end,0);
Edits *edits = track->edits;
void MWindow::restore_windows()
{
+ gui->unlock_window();
if( !session->show_vwindow ) {
for( int i=0, n=vwindows.size(); i<n; ++i ) {
VWindow *vwindow = vwindows[i];
else if( session->show_lwindow && lwindow->gui->is_hidden() )
show_lwindow();
+ gui->lock_window("MWindow::restore_windows");
gui->focus();
}
return get_cpus(edl->session->output_w, edl->session->output_h);
}
+void MWindow::draw_trackmovement()
+{
+ if( !redraw_tracks )
+ redraw_tracks = new DrawTrackMovement(this);
+ redraw_tracks->start();
+}
+
+DrawTrackMovement::DrawTrackMovement(MWindow *mwindow)
+ : Thread(1, 0, 0)
+{
+ this->mwindow = mwindow;
+}
+DrawTrackMovement::~DrawTrackMovement()
+{
+ join();
+}
+
+void DrawTrackMovement::run()
+{
+ mwindow->gui->lock_window("DrawTrackMovement::run");
+ mwindow->edl->tracks->update_y_pixels(mwindow->theme);
+ mwindow->gui->draw_trackmovement();
+ mwindow->gui->unlock_window();
+}
+
};
+class DrawTrackMovement : public Thread
+{
+public:
+ DrawTrackMovement(MWindow *mwindow);
+ ~DrawTrackMovement();
+ void run();
+
+ MWindow *mwindow;
+};
+
+
class MWindow : public Thread
{
public:
void start_mixer();
int select_zwindow(ZWindow *zwindow);
void tile_mixers();
+ void set_gang_tracks(int v);
int load_filenames(ArrayList<char*> *filenames,
int load_mode = LOADMODE_REPLACE,
int edl_mode = LOADMODE_EDL_CLIP,
int interrupt_indexes(); // Stop index building
int redraw_time_dependancies(); // after reconfiguring the time format, sample rate, frame rate
+ void draw_trackmovement(); // after reconfiguring tracks/patchbay guis
+ DrawTrackMovement *redraw_tracks;
// =========================================== movement
// TrackCanvas calls this to insert multiple effects from the drag_pluginservers
// into pluginset_highlighted.
- void insert_effects_canvas(double start, double length);
+ void insert_effects_canvas(Track *dest_track, double start, double length);
// CWindow calls this to insert multiple effects from
// the drag_pluginservers array.
for( Track *current=edl->tracks->first; current; current=NEXT ) {
if( current->data_type == TRACK_VIDEO /* &&
- current->record */ ) {
+ current->is_armed() */ ) {
current->track_w = w;
current->track_h = h;
}
//printf("MWindow::insert 6 %p\n", vwindow->get_edl());
}
-void MWindow::insert_effects_canvas(double start,
- double length)
+void MWindow::insert_effects_canvas(Track *dest_track, double start, double length)
{
- Track *dest_track = session->track_highlighted;
- if( !dest_track ) return;
-
undo_before();
- for( int i=0; i<session->drag_pluginservers->total; ++i ) {
- PluginServer *plugin = session->drag_pluginservers->values[i];
- insert_effect(plugin->title, 0, dest_track,
- i == 0 ? session->pluginset_highlighted : 0,
- start, length, PLUGIN_STANDALONE);
+ ArrayList<SharedLocation> shared_locations;
+ PluginSet *pluginset = session->pluginset_highlighted;
+ int gang = edl->session->gang_tracks != GANG_NONE ? 1 : 0;
+ int data_type = dest_track->data_type;
+ int first_track = 1;
+
+ for( Track *track=dest_track; track; track=track->next ) {
+ if( gang && track->master && !first_track ) break;
+ if( track->data_type != data_type ) continue;
+ if( !track->armed ) continue;
+ int module = edl->tracks->number_of(track);
+ for( int i=0; i<session->drag_pluginservers->total; ++i ) {
+ PluginServer *plugin = session->drag_pluginservers->values[i];
+ int shared = gang && plugin->multichannel ? 1 : 0;
+ int plugin_type = !first_track && shared ?
+ PLUGIN_SHAREDPLUGIN : PLUGIN_STANDALONE;
+ SharedLocation *shared_location = !first_track ?
+ &shared_locations[i] : &shared_locations.append();
+ insert_effect(plugin->title, shared_location, track,
+ pluginset, start, length, plugin_type);
+ if( first_track && shared ) {
+ shared_location->module = module;
+ shared_location->plugin = pluginset ?
+ track->plugin_set.number_of(pluginset) :
+ track->plugin_set.total-1 ;
+ }
+ }
+ if( !gang ) break;
+ first_track = 0;
+ pluginset = 0;
}
save_backup();
{
if( !dest_track ) return;
- undo_before();
-
double start = 0;
double length = dest_track->get_length();
edl->local_session->get_selectionstart();
}
- for( int i=0; i<session->drag_pluginservers->total; ++i ) {
- PluginServer *plugin = session->drag_pluginservers->values[i];
- insert_effect(plugin->title, 0, dest_track, 0,
- start, length, PLUGIN_STANDALONE);
- }
-
- save_backup();
- undo_after(_("insert effect"), LOAD_EDITS | LOAD_PATCHES);
- restart_brender();
- sync_parameters(CHANGE_EDL);
+ insert_effects_canvas(dest_track, start, length);
gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
}
-void MWindow::insert_effect(char *title,
- SharedLocation *shared_location,
- int data_type,
- int plugin_type,
- int single_standalone)
+void MWindow::insert_effect(char *title, SharedLocation *shared_location,
+ int data_type, int plugin_type, int single_standalone)
{
Track *current = edl->tracks->first;
SharedLocation shared_location_local;
shared_location_local.copy_from(shared_location);
int first_track = 1;
for( ; current; current=NEXT ) {
- if( current->data_type == data_type &&
- current->record ) {
+ if( current->data_type == data_type && current->is_armed() ) {
+ double start = edl->local_session->get_selectionstart(1);
+ double end = edl->local_session->get_selectionend(1);
+ double length = end - start;
+ if( start >= end ) {
+ start = 0;
+ length = current->get_length();
+ }
insert_effect(title, &shared_location_local,
- current, 0, 0, 0, plugin_type);
+ current, 0, start, length, plugin_type);
if( first_track ) {
if( plugin_type == PLUGIN_STANDALONE && single_standalone ) {
need_new_tracks = 1;
for( int i=0; i<new_edls->total; ++i ) {
EDL *new_edl = new_edls->values[i];
+ int first_track = 1;
for( Track *current=new_edl->tracks->first; current; current=NEXT ) {
switch( current->data_type ) {
case TRACK_VIDEO:
default:
continue;
}
+ if( first_track ) {
+ edl->tracks->last->master = 1;
+ first_track = 0;
+ }
// re-label only if not already labeled
if( new_edl->local_session->asset2edl )
strcpy(current->title, edl->tracks->last->title);
load_mode == LOADMODE_PASTE ) {
Track *current = first_track ? first_track : edl->tracks->first;
for( ; current; current=NEXT ) {
- if( current->record ) {
+ if( current->is_armed() ) {
destination_tracks.append(current);
}
}
if( destination_track < destination_tracks.total &&
destination_tracks.values[destination_track]->data_type == new_track->data_type ) {
Track *track = destination_tracks.values[destination_track];
-
// Replace default keyframes if first EDL and new tracks were created.
// This means data copied from one track and pasted to another won't retain
// the camera position unless it's a keyframe. If it did, previous data in the
// track might get unknowingly corrupted. Ideally we would detect when differing
// default keyframes existed and create discrete keyframes for both.
int replace_default = (i == 0) && need_new_tracks;
-
+// master tracks are the first track in each new edl when new tracks are created
+ int master = track->master;
//printf("MWindow::paste_edls 1 %d\n", replace_default);
// Insert new track at current position
switch( load_mode ) {
//PRINT_TRACE
track->insert_track(new_track, current_position, replace_default,
edit_plugins, edit_autos, edl_length);
+ if( master ) track->master = 1;
//PRINT_TRACE
}
Track *track = new_edl->tracks->first;
const char *path = edl->path;
for( ; (!path || !*path) && track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
Edit *edit = track->edits->first;
if( !edit ) continue;
Indexable *indexable = edit->get_source();
int current_track = 0;
for( Track *current=edl->tracks->first; current; current=NEXT ) {
if( current->data_type == TRACK_AUDIO &&
- current->record ) {
+ current->is_armed() ) {
Autos *pan_autos = current->automation->autos[AUTOMATION_PAN];
PanAuto *pan_auto = (PanAuto*)pan_autos->get_auto_for_editing(-1);
if( (this_track = pane[i]->over_patchbay()) != 0 ) break;
}
- if( get_keypress() == TAB ) { // Switch the record button
+ if( get_keypress() == TAB ) { // Switch the armed button
if( this_track )
- this_track->record = !this_track->record ? 1 : 0;
+ this_track->armed = !this_track->armed ? 1 : 0;
}
else {
int total_selected = mwindow->edl->tracks->total_of(Tracks::RECORD);
// all selected if nothing previously selected or
// if this patch was previously the only one selected and armed
int selected = !total_selected || (total_selected == 1 &&
- this_track && this_track->record ) ? 1 : 0;
+ this_track && this_track->armed ) ? 1 : 0;
mwindow->edl->tracks->select_all(Tracks::RECORD, selected);
- if( !selected && this_track ) this_track->record = 1;
+ if( !selected && this_track ) this_track->armed = 1;
}
update(0, NORMAL_DRAW, 0, 0, 1, 0, 1);
double position = dir == PLAY_FORWARD ? end : start;
double new_position = dir == PLAY_FORWARD ? start : end;
for( Track *track=edl->tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( int i=0; i<track->plugin_set.size(); ++i ) {
PluginSet *plugin_set = track->plugin_set[i];
int64_t pos = track->to_units(position, 0);
double position = dir == PLAY_FORWARD ? end : start;
double new_position = dir == PLAY_FORWARD ? start : end;
for( Track *track=edl->tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
int64_t pos = track->to_units(position, 0);
for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
Autos *autos = track->automation->autos[i];
track;
track = track->next)
{
+ if( track->is_hidden() ) continue;
int y = track->y_pixel - mwindow->edl->local_session->track_start[pane->number];
int h = track->vertical_span(mwindow->theme);
if(cursor_y >= y && cursor_y < y + h)
}
break;
case Tracks::RECORD:
- if(track->record != new_status)
+ if(track->armed != new_status)
{
- track->record = new_status;
+ track->armed = new_status;
update_gui = 1;
}
break;
case Tracks::GANG:
- if(track->gang != new_status)
+ if(track->ganged != new_status)
{
- track->gang = new_status;
+ track->ganged = new_status;
update_gui = 1;
}
break;
// Every patch has a GUI regardless of whether or not it is visible.
// Make sure GUI's are allocated for every patch and deleted for non-existant
// patches.
- for(Track *current = mwindow->edl->tracks->first;
- current;
- current = NEXT, patch_count++)
+ for(Track *current = mwindow->edl->tracks->first; current; current = NEXT)
{
+ if( current->is_hidden() ) continue;
PatchGUI *patchgui = 0;
int y = current->y_pixel;
y -= mwindow->edl->local_session->track_start[pane->number];
patches.append(patchgui);
patchgui->create_objects();
}
+ ++patch_count;
}
while(patches.total > patch_count)
current = NEXT)
{
if(current->data_type == data_type &&
- current->gang &&
- current->record &&
+ current->armed_gang(skip) &&
+ current->is_armed() &&
current != skip)
{
FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[AUTOMATION_FADE];
void PatchBay::synchronize_nudge(int64_t value, Track *skip)
{
- for(Track *current = mwindow->edl->tracks->first;
- current;
- current = NEXT)
- {
- if(current->data_type == skip->data_type &&
- current->gang &&
- current->record &&
- current != skip)
- {
+ Track *current = mwindow->edl->tracks->first;
+ for( ; current; current = NEXT ) {
+ if( current->data_type == skip->data_type &&
+ current->armed_gang(skip) && current->is_armed() &&
+ current != skip ) {
current->nudge = value;
PatchGUI *patch = get_patch_of(current);
if(patch) patch->update(patch->x, patch->y);
draw = 0;
mute = 0;
zoom = 0;
+ master = 0;
expand = 0;
nudge = 0;
mix = 0;
delete draw;
delete mute;
delete zoom;
+ delete master;
delete expand;
delete nudge;
delete mix;
int PatchGUI::reposition(int x, int y)
{
+ if( track->is_hidden() ) return 0;
int x1 = 0;
int y1 = 0;
mute->reposition_window(mute->get_x(), y1 + y);
x1 += mute->get_w();
zoom->reposition_window(zoom->get_x(), y1 + y);
+ x1 += zoom->get_w();
+ master->reposition_window(master->get_x(), y1 + y);
}
y1 += mwindow->theme->play_h;
}
int PatchGUI::update(int x, int y)
{
+ if( track->is_hidden() ) return 0;
//TRACE("PatchGUI::update 1");
reposition(x, y);
//TRACE("PatchGUI::update 10");
delete draw; draw = 0;
delete mute; mute = 0;
delete zoom; zoom = 0;
+ delete master; master = 0;
}
else {
play->update(track->play);
- record->update(track->record);
- gang->update(track->gang);
+ record->update(track->armed);
+ gang->update(track->ganged);
draw->update(track->draw);
mute->update(mwindow->get_int_auto(this, AUTOMATION_MUTE)->value);
}
patchbay->add_subwindow(mute = new MutePatch(mwindow, this, x1 + x, y1 + y));
x1 += mute->get_w();
patchbay->add_subwindow(zoom = new ZoomPatch(mwindow, this, x1 + x, y1 + y));
+ x1 += zoom->get_w();
+ patchbay->add_subwindow(master = new MasterPatch(mwindow, this, x1 + x, y1 + y));
}
if( play )
y1 = y2;
: BC_Toggle(x,
y,
mwindow->theme->get_image_set("recordpatch_data"),
- patch->track->record,
+ patch->track->armed,
"",
0,
0,
patch->toggle_behavior(Tracks::RECORD,
get_value(),
this,
- &patch->track->record);
- patch->title->set_back_color(patch->track->record ?
+ &patch->track->armed);
+ patch->title->set_back_color(patch->track->armed ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
patch->title->set_text_row(0);
GangPatch::GangPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
: BC_Toggle(x, y,
mwindow->theme->get_image_set("gangpatch_data"),
- patch->track->gang,
+ patch->track->ganged,
"",
0,
0,
patch->toggle_behavior(Tracks::GANG,
get_value(),
this,
- &patch->track->gang);
+ &patch->track->ganged);
return 1;
}
return 0;
}
+MasterPatch::MasterPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("masterpatch_data"),
+ patch->track->master, "", 0, 0, 0)
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Master Track"));
+}
+
+int MasterPatch::handle_event()
+{
+ patch->track->master = patch->track->master ? 0 : 1;
+ mwindow->draw_trackmovement(); // delayed, can delete *this
+ return 1;
+}
+
+
ExpandPatch::ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
- : BC_Toggle(x,
- y,
- mwindow->theme->get_image_set("expandpatch_data"),
- patch->track->expand_view,
- "",
- 0,
- 0,
- 0)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("expandpatch_data"),
+ patch->track->expand_view, "", 0, 0, 0)
{
this->mwindow = mwindow;
this->patch = patch;
{
this->mwindow = mwindow;
this->patch = patch;
- set_back_color(patch->track->record ?
+ set_back_color(patch->track->armed ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
}
void TitlePatch::update(const char *text)
{
- set_back_color(patch->track->record ?
+ set_back_color(patch->track->armed ?
get_resources()->text_background :
get_resources()->text_background_disarmed);
BC_TextBox::update(text);
mwindow->undo->update_undo_before(_("nudge."), this);
patch->track->nudge = value;
- if(patch->track->gang && patch->track->record)
+ if(patch->track->is_ganged() && patch->track->is_armed())
patch->patchbay->synchronize_nudge(patch->track->nudge, patch->track);
mwindow->undo->update_undo_after(_("nudge."), LOAD_PATCHES);
class DrawPatch;
class MutePatch;
class ZoomPatch;
+class MasterPatch;
class ExpandPatch;
class NudgePatch;
class MixPatch;
DrawPatch *draw;
MutePatch *mute;
ZoomPatch *zoom;
+ MasterPatch *master;
ExpandPatch *expand;
NudgePatch *nudge;
MixPatch *mix;
PatchGUI *patch;
};
+class MasterPatch : public BC_Toggle
+{
+public:
+ MasterPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ PatchGUI *patch;
+};
+
class ExpandPatch : public BC_Toggle
{
public:
void PluginDialogThread::apply()
{
+ Plugin *plugin = 0;
if( mwindow->edl )
mwindow->edl->session->single_standalone = single_standalone;
if(plugin_type) {
mwindow->insert_effect(plugin_title, &shared_location,
data_type, plugin_type, single_standalone);
}
- else {
- Plugin *plugin = mwindow->edl->tracks->plugin_exists(plugin_id);
- if( plugin ) {
- plugin->change_plugin(plugin_title,
+ else if( (plugin=mwindow->edl->tracks->plugin_exists(plugin_id)) != 0 ) {
+ plugin->change_plugin(plugin_title,
&shared_location, plugin_type);
- }
- else if( mwindow->edl->tracks->track_exists(track) ) {
- mwindow->insert_effect(plugin_title, &shared_location,
+ }
+ else if( mwindow->edl->tracks->track_exists(track) ) {
+ mwindow->insert_effect(plugin_title, &shared_location,
track, 0, 0, 0, plugin_type);
- }
}
mwindow->save_backup();
current_track;
current_track = current_track->next)
{
- if(current_track->record && current_track->data_type == TRACK_AUDIO)
+ if(current_track->is_armed() && current_track->data_type == TRACK_AUDIO)
append((ATrack*)current_track);
}
}
current_track;
current_track = current_track->next)
{
- if(current_track->record && current_track->data_type == TRACK_VIDEO)
+ if(current_track->is_armed() && current_track->data_type == TRACK_VIDEO)
append((VTrack*)current_track);
}
}
Edit *edit = 0;
Tracks *tracks = edl->tracks;
for( Track *track=tracks->first; track && !edit; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
if( track->data_type != TRACK_SUBTITLE ) continue;
int64_t pos = track->to_units(position,0);
edit = track->edits->editof(pos, PLAY_FORWARD, 0);
Tracks *tracks = edl->tracks;
for( Track *track=tracks->first; track; track=track->next ) {
if( track->data_type != TRACK_SUBTITLE ) continue;
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
int64_t start_i = track->to_units(start, 0);
int64_t end_i = track->to_units(end, 1);
track->edits->clear(start_i,end_i);
Tracks *tracks = swindow->mwindow->edl->tracks;
for( Track *track=tracks->first; track; track=track->next ) {
if( track->data_type != TRACK_SUBTITLE ) continue;
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
char *cp = track_title, *ep = cp+sizeof(track_title)-6;
for( const char *bp=track->title; cp<ep && *bp!=0; ) {
int wch = butf8(bp); // iswalnum(wch) broken by MS port
data_h = 64;
expand_view = 0;
draw = 1;
- gang = 1;
+ ganged = 1;
+ master = 0;
title[0] = 0;
- record = 1;
+ armed = 1;
play = 1;
nudge = 0;
track_w = edl->session->output_w;
{
this->expand_view = track->expand_view;
this->draw = track->draw;
- this->gang = track->gang;
- this->record = track->record;
+ this->ganged = track->ganged;
+ this->master = track->master;
+ this->armed = track->armed;
this->nudge = track->nudge;
this->mixer_id = track->mixer_id;
this->play = track->play;
int current_plugin = 0;
- record = file->tag.get_property("RECORD", record);
+ armed = file->tag.get_property("RECORD", armed);
play = file->tag.get_property("PLAY", play);
- gang = file->tag.get_property("GANG", gang);
+ ganged = file->tag.get_property("GANG", ganged);
+ master = file->tag.get_property("MASTER", 1);
draw = file->tag.get_property("DRAW", draw);
nudge = file->tag.get_property("NUDGE", nudge);
mixer_id = file->tag.get_property("MIXER_ID", mixer_id);
int Track::dump(FILE *fp)
{
- fprintf(fp," Data type %d, draw %d, gang %d, play %d, record %d, nudge %jd, masks 0x%04x\n",
- data_type, draw, gang, play, record, nudge, masks);
fprintf(fp," Title %s\n", title);
+ fprintf(fp," Data type %d, draw %d, gang %d, master %d, mixer_id %d\n"
+ " play %d, armed %d, nudge %jd, masks 0x%04x\n",
+ data_type, draw, ganged, master, mixer_id, play, armed, nudge, masks);
fprintf(fp," Edits:\n");
for(Edit* current = edits->first; current; current = NEXT)
current->dump(fp);
file->tag.set_title("TRACK");
- file->tag.set_property("RECORD", record);
+ file->tag.set_property("RECORD", armed);
file->tag.set_property("NUDGE", nudge);
file->tag.set_property("MIXER_ID", mixer_id);
file->tag.set_property("PLAY", play);
- file->tag.set_property("GANG", gang);
+ file->tag.set_property("GANG", ganged);
+ file->tag.set_property("MASTER", master);
file->tag.set_property("DRAW", draw);
file->tag.set_property("EXPAND", expand_view);
file->tag.set_property("DATA_H", data_h);
set_fauto_xyz(AUTOMATION_CAMERA_X, x, y, z);
}
+Track *Track::gang_master()
+{
+ if( edl->session->gang_tracks == GANG_NONE ) return this;
+ Track *track = this;
+ while( track && !track->master ) track = track->previous;
+ return !track ? tracks->first : track;
+}
+
+int Track::is_hidden()
+{
+ if( master ) return 0;
+ if( edl->session->gang_tracks == GANG_MEDIA ) return 1;
+ if( edl->session->gang_tracks == GANG_CHANNELS ) {
+ for( Track *track=previous; track; track=track->previous ) {
+ if( track->data_type == data_type ) return 1;
+ if( track->master ) return 0;
+ }
+ }
+ return 0;
+}
+int Track::is_armed()
+{
+ return gang_master()->armed;
+}
+int Track::is_ganged()
+{
+ return gang_master()->ganged;
+}
+
+int Track::armed_gang(Track *track)
+{
+ if( edl->session->gang_tracks == GANG_NONE ) return ganged;
+ Track *current = gang_master();
+ for(;;) {
+ if( track == current ) return 1;
+ current = current->next;
+ if( !current || current->master ) return 0;
+ }
+ return 1;
+}
+
+
int Track::index_in(Mixer *mixer)
{
if( !mixer || mixer_id < 0 ) return -1;
void change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap);
void change_modules(int old_location, int new_location, int do_swap);
Plugin *plugin_exists(int plugin_id);
+ Track *gang_master();
+ int is_hidden();
+ int is_armed();
+ int is_ganged();
+ int armed_gang(Track *track);
int index_in(Mixer *mixer);
EDL *edl;
// There is some debate on whether to expand gang from faders to
// dragging operations. This would allow every edit in a column to get dragged
// simultaneously.
- int gang;
+ int ganged;
char title[BCTEXTLEN];
int play;
- int record;
+ int armed;
// mask enable bit flags
int masks;
// Nudge in track units. Positive shifts track earlier in time. This way
int pixel; // pixel position from top of track view
// Dimensions of this track if video
int track_w, track_h;
- int mixer_id;
+// mixer set track id, gang master flag
+ int mixer_id, master;
private:
// Identification of the track
// Find the edit and track the cursor is over
for(Track *track = mwindow->edl->tracks->first; track; track = track->next)
{
+ if( track->is_hidden() ) continue;
int64_t track_x, track_y, track_w, track_h;
track_dimensions(track, track_x, track_y, track_w, track_h);
mwindow->session->edit_highlighted->length);
}
start = mwindow->edl->align_to_frame(start, 0);
- mwindow->insert_effects_canvas(start, length);
+ mwindow->insert_effects_canvas(track, start, length);
*redraw = 1;
}
if( mwindow->session->track_highlighted )
current;
current = NEXT)
{
+ if( current->is_hidden() ) continue;
if(debug) PRINT_TRACE
for(Edit *edit = current->edits->first; edit; edit = edit->next)
{
for(Track *dest = mwindow->session->track_highlighted;
dest;
dest = dest->next) {
- if(dest->record) {
+ if( dest->is_hidden() ) continue;
+ if(dest->is_armed()) {
// Get source width in pixels
w = -1;
// Use start of highlighted edit
{
int dropping = 0;
for( Track *track=edl->tracks->first; track; track=track->next ) {
- if( !track->record && color1 < 0 ) {
+ if( track->is_hidden() ) continue;
+ if( !track->is_armed() && color1 < 0 ) {
if( dropping )
dy -= track->vertical_span(mwindow->theme);
continue;
int inner = color1 < 0 ? color0 : !edit->group_id ? color0 :
mwindow->get_group_color(edit->group_id);
int outer = color1 < 0 ? color0 : !edit->group_id ? color1 : inner;
- set_color(track->record ? inner : outer);
+ set_color(track->is_armed() ? inner : outer);
draw_selected(x, y, w, h);
- set_color(track->record ? outer : inner);
+ set_color(track->is_armed() ? outer : inner);
draw_selected(x-1, y-1, w+2, h+2);
draw_selected(x-2, y-2, w+1, h+1);
}
track;
track = track->next)
{
+ if( track->is_hidden() ) continue;
if(track->expand_view)
{
for(int i = 0; i < track->plugin_set.total; i++)
int64_t x, y, w, h;
for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
+ if( track->is_hidden() ) continue;
for(Edit *edit = track->edits->first; edit; edit = edit->next) {
if( !edit->hard_left && !edit->hard_right ) continue;
edit_dimensions(edit, x, y, w, h);
set_line_width(3);
for( Track *track=mwindow->edl->tracks->first; track; track=track->next ) {
+ if( track->is_hidden() ) continue;
Edit *left = 0, *right = 0;
double start = DBL_MAX, end = DBL_MIN;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
int64_t x, y, w, h;
for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
+ if( track->is_hidden() ) continue;
if( !track->show_transitions() ) continue;
for(Edit *edit = track->edits->first; edit; edit = edit->next) {
// track context menu to appear
int result = 0;
EDLSession *session = mwindow->edl->session;
-
-
+ int gang = session->gang_tracks != GANG_NONE || get_double_click() ? 1 : 0;
static BC_Pixmap *auto_pixmaps[AUTOMATION_TOTAL] =
{
for(Track *track = mwindow->edl->tracks->first;
track && !result;
track = track->next) {
+ if( track->is_hidden() ) continue;
Auto *auto_keyframe = 0;
Automation *automation = track->automation;
if (buttonpress != 3)
{
if(i == AUTOMATION_FADE || i == AUTOMATION_SPEED)
- fill_ganged_autos(get_double_click(), 0, track,
+ fill_ganged_autos(gang, 0, track,
(FloatAuto*)mwindow->session->drag_auto);
mwindow->session->current_operation = pre_auto_operations[i];
update_drag_caption();
keyframe_hairline == HAIRLINE_DRAGGING && dragging ) ) {
int show = dragging || keyframe_hairline == HAIRLINE_ALWAYS ? 1 : 0;
for( Track *track = mwindow->edl->tracks->first; track; track=track->next ) {
+ if( track->is_hidden() ) continue;
Automation *automation = track->automation;
for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
if( !mwindow->edl->session->auto_conf->autos[i] ) continue;
void TrackCanvas::fill_ganged_autos(int all, float change, Track *skip, FloatAuto *fauto)
{
- if( !skip->gang ) return;
+ if( !skip->is_ganged() ) return;
// Handles the special case of modifying a fadeauto
// when there are ganged faders on several tracks
double position = skip->from_units(fauto->position);
for(Track *current = mwindow->edl->tracks->first; current; current = NEXT) {
if( (all || current->data_type == skip->data_type) &&
- current->gang && current->record && current != skip ) {
+ current->armed_gang(skip) && current->is_armed() &&
+ current != skip ) {
FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[autoidx];
float auto_min = mwindow->edl->local_session->automation_mins[fade_autos->autogrouptype];
float auto_max = mwindow->edl->local_session->automation_maxs[fade_autos->autogrouptype];
// Draw or test handle
if( current && !result && current != autos->default_auto ) {
- if( !draw && track->record ) {
+ if( !draw && track->is_armed() ) {
result = test_floatauto((FloatAuto*)current, (int)ax2, (int)ay2,
(int)in_x2, (int)in_y2, (int)out_x2, (int)out_y2,
(int)center_pixel, (int)yscale, cursor_x, cursor_y,
}
// Draw or test joining line
- if( !draw && !result && track->record /* && buttonpress != 3 */ ) {
+ if( !draw && !result && track->is_armed() /* && buttonpress != 3 */ ) {
result = test_floatline(center_pixel,
(FloatAutos*)autos, unit_start, zoom_units, yscale,
// Exclude auto coverage from the end of the line. The auto overlaps
if( ax < get_w() && !result ) {
ax2 = get_w(); ay2 = ay;
- if(!draw && track->record /* && buttonpress != 3 */ ) {
+ if(!draw && track->is_armed() /* && buttonpress != 3 */ ) {
result = test_floatline(center_pixel,
(FloatAutos*)autos, unit_start, zoom_units, yscale,
(int)ax, (int)ax2, cursor_x, cursor_y,
{
if(!draw)
{
- if(track->record)
+ if(track->is_armed())
{
result = test_auto(current,
(int)ax2,
{
if(!result)
{
- if(track->record /* && buttonpress != 3 */)
+ if(track->is_armed() /* && buttonpress != 3 */)
{
result = test_toggleline(autos,
center_pixel,
ay2 = ay;
if(!draw)
{
- if(track->record /* && buttonpress != 3 */)
+ if(track->is_armed() /* && buttonpress != 3 */)
{
result = test_toggleline(autos,
center_pixel,
*percentage = 0;
*position = 0;
- if(!current->autos->track->record) return 1;
+ if(!current->autos->track->is_armed()) return 1;
double view_start;
double unit_start;
double view_end;
#define UPDATE_DRAG_HEAD(do_clamp) \
int result = 0, center_pixel; \
- if(!current->autos->track->record) return 0; \
+ if(!current->autos->track->is_armed()) return 0; \
double view_start, unit_start, view_end, unit_end; \
double yscale, zoom_sample, zoom_units; \
\
int result = 0;
for( Track *track=mwindow->edl->tracks->first; track && !result; track=track->next) {
+ if( track->is_hidden() ) continue;
for( Edit *edit=track->edits->first; edit && !result; edit=edit->next ) {
int64_t edit_x, edit_y, edit_w, edit_h;
edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
if( handle_result == 1 ) edit_edge += edit_result->length;
double edge_position = edit_result->track->from_units(edit_edge);
for( Track *track=mwindow->edl->tracks->first; track!=0; track=track->next ) {
+ if( track->is_hidden() ) continue;
int64_t track_position = track->to_units(edge_position, 1);
Edit *left_edit = track->edits->editof(track_position, PLAY_FORWARD, 0);
if( left_edit ) {
for(Track *track = mwindow->edl->tracks->first;
track && !result;
track = track->next) {
+ if( track->is_hidden() ) continue;
for(int i = 0; i < track->plugin_set.total && !result; i++) {
PluginSet *plugin_set = track->plugin_set.values[i];
for(Plugin *plugin = (Plugin*)plugin_set->first;
int result = 0;
for(Track *track = mwindow->edl->tracks->first; track && !result; track = track->next) {
+ if( track->is_hidden() ) continue;
for(Edit *edit = track->edits->first; edit && !result; edit = edit->next) {
int64_t edit_x, edit_y, edit_w, edit_h;
edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
if( button_press && get_buttonpress() == LEFT_BUTTON ) {
if( get_double_click() ) {
mwindow->edl->tracks->clear_selected_edits();
- mwindow->edl->tracks->select_affected_edits(
- edit->track->from_units(edit->startproject),
- edit->track, 1);
+ edit->select_affected_edits(1, -1);
double start = edit->track->from_units(edit->startproject);
start = mwindow->edl->align_to_frame(start, 0);
mwindow->edl->local_session->set_selectionstart(start);
update_cursor = -1;
}
}
- else if( drag_start && track->record ) {
+ else if( drag_start && track->is_armed() ) {
mwindow->session->drag_edit = edit;
mwindow->session->drag_origin_x = cursor_x;
mwindow->session->drag_origin_y = cursor_y;
edit->set_selected(1);
}
else
- mwindow->edl->tracks->select_affected_edits(
- edit->track->from_units(edit->startproject),
- edit->track, 1);
+ edit->select_affected_edits(1, -1);
drag_start = 1;
}
// Construct list of all affected edits
int intersects = 0;
Track *src = group->tracks->first;
for( Track *track=first_track; track && src; track=track->next ) {
- if( !track->record ) return -1;
+ if( !track->is_armed() ) return -1;
if( src->data_type != track->data_type ) return -1;
for( Edit *src_edit=src->edits->first; src_edit; src_edit=src_edit->next ) {
if( src_edit->silence() ) continue;
}
else
// Move plugin
- if( drag_start && plugin->track->record && !plugin->silence() ) {
+ if( drag_start && plugin->track->is_armed() && !plugin->silence() ) {
if( mwindow->edl->session->editing_mode == EDITING_ARROW ) {
if( plugin->track->data_type == TRACK_AUDIO )
mwindow->session->current_operation = DRAG_AEFFECT_COPY;
for( Track *track = mwindow->edl->tracks->first; track && !result; track = track->next ) {
+ if( track->is_hidden() ) continue;
if( !track->show_transitions() ) continue;
for( Edit *edit = track->edits->first; edit; edit = edit->next ) {
current_track && current_patch;
current_track = current_track->next, current_patch = current_patch->next)
{
- if(current_patch->record && current_track->data_type == TRACK_AUDIO)
+ if(current_patch->is_armed() && current_track->data_type == TRACK_AUDIO)
append((ATrack*)current_track);
}
}
const char *text = window->title_text->get_text();
int count = 0;
for( Track *track=edl->tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( !edit->is_selected ) continue;
strcpy(edit->user_title, text);
EDL *edl = popup->mwindow->edl;
int count = 0;
for( Track *track=edl->tracks->first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( !edit->is_selected ) continue;
edit->color = color;
}
}
-void Tracks::select_affected_edits(double position, Track *start_track, int sense)
-{
- for( Track *track=start_track; track; track=track->next ) {
- if( !track->record ) continue;
- for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
- if( edit->silence() ) continue;
- double startproject = track->from_units(edit->startproject);
- if( edl->equivalent(startproject, position) ) {
- edit->is_selected = sense >= 0 ? sense :
- edit->is_selected ? 0 : 1;
- break;
- }
- }
- }
-}
-
void Tracks::get_selected_edits(ArrayList<Edit*> *drag_edits)
{
drag_edits->remove_all();
for( Track *track=first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( !edit->is_selected ) continue;
drag_edits->append(edit);
int coords_undefined = 1;
for(Track *current = first; current; current = NEXT)
{
- if(current->record)
+ if(current->is_armed())
{
current->automation->get_extents(min,
max,
int Tracks::delete_track(Track *track)
{
- if (!track)
- return 0;
-
- int old_location = number_of(track);
- detach_shared_effects(old_location);
-
+ if( !track ) return 0;
+ int gang = edl->session->gang_tracks != GANG_NONE ? 1 : 0;
+ Track *nxt = track->next;
+ if( gang ) {
+ while( track && !track->master && track->previous )
+ track = track->previous;
+ while( nxt && !nxt->master )
+ nxt = nxt->next;
+ }
+ Track *current = track;
+ int old_location = number_of(current);
+ for( Track *next_track=0; current!=nxt; current=next_track ) {
+ next_track = current->next;
+ detach_shared_effects(old_location);
+ for( Track *curr=current; curr; curr=curr->next ) {
// Shift effects referencing effects below the deleted track
- for(Track *current = track;
- current;
- current = NEXT)
- {
- change_modules(number_of(current), number_of(current) - 1, 0);
+ change_modules(number_of(curr), number_of(curr)-1, 0);
+ }
+ delete current;
}
- if(track) delete track;
-
return 0;
}
result +=
(current->play && type == PLAY) ||
- (current->record && type == RECORD) ||
- (current->gang && type == GANG) ||
+ (current->is_armed() && type == RECORD) ||
+ (current->is_ganged() && type == GANG) ||
(current->draw && type == DRAW) ||
(mute_auto->value && type == MUTE) ||
(current->expand_view && type == EXPAND);
{
int result = 0;
for(Track *current = first; current; current = NEXT)
- if(current->data_type == TRACK_AUDIO && current->record) result++;
+ if(current->data_type == TRACK_AUDIO && current->is_armed()) result++;
return result;
}
int result = 0;
for(Track *current = first; current; current = NEXT)
{
- if(current->data_type == TRACK_VIDEO && current->record) result++;
+ if(current->data_type == TRACK_VIDEO && current->is_armed()) result++;
}
return result;
}
double total = -1;
for(Track *current = first; current; current = NEXT)
{
- if(current->record)
+ if(current->is_armed())
{
double length = current->get_length();
if(length > total) total = length;
{
Track *track = first;
for( ; track; track=track->next ) {
- if( !all && !track->record ) continue;
+ if( !all && !track->is_armed() ) continue;
if( track->data_type != TRACK_VIDEO ) continue;
((VTrack*)track)->translate(fauto, dx, dy, all);
}
float ctr_y = edl->session->output_h / 2.;
Track *track = first;
for( ; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
if( track->data_type != TRACK_VIDEO ) continue;
float px, py, pz;
track->get_projector(px, py, pz);
float ctr_y = edl->session->output_h / 2.;
Track *track = first;
for( ; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
if( track->data_type != TRACK_VIDEO ) continue;
float cx, cy, cz, px, py, pz;
track->get_camera(cx, cy, cz);
{
//printf("Tracks::update_y_pixels %d\n", y);
current->y_pixel = y;
+ if( current->is_hidden() ) continue;
y += current->vertical_span(theme);
}
}
double position = edl->local_session->get_selectionstart(1);
if(type == PLAY) current->play = value;
- if(type == RECORD) current->record = value;
- if(type == GANG) current->gang = value;
+ if(type == RECORD) current->armed = value;
+ if(type == GANG) current->ganged = value;
if(type == DRAW) current->draw = value;
if(type == MUTE)
{
int count = 0;
for( Track *track=first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( edit->group_id > 0 ) continue;
if( !edit->is_selected ) continue;
int Tracks::set_group_selected(int id, int v)
{
int count = 0;
+ int gang = edl->session->gang_tracks != GANG_NONE ? 1 : 0;
for( Track *track=first; track; track=track->next ) {
+ if( track->is_hidden() ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( edit->group_id != id ) continue;
- edit->is_selected = v >= 0 ? v : !edit->is_selected ? 1 : 0;
+ if( v < 0 ) v = !edit->is_selected ? 1 : 0;
+ edit->select_affected_edits(v, gang);
++count;
}
}
return 0;
}
+void Tracks::move_tracks(Track *src, Track *dst, int n)
+{
+ if( src == dst ) return;
+ while( --n >= 0 && src ) {
+ Track *nxt = src->next;
+ change_modules(number_of(src), total(), 0);
+ for( Track *track=nxt; track; track=track->next )
+ change_modules(number_of(track), number_of(track)-1, 0);
+ remove_pointer(src);
+ int ndst = dst ? number_of(dst) : total();
+ insert_before(dst, src);
+ for( Track *track=last; track && track!=src; track=track->previous )
+ change_modules(number_of(track)-1, number_of(track), 0);
+ change_modules(total(), ndst, 0);
+ src = nxt;
+ }
+}
+
// Construct a list of all the recordable edits which start on position
void clear_selected_edits();
- void select_affected_edits(double position, Track *start_track, int sense);
int clear_hard_edges(double start, double end);
void get_selected_edits(ArrayList<Edit*> *drag_edits);
int next_group_id();
void equivalent_output(Tracks *tracks, double *result);
+ void move_tracks(Track *src, Track *dst, int n);
int move_track_up(Track *track); // move recordable tracks up
int move_track_down(Track *track); // move recordable tracks down
int move_tracks_up(); // move recordable tracks up
int Tracks::blade(double position)
{
for( Track *track=first; track!=0; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
track->blade(position);
}
return 0;
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->clear(start,
end,
for(current_track = first; current_track; current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->clear_automation(selectionstart,
selectionend,
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
int64_t start_units = current_track->to_units(start, 0);
int64_t end_units = current_track->to_units(end, 0);
int Tracks::clear_hard_edges(double start, double end)
{
for( Track *track=first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
int64_t start_units = track->to_units(start, 0);
int64_t end_units = track->to_units(end, 0);
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->shuffle_edits(start, end, first_track);
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->reverse_edits(start, end, first_track);
// This doesn't affect automation or effects
Track *master_track = 0;
for( Track *track=first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
if( !master_track )
master_track = track;
else
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
#define USE_FLOATING_LENGTHS
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
int64_t start_units = current_track->to_units(start, 0);
int64_t end_units = current_track->to_units(end, 0);
{
int count = 0;
for( Track *track=first; track; track=track->next ) {
- if( !track->record || track->data_type != track_type ) continue;
+ if( !track->is_armed() || track->data_type != track_type ) continue;
for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
if( !edit->is_selected ) continue;
edit->insert_transition(title);
}
for( Track *track=first; track; track=track->next ) {
- if( !track->record || track->data_type != track_type ) continue;
+ if( !track->is_armed() || track->data_type != track_type ) continue;
int64_t start_units = track->to_units(start, 0);
int64_t end_units = track->to_units(end, 0);
if( start_units == end_units ) {
for(current_track = first; current_track; current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->set_automation_mode(selectionstart,
selectionend,
{
for(Track *current = first; current; current = NEXT)
{
- if(current->record)
+ if(current->is_armed())
current->clear_automation(0, 0, 0, 1);
}
return 0;
for(current_track = first; current_track; current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->clear_handle(start,
end,
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->copy_automation(selectionstart,
selectionend,
{
int total_deleted = 0;
int done = 0;
+ int gang = edl->session->gang_tracks != GANG_NONE ? 1 : 0;
- while(!done)
- {
+ while( !done ) {
done = 1;
- Track *next_track = 0;
- for (Track* current = first; current && done; current = next_track)
- {
- next_track = current->next;
- if(current->record)
- {
- delete_track(current);
- current = NULL;
- total_deleted++;
- done = 0;
- break;
+ for( Track* track=first, *nxt=0; done && track; track=nxt ) {
+ nxt = track->next;
+ if( gang ) {
+ while( nxt && !nxt->master ) nxt = nxt->next;
}
+ if( !track->is_armed() ) continue;
+ delete_track(track);
+ ++total_deleted;
}
}
return total_deleted;
int current_aedit = 0, current_vedit = 0;
//printf("Tracks::move_edits 1\n");
for( Track *dest_track=track; dest_track; dest_track=dest_track->next ) {
- if( !dest_track->record ) continue;
+ if( !dest_track->is_armed() ) continue;
// Need a local copy of the source edit since the original source edit may
// change in the editing operation.
// Get source edit
output_track;
output_track = output_track->next)
if(output_track->data_type == data_type &&
- output_track->record) break;
+ output_track->is_armed()) break;
first_output_track = output_track;
{
if(input_track->data_type == data_type &&
input_track->play &&
- !input_track->record) break;
+ !input_track->is_armed()) break;
}
{
if(input_track->data_type == data_type &&
- !input_track->record &&
+ !input_track->is_armed() &&
input_track->play) break;
}
output_track = output_track->next)
{
if(output_track->data_type == data_type &&
- output_track->record) break;
+ output_track->is_armed()) break;
}
if(!output_track)
// if nothing selected
if( start == end && !all ) return 1;
for( Track *track=first; track; track=track->next ) {
- if( track->record || all )
+ if( track->is_armed() || all )
track->copy(copy_flags, start, end, file, output_path);
}
return 0;
int Tracks::move_track_up(Track *track)
{
- Track *next_track = track->previous;
- if(!next_track) next_track = last;
-
- change_modules(number_of(track), number_of(next_track), 1);
-
-// printf("Tracks::move_track_up 1 %p %p\n", track, next_track);
-// int count = 0;
-// for(Track *current = first; current && count < 5; current = NEXT, count++)
-// printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
-// printf("Tracks::move_track_up 2\n");
-//
- swap(track, next_track);
-
-// count = 0;
-// for(Track *current = first; current && count < 5; current = NEXT, count++)
-// printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
-// printf("Tracks::move_track_up 3\n");
-
+ if( first == last ) return 1;
+ int n = 1;
+ Track *src = track, *dst = src->previous;
+ if( edl->session->gang_tracks != GANG_NONE ) {
+ while( src && !src->master ) src = src->previous;
+ if( !src ) src = first;
+ Track *nxt = src->next;
+ while( nxt && !nxt->master ) { ++n; nxt = nxt->next; }
+ dst = src->previous;
+ while( dst && !dst->master ) { dst = dst->previous; }
+ }
+ if( src == dst ) return 1;
+ move_tracks(src, dst, n);
return 0;
}
int Tracks::move_track_down(Track *track)
{
- Track *next_track = track->next;
- if(!next_track) next_track = first;
-
- change_modules(number_of(track), number_of(next_track), 1);
- swap(track, next_track);
+ if( first == last ) return 1;
+ int n = 1;
+ Track *src = track, *dst = src->next;
+ if( edl->session->gang_tracks != GANG_NONE ) {
+ while( src && !src->master ) src = src->previous;
+ if( !src ) src = first;
+ Track *nxt = src->next;
+ while( nxt && !nxt->master ) { ++n; nxt = nxt->next; }
+ if( nxt ) {
+ nxt = nxt->next;
+ while( nxt && !nxt->master ) { nxt = nxt->next; }
+ }
+ else
+ nxt = first;
+ dst = nxt;
+ }
+ else
+ dst = !dst ? first : dst->next;
+ if( src == dst ) return 1;
+ move_tracks(src, dst, n);
return 0;
}
int Tracks::move_tracks_up()
{
- int result = 0;
- Track *next = first;
- while( next ) {
- Track *track = next; next = track->next;
- if( !track->record ) continue;
- if( track->previous ) {
- change_modules(number_of(track->previous), number_of(track), 1);
- swap(track->previous, track);
- result = 1;
- }
+ if( first == last ) return 1;
+ int n = 1;
+ Track *src = first, *dst = 0;
+ if( edl->session->gang_tracks != GANG_NONE ) {
+ Track *nxt = src->next;
+ while( nxt && !nxt->master ) { ++n; nxt = nxt->next; }
}
-
- return result;
+ if( src == dst ) return 1;
+ move_tracks(src, dst, n);
+ return 0;
}
int Tracks::move_tracks_down()
{
- int result = 0;
- Track *prev = last;
- while( prev ) {
- Track *track = prev; prev = track->previous;
- if( !track->record ) continue;
- if( track->next ) {
- change_modules(number_of(track), number_of(track->next), 1);
- swap(track, track->next);
- result = 1;
- }
+ if( first == last ) return 1;
+ int n = 1;
+ Track *src = last, *dst = first;
+ if( edl->session->gang_tracks != GANG_NONE ) {
+ while( src && !src->master ) { ++n; src = src->previous; }
}
-
- return result;
+ if( src == dst ) return 1;
+ move_tracks(src, dst, n);
+ return 0;
}
for(Track *current = first; current; current = NEXT)
{
if(current->data_type == TRACK_AUDIO &&
- current->record)
+ current->is_armed())
{
int64_t position = current->to_units(
edl->local_session->get_selectionstart(), 0);
if(typeless)
{
if(!current_track) current_track = first;
- while(current_track && !current_track->record)
+ while(current_track && !current_track->is_armed())
current_track = current_track->next;
dst_track = current_track;
}
while(current_atrack &&
(current_atrack->data_type != TRACK_AUDIO ||
- !current_atrack->record))
+ !current_atrack->is_armed()))
current_atrack = current_atrack->next;
dst_track = current_atrack;
}
while(current_vtrack &&
(current_vtrack->data_type != TRACK_VIDEO ||
- !current_vtrack->record))
+ !current_vtrack->is_armed()))
current_vtrack = current_vtrack->next;
dst_track = current_vtrack;
for(Track *current = first; current; current = NEXT)
{
if(current->data_type == TRACK_VIDEO &&
- current->record)
+ current->is_armed())
{
int64_t position = current->to_units(
edl->local_session->get_selectionstart(), 0);
current_track;
current_track = current_track->next)
{
- if(current_track->record)
+ if(current_track->is_armed())
{
current_track->paste_silence(start,
end,
int edit_plugins, int edit_autos, int group_id)
{
for( Track *track=first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
track->modify_edithandles(oldposition, newposition,
currentend, handle_mode, edit_labels,
edit_plugins, edit_autos, group_id);
int edit_autos, Edits *trim_edits)
{
for( Track *track=first; track; track=track->next ) {
- if( !track->record ) continue;
+ if( !track->is_armed() ) continue;
track->modify_pluginhandles(oldposition, newposition,
currentend, handle_mode, edit_labels,
edit_autos, trim_edits);
current_track;
current_track = current_track->next)
{
- if((current_track->record || ignore_record) &&
+ if((current_track->is_armed() || ignore_record) &&
current_track->data_type == TRACK_VIDEO)
{
current_track->scale_time(rate_scale, scale_edits, scale_autos, start, end);
float change = v - current->get_value();
current->set_value(v);
- if( track->gang && track->record )
+ if( track->is_ganged() && track->is_armed() )
patchbay->synchronize_faders(change, TRACK_AUDIO, track);
mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION);
change_source = 0;
0, // use_commerical
0, // use_goto
1, // use_clk2play
- 1) // use_scope
+ 1, // use_scope
+ 0) // use_gang_tracks
{
this->mwindow = mwindow;
this->vwindow = vwindow;
void VWindowEditing::panel_set_auto_keyframes(int v) {}
void VWindowEditing::panel_set_span_keyframes(int v) {}
void VWindowEditing::panel_set_labels_follow_edits(int v) {}
+void VWindowEditing::panel_set_gang_tracks(int v) {}
VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y)
void panel_set_auto_keyframes(int v);
void panel_set_span_keyframes(int v);
void panel_set_labels_follow_edits(int v);
+ void panel_set_gang_tracks(int v);
MWindow *mwindow;
VWindow *vwindow;
<td align="left"><font face="Liberation Serif" size=4>Ctrl-alt</font></td>
<td align="left"><font face="Liberation Serif" size=4>Increase all auto curve limits</font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>UP (up arrow)</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Shift</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Move all tracks up by 1</font></td>
+ </tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>DOWN arrow</font></td>
<td align="left"><font face="Liberation Serif" size=4>Ctrl-alt</font></td>
<td align="left"><font face="Liberation Serif" size=4>Decrease all auto curve limits</font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>DOWN arrow</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Shift</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Move all tracks down by 1</font></td>
+ </tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>PGUP (page up)</font></td>
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
//show_meters = new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
//titlesafe_data = new_toggle("titlesafe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
//tool_data = new_toggle("toolwindow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi);
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
new_toggle("eyedrop.png",
editpanel_up,
editpanel_hi,
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
"drawpatch_dn.png",
"drawpatch_checkedhi.png");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
//Is that necessary??
VFrame *cpanel_up = new_image("editpanel_up.png");
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
"patch_dn.png",
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
"mutepatch_up.png",
new_image("locklabels_dn.png"),
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "gang0");
+ new_toggle("gang1.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "gang1");
+ new_toggle("gang2.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
VFrame *cpanel_dn = new_image("cpanel_dn.png");
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
"mutepatch_up.png",
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "gang0");
+ new_toggle("gang1.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "gang1");
+ new_toggle("gang2.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");
"patch_checkedhi.png",
"drawpatch_data");
+ new_toggle("masterpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "masterpatch_data");
+
new_image_set("mutepatch_data",
5,
new_image("locklabels_dn.png"), // can't have seperate down for each!!??
new_image("locklabels_unlockedhi.png"),
"locklabels");
+ new_toggle("gang0.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang0");
+ new_toggle("gang1.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang1");
+ new_toggle("gang2.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "gang2");
VFrame *cpanel_up = new_image("cpanel_up.png");
VFrame *cpanel_hi = new_image("cpanel_hi.png");