projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add master/armed_gang track operations, tweak appearanceprefs layout, fix vicon video...
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
cinelerra
/
awindowgui.C
diff --git
a/cinelerra-5.1/cinelerra/awindowgui.C
b/cinelerra-5.1/cinelerra/awindowgui.C
index cabbbc06fb1c86eda270c8bfed0c13ccb83a2027..33e3cbc8bd33a7aa93513a6c368797deb23e52da 100644
(file)
--- a/
cinelerra-5.1/cinelerra/awindowgui.C
+++ b/
cinelerra-5.1/cinelerra/awindowgui.C
@@
-109,16
+109,20
@@
AssetVIcon::AssetVIcon(AssetPicon *picon, int w, int h, double framerate, int64_
this->picon = picon;
this->length = length;
temp = 0;
this->picon = picon;
this->length = length;
temp = 0;
+ broken = 0;
}
AssetVIcon::~AssetVIcon()
{
}
AssetVIcon::~AssetVIcon()
{
+ if( picon->gui->vicon_thread->solo == this )
+ picon->gui->vicon_thread->solo = 0;
picon->gui->vicon_thread->del_vicon(this);
delete temp;
}
VFrame *AssetVIcon::frame()
{
picon->gui->vicon_thread->del_vicon(this);
delete temp;
}
VFrame *AssetVIcon::frame()
{
+ if( broken ) return 0;
AssetVIconThread *avt = picon->gui->vicon_thread;
Indexable *idxbl = picon->indexable;
Asset *asset = idxbl && idxbl->is_asset ? (Asset *)idxbl : 0;
AssetVIconThread *avt = picon->gui->vicon_thread;
Indexable *idxbl = picon->indexable;
Asset *asset = idxbl && idxbl->is_asset ? (Asset *)idxbl : 0;
@@
-160,26
+164,30
@@
VFrame *AssetVIcon::frame()
}
if( seq_no >= images.size() ) {
MWindow *mwindow = picon->mwindow;
}
if( seq_no >= images.size() ) {
MWindow *mwindow = picon->mwindow;
- File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
- if( !file ) return 0;
if( temp && (temp->get_w() != asset->width || temp->get_h() != asset->height) ) {
delete temp; temp = 0;
}
if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
if( temp && (temp->get_w() != asset->width || temp->get_h() != asset->height) ) {
delete temp; temp = 0;
}
if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
- while( seq_no >= images.size() ) {
- mwindow->video_cache->check_in(asset);
- Thread::yield();
- file = mwindow->video_cache->check_out(asset, mwindow->edl, 0);
- if( !file ) { usleep(1000); continue; }
- file->set_layer(0);
+ File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
+ 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);
int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate;
file->set_video_position(pos,0);
+ file->set_layer(0);
if( file->read_frame(temp) ) temp->clear_frame();
add_image(temp, vw, vh, vicon_cmodel);
if( file->read_frame(temp) ) temp->clear_frame();
add_image(temp, vw, vh, vicon_cmodel);
+ mwindow->video_cache->check_in(asset);
+ Thread::yield();
+ file = 0;
+ 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);
}
mwindow->video_cache->check_in(asset);
}
+ if( seq_no >= images.size() ) return 0;
return *images[seq_no];
}
return *images[seq_no];
}
@@
-529,7
+537,7
@@
void AssetViewPopup::draw_vframe(VFrame *vframe)
double total_length = edl->tracks->total_length();
if( !total_length ) total_length = 1;
for( Track *track=edl->tracks->first; track!=0; track=track->next ) {
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;
for( Edit *edit=track->edits->first; edit!=0; edit=edit->next ) {
Indexable *indexable = (Indexable *)edit->asset;
if( !indexable ) indexable = (Indexable *)edit->nested_edl;
@@
-918,16
+926,25
@@
void AssetPicon::create_objects()
int is_clip = 0;
if( this->indexable ) {
int is_clip = 0;
if( this->indexable ) {
- fs.extract_name(name, indexable->path);
- set_text(name);
- if( this->indexable->is_asset )
+ char *cp = name;
+ if( this->indexable->is_asset ) {
asset = (Asset *)indexable;
asset = (Asset *)indexable;
- else
+ if( asset->format == FILE_REF ) {
+ cp += sprintf(cp, "ref:");
+ set_color(get_color() ^ 0x5599CC);
+ }
+ }
+ else {
edl = (EDL *)indexable;
edl = (EDL *)indexable;
+ cp += sprintf(cp, "edl:");
+// set_color(get_color() ^ 0xCC9955);
+ }
+ fs.extract_name(cp, indexable->path);
+ set_text(name);
}
else if( this->edl ) {
edl = this->edl;
}
else if( this->edl ) {
edl = this->edl;
- s
et_text(strcpy(name, edl->local_session->clip_title)
);
+ s
trcpy(name, edl->local_session->clip_title
);
set_text(name);
is_clip = 1;
}
set_text(name);
is_clip = 1;
}
@@
-2068,10
+2085,6
@@
void AWindowGUI::update_asset_list()
if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
this, current);
if( !exists ) {
AssetPicon *picon = new AssetPicon(mwindow,
this, current);
- if( current->format == FILE_REF ) {
- int color = picon->get_color();
- picon->set_color(color ^ 0x5599CC);
- }
new_assets.append(picon);
}
}
new_assets.append(picon);
}
}
@@
-2643,12
+2656,18
@@
int AWindowFolders::load_expanders()
char expanders_path[BCTEXTLEN];
mwindow->create_defaults_path(expanders_path, EXPANDERS_FILE);
FILE *fp = fopen(expanders_path, "r");
char expanders_path[BCTEXTLEN];
mwindow->create_defaults_path(expanders_path, EXPANDERS_FILE);
FILE *fp = fopen(expanders_path, "r");
+ if( !fp ) {
+ snprintf(expanders_path, sizeof(expanders_path), "%s/%s",
+ File::get_cindat_path(), EXPANDERS_FILE);
+ char *cp = strrchr(expanders_path,'.');
+ if( cp ) strcpy(cp+1, mwindow->cin_lang);
+ fp = fopen(expanders_path, "r");
+ }
if( !fp ) {
snprintf(expanders_path, sizeof(expanders_path), "%s/%s",
File::get_cindat_path(), EXPANDERS_FILE);
fp = fopen(expanders_path, "r");
}
if( !fp ) {
snprintf(expanders_path, sizeof(expanders_path), "%s/%s",
File::get_cindat_path(), EXPANDERS_FILE);
fp = fopen(expanders_path, "r");
}
-
if( !fp ) return 1;
const char tab = '\t';
char line[BCTEXTLEN]; line[0] = 0;
if( !fp ) return 1;
const char tab = '\t';
char line[BCTEXTLEN]; line[0] = 0;