Enchancement / "Sequencer Clear All" (VIMS_SEQUENCE_DEL -1)

This commit is contained in:
[d.j.a.y] Jerome Blanchi
2016-08-03 16:41:39 +02:00
parent b4a6084629
commit 02774f1868

View File

@@ -1414,40 +1414,13 @@ g_return_val_if_fail( GTK_IS_LIST_STORE(_model),NULL);
void on_button_seq_clearall_clicked( GtkWidget *w, gpointer data )
{
single_vims( VIMS_SEQUENCE_LIST );
gint len = 0;
gchar *text = recv_vims( 6, &len );
if( len <= 0 || text == NULL )
return;
int playing=0;
int size =0;
int active=0;
sscanf( text, "%04d%04d%4d",&playing,&size,&active );
int nlen = len - 12;
int offset = 0;
int id = 0;
gchar *in = text + 12;
while( offset < nlen )
multi_vims( VIMS_SEQUENCE_DEL, "-1");
int slot;
for (slot = 0; slot < info->sequencer_col * info->sequencer_row ; slot++)
{
int sample_id = 0;
int type = 0;
char seqtext[32];
sscanf( in + offset, "%04d%02d", &sample_id, &type );
offset += 6;
if( sample_id > 0 )
{
multi_vims( VIMS_SEQUENCE_DEL, "%d", id );
gtk_label_set_text(GTK_LABEL(info->sequencer_view->gui_slot[id]->image),
NULL );
}
id ++;
gtk_label_set_text(GTK_LABEL(info->sequencer_view->gui_slot[slot]->image),
NULL );
}
free(text);
vj_msg(VEEJAY_MSG_INFO, "Sequencer cleared");
}