Thomas Charbonnel <thomas@undata.org>:

updated to version 1.2.
This commit is contained in:
Takashi Iwai 2003-11-03 19:09:32 +00:00
parent a66f2e98b6
commit 6498fd396f
39 changed files with 1155 additions and 158 deletions

View file

@ -0,0 +1,2 @@
Version 1.2 (01/11/2003) :
* added support for HDSP 9652 and HDSP 9632 specific features

View file

@ -1,2 +1,2 @@
HDSPConfig is a GUI to control the Hammerfall HDSP Alsa Settings. HDSPConf is a GUI to control the Hammerfall HDSP Alsa Settings.
Up to four hdsp cards are supported. Up to four hdsp cards are supported.

View file

@ -1,5 +1,5 @@
AC_INIT(src/hdspconf.cxx) AC_INIT(src/hdspconf.cxx)
AM_INIT_AUTOMAKE(hdspconf, 1.1) AM_INIT_AUTOMAKE(hdspconf, 1.2)
AC_PROG_CXX AC_PROG_CXX
AC_PROG_MAKE_SET AC_PROG_MAKE_SET

View file

@ -1,5 +1,5 @@
/* XPM */ /* XPM */
static char * alsalogo_xpm[] = { char * alsalogo_xpm[] = {
"50 50 398 2", "50 50 398 2",
" c None", " c None",
". c #C0C0C0", ". c #C0C0C0",

View file

@ -1,5 +1,5 @@
/* XPM */ /* XPM */
static char * lad_banner_xpm[] = { char * lad_banner_xpm[] = {
"113 39 1833 2", "113 39 1833 2",
" c None", " c None",
". c #C0C0C0", ". c #C0C0C0",

View file

@ -1,5 +1,5 @@
/* XPM */ /* XPM */
static char * rme_xpm[] = { char * rme_xpm[] = {
"113 35 2300 2", "113 35 2300 2",
" c None", " c None",
". c #030505", ". c #030505",

View file

@ -23,7 +23,7 @@
HC_AboutText::HC_AboutText(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "About Text") HC_AboutText::HC_AboutText(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "About Text")
{ {
text = "HDSPConf (C) 2003 Thomas Charbonnel <thomas@@undata.org>\n\n" text = "HDSPConf " VERSION " (C) 2003 Thomas Charbonnel <thomas@@undata.org>\n\n"
"This Program is free software; you can redistribute it and/or modify\n" "This Program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n" "it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation; either version 2 of the License, or\n" "the Free Software Foundation; either version 2 of the License, or\n"

94
hdspconf/src/HC_Aeb.cxx Normal file
View file

@ -0,0 +1,94 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma implementation
#include "HC_Aeb.h"
static void setAebStatus(char *ctl_name, int val, int card_index)
{
int err;
char card_name[6];
snd_ctl_elem_value_t *ctl;
snd_ctl_elem_id_t *id;
snd_ctl_t *handle;
snprintf(card_name, 6, "hw:%i", card_index);
snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id);
snd_ctl_elem_id_set_name(id, ctl_name);
snd_ctl_elem_id_set_numid(id, 0);
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_HWDEP);
snd_ctl_elem_id_set_device(id, 0);
snd_ctl_elem_id_set_subdevice(id, 0);
snd_ctl_elem_id_set_index(id, 0);
snd_ctl_elem_value_set_id(ctl, id);
snd_ctl_elem_value_set_integer(ctl, 0, val);
if ((err = snd_ctl_open(&handle, card_name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Error opening ctl interface on card %s\n", card_name);
return;
}
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
return;
}
snd_ctl_close(handle);
}
void adat_internal_cb(Fl_Widget *w, void *arg)
{
setAebStatus("Analog Extension Board", ((Fl_Check_Button *)w)->value(), ((HC_CardPane *)arg)->alsa_index);
}
HC_Aeb::HC_Aeb(int x, int y, int w, int h):Fl_Group(x, y, w, h, "AEB")
{
int i = 0;
lock = 0;
box(FL_ENGRAVED_FRAME);
label("AEB");
labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
adat_internal = new Fl_Check_Button(x+15, y, w-30, 20, "Adat1 Int.");
adat_internal->labelsize(10);
adat_internal->callback(adat_internal_cb, (void *)parent());
end();
}
void HC_Aeb::setAdatInternal(unsigned char val)
{
if (val != adat_internal->value()) {
adat_internal->value(val);
}
}
int HC_Aeb::handle(int e)
{
switch (e) {
case FL_PUSH:
lock = 1;
break;
case FL_RELEASE:
lock = 0;
break;
default:
return Fl_Group::handle(e);
}
return Fl_Group::handle(e);
}

43
hdspconf/src/HC_Aeb.h Normal file
View file

@ -0,0 +1,43 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma interface
#ifndef HC_AEB_H
#define HC_AEB_H
#include <FL/Fl_Group.H>
#include <FL/Fl_Check_Button.H>
#include <alsa/asoundlib.h>
#include "HC_CardPane.h"
class HC_CardPane;
class HC_Aeb:public Fl_Group
{
public:
HC_Aeb(int x, int y, int w, int h);
Fl_Check_Button *adat_internal;
void setAdatInternal(unsigned char val);
int handle(int e);
int lock;
};
#endif

View file

@ -21,8 +21,8 @@
#pragma implementation #pragma implementation
#include "HC_AutoSyncRef.h" #include "HC_AutoSyncRef.h"
extern char *freqs[7]; extern char *freqs[10];
extern char *ref[6]; extern char *ref[7];
HC_AutoSyncRef::HC_AutoSyncRef(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "AutoSync Ref.") HC_AutoSyncRef::HC_AutoSyncRef(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "AutoSync Ref.")
{ {
@ -69,6 +69,15 @@ void HC_AutoSyncRef::setFreq(int f)
case 96000: case 96000:
freq = 5; freq = 5;
break; break;
case 128000:
freq = 7;
break;
case 176400:
freq = 8;
break;
case 192000:
freq = 9;
break;
default: default:
freq = 6; freq = 6;
} }
@ -81,7 +90,7 @@ void HC_AutoSyncRef::setFreq(int f)
void HC_AutoSyncRef::setRef(unsigned char r) void HC_AutoSyncRef::setRef(unsigned char r)
{ {
if (r == external_ref) return; if (r == external_ref) return;
if (r > 6) external_ref = 6; if (r > 6) external_ref = 3;
else external_ref = r; else external_ref = r;
redraw(); redraw();
} }

View file

@ -0,0 +1,93 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma implementation
#include "HC_BreakoutCable.h"
static void setXlrStatus(char *ctl_name, int val, int card_index)
{
int err;
char card_name[6];
snd_ctl_elem_value_t *ctl;
snd_ctl_elem_id_t *id;
snd_ctl_t *handle;
snprintf(card_name, 6, "hw:%i", card_index);
snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id);
snd_ctl_elem_id_set_name(id, ctl_name);
snd_ctl_elem_id_set_numid(id, 0);
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_HWDEP);
snd_ctl_elem_id_set_device(id, 0);
snd_ctl_elem_id_set_subdevice(id, 0);
snd_ctl_elem_id_set_index(id, 0);
snd_ctl_elem_value_set_id(ctl, id);
snd_ctl_elem_value_set_integer(ctl, 0, val);
if ((err = snd_ctl_open(&handle, card_name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Error opening ctl interface on card %s\n", card_name);
return;
}
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
return;
}
snd_ctl_close(handle);
}
void xlr_cb(Fl_Widget *w, void *arg)
{
setXlrStatus("XLR Breakout Cable", ((Fl_Check_Button *)w)->value(), ((HC_CardPane *)arg)->alsa_index);
}
HC_BreakoutCable::HC_BreakoutCable(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Breakout Cable")
{
int i = 0;
lock = 0;
box(FL_ENGRAVED_FRAME);
label("Breakout Cable");
labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
xlr = new Fl_Check_Button(x+15, y, w-30, 20, "XLR");
xlr->labelsize(10);
xlr->callback(xlr_cb, (void *)parent());
end();
}
void HC_BreakoutCable::setXlr(unsigned char val)
{
if (val != xlr->value()) {
xlr->value(val);
}
}
int HC_BreakoutCable::handle(int e)
{
switch (e) {
case FL_PUSH:
lock = 1;
break;
case FL_RELEASE:
lock = 0;
break;
default:
return Fl_Group::handle(e);
}
return Fl_Group::handle(e);
}

View file

@ -0,0 +1,43 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma interface
#ifndef HC_BREAKOUTCABLE_H
#define HC_BREAKOUTCABLE_H
#include <FL/Fl_Group.H>
#include <FL/Fl_Check_Button.H>
#include <alsa/asoundlib.h>
#include "HC_CardPane.h"
class HC_CardPane;
class HC_BreakoutCable:public Fl_Group
{
public:
HC_BreakoutCable(int x, int y, int w, int h);
Fl_Check_Button *xlr;
void setXlr(unsigned char val);
int handle(int e);
int lock;
};
#endif

View file

@ -21,26 +21,75 @@
#pragma implementation #pragma implementation
#include "HC_CardPane.h" #include "HC_CardPane.h"
HC_CardPane::HC_CardPane(int alsa_idx, int idx, int t):Fl_Group(PANE_X, PANE_Y, PANE_W, PANE_H) extern char *card_names[5];
HC_CardPane::HC_CardPane(int alsa_idx, int idx, HDSP_IO_Type t):Fl_Group(PANE_X, PANE_Y, PANE_W, PANE_H)
{ {
alsa_index = alsa_idx; alsa_index = alsa_idx;
index = idx; index = idx;
type = t; type = t;
snprintf(name, 7, "Card %d", index+1); snprintf(name, 19, "Card %d (%s)", index+1, card_names[t]);
label(name); label(name);
labelsize(10); labelsize(10);
sync_ref = new HC_PrefSyncRef(x()+6, y()+20, 112, 120); if (type == Multiface) {
sync_check = new HC_SyncCheck(x()+6, y()+156, 112, 100); clock_source = new HC_ClockSource(x()+9, y()+20, 148, V_STEP*7);
sync_check = new HC_SyncCheck(x()+9, y()+40+V_STEP*7, 148, V_STEP*4);
spdif_in = new HC_SpdifIn(x()+124, y()+20, 112, 60); spdif_in = new HC_SpdifIn(x()+166, y()+20, 148, V_STEP*3);
spdif_out = new HC_SpdifOut(x()+124, y()+96, 112, 80); spdif_out = new HC_SpdifOut(x()+166, y()+40+V_STEP*3, 148, V_STEP*4);
spdif_freq = new HC_SpdifFreq(x()+124, y()+192, 112, 20); spdif_freq = new HC_SpdifFreq(x()+166, y()+60+V_STEP*7, 148, V_STEP);
sync_ref = new HC_PrefSyncRef(x()+323, y()+20, 148, V_STEP*4);
autosync_ref = new HC_AutoSyncRef(x()+323, y()+40+V_STEP*4, 148, V_STEP*2);
system_clock = new HC_SystemClock(x()+323, y()+60+V_STEP*6, 148, V_STEP*2);
clock_source = new HC_ClockSource(x()+242, y()+20, 112, 140); } else if (type == Digiface) {
autosync_ref = new HC_AutoSyncRef(x()+242, y()+176, 112, 40);
system_clock = new HC_SystemClock(x()+242, y()+232, 112, 40); clock_source = new HC_ClockSource(x()+9, y()+20, 148, V_STEP*7);
sync_check = new HC_SyncCheck(x()+9, y()+40+V_STEP*7, 148, V_STEP*6);
spdif_in = new HC_SpdifIn(x()+166, y()+20, 148, V_STEP*3);
spdif_out = new HC_SpdifOut(x()+166, y()+40+V_STEP*3, 148, V_STEP*4);
spdif_freq = new HC_SpdifFreq(x()+166, y()+60+V_STEP*7, 148, V_STEP);
sync_ref = new HC_PrefSyncRef(x()+323, y()+20, 148, V_STEP*6);
autosync_ref = new HC_AutoSyncRef(x()+323, y()+40+V_STEP*6, 148, V_STEP*2);
system_clock = new HC_SystemClock(x()+323, y()+60+V_STEP*8, 148, V_STEP*2);
} else if (type == H9652) {
clock_source = new HC_ClockSource(x()+9, y()+20, 148, V_STEP*7);
sync_check = new HC_SyncCheck(x()+9, y()+40+V_STEP*7, 148, V_STEP*6);
spdif_in = new HC_SpdifIn(x()+166, y()+20, 148, V_STEP*3);
spdif_out = new HC_SpdifOut(x()+166, y()+40+V_STEP*3, 148, V_STEP*4);
spdif_freq = new HC_SpdifFreq(x()+166, y()+60+V_STEP*7, 148, V_STEP);
aeb = new HC_Aeb(x()+323, y()+20, 148, V_STEP);
sync_ref = new HC_PrefSyncRef(x()+323, y()+40+V_STEP, 148, V_STEP*6);
autosync_ref = new HC_AutoSyncRef(x()+323, y()+60+V_STEP*7, 148, V_STEP*2);
system_clock = new HC_SystemClock(x()+323, y()+80+V_STEP*9, 148, V_STEP*2);
} else if (type == H9632) {
clock_source = new HC_ClockSource(x()+8, y()+20, 110, V_STEP*10);
sync_check = new HC_SyncCheck(x()+8, y()+40+V_STEP*10, 110, V_STEP*3);
spdif_in = new HC_SpdifIn(x()+126, y()+20, 110, V_STEP*4);
spdif_out = new HC_SpdifOut(x()+126, y()+40+V_STEP*4, 110, V_STEP*4);
spdif_freq = new HC_SpdifFreq(x()+126, y()+60+V_STEP*8, 110, V_STEP);
aeb = new HC_Aeb(x()+244, y()+20, 110, V_STEP);
sync_ref = new HC_PrefSyncRef(x()+244, y()+40+V_STEP, 110, V_STEP*3);
autosync_ref = new HC_AutoSyncRef(x()+244, y()+60+V_STEP*4, 110, V_STEP*2);
system_clock = new HC_SystemClock(x()+244, y()+80+V_STEP*6, 110, V_STEP*2);
breakout_cable = new HC_BreakoutCable(x()+362, y()+20, 110, V_STEP);
input_level = new HC_InputLevel(x()+362, y()+40+V_STEP, 110, V_STEP*3);
output_level = new HC_OutputLevel(x()+362, y()+60+V_STEP*4, 110, V_STEP*3);
phones = new HC_Phones(x()+362, y()+80+V_STEP*7, 110, V_STEP*3);
}
end(); end();
} }

View file

@ -23,6 +23,7 @@
#define HC_CardPane_H #define HC_CardPane_H
#include <stdio.h> #include <stdio.h>
#include <sound/hdsp.h>
#include <FL/Fl_Group.H> #include <FL/Fl_Group.H>
#include "HC_SyncCheck.h" #include "HC_SyncCheck.h"
#include "HC_SpdifFreq.h" #include "HC_SpdifFreq.h"
@ -32,6 +33,11 @@
#include "HC_SpdifIn.h" #include "HC_SpdifIn.h"
#include "HC_SpdifOut.h" #include "HC_SpdifOut.h"
#include "HC_PrefSyncRef.h" #include "HC_PrefSyncRef.h"
#include "HC_Aeb.h"
#include "HC_BreakoutCable.h"
#include "HC_InputLevel.h"
#include "HC_OutputLevel.h"
#include "HC_Phones.h"
#include "defines.h" #include "defines.h"
class HC_SyncCheck; class HC_SyncCheck;
@ -42,11 +48,16 @@ class HC_ClockSource;
class HC_SpdifIn; class HC_SpdifIn;
class HC_SpdifOut; class HC_SpdifOut;
class HC_PrefSyncRef; class HC_PrefSyncRef;
class HC_Aeb;
class HC_BreakoutCable;
class HC_InputLevel;
class HC_OutputLevel;
class HC_Phones;
class HC_CardPane:public Fl_Group class HC_CardPane:public Fl_Group
{ {
public: public:
HC_CardPane(int alsa_idx, int idx, int t); HC_CardPane(int alsa_idx, int idx, HDSP_IO_Type t);
HC_SyncCheck *sync_check; HC_SyncCheck *sync_check;
HC_SpdifFreq *spdif_freq; HC_SpdifFreq *spdif_freq;
HC_AutoSyncRef *autosync_ref; HC_AutoSyncRef *autosync_ref;
@ -55,11 +66,16 @@ public:
HC_SpdifIn *spdif_in; HC_SpdifIn *spdif_in;
HC_SpdifOut *spdif_out; HC_SpdifOut *spdif_out;
HC_PrefSyncRef *sync_ref; HC_PrefSyncRef *sync_ref;
HC_Aeb *aeb;
HC_BreakoutCable *breakout_cable;
HC_InputLevel *input_level;
HC_OutputLevel *output_level;
HC_Phones *phones;
int index; int index;
int alsa_index; int alsa_index;
int type; HDSP_IO_Type type;
private: private:
char name[7]; char name[19];
}; };
#endif #endif

View file

@ -21,7 +21,7 @@
#pragma implementation #pragma implementation
#include "HC_ClockSource.h" #include "HC_ClockSource.h"
extern char *freqs[7]; extern char *freqs[10];
void clock_source_cb(Fl_Widget *w, void *arg) void clock_source_cb(Fl_Widget *w, void *arg)
{ {
@ -47,7 +47,14 @@ void clock_source_cb(Fl_Widget *w, void *arg)
src = 5; src = 5;
} else if (source == cs->khz96) { } else if (source == cs->khz96) {
src = 6; src = 6;
} else if (source == cs->khz128) {
src = 7;
} else if (source == cs->khz176_4) {
src = 8;
} else if (source == cs->khz192) {
src = 9;
} }
snprintf(card_name, 6, "hw:%i", pane->alsa_index); snprintf(card_name, 6, "hw:%i", pane->alsa_index);
snd_ctl_elem_value_alloca(&ctl); snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id); snd_ctl_elem_id_alloca(&id);
@ -73,25 +80,38 @@ void clock_source_cb(Fl_Widget *w, void *arg)
HC_ClockSource::HC_ClockSource(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Sample Clock Source") HC_ClockSource::HC_ClockSource(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Sample Clock Source")
{ {
int i = 0; int i = 0;
int v_step = (int)(h/7.0f);
box(FL_ENGRAVED_FRAME); box(FL_ENGRAVED_FRAME);
label("Sample Clock Source"); label("Sample Clock Source");
labelsize(10); labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT); align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
autosync = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "AutoSync"); autosync = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "AutoSync");
autosync->callback(clock_source_cb, (void *)this); autosync->callback(clock_source_cb, (void *)this);
khz32 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, freqs[0]); khz32 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[0]);
khz32->callback(clock_source_cb, (void *)this); khz32->callback(clock_source_cb, (void *)this);
khz44_1 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, freqs[1]); khz44_1 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[1]);
khz44_1->callback(clock_source_cb, (void *)this); khz44_1->callback(clock_source_cb, (void *)this);
khz48 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, freqs[2]); khz48 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[2]);
khz48->callback(clock_source_cb, (void *)this); khz48->callback(clock_source_cb, (void *)this);
khz64 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, freqs[3]); khz64 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[3]);
khz64->callback(clock_source_cb, (void *)this); khz64->callback(clock_source_cb, (void *)this);
khz88_2 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, freqs[4]); khz88_2 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[4]);
khz88_2->callback(clock_source_cb, (void *)this); khz88_2->callback(clock_source_cb, (void *)this);
khz96 = new Fl_Round_Button(x+15, y+v_step*i, w-30, v_step, freqs[5]); khz96 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[5]);
khz96->callback(clock_source_cb, (void *)this); khz96->callback(clock_source_cb, (void *)this);
if (((HC_CardPane *)parent())->type == H9632) {
khz128 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[7]);
khz128->callback(clock_source_cb, (void *)this);
khz128->labelsize(10);
khz128->type(FL_RADIO_BUTTON);
khz176_4 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[8]);
khz176_4->callback(clock_source_cb, (void *)this);
khz176_4->labelsize(10);
khz176_4->type(FL_RADIO_BUTTON);
khz192 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, freqs[9]);
khz192->callback(clock_source_cb, (void *)this);
khz192->labelsize(10);
khz192->type(FL_RADIO_BUTTON);
}
autosync->labelsize(10); autosync->labelsize(10);
autosync->type(FL_RADIO_BUTTON); autosync->type(FL_RADIO_BUTTON);
khz32->labelsize(10); khz32->labelsize(10);

