[SCM] gsequencer/master: Imported Upstream version 0.5.11
jkraehemann-guest at users.alioth.debian.org
jkraehemann-guest at users.alioth.debian.org
Sun Aug 9 05:49:49 UTC 2015
The following commit has been merged in the master branch:
commit 0eca28dbf0001cee261c6810d274d8c71e8ca8ad
Author: Joël Krähemann <jkraehemann-guest at users.alioth.debian.org>
Date: Sun Aug 9 07:29:15 2015 +0200
Imported Upstream version 0.5.11
diff --git a/ChangeLog b/ChangeLog
index 17498da..2e1819d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+ags (0.5.11)
+
+ [ Joël Krähemann (Maintainer of Advanced Gtk+ Sequencer) ]
+ * fixed time calculation using absolute position for AgsExportWindow and AgsNavigation
+ * fixed fundamental timing issue which caused the engine to be delayed
+
ags (0.5.10)
[ Joël Krähemann (Maintainer of Advanced Gtk+ Sequencer) ]
diff --git a/Makefile.am b/Makefile.am
index 1514773..5f7313d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = foreign
# SUBDIRS = src doc
-AM_CPPFLAGS = -I$(top_srcdir)/src -DDESTDIR=\"$(DESTDIR)$(datadir)\" -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" -D_FORTIFY_SOURCE=2 # -DAGS_USE_TIMER
+AM_CPPFLAGS = -I$(top_srcdir)/src -DDESTDIR=\"$(DESTDIR)$(datadir)\" -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" -D_FORTIFY_SOURCE=2
# what flags you want to pass to the C compiler & linker
CFLAGS = -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -ftrapv
diff --git a/Makefile.in b/Makefile.in
index 0b68aa7..8283efe 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -668,7 +668,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
# SUBDIRS = src doc
-AM_CPPFLAGS = -I$(top_srcdir)/src -DDESTDIR=\"$(DESTDIR)$(datadir)\" -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" -D_FORTIFY_SOURCE=2 # -DAGS_USE_TIMER
+AM_CPPFLAGS = -I$(top_srcdir)/src -DDESTDIR=\"$(DESTDIR)$(datadir)\" -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" -D_FORTIFY_SOURCE=2
# this lists the binaries to produce, the (non-PHONY, binary) targets in
# the previous manual Makefile
diff --git a/configure b/configure
index b13f928..0a0b971 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gsequencer 0.5.10.
+# Generated by GNU Autoconf 2.69 for gsequencer 0.5.11.
#
# Report bugs to <jkraehemann-guest at users.alioth.debian.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gsequencer'
PACKAGE_TARNAME='gsequencer'
-PACKAGE_VERSION='0.5.10'
-PACKAGE_STRING='gsequencer 0.5.10'
+PACKAGE_VERSION='0.5.11'
+PACKAGE_STRING='gsequencer 0.5.11'
PACKAGE_BUGREPORT='jkraehemann-guest at users.alioth.debian.org'
PACKAGE_URL=''
@@ -1321,7 +1321,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures gsequencer 0.5.10 to adapt to many kinds of systems.
+\`configure' configures gsequencer 0.5.11 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1391,7 +1391,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gsequencer 0.5.10:";;
+ short | recursive ) echo "Configuration of gsequencer 0.5.11:";;
esac
cat <<\_ACEOF
@@ -1531,7 +1531,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gsequencer configure 0.5.10
+gsequencer configure 0.5.11
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2008,7 +2008,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gsequencer $as_me 0.5.10, which was
+It was created by gsequencer $as_me 0.5.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2874,7 +2874,7 @@ fi
# Define the identity of the package.
PACKAGE='gsequencer'
- VERSION='0.5.10'
+ VERSION='0.5.11'
cat >>confdefs.h <<_ACEOF
@@ -7263,7 +7263,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gsequencer $as_me 0.5.10, which was
+This file was extended by gsequencer $as_me 0.5.11, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7329,7 +7329,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gsequencer config.status 0.5.10
+gsequencer config.status 0.5.11
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 204a3b3..82faa74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([gsequencer],[0.5.10],[jkraehemann-guest at users.alioth.debian.org])
+AC_INIT([gsequencer],[0.5.11],[jkraehemann-guest at users.alioth.debian.org])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
diff --git a/src/ags/X/ags_export_window_callbacks.c b/src/ags/X/ags_export_window_callbacks.c
index ef8b1fa..674ddab 100644
--- a/src/ags/X/ags_export_window_callbacks.c
+++ b/src/ags/X/ags_export_window_callbacks.c
@@ -70,9 +70,9 @@ ags_export_window_tact_callback(GtkWidget *spin_button,
window = AGS_MAIN(export_window->ags_main)->window;
gtk_label_set_text(export_window->duration,
- ags_navigation_tact_to_time_string(gtk_spin_button_get_value(export_window->tact) - 1.0,
- window->navigation->bpm->adjustment->value,
- window->devout->delay_factor));
+ ags_navigation_absolute_tact_to_time_string(gtk_spin_button_get_value(export_window->tact) * 16.0,
+ window->navigation->bpm->adjustment->value,
+ window->devout->delay_factor));
}
void
diff --git a/src/ags/X/ags_navigation.c b/src/ags/X/ags_navigation.c
index 9aae7d7..7f52392 100644
--- a/src/ags/X/ags_navigation.c
+++ b/src/ags/X/ags_navigation.c
@@ -27,6 +27,8 @@
#include <ags/thread/ags_audio_loop.h>
#include <ags/thread/ags_task_thread.h>
+#include <ags/audio/ags_config.h>
+
#include <ags/audio/task/ags_seek_devout.h>
#include <ags/X/ags_window.h>
@@ -79,6 +81,8 @@ enum{
static gpointer ags_navigation_parent_class = NULL;
static guint navigation_signals[LAST_SIGNAL];
+extern AgsConfig *config;
+
GType
ags_navigation_get_type(void)
{
@@ -496,9 +500,9 @@ ags_navigation_real_change_position(AgsNavigation *navigation,
tact_counter * AGS_PATTERN_EDIT(editor->current_edit_widget)->control_current.control_width * (16.0 / tact_factor));
}
- timestr = ags_navigation_tact_to_time_string(tact_counter,
- navigation->bpm->adjustment->value,
- window->devout->delay_factor);
+ timestr = ags_navigation_absolute_tact_to_time_string(16.0 * tact_counter,
+ navigation->bpm->adjustment->value,
+ window->devout->delay_factor);
gtk_label_set_text(navigation->position_time, timestr);
g_free(timestr);
@@ -649,6 +653,66 @@ ags_navigation_relative_tact_to_time_string(gchar *timestr,
return(timestr);
}
+gchar*
+ags_navigation_absolute_tact_to_time_string(gdouble tact,
+ gdouble bpm,
+ gdouble delay_factor)
+{
+ gchar *str;
+ guint samplerate;
+ guint buffer_size;
+ gdouble delay;
+ gdouble delay_min, delay_sec, delay_msec;
+ gchar *timestr;
+ gdouble tact_redux;
+ guint min, sec, msec;
+
+ /* retrieve some presets */
+ str = ags_config_get(config,
+ AGS_CONFIG_DEVOUT,
+ "samplerate\0");
+ samplerate = g_ascii_strtoull(str,
+ NULL,
+ 10);
+ free(str);
+
+ str = ags_config_get(config,
+ AGS_CONFIG_DEVOUT,
+ "buffer-size\0");
+ buffer_size = g_ascii_strtoull(str,
+ NULL,
+ 10);
+ free(str);
+
+ /* calculate delays */
+ delay = ((gdouble) samplerate / (gdouble) buffer_size) * (gdouble)(60.0 / bpm) * delay_factor;
+
+ delay_sec = ((bpm / delay_factor) / 60.0);
+ delay_min = delay_sec * 60.0;
+ delay_msec = delay_sec / 1000.0;
+
+ /* translate to time string */
+ tact_redux = tact;
+
+ min = (guint) floor(tact_redux / delay_min);
+
+ if(min > 0){
+ tact_redux = tact_redux - (min * delay_min);
+ }
+
+ sec = (guint) floor(tact_redux / delay_sec);
+
+ if(sec > 0){
+ tact_redux = tact_redux - (sec * delay_sec);
+ }
+
+ msec = (guint) floor(tact_redux / delay_msec);
+
+ timestr = g_strdup_printf("%.4d:%.2d.%.3d\0", min, sec, msec);
+
+ return(timestr);
+}
+
/**
* ags_navigation_set_seeking_sensitive_new:
* @navigation: the #AgsNavigation
diff --git a/src/ags/X/ags_navigation.h b/src/ags/X/ags_navigation.h
index a7d4e7a..372ace7 100644
--- a/src/ags/X/ags_navigation.h
+++ b/src/ags/X/ags_navigation.h
@@ -101,6 +101,10 @@ gchar* ags_navigation_relative_tact_to_time_string(gchar *timestr,
gdouble bpm,
gdouble delay_factor);
+gchar* ags_navigation_absolute_tact_to_time_string(gdouble tact,
+ gdouble bpm,
+ gdouble delay_factor);
+
void ags_navigation_update_time_string(double tact,
gdouble bpm,
gdouble delay_factor,
diff --git a/src/ags/audio/ags_devout.c b/src/ags/audio/ags_devout.c
index f6d4c1f..4ea0acb 100644
--- a/src/ags/audio/ags_devout.c
+++ b/src/ags/audio/ags_devout.c
@@ -1712,7 +1712,7 @@ ags_devout_alsa_play(AgsDevout *devout,
devout->delay_counter += 1.0;
///TODO:JK: fix me
- if(devout->delay_counter >= delay){ //devout->delay[devout->tic_counter]
+ if(devout->delay_counter >= floor(delay)){ //devout->delay[devout->tic_counter]
devout->tic_counter += 1;
if(devout->tic_counter == AGS_DEVOUT_DEFAULT_PERIOD){
diff --git a/src/ags/audio/task/ags_display_tact.c b/src/ags/audio/task/ags_display_tact.c
index 8218f0c..7a615bf 100644
--- a/src/ags/audio/task/ags_display_tact.c
+++ b/src/ags/audio/task/ags_display_tact.c
@@ -149,7 +149,7 @@ ags_display_tact_launch(AgsTask *task)
AgsWindow *window;
AgsNavigation *navigation;
gchar *timestr;
- gdouble tact;
+ gdouble delay, tact;
display_tact = AGS_DISPLAY_TACT(task);
@@ -160,12 +160,12 @@ ags_display_tact_launch(AgsTask *task)
tact = window->devout->tact_counter - navigation->start_tact;
gdk_window_flush(GTK_WIDGET(navigation->duration_time)->window);
- timestr = ags_navigation_relative_tact_to_time_string(navigation->duration_time->label,
- window->devout->delay[window->devout->tic_counter],
+ timestr = ags_navigation_absolute_tact_to_time_string(tact,
window->devout->bpm,
window->devout->delay_factor);
gtk_label_set_label(navigation->duration_time, timestr);
+ gtk_widget_queue_draw(navigation->duration_time);
g_free(timestr);
}
diff --git a/src/ags/audio/task/ags_seek_devout.c b/src/ags/audio/task/ags_seek_devout.c
index 40157e1..3663d5d 100644
--- a/src/ags/audio/task/ags_seek_devout.c
+++ b/src/ags/audio/task/ags_seek_devout.c
@@ -169,11 +169,15 @@ ags_seek_devout_launch(AgsTask *task)
audio = audio->next;
}
-
+
if(seek_devout->move_forward){
AGS_DEVOUT(seek_devout->devout)->tact_counter += (seek_devout->steps / AGS_DEVOUT(seek_devout->devout)->delay[AGS_DEVOUT(seek_devout->devout)->tic_counter]);
}else{
- AGS_DEVOUT(seek_devout->devout)->tact_counter -= (seek_devout->steps / AGS_DEVOUT(seek_devout->devout)->delay[AGS_DEVOUT(seek_devout->devout)->tic_counter]);
+ if( AGS_DEVOUT(seek_devout->devout)->tact_counter > (seek_devout->steps / AGS_DEVOUT(seek_devout->devout)->delay[AGS_DEVOUT(seek_devout->devout)->tic_counter])){
+ AGS_DEVOUT(seek_devout->devout)->tact_counter -= (seek_devout->steps / AGS_DEVOUT(seek_devout->devout)->delay[AGS_DEVOUT(seek_devout->devout)->tic_counter]);
+ }else{
+ AGS_DEVOUT(seek_devout->devout)->tact_counter = 0.0;
+ }
}
}
diff --git a/src/ags/thread/ags_thread-posix.c b/src/ags/thread/ags_thread-posix.c
index 9d6bca1..728f342 100644
--- a/src/ags/thread/ags_thread-posix.c
+++ b/src/ags/thread/ags_thread-posix.c
@@ -2121,7 +2121,7 @@ ags_thread_loop(void *ptr)
clock_gettime(CLOCK_MONOTONIC, &time_now);
if(time_now.tv_sec > time_prev.tv_sec){
- time_spent = (time_now.tv_nsec); // + (NSEC_PER_SEC - time_prev.tv_nsec)
+ time_spent = (time_now.tv_nsec) + (NSEC_PER_SEC - time_prev.tv_nsec);
}else{
time_spent = time_now.tv_nsec - time_prev.tv_nsec;
}
--
gsequencer packaging
More information about the pkg-multimedia-commits
mailing list