Enchancement / "Sequencer Clear All"

* Button in ui (on_button_seq_clearall) right to activate sequencer checkbox
* Callback clear entire grid (VIMS_SEQUENCE_DEL)
* sequencer col and row has #define
* new vj_gui_t struct members :  sequencer_col & sequencer_row
This commit is contained in:
[d.j.a.y] Jerome Blanchi
2016-07-31 17:42:27 +02:00
parent f27ddfb27e
commit 31ac585ca3
3 changed files with 53 additions and 1 deletions

View File

@@ -5576,6 +5576,38 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkButton" id="button_seq_clearall">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip" translatable="yes">Clear all sequencer slots</property>
<signal name="clicked" handler="on_button_seq_clearall_clicked" swapped="no"/>
<child>
<widget class="GtkHBox" id="hbox48">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkImage" id="image56">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">icon_clearall.png</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>

View File

@@ -1412,6 +1412,18 @@ g_return_val_if_fail( GTK_IS_LIST_STORE(_model),NULL);
#define gtk_combo_box_get_active_text( combo ) my_gtk_combo_box_get_active_text(combo) #define gtk_combo_box_get_active_text( combo ) my_gtk_combo_box_get_active_text(combo)
#endif #endif
void on_button_seq_clearall_clicked( GtkWidget *w, gpointer data )
{
int slot;
for (slot = 0; slot < info->sequencer_col * info->sequencer_row ; slot++)
{
multi_vims( VIMS_SEQUENCE_DEL, "%d", slot );
gtk_label_set_text(GTK_LABEL(info->sequencer_view->gui_slot[slot]->image),
NULL );
}
vj_msg(VEEJAY_MSG_INFO, "Sequencer cleared");
}
void on_seq_rec_stop_clicked( GtkWidget *w, gpointer data ) void on_seq_rec_stop_clicked( GtkWidget *w, gpointer data )
{ {
single_vims( VIMS_SAMPLE_REC_STOP ); single_vims( VIMS_SAMPLE_REC_STOP );

View File

@@ -482,6 +482,8 @@ typedef struct
sample_gui_slot_t *selection_gui_slot; sample_gui_slot_t *selection_gui_slot;
sequence_envelope *sequence_view; sequence_envelope *sequence_view;
sequence_envelope *sequencer_view; sequence_envelope *sequencer_view;
int sequencer_col;
int sequencer_row;
int sequence_playing; int sequence_playing;
gint current_sequence_slot; gint current_sequence_slot;
// GtkKnob *audiovolume_knob; // GtkKnob *audiovolume_knob;
@@ -563,6 +565,9 @@ static widget_name_t *gen_decs_ = NULL;
#define VEEJAY_MSG_OUTPUT 4 #define VEEJAY_MSG_OUTPUT 4
#define GENERATOR_PARAMS 11 #define GENERATOR_PARAMS 11
#define SEQUENCER_COL 10
#define SEQUENCER_ROW 10
static vj_gui_t *info = NULL; static vj_gui_t *info = NULL;
void reloaded_restart(); void reloaded_restart();
void *get_ui_info() { return (void*) info; } void *get_ui_info() { return (void*) info; }
@@ -7527,7 +7532,7 @@ void vj_gui_init(char *glade_file,
create_ref_slots( 10 ); create_ref_slots( 10 );
//SEQ //SEQ
create_sequencer_slots( 10,10 ); create_sequencer_slots( SEQUENCER_COL, SEQUENCER_ROW );
veejay_memset( vj_event_list, 0, sizeof( vj_event_list )); veejay_memset( vj_event_list, 0, sizeof( vj_event_list ));
veejay_memset( vims_keys_list, 0, sizeof( vims_keys_list) ); veejay_memset( vims_keys_list, 0, sizeof( vims_keys_list) );
@@ -8425,6 +8430,9 @@ static void create_sequencer_slots(int nx, int ny)
gtk_container_add( GTK_CONTAINER(info->sample_sequencer), table ); gtk_container_add( GTK_CONTAINER(info->sample_sequencer), table );
gtk_widget_show(table); gtk_widget_show(table);
info->sequencer_col = nx;
info->sequencer_row = ny;
gint col=0; gint col=0;
gint row=0; gint row=0;
gint k = 0; gint k = 0;