mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-13 03:09:59 +01:00
refactor sample offset / resume positions and bezerk mode
This commit is contained in:
@@ -56,7 +56,6 @@
|
|||||||
#include <libvjxml/vj-xml.h>
|
#include <libvjxml/vj-xml.h>
|
||||||
#include <veejay/vj-macro.h>
|
#include <veejay/vj-macro.h>
|
||||||
#include <libvje/internal.h>
|
#include <libvje/internal.h>
|
||||||
//#define KAZLIB_OPAQUE_DEBUG 1
|
|
||||||
|
|
||||||
#ifdef HAVE_XML2
|
#ifdef HAVE_XML2
|
||||||
#endif
|
#endif
|
||||||
@@ -79,6 +78,7 @@ static void *sample_font_ = NULL;
|
|||||||
static int sampleadm_state = SAMPLE_PEEK; /* default state */
|
static int sampleadm_state = SAMPLE_PEEK; /* default state */
|
||||||
static void *sample_cache[SAMPLE_MAX_SAMPLES];
|
static void *sample_cache[SAMPLE_MAX_SAMPLES];
|
||||||
static editlist *plain_editlist=NULL;
|
static editlist *plain_editlist=NULL;
|
||||||
|
static veejay_t *veejay_info = NULL;
|
||||||
|
|
||||||
extern void tagParseStreamFX(char *file, xmlDocPtr doc, xmlNodePtr cur, void *font, void *vp);
|
extern void tagParseStreamFX(char *file, xmlDocPtr doc, xmlNodePtr cur, void *font, void *vp);
|
||||||
extern void tag_writeStream( char *file, int n, xmlNodePtr node, void *font, void *vp );
|
extern void tag_writeStream( char *file, int n, xmlNodePtr node, void *font, void *vp );
|
||||||
@@ -246,7 +246,7 @@ void *sample_get_dict( int sample_id )
|
|||||||
* call before using any other function as sample_skeleton_new
|
* call before using any other function as sample_skeleton_new
|
||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
int sample_init(int len, void *font, editlist *pedl)
|
int sample_init(int len, void *font, editlist *pedl, void *info)
|
||||||
{
|
{
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
veejay_memset(avail_num, 0, sizeof(avail_num));
|
veejay_memset(avail_num, 0, sizeof(avail_num));
|
||||||
@@ -261,7 +261,7 @@ int sample_init(int len, void *font, editlist *pedl)
|
|||||||
|
|
||||||
sample_font_ = font;
|
sample_font_ = font;
|
||||||
plain_editlist = pedl;
|
plain_editlist = pedl;
|
||||||
|
veejay_info = (veejay_t*)info;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,8 +564,6 @@ int sample_get_longest(int sample_id)
|
|||||||
int _id=0;
|
int _id=0;
|
||||||
int speed = abs(si->speed);
|
int speed = abs(si->speed);
|
||||||
|
|
||||||
si->resume_pos = ( si->speed < 0 ? end : (si->speed > 0 ? start : si->resume_pos ) );
|
|
||||||
|
|
||||||
if( speed == 0 ) {
|
if( speed == 0 ) {
|
||||||
veejay_msg(VEEJAY_MSG_WARNING,
|
veejay_msg(VEEJAY_MSG_WARNING,
|
||||||
"Starting paused sample %d at normal speed from position %d",
|
"Starting paused sample %d at normal speed from position %d",
|
||||||
@@ -698,62 +696,6 @@ int sample_entry_set_is_rendering(int s1, int position, int value) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sample_get_position(int s1)
|
|
||||||
{
|
|
||||||
sample_info *si = sample_get(s1);
|
|
||||||
|
|
||||||
if(!si) return 0;
|
|
||||||
|
|
||||||
return si->offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_reset_chain_offset(int s1, int chain_entry, int s2)
|
|
||||||
{
|
|
||||||
sample_info *si1 = sample_get(s1);
|
|
||||||
sample_info *si2 = sample_get(s2);
|
|
||||||
|
|
||||||
if(!si1 || !si2)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
int has_marker = si2->marker_start >= 0 && si2->marker_end > 0;
|
|
||||||
int start_frame = ( has_marker ? si2->marker_start : si2->first_frame );
|
|
||||||
int end_frame = ( has_marker ? si2->marker_end : si2->last_frame );
|
|
||||||
|
|
||||||
int new_offset = start_frame;
|
|
||||||
if( si2->speed < 0 )
|
|
||||||
new_offset = end_frame;
|
|
||||||
|
|
||||||
si1->effect_chain[ chain_entry ]->frame_offset = new_offset;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_update_offset(int s1, int n_frame)
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
sample_info *si = sample_get(s1);
|
|
||||||
|
|
||||||
if(!si) return -1;
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
si->offset = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(si->offset > len)
|
|
||||||
{
|
|
||||||
si->offset = len;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_set_manual_fader( int s1, int value)
|
int sample_set_manual_fader( int s1, int value)
|
||||||
{
|
{
|
||||||
sample_info *si = sample_get(s1);
|
sample_info *si = sample_get(s1);
|
||||||
@@ -1186,31 +1128,20 @@ int sample_get_chain_status(int s1, int position)
|
|||||||
return sample->effect_chain[position]->e_flag;
|
return sample->effect_chain[position]->e_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sample_update_ascociated_samples(int s1)
|
void sample_frame_tick()
|
||||||
{
|
{
|
||||||
sample_info *sample = sample_get(s1);
|
int end = sample_highest();
|
||||||
if(!sample) {
|
int i;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int p = 0;
|
|
||||||
for( p = 0; p < SAMPLE_MAX_EFFECTS; p ++ ) {
|
|
||||||
if( sample->effect_chain[p]->source_type != 0 )
|
|
||||||
continue;
|
|
||||||
if( !sample_exists(sample->effect_chain[p]->channel) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
int pos = sample->effect_chain[p]->frame_offset;
|
for (i = 1; i <= end; i++) {
|
||||||
if(pos == 0 )
|
sample_info *sample = sample_get(i);
|
||||||
continue;
|
if(sample) {
|
||||||
|
sample->frame_tick = 0;
|
||||||
sample_set_resume( sample->effect_chain[p]->channel, pos );
|
}
|
||||||
veejay_msg(VEEJAY_MSG_DEBUG, "Sample %d will resume playback from position %d",
|
|
||||||
sample->effect_chain[p]->channel, pos );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sample_set_resume(int s1,long position)
|
int sample_set_resume_override(int s1, long position)
|
||||||
{
|
{
|
||||||
sample_info *sample = sample_get(s1);
|
sample_info *sample = sample_get(s1);
|
||||||
if(!sample)
|
if(!sample)
|
||||||
@@ -1239,9 +1170,45 @@ int sample_set_resume(int s1,long position)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sample->offset > 0) {
|
sample->loop_pp = 0;
|
||||||
sample->resume_pos = sample->offset;
|
}
|
||||||
veejay_msg(VEEJAY_MSG_WARNING, "Check me, resume position set to offset %d", sample->resume_pos );
|
else {
|
||||||
|
sample->resume_pos = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sample_set_resume(int s1,long position)
|
||||||
|
{
|
||||||
|
sample_info *sample = sample_get(s1);
|
||||||
|
if(!sample)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if( sample->frame_tick )
|
||||||
|
return 1; // already incremented for this time period
|
||||||
|
|
||||||
|
if(position == -1) {
|
||||||
|
int start = sample_get_startFrame(s1);
|
||||||
|
int end = sample_get_endFrame(s1);
|
||||||
|
|
||||||
|
if( sample->speed < 0) {
|
||||||
|
if(sample->resume_pos <= start) {
|
||||||
|
sample->speed = sample->speed * -1;
|
||||||
|
sample->resume_pos = start;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sample->resume_pos = end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(sample->speed >= 0) {
|
||||||
|
if(sample->resume_pos >= end) {
|
||||||
|
sample->speed = sample->speed * -1;
|
||||||
|
sample->resume_pos = end;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sample->resume_pos = start;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sample->loop_pp = 0;
|
sample->loop_pp = 0;
|
||||||
@@ -1249,6 +1216,9 @@ int sample_set_resume(int s1,long position)
|
|||||||
else {
|
else {
|
||||||
sample->resume_pos = position;
|
sample->resume_pos = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sample->frame_tick = 1;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
long sample_get_resume(int s1)
|
long sample_get_resume(int s1)
|
||||||
@@ -1256,33 +1226,10 @@ long sample_get_resume(int s1)
|
|||||||
sample_info *sample = sample_get(s1);
|
sample_info *sample = sample_get(s1);
|
||||||
if(!sample)
|
if(!sample)
|
||||||
return -1;
|
return -1;
|
||||||
if( sample->resume_pos < sample->first_frame )
|
|
||||||
sample->resume_pos = sample->first_frame;
|
|
||||||
else if ( sample->resume_pos > sample->last_frame )
|
|
||||||
sample->resume_pos = sample->last_frame;
|
|
||||||
|
|
||||||
if( sample->marker_start >= 0 && sample->marker_end > 0 ) {
|
|
||||||
if( sample->resume_pos < sample->marker_start )
|
|
||||||
sample->resume_pos = sample->marker_start;
|
|
||||||
else if ( sample->resume_pos > sample->marker_end )
|
|
||||||
sample->resume_pos = sample->marker_end;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sample->resume_pos;
|
return sample->resume_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sample_get_offset(int s1, int position)
|
|
||||||
{
|
|
||||||
sample_info *sample;
|
|
||||||
sample = sample_get(s1);
|
|
||||||
if (!sample)
|
|
||||||
return -1;
|
|
||||||
if (position >= SAMPLE_MAX_EFFECTS)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return sample->effect_chain[position]->frame_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_get_chain_volume(int s1, int position)
|
int sample_get_chain_volume(int s1, int position)
|
||||||
{
|
{
|
||||||
sample_info *sample;
|
sample_info *sample;
|
||||||
@@ -2438,43 +2385,6 @@ void sample_set_chain_paused( int s1, int paused )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sample_reset_offset(int s1)
|
|
||||||
{
|
|
||||||
sample_info *sample = sample_get(s1);
|
|
||||||
int i;
|
|
||||||
if(!sample) return -1;
|
|
||||||
for(i=0; i < SAMPLE_MAX_EFFECTS; i++)
|
|
||||||
{
|
|
||||||
sample->effect_chain[i]->frame_offset = 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sample_calc_offset( sample_info *sample,int entry, int candidate_offset )
|
|
||||||
{
|
|
||||||
int s1 = sample->effect_chain[ entry ]->channel;
|
|
||||||
|
|
||||||
for( int i = 0; i < SAMPLE_MAX_EFFECTS ; i ++ ) {
|
|
||||||
if( i > entry &&
|
|
||||||
sample->effect_chain[i]->source_type == 0 &&
|
|
||||||
sample->effect_chain[i]->channel == s1 ) {
|
|
||||||
return sample->effect_chain[ i ]->frame_offset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return candidate_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_set_offset(int s1, int chain_entry, int frame_offset)
|
|
||||||
{
|
|
||||||
sample_info *sample = sample_get(s1);
|
|
||||||
if (!sample)
|
|
||||||
return -1;
|
|
||||||
sample->effect_chain[chain_entry]->frame_offset = sample_calc_offset( sample, chain_entry, frame_offset );
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_set_chain_audio(int s1, int chain_entry, int val)
|
int sample_set_chain_audio(int s1, int chain_entry, int val)
|
||||||
{
|
{
|
||||||
sample_info *sample = sample_get(s1);
|
sample_info *sample = sample_get(s1);
|
||||||
@@ -2490,13 +2400,13 @@ int sample_set_chain_volume(int s1, int chain_entry, int volume)
|
|||||||
{
|
{
|
||||||
sample_info *sample = sample_get(s1);
|
sample_info *sample = sample_get(s1);
|
||||||
if (!sample)
|
if (!sample)
|
||||||
return -1;
|
return -1;
|
||||||
/* set to zero if frame_offset is greater than sample length */
|
|
||||||
if (volume < 0)
|
if (volume < 0)
|
||||||
volume = 100;
|
volume = 100;
|
||||||
if (volume > 100)
|
if (volume > 100)
|
||||||
volume = 0;
|
volume = 0;
|
||||||
sample->effect_chain[chain_entry]->volume = volume;
|
|
||||||
|
sample->effect_chain[chain_entry]->volume = volume;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2523,7 +2433,6 @@ int sample_chain_clear(int s1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sample->effect_chain[i]->effect_id = -1;
|
sample->effect_chain[i]->effect_id = -1;
|
||||||
sample->effect_chain[i]->frame_offset = 0;
|
|
||||||
sample->effect_chain[i]->volume = 0;
|
sample->effect_chain[i]->volume = 0;
|
||||||
sample->effect_chain[i]->a_flag = 0;
|
sample->effect_chain[i]->a_flag = 0;
|
||||||
sample->effect_chain[i]->is_rendering = 1;
|
sample->effect_chain[i]->is_rendering = 1;
|
||||||
@@ -2625,7 +2534,6 @@ int sample_chain_remove(int s1, int position)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sample->effect_chain[position]->effect_id = -1;
|
sample->effect_chain[position]->effect_id = -1;
|
||||||
sample->effect_chain[position]->frame_offset = 0;
|
|
||||||
sample->effect_chain[position]->volume = 0;
|
sample->effect_chain[position]->volume = 0;
|
||||||
sample->effect_chain[position]->a_flag = 0;
|
sample->effect_chain[position]->a_flag = 0;
|
||||||
sample->effect_chain[position]->is_rendering = 1;
|
sample->effect_chain[position]->is_rendering = 1;
|
||||||
@@ -2820,7 +2728,6 @@ void ParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample, int start_at)
|
|||||||
int i;
|
int i;
|
||||||
int source_type = 0;
|
int source_type = 0;
|
||||||
int channel = 0;
|
int channel = 0;
|
||||||
int frame_offset = 0;
|
|
||||||
int e_flag = 0;
|
int e_flag = 0;
|
||||||
int volume = 0;
|
int volume = 0;
|
||||||
int a_flag = 0;
|
int a_flag = 0;
|
||||||
@@ -2865,10 +2772,6 @@ void ParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample, int start_at)
|
|||||||
channel = get_xml_int( doc, cur );
|
channel = get_xml_int( doc, cur );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_EFFECTOFFSET)) {
|
|
||||||
frame_offset = get_xml_int( doc, cur );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_EFFECTACTIVE)) {
|
if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_EFFECTACTIVE)) {
|
||||||
e_flag = get_xml_int( doc, cur );
|
e_flag = get_xml_int( doc, cur );
|
||||||
}
|
}
|
||||||
@@ -2914,7 +2817,6 @@ void ParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample, int start_at)
|
|||||||
|
|
||||||
if( effect_id != -1 ) {
|
if( effect_id != -1 ) {
|
||||||
sample_set_chain_status(dst_sample, chain_index, e_flag);
|
sample_set_chain_status(dst_sample, chain_index, e_flag);
|
||||||
sample_set_offset(dst_sample, chain_index, frame_offset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sample_info *skel = sample_get(dst_sample);
|
sample_info *skel = sample_get(dst_sample);
|
||||||
@@ -3361,7 +3263,6 @@ void CreateEffect(xmlNodePtr node, sample_eff_chain * effect, int position)
|
|||||||
put_xml_int( node, XMLTAG_EFFECTACTIVE, effect->e_flag );
|
put_xml_int( node, XMLTAG_EFFECTACTIVE, effect->e_flag );
|
||||||
put_xml_int( node, XMLTAG_EFFECTSOURCE, effect->source_type );
|
put_xml_int( node, XMLTAG_EFFECTSOURCE, effect->source_type );
|
||||||
put_xml_int( node, XMLTAG_EFFECTCHANNEL, effect->channel );
|
put_xml_int( node, XMLTAG_EFFECTCHANNEL, effect->channel );
|
||||||
put_xml_int( node, XMLTAG_EFFECTOFFSET, effect->frame_offset );
|
|
||||||
put_xml_int( node, XMLTAG_EFFECTAUDIOFLAG, effect->a_flag );
|
put_xml_int( node, XMLTAG_EFFECTAUDIOFLAG, effect->a_flag );
|
||||||
put_xml_int( node, XMLTAG_EFFECTAUDIOVOLUME, effect->volume );
|
put_xml_int( node, XMLTAG_EFFECTAUDIOVOLUME, effect->volume );
|
||||||
put_xml_int( node, "kf_status", effect->kf_status );
|
put_xml_int( node, "kf_status", effect->kf_status );
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
#define XMLTAG_ARGUMENT "argument"
|
#define XMLTAG_ARGUMENT "argument"
|
||||||
#define XMLTAG_EFFECTSOURCE "source"
|
#define XMLTAG_EFFECTSOURCE "source"
|
||||||
#define XMLTAG_EFFECTCHANNEL "channel"
|
#define XMLTAG_EFFECTCHANNEL "channel"
|
||||||
#define XMLTAG_EFFECTOFFSET "offset"
|
|
||||||
#define XMLTAG_EFFECTACTIVE "active"
|
#define XMLTAG_EFFECTACTIVE "active"
|
||||||
#define XMLTAG_EFFECTAUDIOFLAG "use_audio"
|
#define XMLTAG_EFFECTAUDIOFLAG "use_audio"
|
||||||
#define XMLTAG_EFFECTAUDIOVOLUME "chain_volume"
|
#define XMLTAG_EFFECTAUDIOVOLUME "chain_volume"
|
||||||
@@ -96,7 +95,6 @@ typedef struct sample_eff_t {
|
|||||||
int e_flag;
|
int e_flag;
|
||||||
void *vje_instance;
|
void *vje_instance;
|
||||||
int arg[SAMPLE_MAX_PARAMETERS]; /* array of arguments */
|
int arg[SAMPLE_MAX_PARAMETERS]; /* array of arguments */
|
||||||
int frame_offset;
|
|
||||||
int speed; /* last known play speed */
|
int speed; /* last known play speed */
|
||||||
/* audio settings */
|
/* audio settings */
|
||||||
int a_flag; /* audio enabled/disabled */
|
int a_flag; /* audio enabled/disabled */
|
||||||
@@ -165,11 +163,11 @@ typedef struct sample_info_t {
|
|||||||
int encoder_width;
|
int encoder_width;
|
||||||
int encoder_height;
|
int encoder_height;
|
||||||
int encoder_max_size;
|
int encoder_max_size;
|
||||||
|
int frame_tick;
|
||||||
|
|
||||||
int auto_switch;
|
int auto_switch;
|
||||||
int selected_entry;
|
int selected_entry;
|
||||||
int effect_toggle;
|
int effect_toggle;
|
||||||
int offset;
|
|
||||||
int play_length;
|
int play_length;
|
||||||
editlist *edit_list;
|
editlist *edit_list;
|
||||||
char *edit_list_file;
|
char *edit_list_file;
|
||||||
@@ -199,13 +197,12 @@ extern unsigned int sample_size();
|
|||||||
extern int sample_highest();
|
extern int sample_highest();
|
||||||
extern int sample_highest_valid_id();
|
extern int sample_highest_valid_id();
|
||||||
extern int sample_verify();
|
extern int sample_verify();
|
||||||
extern int sample_init(int len, void *font, editlist *el);
|
extern int sample_init(int len, void *font, editlist *el,void *info);
|
||||||
extern int sample_update(sample_info *sample, int s1);
|
extern int sample_update(sample_info *sample, int s1);
|
||||||
#ifdef HAVE_XML2
|
#ifdef HAVE_XML2
|
||||||
extern int sample_readFromFile(char *, void *vp, void *ptr, void *font, void *el, int *id, int *mode);
|
extern int sample_readFromFile(char *, void *vp, void *ptr, void *font, void *el, int *id, int *mode);
|
||||||
extern int sample_writeToFile(char *, void *vp, void *ptr, void *font, int id, int mode);
|
extern int sample_writeToFile(char *, void *vp, void *ptr, void *font, int id, int mode);
|
||||||
#endif
|
#endif
|
||||||
extern int sample_update_offset(int s1, int nframe);
|
|
||||||
extern int sample_get_position(int s1);
|
extern int sample_get_position(int s1);
|
||||||
extern int sample_set_state(int new_state);
|
extern int sample_set_state(int new_state);
|
||||||
extern int sample_get_state();
|
extern int sample_get_state();
|
||||||
@@ -264,13 +261,11 @@ void *sample_get_plugin( int s1, int position, void *ptr );
|
|||||||
extern int sample_get_effect(int s1, int position);
|
extern int sample_get_effect(int s1, int position);
|
||||||
/* get effect any, even if effect is disabled (required for informational purposes)*/
|
/* get effect any, even if effect is disabled (required for informational purposes)*/
|
||||||
extern int sample_get_effect_any(int s1, int position);
|
extern int sample_get_effect_any(int s1, int position);
|
||||||
extern int sample_get_offset(int s1, int position);
|
|
||||||
extern int sample_get_short_info(int sample_id, int *, int *, int *, int *) ;
|
extern int sample_get_short_info(int sample_id, int *, int *, int *, int *) ;
|
||||||
extern int sample_get_chain_volume(int s1, int position);
|
extern int sample_get_chain_volume(int s1, int position);
|
||||||
extern void sample_set_kf_type(int s1, int entry, int type );
|
extern void sample_set_kf_type(int s1, int entry, int type );
|
||||||
/* set volume of audio data coming to the chain */
|
/* set volume of audio data coming to the chain */
|
||||||
extern int sample_set_chain_volume(int s1, int position, int volume);
|
extern int sample_set_chain_volume(int s1, int position, int volume);
|
||||||
extern int sample_reset_chain_offset(int s1, int chain_entry, int s2);
|
|
||||||
|
|
||||||
/* whether to mix underlying sample's audio */
|
/* whether to mix underlying sample's audio */
|
||||||
extern int sample_get_chain_audio(int s1, int position);
|
extern int sample_get_chain_audio(int s1, int position);
|
||||||
@@ -281,7 +276,6 @@ extern int sample_set_chain_audio(int s1, int position, int flag);
|
|||||||
extern int sample_set_chain_status(int s1, int position, int status);
|
extern int sample_set_chain_status(int s1, int position, int status);
|
||||||
extern int sample_get_chain_status(int s1, int position);
|
extern int sample_get_chain_status(int s1, int position);
|
||||||
|
|
||||||
extern int sample_set_offset(int s1, int position, int frame_offset);
|
|
||||||
extern int sample_get_effect_arg(int s1, int position, int argnr);
|
extern int sample_get_effect_arg(int s1, int position, int argnr);
|
||||||
extern int sample_set_effect_arg(int s1, int position, int argnr, int value);
|
extern int sample_set_effect_arg(int s1, int position, int argnr, int value);
|
||||||
|
|
||||||
@@ -297,7 +291,7 @@ extern int sample_chain_add(int s1, int c, int effect_nr);
|
|||||||
extern int sample_get_chain_channel(int s1, int position);
|
extern int sample_get_chain_channel(int s1, int position);
|
||||||
extern int sample_set_chain_channel(int s1, int position, int channel);
|
extern int sample_set_chain_channel(int s1, int position, int channel);
|
||||||
|
|
||||||
//int sample_chain_replace(int s1, int position, int effect_id);
|
extern void sample_frame_tick();
|
||||||
|
|
||||||
extern int sample_chain_sprint_status(int s1,int tags,int cache,int sa,int ca, int r, int f, int m, int t,int sr,int curfps,uint32_t lo, uint32_t hi, int macro,char *s, int feedback );
|
extern int sample_chain_sprint_status(int s1,int tags,int cache,int sa,int ca, int r, int f, int m, int t,int sr,int curfps,uint32_t lo, uint32_t hi, int macro,char *s, int feedback );
|
||||||
|
|
||||||
@@ -327,7 +321,6 @@ extern int sample_reset_fader(int t1);
|
|||||||
extern int sample_get_fade_entry(int t1);
|
extern int sample_get_fade_entry(int t1);
|
||||||
extern void sample_set_fade_entry(int t1, int entry);
|
extern void sample_set_fade_entry(int t1, int entry);
|
||||||
extern void sample_set_fade_method(int t1, int method );
|
extern void sample_set_fade_method(int t1, int method );
|
||||||
extern int sample_reset_offset(int s1);
|
|
||||||
extern int sample_get_fade_method(int t1);
|
extern int sample_get_fade_method(int t1);
|
||||||
extern void sample_set_fade_alpha(int t1, int alpha);
|
extern void sample_set_fade_alpha(int t1, int alpha);
|
||||||
extern int sample_get_fade_alpha(int s1);
|
extern int sample_get_fade_alpha(int s1);
|
||||||
@@ -370,7 +363,8 @@ extern int sample_get_frame_length(int s1);
|
|||||||
extern int sample_loop_dec(int s1);
|
extern int sample_loop_dec(int s1);
|
||||||
extern int sample_max_video_length(int s1);
|
extern int sample_max_video_length(int s1);
|
||||||
extern long sample_get_resume(int s1);
|
extern long sample_get_resume(int s1);
|
||||||
extern int sample_set_resume(int s1, long pos );
|
extern int sample_set_resume(int s1, long pos );
|
||||||
|
extern int sample_set_resume_override(int s1, long pos);
|
||||||
extern void sample_update_ascociated_samples(int s1);
|
extern void sample_update_ascociated_samples(int s1);
|
||||||
|
|
||||||
extern void sample_chain_alloc_kf( int s1, int entry );
|
extern void sample_chain_alloc_kf( int s1, int entry );
|
||||||
|
|||||||
@@ -1243,7 +1243,6 @@ int vj_tag_new(int type, char *filename, int stream_nr, editlist * el, int pix_f
|
|||||||
(sample_eff_chain *) vj_calloc(sizeof(sample_eff_chain));
|
(sample_eff_chain *) vj_calloc(sizeof(sample_eff_chain));
|
||||||
tag->effect_chain[i]->effect_id = -1;
|
tag->effect_chain[i]->effect_id = -1;
|
||||||
tag->effect_chain[i]->e_flag = 0;
|
tag->effect_chain[i]->e_flag = 0;
|
||||||
tag->effect_chain[i]->frame_offset = 0;
|
|
||||||
tag->effect_chain[i]->speed = INT_MAX;
|
tag->effect_chain[i]->speed = INT_MAX;
|
||||||
tag->effect_chain[i]->volume = 0;
|
tag->effect_chain[i]->volume = 0;
|
||||||
tag->effect_chain[i]->a_flag = 0;
|
tag->effect_chain[i]->a_flag = 0;
|
||||||
@@ -2940,98 +2939,6 @@ int vj_tag_by_type(int type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vj_tag_reset_offset(int t1)
|
|
||||||
{
|
|
||||||
vj_tag *tag = vj_tag_get(t1);
|
|
||||||
if (!tag)
|
|
||||||
return -1;
|
|
||||||
int i;
|
|
||||||
for(i=0; i < SAMPLE_MAX_EFFECTS; i++)
|
|
||||||
{
|
|
||||||
tag->effect_chain[i]->frame_offset = 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int vj_tag_reset_chain_offset( int t1, int chain_entry, int s1 )
|
|
||||||
{
|
|
||||||
sample_info *si = sample_get(s1);
|
|
||||||
vj_tag *tag = vj_tag_get(t1);
|
|
||||||
if(!si || !tag)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
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 );
|
|
||||||
|
|
||||||
int new_offset = start_frame;
|
|
||||||
if( si->speed < 0 )
|
|
||||||
new_offset = end_frame;
|
|
||||||
|
|
||||||
tag->effect_chain[ chain_entry ]->frame_offset = new_offset;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vj_tag_calc_offset( vj_tag *tag,int entry, int candidate_offset )
|
|
||||||
{
|
|
||||||
int s1 = tag->effect_chain[ entry ]->channel;
|
|
||||||
|
|
||||||
for( int i = 0; i < SAMPLE_MAX_EFFECTS ; i ++ ) {
|
|
||||||
if( i > entry &&
|
|
||||||
tag->effect_chain[i]->source_type == 0 &&
|
|
||||||
tag->effect_chain[i]->channel == s1 ) {
|
|
||||||
return tag->effect_chain[ i ]->frame_offset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return candidate_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
int vj_tag_set_offset(int t1, int chain_entry, int frame_offset)
|
|
||||||
{
|
|
||||||
vj_tag *tag = vj_tag_get(t1);
|
|
||||||
if (!tag)
|
|
||||||
return -1;
|
|
||||||
tag->effect_chain[chain_entry]->frame_offset = vj_tag_calc_offset(tag, chain_entry, frame_offset);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int vj_tag_get_offset(int t1, int chain_entry)
|
|
||||||
{
|
|
||||||
vj_tag *tag = vj_tag_get(t1);
|
|
||||||
if (!tag)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return tag->effect_chain[chain_entry]->frame_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void vj_tag_update_ascociated_samples(int s1)
|
|
||||||
{
|
|
||||||
vj_tag *sample = vj_tag_get(s1);
|
|
||||||
if(!sample) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int p = 0;
|
|
||||||
for( p = 0; p < SAMPLE_MAX_EFFECTS; p ++ ) {
|
|
||||||
if( sample->effect_chain[p]->source_type != 0 )
|
|
||||||
continue;
|
|
||||||
if( !sample_exists(sample->effect_chain[p]->channel) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
int pos = sample->effect_chain[p]->frame_offset;
|
|
||||||
if(pos == 0 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
sample_set_resume( sample->effect_chain[p]->channel, pos );
|
|
||||||
veejay_msg(VEEJAY_MSG_DEBUG, "Sample %d will resume playback from position %d",
|
|
||||||
sample->effect_chain[p]->channel, pos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
long vj_tag_get_encoded_frames(int s1) {
|
long vj_tag_get_encoded_frames(int s1) {
|
||||||
vj_tag *si = vj_tag_get(s1);
|
vj_tag *si = vj_tag_get(s1);
|
||||||
if(!si) return -1;
|
if(!si) return -1;
|
||||||
@@ -3917,7 +3824,6 @@ static void tagParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample)
|
|||||||
int arg[SAMPLE_MAX_PARAMETERS];
|
int arg[SAMPLE_MAX_PARAMETERS];
|
||||||
int source_type = 0;
|
int source_type = 0;
|
||||||
int channel = 0;
|
int channel = 0;
|
||||||
int frame_offset = 0;
|
|
||||||
int e_flag = 0;
|
int e_flag = 0;
|
||||||
int anim= 0;
|
int anim= 0;
|
||||||
int anim_type = 0;
|
int anim_type = 0;
|
||||||
@@ -3948,10 +3854,6 @@ static void tagParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample)
|
|||||||
channel = get_xml_int( doc, cur );
|
channel = get_xml_int( doc, cur );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_EFFECTOFFSET)) {
|
|
||||||
frame_offset = get_xml_int( doc, cur );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!xmlStrcmp(cur->name, (const xmlChar *) "kf_status")) {
|
if (!xmlStrcmp(cur->name, (const xmlChar *) "kf_status")) {
|
||||||
anim = get_xml_int( doc, cur );
|
anim = get_xml_int( doc, cur );
|
||||||
}
|
}
|
||||||
@@ -3990,8 +3892,6 @@ static void tagParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample)
|
|||||||
|
|
||||||
vj_tag_set_chain_status(dst_sample, chain_index, e_flag);
|
vj_tag_set_chain_status(dst_sample, chain_index, e_flag);
|
||||||
|
|
||||||
vj_tag_set_offset(dst_sample, chain_index, frame_offset);
|
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
vj_tag *t = vj_tag_get( dst_sample );
|
vj_tag *t = vj_tag_get( dst_sample );
|
||||||
while (curarg != NULL)
|
while (curarg != NULL)
|
||||||
@@ -4241,7 +4141,6 @@ static void tagCreateEffect(xmlNodePtr node, sample_eff_chain * effect, int posi
|
|||||||
put_xml_int( node, XMLTAG_EFFECTACTIVE, effect->e_flag );
|
put_xml_int( node, XMLTAG_EFFECTACTIVE, effect->e_flag );
|
||||||
put_xml_int( node, XMLTAG_EFFECTSOURCE, effect->source_type );
|
put_xml_int( node, XMLTAG_EFFECTSOURCE, effect->source_type );
|
||||||
put_xml_int( node, XMLTAG_EFFECTCHANNEL, effect->channel );
|
put_xml_int( node, XMLTAG_EFFECTCHANNEL, effect->channel );
|
||||||
put_xml_int( node, XMLTAG_EFFECTOFFSET, effect->frame_offset );
|
|
||||||
put_xml_int( node, XMLTAG_EFFECTAUDIOFLAG, effect->a_flag );
|
put_xml_int( node, XMLTAG_EFFECTAUDIOFLAG, effect->a_flag );
|
||||||
put_xml_int( node, XMLTAG_EFFECTAUDIOVOLUME, effect->volume );
|
put_xml_int( node, XMLTAG_EFFECTAUDIOVOLUME, effect->volume );
|
||||||
put_xml_int( node, "kf_status", effect->kf_status );
|
put_xml_int( node, "kf_status", effect->kf_status );
|
||||||
|
|||||||
@@ -615,12 +615,6 @@ int veejay_start_playing_sample( veejay_t *info, int sample_id )
|
|||||||
|
|
||||||
info->sfd = sample_get_framedup(sample_id);
|
info->sfd = sample_get_framedup(sample_id);
|
||||||
|
|
||||||
if(!info->seq->active) {
|
|
||||||
if( info->settings->sample_restart ) {
|
|
||||||
sample_reset_offset( sample_id ); /* reset mixing offsets */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sample_set_loop_stats( sample_id, 0 );
|
sample_set_loop_stats( sample_id, 0 );
|
||||||
sample_set_loops( sample_id, -1 ); /* reset loop count */
|
sample_set_loops( sample_id, -1 ); /* reset loop count */
|
||||||
|
|
||||||
@@ -750,13 +744,13 @@ void veejay_change_playback_mode( veejay_t *info, int new_pm, int sample_id )
|
|||||||
if( !info->seq->active ) {
|
if( !info->seq->active ) {
|
||||||
if( info->settings->sample_restart)
|
if( info->settings->sample_restart)
|
||||||
{
|
{
|
||||||
sample_set_resume(cur_id,-1);
|
sample_set_resume_override(cur_id,-1);
|
||||||
long pos = sample_get_resume( cur_id );
|
long pos = sample_get_resume( cur_id );
|
||||||
veejay_set_frame(info, pos );
|
veejay_set_frame(info, pos );
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Sample %d starts playing from frame %d",sample_id,pos);
|
veejay_msg(VEEJAY_MSG_INFO, "Sample %d starts playing from frame %d",sample_id,pos);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Already playing sample (continous mode is on)");
|
veejay_msg(VEEJAY_MSG_INFO, "Already playing sample %d (continous mode is on)", sample_id);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -840,7 +834,6 @@ void veejay_sample_set_initial_positions(veejay_t *info)
|
|||||||
int id = info->seq->samples[i].sample_id;
|
int id = info->seq->samples[i].sample_id;
|
||||||
int stats[4];
|
int stats[4];
|
||||||
|
|
||||||
sample_reset_offset(id);
|
|
||||||
sample_set_loops(id,-1);
|
sample_set_loops(id,-1);
|
||||||
sample_get_short_info( id, &stats[0],&stats[1],&stats[2],&stats[3]);
|
sample_get_short_info( id, &stats[0],&stats[1],&stats[2],&stats[3]);
|
||||||
if( stats[2] == 2 ) {
|
if( stats[2] == 2 ) {
|
||||||
@@ -868,7 +861,6 @@ void veejay_sample_set_initial_positions(veejay_t *info)
|
|||||||
void veejay_prepare_sample_positions(int id) {
|
void veejay_prepare_sample_positions(int id) {
|
||||||
int stats[4] = { 0,0,0,0 };
|
int stats[4] = { 0,0,0,0 };
|
||||||
|
|
||||||
sample_reset_offset(id);
|
|
||||||
sample_set_loops(id,-1);
|
sample_set_loops(id,-1);
|
||||||
sample_get_short_info( id, &stats[0],&stats[1],&stats[2],&stats[3]);
|
sample_get_short_info( id, &stats[0],&stats[1],&stats[2],&stats[3]);
|
||||||
if( stats[2] == 2 ) {
|
if( stats[2] == 2 ) {
|
||||||
@@ -1955,7 +1947,7 @@ int veejay_init(veejay_t * info, int x, int y,char *arg, int def_tags, int gen_t
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sample_init( (info->video_output_width * info->video_output_height), info->font, info->plain_editlist ) ) {
|
if(!sample_init( (info->video_output_width * info->video_output_height), info->font, info->plain_editlist,info ) ) {
|
||||||
veejay_msg(VEEJAY_MSG_ERROR, "Internal error while initializing sample administrator");
|
veejay_msg(VEEJAY_MSG_ERROR, "Internal error while initializing sample administrator");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3819,11 +3819,11 @@ void vj_event_sample_set_position( void *ptr, const char format[], va_list ap
|
|||||||
sample_get_chain_source(args[0], entry);
|
sample_get_chain_source(args[0], entry);
|
||||||
int cha = sample_get_chain_channel( args[0], entry );
|
int cha = sample_get_chain_channel( args[0], entry );
|
||||||
|
|
||||||
int pos = sample_get_offset( cha,entry );
|
int pos = sample_get_resume( cha );
|
||||||
|
|
||||||
pos += args[2];
|
pos += args[2];
|
||||||
|
|
||||||
sample_set_offset( cha,entry, pos );
|
sample_set_resume( cha, pos );
|
||||||
|
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Changed frame position to %d for sample %d on FX entry %d (only)", pos,cha,entry );
|
veejay_msg(VEEJAY_MSG_INFO, "Changed frame position to %d for sample %d on FX entry %d (only)", pos,cha,entry );
|
||||||
}
|
}
|
||||||
@@ -3857,17 +3857,19 @@ void vj_event_sample_skip_frame(void *ptr, const char format[], va_list ap)
|
|||||||
int len = end - start;
|
int len = end - start;
|
||||||
|
|
||||||
//@ skip frame = increment current with offset in args[1]
|
//@ skip frame = increment current with offset in args[1]
|
||||||
si->effect_chain[k]->frame_offset += args[1];
|
int cur = sample_get_resume( si->effect_chain[k]->channel ) + args[1];
|
||||||
|
|
||||||
//@ check range
|
//@ check range
|
||||||
if( si->effect_chain[k]->frame_offset > len )
|
if( cur > len )
|
||||||
si->effect_chain[k]->frame_offset = len;
|
cur = len;
|
||||||
if( si->effect_chain[k]->frame_offset < 0 )
|
if( cur < 0 )
|
||||||
si->effect_chain[k]->frame_offset = 0;
|
cur = 0;
|
||||||
|
|
||||||
|
sample_set_resume_override( si->effect_chain[k]->channel, cur );
|
||||||
|
|
||||||
veejay_msg(VEEJAY_MSG_DEBUG,
|
veejay_msg(VEEJAY_MSG_DEBUG,
|
||||||
"Set offset of mixing sample #%d (%d-%d) on chain entry %d of sample %d to %d",
|
"Set offset of mixing sample #%d (%d-%d) on chain entry %d of sample %d to %d",
|
||||||
si->effect_chain[k]->channel,start,end, k,i, si->effect_chain[k]->frame_offset );
|
si->effect_chain[k]->channel,start,end, k,i, cur );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5628,9 +5630,9 @@ void vj_event_chain_entry_src_toggle(void *ptr, const char format[], va_list ap)
|
|||||||
}
|
}
|
||||||
sample_set_chain_source(v->uc->sample_id,entry,src);
|
sample_set_chain_source(v->uc->sample_id,entry,src);
|
||||||
sample_set_chain_channel(v->uc->sample_id,entry,cha);
|
sample_set_chain_channel(v->uc->sample_id,entry,cha);
|
||||||
|
if(v->bezerk)
|
||||||
|
sample_set_resume_override( v->uc->sample_id, -1 );
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d", entry,(src==VJ_TAG_TYPE_NONE ? "Sample":"Stream"), cha);
|
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d", entry,(src==VJ_TAG_TYPE_NONE ? "Sample":"Stream"), cha);
|
||||||
if(v->bezerk)
|
|
||||||
sample_reset_chain_offset( v->uc->sample_id, entry, cha );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(STREAM_PLAYING(v))
|
if(STREAM_PLAYING(v))
|
||||||
@@ -5668,8 +5670,8 @@ void vj_event_chain_entry_src_toggle(void *ptr, const char format[], va_list ap)
|
|||||||
}
|
}
|
||||||
vj_tag_set_chain_source(v->uc->sample_id,entry,src);
|
vj_tag_set_chain_source(v->uc->sample_id,entry,src);
|
||||||
vj_tag_set_chain_channel(v->uc->sample_id,entry,cha);
|
vj_tag_set_chain_channel(v->uc->sample_id,entry,cha);
|
||||||
if(v->bezerk && src == VJ_TAG_TYPE_NONE) {
|
if( src == VJ_TAG_TYPE_NONE && v->bezerk ) {
|
||||||
vj_tag_reset_chain_offset( v->uc->sample_id, entry, cha );
|
sample_set_resume_override( cha, -1 );
|
||||||
}
|
}
|
||||||
vj_tag_get_descriptive(cha, description);
|
vj_tag_get_descriptive(cha, description);
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d (%s)", entry,( src == 0 ? "Sample" : "Stream" ), cha,description);
|
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d (%s)", entry,( src == 0 ? "Sample" : "Stream" ), cha,description);
|
||||||
@@ -5727,15 +5729,14 @@ void vj_event_chain_entry_source(void *ptr, const char format[], va_list ap)
|
|||||||
{
|
{
|
||||||
sample_set_chain_channel(args[0],args[1], c);
|
sample_set_chain_channel(args[0],args[1], c);
|
||||||
sample_set_chain_source (args[0],args[1],src);
|
sample_set_chain_source (args[0],args[1],src);
|
||||||
int sample_offset = sample_get_offset(args[0],args[1]);
|
int sample_offset = sample_get_resume(args[0]);
|
||||||
int sample_speed = 0;
|
int sample_speed = 0;
|
||||||
if( src == VJ_TAG_TYPE_NONE )
|
if( src == VJ_TAG_TYPE_NONE ) {
|
||||||
sample_speed = sample_get_speed(c);
|
sample_speed = sample_get_speed(c);
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Mixing with source (%s %d) at speed %d position %d",
|
if( v->bezerk ) sample_set_resume_override( c, -1 );
|
||||||
src == VJ_TAG_TYPE_NONE ? "sample" : "stream",c,sample_speed,sample_offset);
|
}
|
||||||
if(v->bezerk && src==VJ_TAG_TYPE_NONE) {
|
veejay_msg(VEEJAY_MSG_INFO, "Mixing with source (%s %d) at speed %d position %d",
|
||||||
sample_reset_chain_offset(args[0], args[1], c );
|
src == VJ_TAG_TYPE_NONE ? "sample" : "stream",c,sample_speed,sample_offset);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5786,16 +5787,16 @@ void vj_event_chain_entry_source(void *ptr, const char format[], va_list ap)
|
|||||||
{
|
{
|
||||||
vj_tag_set_chain_channel(args[0],args[1], c);
|
vj_tag_set_chain_channel(args[0],args[1], c);
|
||||||
vj_tag_set_chain_source (args[0],args[1],src);
|
vj_tag_set_chain_source (args[0],args[1],src);
|
||||||
if(v->bezerk && src == VJ_TAG_TYPE_NONE) {
|
|
||||||
vj_tag_reset_chain_offset( args[0], args[1], c );
|
|
||||||
}
|
|
||||||
|
|
||||||
int sample_offset = vj_tag_get_offset(args[0],args[1]);
|
|
||||||
int sample_speed = 1;
|
int sample_speed = 1;
|
||||||
if( src == VJ_TAG_TYPE_NONE )
|
int sample_offset = 0;
|
||||||
sample_speed = sample_get_speed(c);
|
if( src == VJ_TAG_TYPE_NONE ) {
|
||||||
|
sample_speed = sample_get_speed(c);
|
||||||
|
sample_offset = sample_get_resume(c);
|
||||||
|
if(v->bezerk) sample_set_resume_override( c, -1 );
|
||||||
|
}
|
||||||
|
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Mixing with source (%s %d) at speed %d position %d",
|
veejay_msg(VEEJAY_MSG_INFO, "Mixing with source (%s %d) at speed %d position %d",
|
||||||
src==VJ_TAG_TYPE_NONE ? "sample" : "stream",c,sample_speed, sample_offset);
|
src==VJ_TAG_TYPE_NONE ? "sample" : "stream",c,sample_speed, sample_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5849,11 +5850,11 @@ void vj_event_chain_entry_channel_dec(void *ptr, const char format[], va_list ap
|
|||||||
cha = old;
|
cha = old;
|
||||||
}
|
}
|
||||||
sample_set_chain_channel( v->uc->sample_id, entry, cha );
|
sample_set_chain_channel( v->uc->sample_id, entry, cha );
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d",entry,
|
if(src == VJ_TAG_TYPE_NONE && v->bezerk ) sample_set_resume_override( cha, -1 );
|
||||||
|
|
||||||
|
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d",entry,
|
||||||
(src==VJ_TAG_TYPE_NONE ? "Sample" : "Stream"),cha);
|
(src==VJ_TAG_TYPE_NONE ? "Sample" : "Stream"),cha);
|
||||||
|
|
||||||
if(v->bezerk)
|
|
||||||
sample_reset_chain_offset( v->uc->sample_id, entry, cha );
|
|
||||||
}
|
}
|
||||||
if(STREAM_PLAYING(v))
|
if(STREAM_PLAYING(v))
|
||||||
{
|
{
|
||||||
@@ -5896,10 +5897,7 @@ void vj_event_chain_entry_channel_dec(void *ptr, const char format[], va_list ap
|
|||||||
|
|
||||||
vj_tag_set_chain_channel( v->uc->sample_id, entry, cha );
|
vj_tag_set_chain_channel( v->uc->sample_id, entry, cha );
|
||||||
vj_tag_get_descriptive( cha, description);
|
vj_tag_get_descriptive( cha, description);
|
||||||
if(v->bezerk && src == VJ_TAG_TYPE_NONE) {
|
if( src == VJ_TAG_TYPE_NONE && v->bezerk ) sample_set_resume_override( cha, -1 );
|
||||||
vj_tag_reset_chain_offset( v->uc->sample_id, entry, cha );
|
|
||||||
}
|
|
||||||
|
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses Stream %d (%s)",entry,cha,description);
|
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses Stream %d (%s)",entry,cha,description);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5949,11 +5947,9 @@ void vj_event_chain_entry_channel_inc(void *ptr, const char format[], va_list ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
sample_set_chain_channel( v->uc->sample_id, entry, cha );
|
sample_set_chain_channel( v->uc->sample_id, entry, cha );
|
||||||
|
if( src == VJ_TAG_TYPE_NONE && v->bezerk ) sample_set_resume_override( cha, -1 );
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d",entry,
|
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d",entry,
|
||||||
(src==VJ_TAG_TYPE_NONE ? "Sample" : "Stream"),cha);
|
(src==VJ_TAG_TYPE_NONE ? "Sample" : "Stream"),cha);
|
||||||
if(v->bezerk && src==VJ_TAG_TYPE_NONE)
|
|
||||||
sample_reset_chain_offset( v->uc->sample_id, entry, cha );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(STREAM_PLAYING(v))
|
if(STREAM_PLAYING(v))
|
||||||
{
|
{
|
||||||
@@ -5996,10 +5992,7 @@ void vj_event_chain_entry_channel_inc(void *ptr, const char format[], va_list ap
|
|||||||
|
|
||||||
vj_tag_set_chain_channel( v->uc->sample_id, entry, cha );
|
vj_tag_set_chain_channel( v->uc->sample_id, entry, cha );
|
||||||
vj_tag_get_descriptive( cha, description);
|
vj_tag_get_descriptive( cha, description);
|
||||||
if(v->bezerk && src == VJ_TAG_TYPE_NONE) {
|
if( src == VJ_TAG_TYPE_NONE && v->bezerk ) sample_set_resume_override( cha, -1 );
|
||||||
vj_tag_reset_chain_offset( v->uc->sample_id, entry, cha );
|
|
||||||
}
|
|
||||||
|
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d (%s)",entry, (src == VJ_TAG_TYPE_NONE ? "Sample" : "Stream" ),
|
veejay_msg(VEEJAY_MSG_INFO, "Chain entry %d uses %s %d (%s)",entry, (src == VJ_TAG_TYPE_NONE ? "Sample" : "Stream" ),
|
||||||
vj_tag_get_chain_channel(v->uc->sample_id,entry),description);
|
vj_tag_get_chain_channel(v->uc->sample_id,entry),description);
|
||||||
}
|
}
|
||||||
@@ -6036,6 +6029,7 @@ void vj_event_chain_entry_channel(void *ptr, const char format[], va_list ap)
|
|||||||
}
|
}
|
||||||
if(err == 0 && sample_set_chain_channel(args[0],args[1], args[2])>= 0)
|
if(err == 0 && sample_set_chain_channel(args[0],args[1], args[2])>= 0)
|
||||||
{
|
{
|
||||||
|
if(src == VJ_TAG_TYPE_NONE && v->bezerk ) sample_set_resume_override( args[2], -1 );
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Selected input channel (%s %d)",
|
veejay_msg(VEEJAY_MSG_INFO, "Selected input channel (%s %d)",
|
||||||
(src == VJ_TAG_TYPE_NONE ? "sample" : "stream"),args[2]);
|
(src == VJ_TAG_TYPE_NONE ? "sample" : "stream"),args[2]);
|
||||||
}
|
}
|
||||||
@@ -6045,9 +6039,6 @@ void vj_event_chain_entry_channel(void *ptr, const char format[], va_list ap)
|
|||||||
(src ==VJ_TAG_TYPE_NONE ? "sample" : "stream") , args[2]);
|
(src ==VJ_TAG_TYPE_NONE ? "sample" : "stream") , args[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( v->bezerk && src == VJ_TAG_TYPE_NONE ) {
|
|
||||||
sample_reset_chain_offset( args[0], args[1], args[2] );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(STREAM_PLAYING(v))
|
if(STREAM_PLAYING(v))
|
||||||
@@ -6070,12 +6061,9 @@ void vj_event_chain_entry_channel(void *ptr, const char format[], va_list ap)
|
|||||||
if( src != VJ_TAG_TYPE_NONE && vj_tag_exists( args[2] ))
|
if( src != VJ_TAG_TYPE_NONE && vj_tag_exists( args[2] ))
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
if(v->bezerk && src == VJ_TAG_TYPE_NONE && err == 0) {
|
|
||||||
vj_tag_reset_chain_offset( args[0], args[1], args[2] );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( err == 0 && vj_tag_set_chain_channel(args[0],args[1],args[2])>=0)
|
if( err == 0 && vj_tag_set_chain_channel(args[0],args[1],args[2])>=0)
|
||||||
{
|
{
|
||||||
|
if( src == VJ_TAG_TYPE_NONE && v->bezerk ) sample_set_resume_override( args[2], -1 );
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Selected input channel (%s %d)",
|
veejay_msg(VEEJAY_MSG_INFO, "Selected input channel (%s %d)",
|
||||||
(src==VJ_TAG_TYPE_NONE ? "sample" : "stream"), args[2]);
|
(src==VJ_TAG_TYPE_NONE ? "sample" : "stream"), args[2]);
|
||||||
}
|
}
|
||||||
@@ -6129,8 +6117,8 @@ void vj_event_chain_entry_srccha(void *ptr, const char format[], va_list ap)
|
|||||||
veejay_msg(VEEJAY_MSG_DEBUG, "Using calibration data of stream %d",channel_id);
|
veejay_msg(VEEJAY_MSG_DEBUG, "Using calibration data of stream %d",channel_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( v->bezerk && source == VJ_TAG_TYPE_NONE ) {
|
else if( v->bezerk ) {
|
||||||
sample_reset_chain_offset( args[0], args[1], channel_id );
|
sample_set_resume_override( channel_id, -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -6178,10 +6166,9 @@ void vj_event_chain_entry_srccha(void *ptr, const char format[], va_list ap)
|
|||||||
if( slot >= 0 ) {
|
if( slot >= 0 ) {
|
||||||
vj_tag_cali_prepare( args[0],slot, channel_id);
|
vj_tag_cali_prepare( args[0],slot, channel_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (v->bezerk) {
|
else if ( v->bezerk ) {
|
||||||
vj_tag_reset_chain_offset( args[0], args[1], channel_id );
|
sample_set_resume_override( channel_id, -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -8119,7 +8106,7 @@ void vj_event_print_sample_info(veejay_t *v, int id)
|
|||||||
if (vje_get_extra_frame(y) == 1)
|
if (vje_get_extra_frame(y) == 1)
|
||||||
{
|
{
|
||||||
int source = sample_get_chain_source(id, i);
|
int source = sample_get_chain_source(id, i);
|
||||||
int sample_offset = sample_get_offset(id,i);
|
int sample_offset = sample_get_resume(id);
|
||||||
int c = sample_get_chain_channel(id,i);
|
int c = sample_get_chain_channel(id,i);
|
||||||
int sample_speed = 0;
|
int sample_speed = 0;
|
||||||
if( source == VJ_TAG_TYPE_NONE )
|
if( source == VJ_TAG_TYPE_NONE )
|
||||||
@@ -8691,7 +8678,7 @@ void vj_event_send_sample_stack ( void *ptr, const char format[],
|
|||||||
continue;
|
continue;
|
||||||
channel = sample_get_chain_channel( args[0], i );
|
channel = sample_get_chain_channel( args[0], i );
|
||||||
source = sample_get_chain_source( args[0], i );
|
source = sample_get_chain_source( args[0], i );
|
||||||
offset = sample_get_offset( args[0], i );
|
offset = sample_get_resume( args[0] );
|
||||||
if( source == 0 )
|
if( source == 0 )
|
||||||
sample_len= sample_video_length( channel );
|
sample_len= sample_video_length( channel );
|
||||||
else
|
else
|
||||||
@@ -8710,9 +8697,11 @@ void vj_event_send_sample_stack ( void *ptr, const char format[],
|
|||||||
continue;
|
continue;
|
||||||
channel = vj_tag_get_chain_channel( args[0], i );
|
channel = vj_tag_get_chain_channel( args[0], i );
|
||||||
source = vj_tag_get_chain_source( args[0], i );
|
source = vj_tag_get_chain_source( args[0], i );
|
||||||
offset = vj_tag_get_offset( args[0], i );
|
int offset = 0;
|
||||||
if( source == 0 )
|
if( source == 0 ) {
|
||||||
sample_len= sample_video_length( channel );
|
sample_len= sample_video_length( channel );
|
||||||
|
offset = sample_get_resume( channel );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
sample_len = vj_tag_get_n_frames( channel );
|
sample_len = vj_tag_get_n_frames( channel );
|
||||||
|
|
||||||
|
|||||||
@@ -529,11 +529,8 @@ static int vj_perform_next_sequence( veejay_t *info, int *type, int *next_slot
|
|||||||
|
|
||||||
*next_slot = next_current;
|
*next_slot = next_current;
|
||||||
|
|
||||||
if( current_type == 0 ) {
|
if( info->bezerk && current_type == 0 ) {
|
||||||
sample_update_ascociated_samples( sample_id );
|
sample_set_resume_override( sample_id, -1 );
|
||||||
}
|
|
||||||
else {
|
|
||||||
vj_tag_update_ascociated_samples( sample_id );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return next_sample_id;
|
return next_sample_id;
|
||||||
@@ -630,7 +627,6 @@ static int vj_perform_increase_sample_frame(veejay_t * info, long num)
|
|||||||
settings->current_frame_num += num;
|
settings->current_frame_num += num;
|
||||||
|
|
||||||
if( num == 0 ) {
|
if( num == 0 ) {
|
||||||
sample_set_resume( info->uc->sample_id, settings->current_frame_num );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -710,9 +706,6 @@ static int vj_perform_increase_sample_frame(veejay_t * info, long num)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!info->seq->active) {
|
|
||||||
sample_set_resume( info->uc->sample_id, settings->current_frame_num );
|
|
||||||
}
|
|
||||||
vj_perform_rand_update( info );
|
vj_perform_rand_update( info );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1539,7 +1532,7 @@ static int vj_perform_get_subframe(veejay_t * info, int this_sample_id, int sub_
|
|||||||
int sample_a[4];
|
int sample_a[4];
|
||||||
int sample_b[4];
|
int sample_b[4];
|
||||||
|
|
||||||
int offset = sample_get_offset(a, chain_entry);
|
int offset = sample_get_resume( b );
|
||||||
int len_b;
|
int len_b;
|
||||||
|
|
||||||
if(sample_get_short_info(b,&sample_b[0],&sample_b[1],&sample_b[2],&sample_b[3])!=0) return -1;
|
if(sample_get_short_info(b,&sample_b[0],&sample_b[1],&sample_b[2],&sample_b[3])!=0) return -1;
|
||||||
@@ -1586,7 +1579,7 @@ static int vj_perform_get_subframe(veejay_t * info, int this_sample_id, int sub_
|
|||||||
//offset = sample_b[1] - sample_b[0];
|
//offset = sample_b[1] - sample_b[0];
|
||||||
offset = len_b;
|
offset = len_b;
|
||||||
sample_set_speed( b, (-1 * sample_b[3]) );
|
sample_set_speed( b, (-1 * sample_b[3]) );
|
||||||
sample_set_offset(a,chain_entry,offset);
|
sample_set_resume( b, offset);
|
||||||
return sample_b[1];
|
return sample_b[1];
|
||||||
}
|
}
|
||||||
if(sample_b[2] == 1)
|
if(sample_b[2] == 1)
|
||||||
@@ -1601,7 +1594,7 @@ static int vj_perform_get_subframe(veejay_t * info, int this_sample_id, int sub_
|
|||||||
else if(sample_b[2] == 3 )
|
else if(sample_b[2] == 3 )
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
sample_set_offset(a,chain_entry,offset);
|
sample_set_resume(b,offset);
|
||||||
return (sample_b[0] + offset);
|
return (sample_b[0] + offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1619,7 +1612,7 @@ static int vj_perform_get_subframe(veejay_t * info, int this_sample_id, int sub_
|
|||||||
//offset = sample_b[1] - sample_b[0];
|
//offset = sample_b[1] - sample_b[0];
|
||||||
offset = 0;
|
offset = 0;
|
||||||
sample_set_speed( b, (-1 * sample_b[3]));
|
sample_set_speed( b, (-1 * sample_b[3]));
|
||||||
sample_set_offset(a,chain_entry,offset);
|
sample_set_resume(b,offset);
|
||||||
return sample_b[0];
|
return sample_b[0];
|
||||||
}
|
}
|
||||||
if(sample_b[2] == 1)
|
if(sample_b[2] == 1)
|
||||||
@@ -1635,8 +1628,7 @@ static int vj_perform_get_subframe(veejay_t * info, int this_sample_id, int sub_
|
|||||||
else if(sample_b[2] == 3 )
|
else if(sample_b[2] == 3 )
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
sample_set_offset(a, chain_entry, offset);
|
sample_set_resume(b, offset);
|
||||||
|
|
||||||
return (sample_b[0] + offset); //1
|
return (sample_b[0] + offset); //1
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1646,10 +1638,10 @@ static int vj_perform_get_subframe_tag(veejay_t * info, int sub_sample, int chai
|
|||||||
|
|
||||||
{
|
{
|
||||||
int sample[4];
|
int sample[4];
|
||||||
//int offset = sample_get_offset(sub_sample, chain_entry);
|
|
||||||
int offset = vj_tag_get_offset( info->uc->sample_id, chain_entry );
|
|
||||||
int len;
|
int len;
|
||||||
veejay_msg(VEEJAY_MSG_DEBUG, "Current offset for sample %d is %d", sub_sample, offset );
|
|
||||||
|
int offset = sample_get_resume( sub_sample );
|
||||||
|
|
||||||
if(sample_get_short_info(sub_sample,&sample[0],&sample[1],&sample[2],&sample[3])!=0) return -1;
|
if(sample_get_short_info(sub_sample,&sample[0],&sample[1],&sample[2],&sample[3])!=0) return -1;
|
||||||
|
|
||||||
if( sample[3] == 0 )
|
if( sample[3] == 0 )
|
||||||
@@ -1690,7 +1682,7 @@ static int vj_perform_get_subframe_tag(veejay_t * info, int sub_sample, int chai
|
|||||||
//offset = sample_b[1] - sample_b[0];
|
//offset = sample_b[1] - sample_b[0];
|
||||||
offset = len;
|
offset = len;
|
||||||
sample_set_speed( sub_sample, (-1 * sample[3]) );
|
sample_set_speed( sub_sample, (-1 * sample[3]) );
|
||||||
vj_tag_set_offset( info->uc->sample_id, chain_entry, offset );
|
sample_set_resume( sub_sample, offset );
|
||||||
//sample_set_offset( sub_sample,chain_entry,offset);
|
//sample_set_offset( sub_sample,chain_entry,offset);
|
||||||
return sample[1];
|
return sample[1];
|
||||||
}
|
}
|
||||||
@@ -1707,8 +1699,7 @@ static int vj_perform_get_subframe_tag(veejay_t * info, int sub_sample, int chai
|
|||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
vj_tag_set_offset( info->uc->sample_id, chain_entry, offset );
|
sample_set_resume( sub_sample, offset );
|
||||||
//sample_set_offset(sub_sample,chain_entry,offset);
|
|
||||||
return (sample[0] + offset);
|
return (sample[0] + offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1726,8 +1717,7 @@ static int vj_perform_get_subframe_tag(veejay_t * info, int sub_sample, int chai
|
|||||||
//offset = sample_b[1] - sample_b[0];
|
//offset = sample_b[1] - sample_b[0];
|
||||||
offset = 0;
|
offset = 0;
|
||||||
sample_set_speed( sub_sample, (-1 * sample[3]));
|
sample_set_speed( sub_sample, (-1 * sample[3]));
|
||||||
vj_tag_set_offset( info->uc->sample_id, chain_entry, offset );
|
sample_set_resume( sub_sample, offset );
|
||||||
//sample_set_offset( sub_sample,chain_entry,offset);
|
|
||||||
return sample[0];
|
return sample[0];
|
||||||
}
|
}
|
||||||
if(sample[2] == 1)
|
if(sample[2] == 1)
|
||||||
@@ -1743,10 +1733,8 @@ static int vj_perform_get_subframe_tag(veejay_t * info, int sub_sample, int chai
|
|||||||
if(sample[2] == 3 )
|
if(sample[2] == 3 )
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
vj_tag_set_offset( info->uc->sample_id, chain_entry, offset );
|
sample_set_resume( sub_sample, offset );
|
||||||
//sample_set_offset(sub_sample, chain_entry, offset);
|
|
||||||
|
|
||||||
return (sample[0] + offset);
|
return (sample[0] + offset);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1916,8 +1904,6 @@ static int vj_perform_apply_secundary_tag(veejay_t * info, performer_t *p, int s
|
|||||||
case VJ_TAG_TYPE_NONE:
|
case VJ_TAG_TYPE_NONE:
|
||||||
nframe = vj_perform_get_subframe_tag(info, sample_id, chain_entry);
|
nframe = vj_perform_get_subframe_tag(info, sample_id, chain_entry);
|
||||||
|
|
||||||
sample_set_resume( sample_id, nframe );
|
|
||||||
|
|
||||||
if(!subrender)
|
if(!subrender)
|
||||||
cached_frame = vj_perform_sample_is_cached(info,sample_id);
|
cached_frame = vj_perform_sample_is_cached(info,sample_id);
|
||||||
|
|
||||||
@@ -2108,7 +2094,6 @@ static int vj_perform_apply_secundary(veejay_t * info,performer_t *p, int this_s
|
|||||||
|
|
||||||
case VJ_TAG_TYPE_NONE:
|
case VJ_TAG_TYPE_NONE:
|
||||||
nframe = vj_perform_get_subframe(info,this_sample_id, sample_id, chain_entry); // get exact frame number to decode
|
nframe = vj_perform_get_subframe(info,this_sample_id, sample_id, chain_entry); // get exact frame number to decode
|
||||||
sample_set_resume( sample_id, nframe );
|
|
||||||
|
|
||||||
if(!subrender)
|
if(!subrender)
|
||||||
cached_frame = vj_perform_sample_is_cached(info,sample_id);
|
cached_frame = vj_perform_sample_is_cached(info,sample_id);
|
||||||
@@ -3621,7 +3606,7 @@ static int vj_perform_transition_get_sample_position(int sample_id)
|
|||||||
if(sample_get_short_info(sample_id,&sample_b[0],&sample_b[1],&sample_b[2],&sample_b[3])!=0) {
|
if(sample_get_short_info(sample_id,&sample_b[0],&sample_b[1],&sample_b[2],&sample_b[3])!=0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int position = sample_get_position( sample_id );
|
int position = sample_get_resume( sample_id );
|
||||||
|
|
||||||
if( sample_b[3] == 0 ) {
|
if( sample_b[3] == 0 ) {
|
||||||
return sample_b[0] + position;
|
return sample_b[0] + position;
|
||||||
@@ -3661,7 +3646,7 @@ static int vj_perform_transition_get_sample_position(int sample_id)
|
|||||||
//offset = sample_b[1] - sample_b[0];
|
//offset = sample_b[1] - sample_b[0];
|
||||||
position = len_b;
|
position = len_b;
|
||||||
sample_set_speed( sample_id, (-1 * sample_b[3]) );
|
sample_set_speed( sample_id, (-1 * sample_b[3]) );
|
||||||
sample_update_offset( sample_id, position );
|
sample_set_resume( sample_id, position );
|
||||||
return sample_b[1];
|
return sample_b[1];
|
||||||
}
|
}
|
||||||
if(sample_b[2] == 1)
|
if(sample_b[2] == 1)
|
||||||
@@ -3676,7 +3661,7 @@ static int vj_perform_transition_get_sample_position(int sample_id)
|
|||||||
if(sample_b[2] == 3 )
|
if(sample_b[2] == 3 )
|
||||||
position = 0;
|
position = 0;
|
||||||
}
|
}
|
||||||
sample_update_offset(sample_id, position);
|
sample_set_resume(sample_id, position);
|
||||||
return (sample_b[0] + position);
|
return (sample_b[0] + position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3693,7 +3678,7 @@ static int vj_perform_transition_get_sample_position(int sample_id)
|
|||||||
{
|
{
|
||||||
position = 0;
|
position = 0;
|
||||||
sample_set_speed( sample_id, (-1 * sample_b[3]));
|
sample_set_speed( sample_id, (-1 * sample_b[3]));
|
||||||
sample_update_offset( sample_id, position );
|
sample_set_resume( sample_id, position );
|
||||||
return sample_b[0];
|
return sample_b[0];
|
||||||
}
|
}
|
||||||
if(sample_b[2] == 1)
|
if(sample_b[2] == 1)
|
||||||
@@ -3708,7 +3693,7 @@ static int vj_perform_transition_get_sample_position(int sample_id)
|
|||||||
if(sample_b[2] == 3 )
|
if(sample_b[2] == 3 )
|
||||||
position = 0;
|
position = 0;
|
||||||
}
|
}
|
||||||
sample_update_offset(sample_id, position);
|
sample_set_resume(sample_id, position);
|
||||||
|
|
||||||
return (sample_b[0] + position); //1
|
return (sample_b[0] + position); //1
|
||||||
}
|
}
|
||||||
@@ -4046,7 +4031,10 @@ int vj_perform_queue_frame(veejay_t * info, int skip )
|
|||||||
if(!skip)
|
if(!skip)
|
||||||
{
|
{
|
||||||
int speed = settings->current_playback_speed;
|
int speed = settings->current_playback_speed;
|
||||||
if( settings->hold_status == 1 ) {
|
|
||||||
|
sample_frame_tick();
|
||||||
|
|
||||||
|
if( settings->hold_status == 1 ) {
|
||||||
speed = 0;
|
speed = 0;
|
||||||
if(settings->hold_pos == 0 ) {
|
if(settings->hold_pos == 0 ) {
|
||||||
settings->hold_status = 0;
|
settings->hold_status = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user