Update of /cvsroot/alsa/alsa-tools/hdspmixer/src In directory sc8-pr-cvs1:/tmp/cvs-serv15125/src
Modified Files: HDSPMixerCard.cxx HDSPMixerCard.h HDSPMixerFader.cxx HDSPMixerMaster.cxx HDSPMixerMeter.cxx HDSPMixerOutput.cxx HDSPMixerOutput.h HDSPMixerPan.cxx HDSPMixerSelector.cxx HDSPMixerSelector.h HDSPMixerView.cxx HDSPMixerWindow.cxx Makefile.am Log Message: - updated to version 1.6 - fixed compile warnings - corrects preset 7 for H9632 cards Index: HDSPMixerCard.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerCard.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerCard.cxx 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerCard.cxx 24 Nov 2003 18:17:05 -0000 1.4 @@ -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 @@ 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 @@ 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 @@ } void HDSPMixerCard::getAeb() { - int err, i; + int err; snd_hwdep_t *hw; snd_hwdep_info_t *info; snd_hwdep_info_alloca(&info); Index: HDSPMixerCard.h =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerCard.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerCard.h 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerCard.h 24 Nov 2003 18:17:05 -0000 1.4 @@ -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" Index: HDSPMixerFader.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerFader.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HDSPMixerFader.cxx 28 Jul 2003 11:32:32 -0000 1.1 +++ HDSPMixerFader.cxx 24 Nov 2003 18:17:05 -0000 1.2 @@ -46,7 +46,6 @@ 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: Index: HDSPMixerMaster.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerMaster.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HDSPMixerMaster.cxx 28 Jul 2003 11:32:32 -0000 1.1 +++ HDSPMixerMaster.cxx 24 Nov 2003 18:17:05 -0000 1.2 @@ -53,7 +53,6 @@ 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) { Index: HDSPMixerMeter.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerMeter.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HDSPMixerMeter.cxx 3 Nov 2003 19:10:39 -0000 1.2 +++ HDSPMixerMeter.cxx 24 Nov 2003 18:17:05 -0000 1.3 @@ -117,7 +117,6 @@ void HDSPMixerMeter::update(int peak, int overs, int64 rms) { - int p; double fp, fr, db; int over = 0; Index: HDSPMixerOutput.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerOutput.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerOutput.cxx 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerOutput.cxx 24 Nov 2003 18:17:05 -0000 1.4 @@ -19,8 +19,47 @@ */ #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) { Index: HDSPMixerOutput.h =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerOutput.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerOutput.h 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerOutput.h 24 Nov 2003 18:17:05 -0000 1.4 @@ -41,47 +41,6 @@ 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 { Index: HDSPMixerPan.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerPan.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HDSPMixerPan.cxx 28 Jul 2003 11:32:32 -0000 1.1 +++ HDSPMixerPan.cxx 24 Nov 2003 18:17:05 -0000 1.2 @@ -43,7 +43,6 @@ 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) { Index: HDSPMixerSelector.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerSelector.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerSelector.cxx 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerSelector.cxx 24 Nov 2003 18:17:05 -0000 1.4 @@ -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 @@ 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++) { Index: HDSPMixerSelector.h =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerSelector.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerSelector.h 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerSelector.h 24 Nov 2003 18:17:05 -0000 1.4 @@ -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_ { Index: HDSPMixerView.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerView.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HDSPMixerView.cxx 28 Jul 2003 11:32:32 -0000 1.1 +++ HDSPMixerView.cxx 24 Nov 2003 18:17:05 -0000 1.2 @@ -47,7 +47,6 @@ int HDSPMixerView::handle(int e) { - int xpos = Fl::event_x()-x(); int ypos = Fl::event_y()-y(); switch (e) { case FL_PUSH: Index: HDSPMixerWindow.cxx =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/HDSPMixerWindow.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HDSPMixerWindow.cxx 24 Nov 2003 14:48:21 -0000 1.3 +++ HDSPMixerWindow.cxx 24 Nov 2003 18:17:05 -0000 1.4 @@ -533,6 +533,9 @@ 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 @@ } } 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 @@ 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; Index: Makefile.am =================================================================== RCS file: /cvsroot/alsa/alsa-tools/hdspmixer/src/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile.am 28 Jul 2003 11:32:32 -0000 1.1 +++ Makefile.am 24 Nov 2003 18:17:05 -0000 1.2 @@ -55,5 +55,4 @@ HDSPMixerMeter.h \ pixmaps.cxx \ pixmaps.h \ - mappings.h \ defines.h ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog