- fixed H9632 problem.

- added desktop file and icon
  new options --with-desktop-dir and --with-pixmap-dir.
- fixed CXXFLAGS for soundbase option.
- fixed compile warnings.
This commit is contained in:
Takashi Iwai 2003-11-24 14:48:21 +00:00
parent 4046e31368
commit ca7ae60abd
14 changed files with 160 additions and 57 deletions

View file

@ -1,5 +1,9 @@
EXTRA_DIST = hdspmixer.desktop
SUBDIRS = src pixmaps
desktopdir = $(DESKTOP_DIR)
desktop_DATA = hdspmixer.desktop
alsa-dist: distdir
@rm -rf ../distdir/hdspmixer
@mkdir -p ../distdir/hdspmixer

View file

@ -1,3 +1,8 @@
Version 1.5 (21/11/2003):
* Added a .desktop file
* H9632 bug fixes (thanks to Pentti Ala-Vannesluoma)
* Fixes presets handling for H9632 cards
Version 1.4 (01/11/2003):
* Adds support for H9632 cards

View file

@ -1,12 +1,12 @@
AC_INIT(src/hdspmixer.cxx)
AM_INIT_AUTOMAKE(hdspmixer, 1.4)
AM_INIT_AUTOMAKE(hdspmixer, 1.5)
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_STDC_HEADERS
AC_PATH_X
AM_PATH_ALSA(0.9.0)
AM_PATH_ALSA(1.0.0)
dnl kernel header files
AC_MSG_CHECKING(for kernel header files)
@ -32,7 +32,7 @@ AC_ARG_WITH(soundbase,
[soundbasedir="$withval"], [soundbasedir="$kerneldir"])
if test "$soundbasedir" != "" -a -r "$soundbasedir/sound" ; then
ALSA_CFLAGS="$ALSA_CFLAGS -I$soundbasedir"
CFLAGS="$CFLAGS -I$soundbasedir"
CXXFLAGS="$CXXFLAGS -I$soundbasedir"
AC_MSG_RESULT($ALSA_CFLAGS)
else
if test "x$prefix" != xNONE; then
@ -42,13 +42,33 @@ else
fi
if test -z "$soundbasedir" -a -r "$aprefix/include/sound"; then
ALSA_CFLAGS="$ALSA_CFLAGS -I$aprefix/include"
CFLAGS="$CFLAGS -I$aprefix/include"
CXXFLAGS="$CXXFLAGS -I$aprefix/include"
AC_MSG_RESULT($ALSA_CFLAGS)
else
AC_MSG_RESULT("not specified - using C compiler defaults")
fi
fi
dnl desktop install
AC_ARG_WITH(desktop-dir,
[ --with-desktop-dir specify the path to install desktop file],
[desktopdir="$withval"], [desktopdir=""])
if test -z "$desktopdir"; then
desktopdir=$datadir/applications
fi
DESKTOP_DIR="$desktopdir"
AC_SUBST(DESKTOP_DIR)
AC_ARG_WITH(pixmap-dir,
[ --with-pixmap-dir specify the path to install desktop pixmap file],
[pixmapdir="$withval"], [pixmapdir=""])
if test -z "$pixmapdir"; then
pixmapdir=$datadir/pixmaps
fi
PIXMAP_DIR="$pixmapdir"
AC_SUBST(PIXMAP_DIR)
dnl library check
AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
if test "$FLTK_CONFIG" = "no"; then
AC_MSG_ERROR(fltk-config is required)

View file

@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=HDSPMixer
Comment=Hammerfall DSP matrix mixer control GUI
Exec=hdspmixer
FilePattern=hdspmixer
Icon=hdspmixer.png
Terminal=false
Type=Application
Categories=Application;AudioVideo;

View file

