- updated to version 1.6

- fixed compile warnings
  - corrects preset 7 for H9632 cards
This commit is contained in:
Takashi Iwai 2003-11-24 18:17:05 +00:00
parent c4afb782fd
commit e535082270
15 changed files with 178 additions and 130 deletions

View file

@ -1,3 +1,8 @@
Version 1.6 (24/11/2003):
* Fixes compilation warnings
* AutoSync sample rate detection scheme changed
* Fixes default preset 7 for H9632 cards
Version 1.5 (21/11/2003):
* Added a .desktop file
* H9632 bug fixes (thanks to Pentti Ala-Vannesluoma)

View file

@ -1,5 +1,5 @@
AC_INIT(src/hdspmixer.cxx)
AM_INIT_AUTOMAKE(hdspmixer, 1.5)
AM_INIT_AUTOMAKE(hdspmixer, 1.6)
AC_PROG_CXX
AC_PROG_MAKE_SET

View file

@ -19,9 +19,76 @@
*/
#pragma implementation
#define HDSPMIXER_DEFINE_MAPPINGS
#include "HDSPMixerCard.h"
static char channel_map_df_ss[26] = {
0, 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
};
static char channel_map_mf_ss[26] = {
0, 1, 2, 3, 4, 5, 6, 7,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25,
-1, -1, -1, -1, -1, -1, -1, -1
};
static char meter_map_ds[26] = {
0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19,
24, 25,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
static char channel_map_ds[26] = {
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23,
24, 25,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
static char dest_map_mf_ss[10] = {
0, 2, 4, 6, 16, 18, 20, 22, 24, 26
};
static char dest_map_ds[8] = {
0, 2, 8, 10, 16, 18, 24, 26
};
static char dest_map_df_ss[14] = {
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26
};
static char dest_map_h9652_ss[13] = {
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
};
static char dest_map_h9652_ds[7] = {
0, 2, 8, 10, 16, 18, 24
};
static char dest_map_h9632_ss[8] = {
0, 2, 4, 6, 8, 10, 12, 14
};
static char dest_map_h9632_ds[6] = {
0, 2, 8, 10, 12, 14
};
static char dest_map_h9632_qs[4] = {
8, 10, 12, 14
};
static char channel_map_h9632_ss[16] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
static char channel_map_h9632_ds[12] = {
0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15
};
static char channel_map_h9632_qs[8] = {
8, 9, 10, 11, 12, 13, 14, 15
};
static void alsactl_cb(snd_async_handler_t *handler)
{
int err, clock_value;
@ -76,12 +143,7 @@ static void alsactl_cb(snd_async_handler_t *handler)
int HDSPMixerCard::getAutosyncSpeed()
{
/* FIXME : this is over simplistic, there are lots of crooked cases
It should always be possible to do what one wants executing the
proper sequence of actions, though.
*/
int err, external_rate;
int err, rate;
snd_ctl_elem_value_t *elemval;
snd_ctl_elem_id_t * elemid;
snd_ctl_t *handle;
@ -92,24 +154,22 @@ int HDSPMixerCard::getAutosyncSpeed()
return -1;
}
snd_ctl_elem_id_set_name(elemid, "External Rate");
snd_ctl_elem_id_set_numid(elemid, 17);
snd_ctl_elem_id_set_interface(elemid, SND_CTL_ELEM_IFACE_PCM);
snd_ctl_elem_id_set_name(elemid, "System Sample Rate");
snd_ctl_elem_id_set_numid(elemid, 16);
snd_ctl_elem_id_set_interface(elemid, SND_CTL_ELEM_IFACE_HWDEP);
snd_ctl_elem_id_set_device(elemid, 0);
snd_ctl_elem_id_set_subdevice(elemid, 0);
snd_ctl_elem_id_set_index(elemid, 0);
snd_ctl_elem_value_set_id(elemval, elemid);
snd_ctl_elem_read(handle, elemval);
external_rate = snd_ctl_elem_value_get_enumerated(elemval, 0);
rate = snd_ctl_elem_value_get_integer(elemval, 0);
snd_ctl_close(handle);
if (external_rate > 2 && external_rate < 6) {
return 1;
} else if (external_rate > 6) {
if (rate > 96000) {
return 2;
} else if (external_rate <= 2) {
return 0;
} else if (rate > 48000) {
return 1;
}
return 0;
}
@ -189,7 +249,7 @@ HDSPMixerCard::HDSPMixerCard(HDSP_IO_Type cardtype, int id)
}
void HDSPMixerCard::getAeb() {
int err, i;
int err;
snd_hwdep_t *hw;
snd_hwdep_info_t *info;
snd_hwdep_info_alloca(&info);

View file

@ -26,9 +26,6 @@
#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"

View file

@ -46,7 +46,6 @@ int HDSPMixerFader::handle(int e)
int button3 = Fl::event_button3();
int shift = Fl::event_shift();
int ctrl = Fl::event_ctrl();
int xpos = Fl::event_x()-x();
int ypos = Fl::event_y()-y();
switch (e) {
case FL_PUSH:

View file

@ -53,7 +53,6 @@ void HDSPMixerMaster::draw()
int HDSPMixerMaster::handle(int e)
{
int xpos = Fl::event_x()-x();
int ypos = Fl::event_y()-y();
switch (e) {
case FL_PUSH:
if (xpos >= 0 && xpos <= 29) {

View file

@ -117,7 +117,6 @@ int HDSPMixerMeter::logToHeight(double db)
void HDSPMixerMeter::update(int peak, int overs, int64 rms)
{
int p;
double fp, fr, db;
int over = 0;

View file

@ -19,9 +19,48 @@
*/
#pragma implementation
#define HDSPMIXER_DEFINE_OUTPUT_LABELS
#include "HDSPMixerOutput.h"
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",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_mf_ds[16] = {
"AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6", "AN 7", "AN 8",
"A 1", "A 2", "A 3", "A 4",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_df_ss[28] = {
"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",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_df_ds[16] = {
"A1 1", "A1 2", "A1 3", "A1 4",
"A2 1", "A2 2", "A2 3", "A2 4",
"A3 1", "A3 2", "A3 3", "A3 4",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_9632_ss[16] = {
"A 1", "A 2", "A 3", "A 4", "A 5", "A 6", "A 7", "A 8",
"SP.L", "SP.R", "AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6"
};
static char *labels_9632_ds[12] = {
"A 1", "A 2", "A 3", "A 4",
"SP.L", "SP.R", "AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6"
};
static char *labels_9632_qs[8] = {
"SP.L", "SP.R", "AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6"
};
HDSPMixerOutput::HDSPMixerOutput(int x, int y, int w, int h, int num):Fl_Group(x, y, w, h)
{

View file

@ -41,47 +41,6 @@ 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",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_mf_ds[16] = {
"AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6", "AN 7", "AN 8",
"A 1", "A 2", "A 3", "A 4",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_df_ss[28] = {
"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",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_df_ds[16] = {
"A1 1", "A1 2", "A1 3", "A1 4",
"A2 1", "A2 2", "A2 3", "A2 4",
"A3 1", "A3 2", "A3 3", "A3 4",
"SP.L", "SP.R", "AN.L", "AN.R"
};
static char *labels_9632_ss[16] = {
"A 1", "A 2", "A 3", "A 4", "A 5", "A 6", "A 7", "A 8",
"SP.L", "SP.R", "AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6"
};
static char *labels_9632_ds[12] = {
"A 1", "A 2", "A 3", "A 4",
"SP.L", "SP.R", "AN 1", "AN 2", "AN 3", "AN 4", "AN 5", "AN 6"
};
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

@ -43,7 +43,6 @@ int HDSPMixerPan::handle(int e)
int shift = Fl::event_shift();
int ctrl = Fl::event_ctrl();
int xpos = Fl::event_x()-x();
int ypos = Fl::event_y()-y();
switch (e) {
case FL_PUSH:
if (xpos > 0 && xpos < 30) {

View file

@ -19,9 +19,55 @@
*/
#pragma implementation
#define HDSPMIXER_DEFINE_SELECTOR_LABELS
#include "HDSPMixerSelector.h"
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",
"SPDIF", "Analog"
};
static char *destinations_mf_ds[8] = {
"AN 1+2", "AN 3+4", "AN 5+6", "AN 7+8",
"A 1+2", "A 3+4",
"SPDIF", "Analog"
};
static char *destinations_df_ss[14] = {
"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",
"SPDIF", "Analog"
};
static char *destinations_df_ds[8] = {
"A1 1+2", "A1 3+4",
"A2 1+2", "A2 3+4",
"A3 1+2", "A3 3+4",
"SPDIF", "Analog"
};
static char *destinations_h9652_ss[13] = {
"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",
"SPDIF"
};
static char *destinations_h9652_ds[7] = {
"A1 1+2", "A1 3+4",
"A2 1+2", "A2 3+4",
"A3 1+2", "A3 3+4",
"SPDIF"
};
static char *destinations_h9632_ss[8] = {
"A 1+2", "A 3+4", "A 5+6", "A 7+8",
"SPDIF", "AN 1+2", "AN 3+4", "AN 5+6"
};
static char *destinations_h9632_ds[6] = {
"A 1+2", "A 3+4",
"SPDIF", "AN 1+2", "AN 3+4", "AN 5+6"
};
static char *destinations_h9632_qs[4] = {
"SPDIF", "AN 1+2", "AN 3+4", "AN 5+6"
};
HDSPMixerSelector::HDSPMixerSelector(int x, int y, int w, int h):Fl_Menu_(x, y, w, h)
{
max_dest = 0;
@ -41,8 +87,6 @@ void HDSPMixerSelector::draw() {
int HDSPMixerSelector::handle(int e) {
const Fl_Menu_Item *item;
int xpos = Fl::event_x()-x();
int ypos = Fl::event_y()-y();
switch(e) {
case FL_PUSH:
for (int i = 0; i < max_dest; i++) {

View file

@ -35,61 +35,6 @@
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",
"SPDIF", "Analog"
};
static char *destinations_mf_ds[8] = {
"AN 1+2", "AN 3+4", "AN 5+6", "AN 7+8",
"A 1+2", "A 3+4",
"SPDIF", "Analog"
};
static char *destinations_df_ss[14] = {
"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",
"SPDIF", "Analog"
};
static char *destinations_df_ds[8] = {
"A1 1+2", "A1 3+4",
"A2 1+2", "A2 3+4",
"A3 1+2", "A3 3+4",
"SPDIF", "Analog"
};
static char *destinations_h9652_ss[13] = {
"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",
"SPDIF"
};
static char *destinations_h9652_ds[7] = {
"A1 1+2", "A1 3+4",
"A2 1+2", "A2 3+4",
"A3 1+2", "A3 3+4",
"SPDIF"
};
static char *destinations_h9632_ss[8] = {
"A 1+2", "A 3+4", "A 5+6", "A 7+8",
"SPDIF", "AN 1+2", "AN 3+4", "AN 5+6"
};
static char *destinations_h9632_ds[6] = {
"A 1+2", "A 3+4",
"SPDIF", "AN 1+2", "AN 3+4", "AN 5+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

@ -47,7 +47,6 @@ void HDSPMixerView::draw()
int HDSPMixerView::handle(int e)
{
int xpos = Fl::event_x()-x();
int ypos = Fl::event_y()-y();
switch (e) {
case FL_PUSH:

View file

@ -533,6 +533,9 @@ void HDSPMixerWindow::restoreDefaults(int card)
h9632_an12_submix[2] = 1;
num_modes = 3;
phones = 0;
default:
/* should never happen */
return;
}
for (int preset = 0; preset < 8; ++preset) {
for (int speed = 0; speed < num_modes; ++speed) {
@ -595,8 +598,10 @@ void HDSPMixerWindow::restoreDefaults(int card)
}
} 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;
if (preset == 5) {
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;
}
@ -613,7 +618,7 @@ void HDSPMixerWindow::restoreDefaults(int card)
HDSPMixerWindow::HDSPMixerWindow(int x, int y, int w, int h, const char *label, HDSPMixerCard *hdsp_card1, HDSPMixerCard *hdsp_card2, HDSPMixerCard *hdsp_card3):Fl_Double_Window(x, y, w, h, label)
{
int def, i;
int i;
cards[0] = hdsp_card1;
cards[1] = hdsp_card2;
cards[2] = hdsp_card3;

View file

@ -55,5 +55,4 @@ hdspmixer_SOURCES = \
HDSPMixerMeter.h \
pixmaps.cxx \
pixmaps.h \
mappings.h \
defines.h