projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vicon jittering, opengl no draw_refresh if no ovly for last frame
[goodguy/history.git]
/
cinelerra-5.1
/
cinelerra
/
tracks.C
diff --git
a/cinelerra-5.1/cinelerra/tracks.C
b/cinelerra-5.1/cinelerra/tracks.C
index 9d994f471855e14b53bfe163ead38b21916f20db..08952e429d3fbd06e50bfe9859b335a15e623ceb 100644
(file)
--- a/
cinelerra-5.1/cinelerra/tracks.C
+++ b/
cinelerra-5.1/cinelerra/tracks.C
@@
-201,31
+201,23
@@
int Tracks::load(FileXML *xml,
xml->tag.get_property("TYPE", string);
if((load_flags & LOAD_ALL) == LOAD_ALL ||
xml->tag.get_property("TYPE", string);
if((load_flags & LOAD_ALL) == LOAD_ALL ||
- (load_flags & LOAD_EDITS))
- {
- if(!strcmp(string, "VIDEO"))
- {
- add_video_track(0, 0);
+ (load_flags & LOAD_EDITS)) {
+ if(!strcmp(string, "VIDEO")) {
+ track = add_video_track(0, 0);
}
}
- else
- if(!strcmp(string, "SUBTTL"))
- {
- add_subttl_track(0, 0);
+ else if(!strcmp(string, "SUBTTL")) {
+ track = add_subttl_track(0, 0);
}
}
- else
- {
- add_audio_track(0, 0); // default to audio
+ else {
+ track = add_audio_track(0, 0); // default to audio
}
}
- track = last;
}
}
- else
- {
- track = get_item_number(track_offset);
- track_offset++;
+ else {
+ track = get_item_number(track_offset++);
}
// load it
}
// load it
- if(
track
) track->load(xml, track_offset, load_flags);
+ if(
track
) track->load(xml, track_offset, load_flags);
return 0;
}
return 0;
}
@@
-287,83
+279,39
@@
Track* Tracks::add_audio_track(int above, Track *dst_track)
Track* Tracks::add_video_track(int above, Track *dst_track)
{
Track* Tracks::add_video_track(int above, Track *dst_track)
{
-const int debug = 0;
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
VTrack* new_track = new VTrack(edl, this);
VTrack* new_track = new VTrack(edl, this);
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
if(!dst_track)
dst_track = (above ? first : last);
if(!dst_track)
dst_track = (above ? first : last);
-
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
if(above)
if(above)
- {
insert_before(dst_track, (Track*)new_track);
insert_before(dst_track, (Track*)new_track);
- }
else
else
- {
insert_after(dst_track, (Track*)new_track);
insert_after(dst_track, (Track*)new_track);
- }
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
-
-
-// Shift effects referenced below the new track
- for(Track *track = last;
- track && track != new_track;
- track = track->previous)
- {
+ for(Track *track = last; track && track != new_track; track = track->previous)
change_modules(number_of(track) - 1, number_of(track), 0);
change_modules(number_of(track) - 1, number_of(track), 0);
- }
-
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
-
new_track->create_objects();
new_track->create_objects();
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
new_track->set_default_title();
new_track->set_default_title();
-if(debug) printf("Tracks::add_video_track %d\n", __LINE__);
return new_track;
}
Track* Tracks::add_subttl_track(int above, Track *dst_track)
{
return new_track;
}
Track* Tracks::add_subttl_track(int above, Track *dst_track)
{
-const int debug = 0;
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
STrack* new_track = new STrack(edl, this);
STrack* new_track = new STrack(edl, this);
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
if(!dst_track)
dst_track = (above ? first : last);
if(!dst_track)
dst_track = (above ? first : last);
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
if(above)
if(above)
- {
insert_before(dst_track, (Track*)new_track);
insert_before(dst_track, (Track*)new_track);
- }
else
else
- {
insert_after(dst_track, (Track*)new_track);
insert_after(dst_track, (Track*)new_track);
- }
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
-
-
-// Shift effects referenced below the new track
- for(Track *track = last;
- track && track != new_track;
- track = track->previous)
- {
+ for(Track *track = last; track && track != new_track; track = track->previous)
change_modules(number_of(track) - 1, number_of(track), 0);
change_modules(number_of(track) - 1, number_of(track), 0);
- }
-
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
-
new_track->create_objects();
new_track->create_objects();
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
new_track->set_default_title();
new_track->set_default_title();
-if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__);
-
// new_track->paste_silence(0,total_length(),0);
return new_track;
}
// new_track->paste_silence(0,total_length(),0);
return new_track;
}
@@
-402,23
+350,21
@@
int Tracks::detach_shared_effects(int module)
int Tracks::total_of(int type)
{
int result = 0;
int Tracks::total_of(int type)
{
int result = 0;
- IntAuto *mute_keyframe = 0;
for(Track *current = first; current; current = NEXT)
{
long unit_start = current->to_units(edl->local_session->get_selectionstart(1), 0);
for(Track *current = first; current; current = NEXT)
{
long unit_start = current->to_units(edl->local_session->get_selectionstart(1), 0);
- mute_keyframe =
- (IntAuto*)current->automation->autos[AUTOMATION_MUTE]->get_prev_auto(
- unit_start,
- PLAY_FORWARD,
- (Auto* &)mute_keyframe);
+ Auto *mute_keyframe = 0;
+ current->automation->autos[AUTOMATION_MUTE]->
+ get_prev_auto(unit_start, PLAY_FORWARD, mute_keyframe);
+ IntAuto *mute_auto = (IntAuto *)mute_keyframe;
result +=
(current->play && type == PLAY) ||
(current->record && type == RECORD) ||
(current->gang && type == GANG) ||
(current->draw && type == DRAW) ||
result +=
(current->play && type == PLAY) ||
(current->record && type == RECORD) ||
(current->gang && type == GANG) ||
(current->draw && type == DRAW) ||
- (mute_
keyframe
->value && type == MUTE) ||
+ (mute_
auto
->value && type == MUTE) ||
(current->expand_view && type == EXPAND);
}
return result;
(current->expand_view && type == EXPAND);
}
return result;
@@
-493,15
+439,18
@@
double Tracks::total_playable_length()
double total = 0;
for(Track *current = first; current; current = NEXT)
{
double total = 0;
for(Track *current = first; current; current = NEXT)
{
- double length = current->get_length();
- if(length > total) total = length;
+ if( current->play )
+ {
+ double length = current->get_length();
+ if(length > total) total = length;
+ }
}
return total;
}
double Tracks::total_recordable_length()
{
}
return total;
}
double Tracks::total_recordable_length()
{
- double total =
0
;
+ double total =
-1
;
for(Track *current = first; current; current = NEXT)
{
if(current->record)
for(Track *current = first; current; current = NEXT)
{
if(current->record)
@@
-518,7
+467,8
@@
double Tracks::total_length()
double total = 0;
for(Track *current = first; current; current = NEXT)
{
double total = 0;
for(Track *current = first; current; current = NEXT)
{
- if(current->get_length() > total) total = current->get_length();
+ double length = current->get_length();
+ if(length > total) total = length;
}
return total;
}
}
return total;
}