Reloaded/transition : various fixes (bis repetita)

* add info->status_lock mechanics
* block signals when refreshing length and shape values
* shared gtkadjustement for shape, unique for length stream and sample
* adjust some gtkspinbutton properties, (numeric only)
* rename tag_transition_* --> stream_transition
* fix transition length start value calling update_spin_range2
This commit is contained in:
Jerome Blanchi aka d.j.a.y
2020-08-17 13:50:05 +02:00
parent a79f498160
commit af9e307eec
2 changed files with 154 additions and 73 deletions

View File

@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.16"/>
<object class="GtkWindow">
<property name="can_focus">False</property>
<child type="titlebar">
<child>
<placeholder/>
</child>
<child>
<child type="titlebar">
<placeholder/>
</child>
</object>
<object class="GtkApplicationWindow">
<property name="can_focus">False</property>
<child type="titlebar">
<child>
<placeholder/>
</child>
<child>
<child type="titlebar">
<placeholder/>
</child>
</object>
@@ -142,9 +142,6 @@
<property name="destroy_with_parent">True</property>
<property name="icon">icon_stream.png</property>
<signal name="delete-event" handler="on_generator_window_delete_event" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkFrame" id="frame_generator">
<property name="visible">True</property>
@@ -1620,6 +1617,48 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="generators_close">
<property name="visible">True</property>
@@ -1701,6 +1740,9 @@
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>
@@ -1752,9 +1794,6 @@
<property name="title" translatable="yes">Image Calibration</property>
<property name="destroy_with_parent">True</property>
<signal name="delete-event" handler="on_calibration_window_delete_event" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkBox" id="vbox637">
<property name="visible">True</property>
@@ -2545,6 +2584,9 @@
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>
@@ -2594,9 +2636,6 @@
<property name="default_height">400</property>
<property name="icon">icon_stream.png</property>
<signal name="delete-event" handler="on_inputstream_window_delete_event" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkFrame" id="frame161">
<property name="width_request">340</property>
@@ -2958,6 +2997,9 @@
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>
@@ -2969,9 +3011,6 @@
<property name="type_hint">dialog</property>
<signal name="close" handler="on_veejay_connection_close" swapped="no"/>
<signal name="delete-event" handler="on_veejay_connection_close" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox3">
<property name="visible">True</property>
@@ -3212,6 +3251,9 @@
<action-widgets>
<action-widget response="-7">veejay_connection_close</action-widget>
</action-widgets>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>
@@ -3389,17 +3431,22 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="transition_lengt">
<object class="GtkAdjustment" id="transition_sample_length_adj">
<property name="upper">1000000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="transition_shap">
<object class="GtkAdjustment" id="transition_shape_adj">
<property name="lower">-1</property>
<property name="upper">100</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="transition_stream_length_adj">
<property name="upper">1000000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="v4l_backlight_compensation">
<property name="upper">65535</property>
<property name="step_increment">1</property>
@@ -3477,9 +3524,6 @@
<property name="type_hint">dialog</property>
<signal name="close" handler="on_video_options_close" swapped="no"/>
<signal name="delete-event" handler="on_video_options_close" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="vbox_video_options">
<property name="visible">True</property>
@@ -4333,6 +4377,9 @@
<action-widgets>
<action-widget response="-7">button117</action-widget>
</action-widgets>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>
@@ -4346,9 +4393,6 @@
<property name="type_hint">dialog</property>
<signal name="close" handler="on_vims_bundles_close" swapped="no"/>
<signal name="delete-event" handler="on_vims_bundles_close" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox5">
<property name="visible">True</property>
@@ -4722,6 +4766,9 @@
<action-widgets>
<action-widget response="-7">vims_bundles_close</action-widget>
</action-widgets>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>
@@ -4745,9 +4792,6 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">Reloaded</property>
<property name="icon">veejay-icon.png</property>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkBox" id="veejay_box">
<property name="visible">True</property>
@@ -11495,8 +11539,10 @@
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="width_chars">6</property>
<property name="adjustment">transition_shap</property>
<property name="input_purpose">number</property>
<property name="adjustment">transition_shape_adj</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
<signal name="value-changed" handler="on_transition_shape_value_changed" swapped="no"/>
</object>
<packing>
@@ -11510,7 +11556,10 @@
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">transition_lengt</property>
<property name="input_purpose">number</property>
<property name="adjustment">transition_sample_length_adj</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
<signal name="value-changed" handler="on_transition_length_value_changed" swapped="no"/>
</object>
<packing>
@@ -13027,9 +13076,9 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="tag_transition_active">
<object class="GtkCheckButton" id="stream_transition_active">
<property name="label" translatable="yes">Enabled</property>
<property name="name">tag_transition_active</property>
<property name="name">stream_transition_active</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -13055,15 +13104,17 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="tag_transition_shape">
<property name="name">transition_shape</property>
<object class="GtkSpinButton" id="stream_transition_shape">
<property name="name">stream_transition_shape</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="width_chars">6</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">transition_shap</property>
<property name="input_purpose">number</property>
<property name="adjustment">transition_shape_adj</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
<signal name="value-changed" handler="on_transition_shape_value_changed" swapped="no"/>
</object>
<packing>
@@ -13084,13 +13135,15 @@
</packing>
</child>
<child>
<object class="GtkSpinButton" id="tag_transition_length">
<property name="name">transition_length</property>
<object class="GtkSpinButton" id="stream_transition_length">
<property name="name">stream_transition_length</property>
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">0</property>
<property name="adjustment">transition_lengt</property>
<property name="input_purpose">number</property>
<property name="adjustment">transition_stream_length_adj</property>
<property name="numeric">True</property>
<signal name="value-changed" handler="on_transition_length_value_changed" swapped="no"/>
</object>
<packing>
@@ -19509,6 +19562,9 @@ Events may not always be triggered if veejay is configured to keep in sync (hard
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
<style>
<class name="reloaded"/>
</style>

View File

@@ -729,9 +729,9 @@ static struct
{ "transition_active", WIDGET_SAMPLE_TRANSITION_ACTIVE },
{ "transition_length", WIDGET_SAMPLE_TRANSITION_LENGTH },
{ "transition_shape", WIDGET_SAMPLE_TRANSITION_SHAPE },
{ "tag_transition_active", WIDGET_STREAM_TRANSITION_ACTIVE },
{ "tag_transition_length", WIDGET_STREAM_TRANSITION_LENGTH },
{ "tag_transition_shape", WIDGET_STREAM_TRANSITION_SHAPE },
{ "stream_transition_active", WIDGET_STREAM_TRANSITION_ACTIVE },
{ "stream_transition_length", WIDGET_STREAM_TRANSITION_LENGTH },
{ "stream_transition_shape", WIDGET_STREAM_TRANSITION_SHAPE },
{ "button_offline_stop_sample", WIDGET_OFFLINE_STOP_SAMPLE },
{ "button_offline_start_sample", WIDGET_OFFLINE_START_SAMPLE },
{ "spin_bufferedstreamid", WIDGET_BUFFEREDSTREAMID },
@@ -3947,66 +3947,91 @@ static void update_record_tab(int pm)
******************************************************/
static void update_current_slot_transition_state(int * history, int pm)
{
int sl = info->status_lock;
if (history[SAMPLE_TRANSITION_ACTIVE] != info->status_tokens[SAMPLE_TRANSITION_ACTIVE]){
info->status_lock = 1;
if( pm == MODE_STREAM ) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_STREAM_TRANSITION_ACTIVE]),
info->status_tokens[SAMPLE_TRANSITION_ACTIVE]);
} else if ( pm == MODE_SAMPLE ) {
if( history[SAMPLE_TRANSITION_ACTIVE] != info->status_tokens[SAMPLE_TRANSITION_ACTIVE] ) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_SAMPLE_TRANSITION_ACTIVE]),
info->status_tokens[SAMPLE_TRANSITION_ACTIVE]);
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget_cache[WIDGET_SAMPLE_TRANSITION_ACTIVE]),
info->status_tokens[SAMPLE_TRANSITION_ACTIVE]);
}
}
if( history[SAMPLE_TRANSITION_LENGTH] != info->status_tokens[SAMPLE_TRANSITION_LENGTH] ) {
//Two widgets for one signal handler : block signal propagations.
/* Block transitions widgets "value-changed" signal to prevent propagation */
guint signal_id = g_signal_lookup("value-changed", GTK_TYPE_SPIN_BUTTON);
gpointer widget_stl = (gpointer)widget_cache[WIDGET_SAMPLE_TRANSITION_LENGTH];
gulong handler_stl = g_signal_handler_find( widget_stl,
G_SIGNAL_MATCH_ID,
signal_id,
0, NULL, NULL, NULL );
if (handler_stl){ g_signal_handler_block(widget_stl, handler_stl); }
if( pm == MODE_STREAM ) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_cache[WIDGET_STREAM_TRANSITION_LENGTH]),
gpointer widget_stl = (gpointer)widget_cache[WIDGET_STREAM_TRANSITION_LENGTH];
gulong handler_stl = g_signal_handler_find( widget_stl,
G_SIGNAL_MATCH_ID,
signal_id,
0, NULL, NULL, NULL );
if (handler_stl) g_signal_handler_block(widget_stl, handler_stl);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_stl),
(gdouble) info->status_tokens[SAMPLE_TRANSITION_LENGTH]);
if (handler_stl) g_signal_handler_unblock(widget_stl, handler_stl);
} else if ( pm == MODE_SAMPLE ) {
update_spin_range2( widget_stl,
(gdouble) info->status_tokens[SAMPLE_TRANSITION_LENGTH],
gpointer widget_stl = (gpointer)widget_cache[WIDGET_SAMPLE_TRANSITION_LENGTH];
gulong handler_stl = g_signal_handler_find( widget_stl,
G_SIGNAL_MATCH_ID,
signal_id,
0, NULL, NULL, NULL );
if (handler_stl) g_signal_handler_block(widget_stl, handler_stl);
update_spin_range2( GTK_SPIN_BUTTON(widget_stl),
(gdouble) info->status_tokens[SAMPLE_START],
info->status_tokens[SAMPLE_END],
info->status_tokens[SAMPLE_TRANSITION_LENGTH] );
if (handler_stl) g_signal_handler_unblock(widget_stl, handler_stl);
}
if (handler_stl) { g_signal_handler_unblock(widget_stl, handler_stl); }
}
if( history[SAMPLE_TRANSITION_SHAPE] != info->status_tokens[SAMPLE_TRANSITION_SHAPE]) {
/* Block transitions widgets "value-changed" signal to prevent propagation */
guint signal_id = g_signal_lookup("value-changed", GTK_TYPE_SPIN_BUTTON);
gpointer widget_sts = (gpointer)widget_cache[WIDGET_SAMPLE_TRANSITION_SHAPE];
gulong handler_sts = g_signal_handler_find( widget_sts,
G_SIGNAL_MATCH_ID,
signal_id,
0, NULL, NULL, NULL );
if (handler_sts){ g_signal_handler_block(widget_sts, handler_sts); }
info->status_lock = 1;
if( pm == MODE_STREAM ) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_cache[WIDGET_STREAM_TRANSITION_SHAPE]),
(gdouble) info->status_tokens[SAMPLE_TRANSITION_SHAPE]);
} else if ( pm == MODE_SAMPLE ) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_sts), (gdouble) info->status_tokens[SAMPLE_TRANSITION_SHAPE]);
}
gpointer widget_sts = (gpointer)widget_cache[WIDGET_STREAM_TRANSITION_SHAPE];
gulong handler_sts = g_signal_handler_find( widget_sts,
G_SIGNAL_MATCH_ID,
signal_id,
0, NULL, NULL, NULL );
if (handler_sts) { g_signal_handler_unblock(widget_sts, handler_sts); }
if (handler_sts) g_signal_handler_block(widget_sts, handler_sts);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_sts),
(gdouble) info->status_tokens[SAMPLE_TRANSITION_SHAPE]);
if (handler_sts) g_signal_handler_unblock(widget_sts, handler_sts);
} else if ( pm == MODE_SAMPLE ) {
gpointer widget_sts = (gpointer)widget_cache[WIDGET_SAMPLE_TRANSITION_SHAPE];
gulong handler_sts = g_signal_handler_find( widget_sts,
G_SIGNAL_MATCH_ID,
signal_id,
0, NULL, NULL, NULL );
if (handler_sts) g_signal_handler_block(widget_sts, handler_sts);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget_sts),
(gdouble) info->status_tokens[SAMPLE_TRANSITION_SHAPE]);
if (handler_sts) g_signal_handler_unblock(widget_sts, handler_sts);
}
}
info->status_lock = sl;
}
/******************************************************