mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
New Timeline actions
Smooth and auto cut actions added on the side of the timeline UI.
This commit is contained in:
17
Timeline.cpp
17
Timeline.cpp
@@ -246,7 +246,6 @@ void Timeline::smoothFading(uint N)
|
||||
|
||||
void Timeline::autoFading(uint milisecond)
|
||||
{
|
||||
|
||||
GstClockTime stepduration = timing_.end / MAX_TIMELINE_ARRAY;
|
||||
stepduration = GST_TIME_AS_MSECONDS(stepduration);
|
||||
uint N = milisecond / stepduration;
|
||||
@@ -281,7 +280,23 @@ void Timeline::autoFading(uint milisecond)
|
||||
for (; i < e; ++i)
|
||||
fadingArray_[i] = static_cast<float>(e-i) / static_cast<float>(n);
|
||||
}
|
||||
}
|
||||
|
||||
bool Timeline::autoCut()
|
||||
{
|
||||
bool changed = false;
|
||||
for (long i = 0; i < MAX_TIMELINE_ARRAY; ++i) {
|
||||
if (fadingArray_[i] < EPSILON) {
|
||||
if (gapsArray_[i] != 1.f)
|
||||
changed = true;
|
||||
gapsArray_[i] = 1.f;
|
||||
}
|
||||
}
|
||||
|
||||
updateGapsFromArray(gapsArray_, MAX_TIMELINE_ARRAY);
|
||||
gaps_array_need_update_ = false;
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
void Timeline::updateGapsFromArray(float *array, size_t array_size)
|
||||
|
||||
Reference in New Issue
Block a user