#include "transportque.h"
#include "vrender.h"
-#define WIDTH 400
-#define HEIGHT 330
+#define WIDTH xS(400)
+#define HEIGHT yS(330)
#define MAX_SCALE 16
ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
strcpy(asset->fformat, "mpeg");
strcpy(asset->vcodec, "mpeg.mpeg");
asset->ff_video_bitrate = 2000000;
+ asset->video_data = 1;
bzero(size_text, sizeof(char*) * MAX_SIZES);
bzero(size_factors, sizeof(int) * MAX_SIZES);
return 0;
}
-ProxyRender::ProxyRender(MWindow *mwindow, Asset *format_asset)
+ProxyRender::ProxyRender(MWindow *mwindow, Asset *format_asset, int asset_scale)
{
this->mwindow = mwindow;
this->format_asset = format_asset;
+ this->asset_scale = asset_scale;
progress = 0;
counter_lock = new Mutex("ProxyDialog::counter_lock");
total_rendered = 0;
}
int x = margin;
- int y = margin+10;
+ int y = margin+yS(10);
add_subwindow(use_scaler = new ProxyUseScaler(this, x, y));
y += use_scaler->get_h() + margin;
add_subwindow(text = new BC_Title(x, y, _("Scale factor:")));
x += text->get_w() + margin;
- int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+15);
+ int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+xS(15));
add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, ""));
scale_factor->update_sizes();
x += scale_factor->get_w() + margin;
add_subwindow(active_scale = new BC_Title(x, y, ""));
y += active_scale->get_h() + margin;
- x = margin; y += 25;
+ x = margin; y += yS(25);
format_tools = new ProxyFormatTools(mwindow, this, dialog->asset);
format_tools->create_objects(x, y, 0, 1, 0, 0, 0, 1, 0, 1, // skip the path
0, 0);
void ProxyFormatTools::update_format()
{
+ asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
FormatTools::update_format();
pwindow->use_scaler->update();
}
proxy_render->update_progress();
}
if( !proxy_render->failed && !proxy_render->is_canceled() ) {
- Asset *asset = mwindow->edl->assets->update(proxy);
+ Asset *asset = edl->assets->update(proxy);
+ asset->proxy_scale = proxy_render->asset_scale;
+ int scale = asset->proxy_scale;
+ if( !scale ) scale = 1;
+ asset->width = asset->actual_width * scale;
+ asset->height = asset->actual_height * scale;
mwindow->mainindexes->add_next_asset(0, asset);
mwindow->mainindexes->start_build();
}