void MWindow::set_gang_tracks(int v)
{
- edl->session->gang_tracks = v;
+ edl->local_session->gang_tracks = v;
+ sync_parameters(CHANGE_PARAMS);
gui->update(1, 1, 0, 0, 1, 0, 0);
gui->flush();
}
load_mode == LOADMODE_REPLACE_CONCATENATE ) &&
(ftype != FILE_IS_XML || edl_mode != LOADMODE_EDL_CLIP) ) {
select_asset(0, 0);
+ edl->session->proxy_state = PROXY_INACTIVE;
edl->session->proxy_scale = 1;
edl->session->proxy_disabled_scale = 1;
edl->session->proxy_use_scaler = 0;
goto_start();
}
- if( ( edl->session->proxy_auto_scale && edl->session->proxy_scale != 1 ) &&
- ( load_mode != LOADMODE_REPLACE && load_mode != LOADMODE_REPLACE_CONCATENATE ) ) {
+ if( edl->session->proxy_state != PROXY_INACTIVE && edl->session->proxy_auto_scale &&
+ load_mode != LOADMODE_REPLACE && load_mode != LOADMODE_REPLACE_CONCATENATE ) {
ArrayList<Indexable *> orig_idxbls;
for( int i=0; i<new_assets.size(); ++i )
orig_idxbls.append(new_assets.get(i));
int MWindow::enable_proxy()
{
int ret = 0;
- if( edl->session->proxy_scale == 1 &&
- edl->session->proxy_disabled_scale != 1 ) {
+ if( edl->session->proxy_state == PROXY_DISABLED ) {
int new_scale = edl->session->proxy_disabled_scale;
int new_use_scaler = edl->session->proxy_use_scaler;
Asset *asset = new Asset;
beep(2000., 1.5, gain);
}
edl->session->proxy_disabled_scale = 1;
+ edl->session->proxy_state = PROXY_ACTIVE;
gui->lock_window("MWindow::to_proxy");
update_project(LOADMODE_REPLACE);
gui->unlock_window();
int MWindow::disable_proxy()
{
- if( edl->session->proxy_scale != 1 &&
- edl->session->proxy_disabled_scale == 1 ) {
- int old_scale = edl->session->proxy_scale, new_scale = 1;
+ if( edl->session->proxy_state == PROXY_ACTIVE ) {
+ int old_scale = edl->session->proxy_scale, new_scale = 0;
int new_use_scaler = edl->session->proxy_use_scaler;
Asset *asset = new Asset;
asset->format = FILE_FFMPEG;
asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
to_proxy(asset, new_scale, new_use_scaler);
asset->remove_user();
+ edl->session->proxy_state = PROXY_DISABLED;
edl->session->proxy_disabled_scale = old_scale;
gui->lock_window("MWindow::to_proxy");
update_project(LOADMODE_REPLACE);
edl->Garbage::add_user();
save_backup();
undo_before(_("proxy"), this);
- int asset_scale = new_scale == 1 ? 0 :
+ int asset_scale = !new_scale ? 0 :
!new_use_scaler ? 1 : new_scale;
ProxyRender proxy_render(this, asset, asset_scale);
// remove all session proxy assets at the at the current proxy_scale
int proxy_scale = edl->session->proxy_scale;
- if( proxy_scale > 1 ) {
+ if( edl->session->proxy_state == PROXY_ACTIVE ) {
Asset *orig_asset = edl->assets->first;
for( ; orig_asset; orig_asset=orig_asset->next ) {
char new_path[BCTEXTLEN];
}
// convert from the proxy assets to the original assets
- edl->set_proxy(1, 0, &proxy_assets, &orig_idxbls);
+ edl->set_proxy(0, 0, &proxy_assets, &orig_idxbls);
// remove the references
for( int i=0; i<proxy_assets.size(); ++i ) {
confirm_paths.set_array_delete();
// convert to new size if not original size
- if( new_scale != 1 ) {
+ if( new_scale ) {
FileSystem fs;
Asset *orig = edl->assets->first;
for( ; orig; orig=orig->next ) {
proxy_render.add_needed(orig_nested, proxy);
}
}
+ edl->session->proxy_state = PROXY_ACTIVE;
}
+ else
+ edl->session->proxy_state = PROXY_INACTIVE;
int result = 0;
// test for existing files
confirm_paths.remove_all_objects();
}
- if( !result )
+ if( !result && new_scale )
result = proxy_render.create_needed_proxies(new_scale);
- if( !result ) // resize project
+ if( !result ) { // resize project
edl->set_proxy(new_scale, new_use_scaler,
&proxy_render.orig_idxbls, &proxy_render.orig_proxies);
-
+ }
undo_after(_("proxy"), LOAD_ALL);
edl->Garbage::remove_user();
restart_brender();
(Indexable*)edit->asset : (Indexable*)edit->nested_edl;
if( !idxbl ) return 0;
char path[BCTEXTLEN];
- if( !edit->asset || edit->track->data_type != TRACK_VIDEO ||
- edl->session->proxy_scale == 1 ||
+// map proxy colors to unproxy colors
+ if( edl->session->proxy_state != PROXY_ACTIVE ||
+ !edit->asset || edit->track->data_type != TRACK_VIDEO ||
ProxyRender::from_proxy_path(path, (Asset*)idxbl, edl->session->proxy_scale) )
strcpy(path, idxbl->path);
char *cp = strrchr(path, '/');