@ -1 +1,4 @@
EXTRA_DIST = $(wildcard *.xpm)
pixmapdir = $(PIXMAP_DIR)
pixmap_DATA = hdspmixer.png
EXTRA_DIST = $(wildcard *.xpm) hdspmixer.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -19,6 +19,7 @@
*/
#pragma implementation
#define HDSPMIXER_DEFINE_MAPPINGS
#include "HDSPMixerCard.h"
static void alsactl_cb(snd_async_handler_t *handler)
@ -110,6 +111,7 @@ int HDSPMixerCard::getAutosyncSpeed()
} else if (external_rate <= 2) {
return 0;
}
return 0;
}
int HDSPMixerCard::getSpeed()
@ -168,7 +170,12 @@ HDSPMixerCard::HDSPMixerCard(HDSP_IO_Type cardtype, int id)
snprintf(name, 6, "hw:%i", card_id);
h9632_aeb.aebi = 0;
h9632_aeb.aebo = 0;
if (type == H9632) getAeb();
if (type == H9632) {
getAeb();
playbacks_offset = 16;
} else {
playbacks_offset = 26;
}
speed_mode = getSpeed();
if (speed_mode < 0) {
fprintf(stderr, "Error trying to determine speed mode for card %s, exiting.\n", name);
@ -195,6 +202,7 @@ void HDSPMixerCard::getAeb() {
snd_hwdep_close(hw);
return;
}
snd_hwdep_close(hw);
}
void HDSPMixerCard::adjustSettings() {
@ -255,32 +263,30 @@ void HDSPMixerCard::adjustSettings() {
lineouts = 0;
break;
case 2:
/* should never happen */
break;
}
} else if (type == H9632) {
/* FIXME : mapping values are my first guess here
this needs to be tested
*/
switch (speed_mode) {
case 0:
channels = 12 + (h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0;
channels = 12 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
channel_map = channel_map_h9632_ss;
dest_map = dest_map_h9632_ss;
meter_map = channel_map_h9632_ss;
lineouts = 0;
break;
case 1:
channels = 8 + (h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0;
channels = 8 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
channel_map = channel_map_h9632_ds;
dest_map = dest_map_h9632_ds;
meter_map = meter_map_h9632_ds;
meter_map = channel_map_h9632_ds;
lineouts = 0;
break;
case 2:
channels = 4 + (h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0;
channels = 4 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
channel_map = channel_map_h9632_qs;
dest_map = dest_map_h9632_qs;
meter_map = dest_map_h9632_qs;
meter_map = channel_map_h9632_qs;
lineouts = 0;
break;
}
@ -355,13 +361,20 @@ void HDSPMixerCard::actualizeStrips()
basew->inputs->empty_aebi[i]->hide();
basew->playbacks->empty_aebo[i]->show();
basew->outputs->empty_aebo[i]->show();
}
}
for (int i = channels-4; i < channels; ++i) {
basew->playbacks->strips[i]->hide();
basew->outputs->strips[i]->hide();
}
} else if (h9632_aeb.aebo && !h9632_aeb.aebi) {
for (int i = 0; i < 2; ++i) {
basew->inputs->empty_aebi[i]->show();
basew->playbacks->empty_aebo[i]->hide();
basew->outputs->empty_aebo[i]->hide();
}
for (int i = channels-4; i < channels; ++i) {
basew->inputs->strips[i]->hide();
}
} else {
for (int i = 0; i < 2; ++i) {
basew->inputs->empty_aebi[i]->hide();

View file

@ -26,7 +26,9 @@
#include <stdio.h>
#include <alsa/asoundlib.h>
#include <sound/hdsp.h>
#ifdef HDSPMIXER_DEFINE_MAPPINGS
#include "mappings.h"
#endif
#include "defines.h"
#include "HDSPMixerWindow.h"
@ -47,6 +49,7 @@ public:
char *dest_map;
char *meter_map;
int speed_mode;
int playbacks_offset;
void setMode(int mode);
int initializeCard(HDSPMixerWindow *w);
int getSpeed();

View file

@ -19,6 +19,7 @@
*/
#pragma implementation
#define HDSPMIXER_DEFINE_OUTPUT_LABELS
#include "HDSPMixerOutput.h"
HDSPMixerOutput::HDSPMixerOutput(int x, int y, int w, int h, int num):Fl_Group(x, y, w, h)

View file

@ -41,6 +41,7 @@ class HDSPMixerMeter;
class HDSPMixerOutputData;
class HDSPMixerWindow;
#ifdef HDSPMIXER_DEFINE_OUTPUT_LABELS
static char *labels_mf_ss[20] = {
"AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6", "AN 7", "AN 8",
"A 1", "A 2", "A 3", "A 4", "A 5", "A 6", "A 7", "A 8",
@ -80,6 +81,7 @@ static char *labels_9632_ds[12] = {
static char *labels_9632_qs[8] = {
"SP.L", "SP.R", "AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6"
};
#endif
class HDSPMixerOutput:public Fl_Group
{

View file

@ -19,6 +19,7 @@
*/
#pragma implementation
#define HDSPMIXER_DEFINE_SELECTOR_LABELS
#include "HDSPMixerSelector.h"
HDSPMixerSelector::HDSPMixerSelector(int x, int y, int w, int h):Fl_Menu_(x, y, w, h)
@ -142,15 +143,15 @@ void HDSPMixerSelector::setLabels()
} else if (type == H9632) {
switch (sm) {
case 0:
max_dest = 6 + (aeb->aebo) ? 2 : 0;
max_dest = 6 + (aeb->aebo ? 2 : 0);
destinations = destinations_h9632_ss;
break;
case 1:
max_dest = 4 + (aeb->aebo) ? 2 : 0;
max_dest = 4 + (aeb->aebo ? 2 : 0);
destinations = destinations_h9632_ds;
break;
case 2:
max_dest = 2 + (aeb->aebo) ? 2 : 0;
max_dest = 2 + (aeb->aebo ? 2 : 0);
destinations = destinations_h9632_qs;
break;
}

View file

@ -35,6 +35,7 @@
class HDSPMixerWindow;
class HDSPMixerIOMixer;
#ifdef HDSPMIXER_DEFINE_SELECTOR_LABELS
static char *destinations_mf_ss[10] = {
"AN 1+2", "AN 3+4", "AN 5+6", "AN 7+8",
"A 1+2", "A 3+4", "A 5+6", "A 7+8",
@ -88,6 +89,7 @@ static char *destinations_h9632_ds[6] = {
static char *destinations_h9632_qs[4] = {
"SPDIF", "AN 1+2", "AN 3+4", "AN 5+6"
};
#endif
class HDSPMixerSelector:public Fl_Menu_
{

View file

@ -246,7 +246,7 @@ static int handler_cb(int event)
break;
}
}
if (fl_win = Fl::next_window(fl_win)) return 0;
if ((fl_win = Fl::next_window(fl_win))) return 0;
}
if (!w) return 0;
int key = Fl::event_key();
@ -276,7 +276,7 @@ static int handler_cb(int event)
w->checkState();
return 1;
} else if (key == '3' || key == '3'+FL_KP) {
/* rms +3B */
/* rms +3dB */
w->setup->rmsplus3_val = 1;
w->checkState();
return 1;
@ -309,7 +309,7 @@ void HDSPMixerWindow::save()
if (dirty) {
inputs->buttons->presets->save_preset(current_preset+1);
}
for (int speed = 0; speed < 2; ++speed) {
for (int speed = 0; speed < 3; ++speed) {
for (int card = 0; card < 3; ++card) {
for (int preset = 0; preset < 8; ++preset) {
for (int channel = 0; channel < HDSP_MAX_CHANNELS; ++channel) {
@ -399,7 +399,7 @@ void HDSPMixerWindow::load()
if ((file = fopen(file_name, "r")) == NULL) {
fl_alert("Error opening file %s for reading", file_name);
}
for (int speed = 0; speed < 2; ++speed) {
for (int speed = 0; speed < 3; ++speed) {
for (int card = 0; card < 3; ++card) {
for (int preset = 0; preset < 8; ++preset) {
for (int channel = 0; channel < HDSP_MAX_CHANNELS; ++channel) {
@ -490,8 +490,11 @@ load_error:
void HDSPMixerWindow::restoreDefaults(int card)
{
int phones;
int chnls[2];
int maxdest[2];
int chnls[3];
int maxdest[3];
int h9632_spdif_submix[3];
int h9632_an12_submix[3];
int num_modes = 2;
int ndb = inputs->strips[0]->fader->ndb;
switch (cards[card]->type) {
case Multiface:
@ -515,35 +518,60 @@ void HDSPMixerWindow::restoreDefaults(int card)
maxdest[1] = 7;
phones = 0;
break;
case H9632:
chnls[0] = 16;
chnls[1] = 12;
chnls[2] = 8;
maxdest[0] = 8;
maxdest[1] = 6;
maxdest[2] = 4;
h9632_spdif_submix[0] = 4;
h9632_spdif_submix[1] = 2;
h9632_spdif_submix[2] = 0;
h9632_an12_submix[0] = 5;
h9632_an12_submix[1] = 3;
h9632_an12_submix[2] = 1;
num_modes = 3;
phones = 0;
}
for (int preset = 0; preset < 8; ++preset) {
for (int speed = 0; speed < 2; ++speed) {
for (int speed = 0; speed < num_modes; ++speed) {
for (int i = 0; i < chnls[speed]; i+=2) {
for (int z = 0; z < maxdest[speed]; ++z) {
inputs->strips[i]->data[card][speed][preset]->fader_pos[z] =
((preset == 6 && z == maxdest[speed]-phones-1) || (i == z*2 && (preset > 1 && preset < 4)) || (((preset > 0 && preset < 4) || preset == 7) && phones && (z == maxdest[speed]-1))) ? ndb : 0;
inputs->strips[i+1]->data[card][speed][preset]->fader_pos[z] =
((preset == 6 && z == maxdest[speed]-phones-1) || (i == z*2 && (preset > 1 && preset < 4)) || (((preset > 0 && preset < 4) || preset == 7) && phones && (z == maxdest[speed]-1))) ? ndb : 0;
/* Gain setup */
if (cards[card]->type == H9632) {
inputs->strips[i]->data[card][speed][preset]->fader_pos[z] =
((preset == 1 && z == h9632_an12_submix[speed]) || (i == z*2 && ((preset > 1 && preset < 4) || (preset == 7))) || ((preset == 5) && (z == h9632_spdif_submix[speed]))) ? ndb : 0;
inputs->strips[i+1]->data[card][speed][preset]->fader_pos[z] =
((preset == 1 && z == h9632_an12_submix[speed]) || (i == z*2 && ((preset > 1 && preset < 4) || (preset == 7))) || ((preset == 5) && (z == h9632_spdif_submix[speed]))) ? ndb : 0;
playbacks->strips[i]->data[card][speed][preset]->fader_pos[z] =
((preset == 1 && z == h9632_an12_submix[speed]) || i == z*2 || (preset == 5 && z == h9632_spdif_submix[speed])) ? ndb : 0;
playbacks->strips[i+1]->data[card][speed][preset]->fader_pos[z] =
((preset == 1 && z == h9632_an12_submix[speed]) || i == z*2 || (preset == 5 && z == h9632_spdif_submix[speed])) ? ndb : 0;
} else {
inputs->strips[i]->data[card][speed][preset]->fader_pos[z] =
((preset == 6 && z == (maxdest[speed]-phones-1)) || (i == z*2 && (preset > 1 && preset < 4)) || (((preset > 0 && preset < 4) || preset == 7) && phones && (z == maxdest[speed]-1))) ? ndb : 0;
inputs->strips[i+1]->data[card][speed][preset]->fader_pos[z] =
((preset == 6 && z == (maxdest[speed]-phones-1)) || (i == z*2 && (preset > 1 && preset < 4)) || (((preset > 0 && preset < 4) || preset == 7) && phones && (z == maxdest[speed]-1))) ? ndb : 0;
playbacks->strips[i]->data[card][speed][preset]->fader_pos[z] =
((preset > 4 && preset < 7 && z == (maxdest[speed]-phones-1)) || i == z*2 || (phones && (z == maxdest[speed]-1))) ? ndb : 0;
playbacks->strips[i+1]->data[card][speed][preset]->fader_pos[z] =
((preset > 4 && preset < 7 && z == (maxdest[speed]-phones-1)) || i == z*2 || (phones && (z == maxdest[speed]-1))) ? ndb : 0;
}
/* Pan setup */
inputs->strips[i]->data[card][speed][preset]->pan_pos[z] = 0;
inputs->strips[i+1]->data[card][speed][preset]->pan_pos[z] = 28*CF;
playbacks->strips[i]->data[card][speed][preset]->fader_pos[z] =
((preset > 4 && preset < 7 && z == maxdest[speed]-phones-1) || i == z*2 || (phones && (z == maxdest[speed]-1))) ? ndb : 0;
playbacks->strips[i+1]->data[card][speed][preset]->fader_pos[z] =
((preset > 4 && preset < 7 && z == maxdest[speed]-phones-1) || i == z*2 || (phones && (z == maxdest[speed]-1))) ? ndb : 0;
playbacks->strips[i]->data[card][speed][preset]->pan_pos[z] = 0;
playbacks->strips[i+1]->data[card][speed][preset]->pan_pos[z] = 28*CF;
}
inputs->strips[i]->data[card][speed][preset]->dest = (int)floor(i/2);
inputs->strips[i+1]->data[card][speed][preset]->dest = (int)floor(i/2);
playbacks->strips[i]->data[card][speed][preset]->dest = (int)floor(i/2);
playbacks->strips[i+1]->data[card][speed][preset]->dest = (int)floor(i/2);
if (i < (chnls[speed]-(cards[card]->h9632_aeb.aebo ? 2 : 0))) {
inputs->strips[i]->data[card][speed][preset]->dest =
inputs->strips[i+1]->data[card][speed][preset]->dest =
playbacks->strips[i]->data[card][speed][preset]->dest =
playbacks->strips[i+1]->data[card][speed][preset]->dest = (int)floor(i/2);
}
outputs->strips[i]->data[card][speed][preset]->fader_pos = (preset != 4) ? 137*CF : 0;
outputs->strips[i+1]->data[card][speed][preset]->fader_pos = (preset != 4) ? 137*CF : 0;
if (preset > 4 && preset < 7) {
outputs->strips[chnls[speed]-2]->data[card][speed][preset]->fader_pos = ndb;
outputs->strips[chnls[speed]-1]->data[card][speed][preset]->fader_pos = ndb;
}
if (preset == 3 || preset == 7) {
inputs->strips[i]->data[card][speed][preset]->mute = 1;
inputs->strips[i+1]->data[card][speed][preset]->mute = 1;
@ -553,17 +581,31 @@ void HDSPMixerWindow::restoreDefaults(int card)
}
}
}
if (phones) {
outputs->strips[chnls[speed]]->data[card][speed][preset]->fader_pos = (preset != 4) ? ndb : 0;
outputs->strips[chnls[speed]+1]->data[card][speed][preset]->fader_pos = (preset != 4) ? ndb : 0;
if (cards[card]->type == H9632) {
if (preset == 1 || preset == 6) {
data[card][speed][preset]->submix_value = h9632_an12_submix[speed];
outputs->strips[h9632_an12_submix[speed]*2]->data[card][speed][preset]->fader_pos = ndb;
outputs->strips[h9632_an12_submix[speed]*2+1]->data[card][speed][preset]->fader_pos = ndb;
} else if (preset == 5) {
data[card][speed][preset]->submix_value = h9632_spdif_submix[speed];
outputs->strips[h9632_spdif_submix[speed]*2]->data[card][speed][preset]->fader_pos = ndb;
outputs->strips[h9632_spdif_submix[speed]*2+1]->data[card][speed][preset]->fader_pos = ndb;
} else {
data[card][speed][preset]->submix = 0;
}
} else if (preset > 4 && preset < 7) {
data[card][speed][preset]->submix_value = maxdest[speed]-phones-1;
outputs->strips[chnls[speed]-2]->data[card][speed][preset]->fader_pos = ndb;
outputs->strips[chnls[speed]-1]->data[card][speed][preset]->fader_pos = ndb;
} else {
data[card][speed][preset]->submix = 0;
}
if (preset == 3 || preset == 7) {
data[card][speed][preset]->mute = 1;
}
if (preset > 4 && preset < 7) {
data[card][speed][preset]->submix_value = (maxdest[speed]-phones-1);
} else {
data[card][speed][preset]->submix = 0;
if (phones) {
outputs->strips[chnls[speed]]->data[card][speed][preset]->fader_pos = (preset != 4) ? ndb : 0;
outputs->strips[chnls[speed]+1]->data[card][speed][preset]->fader_pos = (preset != 4) ? ndb : 0;
}
}
}
@ -583,6 +625,7 @@ HDSPMixerWindow::HDSPMixerWindow(int x, int y, int w, int h, const char *label,
for (int i = 0; i < 8; ++i) {
data[j][0][i] = new HDSPMixerPresetData();
data[j][1][i] = new HDSPMixerPresetData();
data[j][2][i] = new HDSPMixerPresetData();
}
}
buttons_removed = 0;
@ -832,8 +875,8 @@ void HDSPMixerWindow::refreshMixerStrip(int idx, int src)
void HDSPMixerWindow::resetMixer()
{
int i, j;
for (i = 0; i < 52 ; ++i) {
for (j = 0; j < 28; ++j) {
for (i = 0; i < (cards[current_card]->playbacks_offset*2) ; ++i) {
for (j = 0; j < (cards[current_card]->playbacks_offset+cards[current_card]->lineouts); ++j) {
setGain(i, j, 0);
}
}
@ -938,14 +981,14 @@ void HDSPMixerWindow::setMixer(int idx, int src, int dst)
right_val = attenuation_r* vol * pan;
muted:
snd_ctl_elem_value_set_integer(ctl, 0, src*26+cards[current_card]->channel_map[idx-1]);
snd_ctl_elem_value_set_integer(ctl, 0, src*cards[current_card]->playbacks_offset+cards[current_card]->channel_map[idx-1]);
snd_ctl_elem_value_set_integer(ctl, 1, cards[current_card]->dest_map[dst]);
snd_ctl_elem_value_set_integer(ctl, 2, (int)left_val);
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Alsa error: %s\n", snd_strerror(err));
return;
}
snd_ctl_elem_value_set_integer(ctl, 0, src*26+cards[current_card]->channel_map[idx-1]);
snd_ctl_elem_value_set_integer(ctl, 0, src*cards[current_card]->playbacks_offset+cards[current_card]->channel_map[idx-1]);
snd_ctl_elem_value_set_integer(ctl, 1, cards[current_card]->dest_map[dst]+1);
snd_ctl_elem_value_set_integer(ctl, 2, (int)right_val);
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {

View file

@ -82,10 +82,6 @@ static char channel_map_h9632_ss[16] = {
};
static char channel_map_h9632_ds[12] = {
1, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
static char meter_map_h9632_ds[12] = {
0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15
};