mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 22:30:06 +01:00
use frame selection on updating mixing offsets
This commit is contained in:
@@ -713,18 +713,21 @@ int sample_update_offset(int s1, int n_frame)
|
||||
sample_info *si = sample_get(s1);
|
||||
|
||||
if(!si) return -1;
|
||||
si->offset = (n_frame - si->first_frame);
|
||||
len = si->last_frame - si->first_frame;
|
||||
|
||||
int has_marker = si->marker_start >= 0 && si->marker_end > 0;
|
||||
int start_frame = ( has_marker ? si->marker_start : si->first_frame );
|
||||
int end_frame = ( has_marker ? si->marker_end : si->last_frame );
|
||||
|
||||
si->offset = (n_frame - start_frame);
|
||||
len = end_frame - start_frame;
|
||||
|
||||
if(si->offset < 0)
|
||||
{
|
||||
veejay_msg(VEEJAY_MSG_WARNING,"Sample bounces outside sample by %d frames",
|
||||
si->offset);
|
||||
si->offset = 0;
|
||||
}
|
||||
|
||||
if(si->offset > len)
|
||||
{
|
||||
veejay_msg(VEEJAY_MSG_WARNING,"Sample bounces outside sample with %d frames",
|
||||
si->offset);
|
||||
si->offset = len;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -3885,11 +3885,6 @@ void vj_event_sample_set_speed(void *ptr, const char format[], va_list ap)
|
||||
{
|
||||
veejay_msg(VEEJAY_MSG_INFO, "Changed speed of sample %d to %d",args[0],args[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
veejay_msg(VEEJAY_MSG_ERROR, "Speed %d it too high to set on sample %d",
|
||||
args[1],args[0]);
|
||||
}
|
||||
}
|
||||
|
||||
void vj_event_set_transition(void *ptr, const char format[], va_list ap)
|
||||
|
||||
Reference in New Issue
Block a user