From 12f184b568c2f5921e64b4bc3f6674c394e8021a Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 7 Jan 2023 21:48:17 +0100 Subject: [PATCH 1/2] Plugins (lv_gltest): Base rotation on runtime not FPS --- .../plugins/actor/lv_gltest/actor_lv_gltest.c | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c b/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c index d56876216..ea0b2ce06 100644 --- a/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c +++ b/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c @@ -44,14 +44,19 @@ static int xranges[] = {0, 1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 54, 74, 101, 137, typedef struct { GLfloat y_angle; - GLfloat y_speed; + GLfloat y_initial_angle; + GLfloat y_speed; // degrees per second GLfloat x_angle; - GLfloat x_speed; + GLfloat x_initial_angle; + GLfloat x_speed; // degrees per second GLfloat z_angle; - GLfloat z_speed; + GLfloat z_initial_angle; + GLfloat z_speed; // degrees per second GLfloat heights[16][16]; int transparent; + + VisTimer * started_at; } GLtestPrivate; int lv_gltest_init (VisPluginData *plugin); @@ -161,12 +166,17 @@ int lv_gltest_init (VisPluginData *plugin) } } - priv->x_speed = 0.0; - priv->y_speed = 0.5; - priv->z_speed = 0.0; - priv->x_angle = 20.0; - priv->y_angle = 45.0; - priv->z_angle = 0.0; + priv->x_speed = 0.0f; + priv->y_speed = 360.0f / 13.0f; + priv->z_speed = 0.0f; + priv->x_initial_angle = 20.0f; + priv->y_initial_angle = 45.0f; + priv->z_initial_angle = 0.0f; + + priv->started_at = visual_timer_new(); + visual_log_return_val_if_fail( priv->started_at != NULL, -1 ); + + visual_timer_start(priv->started_at); return 0; } @@ -303,17 +313,11 @@ int lv_gltest_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) priv->heights[0][i] = ff * 10; } - priv->x_angle += priv->x_speed; - if (priv->x_angle >= 360.0) - priv->x_angle -= 360.0; - - priv->y_angle += priv->y_speed; - if (priv->y_angle >= 360.0) - priv->y_angle -= 360.0; + const float seconds_elapsed = visual_timer_elapsed_msecs(priv->started_at) / 1000.0f; - priv->z_angle += priv->z_speed; - if (priv->z_angle >= 360.0) - priv->z_angle -= 360.0; + priv->x_angle = fmodf(priv->x_initial_angle + priv->x_speed * seconds_elapsed, 360.0); + priv->y_angle = fmodf(priv->y_initial_angle + priv->y_speed * seconds_elapsed, 360.0); + priv->z_angle = fmodf(priv->z_initial_angle + priv->z_speed * seconds_elapsed, 360.0); draw_bars (priv); From 0ed54dec3ca3d73e7e1054b5e4685b508522fd32 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 13 Jan 2023 23:08:53 +0100 Subject: [PATCH 2/2] Plugins (lv_gltest): Sync translation --- libvisual-plugins/po/de.po | 10 +++++----- libvisual-plugins/po/es_AR.po | 10 +++++----- libvisual-plugins/po/es_ES.po | 10 +++++----- libvisual-plugins/po/libvisual-plugins-0.4.pot | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libvisual-plugins/po/de.po b/libvisual-plugins/po/de.po index f290dce54..518e6e20a 100644 --- a/libvisual-plugins/po/de.po +++ b/libvisual-plugins/po/de.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: libvisual-plugins 0.4.0\n" "Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n" -"POT-Creation-Date: 2023-01-13 19:36+0100\n" +"POT-Creation-Date: 2023-01-13 23:31+0100\n" "PO-Revision-Date: 2017-11-23 18:08:07+0200\n" "Last-Translator: Chris Leick \n" "Language-Team: German \n" @@ -293,7 +293,7 @@ msgstr "Libvisual-Analyseerweiterung" msgid "A nice simple spectrum analyzer plugin." msgstr "eine schicke einfache Spektrumanalyseerweiterung" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:87 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:92 msgid "" "Original by: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front " "Technologies, Port by: Dennis Smit " @@ -301,16 +301,16 @@ msgstr "" "Original von: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson und 4Front " "Technologies, Portierung durch: Dennis Smit " -#: plugins/actor/lv_gltest/actor_lv_gltest.c:89 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:94 msgid "Libvisual GL analyzer plugin" msgstr "Libvisual-GL-Analysiererweiterung" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:90 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:95 msgid "This plugin shows an openGL bar analyzer like the xmms one" msgstr "Diese Erweiterung zeigt ein OpenGL-Balkenanalyse wie die von XMMS." # FIXME s/Transparant/Transparent/ -#: plugins/actor/lv_gltest/actor_lv_gltest.c:136 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:141 msgid "Transparant bars" msgstr "durchsichtige Balken" diff --git a/libvisual-plugins/po/es_AR.po b/libvisual-plugins/po/es_AR.po index 3be23f83c..8f1b56a90 100644 --- a/libvisual-plugins/po/es_AR.po +++ b/libvisual-plugins/po/es_AR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Libvisual plugins 0.3.0\n" "Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n" -"POT-Creation-Date: 2023-01-13 19:36+0100\n" +"POT-Creation-Date: 2023-01-13 23:31+0100\n" "PO-Revision-Date: 2005-03-16 00:11-0300\n" "Last-Translator: Duilio Javier Protti \n" "Language-Team: Spanish \n" @@ -287,21 +287,21 @@ msgstr "" msgid "A nice simple spectrum analyzer plugin." msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:87 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:92 msgid "" "Original by: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front " "Technologies, Port by: Dennis Smit " msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:89 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:94 msgid "Libvisual GL analyzer plugin" msgstr "Plugin analizador GL para Libvisual" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:90 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:95 msgid "This plugin shows an openGL bar analyzer like the xmms one" msgstr "Éste plugin muestra un analizador de barras OpenGL como el de xmms" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:136 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:141 msgid "Transparant bars" msgstr "Barras transparentes" diff --git a/libvisual-plugins/po/es_ES.po b/libvisual-plugins/po/es_ES.po index f54320148..bab5a482d 100644 --- a/libvisual-plugins/po/es_ES.po +++ b/libvisual-plugins/po/es_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Libvisual plugins 0.3.0\n" "Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n" -"POT-Creation-Date: 2023-01-13 19:36+0100\n" +"POT-Creation-Date: 2023-01-13 23:31+0100\n" "PO-Revision-Date: 2005-03-16 00:11-0300\n" "Last-Translator: Duilio Javier Protti \n" "Language-Team: Spanish \n" @@ -287,21 +287,21 @@ msgstr "" msgid "A nice simple spectrum analyzer plugin." msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:87 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:92 msgid "" "Original by: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front " "Technologies, Port by: Dennis Smit " msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:89 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:94 msgid "Libvisual GL analyzer plugin" msgstr "Plugin analizador GL para Libvisual" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:90 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:95 msgid "This plugin shows an openGL bar analyzer like the xmms one" msgstr "Éste plugin muestra un analizador de barras OpenGL como el de xmms" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:136 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:141 msgid "Transparant bars" msgstr "Barras transparentes" diff --git a/libvisual-plugins/po/libvisual-plugins-0.4.pot b/libvisual-plugins/po/libvisual-plugins-0.4.pot index 25db10ffb..4bbca45fa 100644 --- a/libvisual-plugins/po/libvisual-plugins-0.4.pot +++ b/libvisual-plugins/po/libvisual-plugins-0.4.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: libvisual-plugins 0.4.1\n" "Report-Msgid-Bugs-To: https://github.com/Libvisual/libvisual/issues/\n" -"POT-Creation-Date: 2023-01-13 19:36+0100\n" +"POT-Creation-Date: 2023-01-13 23:31+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -272,21 +272,21 @@ msgstr "" msgid "A nice simple spectrum analyzer plugin." msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:87 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:92 msgid "" "Original by: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front " "Technologies, Port by: Dennis Smit " msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:89 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:94 msgid "Libvisual GL analyzer plugin" msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:90 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:95 msgid "This plugin shows an openGL bar analyzer like the xmms one" msgstr "" -#: plugins/actor/lv_gltest/actor_lv_gltest.c:136 +#: plugins/actor/lv_gltest/actor_lv_gltest.c:141 msgid "Transparant bars" msgstr ""