./autogen.sh
CC=clang CXX=clang++ CFLAGS="-g -O2 -DFFMPEG3" ./configure --with-single-user \
--disable-static-build --without-lv2 --disable-lame --disable-twolame \
- --with-oss --without-alsa --without-gl --without-firewire --without-dv \
- --without-dvb --without-video4linux2 --without-xxf86vm --without-ladspa-build \
+ --with-oss --without-alsa --without-firewire --without-dv --without-dvb \
+ --without-video4linux2 --without-xxf86vm --without-ladspa-build \
--without-libzmpeg --without-commercial --without-thirdparty
gmake 2>&1 | tee log
vicon_audio = 0;
vicon_drawing = 1;
displayed_folder = AW_NO_FOLDER;
+ folder_lock = new Mutex("AWindowGUI::folder_lock");
}
AWindowGUI::~AWindowGUI()
delete vtransition_vframe; delete vtransition_icon;
delete aeffect_vframe; delete aeffect_icon;
delete veffect_vframe; delete veffect_icon;
+ delete folder_lock;
}
bool AWindowGUI::protected_pixmap(BC_Pixmap *icon)
plugin_icon(ladspa_vframe, ladspa_icon, "lad_picon", lad_picon_png);
plugin_icon(ff_aud_vframe, ff_aud_icon, "ff_audio", ff_audio_png);
plugin_icon(ff_vid_vframe, ff_vid_icon, "ff_video", ff_video_png);
-
+ folder_lock->lock("AWindowGUI::create_objects");
// Mandatory folders
folders.append(new AssetPicon(mwindow, this, AW_AEFFECT_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_VEFFECT_FOLDER, 1));
folders.append(new AssetPicon(mwindow, this, AW_MEDIA_FOLDER, 1));
create_label_folder();
+ folder_lock->unlock();
mwindow->theme->get_awindow_sizes(this);
load_defaults(mwindow->defaults);
void AWindowGUI::sort_assets(int use_mtime)
{
+ folder_lock->lock("AWindowGUI::sort_assets");
switch( mwindow->edl->session->awindow_folder ) {
case AW_AEFFECT_FOLDER:
sort_picons(&aeffects);
break;
default:
sort_picons(&assets, use_mtime);
+ break;
}
// reset xyposition
asset_list->update_format(asset_list->get_format(), 0);
+ folder_lock->unlock();
update_assets();
}
void AWindowGUI::sort_folders()
{
+ folder_lock->lock("AWindowGUI::update_assets");
sort_picons(&folders);
folder_list->update_format(folder_list->get_format(), 0);
+ folder_lock->unlock();
update_assets();
}
void AWindowGUI::update_assets()
{
stop_vicon_drawing();
+ folder_lock->lock("AWindowGUI::update_assets");
update_folder_list();
update_asset_list();
labellist.remove_all_objects();
if( displayed_folder != mwindow->edl->session->awindow_folder )
search_text->clear();
filter_displayed_assets();
+ folder_lock->unlock();
if( mwindow->edl->session->folderlist_format != folder_list->get_format() ) {
folder_list->update_format(mwindow->edl->session->folderlist_format, 0);
#include "labels.h"
#include "indexable.inc"
#include "mwindow.inc"
+#include "mutex.inc"
#include "newfolder.inc"
#include "pluginserver.inc"
#include "proxypopup.inc"
AWindowFolders *folder_list;
AWindowDivider *divider;
AWindowSearchText *search_text;
+ Mutex *folder_lock;
// Store data to speed up responses
// Persistant data for listboxes
}
}
-void EDL::set_proxy(int use_scaler, int new_scale, int auto_scale, int beep,
+void EDL::set_proxy(int new_scale, int use_scaler,
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
{
- int orig_use_scaler = session->proxy_use_scaler;
int orig_scale = session->proxy_scale;
+ int orig_use_scaler = session->proxy_use_scaler;
+
// rescale to full size asset in read_frame
- session->proxy_use_scaler = use_scaler;
session->proxy_scale = new_scale;
- session->proxy_auto_scale = auto_scale;
- session->proxy_beep = beep;
+ session->proxy_use_scaler = use_scaler;
if( use_scaler ) {
for( int i=0; i<proxy_assets->size(); ++i ) {
// Does nothing if EDL already exists
void append_vwindow_edl(EDL *edl, int increase_counter);
void rescale_proxy(int orig_scale, int new_scale);
- void set_proxy(int use_scaler, int new_scale, int auto_scale, int beep,
+ void set_proxy(int new_scale, int use_scaler,
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
void add_proxy(int use_scaler,
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
playback_cursor_visible = 0;
playback_preload = 0;
proxy_scale = 1;
+ proxy_disabled_scale = 1;
proxy_use_scaler = 0;
proxy_auto_scale = 1;
proxy_beep = 0;
(subtitle_number != ptr->subtitle_number) ||
(interpolate_raw != ptr->interpolate_raw) ||
(white_balance_raw != ptr->white_balance_raw) ||
+ (proxy_disabled_scale != ptr->proxy_disabled_scale) ||
(proxy_scale != ptr->proxy_scale) ||
(proxy_use_scaler != ptr->proxy_use_scaler));
}
session->white_balance_raw != white_balance_raw ||
session->decode_subtitles != decode_subtitles ||
session->subtitle_number != subtitle_number ||
+ session->proxy_disabled_scale != proxy_disabled_scale ||
session->proxy_scale != proxy_scale ||
session->proxy_use_scaler != proxy_use_scaler )
*result = 0;
aspect_w = file->tag.get_property("ASPECTW", aspect_w);
aspect_h = file->tag.get_property("ASPECTH", aspect_h);
proxy_scale = file->tag.get_property("PROXY_SCALE", proxy_scale);
+ proxy_disabled_scale = file->tag.get_property("PROXY_DISABLED_SCALE", proxy_disabled_scale);
proxy_use_scaler = file->tag.get_property("PROXY_USE_SCALER", proxy_use_scaler);
proxy_auto_scale = file->tag.get_property("PROXY_AUTO_SCALE", proxy_auto_scale);
return 0;
file->tag.set_property("ASPECTW", aspect_w);
file->tag.set_property("ASPECTH", aspect_h);
file->tag.set_property("PROXY_SCALE", proxy_scale);
+ file->tag.set_property("PROXY_DISABLED_SCALE", proxy_disabled_scale);
file->tag.set_property("PROXY_USE_SCALER", proxy_use_scaler);
file->tag.set_property("PROXY_AUTO_SCALE", proxy_auto_scale);
file->append_tag();
vwindow_zoom = session->vwindow_zoom;
vwindow_click2play = session->vwindow_click2play;
proxy_scale = session->proxy_scale;
+ proxy_disabled_scale = session->proxy_disabled_scale;
proxy_use_scaler = session->proxy_use_scaler;
proxy_auto_scale = session->proxy_auto_scale;
proxy_beep = session->proxy_beep;
printf(" audio_tracks=%d audio_channels=%d sample_rate=%jd\n"
" video_tracks=%d frame_rate=%f output_w=%d output_h=%d aspect_w=%f aspect_h=%f\n"
" decode subtitles=%d subtitle_number=%d label_cells=%d program_no=%d\n"
- " proxy_scale=%d\n proxy_use_scaler=%d, proxy_auto_scale=%d\n"
- " proxy_beep=%d render_beep=%d\n",
+ " proxy scale=%d\n disabled_scale=%d, use_scaler=%d, auto_scale=%d\n"
+ " proxy_beep=%d render_beep=%d\n",
audio_tracks, audio_channels, sample_rate, video_tracks,
frame_rate, output_w, output_h, aspect_w, aspect_h,
decode_subtitles, subtitle_number, label_cells, program_no,
- proxy_scale, proxy_use_scaler, proxy_auto_scale,
+ proxy_scale, proxy_disabled_scale, proxy_use_scaler, proxy_auto_scale,
proxy_beep, render_beep);
}
int playback_software_position;
// current settings are scaled this much from the original settings
int proxy_scale;
+// original proxy_scale when proxy_enable disables/enables proxy
+ int proxy_disabled_scale;
// upscale geom from proxy to session on read in
int proxy_use_scaler;
// automatically rescale assets when loaded
#include "clipedls.h"
#include "bccmodels.h"
#include "commercials.h"
+#include "confirmsave.h"
#include "cplayback.h"
#include "ctimebar.h"
#include "cwindowgui.h"
load_mode == LOADMODE_REPLACE_CONCATENATE ) ) {
select_asset(0, 0);
edl->session->proxy_scale = 1;
+ edl->session->proxy_disabled_scale = 1;
edl->session->proxy_use_scaler = 0;
edl->session->proxy_auto_scale = 0;
edl->session->proxy_beep = 0;
return !result ? proxy_render.needed_proxies.size() : -1;
}
+int MWindow::enable_proxy()
+{
+ if( edl->session->proxy_scale == 1 &&
+ edl->session->proxy_disabled_scale != 1 ) {
+ int new_scale = edl->session->proxy_disabled_scale;
+ edl->session->proxy_disabled_scale = 1;
+ Asset *asset = new Asset;
+ asset->format = FILE_FFMPEG;
+ asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
+ to_proxy(asset, new_scale);
+ asset->remove_user();
+ }
+ return 1;
+}
+
+int MWindow::disable_proxy()
+{
+ if( edl->session->proxy_scale != 1 &&
+ edl->session->proxy_disabled_scale == 1 ) {
+ edl->session->proxy_disabled_scale = edl->session->proxy_scale;
+ Asset *asset = new Asset;
+ asset->format = FILE_FFMPEG;
+ asset->load_defaults(defaults, "PROXY_", 1, 1, 0, 0, 0);
+ to_proxy(asset, 1);
+ asset->remove_user();
+ }
+ return 1;
+}
+
+int MWindow::to_proxy(Asset *asset, int new_scale)
+{
+ ArrayList<Indexable*> orig_idxbls;
+ ArrayList<Indexable*> proxy_assets;
+
+ edl->Garbage::add_user();
+ save_backup();
+ undo->update_undo_before(_("proxy"), this);
+ ProxyRender proxy_render(this, asset);
+
+// revert project to original size from current size
+// remove all session proxy assets at the at the current proxy_scale
+ int proxy_scale = edl->session->proxy_scale;
+ int proxy_use_scaler = edl->session->proxy_use_scaler;
+
+ if( proxy_scale > 1 ) {
+ Asset *orig_asset = edl->assets->first;
+ for( ; orig_asset; orig_asset=orig_asset->next ) {
+ char new_path[BCTEXTLEN];
+ proxy_render.to_proxy_path(new_path, orig_asset, proxy_scale);
+// test if proxy asset was already added to proxy_assets
+ int got_it = 0;
+ for( int i = 0; !got_it && i<proxy_assets.size(); ++i )
+ got_it = !strcmp(proxy_assets[i]->path, new_path);
+ if( got_it ) continue;
+ Asset *proxy_asset = edl->assets->get_asset(new_path);
+ if( !proxy_asset ) continue;
+// add pointer to existing EDL asset if it exists
+// EDL won't delete it unless it's the same pointer.
+ proxy_assets.append(proxy_asset);
+ proxy_asset->add_user();
+ orig_idxbls.append(orig_asset);
+ orig_asset->add_user();
+ }
+ for( int i=0,n=edl->nested_edls.size(); i<n; ++i ) {
+ EDL *orig_nested = edl->nested_edls[i];
+ char new_path[BCTEXTLEN];
+ if( !ProxyRender::from_proxy_path(new_path, orig_nested, proxy_scale) )
+ continue;
+ proxy_render.to_proxy_path(new_path, orig_nested, proxy_scale);
+// test if proxy asset was already added to proxy_assets
+ int got_it = 0;
+ for( int i = 0; !got_it && i<proxy_assets.size(); ++i )
+ got_it = !strcmp(proxy_assets[i]->path, new_path);
+ if( got_it ) continue;
+ Asset *proxy_nested = edl->assets->get_asset(new_path);
+ if( !proxy_nested ) continue;
+// add pointer to existing EDL asset if it exists
+// EDL won't delete it unless it's the same pointer.
+ proxy_assets.append(proxy_nested);
+ proxy_nested->add_user();
+ orig_idxbls.append(orig_nested);
+ orig_nested->add_user();
+ }
+
+// convert from the proxy assets to the original assets
+ edl->set_proxy(1, 0, &proxy_assets, &orig_idxbls);
+
+// remove the references
+ for( int i=0; i<proxy_assets.size(); ++i ) {
+ Asset *proxy = (Asset *) proxy_assets[i];
+ proxy->width = proxy->actual_width;
+ proxy->height = proxy->actual_height;
+ proxy->remove_user();
+ edl->assets->remove_pointer(proxy);
+ proxy->remove_user();
+ }
+ proxy_assets.remove_all();
+ for( int i = 0; i < orig_idxbls.size(); i++ )
+ orig_idxbls[i]->remove_user();
+ orig_idxbls.remove_all();
+ }
+
+ ArrayList<char *> confirm_paths; // test for new files
+ confirm_paths.set_array_delete();
+
+// convert to new size if not original size
+ if( new_scale != 1 ) {
+ FileSystem fs;
+ Asset *orig = edl->assets->first;
+ for( ; orig; orig=orig->next ) {
+ Asset *proxy = proxy_render.add_original(orig, new_scale);
+ if( !proxy ) continue;
+ int exists = fs.get_size(proxy->path) > 0 ? 1 : 0;
+ int got_it = exists && // if proxy exists, and is newer than orig
+ fs.get_date(proxy->path) > fs.get_date(orig->path) ? 1 : 0;
+ if( !got_it ) {
+ if( exists ) // prompt user to overwrite
+ confirm_paths.append(cstrdup(proxy->path));
+ proxy_render.add_needed(orig, proxy);
+ }
+ }
+ for( int i=0,n=edl->nested_edls.size(); i<n; ++i ) {
+ EDL *orig_nested = edl->nested_edls[i];
+ Asset *proxy = proxy_render.add_original(orig_nested, new_scale);
+ if( !proxy ) continue;
+ int exists = fs.get_size(proxy->path) > 0 ? 1 : 0;
+ int got_it = exists && // if proxy exists, and is newer than orig_nested
+ fs.get_date(proxy->path) > fs.get_date(orig_nested->path) ? 1 : 0;
+ if( !got_it ) {
+ if( exists ) // prompt user to overwrite
+ confirm_paths.append(cstrdup(proxy->path));
+ proxy_render.add_needed(orig_nested, proxy);
+ }
+ }
+ }
+
+ int result = 0;
+// test for existing files
+ if( confirm_paths.size() ) {
+ result = ConfirmSave::test_files(this, &confirm_paths);
+ confirm_paths.remove_all_objects();
+ }
+
+ if( !result )
+ result = proxy_render.create_needed_proxies(new_scale);
+
+ if( !result ) // resize project
+ edl->set_proxy(new_scale, proxy_use_scaler,
+ &proxy_render.orig_idxbls, &proxy_render.orig_proxies);
+
+ undo->update_undo_after(_("proxy"), LOAD_ALL);
+ edl->Garbage::remove_user();
+ restart_brender();
+
+ gui->lock_window("MWindow::to_proxy");
+ update_project(LOADMODE_REPLACE);
+ gui->unlock_window();
+
+ return !result ? proxy_render.needed_proxies.size() : -1;
+}
+
void MWindow::test_plugins(EDL *new_edl, char *path)
{
char string[BCTEXTLEN];
int modify_pluginhandles();
void finish_modify_handles();
void rescale_proxy(EDL *clip, int orig_scale, int new_scale);
- void set_proxy(int use_scaler, int new_scale, int auto_scale, int beep,
- ArrayList<Indexable*> *orig_assets,
- ArrayList<Indexable*> *proxy_assets);
void add_proxy(int use_scaler,
ArrayList<Indexable*> *orig_assets,
ArrayList<Indexable*> *proxy_assets);
int render_proxy(ArrayList<Indexable *> &new_idxbls);
void beep(double freq, double secs, double gain);
+ int enable_proxy();
+ int disable_proxy();
+ int to_proxy(Asset *asset, int new_scale);
ProxyBeep *proxy_beep;
void dump_plugins(FILE *fp=stdout);
edl->rescale_proxy(orig_scale, new_scale);
}
-void MWindow::set_proxy(int use_scaler, int new_scale, int auto_scale, int beep,
- ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
-{
- edl->set_proxy(use_scaler, new_scale, auto_scale, beep, orig_assets, proxy_assets);
-}
-
void MWindow::add_proxy(int use_scaler,
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets)
{
add_subwindow(mbuttons = new MButtons(mwindow, this));
mbuttons->create_objects();
- add_subwindow(ffmpeg_toggle = new FFMpegToggle(mwindow, mbuttons, menu_w(), menu_h()+2));
+ int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+2;
+ add_subwindow(proxy_toggle = new ProxyToggle(mwindow, mbuttons, x1, y1));
+ x1 += proxy_toggle->get_w() + 3;
+ add_subwindow(ffmpeg_toggle = new FFMpegToggle(mwindow, mbuttons, x1, y1));
pane[TOP_LEFT_PANE] = new TimelinePane(mwindow,
TOP_LEFT_PANE,
int x = w - MainShBtns::calculate_w(0);
mainmenu->resize_event(x, mainmenu->get_h());
mainshbtns->reposition_window(x, -1);
- ffmpeg_toggle->reposition_window(menu_w(), menu_h()+2);
mwindow->theme->get_mwindow_sizes(this, w, h);
mwindow->theme->draw_mwindow_bg(this);
mbuttons->resize_event();
+ int x1 = mbuttons->get_x() + mbuttons->get_w(), y1 = mbuttons->get_y()+2;
+ proxy_toggle->reposition_window(x1, y1);
+ x1 += proxy_toggle->get_w() + 3;
+ ffmpeg_toggle->reposition_window(x1, y1);
statusbar->resize_event();
zoombar->resize_event();
}
}
+int MWindowGUI::show_window(int flush)
+{
+ int ret = BC_WindowBase::show_window(flush);
+ if( mwindow->edl->session->proxy_scale == 1 &&
+ mwindow->edl->session->proxy_disabled_scale == 1 )
+ proxy_toggle->hide_window();
+ else
+ proxy_toggle->show_window();
+ return ret;
+}
+
void MWindowGUI::draw_cursor(int do_plugintoggles)
{
for(int i = 0; i < TOTAL_PANES; i++)
return mainmenu->get_h();
}
+int MWindowGUI::mbuttons_w()
+{
+ int w = get_w();
+ w -= mwindow->theme->ffmpeg_toggle[0]->get_w()+2;
+ w -= mwindow->theme->ffmpeg_toggle[0]->get_w()+2;
+ return w;
+}
+
void MWindowGUI::start_x_pane_drag()
{
if(!x_pane_drag)
}
+ProxyToggle::ProxyToggle(MWindow *mwindow, MButtons *mbuttons, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->proxy_toggle,
+ mwindow->edl->session->proxy_disabled_scale != 1)
+{
+ this->mwindow = mwindow;
+ this->mbuttons = mbuttons;
+ set_tooltip(mwindow->edl->session->proxy_disabled_scale==1 ?
+ _("Disable proxy") : _("Enable proxy"));
+}
+
+ProxyToggle::~ProxyToggle()
+{
+}
+
+int ProxyToggle::handle_event()
+{
+ int disabled = get_value();
+ if( disabled )
+ mwindow->disable_proxy();
+ else
+ mwindow->enable_proxy();
+ set_tooltip(!disabled ? _("Disable proxy") : _("Enable proxy"));
+ return 1;
+}
+
+int ProxyToggle::keypress_event()
+{
+ if( ctrl_down() && !shift_down() && !alt_down() ) {
+ int key = get_keypress();
+ if( key == 'r' ) {
+ int value = get_value() ? 0 : 1;
+ set_value(value);
+ return handle_event();
+ }
+ }
+ return 0;
+}
+
MButtons *mbuttons;
};
+class ProxyToggle : public BC_Toggle
+{
+public:
+ ProxyToggle(MWindow *mwindow, MButtons *mbuttons, int x, int y);
+ ~ProxyToggle();
+ int handle_event();
+ int keypress_event();
+
+ MWindow *mwindow;
+ MButtons *mbuttons;
+};
+
class MWindowGUI : public BC_Window
{
void update_scrollbars(int flush);
void draw_canvas(int mode, int hide_cursor);
void flash_canvas(int flush);
+ int show_window(int flush=1);
void deactivate_timeline();
void activate_timeline();
void reset_meters();
int save_defaults(BC_Hash *defaults);
int menu_w();
int menu_h();
+ int mbuttons_w();
// Draw on the status bar only.
void show_message(const char *message, int color=-1);
void update_default_message();
MainClock *mainclock;
MButtons *mbuttons;
FFMpegToggle *ffmpeg_toggle;
+ ProxyToggle *proxy_toggle;
PaneDivider *x_divider;
PaneDivider *y_divider;
TimelinePane *pane[TOTAL_PANES];
delete [] syms[i];
}
delete [] names; names = 0;
+ delete [] syms; syms = 0;
delete [] mins; mins = 0;
delete [] maxs; maxs = 0;
delete [] ctls; ctls = 0;
#include "bcsignals.h"
#include "cache.h"
#include "clip.h"
-#include "confirmsave.h"
#include "cstrdup.h"
#include "edl.h"
#include "edlsession.h"
#include "vrender.h"
#define WIDTH 400
-#define HEIGHT 300
+#define HEIGHT 330
#define MAX_SCALE 16
ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
size_text[0] = cstrdup(_("Original size"));
size_factors[0] = 1;
total_sizes = 1;
- proxy_beep = 0;
}
ProxyDialog::~ProxyDialog()
{
- delete proxy_beep;
close_window();
for( int i=0; i<MAX_SIZES; ++i ) delete [] size_text[i];
asset->remove_user();
void ProxyDialog::handle_close_event(int result)
{
+ if( result ) return;
+ mwindow->edl->session->proxy_use_scaler = use_scaler;
+ mwindow->edl->session->proxy_auto_scale = auto_scale;
+ mwindow->edl->session->proxy_beep = beep;
+ mwindow->edl->session->proxy_disabled_scale = 1;
asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
-
- if( !result && (result=to_proxy()) >= 0 && beep && new_scale != 1 )
- if( result > 0 )
- mwindow->beep(2000., 1.5, 0.5);
- else
- mwindow->beep(4000., 0.25, 0.5);
-}
-
-int ProxyDialog::to_proxy()
-{
- ArrayList<Indexable*> orig_idxbls;
- ArrayList<Indexable*> proxy_assets;
-
- EDL *edl = mwindow->edl;
- mwindow->edl->Garbage::add_user();
- mwindow->save_backup();
- mwindow->undo->update_undo_before(_("proxy"), this);
- ProxyRender proxy_render(mwindow, asset);
-
-// revert project to original size from current size
-// remove all session proxy assets at the at the current proxy_scale
- int proxy_scale = edl->session->proxy_scale;
- if( proxy_scale > 1 ) {
- Asset *orig_asset = edl->assets->first;
- for( ; orig_asset; orig_asset=orig_asset->next ) {
- char new_path[BCTEXTLEN];
- proxy_render.to_proxy_path(new_path, orig_asset, proxy_scale);
-// test if proxy asset was already added to proxy_assets
- int got_it = 0;
- for( int i = 0; !got_it && i<proxy_assets.size(); ++i )
- got_it = !strcmp(proxy_assets[i]->path, new_path);
- if( got_it ) continue;
- Asset *proxy_asset = edl->assets->get_asset(new_path);
- if( !proxy_asset ) continue;
-// add pointer to existing EDL asset if it exists
-// EDL won't delete it unless it's the same pointer.
- proxy_assets.append(proxy_asset);
- proxy_asset->add_user();
- orig_idxbls.append(orig_asset);
- orig_asset->add_user();
- }
- for( int i=0,n=edl->nested_edls.size(); i<n; ++i ) {
- EDL *orig_nested = edl->nested_edls[i];
- char new_path[BCTEXTLEN];
- if( !ProxyRender::from_proxy_path(new_path, orig_nested, proxy_scale) )
- continue;
- proxy_render.to_proxy_path(new_path, orig_nested, proxy_scale);
-// test if proxy asset was already added to proxy_assets
- int got_it = 0;
- for( int i = 0; !got_it && i<proxy_assets.size(); ++i )
- got_it = !strcmp(proxy_assets[i]->path, new_path);
- if( got_it ) continue;
- Asset *proxy_nested = edl->assets->get_asset(new_path);
- if( !proxy_nested ) continue;
-// add pointer to existing EDL asset if it exists
-// EDL won't delete it unless it's the same pointer.
- proxy_assets.append(proxy_nested);
- proxy_nested->add_user();
- orig_idxbls.append(orig_nested);
- orig_nested->add_user();
- }
-
-// convert from the proxy assets to the original assets
- int auto_scale = edl->session->proxy_auto_scale;
- int beep = edl->session->proxy_beep;
- mwindow->set_proxy(0, 1, auto_scale, beep, &proxy_assets, &orig_idxbls);
-
-// remove the references
- for( int i=0; i<proxy_assets.size(); ++i ) {
- Asset *proxy = (Asset *) proxy_assets[i];
- proxy->width = proxy->actual_width;
- proxy->height = proxy->actual_height;
- proxy->remove_user();
- mwindow->edl->assets->remove_pointer(proxy);
- proxy->remove_user();
- }
- proxy_assets.remove_all();
- for( int i = 0; i < orig_idxbls.size(); i++ )
- orig_idxbls[i]->remove_user();
- orig_idxbls.remove_all();
- }
-
- ArrayList<char *> confirm_paths; // test for new files
- confirm_paths.set_array_delete();
-
-// convert to new size if not original size
- if( new_scale != 1 ) {
- FileSystem fs;
- Asset *orig = mwindow->edl->assets->first;
- for( ; orig; orig=orig->next ) {
- Asset *proxy = proxy_render.add_original(orig, new_scale);
- if( !proxy ) continue;
- int exists = fs.get_size(proxy->path) > 0 ? 1 : 0;
- int got_it = exists && // if proxy exists, and is newer than orig
- fs.get_date(proxy->path) > fs.get_date(orig->path) ? 1 : 0;
- if( !got_it ) {
- if( exists ) // prompt user to overwrite
- confirm_paths.append(cstrdup(proxy->path));
- proxy_render.add_needed(orig, proxy);
- }
- }
- for( int i=0,n=edl->nested_edls.size(); i<n; ++i ) {
- EDL *orig_nested = edl->nested_edls[i];
- Asset *proxy = proxy_render.add_original(orig_nested, new_scale);
- if( !proxy ) continue;
- int exists = fs.get_size(proxy->path) > 0 ? 1 : 0;
- int got_it = exists && // if proxy exists, and is newer than orig_nested
- fs.get_date(proxy->path) > fs.get_date(orig_nested->path) ? 1 : 0;
- if( !got_it ) {
- if( exists ) // prompt user to overwrite
- confirm_paths.append(cstrdup(proxy->path));
- proxy_render.add_needed(orig_nested, proxy);
- }
- }
+ result = mwindow->to_proxy(asset, new_scale);
+ if( result >= 0 && beep && new_scale != 1 ) {
+ static struct { double freq, secs, gain; }
+ tone[2] = { { 2000., 1.5, 0.5 }, { 4000., 0.25, 0.5 } };
+ int i = result > 0 ? 0 : 1;
+ mwindow->beep(tone[i].freq, tone[i].secs, tone[i].gain);
}
-
- int result = 0;
-// test for existing files
- if( confirm_paths.size() ) {
- result = ConfirmSave::test_files(mwindow, &confirm_paths);
- confirm_paths.remove_all_objects();
- }
-
- if( !result )
- result = proxy_render.create_needed_proxies(new_scale);
-
- if( !result ) // resize project
- mwindow->set_proxy(use_scaler, new_scale, auto_scale, beep,
- &proxy_render.orig_idxbls, &proxy_render.orig_proxies);
-
- mwindow->undo->update_undo_after(_("proxy"), LOAD_ALL);
- mwindow->edl->Garbage::remove_user();
- mwindow->restart_brender();
-
- mwindow->gui->lock_window("ProxyDialog::to_proxy");
- mwindow->update_project(LOADMODE_REPLACE);
- mwindow->gui->unlock_window();
- return !result ? proxy_render.needed_proxies.size() : -1;
}
-
void ProxyRender::to_proxy_path(char *new_path, Indexable *indexable, int scale)
{
// path is already a proxy
add_subwindow(new_dimensions = new BC_Title(x, y, ""));
y += new_dimensions->get_h() + margin;
+ x = margin;
+ add_subwindow(text = new BC_Title(x, y, _("Active Scale: ")));
+ x += text->get_w() + margin;
+ add_subwindow(active_scale = new BC_Title(x, y, ""));
+ y += active_scale->get_h() + margin;
+
x = margin; y += 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
void ProxyWindow::update()
{
-// preview the new size
- char string[BCTEXTLEN];
-//printf("ProxyWindow::update %d %d %d %d %d\n",
-// __LINE__, mwindow->edl->session->output_w, mwindow->edl->session->output_h,
-// dialog->orig_scale, dialog->new_scale);
+ char string[BCSTRLEN];
int orig_w = mwindow->edl->session->output_w * dialog->orig_scale;
int orig_h = mwindow->edl->session->output_h * dialog->orig_scale;
int new_w = orig_w / dialog->new_scale;
scale_factor->set_text(string);
use_scaler->update();
auto_scale->update();
+ int scale = mwindow->edl->session->proxy_scale;
+ if( scale == 1 ) scale = mwindow->edl->session->proxy_disabled_scale;
+ sprintf(string, scale>1 ? "1/%d" : "%d", scale);
+ active_scale->update(string);
}
int ProxyUseScaler::handle_event()
{
- pwindow->dialog->new_scale = 1;
pwindow->dialog->use_scaler = get_value();
pwindow->scale_factor->update_sizes();
pwindow->update();
void handle_close_event(int result);
void from_proxy();
- int to_proxy();
// calculate possible sizes based on the original size
void calculate_sizes();
void scale_to_text(char *string, int scale);
ProxyWindow *gui;
Asset *asset;
ProxyRender *proxy_render;
- ProxyBeep *proxy_beep;
int new_scale;
int orig_scale;
ProxyDialog *dialog;
FormatTools *format_tools;
BC_Title *new_dimensions;
+ BC_Title *active_scale;
ProxyMenu *scale_factor;
ProxyUseScaler *use_scaler;
ProxyAutoScale *auto_scale;
edithandleout_data = 0;
extract_data = 0;
ffmpeg_toggle = 0;
+ proxy_toggle = 0;
infoasset_data = 0;
in_point = 0;
insert_data = 0;
{
mbuttons_x = 0;
mbuttons_y = gui->menu_h() + 1;
- mbuttons_w = gui->menu_w();
+ mbuttons_w = gui->mbuttons_w();
mbuttons_h = get_image("mbutton_bg")->get_h();
mclock_x = window_border - 5;
mclock_y = mbuttons_y - 1 + mbuttons_h;
VFrame **edithandleout_data;
VFrame **extract_data;
VFrame **ffmpeg_toggle;
+ VFrame **proxy_toggle;
VFrame **infoasset_data;
VFrame **in_point;
VFrame **insert_data;
<td align="left"><font face="Liberation Serif" size=4>'o'</font></td>
<td align="left"><font face="Liberation Serif" size=4>Load file(s)</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> - load tool</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Alt-a'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Selects all files</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> - load tool</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Alt-z'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Deselects any selected files</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>Save</font></td>
<td align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Lock labels from moving</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>Editing choice</font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Drag and drop editing mode</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>Editing choice</font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Cut and paste editing mode</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><br></font></td>
<td align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Paste the last Audio transition</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>'r'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Ctrl'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Proxy quick switch</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><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>F7</font></td>
<td align="left"><font face="Liberation Serif" size=4>Crop a layer or output</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>+ crop tool</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Click-drag</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>In video, starts a new rectangle</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>+ crop tool</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Click-drag</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Over rectangle corner to reposition</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>+ crop tool</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Alt-click</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>In cropping rectangle to translate</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>Get color</font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4>'g'</font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4>Jump to time selected by popup</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><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4> Keypresses</font></td>
+ <td align="left"><b><u><font face="Liberation Serif" size=4>Key</font></u></b></td>
+ <td align="left"><b><u><font face="Liberation Serif" size=4>Qualifier</font></u></b></td>
+ <td align="left"><b><u><font face="Liberation Serif" size=4>Description</font></u></b></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>Right click</font></td>
+ <td align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Brings up fullscreen/zoom/close menu</font></td>
+ </tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4></font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4>Opens Load files... menu</font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4> - load tool</font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Ctrl-a</font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Selects all files</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4> - load tool</font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Ctrl-z</font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Deselects any selected files</font></td>
+ </tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Double click</font></td>
- <td align="left"><font face="Liberation Serif" size=4>In Find window,centers there & turns yellow</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>In Find window, cursor moves to hilite program</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,Times New Roman" size=4><br></font></td>
</tr>
<tr>
- <td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4>Android Remote</font></td>
+ <td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4>Remote Control</font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4>MENU</font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
- <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Toggle Android remote state (grabs/ungrabs keys)</font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Toggle remote control state (grabs/ungrabs keys)</font></td>
</tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4>KPTV</font></td>
<td align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
- <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Start/stop record window</font></td>
+ <td align="left"><font face="Liberation Serif,Times New Roman" size=4>Open or close the record window</font></td>
</tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif,Times New Roman" size=4><br></font></td>
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",
"ff_down.png",
"ff_checkedhi.png");
+ proxy_toggle = new_image_set(5,
+ "proxy_up.png",
+ "proxy_hi.png",
+ "proxy_chkd.png",
+ "proxy_down.png",
+ "proxy_chkdhi.png");
+
shbtn_data = new_image_set(3,
"shbtn_up.png",
"shbtn_hi.png",