mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-21 15:20:02 +01:00
swap location of kf_p8, refactor fx chain entry cut/copy/paste. now also includes source,channel and status
This commit is contained in:
@@ -3983,6 +3983,21 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="n_columns">8</property>
|
<property name="n_columns">8</property>
|
||||||
<child>
|
<child>
|
||||||
|
<widget class="GtkRadioButton" id="kf_p8">
|
||||||
|
<property name="label" translatable="yes">8</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
<property name="group">kf_p0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="x_options"/>
|
||||||
|
<property name="y_options"/>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
<widget class="GtkRadioButton" id="kf_p9">
|
<widget class="GtkRadioButton" id="kf_p9">
|
||||||
<property name="label" translatable="yes">9</property>
|
<property name="label" translatable="yes">9</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -4108,21 +4123,7 @@
|
|||||||
<property name="y_options"/>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<widget class="GtkRadioButton" id="kf_p8">
|
|
||||||
<property name="label" translatable="yes">8</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
<property name="group">kf_p0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="x_options"/>
|
|
||||||
<property name="y_options"/>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
|
|||||||
@@ -3071,87 +3071,154 @@ void on_colorselection_color_changed( GtkWidget *w, gpointer user_data)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
static
|
static
|
||||||
gchar *get_clipboard_fx_buffer()
|
gchar *get_clipboard_fx_parameter_buffer(int *mixing_src, int *mixing_cha, int *enabled, int *fx_id)
|
||||||
{
|
{
|
||||||
|
char rest[1024];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int p[16];
|
int tmp[8];
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i <16;i++)
|
int n_params = 0;
|
||||||
p[i] = 0;
|
int fid = 0;
|
||||||
multi_vims( VIMS_CHAIN_GET_ENTRY, "%d %d", 0,
|
|
||||||
info->uc.selected_chain_entry );
|
veejay_memset( rest,0,sizeof(rest));
|
||||||
|
|
||||||
|
multi_vims( VIMS_CHAIN_GET_ENTRY, "%d %d", 0,info->uc.selected_chain_entry );
|
||||||
|
|
||||||
gchar *answer = recv_vims(3,&len);
|
gchar *answer = recv_vims(3,&len);
|
||||||
if(len <= 0 || answer == NULL )
|
if(len <= 0 || answer == NULL )
|
||||||
{
|
{
|
||||||
gveejay_popup_err( "Error", "Nothing in FX clipboard");
|
gveejay_popup_err( "Error", "Nothing in FX clipboard");
|
||||||
|
|
||||||
if(answer) g_free(answer);
|
if(answer) g_free(answer);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = sscanf( answer, "%d %d %d %d %d %d %d %d %d %d %d",
|
i = sscanf( answer, "%d %d %d %d %d %d %d %d %d %d %d %1024[0-9 ]",
|
||||||
&p[0], //fx id
|
&fid, //fx id
|
||||||
&p[1], //2 video
|
&tmp[0], //is video
|
||||||
&p[2], //n params
|
&n_params, //num params
|
||||||
&p[3], //p0
|
&tmp[0], //kf_type
|
||||||
&p[4], //p1
|
&tmp[0], //0
|
||||||
&p[5], //p2
|
&tmp[0], //0
|
||||||
&p[6], //p3
|
&tmp[0], //kf_status
|
||||||
&p[7],//p4
|
&tmp[1], //source
|
||||||
&p[8],//p5
|
&tmp[2], //channel
|
||||||
&p[9],//p6
|
&tmp[3], //fx enabled
|
||||||
&p[10] //p7
|
&tmp[0], //dummy
|
||||||
|
rest
|
||||||
);
|
);
|
||||||
|
|
||||||
char preset[512];
|
if( i != 12 ) {
|
||||||
sprintf(preset, "%d", p[0]);
|
return NULL;
|
||||||
for(i=0; i < p[2] ;i++)
|
}
|
||||||
{
|
|
||||||
char tmp[10];
|
*mixing_src = tmp[1];
|
||||||
sprintf(tmp, " %d", p[3+i] );
|
*mixing_cha = tmp[2];
|
||||||
strcat( preset,tmp);
|
*enabled = tmp[3];
|
||||||
|
*fx_id = fid;
|
||||||
|
|
||||||
|
return strdup(rest);
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char *parameters;
|
||||||
|
int fx_id;
|
||||||
|
int src;
|
||||||
|
int cha;
|
||||||
|
int enabled;
|
||||||
|
} clipboard_t;
|
||||||
|
|
||||||
|
static clipboard_t *get_new_clipboard()
|
||||||
|
{
|
||||||
|
clipboard_t *c = (clipboard_t*) vj_calloc( sizeof(clipboard_t) );
|
||||||
|
|
||||||
|
c->parameters = get_clipboard_fx_parameter_buffer( &(c->src), &(c->cha), &(c->enabled), &(c->fx_id) );
|
||||||
|
if( c->parameters == NULL ) {
|
||||||
|
free(c);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void del_clipboard(clipboard_t *c)
|
||||||
|
{
|
||||||
|
if(c) {
|
||||||
|
if(c->parameters)
|
||||||
|
free(c->parameters);
|
||||||
|
free(c);
|
||||||
|
}
|
||||||
|
c = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static clipboard_t *last_clipboard = NULL;
|
||||||
|
|
||||||
|
static void do_clipboard(clipboard_t *c, int id, int entry_id)
|
||||||
|
{
|
||||||
|
char msg[1024];
|
||||||
|
snprintf( msg, sizeof(msg), "%03d:%d %d %d %s;",
|
||||||
|
VIMS_CHAIN_ENTRY_SET_PRESET,
|
||||||
|
id,
|
||||||
|
entry_id,
|
||||||
|
c->fx_id,
|
||||||
|
c->parameters
|
||||||
|
);
|
||||||
|
|
||||||
|
msg_vims(msg);
|
||||||
|
|
||||||
|
snprintf( msg, sizeof(msg), "%03d:%d %d;",
|
||||||
|
( c->enabled ? 1 : 0 ),
|
||||||
|
id,
|
||||||
|
entry_id
|
||||||
|
);
|
||||||
|
msg_vims(msg);
|
||||||
|
|
||||||
|
if( last_clipboard->cha > 0 ) {
|
||||||
|
snprintf( msg, sizeof(msg), "%03d:%d %d %d %d;",
|
||||||
|
VIMS_CHAIN_ENTRY_SET_SOURCE_CHANNEL,
|
||||||
|
id,
|
||||||
|
entry_id,
|
||||||
|
c->src,
|
||||||
|
c->cha
|
||||||
|
);
|
||||||
|
msg_vims(msg);
|
||||||
}
|
}
|
||||||
g_free(answer);
|
|
||||||
return strdup(preset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar* last_fx_buf = NULL;
|
|
||||||
void on_button_fx_cut_clicked( GtkWidget *w, gpointer user_data)
|
void on_button_fx_cut_clicked( GtkWidget *w, gpointer user_data)
|
||||||
{
|
{
|
||||||
if(last_fx_buf)
|
if(last_clipboard)
|
||||||
free(last_fx_buf);
|
del_clipboard( last_clipboard );
|
||||||
|
|
||||||
last_fx_buf = get_clipboard_fx_buffer();
|
last_clipboard = get_new_clipboard();
|
||||||
|
|
||||||
on_button_fx_del_clicked( NULL,NULL );
|
on_button_fx_del_clicked( NULL,NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_button_fx_paste_clicked( GtkWidget *w, gpointer user_data)
|
void on_button_fx_paste_clicked( GtkWidget *w, gpointer user_data)
|
||||||
{
|
{
|
||||||
int i = info->uc.selected_chain_entry;
|
|
||||||
sample_slot_t *s = info->selected_slot;
|
sample_slot_t *s = info->selected_slot;
|
||||||
|
|
||||||
if( last_fx_buf && s)
|
if( last_clipboard == NULL ) {
|
||||||
{
|
vj_msg(VEEJAY_MSG_INFO, "Nothing in FX clipboard");
|
||||||
char msg[256];
|
return;
|
||||||
sprintf( msg, "%03d:%d %d %s;",
|
|
||||||
VIMS_CHAIN_ENTRY_SET_PRESET,
|
|
||||||
s->sample_id,
|
|
||||||
i,
|
|
||||||
last_fx_buf );
|
|
||||||
msg_vims(msg);
|
|
||||||
info->uc.reload_hint[HINT_ENTRY]=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( s == NULL ) {
|
||||||
|
vj_msg(VEEJAY_MSG_INFO, "No FX entry selected");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
do_clipboard( last_clipboard, s->sample_id, info->uc.selected_chain_entry );
|
||||||
|
|
||||||
|
info->uc.reload_hint[HINT_ENTRY]=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_button_fx_copy_clicked(GtkWidget *w, gpointer user_data)
|
void on_button_fx_copy_clicked(GtkWidget *w, gpointer user_data)
|
||||||
{
|
{
|
||||||
if(last_fx_buf)
|
if(last_clipboard)
|
||||||
free(last_fx_buf);
|
del_clipboard(last_clipboard);
|
||||||
|
|
||||||
last_fx_buf = get_clipboard_fx_buffer();
|
last_clipboard = get_new_clipboard();
|
||||||
}
|
}
|
||||||
void on_copy1_activate( GtkWidget *w, gpointer user_data)
|
void on_copy1_activate( GtkWidget *w, gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user