autos[AUTOMATION_SPEED] = new FloatAutos(edl, track, 1.0);
autos[AUTOMATION_SPEED]->create_objects();
+ ((FloatAutos*)autos[AUTOMATION_SPEED])->set_float_min(SPEED_MIN);
autos[AUTOMATION_PAN] = new PanAutos(edl, track);
autos[AUTOMATION_PAN]->create_objects();
CLAMP(value, 0, 100); \
if (autogrouptype == AUTOGROUPTYPE_ZOOM && value < 0) \
value = 0; \
- else if (autogrouptype == AUTOGROUPTYPE_SPEED && value < 0.001) \
- value = 0.001;
+ else if (autogrouptype == AUTOGROUPTYPE_SPEED && value < SPEED_MIN) \
+ value = SPEED_MIN;
#define AUTOMATIONVIEWCLAMPS(value, autogrouptype) \
if (autogrouptype == AUTOGROUPTYPE_ZOOM && value < 0) \
value = 0; \
- else if (autogrouptype == AUTOGROUPTYPE_SPEED && value < 0) \
- value = 0;
+ else if (autogrouptype == AUTOGROUPTYPE_SPEED && value < SPEED_MIN) \
+ value = SPEED_MIN;
class Automation
AUTOMATION_TYPE_PAN
};
+#define SPEED_MIN 0.005
+
#endif
FFStream::~FFStream()
{
+ frm_lock->lock("FFStream::~FFStream");
if( reading > 0 || writing > 0 ) avcodec_close(avctx);
if( avctx ) avcodec_free_context(&avctx);
if( fmt_ctx ) avformat_close_input(&fmt_ctx);
if( frame ) av_frame_free(&frame);
if( fframe ) av_frame_free(&fframe);
if( probe_frame ) av_frame_free(&probe_frame);
+ frm_lock->unlock();
delete frm_lock;
if( stats_fp ) fclose(stats_fp);
if( stats_in ) av_freep(&stats_in);
}
int ret = 0;
int retries = MAX_RETRY;
-
+ frm_lock->lock("FFStream::decode");
while( ret >= 0 && !flushed && --retries >= 0 ) {
if( need_packet ) {
if( (ret=read_packet()) < 0 ) break;
flushed = st_eof();
}
}
+ frm_lock->unlock();
if( retries < 0 ) {
fprintf(stderr, "FFStream::decode: Retry limit\n");
tstmp = av_rescale_q(tstmp, time_base, AV_TIME_BASE_Q);
idx = -1;
#endif
+ frm_lock->lock("FFStream::seek");
av_frame_free(&probe_frame);
avcodec_flush_buffers(avctx);
avformat_flush(fmt_ctx);
break;
}
}
+ frm_lock->unlock();
if( ret < 0 ) {
printf("** seek fail %jd, %jd\n", pos, tstmp);
seeked = need_packet = 0;
}
-void FloatAuto::set_value(float newvalue)
+void FloatAuto::set_value(float value)
{
- this->value=newvalue;
+ float float_min = ((FloatAutos*)autos)->float_min;
+ if( value < float_min ) value = float_min;
+ float float_max = ((FloatAutos*)autos)->float_max;
+ if( value > float_max ) value = float_max;
+ this->value = value;
this->adjust_curves();
if(previous) ((FloatAuto*)previous)->adjust_curves();
if(next) ((FloatAuto*)next)->adjust_curves();
void FloatAuto::adjust_to_new_coordinates(int64_t position, float value)
// define new position and value in one step, do necessary re-adjustments
{
+ float float_min = ((FloatAutos*)autos)->float_min;
+ if( value < float_min ) value = float_min;
+ float float_max = ((FloatAutos*)autos)->float_max;
+ if( value > float_max ) value = float_max;
this->value = value;
this->position = position;
adjust_ctrl_positions();
void FloatAuto::load(FileXML *file)
{
value = file->tag.get_property("VALUE", value);
+ float float_min = ((FloatAutos*)autos)->float_min;
+ if( value < float_min ) value = float_min;
+ float float_max = ((FloatAutos*)autos)->float_max;
+ if( value > float_max ) value = float_max;
control_in_value = file->tag.get_property("CONTROL_IN_VALUE", control_in_value);
control_out_value = file->tag.get_property("CONTROL_OUT_VALUE", control_out_value);
curve_mode = (t_mode)file->tag.get_property("TANGENT_MODE", (int)FREE);
{
this->default_ = default_;
type = AUTOMATION_TYPE_FLOAT;
+ float_min = -FLT_MAX;
+ float_max = FLT_MAX;
}
FloatAutos::~FloatAutos()
void dump();
Auto* new_auto();
float default_;
+
+ float float_min, float_max;
+ void set_float_min(float mn) { float_min = mn; }
+ void set_float_max(float mx) { float_max = mx; }
};
automation_maxs[AUTOGROUPTYPE_AUDIO_FADE] = 6;
automation_mins[AUTOGROUPTYPE_VIDEO_FADE] = 0;
automation_maxs[AUTOGROUPTYPE_VIDEO_FADE] = 100;
- automation_mins[AUTOGROUPTYPE_SPEED] = 0.005;
+ automation_mins[AUTOGROUPTYPE_SPEED] = SPEED_MIN;
automation_maxs[AUTOGROUPTYPE_SPEED] = 5.000;
automation_mins[AUTOGROUPTYPE_INT255] = 0;
automation_maxs[AUTOGROUPTYPE_INT255] = 255;
for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
if (!Automation::autogrouptypes_fixedrange[i]) {
automation_mins[i] = file->tag.get_property(xml_autogrouptypes_titlesmin[i],automation_mins[i]);
+ AUTOMATIONCLAMPS(automation_mins[i], i);
automation_maxs[i] = file->tag.get_property(xml_autogrouptypes_titlesmax[i],automation_maxs[i]);
+ AUTOMATIONCLAMPS(automation_maxs[i], i);
}
}
floatauto_type = file->tag.get_property("FLOATAUTO_TYPE", floatauto_type);
for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
if (!Automation::autogrouptypes_fixedrange[i]) {
automation_mins[i] = defaults->get(xml_autogrouptypes_titlesmin[i], automation_mins[i]);
+ AUTOMATIONCLAMPS(automation_mins[i], i);
automation_maxs[i] = defaults->get(xml_autogrouptypes_titlesmax[i], automation_maxs[i]);
+ AUTOMATIONCLAMPS(automation_maxs[i], i);
}
}
int Clear::handle_event()
{
if( mwindow->session->current_operation == NO_OPERATION ) {
- mwindow->cwindow->gui->lock_window("Clear::handle_event");
mwindow->clear_entry();
- mwindow->cwindow->gui->unlock_window();
}
return 1;
}
gui->del_keyboard_listener(
(int (BC_WindowBase::*)(BC_WindowBase *))
&MWindowGUI::keyboard_listener);
+ reset_caches();
#if 0
// release the hounds
if( awindow && awindow->gui ) awindow->gui->close(0);
gui->close(0);
join();
#endif
- reset_caches();
dead_plugins->remove_all_objects();
// must delete theme before destroying plugindb
// theme destructor will be deleted by delete_plugins
return;
}
undo_before();
- awindow->gui->stop_vicon_drawing();
+ awindow->gui->close_view_popup();
int clips_total = session->drag_clips->total;
for( int i=0; i<clips_total; ++i ) {
EDL *clip = session->drag_clips->values[i];
void MWindow::reset_caches()
{
+ awindow->gui->close_view_popup();
frame_cache->remove_all();
wave_cache->remove_all();
audio_cache->remove_all();
void MWindow::remove_from_caches(Indexable *idxbl)
{
+ awindow->gui->close_view_popup();
frame_cache->remove_item(idxbl);
wave_cache->remove_item(idxbl);
if( gui->render_engine &&
if( zwindow->zgui->playback_engine->video_cache )
zwindow->zgui->playback_engine->video_cache->delete_entry(asset);
}
+ awindow->gui->start_vicon_drawing();
}
void MWindow::remove_assets_from_project(int push_undo, int redraw, int delete_indexes,
float automation_min = mwindow->edl->local_session->automation_mins[autogrouptype];
float automation_max = mwindow->edl->local_session->automation_maxs[autogrouptype];
float automation_range = automation_max - automation_min;
+ if( autogrouptype == AUTOGROUPTYPE_SPEED && automation_range < SPEED_MIN )
+ automation_range = SPEED_MIN;
for( int x=x1; x<x2; ++x ) {
// Interpolate value between frames
X_TO_FLOATLINE(x)
float automation_min = mwindow->edl->local_session->automation_mins[autogrouptype];
float automation_max = mwindow->edl->local_session->automation_maxs[autogrouptype];
float automation_range = automation_max - automation_min;
+ if( autogrouptype == AUTOGROUPTYPE_SPEED && automation_range < SPEED_MIN )
+ automation_range = SPEED_MIN;
FloatAuto *previous1 = 0, *next1 = 0;
X_TO_FLOATLINE(cursor_x);
float automation_min = mwindow->edl->local_session->automation_mins[autogrouptype];
float automation_max = mwindow->edl->local_session->automation_maxs[autogrouptype];
float automation_range = automation_max - automation_min;
+ if( autogrouptype == AUTOGROUPTYPE_SPEED && automation_range < SPEED_MIN )
+ automation_range = SPEED_MIN;
FloatAuto *ptr = (FloatAuto*)current;
*x = (double)(ptr->position - unit_start) / zoom_units;
*y = ((ptr->get_value() - automation_min) / automation_range - 0.5) * -yscale;
autos[AUTOMATION_SPEED] = new FloatAutos(edl, track, 1.);
autos[AUTOMATION_SPEED]->create_objects();
+ ((FloatAutos*)autos[AUTOMATION_SPEED])->set_float_min(SPEED_MIN);
autos[AUTOMATION_MODE] = new IntAutos(edl, track, TRANSFER_NORMAL);
autos[AUTOMATION_MODE]->create_objects();