View file

@ -33,7 +33,6 @@ class HC_ClockSource:public Fl_Group
{ {
public: public:
HC_ClockSource(int x, int y, int w, int h); HC_ClockSource(int x, int y, int w, int h);
int source;
Fl_Round_Button *autosync; Fl_Round_Button *autosync;
Fl_Round_Button *khz32; Fl_Round_Button *khz32;
Fl_Round_Button *khz44_1; Fl_Round_Button *khz44_1;
@ -41,6 +40,9 @@ public:
Fl_Round_Button *khz64; Fl_Round_Button *khz64;
Fl_Round_Button *khz88_2; Fl_Round_Button *khz88_2;
Fl_Round_Button *khz96; Fl_Round_Button *khz96;
Fl_Round_Button *khz128;
Fl_Round_Button *khz176_4;
Fl_Round_Button *khz192;
void setSource(unsigned char s); void setSource(unsigned char s);
}; };

View file

@ -0,0 +1,103 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma implementation
#include "HC_InputLevel.h"
void input_level_cb(Fl_Widget *w, void *arg)
{
int gain, err;
char card_name[6];
snd_ctl_elem_value_t *ctl;
snd_ctl_elem_id_t *id;
snd_ctl_t *handle;
Fl_Round_Button *source = (Fl_Round_Button *)w;
HC_InputLevel *il = (HC_InputLevel *)arg;
HC_CardPane *pane = (HC_CardPane *)il->parent();
if (source == il->lo_gain) {
gain = 2;
} else if (source == il->plus_four_dbu) {
gain = 1;
} else if (source == il->minus_ten_dbv) {
gain = 0;
}
snprintf(card_name, 6, "hw:%i", pane->alsa_index);
snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id);
snd_ctl_elem_id_set_name(id, "AD Gain");
snd_ctl_elem_id_set_numid(id, 0);
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_HWDEP);
snd_ctl_elem_id_set_device(id, 0);
snd_ctl_elem_id_set_subdevice(id, 0);
snd_ctl_elem_id_set_index(id, 0);
snd_ctl_elem_value_set_id(ctl, id);
snd_ctl_elem_value_set_enumerated(ctl, 0, gain);
if ((err = snd_ctl_open(&handle, card_name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Error opening ctl interface on card %s\n", card_name);
return;
}
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
return;
}
snd_ctl_close(handle);
}
HC_InputLevel::HC_InputLevel(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Input Level")
{
int i = 0;
int v_step = (int)(h/3.0f);
box(FL_ENGRAVED_FRAME);;
label("Input Level");
labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
lo_gain = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "Lo Gain");
plus_four_dbu = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "+4 dBu");
minus_ten_dbv = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "-10 dBV");
lo_gain->labelsize(10);
lo_gain->type(FL_RADIO_BUTTON);
lo_gain->callback(input_level_cb, (void *)this);
plus_four_dbu->labelsize(10);
plus_four_dbu->type(FL_RADIO_BUTTON);
plus_four_dbu->callback(input_level_cb, (void *)this);
minus_ten_dbv->labelsize(10);
minus_ten_dbv->type(FL_RADIO_BUTTON);
minus_ten_dbv->callback(input_level_cb, (void *)this);
end();
}
void HC_InputLevel::setInputLevel(unsigned char i)
{
switch (i) {
case 0:
if (minus_ten_dbv->value() != 1)
minus_ten_dbv->setonly();
break;
case 1:
if (plus_four_dbu->value() != 1)
plus_four_dbu->setonly();
break;
case 2:
if (lo_gain->value() != 1)
lo_gain->setonly();
break;
}
}

