Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.4.x] libvisual-plugins: Base rotation on runtime not FPS for actor "lv_gltest" #153

Merged
merged 2 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);

Expand Down
10 changes: 5 additions & 5 deletions libvisual-plugins/po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <c.leick@vollbio.de>\n"
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
Expand Down Expand Up @@ -293,24 +293,24 @@ 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 <ds@nerds-incorporated.org>"
msgstr ""
"Original von: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson und 4Front "
"Technologies, Portierung durch: Dennis Smit <ds@nerds-incorporated.org>"

#: 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"

Expand Down
10 changes: 5 additions & 5 deletions libvisual-plugins/po/es_AR.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <dprotti@users.sourceforge.net>\n"
"Language-Team: Spanish <es@li.org>\n"
Expand Down Expand Up @@ -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 <ds@nerds-incorporated.org>"
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"

Expand Down
10 changes: 5 additions & 5 deletions libvisual-plugins/po/es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <dprotti@users.sourceforge.net>\n"
"Language-Team: Spanish <es@li.org>\n"
Expand Down Expand Up @@ -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 <ds@nerds-incorporated.org>"
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"

Expand Down
10 changes: 5 additions & 5 deletions libvisual-plugins/po/libvisual-plugins-0.4.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -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 <ds@nerds-incorporated.org>"
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 ""

Expand Down