[SCM] gsequencer/master: Imported Upstream version 0.4.2-65
jkraehemann-guest at users.alioth.debian.org
jkraehemann-guest at users.alioth.debian.org
Tue Jun 16 20:38:13 UTC 2015
The following commit has been merged in the master branch:
commit 019e81919878c5d4d9be929573e5565c55eaca11
Author: Joël Krähemann <jkraehemann at gmail.com>
Date: Tue Jun 16 22:15:38 2015 +0200
Imported Upstream version 0.4.2-65
diff --git a/configure b/configure
index 2277487..5c688a1 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 ags 0.4.2-64.
+# Generated by GNU Autoconf 2.69 for ags 0.4.2-65.
#
# Report bugs to <jkraehemann at gmail.com>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ags'
PACKAGE_TARNAME='ags'
-PACKAGE_VERSION='0.4.2-64'
-PACKAGE_STRING='ags 0.4.2-64'
+PACKAGE_VERSION='0.4.2-65'
+PACKAGE_STRING='ags 0.4.2-65'
PACKAGE_BUGREPORT='jkraehemann at gmail.com'
PACKAGE_URL=''
@@ -1317,7 +1317,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 ags 0.4.2-64 to adapt to many kinds of systems.
+\`configure' configures ags 0.4.2-65 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1387,7 +1387,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ags 0.4.2-64:";;
+ short | recursive ) echo "Configuration of ags 0.4.2-65:";;
esac
cat <<\_ACEOF
@@ -1523,7 +1523,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ags configure 0.4.2-64
+ags configure 0.4.2-65
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2000,7 +2000,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 ags $as_me 0.4.2-64, which was
+It was created by ags $as_me 0.4.2-65, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2866,7 +2866,7 @@ fi
# Define the identity of the package.
PACKAGE='ags'
- VERSION='0.4.2-64'
+ VERSION='0.4.2-65'
cat >>confdefs.h <<_ACEOF
@@ -7161,7 +7161,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 ags $as_me 0.4.2-64, which was
+This file was extended by ags $as_me 0.4.2-65, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7227,7 +7227,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="\\
-ags config.status 0.4.2-64
+ags config.status 0.4.2-65
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 7126f25..4faa46c 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([ags],[0.4.2-64],[jkraehemann at gmail.com])
+AC_INIT([ags],[0.4.2-65],[jkraehemann at gmail.com])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
diff --git a/src/ags/X/ags_audio_preferences.c b/src/ags/X/ags_audio_preferences.c
index 1d5b7ce..7392bea 100644
--- a/src/ags/X/ags_audio_preferences.c
+++ b/src/ags/X/ags_audio_preferences.c
@@ -145,6 +145,9 @@ ags_audio_preferences_init(AgsAudioPreferences *audio_preferences)
GtkLabel *label;
GtkCellRenderer *cell_renderer;
+ g_signal_connect_after((GObject *) audio_preferences, "parent_set\0",
+ G_CALLBACK(ags_audio_preferences_parent_set_callback), (gpointer) audio_preferences);
+
table = (GtkTable *) gtk_table_new(2, 4, FALSE);
gtk_box_pack_start(GTK_BOX(audio_preferences),
GTK_WIDGET(table),
@@ -170,14 +173,13 @@ ags_audio_preferences_init(AgsAudioPreferences *audio_preferences)
0, 1,
GTK_FILL, GTK_FILL,
0, 0);
-
+
cell_renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(audio_preferences->card),
cell_renderer,
FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(audio_preferences->card),
cell_renderer,
- "text\0", 0,
"text\0", 1,
NULL);
gtk_combo_box_set_active(audio_preferences->card, 0);
@@ -253,8 +255,8 @@ ags_audio_preferences_connect(AgsConnectable *connectable)
audio_preferences = AGS_AUDIO_PREFERENCES(connectable);
- g_signal_connect_after(G_OBJECT(audio_preferences->card), "changed\0",
- G_CALLBACK(ags_audio_preferences_card_changed_callback), audio_preferences);
+ g_signal_connect(G_OBJECT(audio_preferences->card), "changed\0",
+ G_CALLBACK(ags_audio_preferences_card_changed_callback), audio_preferences);
}
void
@@ -282,8 +284,10 @@ ags_audio_preferences_apply(AgsApplicable *applicable)
AgsAudioPreferences *audio_preferences;
AgsConfig *config;
GList *card_id, *card_name;
- char *device;
- gchar *str;
+ GtkListStore *model;
+ GtkTreeIter current;
+ GValue value = {0,};
+ char *device, *str;
int card_num;
guint channels, channels_min, channels_max;
guint rate, rate_min, rate_max;
@@ -295,6 +299,27 @@ ags_audio_preferences_apply(AgsApplicable *applicable)
AGS_TYPE_PREFERENCES);
config = AGS_CONFIG(AGS_MAIN(AGS_WINDOW(preferences->window)->ags_main)->config);
+
+ /* device */
+ model = gtk_combo_box_get_model(audio_preferences->card);
+
+ if(!(gtk_combo_box_get_active_iter(audio_preferences->card,
+ ¤t))){
+ return;
+ }
+
+ gtk_tree_model_get_value(model,
+ ¤t,
+ 0,
+ &value);
+ str = g_strdup(g_value_get_string(&value));
+ g_message("%s\0", str);
+ ags_config_set(config,
+ AGS_CONFIG_DEVOUT,
+ "alsa-handle\0",
+ str);
+ g_free(str);
+
/* samplerate */
str = g_strdup_printf("%u\0",
(guint) gtk_spin_button_get_value(audio_preferences->samplerate));
@@ -321,12 +346,6 @@ ags_audio_preferences_apply(AgsApplicable *applicable)
"dsp-channels\0",
str);
g_free(str);
-
- /* card */
- ags_config_set(config,
- AGS_CONFIG_DEVOUT,
- "alsa-handle\0",
- gtk_combo_box_text_get_active_text(audio_preferences->card));
}
void
@@ -334,12 +353,16 @@ ags_audio_preferences_reset(AgsApplicable *applicable)
{
AgsWindow *window;
AgsPreferences *preferences;
+ AgsConfig *config;
AgsAudioPreferences *audio_preferences;
AgsDevout *devout;
GtkListStore *model;
- GtkTreeIter iter;
+ GtkTreeIter current;
GList *card_id, *card_name;
- char *device;
+ GValue value = {0,};
+ char *device, *str;
+ guint nth;
+ gboolean found_card;
int card_num;
guint channels, channels_min, channels_max;
guint rate, rate_min, rate_max;
@@ -352,28 +375,40 @@ ags_audio_preferences_reset(AgsApplicable *applicable)
preferences = (AgsPreferences *) gtk_widget_get_ancestor(GTK_WIDGET(audio_preferences),
AGS_TYPE_PREFERENCES);
window = AGS_WINDOW(preferences->window);
+ config = AGS_CONFIG(AGS_MAIN(window->ags_main)->config);
/* refresh */
- ags_devout_list_cards(&card_id, &card_name);
- model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
+ ags_devout_list_cards(&card_id, &card_name);
+ str = ags_config_get(config,
+ AGS_CONFIG_DEVOUT,
+ "alsa-handle\0");
+ nth = 0;
+ found_card = FALSE;
while(card_id != NULL){
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 0, card_id->data,
- 1, card_name->data,
- -1);
-
+ if(!g_ascii_strcasecmp(card_id->data,
+ str)){
+ found_card = TRUE;
+ }
+
+ if(!found_card){
+ nth++;
+ }
+
card_id = card_id->next;
card_name = card_name->next;
}
-
+
+ if(!found_card){
+ nth = 0;
+ }
+
+ gtk_combo_box_set_active(audio_preferences->card,
+ nth);
+
g_list_free(card_id);
g_list_free(card_name);
- gtk_combo_box_set_model(audio_preferences->card,
- GTK_TREE_MODEL(model));
-
/* */
devout = window->devout;
g_object_get(G_OBJECT(devout),
@@ -387,11 +422,6 @@ ags_audio_preferences_reset(AgsApplicable *applicable)
error = NULL;
/* */
- sscanf(device, "hw:%i\0", &card_num);
-
- // gtk_combo_box_set_active(audio_preferences->card,
- // card_num);
-
gtk_spin_button_set_value(audio_preferences->audio_channels,
(gdouble) channels);
gtk_spin_button_set_value(audio_preferences->samplerate,
@@ -400,7 +430,19 @@ ags_audio_preferences_reset(AgsApplicable *applicable)
(gdouble) buffer_size);
/* */
- ags_devout_pcm_info(gtk_combo_box_get_active_text(audio_preferences->card),
+ model = gtk_combo_box_get_model(audio_preferences->card);
+
+ if(!(gtk_combo_box_get_active_iter(audio_preferences->card,
+ ¤t))){
+ return;
+ }
+
+ gtk_tree_model_get_value(model,
+ ¤t,
+ 0,
+ &value);
+ str = g_strdup(g_value_get_string(&value));
+ ags_devout_pcm_info(str,
&channels_min, &channels_max,
&rate_min, &rate_max,
&buffer_size_min, &buffer_size_max,
diff --git a/src/ags/X/ags_audio_preferences_callbacks.c b/src/ags/X/ags_audio_preferences_callbacks.c
index f971e92..798fdd0 100644
--- a/src/ags/X/ags_audio_preferences_callbacks.c
+++ b/src/ags/X/ags_audio_preferences_callbacks.c
@@ -34,6 +34,40 @@
#include <ags/X/ags_window.h>
#include <ags/X/ags_preferences.h>
+int
+ags_audio_preferences_parent_set_callback(GtkWidget *widget, GtkObject *old_parent, AgsAudioPreferences *audio_preferences)
+{
+ GtkListStore *model;
+ GtkTreeIter iter;
+ GList *card_id, *card_name;
+
+ if(old_parent != NULL)
+ return(0);
+
+ /* refresh */
+ ags_devout_list_cards(&card_id, &card_name);
+ model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
+
+ while(card_id != NULL){
+ gtk_list_store_append(model, &iter);
+ gtk_list_store_set(model, &iter,
+ 0, card_id->data,
+ 1, card_name->data,
+ -1);
+
+ card_id = card_id->next;
+ card_name = card_name->next;
+ }
+
+ gtk_combo_box_set_model(audio_preferences->card,
+ GTK_TREE_MODEL(model));
+
+ g_list_free(card_id);
+ g_list_free(card_name);
+
+ return(0);
+}
+
void
ags_audio_preferences_card_changed_callback(GtkComboBox *combo,
AgsAudioPreferences *audio_preferences)
@@ -41,14 +75,29 @@ ags_audio_preferences_card_changed_callback(GtkComboBox *combo,
AgsWindow *window;
AgsDevout *devout;
AgsSetOutputDevice *set_output_device;
-
+ GtkListStore *model;
+ GtkTreeIter current;
+ GValue value = {0,};
+
window = AGS_WINDOW(AGS_PREFERENCES(gtk_widget_get_ancestor(GTK_WIDGET(audio_preferences),
AGS_TYPE_PREFERENCES))->window);
devout = AGS_DEVOUT(window->devout);
+ model = gtk_combo_box_get_model(audio_preferences->card);
+
+ if(!gtk_combo_box_get_active_iter(audio_preferences->card,
+ ¤t)){
+ return;
+ }
+
+ gtk_tree_model_get_value(model,
+ ¤t,
+ 0,
+ &value);
+
/* create set output device task */
set_output_device = ags_set_output_device_new((GObject *) devout,
- gtk_combo_box_get_active_text(audio_preferences->card));
+ g_strdup(g_value_get_string(&value)));
/* append AgsSetOutputDevice */
ags_task_thread_append_task(AGS_TASK_THREAD(AGS_AUDIO_LOOP(AGS_MAIN(devout->ags_main)->main_loop)->task_thread),
diff --git a/src/ags/X/ags_audio_preferences_callbacks.h b/src/ags/X/ags_audio_preferences_callbacks.h
index f3d719c..1ec9d42 100644
--- a/src/ags/X/ags_audio_preferences_callbacks.h
+++ b/src/ags/X/ags_audio_preferences_callbacks.h
@@ -23,6 +23,8 @@
#include <ags/X/ags_audio_preferences.h>
+int ags_audio_preferences_parent_set_callback(GtkWidget *widget, GtkObject *old_parent, AgsAudioPreferences *audio_preferences);
+
void ags_audio_preferences_card_changed_callback(GtkComboBox *combo,
AgsAudioPreferences *audio_preferences);
diff --git a/src/ags/audio/ags_config.c b/src/ags/audio/ags_config.c
index cba9851..1483cdb 100644
--- a/src/ags/audio/ags_config.c
+++ b/src/ags/audio/ags_config.c
@@ -223,7 +223,7 @@ ags_config_load_defaults(AgsConfig *config)
ags_config_set(config, ags_config_devout, "buffer-size\0", "940\0");
ags_config_set(config, ags_config_devout, "pcm-channels\0", "2\0");
ags_config_set(config, ags_config_devout, "dsp-channels\0", "2\0");
- ags_config_set(config, ags_config_devout, "alsa-handle\0", "hw:0,0\0");
+ ags_config_set(config, ags_config_devout, "alsa-handle\0", "hw:0\0");
ags_config_set(config, ags_config_recall, "auto-sense\0", "true\0");
}
diff --git a/src/ags/audio/ags_devout.c b/src/ags/audio/ags_devout.c
index 638cc2b..1a7182c 100644
--- a/src/ags/audio/ags_devout.c
+++ b/src/ags/audio/ags_devout.c
@@ -997,11 +997,12 @@ ags_devout_pcm_info(char *card_id,
unsigned int val;
int dir;
snd_pcm_uframes_t frames;
+ int card_num;
int err;
/* Open PCM device for playback. */
handle = NULL;
-
+
rc = snd_pcm_open(&handle, card_id, SND_PCM_STREAM_PLAYBACK, 0);
if(rc < 0) {
--
gsequencer packaging
More information about the pkg-multimedia-commits
mailing list