Update of /cvsroot/alsa/alsa-tools/hdspmixer/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8198/src
Modified Files:
HDSPMixerWindow.cxx HDSPMixerWindow.h
Log Message:
Thomas Charbonnel <[EMAIL PROTECTED]>:
- fix some problems with default presets file handling.
Index: HDSPMixerWindow.cxx
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerWindow.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HDSPMixerWindow.cxx 24 Nov 2003 18:17:05 -0000 1.4
+++ HDSPMixerWindow.cxx 27 Nov 2003 10:42:40 -0000 1.5
@@ -397,7 +397,13 @@
{
FILE *file;
if ((file = fopen(file_name, "r")) == NULL) {
+ int i = 0;
fl_alert("Error opening file %s for reading", file_name);
+ while (cards[i] != NULL) {
+ restoreDefaults(i++);
+ }
+ inputs->buttons->presets->preset_change(1);
+ return;
}
for (int speed = 0; speed < 3; ++speed) {
for (int card = 0; card < 3; ++card) {
@@ -533,6 +539,7 @@
h9632_an12_submix[2] = 1;
num_modes = 3;
phones = 0;
+ break;
default:
/* should never happen */
return;
@@ -624,8 +631,18 @@
cards[2] = hdsp_card3;
current_card = current_preset = 0;
prefs = new Fl_Preferences(Fl_Preferences::USER, "thomasATundata.org",
"HDSPMixer");
- if (!prefs->get("default_file", file_name_buffer, NULL, FL_PATH_MAX-1)) file_name
= NULL;
- else file_name = file_name_buffer;
+ if (!prefs->get("default_file", file_name_buffer, NULL, FL_PATH_MAX-1)) {
+ file_name = NULL;
+ } else {
+ struct stat buf;
+ if (!stat(file_name_buffer, &buf)) {
+ file_name = file_name_buffer;
+ } else {
+ file_name = NULL;
+ prefs->deleteEntry("default_file");
+ prefs->flush();
+ }
+ }
for (int j = 0; j < 3; ++j) {
for (int i = 0; i < 8; ++i) {
data[j][0][i] = new HDSPMixerPresetData();
Index: HDSPMixerWindow.h
===================================================================
RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerWindow.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HDSPMixerWindow.h 3 Nov 2003 19:10:39 -0000 1.2
+++ HDSPMixerWindow.h 27 Nov 2003 10:42:40 -0000 1.3
@@ -35,6 +35,9 @@
#include <stdlib.h>
#include <math.h>
#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <alsa/asoundlib.h>
#include <sound/hdsp.h>
#include "HDSPMixerCard.h"
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog