[chronojump] Encoder capture rhythm can only show cluster rest seconds countdown
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder capture rhythm can only show cluster rest seconds countdown
- Date: Fri, 7 Jan 2022 16:31:13 +0000 (UTC)
commit e42732d7c41dc5732798cf6f54bc16b705521608
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jan 7 17:30:41 2022 +0100
Encoder capture rhythm can only show cluster rest seconds countdown
glade/repetitive_conditions.glade | 1149 +++++++++++++++++++------------------
src/encoderRhythm.cs | 54 +-
src/gui/app1/encoder.cs | 78 ++-
src/gui/repetitiveConditions.cs | 12 +-
src/preferences.cs | 8 +-
src/sqlite/preferences.cs | 2 +-
6 files changed, 723 insertions(+), 580 deletions(-)
---
diff --git a/glade/repetitive_conditions.glade b/glade/repetitive_conditions.glade
index 54ea25cc6..d735650e0 100644
--- a/glade/repetitive_conditions.glade
+++ b/glade/repetitive_conditions.glade
@@ -3838,13 +3838,72 @@
<property name="border_width">12</property>
<property name="spacing">20</property>
<child>
- <widget class="GtkCheckButton" id="check_rhythm_active">
- <property name="label" translatable="yes">Show rhythm while capturing</property>
+ <widget class="GtkHBox" id="hbox59">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_check_rhythm_active_toggled" swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="spacing">20</property>
+ <child>
+ <widget class="GtkCheckButton" id="check_rhythm_active">
+ <property name="label" translatable="yes">Show rhythm while
capturing</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_check_rhythm_active_toggled"
swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox38">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkCheckButton" id="check_rhythm_use_clusters">
+ <property name="label" translatable="yes">Use clusters</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_check_rhythm_use_clusters_toggled"
swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_use_clusters_help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_button_use_clusters_help_clicked"
swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image_clusters_info">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -3853,320 +3912,191 @@
</packing>
</child>
<child>
- <widget class="GtkFrame" id="frame_rhythm">
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.69999998807907104</property>
- <property name="shadow_type">out</property>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
- <widget class="GtkAlignment" id="alignment21">
+ <widget class="GtkViewport" id="viewport2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">10</property>
- <property name="bottom_padding">10</property>
- <property name="left_padding">10</property>
- <property name="right_padding">10</property>
<child>
<widget class="GtkVBox" id="vbox10">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">20</property>
- <child>
- <widget class="GtkTable" id="table10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">10</property>
- <child>
- <widget class="GtkLabel" id="label47">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Duration of eccentric
phase</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label39">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Duration of concentric
phase</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label48">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Total
duration</property>
- </widget>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_ecc">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">1 0.10000000000000001 10
0.10000000000000001 1 0</property>
- <property name="digits">2</property>
- <property name="numeric">True</property>
- <signal name="value_changed"
handler="on_spin_rhythm_phases_values_changed" swapped="no"/>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_con">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">1 0.10000000000000001 10
0.10000000000000001 1 0</property>
- <property name="digits">2</property>
- <property name="numeric">True</property>
- <signal name="value_changed"
handler="on_spin_rhythm_phases_values_changed" swapped="no"/>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label55">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label56">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label57">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"/>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label_rhythm_ecc_plus_con">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label">2</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox42">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkCheckButton" id="check_rhythm_rest_reps">
- <property name="label" translatable="yes">Rest between
repetitions</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_check_rhythm_rest_reps_toggled" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox_rhythm_rest_reps_value">
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_rest_reps">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">1 0 99 0.10000000000000001 1
0</property>
- <property name="digits">1</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label49">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox38">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkCheckButton" id="check_rhythm_use_clusters">
- <property name="label" translatable="yes">Use clusters</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_check_rhythm_use_clusters_toggled" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button_use_clusters_help">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked"
handler="on_button_use_clusters_help_clicked" swapped="no"/>
- <child>
- <widget class="GtkImage" id="image_clusters_info">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="border_width">6</property>
+ <property name="spacing">12</property>
<child>
- <widget class="GtkAlignment" id="alignment22">
- <property name="visible">True</property>
+ <widget class="GtkFrame" id="frame_rhythm">
<property name="can_focus">False</property>
- <property name="left_padding">30</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.69999998807907104</property>
+ <property name="shadow_type">out</property>
<child>
- <widget class="GtkVBox" id="vbox_rhythm_cluster">
+ <widget class="GtkAlignment" id="alignment21">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">8</property>
+ <property name="top_padding">10</property>
+ <property name="bottom_padding">10</property>
+ <property name="left_padding">10</property>
+ <property name="right_padding">10</property>
<child>
- <widget class="GtkHBox" id="hbox40">
+ <widget class="GtkVBox" id="vbox12">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">20</property>
<child>
- <widget class="GtkLabel" id="label43">
+ <widget class="GtkTable" id="table10">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Repetitions in
cluster</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">10</property>
+ <child>
+ <widget class="GtkLabel" id="label47">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Duration
of eccentric phase</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label39">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Duration
of concentric phase</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label48">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Total
duration</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_ecc">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">1 0.10000000000000001 10
0.10000000000000001 1 0</property>
+ <property name="digits">2</property>
+ <property name="numeric">True</property>
+ <signal name="value_changed"
handler="on_spin_rhythm_phases_values_changed" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options"/>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_con">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">1 0.10000000000000001 10
0.10000000000000001 1 0</property>
+ <property name="digits">2</property>
+ <property name="numeric">True</property>
+ <signal name="value_changed"
handler="on_spin_rhythm_phases_values_changed" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"/>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label55">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options"/>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label56">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"/>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label57">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"/>
+ <property name="y_options"/>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel"
id="label_rhythm_ecc_plus_con">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label">2</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -4175,18 +4105,68 @@
</packing>
</child>
<child>
- <widget class="GtkSpinButton"
id="spin_rhythm_reps_cluster">
+ <widget class="GtkHBox" id="hbox42">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="width_chars">2</property>
- <property name="progress_pulse_step">1</property>
- <property
name="primary_icon_activatable">False</property>
- <property
name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">5 2 30 1 10 0</property>
- <property name="numeric">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkCheckButton"
id="check_rhythm_rest_reps">
+ <property name="label" translatable="yes">Rest
between repetitions</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled"
handler="on_check_rhythm_rest_reps_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox"
id="hbox_rhythm_rest_reps_value">
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkSpinButton"
id="spin_rhythm_rest_reps">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">1 0 99
0.10000000000000001 1 0</property>
+ <property name="digits">1</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label49">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -4194,82 +4174,329 @@
<property name="position">1</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox41">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label44">
- <property name="visible">True</property>
+ <widget class="GtkHBox" id="hbox43">
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Rest between
clusters</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_rhythm_together">
+ <property name="label" translatable="yes">Rhythm of
the repetition</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled"
handler="on_radio_rhythm_together_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_rhythm_separated">
+ <property name="label" translatable="yes">Rhythm by
phases</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property
name="group">radio_rhythm_together</property>
+ <signal name="toggled"
handler="on_radio_rhythm_together_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment25">
+ <property name="can_focus">False</property>
+ <property name="left_padding">30</property>
+ <child>
+ <widget class="GtkNotebook"
id="notebook_duration_repetition">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <child>
+ <widget class="GtkVBox" id="vbox19">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkHBox"
id="hbox_duration_repetition">
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label50">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Duration of repetition</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton"
id="spin_rhythm_rep">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">2
0.10000000000000001 10 0.10000000000000001 1 0</property>
+ <property name="digits">2</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label51">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label"
translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label52">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">page
1</property>
+ </widget>
+ <packing>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label53">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">page
2</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
</packing>
</child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Configure
rhythm</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame_clusters">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.69999998807907104</property>
+ <property name="shadow_type">out</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment22">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">10</property>
+ <property name="bottom_padding">10</property>
+ <property name="left_padding">10</property>
+ <property name="right_padding">10</property>
+ <child>
+ <widget class="GtkVBox" id="vbox_rhythm_cluster">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
<child>
- <widget class="GtkSpinButton"
id="spin_rhythm_rest_clusters">
+ <widget class="GtkHBox" id="hbox40">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property
name="primary_icon_activatable">False</property>
- <property
name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">6 0.10000000000000001 99
0.10000000000000001 1 0</property>
- <property name="climb_rate">1</property>
- <property name="digits">2</property>
- <property name="numeric">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label44">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label"
translatable="yes">Repetitions in cluster</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton"
id="spin_rhythm_reps_cluster">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="width_chars">2</property>
+ <property name="progress_pulse_step">1</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">5 2 30 1 10 0</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label45">
+ <widget class="GtkHBox" id="hbox41">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">seconds</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label45">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Rest
between clusters</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton"
id="spin_rhythm_rest_clusters">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">6 0.10000000000000001 99
0.10000000000000001 1 0</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">2</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label75">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
</child>
</widget>
</child>
+ <child>
+ <widget class="GtkLabel" id="label43">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Configure clusters</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox_rhythm_rest_after">
<property name="can_focus">False</property>
+ <property name="border_width">6</property>
<property name="spacing">10</property>
<child>
<widget class="GtkAlignment" id="alignment26">
@@ -4343,215 +4570,45 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment24">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">10</property>
- <child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="button_rhythm_default">
- <property name="label" translatable="yes">Back to default
values</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <signal name="clicked"
handler="on_button_rhythm_default_clicked" swapped="no"/>
- </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">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox43">
- <property name="sensitive">False</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <widget class="GtkRadioButton" id="radio_rhythm_together">
- <property name="label" translatable="yes">Rhythm of the
repetition</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_radio_rhythm_together_toggled" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="radio_rhythm_separated">
- <property name="label" translatable="yes">Rhythm by
phases</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">radio_rhythm_together</property>
- <signal name="toggled"
handler="on_radio_rhythm_together_toggled" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment25">
- <property name="can_focus">False</property>
- <property name="left_padding">30</property>
- <child>
- <widget class="GtkNotebook" id="notebook_duration_repetition">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <child>
- <widget class="GtkVBox" id="vbox12">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <widget class="GtkHBox" id="hbox_duration_repetition">
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label50">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Duration
of repetition</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_rep">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property
name="primary_icon_activatable">False</property>
- <property
name="secondary_icon_activatable">False</property>
- <property
name="primary_icon_sensitive">True</property>
- <property
name="secondary_icon_sensitive">True</property>
- <property name="adjustment">2 0.10000000000000001 10
0.10000000000000001 1 0</property>
- <property name="digits">2</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label51">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label"
translatable="yes">seconds</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label52">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">page 1</property>
- </widget>
- <packing>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <widget class="GtkLabel" id="label53">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">page 2</property>
- </widget>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">7</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
<child>
- <widget class="GtkLabel" id="label27">
+ <widget class="GtkButton" id="button_rhythm_default">
+ <property name="label" translatable="yes">Back to default values</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Configure rhythm</property>
- <property name="use_markup">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <signal name="clicked" handler="on_button_rhythm_default_clicked"
swapped="no"/>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
diff --git a/src/encoderRhythm.cs b/src/encoderRhythm.cs
index f33f47181..d4f0d3ed9 100644
--- a/src/encoderRhythm.cs
+++ b/src/encoderRhythm.cs
@@ -15,16 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2018-2020 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2018-2022 Xavier de Blas <xaviblas gmail com>
*/
using System;
using System.Data;
using Mono.Unix;
+using System.Diagnostics; //Stopwatch
public class EncoderRhythm
{
- public bool Active;
+ public bool ActiveRhythm;
public bool RepsOrPhases; //true is by repetition, using RepSeconds. False is by phases, using
EccSeconds, ConSeconds
public double RepSeconds;
public double EccSeconds;
@@ -40,7 +41,7 @@ public class EncoderRhythm
public EncoderRhythm()
{
- Active = false;
+ ActiveRhythm = false;
//default values
RepsOrPhases = false; //it's always Phases (reps was not easy to follow the bar while doing
ecc/con)
@@ -55,12 +56,12 @@ public class EncoderRhythm
RestClustersSeconds = 6;
}
- public EncoderRhythm(bool active, bool repsOrPhases,
+ public EncoderRhythm(bool activeRhythm, bool repsOrPhases,
double repSeconds, double eccSeconds, double conSeconds,
double restRepsSeconds, bool restAfterEcc,
int repsCluster, double restClustersSeconds)
{
- Active = active;
+ ActiveRhythm = activeRhythm;
RepsOrPhases = repsOrPhases;
RepSeconds = repSeconds;
EccSeconds = eccSeconds;
@@ -84,10 +85,10 @@ public class EncoderRhythm
//to show or not image_encoder_rhythm_rest
public bool UseRest()
{
- if(! Active)
+ if(! ActiveRhythm && ! UseClusters())
return false;
- if(RestRepsSeconds > 0)
+ if(ActiveRhythm && RestRepsSeconds > 0)
return true;
if(UseClusters() && RestClustersSeconds > 0)
@@ -98,7 +99,7 @@ public class EncoderRhythm
public double RestClustersForEncoderCaptureAutoEnding()
{
- if(Active && UseClusters() && RestClustersSeconds > 0)
+ if(UseClusters() && RestClustersSeconds > 0)
return RestClustersSeconds;
return 0;
@@ -108,7 +109,7 @@ public class EncoderRhythm
{
return
"EncoderRhythm:" +
- "\nActive: " + Active.ToString() +
+ "\nActiveRhythm: " + ActiveRhythm.ToString() +
"\nRepsOrPhases: " + RepsOrPhases.ToString() +
"\nRepSeconds: " + RepSeconds.ToString() +
"\nEccSeconds: " + EccSeconds.ToString() +
@@ -354,6 +355,41 @@ public class EncoderRhythmExecute
LogB.Information("currentPhase = " + currentPhase.ToString());
}
+ // ----- all this is when we only care for clusters and not for rhythm of each rep or phase
+ private bool clusterRestSecondsDoing = false;
+ private Stopwatch clusterRestSeconds;
+ public bool ClusterRestDoing ()
+ {
+ return clusterRestSecondsDoing;
+ }
+ public void ClusterRestStart ()
+ {
+ if(clusterRestSeconds == null)
+ clusterRestSeconds = new Stopwatch();
+ clusterRestSeconds.Start();
+
+ clusterRestSecondsDoing = true;
+ }
+ public void ClusterRestStop ()
+ {
+ clusterRestSeconds.Reset(); //Stops time interval measurement and resets the elapsed time to
zero.
+ clusterRestSecondsDoing = false;
+ }
+ public string ClusterRestSecondsStr ()
+ {
+ double restTime = encoderRhythm.RestClustersSeconds - clusterRestSeconds.Elapsed.TotalSeconds;
+
+ //at < 0 do not show any message, user should be doing repetition again
+ if(restTime < 0)
+ return "";
+
+ //LogB.Information("encoderRhythm.RestClustersSeconds: " +
encoderRhythm.RestClustersSeconds.ToString());
+ //LogB.Information("clusterRestSeconds.Elapsed.TotalSeconds: " +
clusterRestSeconds.Elapsed.TotalSeconds.ToString());
+ return string.Format(Catalog.GetString("Resting {0} s"), Util.TrimDecimals(restTime, 1));
+ }
+ // <------
+
+
// Accessors ------------------
public double Fraction
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index d2db3c3b0..4745ab968 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2021 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2022 Xavier de Blas <xaviblas gmail com>
*/
using System;
using System.IO;
@@ -6231,7 +6231,7 @@ public partial class ChronoJumpWindow
{
reallyCutByTriggers = preferences.encoderCaptureCutByTriggers;
notebook_encoder_signal_comment_rhythm_and_triggers.Page = 2;
- } else if(encoderRhythm.Active)
+ } else if(encoderRhythm.ActiveRhythm || encoderRhythm.UseClusters())
{
notebook_encoder_signal_comment_rhythm_and_triggers.Page = 1;
image_encoder_rhythm_rest.Visible = encoderRhythm.UseRest();
@@ -6792,7 +6792,7 @@ public partial class ChronoJumpWindow
label_video_encoder_feedback.Text = "Recording video.";
}
- if(encoderRhythm.Active)
+ if(encoderRhythm.ActiveRhythm || encoderRhythm.UseClusters())
updatePulsebarRhythm();
//changed trying to fix crash of nuell 27/may/2016
@@ -7028,20 +7028,66 @@ public partial class ChronoJumpWindow
private void updatePulsebarRhythm()
{
- if(! encoderRhythmExecute.FirstPhaseDone)
+ if(encoderRhythm.ActiveRhythm)
{
- encoder_pulsebar_rhythm_eccon.Fraction = 0;
- label_encoder_rhythm_rest.Text = "";
- image_encoder_rhythm_rest.Visible = false;
- encoder_pulsebar_rhythm_eccon.Text = "Waiting 1st phase";
- return;
+ if(! encoderRhythmExecute.FirstPhaseDone)
+ {
+ encoder_pulsebar_rhythm_eccon.Fraction = 0;
+ label_encoder_rhythm_rest.Text = "";
+ image_encoder_rhythm_rest.Visible = false;
+ encoder_pulsebar_rhythm_eccon.Text = "Waiting 1st phase";
+ return;
+ }
+
+ encoderRhythmExecute.CalculateFractionsAndText();
+ encoder_pulsebar_rhythm_eccon.Fraction = encoderRhythmExecute.Fraction;
+ encoder_pulsebar_rhythm_eccon.Text = encoderRhythmExecute.TextRepetition;
+ label_encoder_rhythm_rest.Text = encoderRhythmExecute.TextRest;
+ image_encoder_rhythm_rest.Visible = encoderRhythmExecute.TextRest != "";
+ }
+ else if(encoderRhythm.UseClusters()) //hi ha bugs pq a vegades es deixa de veure el
comptador!, imprimir els valors del seguent if !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ {
+ //just for show cluster rest (so on feedback gui, rhythm will be unactive but cluster
rest active)
+ if(! encoderRhythmExecute.FirstPhaseDone)
+ {
+ encoder_pulsebar_rhythm_eccon.Fraction = 0;
+ label_encoder_rhythm_rest.Text = "";
+ image_encoder_rhythm_rest.Visible = false;
+ //encoder_pulsebar_rhythm_eccon.Text = "Waiting 1st phase";
+ return;
+ }
+
+ int repsDone = eCapture.Ecca.curvesAccepted;
+ bool showRest = false;
+ if(radio_encoder_eccon_concentric.Active && repsDone % encoderRhythm.RepsCluster == 0)
+ showRest = true;
+ else if(repsDone > 1 && radio_encoder_eccon_eccentric_concentric.Active && repsDone %
(2 * encoderRhythm.RepsCluster) == 0) //TODO: add the info if start up or down, looking at FirstPhaseDo
+ showRest = true;
+
+ if(showRest)
+ {
+ if(! encoderRhythmExecute.ClusterRestDoing())
+ {
+ encoderRhythmExecute.ClusterRestStart();
+ image_encoder_rhythm_rest.Visible = true;
+ }
+
+ string restStr = encoderRhythmExecute.ClusterRestSecondsStr();
+ label_encoder_rhythm_rest.Text = restStr;
+ //do not show sofa when rested more than RestClusterSeconds
+ if(restStr == "")
+ image_encoder_rhythm_rest.Visible = false;
+ } else {
+ if(encoderRhythmExecute.ClusterRestDoing())
+ {
+ encoderRhythmExecute.ClusterRestStop();
+ image_encoder_rhythm_rest.Visible = false;
+ label_encoder_rhythm_rest.Text = "";
+ }
+ }
}
- encoderRhythmExecute.CalculateFractionsAndText();
- encoder_pulsebar_rhythm_eccon.Fraction = encoderRhythmExecute.Fraction;
- encoder_pulsebar_rhythm_eccon.Text = encoderRhythmExecute.TextRepetition;
- label_encoder_rhythm_rest.Text = encoderRhythmExecute.TextRest;
- image_encoder_rhythm_rest.Visible = encoderRhythmExecute.TextRest != "";
+ //TODO: remember to stop ClusterRestSeconds at end of capture
}
// -------------- drawingarea_encoder_analyze_instant
@@ -7447,6 +7493,10 @@ public partial class ChronoJumpWindow
new DialogMessage(Constants.MessageTypes.WARNING,
Catalog.GetString("Set corrected. string was not fully
extended at the beginning."));
}
+
+ if(encoderRhythm != null && encoderRhythm.UseClusters() && encoderRhythmExecute !=
null)
+ encoderRhythmExecute.ClusterRestStop ();
+
} else { //ANALYZE
if(encoderProcessCancel) {
encoder_pulsebar_analyze.Text = Catalog.GetString("Cancelled");
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index f773ea009..57feba3d7 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -163,7 +163,7 @@ public class RepetitiveConditionsWindow
[Widget] Gtk.RadioButton radio_rhythm_together;
[Widget] Gtk.RadioButton radio_rhythm_separated;
[Widget] Gtk.Notebook notebook_duration_repetition;
- [Widget] Gtk.VBox vbox_rhythm_cluster;
+ [Widget] Gtk.Frame frame_clusters;
[Widget] Gtk.Frame frame_rhythm;
[Widget] Gtk.CheckButton check_rhythm_use_clusters;
[Widget] Gtk.SpinButton spin_rhythm_rep;
@@ -885,7 +885,7 @@ public class RepetitiveConditionsWindow
private void on_check_rhythm_use_clusters_toggled (object o, EventArgs args)
{
- vbox_rhythm_cluster.Visible = check_rhythm_use_clusters.Active;
+ frame_clusters.Visible = check_rhythm_use_clusters.Active;
should_show_vbox_rhythm_rest_after();
}
@@ -906,7 +906,7 @@ public class RepetitiveConditionsWindow
//have default values
EncoderRhythm encoderRhythm = new EncoderRhythm();
//But have rhythm active
- encoderRhythm.Active = true;
+ encoderRhythm.ActiveRhythm = true;
//modify widgets
encoder_rhythm_set_values(encoderRhythm);
@@ -914,7 +914,7 @@ public class RepetitiveConditionsWindow
private void encoder_rhythm_set_values(EncoderRhythm encoderRhythm)
{
- check_rhythm_active.Active = encoderRhythm.Active;
+ check_rhythm_active.Active = encoderRhythm.ActiveRhythm;
/*
if(encoderRhythm.RepsOrPhases)
@@ -944,10 +944,10 @@ public class RepetitiveConditionsWindow
if(encoderRhythm.UseClusters()) {
check_rhythm_use_clusters.Active = true;
- vbox_rhythm_cluster.Visible = true;
+ frame_clusters.Visible = true;
} else {
check_rhythm_use_clusters.Active = false;
- vbox_rhythm_cluster.Visible = false;
+ frame_clusters.Visible = false;
}
should_show_vbox_rhythm_rest_after();
diff --git a/src/preferences.cs b/src/preferences.cs
index 974cd3c58..2a280b3fe 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -351,7 +351,7 @@ public class Preferences
public void UpdateEncoderRhythm(EncoderRhythm er)
{
if(
- encoderRhythmActive != er.Active ||
+ encoderRhythmActive != er.ActiveRhythm ||
encoderRhythmRepsOrPhases != er.RepsOrPhases ||
encoderRhythmRepSeconds != er.RepSeconds ||
encoderRhythmEccSeconds != er.EccSeconds ||
@@ -365,11 +365,11 @@ public class Preferences
else
return;
- if(encoderRhythmActive != er.Active)
+ if(encoderRhythmActive != er.ActiveRhythm)
{
- encoderRhythmActive = er.Active;
+ encoderRhythmActive = er.ActiveRhythm;
SqlitePreferences.Update(SqlitePreferences.EncoderRhythmActiveStr,
- er.Active.ToString(), true); //bool
+ er.ActiveRhythm.ToString(), true); //bool
}
if(encoderRhythmRepsOrPhases != er.RepsOrPhases)
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index dccdecd61..db15c02e5 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -313,7 +313,7 @@ class SqlitePreferences : Sqlite
//encoderRhythm
EncoderRhythm er = new EncoderRhythm();
- Insert (EncoderRhythmActiveStr, er.Active.ToString(), dbcmdTr);
+ Insert (EncoderRhythmActiveStr, er.ActiveRhythm.ToString(), dbcmdTr);
Insert (EncoderRhythmRepsOrPhasesStr, er.RepsOrPhases.ToString(), dbcmdTr);
Insert (EncoderRhythmRepSecondsStr, Util.ConvertToPoint(er.RepSeconds),
dbcmdTr);
Insert (EncoderRhythmEccSecondsStr, Util.ConvertToPoint(er.EccSeconds),
dbcmdTr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]