View file

@ -0,0 +1,44 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma interface
#ifndef HC_INPUTLEVEL_H
#define HC_INPUTLEVEL_H
#include <FL/Fl_Group.H>
#include <FL/Fl_Round_Button.H>
#include <alsa/asoundlib.h>
#include "HC_CardPane.h"
class HC_CardPane;
class HC_InputLevel:public Fl_Group
{
public:
HC_InputLevel(int x, int y, int w, int h);
int source;
Fl_Round_Button *lo_gain;
Fl_Round_Button *plus_four_dbu;
Fl_Round_Button *minus_ten_dbv;
void setInputLevel(unsigned char i);
};
#endif

View file

@ -0,0 +1,93 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma implementation
#include "HC_OutputLevel.h"
void output_level_cb(Fl_Widget *w, void *arg)
{
int gain, err;
char card_name[6];
snd_ctl_elem_value_t *ctl;
snd_ctl_elem_id_t *id;
snd_ctl_t *handle;
Fl_Round_Button *source = (Fl_Round_Button *)w;
HC_OutputLevel *ol = (HC_OutputLevel *)arg;
HC_CardPane *pane = (HC_CardPane *)ol->parent();
if (source == ol->hi_gain) {
gain = 0;
} else if (source == ol->plus_four_dbu) {
gain = 1;
} else if (source == ol->minus_ten_dbv) {
gain = 2;
}
snprintf(card_name, 6, "hw:%i", pane->alsa_index);
snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id);
snd_ctl_elem_id_set_name(id, "DA Gain");
snd_ctl_elem_id_set_numid(id, 0);
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_HWDEP);
snd_ctl_elem_id_set_device(id, 0);
snd_ctl_elem_id_set_subdevice(id, 0);
snd_ctl_elem_id_set_index(id, 0);
snd_ctl_elem_value_set_id(ctl, id);
snd_ctl_elem_value_set_enumerated(ctl, 0, gain);
if ((err = snd_ctl_open(&handle, card_name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Error opening ctl interface on card %s\n", card_name);
return;
}
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
return;
}
snd_ctl_close(handle);
}
HC_OutputLevel::HC_OutputLevel(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Output Level")
{
int i = 0;
int v_step = (int)(h/3.0f);
box(FL_ENGRAVED_FRAME);;
label("Output Level");
labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
hi_gain = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "Hi Gain");
plus_four_dbu = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "+4 dBu");
minus_ten_dbv = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "-10 dBV");
hi_gain->labelsize(10);
hi_gain->type(FL_RADIO_BUTTON);
hi_gain->callback(output_level_cb, (void *)this);
plus_four_dbu->labelsize(10);
plus_four_dbu->type(FL_RADIO_BUTTON);
plus_four_dbu->callback(output_level_cb, (void *)this);
minus_ten_dbv->labelsize(10);
minus_ten_dbv->type(FL_RADIO_BUTTON);
minus_ten_dbv->callback(output_level_cb, (void *)this);
end();
}
void HC_OutputLevel::setOutputLevel(unsigned char i)
{
if (i < children()) {
if (((Fl_Round_Button *)child(i))->value() !=1)
((Fl_Round_Button *)child(i))->setonly();
}
}

