mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-22 07:40:00 +01:00
fix fx chain loading
This commit is contained in:
@@ -4091,13 +4091,17 @@ static void load_effectchain_info()
|
||||
|
||||
while( offset < fxlen )
|
||||
{
|
||||
char line[VIMS_CHAIN_LIST_ENTRY_LENGHT];
|
||||
char line[VIMS_CHAIN_LIST_ENTRY_LENGTH+1];
|
||||
veejay_memset(arr,0,sizeof(arr));
|
||||
veejay_memset(line,0,sizeof(line));
|
||||
|
||||
strncpy( line, fxtext + offset, VIMS_CHAIN_LIST_ENTRY_LENGHT );
|
||||
sscanf( line, VIMS_CHAIN_LIST_ENTRY_FORMAT,
|
||||
&arr[0],&arr[1],&arr[2],&arr[3],&arr[4],&arr[5],&arr[6], &arr[7]); // FIXME How to use of VIMS_CHAIN_LIST_ENTRY_VALUES ?
|
||||
strncpy( line, fxtext + offset, VIMS_CHAIN_LIST_ENTRY_LENGTH );
|
||||
int n_tokens = sscanf( line, VIMS_CHAIN_LIST_ENTRY_FORMAT,
|
||||
&arr[0],&arr[1],&arr[2],&arr[3],&arr[4],&arr[5],&arr[6], &arr[7]);
|
||||
if( n_tokens != VIMS_CHAIN_LIST_ENTRY_VALUES ) {
|
||||
veejay_msg(0,"Error parsing FX chain response");
|
||||
break;
|
||||
}
|
||||
|
||||
char *name = _effect_get_description( arr[1] );
|
||||
snprintf(toggle,sizeof(toggle),"%s",arr[3] == 1 ? "on" : "off" );
|
||||
@@ -4139,7 +4143,7 @@ static void load_effectchain_info()
|
||||
g_object_unref( toggle );
|
||||
g_object_unref( kf_togglepf );
|
||||
}
|
||||
offset += VIMS_CHAIN_LIST_ENTRY_LENGHT;
|
||||
offset += VIMS_CHAIN_LIST_ENTRY_LENGTH;
|
||||
}
|
||||
|
||||
// finally clean list end
|
||||
|
||||
@@ -281,7 +281,7 @@ enum {
|
||||
};
|
||||
|
||||
#define VIMS_CHAIN_LIST_ENTRY_FORMAT "%02d%03d%1d%1d%1d%1d%03d%1d"
|
||||
#define VIMS_CHAIN_LIST_ENTRY_LENGHT sizeof(VIMS_CHAIN_LIST_ENTRY_FORMAT) // Size of sub message anwser (real size if SAMPLE_MAX_EFFECTS * VIMS_CHAIN_LIST_ENTRY_LENGHT)
|
||||
#define VIMS_CHAIN_LIST_ENTRY_LENGTH (2+3+1+1+1+1+3+1) // String length of entry format
|
||||
#define VIMS_CHAIN_LIST_ENTRY_VALUES 8 // Number of values of the message
|
||||
|
||||
enum {
|
||||
|
||||
@@ -8902,7 +8902,7 @@ void vj_event_send_chain_entry_parameters ( void *ptr, const char format[], va_
|
||||
void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap )
|
||||
{
|
||||
int i;
|
||||
char line[VIMS_CHAIN_LIST_ENTRY_LENGHT];
|
||||
char line[VIMS_CHAIN_LIST_ENTRY_LENGTH+1]; // null terminated buffer
|
||||
int args[1];
|
||||
char *str = NULL;
|
||||
veejay_t *v = (veejay_t*)ptr;
|
||||
@@ -8914,7 +8914,7 @@ void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap )
|
||||
if(SAMPLE_PLAYING(v))
|
||||
{
|
||||
SAMPLE_DEFAULTS(args[0]);
|
||||
char *print_buf = get_print_buf(VIMS_CHAIN_LIST_ENTRY_LENGHT * SAMPLE_MAX_EFFECTS);
|
||||
char *print_buf = get_print_buf( 1 + (VIMS_CHAIN_LIST_ENTRY_LENGTH * SAMPLE_MAX_EFFECTS ));
|
||||
for(i=0; i < SAMPLE_MAX_EFFECTS; i++)
|
||||
{
|
||||
int effect_id = sample_get_effect_any(args[0], i);
|
||||
@@ -8950,7 +8950,7 @@ void vj_event_send_chain_list ( void *ptr, const char format[], va_list ap )
|
||||
else if(STREAM_PLAYING(v))
|
||||
{
|
||||
STREAM_DEFAULTS(args[0]);
|
||||
char *print_buf = get_print_buf(VIMS_CHAIN_LIST_ENTRY_LENGHT * SAMPLE_MAX_EFFECTS);
|
||||
char *print_buf = get_print_buf(1 + (VIMS_CHAIN_LIST_ENTRY_LENGTH * SAMPLE_MAX_EFFECTS));
|
||||
|
||||
for(i=0; i < SAMPLE_MAX_EFFECTS; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user