void InterfacePrefs::create_objects()
{
int xs4 = xS(4), xs5 = xS(5), xs10 = xS(10), xs30 = xS(30);
- int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys35 = yS(35);
+ int ys5 = yS(5), ys10 = yS(10), ys30 = yS(30), ys35 = yS(35);
BC_Resources *resources = BC_WindowBase::get_resources();
int margin = mwindow->theme->widget_border;
char string[BCTEXTLEN];
AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y);
add_subwindow(android_remote);
y += android_remote->get_h() + ys10;
- add_subwindow(title = new BC_Title(x2, y, _("Port:")));
- int x3 = x2 + title->get_w() + margin;
+ int x3 = x2;
+ add_subwindow(title = new BC_Title(x3, y, _("Port:")));
+ x3 += title->get_w() + margin;
AndroidPort *android_port = new AndroidPort(pwindow, x3, y);
add_subwindow(android_port);
- y += title->get_h() + ys10;
- add_subwindow(title = new BC_Title(x2, y, _("PIN:")));
+ x3 += android_port->get_w() + 2*margin;
+ add_subwindow(title = new BC_Title(x3, y, _("PIN:")));
+ x3 += title->get_w() + margin;
AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y);
add_subwindow(android_pin);
- y += title->get_h() + ys20;
+ y += android_port->get_h() + 3*margin;
ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y);
add_subwindow(shbtn_prefs);
- y += shbtn_prefs->get_h() + ys20;
+ x3 = x2 + shbtn_prefs->get_w() + 2*margin;
+ add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x3, y));
+ y += reload_plugins->get_h() + 3*margin;
- add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x2, y));
- y += reload_plugins->get_h() + ys10;
+ add_subwindow(title = new BC_Title(x2, y, _("Nested Proxy Path:")));
+ y += title->get_h() + ys10;
+ PrefsNestedProxyPath *nested_proxy_path = new PrefsNestedProxyPath(pwindow, this,
+ x2, y, get_w()-x2-xs30);
+ add_subwindow(nested_proxy_path);
+ y += xs30;
add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:")));
y += title->get_h() + ys10;
- PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this, x2, y, get_w()-x2-xs30);
+ PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this,
+ x2, y, get_w()-x2-xs30);
add_subwindow(lv2_path_text);
y += xs30;
}
AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y)
- : BC_TextBox(x, y, xS(240), 1, pwindow->thread->preferences->android_pin)
+ : BC_TextBox(x, y, xS(180), 1, pwindow->thread->preferences->android_pin)
{
this->pwindow = pwindow;
}
return 1;
}
+PrefsNestedProxyPath::PrefsNestedProxyPath(PreferencesWindow *pwindow,
+ InterfacePrefs *subwindow, int x, int y, int w)
+ : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->nested_proxy_path)
+{
+ this->pwindow = pwindow;
+ this->subwindow = subwindow;
+}
+
+PrefsNestedProxyPath::~PrefsNestedProxyPath()
+{
+}
+
+int PrefsNestedProxyPath::handle_event()
+{
+ strcpy(pwindow->thread->preferences->nested_proxy_path, get_text());
+ return 1;
+}
+
InterfacePrefs *subwindow;
};
+class PrefsNestedProxyPath : public BC_TextBox
+{
+public:
+ PrefsNestedProxyPath(PreferencesWindow *pwindow,
+ InterfacePrefs *subwindow, int x, int y, int w);
+ ~PrefsNestedProxyPath();
+
+ int handle_event();
+ PreferencesWindow *pwindow;
+ InterfacePrefs *subwindow;
+};
+
class PrefsReloadPlugins : public BC_GenericButton
{
public:
MWindow mwindow;
mwindow.create_objects(1, !filenames.total, config_path);
CommandLineThread *thread = 0;
- if( mwindow.preferences->perpetual_session && load_perpetual )
+ if( load_perpetual )
mwindow.load_undo_data();
//SET_TRACE
// load the initial files on seperate tracks
done = 1;
mwindow.save_defaults();
- if( mwindow.preferences->perpetual_session )
- mwindow.save_undo_data();
+ mwindow.save_undo_data();
//PRINT_TRACE
filenames.remove_all_objects();
delete thread;
{
if( do_name ) {
memset(name, 0, sizeof(name));
- strncpy(name, ptr.name, sizeof(name-1));
+ strncpy(name, ptr.name, sizeof(name)-1);
}
fader = ptr.fader;
feather = ptr.feather;
sprintf(string2, _("Couldn't open %s for writing."), backup_path);
gui->show_message(string2);
}
+ save_undo_data();
}
void MWindow::load_backup()
void MWindow::save_undo_data()
{
- undo_before();
- undo_after(_("perpetual session"), LOAD_ALL);
+ if( stack.size() > 0 ) return;
+ if( !preferences->perpetual_session ) return;
char perpetual_path[BCTEXTLEN];
snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s",
File::get_config_path(), PERPETUAL_FILE);
void MWindow::load_undo_data()
{
+ if( stack.size() > 0 ) return;
+ if( !preferences->perpetual_session ) return;
char perpetual_path[BCTEXTLEN];
snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s",
File::get_config_path(), PERPETUAL_FILE);
FILE *fp = fopen(perpetual_path,"r");
if( !fp ) return;
undo->load(fp);
+ undo_before();
+ undo_after(_("perpetual load"), LOAD_ALL);
fclose(fp);
}
+void MWindow::remove_undo_data()
+{
+ if( stack.size() > 0 ) return;
+ char perpetual_path[BCTEXTLEN];
+ snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s",
+ File::get_config_path(), PERPETUAL_FILE);
+ ::remove(perpetual_path);
+}
int MWindow::copy_target(const char *path, const char *target)
{
void redo_entry(BC_WindowBase *calling_window_gui);
void save_undo_data();
void load_undo_data();
+ void remove_undo_data();
int copy_target(const char *path, const char *target);
int link_target(const char *real_path, const char *link_path, int relative);
void save_project(const char *dir, int save_mode, int overwrite, int reload);
keyframe_reticle = HAIRLINE_DRAGGING;
perpetual_session = 0;
strcpy(lv2_path, DEFAULT_LV2_PATH);
+ strcpy(nested_proxy_path, DEFAULT_NESTED_PROXY_PATH);
autostart_lv2ui = 0;
trap_sigsegv = 1;
trap_sigintr = 1;
force_uniprocessor = that->force_uniprocessor;
strcpy(lv2_path, that->lv2_path);
autostart_lv2ui = that->autostart_lv2ui;
+ strcpy(nested_proxy_path, that->nested_proxy_path);
trap_sigsegv = that->trap_sigsegv;
trap_sigintr = that->trap_sigintr;
processors = that->processors;
strcpy(lv2_path, DEFAULT_LV2_PATH);
defaults->get("LV2_PATH", lv2_path);
autostart_lv2ui = defaults->get("AUTOSTART_LV2UI", autostart_lv2ui);
+ strcpy(nested_proxy_path, DEFAULT_NESTED_PROXY_PATH);
+ defaults->get("NESTED_PROXY_PATH", nested_proxy_path);
trap_sigsegv = defaults->get("TRAP_SIGSEGV", trap_sigsegv);
trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr);
defaults->update("PERPETUAL_SESSION", perpetual_session);
defaults->update("LV2_PATH", lv2_path);
defaults->update("AUTOSTART_LV2UI", autostart_lv2ui);
+ defaults->update("NESTED_PROXY_PATH", nested_proxy_path);
defaults->update("TRAP_SIGSEGV", trap_sigsegv);
defaults->update("TRAP_SIGINTR", trap_sigintr);
defaults->update("AWINDOW_PICON_H", awindow_picon_h);
char plugin_dir[BCTEXTLEN];
char lv2_path[BCTEXTLEN];
int autostart_lv2ui;
+ char nested_proxy_path[BCTEXTLEN];
// Required when updating renderfarm rates
Mutex *preferences_lock;
#define LAYOUT_NAME_LEN 8
#define LAYOUTS_MAX 4
#define DEFAULT_LV2_PATH CINDAT_DIR "/lv2"
+#define DEFAULT_NESTED_PROXY_PATH NESTED_DIR
#define FFMPEG_EARLY_TIP _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last")
#define FFMPEG_LATE_TIP _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first")
mwindow->restart_status = -1;
}
+ if( mwindow->preferences->perpetual_session && !preferences->perpetual_session )
+ mwindow->remove_undo_data();
+
mwindow->edl->copy_session(edl, 1);
mwindow->update_preferences(preferences);
{
// path is already a proxy
if( strstr(indexable->path, ".proxy") ) return;
- strcpy(new_path, indexable->path);
+ if( !indexable->is_asset ) {
+ char *ifn = indexable->path, *cp = strrchr(ifn, '/');
+ if( cp ) ifn = cp+1;
+ char proxy_path[BCTEXTLEN];
+ File::getenv_path(proxy_path,
+ mwindow->preferences->nested_proxy_path);
+ sprintf(new_path, "%s/%s", proxy_path, ifn);
+ }
+ else
+ strcpy(new_path, indexable->path);
char prxy[BCSTRLEN];
int n = sprintf(prxy, ".proxy%d", scale);
// insert proxy, path.sfx => path.proxy#-sfx.ext
if( strstr(idxbl->path,".proxy") ) return 0;
char new_path[BCTEXTLEN];
to_proxy_path(new_path, idxbl, new_scale);
-// don't proxy if not readable
+// don't proxy if not readable, or proxy_path not writable
if( idxbl->is_asset && access(idxbl->path, R_OK) ) return 0;
+ int ret = access(new_path, W_OK);
+ if( ret ) {
+ int fd = ::open(new_path,O_WRONLY);
+ if( fd < 0 ) fd = open(new_path,O_WRONLY+O_CREAT,0666);
+ if( fd >= 0 ) { close(fd); ret = 0; }
+ }
+ if( ret ) {
+ eprintf(_("bad proxy path: %s\n"), new_path);
+ return 0;
+ }
// add to orig_idxbls & orig_proxies if it isn't already there.
int got_it = 0;
for( int i = 0; !got_it && i<orig_proxies.size(); ++i )
UndoStackItem* UndoStack::push()
{
// delete oldest 2 undos if necessary
- if( total() > UNDOLEVELS ) {
+ while( total() > UNDOLEVELS ) {
UndoStackItem *item = first, *key = item;
#ifdef UNDO_INCREMENTAL
for( int i=2; --i>=0; item=item->next );
CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
CHECK_WITH([ladspa-dir],[ladspa install dir],[LADSPA_DIR],[auto])
CHECK_WITH([config-dir],[.bcast config dir],[CONFIG_DIR],[$$HOME/.bcast5])
+CHECK_WITH([nested-dir],[nested proxy dir],[NESTED_DIR],[$$HOME/Videos])
CHECK_WITH([browser],[cin_browser path],[CIN_BROWSER],[firefox])
CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
CHECK_WITH([noelision],[use noelision/libpthread],[NOELISION],[auto])
]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no])
RESULT="$HAVE_OPENEXR"
if test "x$RESULT" = "xyes"; then
- SHARED_openexr="$LIBS"
- CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
+ SHARED_openexr="$LIBS"
+ SHARED_LIBS+=" $LIBS"
+ CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR"
fi
LIBS="$saved_LIBS"
CXXFLAGS="$saved_CXXFLAGS"
echo " using: with-cinlib = $WANT_CINLIB_DIR"
echo " using: with-cindat = $WANT_CINDAT_DIR"
echo " using: with-config-dir = $WANT_CONFIG_DIR"
+echo " using: with-nested-dir = $WANT_NESTED_DIR"
echo " using: with-browser = $WANT_CIN_BROWSER"
echo " using: with-plugin-dir = $WANT_PLUGIN_DIR"
echo " using: with-ladspa-dir = $WANT_LADSPA_DIR"
echo "CFLAGS += '-DCINLIB_DIR=\"$WANT_CINLIB_DIR\"'"
echo "CFLAGS += '-DCINDAT_DIR=\"$WANT_CINDAT_DIR\"'"
echo "CFLAGS += '-DCONFIG_DIR=\"$WANT_CONFIG_DIR\"'"
+echo "CFLAGS += '-DNESTED_DIR=\"$WANT_NESTED_DIR\"'"
echo "CFLAGS += '-DPLUGIN_DIR=\"$WANT_PLUGIN_DIR\"'"
echo "CFLAGS += '-DLOCALE_DIR=\"$WANT_LOCALE_DIR\"'"
echo "CFLAGS += '-DLADSPA_DIR=\"$WANT_LADSPA_DIR\"'"
uint8_t *img = new uint8_t[w*h*3];
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE, img);
write_ppm(img, w, h, "%s", fn);
- delete img;
+ delete [] img;
glActiveTexture(prev_id);
#endif
}