View file

@ -0,0 +1,43 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma interface
#ifndef HC_OUTPUTLEVEL_H
#define HC_OUTPUTLEVEL_H
#include <FL/Fl_Group.H>
#include <FL/Fl_Round_Button.H>
#include <alsa/asoundlib.h>
#include "HC_CardPane.h"
class HC_CardPane;
class HC_OutputLevel:public Fl_Group
{
public:
HC_OutputLevel(int x, int y, int w, int h);
Fl_Round_Button *hi_gain;
Fl_Round_Button *plus_four_dbu;
Fl_Round_Button *minus_ten_dbv;
void setOutputLevel(unsigned char i);
};
#endif

View file

@ -0,0 +1,93 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma implementation
#include "HC_Phones.h"
void phones_cb(Fl_Widget *w, void *arg)
{
int gain, err;
char card_name[6];
snd_ctl_elem_value_t *ctl;
snd_ctl_elem_id_t *id;
snd_ctl_t *handle;
Fl_Round_Button *source = (Fl_Round_Button *)w;
HC_Phones *ph = (HC_Phones *)arg;
HC_CardPane *pane = (HC_CardPane *)ph->parent();
if (source == ph->zero_db) {
gain = 0;
} else if (source == ph->minus_six_db) {
gain = 1;
} else if (source == ph->minus_twelve_db) {
gain = 2;
}
snprintf(card_name, 6, "hw:%i", pane->alsa_index);
snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id);
snd_ctl_elem_id_set_name(id, "Phones Gain");
snd_ctl_elem_id_set_numid(id, 0);
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_HWDEP);
snd_ctl_elem_id_set_device(id, 0);
snd_ctl_elem_id_set_subdevice(id, 0);
snd_ctl_elem_id_set_index(id, 0);
snd_ctl_elem_value_set_id(ctl, id);
snd_ctl_elem_value_set_enumerated(ctl, 0, gain);
if ((err = snd_ctl_open(&handle, card_name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Error opening ctl interface on card %s\n", card_name);
return;
}
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
return;
}
snd_ctl_close(handle);
}
HC_Phones::HC_Phones(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Phones")
{
int i = 0;
int v_step = (int)(h/3.0f);
box(FL_ENGRAVED_FRAME);;
label("Phones");
labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
zero_db = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "Hi Gain");
minus_six_db = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "+4 dBu");
minus_twelve_db = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "-10 dBV");
zero_db->labelsize(10);
zero_db->type(FL_RADIO_BUTTON);
zero_db->callback(phones_cb, (void *)this);
minus_six_db->labelsize(10);
minus_six_db->type(FL_RADIO_BUTTON);
minus_six_db->callback(phones_cb, (void *)this);
minus_twelve_db->labelsize(10);
minus_twelve_db->type(FL_RADIO_BUTTON);
minus_twelve_db->callback(phones_cb, (void *)this);
end();
}
void HC_Phones::setPhones(unsigned char i)
{
if (i < children()) {
if (((Fl_Round_Button *)child(i))->value() != 1)
((Fl_Round_Button *)child(i))->setonly();
}
}

43
hdspconf/src/HC_Phones.h Normal file
View file

@ -0,0 +1,43 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma interface
#ifndef HC_PHONES_H
#define HC_PHONES_H
#include <FL/Fl_Group.H>
#include <FL/Fl_Round_Button.H>
#include <alsa/asoundlib.h>
#include "HC_CardPane.h"
class HC_CardPane;
class HC_Phones:public Fl_Group
{
public:
HC_Phones(int x, int y, int w, int h);
Fl_Round_Button *zero_db;
Fl_Round_Button *minus_six_db;
Fl_Round_Button *minus_twelve_db;
void setPhones(unsigned char i);
};
#endif

View file

