Add support for RME MADI, RayDAT and AIO

Merged the work by Florian Faber that's distributed separately as
hdspmixer64.

Code taken from http://wiki.linuxproaudio.org/index.php/App:hdspmixer_64

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Adrian Knoth 2011-01-09 19:42:59 +01:00 committed by Takashi Iwai
parent 6af3047947
commit e24e56795e
20 changed files with 651 additions and 187 deletions

View file

@ -23,7 +23,7 @@
HDSPMixerAboutText::HDSPMixerAboutText(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "About Text") HDSPMixerAboutText::HDSPMixerAboutText(int x, int y, int w, int h):Fl_Widget(x, y, w, h, "About Text")
{ {
text = "HDSPMixer " VERSION " (C) 2003 Thomas Charbonnel <thomas@@undata.org>\n\n" text = "HDSPMixer " VERSION " (C) 2003 Thomas Charbonnel <thomas@@undata.org>\n (C) 2009 Florian Faber <faber@@faberman.de>\n (C) 2011 Adrian Knoth <adi@@drcomp.erfurt.thur.de>\n\n"
"Bitmaps by Ralf Brunner\n" "Bitmaps by Ralf Brunner\n"
"Many thanks to Martin Björnsen, Matthias Carstens and Paul Davis\n\n" "Many thanks to Martin Björnsen, Matthias Carstens and Paul Davis\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"

View file

@ -45,6 +45,66 @@ static char channel_map_ds[26] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
}; };
static char dest_map_madi_ss[32] = {
0, 2, 4, 6, 8, 10, 12, 14,
16, 18, 20, 22, 24, 26, 28, 30,
32, 34, 36, 38, 40, 42, 44, 46,
48, 50, 52, 54, 56, 58, 60, 62
};
static char dest_map_raydat_ss[18] = {
4, 6, 8, 10,
12, 14, 16, 18,
20, 22, 24, 26,
28, 30, 32, 34,
0, 2
};
static char dest_map_raydat_ds[10] = {
4, 6,
8, 10,
12, 14,
16, 18,
0, 2
};
static char dest_map_raydat_qs[6] = {
4,
6,
8,
10,
0, 2
};
static char dest_map_aio_ss[8] = {
0, // Analogue
8, // AES
10, // SPDIF
12, 14, 16, 18, // ADAT
6 // Phones
};
static char dest_map_aio_ds[6] = {
0, // Analogue
8, // AES
10, // SPDIF
12, 16, // ADAT
6 // Phones
};
static char dest_map_aio_qs[5] = {
0, // Analogue
8, // AES
10, // SPDIF
12, // ADAT
6 // Phone
};
static char dest_map_mf_ss[10] = { static char dest_map_mf_ss[10] = {
0, 2, 4, 6, 16, 18, 20, 22, 24, 26 0, 2, 4, 6, 16, 18, 20, 22, 24, 26
}; };
@ -181,8 +241,10 @@ int HDSPMixerCard::getSpeed()
snd_ctl_elem_value_t *elemval; snd_ctl_elem_value_t *elemval;
snd_ctl_elem_id_t * elemid; snd_ctl_elem_id_t * elemid;
snd_ctl_t *handle; snd_ctl_t *handle;
snd_ctl_elem_value_alloca(&elemval); snd_ctl_elem_value_alloca(&elemval);
snd_ctl_elem_id_alloca(&elemid); snd_ctl_elem_id_alloca(&elemid);
if ((err = snd_ctl_open(&handle, name, SND_CTL_NONBLOCK)) < 0) { if ((err = snd_ctl_open(&handle, name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Error accessing ctl interface on card %s\n.", name); fprintf(stderr, "Error accessing ctl interface on card %s\n.", name);
return -1; return -1;
@ -198,6 +260,7 @@ int HDSPMixerCard::getSpeed()
} }
val = snd_ctl_elem_value_get_enumerated(elemval, 0); val = snd_ctl_elem_value_get_enumerated(elemval, 0);
snd_ctl_close(handle); snd_ctl_close(handle);
switch (val) { switch (val) {
case 0: case 0:
/* Autosync mode : We need to determine sample rate */ /* Autosync mode : We need to determine sample rate */
@ -225,7 +288,7 @@ int HDSPMixerCard::getSpeed()
return 0; return 0;
} }
HDSPMixerCard::HDSPMixerCard(HDSP_IO_Type cardtype, int id) HDSPMixerCard::HDSPMixerCard(int cardtype, int id)
{ {
type = cardtype; type = cardtype;
card_id = id; card_id = id;
@ -238,6 +301,7 @@ HDSPMixerCard::HDSPMixerCard(HDSP_IO_Type cardtype, int id)
} else { } else {
playbacks_offset = 26; playbacks_offset = 26;
} }
speed_mode = getSpeed(); speed_mode = getSpeed();
if (speed_mode < 0) { if (speed_mode < 0) {
fprintf(stderr, "Error trying to determine speed mode for card %s, exiting.\n", name); fprintf(stderr, "Error trying to determine speed mode for card %s, exiting.\n", name);
@ -271,18 +335,18 @@ void HDSPMixerCard::adjustSettings() {
if (type == Multiface) { if (type == Multiface) {
switch (speed_mode) { switch (speed_mode) {
case 0: case 0:
channels = 18; channels_input = 18;
channel_map = channel_map_mf_ss; channels_playback = 20;
channel_map_input = channel_map_playback = channel_map_mf_ss;
dest_map = dest_map_mf_ss; dest_map = dest_map_mf_ss;
meter_map = channel_map_mf_ss; meter_map_input = meter_map_playback = channel_map_mf_ss;
lineouts = 2;
break; break;
case 1: case 1:
channels = 14; channels_input = 14;
channel_map = meter_map_ds; channels_playback = 16;
channel_map_input = channel_map_playback = meter_map_ds;
dest_map = dest_map_ds; dest_map = dest_map_ds;
meter_map = meter_map_ds; meter_map_input = meter_map_playback = meter_map_ds;
lineouts = 2;
break; break;
case 2: case 2:
/* should never happen */ /* should never happen */
@ -291,18 +355,16 @@ void HDSPMixerCard::adjustSettings() {
} else if (type == Digiface) { } else if (type == Digiface) {
switch (speed_mode) { switch (speed_mode) {
case 0: case 0:
channels = 26; channels_input = channels_playback = 26;
channel_map = channel_map_df_ss; channel_map_input = channel_map_playback = channel_map_df_ss;
dest_map = dest_map_df_ss; dest_map = dest_map_df_ss;
meter_map = channel_map_df_ss; meter_map_input = meter_map_playback = channel_map_df_ss;
lineouts = 2;
break; break;
case 1: case 1:
channels = 14; channels_input = channels_playback = 14;
channel_map = meter_map_ds; channel_map_input = channel_map_playback = meter_map_ds;
dest_map = dest_map_ds; dest_map = dest_map_ds;
meter_map = meter_map_ds; meter_map_input = meter_map_playback = meter_map_ds;
lineouts = 2;
break; break;
case 2: case 2:
/* should never happen */ /* should never happen */
@ -311,18 +373,16 @@ void HDSPMixerCard::adjustSettings() {
} else if (type == H9652) { } else if (type == H9652) {
switch (speed_mode) { switch (speed_mode) {
case 0: case 0:
channels = 26; channels_input = channels_playback = 26;
channel_map = channel_map_df_ss; channel_map_input = channel_map_playback = channel_map_df_ss;
dest_map = dest_map_h9652_ss; dest_map = dest_map_h9652_ss;
meter_map = channel_map_df_ss; meter_map_input = meter_map_playback = channel_map_df_ss;
lineouts = 0;
break; break;
case 1: case 1:
channels = 14; channels_input = channels_playback = 14;
channel_map = channel_map_ds; channel_map_input = channel_map_playback = channel_map_ds;
dest_map = dest_map_h9652_ds; dest_map = dest_map_h9652_ds;
meter_map = meter_map_ds; meter_map_input = meter_map_playback = meter_map_ds;
lineouts = 0;
break; break;
case 2: case 2:
/* should never happen */ /* should never happen */
@ -331,29 +391,111 @@ void HDSPMixerCard::adjustSettings() {
} else if (type == H9632) { } else if (type == H9632) {
switch (speed_mode) { switch (speed_mode) {
case 0: case 0:
channels = 12 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0); channels_input = channels_playback = 12 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
channel_map = channel_map_h9632_ss; channel_map_input = channel_map_playback = channel_map_h9632_ss;
dest_map = dest_map_h9632_ss; dest_map = dest_map_h9632_ss;
meter_map = channel_map_h9632_ss; meter_map_input = meter_map_playback = channel_map_h9632_ss;
lineouts = 0;
break; break;
case 1: case 1:
channels = 8 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0); channels_input = channels_playback = 8 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
channel_map = channel_map_h9632_ds; channel_map_input = channel_map_playback = channel_map_h9632_ds;
dest_map = dest_map_h9632_ds; dest_map = dest_map_h9632_ds;
meter_map = channel_map_h9632_ds; meter_map_input = meter_map_playback = channel_map_h9632_ds;
lineouts = 0;
break; break;
case 2: case 2:
channels = 4 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0); channels_input = channels_playback = 4 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
channel_map = channel_map_h9632_qs; channel_map_input = channel_map_playback = channel_map_h9632_qs;
dest_map = dest_map_h9632_qs; dest_map = dest_map_h9632_qs;
meter_map = channel_map_h9632_qs; meter_map_input = meter_map_playback = channel_map_h9632_qs;
lineouts = 0;
break; break;
} }
} else if (HDSPeMADI == type) {
playbacks_offset = 64;
switch (speed_mode) {
case 0: // SS
channels_input = channels_playback = 64;
channel_map_input = channel_map_playback = channel_map_unity_ss;
dest_map = dest_map_madi_ss;
meter_map_input = meter_map_playback = channel_map_unity_ss;
break;
case 1: // DS
channels_input = channels_playback = 32;
channel_map_input = channel_map_playback = channel_map_unity_ss;
dest_map = dest_map_madi_ss;
meter_map_input = meter_map_playback = channel_map_unity_ss;
break;
case 2: // QS
channels_input = channels_playback = 16;
channel_map_input = channel_map_playback = channel_map_unity_ss;
dest_map = dest_map_madi_ss;
meter_map_input = meter_map_playback = channel_map_unity_ss;
break;
}
} else if (HDSPeAIO == type) {
playbacks_offset = 64;
switch (speed_mode) {
case 0: // SS
channels_input = 14;
channels_playback = 16;
channel_map_input = channel_map_aio_in_ss;
channel_map_playback = channel_map_aio_out_ss;
dest_map = dest_map_aio_ss;
meter_map_input = channel_map_aio_in_ss;
meter_map_playback = channel_map_aio_out_ss;
break;
case 1: // DS
channels_input = 10;
channels_playback = 12;
channel_map_input = channel_map_aio_in_ds;
channel_map_playback = channel_map_aio_out_ds;
dest_map = dest_map_aio_ds;
meter_map_input = channel_map_aio_in_ds;
meter_map_playback = channel_map_aio_out_ds;
break;
case 2: // QS
channels_input = 8;
channels_playback =10;
channel_map_input = channel_map_aio_in_qs;
channel_map_playback = channel_map_aio_out_qs;
dest_map = dest_map_aio_qs;
meter_map_input = channel_map_aio_in_qs;
meter_map_playback = channel_map_aio_out_qs;
break;
}
} else if (HDSPeRayDAT == type) {
playbacks_offset = 64;
switch (speed_mode) {
case 0: // SS
channels_input = 36;
channels_playback = 36;
channel_map_input = channel_map_playback = channel_map_raydat_ss;
dest_map = dest_map_raydat_ss;
meter_map_input = meter_map_playback = channel_map_raydat_ss;
break;
case 1: // DS
channels_input = 20;
channels_playback = 20;
channel_map_input = channel_map_playback = channel_map_raydat_ds;
dest_map = dest_map_raydat_ds;
meter_map_input = meter_map_playback = channel_map_raydat_ds;
break;
case 2: // QS
channels_input = 12;
channels_playback =12;
channel_map_input = channel_map_playback = channel_map_raydat_qs;
dest_map = dest_map_raydat_qs;
meter_map_input = meter_map_playback = channel_map_raydat_qs;
break;
}
} }
window_width = (channels+2)*STRIP_WIDTH;
window_width = (channels_playback+2)*STRIP_WIDTH;
window_height = FULLSTRIP_HEIGHT*2+SMALLSTRIP_HEIGHT+MENU_HEIGHT; window_height = FULLSTRIP_HEIGHT*2+SMALLSTRIP_HEIGHT+MENU_HEIGHT;
} }
@ -363,28 +505,28 @@ void HDSPMixerCard::setMode(int mode)
adjustSettings(); adjustSettings();
actualizeStrips(); actualizeStrips();
for (int i = 0; i < channels; ++i) { for (int i = 0; i < channels_input; ++i) {
basew->inputs->strips[i]->targets->setLabels(); basew->inputs->strips[i]->targets->setLabels();
basew->playbacks->strips[i]->targets->setLabels();
basew->outputs->strips[i]->setLabels();
} }
for (int i = channels; i < channels+lineouts; ++i) { for (int i = 0; i < channels_playback; ++i) {
basew->outputs->strips[i]->setLabels(); basew->playbacks->strips[i]->targets->setLabels();
basew->outputs->strips[i]->setLabels();
} }
if (h9632_aeb.aebo && !h9632_aeb.aebi) { if (h9632_aeb.aebo && !h9632_aeb.aebi) {
basew->inputs->empty_aebi[0]->position(STRIP_WIDTH*(channels-4), basew->inputs->empty_aebi[0]->y()); basew->inputs->empty_aebi[0]->position(STRIP_WIDTH*(channels_input-4), basew->inputs->empty_aebi[0]->y());
basew->inputs->empty_aebi[1]->position(STRIP_WIDTH*(channels-2), basew->inputs->empty_aebi[1]->y()); basew->inputs->empty_aebi[1]->position(STRIP_WIDTH*(channels_input-2), basew->inputs->empty_aebi[1]->y());
} else if (h9632_aeb.aebi && !h9632_aeb.aebo) { } else if (h9632_aeb.aebi && !h9632_aeb.aebo) {
basew->playbacks->empty_aebo[0]->position(STRIP_WIDTH*(channels-4), basew->playbacks->empty_aebo[0]->y()); basew->playbacks->empty_aebo[0]->position(STRIP_WIDTH*(channels_playback-4), basew->playbacks->empty_aebo[0]->y());
basew->playbacks->empty_aebo[1]->position(STRIP_WIDTH*(channels-2), basew->playbacks->empty_aebo[1]->y()); basew->playbacks->empty_aebo[1]->position(STRIP_WIDTH*(channels_playback-2), basew->playbacks->empty_aebo[1]->y());
basew->outputs->empty_aebo[0]->position(STRIP_WIDTH*(channels-4), basew->outputs->empty_aebo[0]->y()); basew->outputs->empty_aebo[0]->position(STRIP_WIDTH*(channels_playback-4), basew->outputs->empty_aebo[0]->y());
basew->outputs->empty_aebo[1]->position(STRIP_WIDTH*(channels-2), basew->outputs->empty_aebo[1]->y()); basew->outputs->empty_aebo[1]->position(STRIP_WIDTH*(channels_playback-2), basew->outputs->empty_aebo[1]->y());
} }
basew->inputs->buttons->position(STRIP_WIDTH*channels, basew->inputs->buttons->y()); basew->inputs->buttons->position(STRIP_WIDTH*channels_input, basew->inputs->buttons->y());
basew->inputs->init_sizes(); basew->inputs->init_sizes();
basew->playbacks->empty->position(STRIP_WIDTH*channels, basew->playbacks->empty->y()); basew->playbacks->empty->position(STRIP_WIDTH*channels_playback, basew->playbacks->empty->y());
basew->playbacks->init_sizes(); basew->playbacks->init_sizes();
basew->outputs->empty->position(STRIP_WIDTH*(channels+lineouts), basew->outputs->empty->y()); basew->outputs->empty->position(STRIP_WIDTH*(channels_playback), basew->outputs->empty->y());
basew->outputs->init_sizes(); basew->outputs->init_sizes();
basew->inputs->size(window_width, basew->inputs->h()); basew->inputs->size(window_width, basew->inputs->h());
basew->playbacks->size(window_width, basew->playbacks->h()); basew->playbacks->size(window_width, basew->playbacks->h());
@ -401,30 +543,26 @@ void HDSPMixerCard::setMode(int mode)
void HDSPMixerCard::actualizeStrips() void HDSPMixerCard::actualizeStrips()
{ {
for (int i = 0; i < HDSP_MAX_CHANNELS; ++i) { for (int i = 0; i < HDSP_MAX_CHANNELS; ++i) {
if (i < channels) { if (i < channels_input) {
basew->inputs->strips[i]->show(); basew->inputs->strips[i]->show();
} else {
basew->inputs->strips[i]->hide();
}
if (i < channels_playback) {
basew->playbacks->strips[i]->show(); basew->playbacks->strips[i]->show();
basew->outputs->strips[i]->show(); basew->outputs->strips[i]->show();
} else { } else {
basew->inputs->strips[i]->hide();
basew->playbacks->strips[i]->hide(); basew->playbacks->strips[i]->hide();
basew->outputs->strips[i]->hide(); basew->outputs->strips[i]->hide();
} }
} }
for (int i = channels; i < channels+2; ++i) {
if (i < channels+lineouts) {
basew->outputs->strips[i]->show();
} else {
basew->outputs->strips[i]->hide();
}
}
if (h9632_aeb.aebi && !h9632_aeb.aebo) { if (h9632_aeb.aebi && !h9632_aeb.aebo) {
for (int i = 0; i < 2; ++i) { for (int i = 0; i < 2; ++i) {
basew->inputs->empty_aebi[i]->hide(); basew->inputs->empty_aebi[i]->hide();
basew->playbacks->empty_aebo[i]->show(); basew->playbacks->empty_aebo[i]->show();
basew->outputs->empty_aebo[i]->show(); basew->outputs->empty_aebo[i]->show();
} }
for (int i = channels-4; i < channels; ++i) { for (int i = channels_playback-4; i < channels_playback; ++i) {
basew->playbacks->strips[i]->hide(); basew->playbacks->strips[i]->hide();
basew->outputs->strips[i]->hide(); basew->outputs->strips[i]->hide();
} }
@ -434,7 +572,7 @@ void HDSPMixerCard::actualizeStrips()
basew->playbacks->empty_aebo[i]->hide(); basew->playbacks->empty_aebo[i]->hide();
basew->outputs->empty_aebo[i]->hide(); basew->outputs->empty_aebo[i]->hide();
} }
for (int i = channels-4; i < channels; ++i) { for (int i = channels_input-4; i < channels_input; ++i) {
basew->inputs->strips[i]->hide(); basew->inputs->strips[i]->hide();
} }
} else { } else {

View file

@ -26,6 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include <alsa/asoundlib.h> #include <alsa/asoundlib.h>
#include <alsa/sound/hdsp.h> #include <alsa/sound/hdsp.h>
#include <alsa/sound/hdspm.h>
#include "defines.h" #include "defines.h"
#include "HDSPMixerWindow.h" #include "HDSPMixerWindow.h"
@ -36,15 +37,16 @@ class HDSPMixerCard
private: private:
snd_ctl_t *cb_handle; snd_ctl_t *cb_handle;
snd_async_handler_t *cb_handler; snd_async_handler_t *cb_handler;
public: public:
HDSPMixerWindow *basew; HDSPMixerWindow *basew;
char name[6]; char name[6];
HDSPMixerCard(HDSP_IO_Type cardtype, int id); HDSPMixerCard(int cardtype, int id);
int channels, lineouts, window_width, window_height, card_id; int channels_input, channels_playback, window_width, window_height, card_id;
HDSP_IO_Type type; int type;
char *channel_map; char *channel_map_input, *channel_map_playback;
char *dest_map; char *dest_map;
char *meter_map; char *meter_map_input, *meter_map_playback;
int speed_mode; int speed_mode;
int playbacks_offset; int playbacks_offset;
void setMode(int mode); void setMode(int mode);

View file

@ -31,7 +31,7 @@ HDSPMixerFader::HDSPMixerFader(int x, int y, double r, int id, int src):Fl_Widge
ref = r; ref = r;
basew = (HDSPMixerWindow *)window(); basew = (HDSPMixerWindow *)window();
anchor = lastpos = lasty = drag = shift_orig = y_orig = 0; anchor = lastpos = lasty = drag = shift_orig = y_orig = 0;
for (int i = 0; i < 14; i++) { for (int i = 0; i < HDSP_MAX_DEST; i++) {
pos[i] = 0; pos[i] = 0;
} }
} }

View file

@ -49,7 +49,7 @@ public:
int posToInt(int p); int posToInt(int p);
int non_submix_dest; int non_submix_dest;
int dest; int dest;
int pos[14]; int pos[HDSP_MAX_DEST];
HDSPMixerWindow *basew; HDSPMixerWindow *basew;
HDSPMixerFader *relative; HDSPMixerFader *relative;
HDSPMixerGain *gain; HDSPMixerGain *gain;

View file

@ -35,7 +35,7 @@ class HDSPMixerInputs:public Fl_Group
{ {
public: public:
HDSPMixerButtons *buttons; HDSPMixerButtons *buttons;
HDSPMixerIOMixer *strips[26]; HDSPMixerIOMixer *strips[HDSP_MAX_CHANNELS];
HDSPMixerInputs(int x, int y, int w, int h, int nchannels); HDSPMixerInputs(int x, int y, int w, int h, int nchannels);
HDSPMixerEmpty *empty_aebi[2]; HDSPMixerEmpty *empty_aebi[2];
}; };

View file

@ -61,8 +61,10 @@ int HDSPMixerMaster::handle(int e)
} else { } else {
mute = 1; mute = 1;
} }
for (int i = 0; i < basew->cards[basew->current_card]->channels; i++) { for (int i = 0; i < basew->cards[basew->current_card]->channels_input; i++) {
basew->inputs->strips[i]->mutesolo->redraw(); basew->inputs->strips[i]->mutesolo->redraw();
}
for (int i = 0; i < basew->cards[basew->current_card]->channels_playback; i++) {
basew->playbacks->strips[i]->mutesolo->redraw(); basew->playbacks->strips[i]->mutesolo->redraw();
} }
basew->refreshMixer(); basew->refreshMixer();
@ -76,8 +78,10 @@ int HDSPMixerMaster::handle(int e)
} else { } else {
solo = 1; solo = 1;
} }
for (int i = 0; i < basew->cards[basew->current_card]->channels; i++) { for (int i = 0; i < basew->cards[basew->current_card]->channels_input; i++) {
basew->inputs->strips[i]->mutesolo->redraw(); basew->inputs->strips[i]->mutesolo->redraw();
}
for (int i = 0; i < basew->cards[basew->current_card]->channels_playback; i++) {
basew->playbacks->strips[i]->mutesolo->redraw(); basew->playbacks->strips[i]->mutesolo->redraw();
} }
basew->refreshMixer(); basew->refreshMixer();

View file

@ -129,8 +129,11 @@ int HDSPMixerMuteSolo::handle(int e)
void HDSPMixerMuteSolo::redraw_all() void HDSPMixerMuteSolo::redraw_all()
{ {
for (int i = 0; i < (basew->cards[basew->current_card]->channels); ++i) { for (int i = 0; i < (basew->cards[basew->current_card]->channels_input); ++i) {
basew->inputs->strips[i]->mutesolo->redraw(); basew->inputs->strips[i]->mutesolo->redraw();
}
for (int i = 0; i < (basew->cards[basew->current_card]->channels_playback); ++i) {
basew->playbacks->strips[i]->mutesolo->redraw(); basew->playbacks->strips[i]->mutesolo->redraw();
} }
} }

View file

@ -21,6 +21,106 @@
#pragma implementation #pragma implementation
#include "HDSPMixerOutput.h" #include "HDSPMixerOutput.h"
static char *labels_madi_ss[64] = {
"1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11", "12", "13", "14", "15", "16",
"17", "18", "19", "20", "21", "22", "23", "24",
"25", "26", "27", "28", "29", "30", "31", "32",
"33", "34", "35", "36", "37", "38", "39", "40",
"41", "42", "43", "44", "45", "46", "47", "48",
"49", "50", "51", "52", "53", "54", "55", "56",
"57", "58", "59", "60", "61", "62", "63", "64"
};
static char *labels_madi_ds[64] = {
"1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11", "12", "13", "14", "15", "16",
"17", "18", "19", "20", "21", "22", "23", "24",
"25", "26", "27", "28", "29", "30", "31", "32",
};
static char *labels_madi_qs[16] = {
"1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11", "12", "13", "14", "15", "16",
};
static char *labels_raydat_ss[36] = {
"A1.1", "A1.2", "A1.3", "A1.4", "A1.5", "A1.6", "A1.7", "A1.8",
"A2.1", "A2.2", "A2.3", "A2.4", "A2.5", "A2.6", "A2.7", "A2.8",
"A3.1", "A3.2", "A3.3", "A3.4", "A3.5", "A3.6", "A3.7", "A3.8",
"A4.1", "A4.2", "A4.3", "A4.4", "A4.5", "A4.6", "A4.7", "A4.8",
"AES.L", "AES.R",
"SP.L", "SP.R"
};
static char *labels_raydat_ds[20] = {
"A1.1", "A1.2", "A1.3", "A1.4",
"A2.1", "A2.2", "A2.3", "A2.4",
"A3.1", "A3.2", "A3.3", "A3.4",
"A4.1", "A4.2", "A4.3", "A4.4",
"AES.L", "AES.R",
"SP.L", "SP.R"
};
static char *labels_raydat_qs[12] = {
"A1.1", "A1.2",
"A2.1", "A2.2",
"A3.1", "A3.2",
"A4.1", "A4.2",
"AES.L", "AES.R",
"SP.L", "SP.R"
};
static char *labels_aio_ss_input[14] = {
"AN 1", "AN 2",
"SP.L", "SP.R",
"AES.L", "AES.R",
"A 1", "A 2", "A 3", "A 4",
"A 5", "A 6", "A 7", "A 8"
};
static char *labels_aio_ss_playback[16] = {
"AN 1", "AN 2",
"SP.L", "SP.R",
"AES.L", "AES.R",
"A 1", "A 2", "A 3", "A 4",
"A 5", "A 6", "A 7", "A 8",
"PH.L", "PH.R"
};
static char *labels_aio_ds_input[10] = {
"AN 1", "AN 2",
"SP.L", "SP.R",
"AES.L", "AES.R",
"A 1", "A 2", "A 3", "A 4"
};
static char *labels_aio_ds_playback[12] = {
"AN 1", "AN 2",
"SP.L", "SP.R",
"AES.L", "AES.R",
"A 1", "A 2", "A 3", "A 4",
"PH.L", "PH.R"
};
static char *labels_aio_qs_input[8] = {
"AN 1", "AN 2",
"SP.L", "SP.R",
"AES.L", "AES.R",
"A 1", "A 2"
};
static char *labels_aio_qs_playback[10] = {
"AN 1", "AN 2",
"SP.L", "SP.R",
"AES.L", "AES.R",
"A 1", "A 2",
"PH.L", "PH.R",
};
static char *labels_mf_ss[20] = { static char *labels_mf_ss[20] = {
"AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6", "AN 7", "AN 8", "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", "A 1", "A 2", "A 3", "A 4", "A 5", "A 6", "A 7", "A 8",
@ -33,6 +133,7 @@ static char *labels_mf_ds[16] = {
"SP.L", "SP.R", "AN.L", "AN.R" "SP.L", "SP.R", "AN.L", "AN.R"
}; };
static char *labels_df_ss[28] = { static char *labels_df_ss[28] = {
"A1 1", "A1 2", "A1 3", "A1 4", "A1 5", "A1 6", "A1 7", "A1 8", "A1 1", "A1 2", "A1 3", "A1 4", "A1 5", "A1 6", "A1 7", "A1 8",
"A2 1", "A2 2", "A2 3", "A2 4", "A2 5", "A2 6", "A2 7", "A2 8", "A2 1", "A2 2", "A2 3", "A2 4", "A2 5", "A2 6", "A2 7", "A2 8",
@ -88,30 +189,72 @@ HDSPMixerOutput::HDSPMixerOutput(int x, int y, int w, int h, int num):Fl_Group(x
void HDSPMixerOutput::setLabels() void HDSPMixerOutput::setLabels()
{ {
HDSP_IO_Type type = basew->cards[basew->current_card]->type; int type = basew->cards[basew->current_card]->type;
int sm = basew->cards[basew->current_card]->speed_mode; int sm = basew->cards[basew->current_card]->speed_mode;
if (type == H9632) { if (type == H9632) {
switch (sm) { switch (sm) {
case 0: case 0:
labels = labels_9632_ss; labels_input = labels_playback = labels_9632_ss;
break; break;
case 1: case 1:
labels = labels_9632_ds; labels_input = labels_playback = labels_9632_ds;
break; break;
case 2: case 2:
labels = labels_9632_qs; labels_input = labels_playback = labels_9632_qs;
break; break;
} }
} else if (type == Multiface) { } else if (type == Multiface) {
if (sm) if (sm)
labels = labels_mf_ds; labels_input = labels_playback = labels_mf_ds;
else else
labels = labels_mf_ss; labels_input = labels_playback = labels_mf_ss;
} else { } else if (type == Digiface) {
if (sm) if (sm)
labels = labels_df_ds; labels_input = labels_playback = labels_df_ds;
else else
labels = labels_df_ss; labels_input = labels_playback = labels_df_ss;
} else if (HDSPeMADI == type) {
switch (sm) {
case 0:
labels_input = labels_playback = labels_madi_ss;
break;
case 1:
labels_input = labels_playback = labels_madi_ds;
break;
case 2:
labels_input = labels_playback = labels_madi_qs;
break;
}
} else if (HDSPeAIO == type) {
switch (sm) {
case 0:
labels_input = labels_aio_ss_input;
labels_playback = labels_aio_ss_playback;
break;
case 1:
labels_input = labels_aio_ds_input;
labels_playback = labels_aio_ds_playback;
break;
case 2:
labels_input = labels_aio_qs_input;
labels_playback = labels_aio_ds_playback;
break;
}
} else if (HDSPeRayDAT == type) {
switch (sm) {
case 0:
labels_input = labels_playback = labels_raydat_ss;
break;
case 1:
labels_input = labels_playback = labels_raydat_ds;
break;
case 2:
labels_input = labels_playback = labels_raydat_qs;
break;
}
} else {
fprintf(stderr, "Unknown card type for output labels\n");
} }
} }
@ -134,7 +277,7 @@ void HDSPMixerOutput::draw()
draw_background(); draw_background();
fl_color(FL_BLACK); fl_color(FL_BLACK);
fl_font(FL_HELVETICA, 8); fl_font(FL_HELVETICA, 8);
fl_draw(labels[out_num], x()+4, y()+193, 27, 9, FL_ALIGN_CENTER); fl_draw(labels_playback[out_num], x()+4, y()+193, 27, 9, FL_ALIGN_CENTER);
for (int i=children(); i--;) { for (int i=children(); i--;) {
Fl_Widget& o = **a++; Fl_Widget& o = **a++;
draw_child(o); draw_child(o);

View file

@ -46,7 +46,7 @@ class HDSPMixerOutput:public Fl_Group
{ {
private: private:
int out_num; int out_num;
char **labels; char **labels_input, **labels_playback;
char **p_output_xpm; char **p_output_xpm;
HDSPMixerPeak *peak; HDSPMixerPeak *peak;
HDSPMixerWindow *basew; HDSPMixerWindow *basew;

View file

@ -35,7 +35,7 @@ class HDSPMixerOutputs:public Fl_Group
public: public:
HDSPMixerEmpty *empty_aebo[2]; HDSPMixerEmpty *empty_aebo[2];
HDSPMixerEmpty *empty; HDSPMixerEmpty *empty;
HDSPMixerOutput *strips[28]; HDSPMixerOutput *strips[HDSP_MAX_CHANNELS+2];
HDSPMixerOutputs(int x, int y, int w, int h, int nchannels); HDSPMixerOutputs(int x, int y, int w, int h, int nchannels);
}; };

View file

@ -27,7 +27,7 @@ HDSPMixerPan::HDSPMixerPan(int x, int y, int id, int src):Fl_Widget(x, y, 30, 13
index = id; index = id;
basew = (HDSPMixerWindow *)window(); basew = (HDSPMixerWindow *)window();
dest = x_orig = shift_orig = lastpos = lastx = drag = 0; dest = x_orig = shift_orig = lastpos = lastx = drag = 0;
for (int i = 0; i < 14; i++) { for (int i = 0; i < HDSP_MAX_DEST; i++) {
pos[i] = 0; pos[i] = 0;
} }
} }

View file

@ -28,6 +28,7 @@
#include "HDSPMixerIOMixer.h" #include "HDSPMixerIOMixer.h"
#include "HDSPMixerWindow.h" #include "HDSPMixerWindow.h"
#include "pixmaps.h" #include "pixmaps.h"
#include "defines.h"
class HDSPMixerIOMixer; class HDSPMixerIOMixer;
class HDSPMixerWindow; class HDSPMixerWindow;
@ -39,7 +40,7 @@ private:
void sendText(); void sendText();
void panToText(char *s); void panToText(char *s);
public: public:
int pos[14]; int pos[HDSP_MAX_DEST];
int dest; int dest;
int index; int index;
int source; int source;

View file

@ -34,7 +34,7 @@ class HDSPMixerPlaybacks:public Fl_Group
public: public:
HDSPMixerEmpty *empty_aebo[2]; HDSPMixerEmpty *empty_aebo[2];
HDSPMixerEmpty *empty; HDSPMixerEmpty *empty;
HDSPMixerIOMixer *strips[26]; HDSPMixerIOMixer *strips[HDSP_MAX_CHANNELS];
HDSPMixerPlaybacks(int x, int y, int w, int h, int nchannels); HDSPMixerPlaybacks(int x, int y, int w, int h, int nchannels);
}; };

View file

@ -193,18 +193,21 @@ void HDSPMixerPresets::restore_preset(int prst) {
basew->outputs->strips[HDSP_MAX_CHANNELS]->fader->pos[0] = basew->outputs->strips[HDSP_MAX_CHANNELS+1]->data[card][speed][p]->fader_pos; basew->outputs->strips[HDSP_MAX_CHANNELS]->fader->pos[0] = basew->outputs->strips[HDSP_MAX_CHANNELS+1]->data[card][speed][p]->fader_pos;
basew->outputs->strips[HDSP_MAX_CHANNELS+1]->fader->pos[0] = basew->outputs->strips[HDSP_MAX_CHANNELS+1]->data[card][speed][p]->fader_pos; basew->outputs->strips[HDSP_MAX_CHANNELS+1]->fader->pos[0] = basew->outputs->strips[HDSP_MAX_CHANNELS+1]->data[card][speed][p]->fader_pos;
for (int i = 0; i < basew->cards[card]->channels; ++i) { for (int i = 0; i < basew->cards[card]->channels_input; ++i) {
basew->inputs->strips[i]->fader->sendGain(); basew->inputs->strips[i]->fader->sendGain();
basew->inputs->strips[i]->redraw(); basew->inputs->strips[i]->redraw();
}
for (int i = 0; i < basew->cards[card]->channels_playback; ++i) {
basew->playbacks->strips[i]->fader->sendGain(); basew->playbacks->strips[i]->fader->sendGain();
basew->playbacks->strips[i]->redraw(); basew->playbacks->strips[i]->redraw();
basew->outputs->strips[i]->fader->sendGain(); basew->outputs->strips[i]->fader->sendGain();
basew->outputs->strips[i]->redraw(); basew->outputs->strips[i]->redraw();
} }
basew->outputs->strips[basew->cards[card]->channels]->fader->sendGain(); basew->outputs->strips[basew->cards[card]->channels_playback]->fader->sendGain();
basew->outputs->strips[basew->cards[card]->channels]->redraw(); basew->outputs->strips[basew->cards[card]->channels_playback]->redraw();
basew->outputs->strips[basew->cards[card]->channels+1]->fader->sendGain(); basew->outputs->strips[basew->cards[card]->channels_playback+1]->fader->sendGain();
basew->outputs->strips[basew->cards[card]->channels+1]->redraw(); basew->outputs->strips[basew->cards[card]->channels_playback+1]->redraw();
/* Global settings */ /* Global settings */
basew->inputs->buttons->view->input = basew->data[card][speed][p]->input; basew->inputs->buttons->view->input = basew->data[card][speed][p]->input;

View file

@ -21,6 +21,83 @@
#pragma implementation #pragma implementation
#include "HDSPMixerSelector.h" #include "HDSPMixerSelector.h"
static char *destinations_madi_ss[32] = {
"1+2", "3+4", "5+6", "7+8",
"9+10", "11+12", "13+14", "15+16",
"17+18", "19+20", "21+22", "23+24",
"25+26", "27+28", "29+30", "31+32",
"33+34", "35+36", "37+38", "39+40",
"41+42", "43+44", "45+46", "47+48",
"49+50", "51+52", "53+54", "55+56",
"57+58", "59+60", "61+62", "63+64"
};
static char *destinations_madi_ds[16] = {
"1+2", "3+4", "5+6", "7+8",
"9+10", "11+12", "13+14", "15+16",
"17+18", "19+20", "21+22", "23+24",
"25+26", "27+28", "29+30", "31+32",
};
static char *destinations_madi_qs[8] = {
"1+2", "3+4", "5+6", "7+8",
"9+10", "11+12", "13+14", "15+16",
};
static char *destinations_raydat_ss[18] = {
"A1 1+2", "A1 3+4", "A1 5+6", "A1 7+8",
"A2 1+2", "A2 3+4", "A2 5+6", "A2 7+8",
"A3 1+2", "A3 3+4", "A3 5+6", "A3 7+8",
"A4 1+2", "A4 3+4", "A4 5+6", "A4 7+8",
"AES",
"SPDIF"
};
static char *destinations_raydat_ds[10] = {
"A1 1+2", "A1 3+4",
"A2 1+2", "A2 3+4",
"A3 1+2", "A3 3+4",
"A4 1+2", "A4 3+4",
"AES",
"SPDIF"
};
static char *destinations_raydat_qs[6] = {
"A1 1+2",
"A2 1+2",
"A3 1+2",
"A4 1+2",
"AES",
"SPDIF"
};
static char *destinations_aio_ss[8] = {
"AN 1+2",
"AES",
"SPDIF",
"A 1+2", "A 3+4", "A 5+6", "A 7+8",
"Phones",
};
static char *destinations_aio_ds[6] = {
"AN 1+2",
"AES",
"SPDIF",
"A 1+2", "A 3+4"
"Phones",
};
static char *destinations_aio_qs[5] = {
"AN 1+2",
"AES",
"SPDIF",
"A 1+2"
"Phones",
};
static char *destinations_mf_ss[10] = { static char *destinations_mf_ss[10] = {
"AN 1+2", "AN 3+4", "AN 5+6", "AN 7+8", "AN 1+2", "AN 3+4", "AN 5+6", "AN 7+8",
"A 1+2", "A 3+4", "A 5+6", "A 7+8", "A 1+2", "A 3+4", "A 5+6", "A 7+8",
@ -135,7 +212,7 @@ int HDSPMixerSelector::handle(int e) {
void HDSPMixerSelector::setLabels() void HDSPMixerSelector::setLabels()
{ {
HDSP_IO_Type type; int type;
hdsp_9632_aeb_t *aeb; hdsp_9632_aeb_t *aeb;
int sm; int sm;
clear(); clear();
@ -199,7 +276,54 @@ void HDSPMixerSelector::setLabels()
destinations = destinations_h9632_qs; destinations = destinations_h9632_qs;
break; break;
} }
} else if (HDSPeMADI == type) {
switch (sm) {
case 0:
max_dest = 32;
destinations = destinations_madi_ss;
break;
case 1:
max_dest = 16;
destinations = destinations_madi_ds;
break;
case 2:
max_dest = 8;
destinations = destinations_madi_qs;
break;
}
} else if (HDSPeAIO == type) {
switch (sm) {
case 0:
max_dest = 8;
destinations = destinations_aio_ss;
break;
case 1:
max_dest = 6;
destinations = destinations_aio_ds;
break;
case 2:
max_dest = 5;
destinations = destinations_aio_qs;
break;
}
} else if (HDSPeRayDAT == type) {
switch (sm) {
case 0:
max_dest = 18;
destinations = destinations_raydat_ss;
break;
case 1:
max_dest = 10;
destinations = destinations_raydat_ds;
break;
case 2:
max_dest = 6;
destinations = destinations_raydat_qs;
break;
}
} }
for (int i = 0; i < max_dest; ++i) { for (int i = 0; i < max_dest; ++i) {
add(destinations[i], 0, 0, 0, FL_MENU_TOGGLE); add(destinations[i], 0, 0, 0, FL_MENU_TOGGLE);

View file

@ -22,14 +22,16 @@
#ifndef HDSPMixerStripData_H #ifndef HDSPMixerStripData_H
#define HDSPMixerStripData_H #define HDSPMixerStripData_H
#include "defines.h"
class HDSPMixerStripData class HDSPMixerStripData
{ {
public: public:
int mute; int mute;
int solo; int solo;
int pan_pos[14]; int pan_pos[HDSP_MAX_DEST];
int fader_pos[14]; int fader_pos[HDSP_MAX_DEST];
int dest; int dest;
HDSPMixerStripData(); HDSPMixerStripData();
}; };

View file

@ -16,6 +16,10 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* @version 04-12-2009 [FF]
* - updated deprecated fl_ask calls
*
*/ */
#pragma implementation #pragma implementation
@ -25,7 +29,8 @@ static void readregisters_cb(void *arg)
{ {
int err; int err;
snd_hwdep_t *hw; snd_hwdep_t *hw;
hdsp_peak_rms_t peak_rms; hdsp_peak_rms_t hdsp_peak_rms;
struct hdspm_peak_rms hdspm_peak_rms;
HDSPMixerWindow *w = (HDSPMixerWindow *)arg; HDSPMixerWindow *w = (HDSPMixerWindow *)arg;
@ -39,49 +44,52 @@ static void readregisters_cb(void *arg)
return; return;
} }
if ((err = snd_hwdep_ioctl(hw, SNDRV_HDSP_IOCTL_GET_PEAK_RMS, (void *)&peak_rms)) < 0) { if ((HDSPeMADI == w->cards[w->current_card]->type) ||
(HDSPeAIO == w->cards[w->current_card]->type) ||
(HDSPeRayDAT == w->cards[w->current_card]->type)) {
if ((err = snd_hwdep_ioctl(hw, SNDRV_HDSPM_IOCTL_GET_PEAK_RMS, (void *)&hdspm_peak_rms)) < 0) {
fprintf(stderr, "HwDep ioctl failed. Metering stopped\n"); fprintf(stderr, "HwDep ioctl failed. Metering stopped\n");
snd_hwdep_close(hw); snd_hwdep_close(hw);
return; return;
}
} else {
if ((err = snd_hwdep_ioctl(hw, SNDRV_HDSP_IOCTL_GET_PEAK_RMS, (void *)&hdsp_peak_rms)) < 0) {
fprintf(stderr, "HwDep ioctl failed. Metering stopped\n");
snd_hwdep_close(hw);
return;
}
}
snd_hwdep_close(hw);
// check for speed change
if (hdspm_peak_rms.speed != w->cards[w->current_card]->speed_mode) {
w->cards[w->current_card]->setMode(hdspm_peak_rms.speed);
} }
snd_hwdep_close(hw);
if (w->inputs->buttons->input) { if (w->inputs->buttons->input) {
for (int i = 0; i < w->cards[w->current_card]->channels; ++i) { for (int i = 0; i < w->cards[w->current_card]->channels_input; ++i) {
w->inputs->strips[i]->meter->update(peak_rms.input_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xffffff00, w->inputs->strips[i]->meter->update(hdspm_peak_rms.input_peaks[(w->cards[w->current_card]->meter_map_input[i])] & 0xffffff00,
peak_rms.input_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xf, hdspm_peak_rms.input_peaks[(w->cards[w->current_card]->meter_map_input[i])] & 0xf,
peak_rms.input_rms[(w->cards[w->current_card]->meter_map[i])]); hdspm_peak_rms.input_rms[(w->cards[w->current_card]->meter_map_input[i])]);
} }
} }
if (w->inputs->buttons->playback) { if (w->inputs->buttons->playback) {
for (int i = 0; i < w->cards[w->current_card]->channels; ++i) { for (int i = 0; i < w->cards[w->current_card]->channels_playback; ++i) {
w->playbacks->strips[i]->meter->update(peak_rms.playback_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xffffff00, w->playbacks->strips[i]->meter->update(hdspm_peak_rms.playback_peaks[(w->cards[w->current_card]->meter_map_playback[i])] & 0xffffff00,
peak_rms.playback_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xf, hdspm_peak_rms.playback_peaks[(w->cards[w->current_card]->meter_map_playback[i])] & 0xf,
peak_rms.playback_rms[(w->cards[w->current_card]->meter_map[i])]); hdspm_peak_rms.playback_rms[(w->cards[w->current_card]->meter_map_playback[i])]);
} }
} }
if (w->inputs->buttons->output) { if (w->inputs->buttons->output) {
if (w->cards[w->current_card]->type != H9652) { for (int i = 0; i < w->cards[w->current_card]->channels_playback; ++i) {
for (int i = 0; i < w->cards[w->current_card]->channels; ++i) { w->outputs->strips[i]->meter->update(hdspm_peak_rms.output_peaks[(w->cards[w->current_card]->meter_map_playback[i])] & 0xffffff00,
w->outputs->strips[i]->meter->update(peak_rms.output_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xffffff00, hdspm_peak_rms.output_peaks[(w->cards[w->current_card]->meter_map_playback[i])] & 0xf,
peak_rms.output_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xf, hdspm_peak_rms.output_rms[(w->cards[w->current_card]->meter_map_playback[i])]);
0 ); }
}
for (int i = 0; i < w->cards[w->current_card]->lineouts; ++i) {
w->outputs->strips[w->cards[w->current_card]->channels+i]->meter->update(peak_rms.output_peaks[26+i] & 0xffffff00,
peak_rms.output_peaks[26+i] & 0xf,
0 );
}
} else {
for (int i = 0; i < w->cards[w->current_card]->channels; ++i) {
w->outputs->strips[i]->meter->update(peak_rms.output_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xffffff00,
peak_rms.output_peaks[(w->cards[w->current_card]->meter_map[i])] & 0xf,
peak_rms.output_rms[(w->cards[w->current_card]->meter_map[i])] );
}
}
} }
Fl::add_timeout(0.03, readregisters_cb, w); Fl::add_timeout(0.03, readregisters_cb, w);
} }
@ -90,7 +98,7 @@ static void exit_cb(Fl_Widget *widget, void *arg)
{ {
HDSPMixerWindow *w = (HDSPMixerWindow *)arg; HDSPMixerWindow *w = (HDSPMixerWindow *)arg;
if (w->dirty) { if (w->dirty) {
if (!fl_ask("There are unsaved changes, quit anyway ?")) return; if (!fl_choice("There are unsaved changes, quit anyway ?", "Return", "Quit", NULL)) return;
} }
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
@ -202,7 +210,7 @@ static void restore_defaults_cb(Fl_Widget *widget, void *arg)
HDSPMixerWindow *w = (HDSPMixerWindow *)arg; HDSPMixerWindow *w = (HDSPMixerWindow *)arg;
int i = 0; int i = 0;
if (w->dirty) { if (w->dirty) {
if (!fl_ask("There are unsaved changes, restore factory settings anyway ?")) return; if (!fl_choice("There are unsaved changes, restore factory settings anyway ?", "Don't restore", "Restore them", NULL)) return;
} }
w->prefs->deleteEntry("default_file"); w->prefs->deleteEntry("default_file");
w->prefs->flush(); w->prefs->flush();
@ -228,7 +236,7 @@ static void atclose_cb(Fl_Window *w, void *arg)
{ {
if (strncmp("HDSPMixer", w->label(), 9) == 0) { if (strncmp("HDSPMixer", w->label(), 9) == 0) {
if (((HDSPMixerWindow *)w)->dirty) { if (((HDSPMixerWindow *)w)->dirty) {
if (!fl_ask("There are unsaved changes, quit anyway ?")) return; if (!fl_choice("There are unsaved changes, quit anyway ?", "Don't quit", "Quit", NULL)) return;
} }
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
@ -254,7 +262,7 @@ static int handler_cb(int event)
case FL_SHORTCUT: case FL_SHORTCUT:
if (key == FL_Escape) { if (key == FL_Escape) {
if (w->dirty) { if (w->dirty) {
if (!fl_ask("There are unsaved changes, quit anyway ?")) return 1; if (!fl_choice("There are unsaved changes, quit anyway ?", "Don't quit", "Quit", NULL)) return 1;
} }
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
@ -495,7 +503,6 @@ load_error:
void HDSPMixerWindow::restoreDefaults(int card) void HDSPMixerWindow::restoreDefaults(int card)
{ {
int phones;
int chnls[3]; int chnls[3];
int maxdest[3]; int maxdest[3];
int h9632_spdif_submix[3]; int h9632_spdif_submix[3];
@ -508,21 +515,18 @@ void HDSPMixerWindow::restoreDefaults(int card)
chnls[1] = 14; chnls[1] = 14;
maxdest[0] = 10; maxdest[0] = 10;
maxdest[1] = 8; maxdest[1] = 8;
phones = 1;
break; break;
case Digiface: case Digiface:
chnls[0] = 26; chnls[0] = 26;
chnls[1] = 14; chnls[1] = 14;
maxdest[0] = 14; maxdest[0] = 14;
maxdest[1] = 8; maxdest[1] = 8;
phones = 1;
break; break;
case H9652: case H9652:
chnls[0] = 26; chnls[0] = 26;
chnls[1] = 14; chnls[1] = 14;
maxdest[0] = 13; maxdest[0] = 13;
maxdest[1] = 7; maxdest[1] = 7;
phones = 0;
break; break;
case H9632: case H9632:
chnls[0] = 16; chnls[0] = 16;
@ -538,8 +542,35 @@ void HDSPMixerWindow::restoreDefaults(int card)
h9632_an12_submix[1] = 3; h9632_an12_submix[1] = 3;
h9632_an12_submix[2] = 1; h9632_an12_submix[2] = 1;
num_modes = 3; num_modes = 3;
phones = 0;
break; break;
case HDSPeMADI:
chnls[0] = 64;
chnls[1] = 32;
chnls[2] = 16;
maxdest[0] = 32;
maxdest[1] = 16;
maxdest[2] = 8;
num_modes = 3;
break;
case HDSPeAIO:
chnls[0] = 14;
chnls[1] = 10;
chnls[2] = 8;
maxdest[0] = 8;
maxdest[1] = 6;
maxdest[2] = 5;
num_modes = 3;
break;
case HDSPeRayDAT:
chnls[0] = 36;
chnls[1] = 20;
chnls[2] = 12;
maxdest[0] = 18;
maxdest[1] = 10;
maxdest[2] = 6;
num_modes = 3;
break;
default: default:
/* should never happen */ /* should never happen */
return; return;
@ -560,13 +591,13 @@ void HDSPMixerWindow::restoreDefaults(int card)
((preset == 1 && z == h9632_an12_submix[speed]) || i == z*2 || (preset == 5 && z == h9632_spdif_submix[speed])) ? ndb : 0; ((preset == 1 && z == h9632_an12_submix[speed]) || i == z*2 || (preset == 5 && z == h9632_spdif_submix[speed])) ? ndb : 0;
} else { } else {
inputs->strips[i]->data[card][speed][preset]->fader_pos[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; ((preset == 6 && z == (maxdest[speed]-1)) || (i == z*2 && (preset > 1 && preset < 4)) || (((preset > 0 && preset < 4) || preset == 7) && (z == maxdest[speed]-1))) ? ndb : 0;
inputs->strips[i+1]->data[card][speed][preset]->fader_pos[z] = 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; ((preset == 6 && z == (maxdest[speed]-1)) || (i == z*2 && (preset > 1 && preset < 4)) || (((preset > 0 && preset < 4) || preset == 7) && (z == maxdest[speed]-1))) ? ndb : 0;
playbacks->strips[i]->data[card][speed][preset]->fader_pos[z] = 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; ((preset > 4 && preset < 7 && z == (maxdest[speed]-1)) || i == z*2 || ((z == maxdest[speed]-1))) ? ndb : 0;
playbacks->strips[i+1]->data[card][speed][preset]->fader_pos[z] = 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; ((preset > 4 && preset < 7 && z == (maxdest[speed]-1)) || i == z*2 || ((z == maxdest[speed]-1))) ? ndb : 0;
} }
/* Pan setup */ /* Pan setup */
inputs->strips[i]->data[card][speed][preset]->pan_pos[z] = 0; inputs->strips[i]->data[card][speed][preset]->pan_pos[z] = 0;
@ -604,7 +635,7 @@ void HDSPMixerWindow::restoreDefaults(int card)
data[card][speed][preset]->submix = 0; data[card][speed][preset]->submix = 0;
} }
} else if (preset > 4 && preset < 7) { } else if (preset > 4 && preset < 7) {
data[card][speed][preset]->submix_value = maxdest[speed]-phones-1; data[card][speed][preset]->submix_value = maxdest[speed]-1;
if (preset == 5) { if (preset == 5) {
outputs->strips[chnls[speed]-2]->data[card][speed][preset]->fader_pos = ndb; outputs->strips[chnls[speed]-2]->data[card][speed][preset]->fader_pos = ndb;
outputs->strips[chnls[speed]-1]->data[card][speed][preset]->fader_pos = ndb; outputs->strips[chnls[speed]-1]->data[card][speed][preset]->fader_pos = ndb;
@ -615,10 +646,6 @@ void HDSPMixerWindow::restoreDefaults(int card)
if (preset == 3 || preset == 7) { if (preset == 3 || preset == 7) {
data[card][speed][preset]->mute = 1; data[card][speed][preset]->mute = 1;
} }
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;
}
} }
} }
} }
@ -669,13 +696,13 @@ HDSPMixerWindow::HDSPMixerWindow(int x, int y, int w, int h, const char *label,
menubar->add("&View/Submix", 's', (Fl_Callback *)submix_cb, (void *)this, FL_MENU_TOGGLE|FL_MENU_VALUE); menubar->add("&View/Submix", 's', (Fl_Callback *)submix_cb, (void *)this, FL_MENU_TOGGLE|FL_MENU_VALUE);
menubar->add("&Options/Level Meter Setup", 'm', (Fl_Callback *)setup_cb, (void *)this); menubar->add("&Options/Level Meter Setup", 'm', (Fl_Callback *)setup_cb, (void *)this);
menubar->add("&?/About", 0, (Fl_Callback *)about_cb, (void *)this); menubar->add("&?/About", 0, (Fl_Callback *)about_cb, (void *)this);
inputs = new HDSPMixerInputs(0, MENU_HEIGHT, w, FULLSTRIP_HEIGHT, cards[0]->channels); inputs = new HDSPMixerInputs(0, MENU_HEIGHT, w, FULLSTRIP_HEIGHT, cards[0]->channels_input);
inputs->buttons->input = 1; inputs->buttons->input = 1;
inputs->buttons->output = 1; inputs->buttons->output = 1;
inputs->buttons->submix = 1; inputs->buttons->submix = 1;
inputs->buttons->playback = 1; inputs->buttons->playback = 1;
playbacks = new HDSPMixerPlaybacks(0, MENU_HEIGHT+FULLSTRIP_HEIGHT, w, FULLSTRIP_HEIGHT, cards[0]->channels); playbacks = new HDSPMixerPlaybacks(0, MENU_HEIGHT+FULLSTRIP_HEIGHT, w, FULLSTRIP_HEIGHT, cards[0]->channels_playback);
outputs = new HDSPMixerOutputs(0, MENU_HEIGHT+FULLSTRIP_HEIGHT*2, w, SMALLSTRIP_HEIGHT, cards[0]->channels); outputs = new HDSPMixerOutputs(0, MENU_HEIGHT+FULLSTRIP_HEIGHT*2, w, SMALLSTRIP_HEIGHT, cards[0]->channels_playback);
scroll->end(); scroll->end();
end(); end();
setup = new HDSPMixerSetup(400, 260, "Level Meters Setup", this); setup = new HDSPMixerSetup(400, 260, "Level Meters Setup", this);
@ -791,11 +818,7 @@ void HDSPMixerWindow::checkState()
if (outputs->strips[i]->data[current_card][speed][p]->fader_pos != outputs->strips[i]->fader->pos[0]) if (outputs->strips[i]->data[current_card][speed][p]->fader_pos != outputs->strips[i]->fader->pos[0])
corrupt++; corrupt++;
} }
/* Line outs */
if (outputs->strips[HDSP_MAX_CHANNELS]->data[current_card][speed][p]->fader_pos != outputs->strips[HDSP_MAX_CHANNELS]->fader->pos[0])
corrupt++;
if (outputs->strips[HDSP_MAX_CHANNELS+1]->data[current_card][speed][p]->fader_pos != outputs->strips[HDSP_MAX_CHANNELS+1]->fader->pos[0])
corrupt++;
/* Global settings */ /* Global settings */
if (data[current_card][speed][p]->mute != inputs->buttons->master->mute) if (data[current_card][speed][p]->mute != inputs->buttons->master->mute)
corrupt++; corrupt++;
@ -839,7 +862,7 @@ void HDSPMixerWindow::checkState()
void HDSPMixerWindow::setSubmix(int submix_value) void HDSPMixerWindow::setSubmix(int submix_value)
{ {
for (int i = 0; i < cards[current_card]->channels; i++) { for (int i = 0; i < cards[current_card]->channels_playback; i++) {
inputs->strips[i]->targets->value(submix_value); inputs->strips[i]->targets->value(submix_value);
inputs->strips[i]->targets->redraw(); inputs->strips[i]->targets->redraw();
inputs->strips[i]->fader->dest = submix_value; inputs->strips[i]->fader->dest = submix_value;
@ -859,7 +882,7 @@ void HDSPMixerWindow::setSubmix(int submix_value)
void HDSPMixerWindow::unsetSubmix() void HDSPMixerWindow::unsetSubmix()
{ {
for (int i = 0; i < cards[current_card]->channels; i++) { for (int i = 0; i < cards[current_card]->channels_input; i++) {
inputs->strips[i]->targets->value(inputs->strips[i]->targets->selected); inputs->strips[i]->targets->value(inputs->strips[i]->targets->selected);
inputs->strips[i]->targets->redraw(); inputs->strips[i]->targets->redraw();
inputs->strips[i]->fader->dest = inputs->strips[i]->targets->selected; inputs->strips[i]->fader->dest = inputs->strips[i]->targets->selected;
@ -881,7 +904,7 @@ void HDSPMixerWindow::unsetSubmix()
void HDSPMixerWindow::refreshMixer() void HDSPMixerWindow::refreshMixer()
{ {
int i, j; int i, j;
for (i = 1; i <= cards[current_card]->channels; ++i) { for (i = 1; i <= cards[current_card]->channels_input; ++i) {
for (j = 0; j < inputs->strips[0]->targets->max_dest; ++j) { for (j = 0; j < inputs->strips[0]->targets->max_dest; ++j) {
setMixer(i, 0, j); setMixer(i, 0, j);
setMixer(i, 1, j); setMixer(i, 1, j);
@ -901,7 +924,7 @@ void HDSPMixerWindow::resetMixer()
{ {
int i, j; int i, j;
for (i = 0; i < (cards[current_card]->playbacks_offset*2) ; ++i) { 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) { for (j = 0; j < (cards[current_card]->playbacks_offset); ++j) {
setGain(i, j, 0); setGain(i, j, 0);
} }
} }
@ -917,6 +940,8 @@ void HDSPMixerWindow::setGain(int in, int out, int value)
snd_ctl_elem_id_t *id; snd_ctl_elem_id_t *id;
snd_ctl_elem_value_t *ctl; snd_ctl_elem_value_t *ctl;
snd_ctl_t *handle; snd_ctl_t *handle;
//printf("setGain(%d, %d, %d)\n", in, out, value);
snd_ctl_elem_value_alloca(&ctl); snd_ctl_elem_value_alloca(&ctl);
snd_ctl_elem_id_alloca(&id); snd_ctl_elem_id_alloca(&id);
@ -927,7 +952,7 @@ void HDSPMixerWindow::setGain(int in, int out, int value)
snd_ctl_elem_value_set_id(ctl, id); snd_ctl_elem_value_set_id(ctl, id);
if ((err = snd_ctl_open(&handle, cards[current_card]->name, SND_CTL_NONBLOCK)) < 0) { if ((err = snd_ctl_open(&handle, cards[current_card]->name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Alsa error: %s\n", snd_strerror(err)); fprintf(stderr, "Alsa error 1: %s\n", snd_strerror(err));
return; return;
} }
@ -935,7 +960,7 @@ void HDSPMixerWindow::setGain(int in, int out, int value)
snd_ctl_elem_value_set_integer(ctl, 1, out); snd_ctl_elem_value_set_integer(ctl, 1, out);
snd_ctl_elem_value_set_integer(ctl, 2, value); snd_ctl_elem_value_set_integer(ctl, 2, value);
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) { if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Alsa error: %s\n", snd_strerror(err)); fprintf(stderr, "Alsa error 2: %s\n", snd_strerror(err));
snd_ctl_close(handle); snd_ctl_close(handle);
return; return;
} }
@ -955,6 +980,17 @@ void HDSPMixerWindow::setMixer(int idx, int src, int dst)
snd_ctl_elem_value_t *ctl; snd_ctl_elem_value_t *ctl;
snd_ctl_t *handle; snd_ctl_t *handle;
char *channel_map;
switch (src) {
case 0:
channel_map = cards[current_card]->channel_map_input;
break;
case 1:
case 2:
channel_map = cards[current_card]->channel_map_playback;
}
gsolo_active = inputs->buttons->master->solo_active; gsolo_active = inputs->buttons->master->solo_active;
gmute_active = inputs->buttons->master->mute_active; gmute_active = inputs->buttons->master->mute_active;
gsolo = inputs->buttons->master->solo; gsolo = inputs->buttons->master->solo;
@ -973,7 +1009,7 @@ void HDSPMixerWindow::setMixer(int idx, int src, int dst)
snd_ctl_elem_value_set_id(ctl, id); snd_ctl_elem_value_set_id(ctl, id);
if ((err = snd_ctl_open(&handle, cards[current_card]->name, SND_CTL_NONBLOCK)) < 0) { if ((err = snd_ctl_open(&handle, cards[current_card]->name, SND_CTL_NONBLOCK)) < 0) {
fprintf(stderr, "Alsa error: %s\n", snd_strerror(err)); fprintf(stderr, "Alsa error 3: %s\n", snd_strerror(err));
return; return;
} }
@ -1003,19 +1039,20 @@ void HDSPMixerWindow::setMixer(int idx, int src, int dst)
right_val = attenuation_r* vol * pan; right_val = attenuation_r* vol * pan;
muted: muted:
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, 0, src*cards[current_card]->playbacks_offset+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, 1, cards[current_card]->dest_map[dst]);
snd_ctl_elem_value_set_integer(ctl, 2, (int)left_val); snd_ctl_elem_value_set_integer(ctl, 2, (int)left_val);
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) { if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Alsa error: %s\n", snd_strerror(err)); fprintf(stderr, "Alsa error 4: %s\n", snd_strerror(err));
snd_ctl_close(handle); snd_ctl_close(handle);
return; return;
} }
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, 0, src*cards[current_card]->playbacks_offset+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, 1, cards[current_card]->dest_map[dst]+1);
snd_ctl_elem_value_set_integer(ctl, 2, (int)right_val); snd_ctl_elem_value_set_integer(ctl, 2, (int)right_val);
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) { if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
fprintf(stderr, "Alsa error: %s\n", snd_strerror(err)); fprintf(stderr, "Alsa error 5: %s\n", snd_strerror(err));
snd_ctl_close(handle); snd_ctl_close(handle);
return; return;
} }
@ -1026,10 +1063,13 @@ muted:
dest = (int)floor((idx-1)/2); dest = (int)floor((idx-1)/2);
for (i = 0; i < cards[current_card]->channels; ++i) { for (i = 0; i < cards[current_card]->channels_input; ++i) {
if ((vol = inputs->strips[i]->fader->posToInt(inputs->strips[i]->fader->pos[dest])) != 0) { if ((vol = inputs->strips[i]->fader->posToInt(inputs->strips[i]->fader->pos[dest])) != 0) {
setMixer(i+1, 0, dest); setMixer(i+1, 0, dest);
} }
}
for (i = 0; i < cards[current_card]->channels_playback; ++i) {
if ((vol = playbacks->strips[i]->fader->posToInt(playbacks->strips[i]->fader->pos[dest])) != 0) { if ((vol = playbacks->strips[i]->fader->posToInt(playbacks->strips[i]->fader->pos[dest])) != 0) {
setMixer(i+1, 1, dest); setMixer(i+1, 1, dest);
} }

View file

@ -24,8 +24,12 @@
/* Uncomment this to make the setup window non-modal */ /* Uncomment this to make the setup window non-modal */
//#define NON_MODAL_SETUP 1 //#define NON_MODAL_SETUP 1
#define HDSP_MAX_CHANNELS 26 #define HDSPeMADI 10
#define HDSP_MAX_DEST 14 #define HDSPeRayDAT 11
#define HDSPeAIO 12
#define HDSP_MAX_CHANNELS 64
#define HDSP_MAX_DEST 32
#define STRIP_WIDTH 36 #define STRIP_WIDTH 36
#define FULLSTRIP_HEIGHT 253 #define FULLSTRIP_HEIGHT 253

View file

@ -44,28 +44,28 @@ int main(int argc, char **argv)
printf("\nHDSPMixer %s - Copyright (C) 2003 Thomas Charbonnel <thomas@undata.org>\n", VERSION); printf("\nHDSPMixer %s - Copyright (C) 2003 Thomas Charbonnel <thomas@undata.org>\n", VERSION);
printf("This program comes with ABSOLUTELY NO WARRANTY\n"); printf("This program comes with ABSOLUTELY NO WARRANTY\n");
printf("HDSPMixer is free software, see the file COPYING for details\n\n"); printf("HDSPMixer is free software, see the file COPYING for details\n\n");
printf("Looking for HDSP cards :\n"); printf("Looking for RME cards :\n");
while (snd_card_next(&card) >= 0) { while (snd_card_next(&card) >= 0) {
if (card < 0) { if (card < 0) {
break; break;
} else { } else {
snd_card_get_longname(card, &name); snd_card_get_longname(card, &name);
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 MADIface", 12)) {
printf("Multiface found !\n"); printf("RME MADIface found !\n");
hdsp_cards[cards] = new HDSPMixerCard(Multiface, card); hdsp_cards[cards] = new HDSPMixerCard(HDSPeMADI, card);
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall DSP + Digiface", 29)) { } else if (!strncmp(name, "RME MADI", 8)) {
printf("Digiface found !\n"); printf("RME MADI found !\n");
hdsp_cards[cards] = new HDSPMixerCard(Digiface, card); hdsp_cards[cards] = new HDSPMixerCard(HDSPeMADI, card);
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall HDSP 9652", 24)) { } else if (!strncmp(name, "RME RayDAT", 10)) {
printf("HDSP 9652 found !\n"); printf("RME RayDAT found !\n");
hdsp_cards[cards] = new HDSPMixerCard(H9652, card); hdsp_cards[cards] = new HDSPMixerCard(HDSPeRayDAT, card);
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall HDSP 9632", 24)) { } else if (!strncmp(name, "RME AIO", 7)) {
printf("HDSP 9632 found !\n"); printf("RME AIO found !\n");
hdsp_cards[cards] = new HDSPMixerCard(H9632, card); hdsp_cards[cards] = new HDSPMixerCard(HDSPeAIO, card);
cards++; cards++;
} else if (!strncmp(name, "RME Hammerfall DSP", 18)) { } else if (!strncmp(name, "RME Hammerfall DSP", 18)) {
printf("Uninitialized HDSP card found.\nUse hdsploader to upload configuration data to the card.\n"); printf("Uninitialized HDSP card found.\nUse hdsploader to upload configuration data to the card.\n");
@ -74,13 +74,13 @@ int main(int argc, char **argv)
} }
free(name); free(name);
if (!cards) { if (!cards) {
printf("No Hammerfall DSP card found.\n"); printf("No RME cards found.\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
for (int i = cards; i < 3; ++i) { for (int i = cards; i < 3; ++i) {
hdsp_cards[i] = NULL; hdsp_cards[i] = NULL;
} }
printf("%d Hammerfall DSP %s found.\n", cards, (cards > 1) ? "cards" : "card"); printf("%d RME cards %s found.\n", cards, (cards > 1) ? "cards" : "card");
window = new HDSPMixerWindow(0, 0, hdsp_cards[0]->window_width, hdsp_cards[0]->window_height, "HDSPMixer", hdsp_cards[0], hdsp_cards[1], hdsp_cards[2]); window = new HDSPMixerWindow(0, 0, hdsp_cards[0]->window_width, hdsp_cards[0]->window_height, "HDSPMixer", hdsp_cards[0], hdsp_cards[1], hdsp_cards[2]);
Fl::visual(FL_DOUBLE|FL_INDEX); Fl::visual(FL_DOUBLE|FL_INDEX);
window->show(argc, argv); window->show(argc, argv);