fix updating sample details, only invert in-point for midi

This commit is contained in:
veejay
2023-10-22 00:43:54 +02:00
parent 8969134b6b
commit c808d84a1d
2 changed files with 51 additions and 49 deletions

View File

@@ -4083,33 +4083,31 @@ static void update_current_slot(int *history, int pm, int last_pm) {
set_pm_page_label( info->status_tokens[CURRENT_ID], pm ); set_pm_page_label( info->status_tokens[CURRENT_ID], pm );
} }
/* Actions for stream mode*/ /* Actions for stream mode*/
if( ( info->status_tokens[CURRENT_ID] != history[CURRENT_ID] || pm != last_pm ) && pm == MODE_STREAM ) if( ( info->status_tokens[CURRENT_ID] != history[CURRENT_ID] || pm != last_pm ) && pm == MODE_STREAM )
{ {
/* Is a solid color stream */ /* Is a solid color stream */
if( info->status_tokens[STREAM_TYPE] == STREAM_WHITE ) if( info->status_tokens[STREAM_TYPE] == STREAM_WHITE )
{ {
if( ( history[STREAM_COL_R] != info->status_tokens[STREAM_COL_R] ) || if( ( history[STREAM_COL_R] != info->status_tokens[STREAM_COL_R] ) ||
( history[STREAM_COL_G] != info->status_tokens[STREAM_COL_G] ) || ( history[STREAM_COL_G] != info->status_tokens[STREAM_COL_G] ) ||
( history[STREAM_COL_B] != info->status_tokens[STREAM_COL_B] ) ) ( history[STREAM_COL_B] != info->status_tokens[STREAM_COL_B] ) )
{ {
info->uc.reload_hint[HINT_RGBSOLID] = 1; info->uc.reload_hint[HINT_RGBSOLID] = 1;
} }
} }
if( info->status_tokens[STREAM_TYPE] == STREAM_GENERATOR ) if( info->status_tokens[STREAM_TYPE] == STREAM_GENERATOR )
{ {
info->uc.reload_hint[HINT_GENERATOR] = 1; info->uc.reload_hint[HINT_GENERATOR] = 1;
} }
/*char *time = format_time( info->status_frame,(double)info->el.fps ); update_label_str( "playhint", "Streaming");
update_label_str( "label_curtime", time );
free(time);*/
update_label_str( "playhint", "Streaming"); info->uc.reload_hint[HINT_KF] = 1;
}/* End actions for stream mode */
info->uc.reload_hint[HINT_KF] = 1; }
}/* End actions for stream mode */
/* Actions for sample mode*/ /* Actions for sample mode*/
if( pm == MODE_SAMPLE ) if( pm == MODE_SAMPLE )
@@ -4236,30 +4234,6 @@ static void update_current_slot(int *history, int pm, int last_pm) {
update = 1; update = 1;
} }
if( (history[SUBRENDER] != info->status_tokens[SUBRENDER] || gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget_cache[ WIDGET_TOGGLE_SUBRENDER ]) ) != info->status_tokens[SUBRENDER]) )
{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( widget_cache[ WIDGET_TOGGLE_SUBRENDER ] ) , TRUE );
}
if( history[FADE_ALPHA] != info->status_tokens[FADE_ALPHA] || info->status_tokens[FADE_ALPHA] != gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget_cache[ WIDGET_TOGGLE_FADEMETHOD ] )) )
{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( widget_cache[ WIDGET_TOGGLE_FADEMETHOD ] ), TRUE );
}
if( history[FADE_METHOD] != info->status_tokens[FADE_METHOD] )
{
switch(info->status_tokens[FADE_METHOD]) {
case -1:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_MNONE]), TRUE ); break;
case 1: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M1]), TRUE ); break;
case 2: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M2]), TRUE ); break;
case 3: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M3]), TRUE ); break;
case 4: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M4]), TRUE ); break;
default:
break;
}
}
if(update) if(update)
{ {
speed = info->status_tokens[SAMPLE_SPEED]; speed = info->status_tokens[SAMPLE_SPEED];
@@ -4288,6 +4262,7 @@ static void update_current_slot(int *history, int pm, int last_pm) {
} }
} }
update_current_slot_transition_state(history, pm); update_current_slot_transition_state(history, pm);
if( pm == MODE_SAMPLE || pm == MODE_STREAM ) { if( pm == MODE_SAMPLE || pm == MODE_STREAM ) {
@@ -4298,7 +4273,33 @@ static void update_current_slot(int *history, int pm, int last_pm) {
} }
} }
if( (history[SUBRENDER] != info->status_tokens[SUBRENDER] || gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget_cache[ WIDGET_TOGGLE_SUBRENDER ]) ) != info->status_tokens[SUBRENDER]) )
{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( widget_cache[ WIDGET_TOGGLE_SUBRENDER ] ) , TRUE );
} }
if( history[FADE_ALPHA] != info->status_tokens[FADE_ALPHA] || info->status_tokens[FADE_ALPHA] != gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget_cache[ WIDGET_TOGGLE_FADEMETHOD ] )) )
{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( widget_cache[ WIDGET_TOGGLE_FADEMETHOD ] ), TRUE );
}
if( history[FADE_METHOD] != info->status_tokens[FADE_METHOD] )
{
switch(info->status_tokens[FADE_METHOD]) {
case -1:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_MNONE]), TRUE ); break;
case 1: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M1]), TRUE ); break;
case 2: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M2]), TRUE ); break;
case 3: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M3]), TRUE ); break;
case 4: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_FX_M4]), TRUE ); break;
default:
break;
}
}
} }
static void on_vims_messenger(void) static void on_vims_messenger(void)

View File

@@ -489,7 +489,8 @@ static void vj_midi_send_vims_now( vmidi_t *v, int *data )
// 115 = frame // 115 = frame
if( tmpv[0] == 108 || tmpv[0] == 109 || tmpv[0] == 115 ) { if( tmpv[0] == 108 || tmpv[0] == 109 || tmpv[0] == 115 ) {
//@ VIMS: sample marker events, replace frame for control/param value //@ VIMS: sample marker events, replace frame for control/param value
if(d->extra == 3) { if(d->extra == 3 && tmpv[0] == 108) {
// invert in point
val = 127 - ( ((max-min)/127.0) * data[2] + min); val = 127 - ( ((max-min)/127.0) * data[2] + min);
} }
snprintf(vims_msg, sizeof(vims_msg), "%03d:%d %d;", tmpv[0], 0, (int) val ); snprintf(vims_msg, sizeof(vims_msg), "%03d:%d %d;", tmpv[0], 0, (int) val );