@ -33,11 +33,11 @@ void pref_sync_ref_cb(Fl_Widget *w, void *arg)
Fl_Round_Button *source = (Fl_Round_Button *)w; Fl_Round_Button *source = (Fl_Round_Button *)w;
if (source == psr->word_clock) { if (source == psr->word_clock) {
ref = 0; ref = 0;
} else if (source == psr->adat_sync) {
ref = 1;
} else if (source == psr->spdif) { } else if (source == psr->spdif) {
ref = 2; ref = 1;
} else if (source == psr->adat1) { } else if (source == psr->adat1) {
ref = 2;
} else if (source == psr->adat_sync) {
ref = 3; ref = 3;
} else if (source == psr->adat2) { } else if (source == psr->adat2) {
ref = 4; ref = 4;
@ -70,31 +70,33 @@ void pref_sync_ref_cb(Fl_Widget *w, void *arg)
HC_PrefSyncRef::HC_PrefSyncRef(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Pref. Sync Ref") HC_PrefSyncRef::HC_PrefSyncRef(int x, int y, int w, int h):Fl_Group(x, y, w, h, "Pref. Sync Ref")
{ {
int i = 0; int i = 0;
int v_step; if (((HC_CardPane *)parent())->type == Multiface || ((HC_CardPane *)parent())->type == H9632) {
if (((HC_CardPane *)parent())->type == MULTIFACE) { adat_name = "ADAT In";
v_step = (int)(h/4.0f);
} else { } else {
v_step = (int)(h/6.0f); adat_name = "ADAT1 In";
} }
source = 0;
box(FL_ENGRAVED_FRAME);; box(FL_ENGRAVED_FRAME);;
label("Pref. Sync Ref"); label("Pref. Sync Ref");
labelsize(10); labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT); align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
word_clock = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "Word Clock"); word_clock = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "Word Clock");
word_clock->callback(pref_sync_ref_cb, (void *)this); word_clock->callback(pref_sync_ref_cb, (void *)this);
adat_sync = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "ADAT Sync"); if (((HC_CardPane *)parent())->type != H9632) {
adat_sync->callback(pref_sync_ref_cb, (void *)this); adat_sync = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "ADAT Sync");
spdif = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "SPDIF In"); adat_sync->callback(pref_sync_ref_cb, (void *)this);
adat_sync->labelsize(10);
adat_sync->type(FL_RADIO_BUTTON);
}
spdif = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "SPDIF In");
spdif->callback(pref_sync_ref_cb, (void *)this); spdif->callback(pref_sync_ref_cb, (void *)this);
adat1 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "ADAT1 In"); adat1 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, adat_name);
adat1->callback(pref_sync_ref_cb, (void *)this); adat1->callback(pref_sync_ref_cb, (void *)this);
if (((HC_CardPane *)parent())->type != MULTIFACE) { if (((HC_CardPane *)parent())->type != Multiface && ((HC_CardPane *)parent())->type != H9632) {
adat2 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "ADAT2 In"); adat2 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "ADAT2 In");
adat2->labelsize(10); adat2->labelsize(10);
adat2->type(FL_RADIO_BUTTON); adat2->type(FL_RADIO_BUTTON);
adat2->callback(pref_sync_ref_cb, (void *)this); adat2->callback(pref_sync_ref_cb, (void *)this);
adat3 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "ADAT3 In"); adat3 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "ADAT3 In");
adat3->labelsize(10); adat3->labelsize(10);
adat3->type(FL_RADIO_BUTTON); adat3->type(FL_RADIO_BUTTON);
adat3->callback(pref_sync_ref_cb, (void *)this); adat3->callback(pref_sync_ref_cb, (void *)this);
@ -105,16 +107,39 @@ HC_PrefSyncRef::HC_PrefSyncRef(int x, int y, int w, int h):Fl_Group(x, y, w, h,
spdif->type(FL_RADIO_BUTTON); spdif->type(FL_RADIO_BUTTON);
word_clock->labelsize(10); word_clock->labelsize(10);
word_clock->type(FL_RADIO_BUTTON); word_clock->type(FL_RADIO_BUTTON);
adat_sync->labelsize(10);
adat_sync->type(FL_RADIO_BUTTON);
end(); end();
} }
void HC_PrefSyncRef::setRef(int r) void HC_PrefSyncRef::setRef(int r)
{ {
if (r >= 0 && r < children()) { switch (r) {
if (((Fl_Round_Button *)child(r))->value() != 1) case 0:
((Fl_Round_Button *)child(r))->setonly(); if (word_clock->value() != 1)
word_clock->setonly();
break;
case 1:
if (spdif->value() != 1)
spdif->setonly();
break;
case 2:
if (adat1->value() != 1)
adat1->setonly();
break;
case 3:
if (((HC_CardPane *)parent())->type != H9632)
if (adat_sync->value() != 1)
adat_sync->setonly();
break;
case 4:
if (((HC_CardPane *)parent())->type == H9652 || ((HC_CardPane *)parent())->type == Digiface)
if (adat2->value() != 1)
adat2->setonly();
break;
case 5:
if (((HC_CardPane *)parent())->type == H9652 || ((HC_CardPane *)parent())->type == Digiface)
if (adat3->value() != 1)
adat3->setonly();
break;
} }
} }

View file

@ -41,6 +41,8 @@ public:
Fl_Round_Button *word_clock; Fl_Round_Button *word_clock;
Fl_Round_Button *adat_sync; Fl_Round_Button *adat_sync;
void setRef(int r); void setRef(int r);
private:
char *adat_name;
}; };
#endif #endif

View file

@ -21,7 +21,7 @@
#pragma implementation #pragma implementation
#include "HC_SpdifFreq.h" #include "HC_SpdifFreq.h"
extern char *freqs[7]; extern char *freqs[10];
HC_SpdifFreq::HC_SpdifFreq(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "SPDIF Freq.") HC_SpdifFreq::HC_SpdifFreq(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "SPDIF Freq.")
{ {
@ -64,6 +64,15 @@ void HC_SpdifFreq::setFreq(int f)
case 96000: case 96000:
freq = 5; freq = 5;
break; break;
case 128000:
freq = 7;
break;
case 176400:
freq = 8;
break;
case 192000:
freq = 9;
break;
default: default:
freq = 6; freq = 6;
} }

View file

@ -37,6 +37,8 @@ void spdif_in_cb(Fl_Widget *w, void *arg)
in = 1; in = 1;
} else if (source == si->internal) { } else if (source == si->internal) {
in = 2; in = 2;
} else if (source == si->aes) {
in = 3;
} }
snprintf(card_name, 6, "hw:%i", pane->alsa_index); snprintf(card_name, 6, "hw:%i", pane->alsa_index);
snd_ctl_elem_value_alloca(&ctl); snd_ctl_elem_value_alloca(&ctl);
@ -63,15 +65,19 @@ void spdif_in_cb(Fl_Widget *w, void *arg)
HC_SpdifIn::HC_SpdifIn(int x, int y, int w, int h):Fl_Group(x, y, w, h, "SPDIF In") HC_SpdifIn::HC_SpdifIn(int x, int y, int w, int h):Fl_Group(x, y, w, h, "SPDIF In")
{ {
int i = 0; int i = 0;
int v_step = (int)(h/3.0f);
source = 0;
box(FL_ENGRAVED_FRAME);; box(FL_ENGRAVED_FRAME);;
label("SPDIF In"); label("SPDIF In");
labelsize(10); labelsize(10);
align(FL_ALIGN_TOP|FL_ALIGN_LEFT); align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
adat1 = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "ADAT1"); adat1 = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "Optical");
coaxial = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "Coaxial"); coaxial = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "Coaxial");
internal = new Fl_Round_Button(x+15, y+v_step*i++, w-30, v_step, "Internal"); internal = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "Internal");
if (((HC_CardPane *)parent())->type == H9632) {
aes = new Fl_Round_Button(x+10, y+V_STEP*i++, w-20, V_STEP, "AES");
aes->labelsize(10);
aes->type(FL_RADIO_BUTTON);
aes->callback(spdif_in_cb, (void *)this);
}
adat1->labelsize(10); adat1->labelsize(10);
adat1->type(FL_RADIO_BUTTON); adat1->type(FL_RADIO_BUTTON);
adat1->callback(spdif_in_cb, (void *)this); adat1->callback(spdif_in_cb, (void *)this);

View file

@ -37,6 +37,7 @@ public:
Fl_Round_Button *adat1; Fl_Round_Button *adat1;
Fl_Round_Button *coaxial; Fl_Round_Button *coaxial;
Fl_Round_Button *internal; Fl_Round_Button *internal;
Fl_Round_Button *aes;
void setInput(unsigned char i); void setInput(unsigned char i);
}; };

View file

@ -31,10 +31,10 @@ HC_SyncCheck::HC_SyncCheck(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "Sy
wordclock_lock_status = -1; wordclock_lock_status = -1;
adatsync_lock_status = -1; adatsync_lock_status = -1;
spdif_lock_status = -1; spdif_lock_status = -1;
if (((HC_CardPane *)parent())->type == MULTIFACE) { if (((HC_CardPane *)parent())->type == Multiface || ((HC_CardPane *)parent())->type == H9632) {
v_step = (int)(h/4.0f); adat_name = "ADAT In";
} else { } else {
v_step = (int)(h/6.0f); adat_name = "ADAT1 In";
} }
h_step = (int)(w/2.0f); h_step = (int)(w/2.0f);
draw_box = Fl::get_boxtype(FL_ENGRAVED_FRAME); draw_box = Fl::get_boxtype(FL_ENGRAVED_FRAME);
@ -45,7 +45,6 @@ HC_SyncCheck::HC_SyncCheck(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "Sy
void HC_SyncCheck::draw() void HC_SyncCheck::draw()
{ {
int v_pos = v_step;
int h_pos = 4; int h_pos = 4;
int i = 0; int i = 0;
fl_color(FL_BACKGROUND_COLOR); fl_color(FL_BACKGROUND_COLOR);
@ -53,20 +52,22 @@ void HC_SyncCheck::draw()
draw_box(x(), y(), w(), h(), FL_WHITE); draw_box(x(), y(), w(), h(), FL_WHITE);
fl_color(FL_BLACK); fl_color(FL_BLACK);
fl_font(FL_HELVETICA, 10); fl_font(FL_HELVETICA, 10);
fl_draw("ADAT1 In", x()+h_pos, y()+v_pos*i, h_step, v_step, FL_ALIGN_LEFT); fl_draw(adat_name, x()+h_pos, y()+V_STEP*i, h_step, V_STEP, FL_ALIGN_LEFT);
fl_draw(lock_status[adat1_lock_status], x()+h_pos+h_step, y()+v_pos*i++, h_step-h_pos, v_step, FL_ALIGN_CENTER); fl_draw(lock_status[adat1_lock_status], x()+h_pos+h_step, y()+V_STEP*i++, h_step-h_pos, V_STEP, FL_ALIGN_CENTER);
if (((HC_CardPane *)parent())->type != MULTIFACE) { if (((HC_CardPane *)parent())->type == Digiface || ((HC_CardPane *)parent())->type == H9652) {
fl_draw("ADAT2 In", x()+h_pos, y()+v_pos*i, h_step, v_step, FL_ALIGN_LEFT); fl_draw("ADAT2 In", x()+h_pos, y()+V_STEP*i, h_step, V_STEP, FL_ALIGN_LEFT);
fl_draw(lock_status[adat2_lock_status], x()+h_pos+h_step, y()+v_pos*i++, h_step-h_pos, v_step, FL_ALIGN_CENTER); fl_draw(lock_status[adat2_lock_status], x()+h_pos+h_step, y()+V_STEP*i++, h_step-h_pos, V_STEP, FL_ALIGN_CENTER);
fl_draw("ADAT3 In", x()+h_pos, y()+v_pos*i, h_step, v_step, FL_ALIGN_LEFT); fl_draw("ADAT3 In", x()+h_pos, y()+V_STEP*i, h_step, V_STEP, FL_ALIGN_LEFT);
fl_draw(lock_status[adat3_lock_status], x()+h_pos+h_step, y()+v_pos*i++, h_step-h_pos, v_step, FL_ALIGN_CENTER); fl_draw(lock_status[adat3_lock_status], x()+h_pos+h_step, y()+V_STEP*i++, h_step-h_pos, V_STEP, FL_ALIGN_CENTER);
}
fl_draw("SPDIF In", x()+h_pos, y()+V_STEP*i, h_step, V_STEP, FL_ALIGN_LEFT);
fl_draw(lock_status[spdif_lock_status], x()+h_pos+h_step, y()+V_STEP*i++, h_step-h_pos, V_STEP, FL_ALIGN_CENTER);
fl_draw("WordClock", x()+h_pos, y()+V_STEP*i, h_step, V_STEP, FL_ALIGN_LEFT);
fl_draw(lock_status[wordclock_lock_status], x()+h_pos+h_step, y()+V_STEP*i++, h_step-h_pos, V_STEP, FL_ALIGN_CENTER);
if (((HC_CardPane *)parent())->type != H9632) {
fl_draw("ADAT Sync", x()+h_pos, y()+V_STEP*i, h_step, V_STEP, FL_ALIGN_LEFT);
fl_draw(lock_status[adatsync_lock_status], x()+h_pos+h_step, y()+V_STEP*i, h_step-h_pos, V_STEP, FL_ALIGN_CENTER);
} }
fl_draw("SPDIF In", x()+h_pos, y()+v_pos*i, h_step, v_step, FL_ALIGN_LEFT);
fl_draw(lock_status[spdif_lock_status], x()+h_pos+h_step, y()+v_pos*i++, h_step-h_pos, v_step, FL_ALIGN_CENTER);
fl_draw("WordClock", x()+h_pos, y()+v_pos*i, h_step, v_step, FL_ALIGN_LEFT);
fl_draw(lock_status[wordclock_lock_status], x()+h_pos+h_step, y()+v_pos*i++, h_step-h_pos, v_step, FL_ALIGN_CENTER);
fl_draw("ADAT Sync", x()+h_pos, y()+v_pos*i, h_step, v_step, FL_ALIGN_LEFT);
fl_draw(lock_status[adatsync_lock_status], x()+h_pos+h_step, y()+v_pos*i, h_step-h_pos, v_step, FL_ALIGN_CENTER);
} }
void HC_SyncCheck::setSpdifStatus(unsigned char s) void HC_SyncCheck::setSpdifStatus(unsigned char s)

View file

@ -51,7 +51,8 @@ public:
void setAdatSyncStatus(unsigned char s); void setAdatSyncStatus(unsigned char s);
void setWCStatus(unsigned char s); void setWCStatus(unsigned char s);
private: private:
int v_step, h_step; char *adat_name;
int h_step;
Fl_Box_Draw_F *draw_box; Fl_Box_Draw_F *draw_box;
}; };

View file

@ -21,7 +21,7 @@
#pragma implementation #pragma implementation
#include "HC_SystemClock.h" #include "HC_SystemClock.h"
extern char *freqs[7]; extern char *freqs[10];
HC_SystemClock::HC_SystemClock(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "System Clock") HC_SystemClock::HC_SystemClock(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "System Clock")
{ {
@ -77,6 +77,15 @@ void HC_SystemClock::setFreq(int f)
case 96000: case 96000:
freq = 5; freq = 5;
break; break;
case 128000:
freq = 7;
break;
case 176400:
freq = 8;
break;
case 192000:
freq = 9;
break;
default: default:
freq = 6; freq = 6;
} }

View file

@ -25,6 +25,7 @@
#include <FL/Fl_Widget.H> #include <FL/Fl_Widget.H>
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <FL/Fl.H> #include <FL/Fl.H>
#include "pixmaps.h"
class HC_XpmRenderer:public Fl_Widget class HC_XpmRenderer:public Fl_Widget
{ {

View file

@ -20,7 +20,19 @@ hdspconf_SOURCES = \
HC_SpdifOut.h \ HC_SpdifOut.h \
HC_PrefSyncRef.cxx \ HC_PrefSyncRef.cxx \
HC_PrefSyncRef.h \ HC_PrefSyncRef.h \
HC_Aeb.cxx \
HC_Aeb.h \
HC_BreakoutCable.cxx \
HC_BreakoutCable.h \
HC_InputLevel.cxx \
HC_InputLevel.h \
HC_OutputLevel.cxx \
HC_OutputLevel.h \
HC_Phones.cxx \
HC_Phones.h \
HC_XpmRenderer.cxx \ HC_XpmRenderer.cxx \
HC_XpmRenderer.h \ HC_XpmRenderer.h \
HC_AboutText.cxx \ HC_AboutText.cxx \
HC_AboutText.h HC_AboutText.h \
pixmaps.cxx \
pixmaps.h

View file

@ -21,22 +21,20 @@
#ifndef DEFINES_H #ifndef DEFINES_H
#define DEFINES_H #define DEFINES_H
#define MULTIFACE 0 #define WINDOW_WIDTH 500
#define DIGIFACE 1 #define WINDOW_HEIGHT 400
#define HDSP9652 2
#define WINDOW_WIDTH 380
#define WINDOW_HEIGHT 330
#define TABS_X 10 #define TABS_X 10
#define TABS_Y 10 #define TABS_Y 10
#define TABS_W 360 #define TABS_W 480
#define TABS_H 310 #define TABS_H 380
#define PANE_X 10 #define PANE_X 10
#define PANE_Y 30 #define PANE_Y 30
#define PANE_H 290 #define PANE_W 480
#define PANE_W 360 #define PANE_H 360
#define V_STEP 24
#endif #endif

View file

@ -31,25 +31,35 @@
#include <FL/Fl_Tabs.H> #include <FL/Fl_Tabs.H>
#include "HC_CardPane.h" #include "HC_CardPane.h"
#include "HC_XpmRenderer.h" #include "HC_XpmRenderer.h"
#include "pixmaps.h"
#include "HC_AboutText.h" #include "HC_AboutText.h"
#include "defines.h" #include "defines.h"
#include "../pixmaps/rme.xpm" //#define GUI_TEST
#include "../pixmaps/alsalogo.xpm"
#include "../pixmaps/lad_banner.xpm"
class HC_CardPane; class HC_CardPane;
class HC_XpmRenderer; class HC_XpmRenderer;
class HC_AboutText; class HC_AboutText;
char *freqs[7] = { char *card_names[5] = {
"Digiface",
"Multiface",
"HDSP9652",
"HDSP9632",
"Undefined",
};
char *freqs[10] = {
"32.0 kHz", "32.0 kHz",
"44.1 kHz", "44.1 kHz",
"48.0 kHz", "48.0 kHz",
"64.0 kHz", "64.0 kHz",
"88.2 kHz", "88.2 kHz",
"96.0 kHz", "96.0 kHz",
"-----" "-----",
"128.0 kHz",
"176.4 kHz",
"192.0 kHz",
}; };
char *ref[7] = { char *ref[7] = {
@ -101,8 +111,10 @@ static void refresh_cb(void *arg)
pane->sync_check->setAdat1Status(config_info.adat_sync_check[0]); pane->sync_check->setAdat1Status(config_info.adat_sync_check[0]);
pane->sync_check->setSpdifStatus(config_info.spdif_sync_check); pane->sync_check->setSpdifStatus(config_info.spdif_sync_check);
pane->sync_check->setWCStatus(config_info.wordclock_sync_check); pane->sync_check->setWCStatus(config_info.wordclock_sync_check);
pane->sync_check->setAdatSyncStatus(config_info.adatsync_sync_check); if (pane->type != H9632) {
if (pane->type != MULTIFACE) { pane->sync_check->setAdatSyncStatus(config_info.adatsync_sync_check);
}
if (pane->type == Digiface || pane->type == H9652) {
pane->sync_check->setAdat2Status(config_info.adat_sync_check[1]); pane->sync_check->setAdat2Status(config_info.adat_sync_check[1]);
pane->sync_check->setAdat3Status(config_info.adat_sync_check[2]); pane->sync_check->setAdat3Status(config_info.adat_sync_check[2]);
} }
@ -118,6 +130,15 @@ static void refresh_cb(void *arg)
pane->autosync_ref->setFreq(config_info.autosync_sample_rate); pane->autosync_ref->setFreq(config_info.autosync_sample_rate);
pane->system_clock->setMode(config_info.system_clock_mode); pane->system_clock->setMode(config_info.system_clock_mode);
pane->system_clock->setFreq(config_info.system_sample_rate); pane->system_clock->setFreq(config_info.system_sample_rate);
if (pane->type == H9632) {
pane->input_level->setInputLevel(config_info.ad_gain);
pane->output_level->setOutputLevel(config_info.da_gain);
pane->phones->setPhones(config_info.phone_gain);
pane->breakout_cable->setXlr(config_info.xlr_breakout_cable);
}
if (pane->type == H9632 || pane->type == H9652) {
pane->aeb->setAdatInternal(config_info.analog_extension_board);
}
} }
Fl::add_timeout(0.3, refresh_cb, arg); Fl::add_timeout(0.3, refresh_cb, arg);
@ -136,7 +157,7 @@ int main(int argc, char **argv)
Fl_Group *about_pane; Fl_Group *about_pane;
char *name; char *name;
int card; int card;
int hdsp_cards[4]; HDSP_IO_Type hdsp_cards[4];
int alsa_index[4]; int alsa_index[4];
snd_ctl_t *handle; snd_ctl_t *handle;
snd_ctl_card_info_t *info; snd_ctl_card_info_t *info;
@ -146,8 +167,22 @@ int main(int argc, char **argv)
snd_ctl_card_info_alloca(&info); snd_ctl_card_info_alloca(&info);
snd_pcm_info_alloca(&pcminfo); snd_pcm_info_alloca(&pcminfo);
card = -1; card = -1;
printf("HDSPConf %s\n", VERSION); printf("\nHDSPConf %s - Copyright (C) 2003 Thomas Charbonnel <thomas@undata.org>\n", VERSION);
printf("This program comes WITH ABSOLUTELY NO WARRANTY\n");
printf("HDSPConf is free software, see the file copying for details\n\n");
printf("Looking for HDSP cards :\n"); printf("Looking for HDSP cards :\n");
#ifdef GUI_TEST
hdsp_cards[0] = Digiface;
alsa_index[0] = 0;
hdsp_cards[1] = H9652;
alsa_index[1] = 1;
hdsp_cards[2] = Multiface;
alsa_index[2] = 2;
hdsp_cards[3] = H9632;
alsa_index[3] = 3;
cards = 4;
#else
while (snd_card_next(&card) >= 0 && cards < 4) { while (snd_card_next(&card) >= 0 && cards < 4) {
if (card < 0) { if (card < 0) {
break; break;
@ -156,24 +191,30 @@ int main(int argc, char **argv)
printf("Card %d : %s\n", card, name); printf("Card %d : %s\n", card, name);
if (!strncmp(name, "RME Hammerfall DSP + Multiface", 30)) { if (!strncmp(name, "RME Hammerfall DSP + Multiface", 30)) {
printf("Multiface found !\n"); printf("Multiface found !\n");
hdsp_cards[cards] = MULTIFACE; hdsp_cards[cards] = Multiface;
alsa_index[cards] = card; alsa_index[cards] = card;
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall DSP + Digiface", 29)) { } else if (!strncmp(name, "RME Hammerfall DSP + Digiface", 29)) {
printf("Digiface found !\n"); printf("Digiface found !\n");
hdsp_cards[cards] = DIGIFACE; hdsp_cards[cards] = Digiface;
alsa_index[cards] = card; alsa_index[cards] = card;
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall HDSP 9652", 24)) { } else if (!strncmp(name, "RME Hammerfall HDSP 9652", 24)) {
printf("HDSP 9652 found !\n"); printf("HDSP 9652 found !\n");
hdsp_cards[cards] = HDSP9652; hdsp_cards[cards] = H9652;
alsa_index[cards] = card; alsa_index[cards] = card;
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall HDSP 9632", 24)) {
printf("HDSP 9632 found !\n");
hdsp_cards[cards] = H9632;
alsa_index[cards] = card;
cards++;
} else if (!strncmp(name, "RME Hammerfall DSP", 18)) { } else if (!strncmp(name, "RME Hammerfall DSP", 18)) {
printf("Uninitialized HDSP card found. Use hdsploader to upload firmware.\n"); printf("Uninitialized HDSP card found.\nUse hdsploader to upload configuration data to the card.\n");
} }
} }
} }
#endif
if (!cards) { if (!cards) {
printf("No Hammerfall DSP card found.\n"); printf("No Hammerfall DSP card found.\n");
exit(1); exit(1);
@ -187,15 +228,17 @@ int main(int argc, char **argv)
card_panes[i] = new HC_CardPane(alsa_index[i], i, hdsp_cards[i]); card_panes[i] = new HC_CardPane(alsa_index[i], i, hdsp_cards[i]);
tabs->add((Fl_Group *)card_panes[i]); tabs->add((Fl_Group *)card_panes[i]);
} }
about_pane = new Fl_Group(10, 30, 360, 360, "About"); about_pane = new Fl_Group(10, 30, 480, 360, "About");
about_pane->labelsize(10); about_pane->labelsize(10);
about_text = new HC_AboutText(20, 40, 340, 210); about_text = new HC_AboutText(80, 70, 440, 210);
rme_logo = new HC_XpmRenderer(20, 263, 113, 35, rme_xpm); rme_logo = new HC_XpmRenderer(60, 328, 113, 35, rme_xpm);
alsa_logo = new HC_XpmRenderer(170, 255, 50, 50, alsalogo_xpm); alsa_logo = new HC_XpmRenderer(230, 320, 50, 50, alsalogo_xpm);
lad_banner = new HC_XpmRenderer(245, 260, 113, 39, lad_banner_xpm); lad_banner = new HC_XpmRenderer(325, 325, 113, 39, lad_banner_xpm);
about_pane->end(); about_pane->end();
tabs->add(about_pane); tabs->add(about_pane);
#ifndef GUI_TEST
refresh_cb((void *)tabs); refresh_cb((void *)tabs);
#endif
window->show(argc, argv); window->show(argc, argv);
return Fl::run(); return Fl::run();
} }

26
hdspconf/src/pixmaps.cxx Normal file
View file

@ -0,0 +1,26 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pixmaps.h"
#include "../pixmaps/alsalogo.xpm"
#include "../pixmaps/lad_banner.xpm"
#include "../pixmaps/rme.xpm"

29
hdspconf/src/pixmaps.h Normal file
View file

@ -0,0 +1,29 @@
/*
* HDSPConf
*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef pixmaps_H
#define pixmaps_H
extern char * rme_xpm[];
extern char * alsalogo_xpm[];
extern char * lad_banner_xpm[];
#endif

View file

@ -1,3 +1,9 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation Basic Installation
================== ==================
@ -8,20 +14,27 @@ various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package. those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file you can run in the future to recreate the current configuration, and a
`config.cache' that saves the results of its tests to speed up file `config.log' containing compiler output (useful mainly for
reconfiguring, and a file `config.log' containing compiler output debugging `configure').
(useful mainly for debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache' be considered for the next release. If you are using the cache, and at
contains results you don't want to keep, you may remove or edit it. some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.in' is used to create `configure' by a program The file `configure.ac' (or `configure.in') is used to create
called `autoconf'. You only need `configure.in' if you want to change `configure' by a program called `autoconf'. You only need
it or regenerate `configure' using a newer version of `autoconf'. `configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is: The simplest way to compile this package is:
@ -55,14 +68,16 @@ Compilers and Options
===================== =====================
Some systems require unusual options for compilation or linking that Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure' the `configure' script does not know about. Run `./configure --help'
initial values for variables by setting them in the environment. Using for details on some of the pertinent environment variables.
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this: You can give `configure' initial values for configuration parameters
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures Compiling For Multiple Architectures
==================================== ====================================
@ -75,11 +90,11 @@ directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH' If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a time variable, you have to compile the package for one architecture at a
in the source code directory. After you have installed the package for time in the source code directory. After you have installed the
one architecture, use `make distclean' before reconfiguring for another package for one architecture, use `make distclean' before reconfiguring
architecture. for another architecture.
Installation Names Installation Names
================== ==================
@ -122,22 +137,32 @@ you can use the `configure' options `--x-includes=DIR' and
Specifying the System Type Specifying the System Type
========================== ==========================
There may be some features `configure' can not figure out There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of host the package automatically, but needs to determine by the type of machine the package
will run on. Usually `configure' can figure that out, but if it prints will run on. Usually, assuming the package is built to be run on the
a message saying it can not guess the host type, give it the _same_ architectures, `configure' can figure that out, but if it prints
`--host=TYPE' option. TYPE can either be a short name for the system a message saying it cannot guess the machine type, give it the
type, such as `sun4', or a canonical name with three fields: `--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If where SYSTEM can have one of these forms:
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of produce code for.
system on which you are compiling the package.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults Sharing Defaults
================ ================
@ -150,20 +175,44 @@ default values for variables like `CC', `cache_file', and `prefix'.
`CONFIG_SITE' environment variable to the location of the site script. `CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script. A warning: not all `configure' scripts look for a site script.
Operation Controls Defining Variables
================== ==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it `configure' recognizes the following options to control how it
operates. operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help' `--help'
`-h'
Print a summary of the options to `configure', and exit. Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet' `--quiet'
`--silent' `--silent'
`-q' `-q'
@ -175,8 +224,6 @@ operates.
Look for the package's source code in directory DIR. Usually Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically. `configure' can determine that directory automatically.
`--version' `configure' also accepts some other, not widely useful, options. Run
Print the version of Autoconf used to generate the `configure' `configure --help' for more details.
script, and exit.
`configure' also accepts some other, not widely useful, options.

View file

@ -1,5 +1,5 @@
AC_INIT(hdsploader.c) AC_INIT(hdsploader.c)
AM_INIT_AUTOMAKE(hdsploader, 1.1) AM_INIT_AUTOMAKE(hdsploader, 1.2)
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
AC_HEADER_STDC AC_HEADER_STDC

View file

@ -36,7 +36,6 @@ void upload_firmware(int card)
snd_hwdep_info_t *info; snd_hwdep_info_t *info;
char card_name[6]; char card_name[6];
hdsp_version_t version; hdsp_version_t version;
unsigned long *fw;
hdsp_firmware_t firmware; hdsp_firmware_t firmware;
hdsp_config_info_t config_info; hdsp_config_info_t config_info;
@ -60,16 +59,16 @@ void upload_firmware(int card)
switch (version.io_type) { switch (version.io_type) {
case Multiface: case Multiface:
if (version.firmware_rev == 0xa) { if (version.firmware_rev == 0xa) {
fw = multiface_firmware; firmware.firmware_data = multiface_firmware;
} else { } else {
fw = multiface_firmware_rev11; firmware.firmware_data = multiface_firmware_rev11;
} }
break; break;
case Digiface: case Digiface:
if (version.firmware_rev == 0xa) { if (version.firmware_rev == 0xa) {
fw = digiface_firmware; firmware.firmware_data = digiface_firmware;
} else { } else {
fw = digiface_firmware_rev11; firmware.firmware_data = digiface_firmware_rev11;
} }
break; break;
default: default:
@ -78,8 +77,6 @@ void upload_firmware(int card)
return; return;
} }
firmware.firmware_data = fw;
if ((err = snd_hwdep_ioctl(hw, SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE, &firmware)) < 0) { if ((err = snd_hwdep_ioctl(hw, SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE, &firmware)) < 0) {
fprintf(stderr, "Hwdep ioctl error on card %s : %s.\n", card_name, snd_strerror(err)); fprintf(stderr, "Hwdep ioctl error on card %s : %s.\n", card_name, snd_strerror(err));
snd_hwdep_close(hw); snd_hwdep_close(hw);