mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-22 07:40:00 +01:00
add friendly name label to reloaded parameter panel (issue #42)
This commit is contained in:
@@ -1599,9 +1599,6 @@
|
|||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkSpinButton" id="button_fx_entry">
|
<widget class="GtkSpinButton" id="button_fx_entry">
|
||||||
<property name="width_request">36</property>
|
<property name="width_request">36</property>
|
||||||
@@ -1618,7 +1615,7 @@
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">2</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -1631,6 +1628,19 @@
|
|||||||
<property name="primary_icon_sensitive">True</property>
|
<property name="primary_icon_sensitive">True</property>
|
||||||
<property name="secondary_icon_sensitive">True</property>
|
<property name="secondary_icon_sensitive">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="value_friendlyname">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xalign">0.1</property>
|
||||||
|
<property name="width_chars">20</property>
|
||||||
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
@@ -12706,6 +12716,18 @@ YUV (current)</property>
|
|||||||
<child>
|
<child>
|
||||||
<placeholder/>
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkButton" id="inputstream_close">
|
<widget class="GtkButton" id="inputstream_close">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|||||||
@@ -561,11 +561,13 @@ void on_button_fx_del_clicked(GtkWidget *w, gpointer user_data)
|
|||||||
#define slider_changed( arg_num, value ) \
|
#define slider_changed( arg_num, value ) \
|
||||||
{\
|
{\
|
||||||
if(!info->status_lock && !info->parameter_lock)\
|
if(!info->status_lock && !info->parameter_lock)\
|
||||||
{\
|
{\
|
||||||
info->parameter_lock = 1;\
|
info->parameter_lock = 1;\
|
||||||
multi_vims( VIMS_CHAIN_ENTRY_SET_ARG_VAL, "%d %d %d %d", 0, info->uc.selected_chain_entry,arg_num, value );\
|
multi_vims( VIMS_CHAIN_ENTRY_SET_ARG_VAL, "%d %d %d %d", 0, info->uc.selected_chain_entry,arg_num, value );\
|
||||||
vj_midi_learning_vims_fx( info->midi, arg_num, VIMS_CHAIN_ENTRY_SET_ARG_VAL, 0,info->uc.selected_chain_entry, arg_num,1 );\
|
vj_midi_learning_vims_fx( info->midi, arg_num, VIMS_CHAIN_ENTRY_SET_ARG_VAL, 0,info->uc.selected_chain_entry, arg_num,1 );\
|
||||||
if(info->uc.selected_rgbkey) update_rgbkey_from_slider(); \
|
if(info->uc.selected_rgbkey) update_rgbkey_from_slider(); \
|
||||||
|
int *entry_tokens = &(info->uc.entry_tokens[0]);\
|
||||||
|
update_label_str( "value_friendlyname", _effect_get_hint( entry_tokens[ENTRY_FXID], arg_num, value ));\
|
||||||
info->parameter_lock = 0;\
|
info->parameter_lock = 0;\
|
||||||
}\
|
}\
|
||||||
}
|
}
|
||||||
@@ -579,6 +581,8 @@ multi_vims( VIMS_CHAIN_ENTRY_SET_ARG_VAL, "%d %d %d %d", 0, info->uc.selected_ch
|
|||||||
update_slider_value( name, (get_slider_val(name) + fraction), 0 );\
|
update_slider_value( name, (get_slider_val(name) + fraction), 0 );\
|
||||||
vj_midi_learning_vims_fx( info->midi, arg_num, VIMS_CHAIN_ENTRY_SET_ARG_VAL, 0, info->uc.selected_chain_entry,arg_num,2 );\
|
vj_midi_learning_vims_fx( info->midi, arg_num, VIMS_CHAIN_ENTRY_SET_ARG_VAL, 0, info->uc.selected_chain_entry,arg_num,2 );\
|
||||||
if(info->uc.selected_rgbkey) update_rgbkey_from_slider(); \
|
if(info->uc.selected_rgbkey) update_rgbkey_from_slider(); \
|
||||||
|
int *entry_tokens = &(info->uc.entry_tokens[0]);\
|
||||||
|
update_label_str( "value_friendlyname", _effect_get_hint( entry_tokens[ENTRY_FXID], arg_num, get_slider_val(name) ));\
|
||||||
info->parameter_lock = 0;\
|
info->parameter_lock = 0;\
|
||||||
}\
|
}\
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define FX_PARAMETER_DEFAULT_NAME "<none>"
|
#define FX_PARAMETER_DEFAULT_NAME "<none>"
|
||||||
|
#define FX_PARAMETER_VALUE_DEFAULT_HINT ""
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -619,8 +620,7 @@ static gchar *recv_vims_args(int slen, int *bytes_written, int *arg0, int *arg1)
|
|||||||
static GdkPixbuf * update_pixmap_kf( int status );
|
static GdkPixbuf * update_pixmap_kf( int status );
|
||||||
static GdkPixbuf * update_pixmap_entry( int status );
|
static GdkPixbuf * update_pixmap_entry( int status );
|
||||||
static gboolean
|
static gboolean
|
||||||
chain_update_row(GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter,
|
chain_update_row(GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter,gpointer data);
|
||||||
gpointer data);
|
|
||||||
int resize_primary_ratio_y();
|
int resize_primary_ratio_y();
|
||||||
int resize_primary_ratio_x();
|
int resize_primary_ratio_x();
|
||||||
static void update_rgbkey();
|
static void update_rgbkey();
|
||||||
@@ -1081,12 +1081,17 @@ typedef struct
|
|||||||
int num_frames;
|
int num_frames;
|
||||||
} el_constr;
|
} el_constr;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char **description;
|
||||||
|
} value_hint;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int defaults[SAMPLE_MAX_PARAMETERS];
|
int defaults[SAMPLE_MAX_PARAMETERS];
|
||||||
int min[SAMPLE_MAX_PARAMETERS];
|
int min[SAMPLE_MAX_PARAMETERS];
|
||||||
int max[SAMPLE_MAX_PARAMETERS];
|
int max[SAMPLE_MAX_PARAMETERS];
|
||||||
char description[150];
|
char description[150];
|
||||||
char *param_description[SAMPLE_MAX_PARAMETERS];
|
char *param_description[SAMPLE_MAX_PARAMETERS];
|
||||||
|
value_hint *hints[SAMPLE_MAX_PARAMETERS];
|
||||||
int id;
|
int id;
|
||||||
int is_video;
|
int is_video;
|
||||||
int num_arg;
|
int num_arg;
|
||||||
@@ -1200,6 +1205,27 @@ char *_effect_get_description(int effect_id)
|
|||||||
return FX_PARAMETER_DEFAULT_NAME;
|
return FX_PARAMETER_DEFAULT_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *_effect_get_hint(int effect_id, int p, int v)
|
||||||
|
{
|
||||||
|
int n = g_list_length( info->effect_info );
|
||||||
|
int i;
|
||||||
|
for(i = 0;i <= n ; i++)
|
||||||
|
{
|
||||||
|
effect_constr *ec = g_list_nth_data(info->effect_info, i);
|
||||||
|
if(ec == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(effect_id == ec->id )
|
||||||
|
{
|
||||||
|
if( ec->hints[p] == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
return ec->hints[p]->description[v];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FX_PARAMETER_VALUE_DEFAULT_HINT;
|
||||||
|
}
|
||||||
|
|
||||||
el_constr *_el_entry_new( int pos, char *file, int nf , char *fourcc)
|
el_constr *_el_entry_new( int pos, char *file, int nf , char *fourcc)
|
||||||
{
|
{
|
||||||
el_constr *el = g_new( el_constr , 1 );
|
el_constr *el = g_new( el_constr , 1 );
|
||||||
@@ -1347,7 +1373,7 @@ effect_constr* _effect_new( char *effect_line )
|
|||||||
{
|
{
|
||||||
effect_constr *ec;
|
effect_constr *ec;
|
||||||
int descr_len = 0;
|
int descr_len = 0;
|
||||||
int p;
|
int p,q;
|
||||||
char len[4];
|
char len[4];
|
||||||
//char line[100];
|
//char line[100];
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
@@ -1380,6 +1406,39 @@ effect_constr* _effect_new( char *effect_line )
|
|||||||
offset += len;
|
offset += len;
|
||||||
offset+=18;
|
offset+=18;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(p=0; p < ec->num_arg; p++)
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
int hint_len = 0;
|
||||||
|
int n = sscanf( effect_line + offset, "%03d", &hint_len );
|
||||||
|
if( n <= 0 ) {
|
||||||
|
veejay_msg(0,"Parse error in FX list hints");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += 3;
|
||||||
|
|
||||||
|
if(hint_len == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ec->hints[p] = (value_hint*) vj_calloc(sizeof(value_hint));
|
||||||
|
ec->hints[p]->description = (char**) vj_malloc(sizeof(char*) * ec->max[p] );
|
||||||
|
for(q = 0; q <= ec->max[p]; q ++ ) {
|
||||||
|
int value_hint = 0;
|
||||||
|
n = sscanf( effect_line + offset, "%03d", &value_hint );
|
||||||
|
if( n != 1) {
|
||||||
|
veejay_msg(0,"Parse error in FX list value hint");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += 3;
|
||||||
|
|
||||||
|
ec->hints[p]->description[q] = (char*) vj_calloc(sizeof(char) * value_hint + 1 );
|
||||||
|
strncpy( ec->hints[p]->description[q], effect_line + offset, value_hint );
|
||||||
|
offset += value_hint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ec;
|
return ec;
|
||||||
}
|
}
|
||||||
@@ -2982,6 +3041,8 @@ static void update_current_slot(int *history, int pm, int last_pm)
|
|||||||
info->uc.selected_chain_entry = 0;
|
info->uc.selected_chain_entry = 0;
|
||||||
info->uc.reload_hint[HINT_ENTRY] = 1;
|
info->uc.reload_hint[HINT_ENTRY] = 1;
|
||||||
load_parameter_info();
|
load_parameter_info();
|
||||||
|
if( info->status_tokens[CURRENT_ENTRY] != history[CURRENT_ENTRY] )
|
||||||
|
update_label_str( "value_friendlyname",FX_PARAMETER_VALUE_DEFAULT_HINT );
|
||||||
fx_anim = 1;
|
fx_anim = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3687,6 +3748,7 @@ static void load_effectchain_info()
|
|||||||
gchar *fxtext = recv_vims(3,&fxlen);
|
gchar *fxtext = recv_vims(3,&fxlen);
|
||||||
|
|
||||||
reset_tree( "tree_chain" );
|
reset_tree( "tree_chain" );
|
||||||
|
update_label_str( "value_friendlyname",FX_PARAMETER_VALUE_DEFAULT_HINT );
|
||||||
|
|
||||||
GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree ));
|
GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree ));
|
||||||
store = GTK_LIST_STORE(model);
|
store = GTK_LIST_STORE(model);
|
||||||
@@ -3827,7 +3889,8 @@ on_effectlist_row_activated(GtkTreeView *treeview,
|
|||||||
char trip[100];
|
char trip[100];
|
||||||
snprintf(trip,sizeof(trip), "%03d:%d %d %d;", VIMS_CHAIN_ENTRY_SET_EFFECT,0,info->uc.selected_chain_entry, gid );
|
snprintf(trip,sizeof(trip), "%03d:%d %d %d;", VIMS_CHAIN_ENTRY_SET_EFFECT,0,info->uc.selected_chain_entry, gid );
|
||||||
vj_midi_learning_vims( info->midi, NULL, trip, 0 );
|
vj_midi_learning_vims( info->midi, NULL, trip, 0 );
|
||||||
|
update_label_str( "value_friendlyname", FX_PARAMETER_VALUE_DEFAULT_HINT );
|
||||||
|
|
||||||
}
|
}
|
||||||
g_free(name);
|
g_free(name);
|
||||||
}
|
}
|
||||||
@@ -6335,6 +6398,7 @@ static void process_reload_hints(int *history, int pm)
|
|||||||
disable_widget( "frame_fxtree4" );
|
disable_widget( "frame_fxtree4" );
|
||||||
disable_widget( "tree_sources");
|
disable_widget( "tree_sources");
|
||||||
disable_widget( "rgbkey");
|
disable_widget( "rgbkey");
|
||||||
|
update_label_str( "value_friendlyname", FX_PARAMETER_VALUE_DEFAULT_HINT );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -6383,9 +6447,7 @@ static void process_reload_hints(int *history, int pm)
|
|||||||
GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(glade_xml_get_widget_(
|
GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(glade_xml_get_widget_(
|
||||||
info->main_window, "tree_chain") ));
|
info->main_window, "tree_chain") ));
|
||||||
|
|
||||||
gtk_tree_model_foreach(
|
gtk_tree_model_foreach( model, chain_update_row, (gpointer*) info );
|
||||||
model,
|
|
||||||
chain_update_row, (gpointer*) info );
|
|
||||||
}
|
}
|
||||||
info->parameter_lock = 0;
|
info->parameter_lock = 0;
|
||||||
|
|
||||||
@@ -7252,7 +7314,8 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num)
|
|||||||
sleep(1); //@ give it some time to settle ( at least 1 frame period )
|
sleep(1); //@ give it some time to settle ( at least 1 frame period )
|
||||||
|
|
||||||
info->status_lock = 1;
|
info->status_lock = 1;
|
||||||
|
info->parameter_lock = 1;
|
||||||
|
|
||||||
single_vims( VIMS_PROMOTION );
|
single_vims( VIMS_PROMOTION );
|
||||||
|
|
||||||
load_editlist_info();
|
load_editlist_info();
|
||||||
@@ -7282,6 +7345,7 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num)
|
|||||||
update_label_i( "label_portx",port_num,0);
|
update_label_i( "label_portx",port_num,0);
|
||||||
|
|
||||||
info->status_lock = 0;
|
info->status_lock = 0;
|
||||||
|
info->parameter_lock = 0;
|
||||||
|
|
||||||
multitrack_configure( info->mt,
|
multitrack_configure( info->mt,
|
||||||
info->el.fps, info->el.width, info->el.height, &preview_box_w_, &preview_box_h_ );
|
info->el.fps, info->el.width, info->el.height, &preview_box_w_, &preview_box_h_ );
|
||||||
|
|||||||
Reference in New Issue
Block a user