2018-03-20 Fred Gleason <fredg@paravelsystems.com>

* Removed rdhpiinfo(8).
This commit is contained in:
Fred Gleason 2018-03-20 10:01:52 -04:00
parent 3b4fddd106
commit 5b8aea8b17
16 changed files with 7 additions and 1191 deletions

View File

@ -16619,3 +16619,5 @@
a clock was deleted while still being assigned to a grid.
2018-03-19 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 2.19.0int00.
2018-03-20 Fred Gleason <fredg@paravelsystems.com>
* Removed rdhpiinfo(8).

View File

@ -303,21 +303,17 @@ if test $HPI_FOUND ; then
AC_SUBST(HPI_FILE2,$LIB_PATH/librdhpi.a)
AC_SUBST(HPI_FILE3,$LIB_PATH/librdhpi.la)
AC_SUBST(HPI_FILE4,$LIB_PATH/librdhpi.so)
AC_SUBST(HPI_FILE5,$PREFIX/bin/rdhpiinfo)
if test $ar_gcc_distro = suse ; then
AC_SUBST(HPI_FILE6,"")
else
AC_SUBST(HPI_FILE6,$PREFIX/bin/rdhpiinfo-root)
fi
AC_SUBST(HPI_FILE5,"")
AC_SUBST(HPI_FILE6,"")
AC_SUBST(HPI_FILE7,$PREFIX/share/rivendell/rdhpi_es.qm)
AC_SUBST(HPI_FILE8,$PREFIX/share/rivendell/rdhpi_cs.qm)
AC_SUBST(HPI_FILE9,$PREFIX/share/rivendell/rdhpi_de.qm)
AC_SUBST(HPI_FILE10,$PREFIX/share/rivendell/rdhpi_nn.qm)
AC_SUBST(HPI_FILE11,$PREFIX/share/rivendell/rdhpi_nb.qm)
AC_SUBST(HPI_FILE12,$PREFIX/share/rivendell/rdhpi_pt_BR.qm)
AC_SUBST(HPI_FILE13,$PREFIX/share/applications/rivendell-rdhpiinfo-root.desktop)
AC_SUBST(HPI_FILE14,/etc/pam.d/rdhpiinfo-root)
AC_SUBST(HPI_FILE15,/etc/security/console.apps/rdhpiinfo-root)
AC_SUBST(HPI_FILE13,"")
AC_SUBST(HPI_FILE14,"")
AC_SUBST(HPI_FILE15,"")
else
AC_SUBST(LIBHPI,"")
AC_SUBST(HPI_FILE1,"")
@ -518,7 +514,6 @@ AC_CONFIG_FILES([rivendell.spec \
utils/rdexport/Makefile \
utils/rdgen/Makefile \
utils/rdgpimon/Makefile \
utils/rdhpiinfo/Makefile \
utils/rdimport/Makefile \
utils/rdmaint/Makefile \
utils/rdmarkerset/Makefile \

View File

@ -20,14 +20,10 @@
##
## Use automake to process this into a Makefile.in
if HPI_RD_AM
HPIINFO_RD_OPT = rdhpiinfo
endif
if ALSA_RD_AM
ALSACONFIG_RD_OPT = rdalsaconfig
endif
SUBDIRS = $(ALSACONFIG_RD_OPT)\
$(HPIINFO_RD_OPT)\
rddbcheck\
rddgimport\
rdcheckcuts\

View File

@ -1,51 +0,0 @@
## automake.am
##
## Automake.am for utils/rdhpiinfo
##
## (C) Copyright 2002-2007,2016 Fred Gleason <fredg@paravelsystems.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License version 2 as
## published by the Free Software Foundation.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public
## License along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
## Use automake to process this into a Makefile.in
##
AM_CPPFLAGS = -Wall -DPREFIX=\"$(prefix)\" -DQTDIR=\"@QT_DIR@\" @QT_CXXFLAGS@ -I$(top_srcdir)/lib -I$(top_srcdir)/rdhpi
LIBS = @QT_LIBS@ -L$(top_srcdir)/lib -L$(top_srcdir)/rdhpi
MOC = @QT_MOC@
# The dependency for qt's Meta Object Compiler (moc)
moc_%.cpp: %.h
$(MOC) $< -o $@
bin_PROGRAMS = rdhpiinfo
dist_rdhpiinfo_SOURCES = change_mode.cpp change_mode.h\
rdhpiinfo.cpp rdhpiinfo.h\
virtdetails.cpp virtdetails.h
nodist_rdhpiinfo_SOURCES = moc_change_mode.cpp\
moc_rdhpiinfo.cpp\
moc_virtdetails.cpp
rdhpiinfo_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @LIBHPI@
EXTRA_DIST = rdhpiinfo.pro
CLEANFILES = *~\
*.qm\
moc_*
MAINTAINERCLEANFILES = *~\
Makefile.in\
moc_*

View File

@ -1,194 +0,0 @@
// change_mode.cpp
//
// Change the mode of an AudioScience Adapter.
//
// (C) Copyright 2002-2014,2016 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <qpushbutton.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <change_mode.h>
ChangeMode::ChangeMode(unsigned short card,unsigned short type,int mode,
QWidget *parent)
: QDialog(parent,"",true)
{
QString str;
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setCaption(tr("RdHPIInfo - Change Mode"));
//
// Create Fonts
//
QFont font=QFont("Helvetica",12,QFont::Normal);
font.setPixelSize(12);
QFont label_font=QFont("Helvetica",12,QFont::Bold);
label_font.setPixelSize(12);
//
// Adapter Type
//
QLabel *label=new QLabel(QString().sprintf("AudioScience %X",type),this);
label->setGeometry(10,10,sizeHint().width()-20,15);
label->setFont(label_font);
label->setAlignment(AlignCenter);
//
// Adapter Mode
//
change_mode_box=new QComboBox(this);
change_mode_box->setGeometry(10,35,sizeHint().width()-20,22);
change_mode_box->setFont(font);
int index=0;
for(uint32_t i=1;i<14;i++) {
if(HPI_AdapterSetModeEx(NULL,card,i,HPI_ADAPTER_MODE_QUERY)==0) {
switch(i) {
case HPI_ADAPTER_MODE_4OSTREAM:
change_mode_box->insertItem(tr("Four Output Streams"));
break;
case HPI_ADAPTER_MODE_6OSTREAM:
change_mode_box->insertItem(tr("Six Output Streams"));
break;
case HPI_ADAPTER_MODE_8OSTREAM:
change_mode_box->insertItem(tr("Eight Output Streams"));
break;
case HPI_ADAPTER_MODE_12OSTREAM:
change_mode_box->insertItem(tr("Twelve Output Streams"));
break;
case HPI_ADAPTER_MODE_16OSTREAM:
change_mode_box->insertItem(tr("Sixteen Output Streams"));
break;
case HPI_ADAPTER_MODE_1OSTREAM:
change_mode_box->insertItem(tr("One Output Stream"));
break;
case HPI_ADAPTER_MODE_1:
change_mode_box->insertItem(tr("Mode 1"));
break;
case HPI_ADAPTER_MODE_2:
change_mode_box->insertItem(tr("Mode 2"));
break;
case HPI_ADAPTER_MODE_3:
change_mode_box->insertItem(tr("Mode 3"));
break;
case HPI_ADAPTER_MODE_MULTICHANNEL:
change_mode_box->insertItem(tr("Surround Sound [SSX]"));
break;
case HPI_ADAPTER_MODE_9OSTREAM:
change_mode_box->insertItem(tr("Nine Output Stream"));
break;
case HPI_ADAPTER_MODE_MONO:
change_mode_box->insertItem(tr("Mono Mode"));
break;
case HPI_ADAPTER_MODE_LOW_LATENCY:
change_mode_box->insertItem(tr("Low Latency Mode"));
break;
default:
str=QString(tr("Unknown"));
change_mode_box->
insertItem(QString().sprintf(" %s [MODE=%u]\n",
(const char *)str,(unsigned)i));
break;
}
hpi_mode_map[index]=i;
if(mode==(int)i) {
change_mode_box->setCurrentItem(index);
change_index=index;
}
index++;
}
}
//
// Ok Button
//
QPushButton *ok_button=new QPushButton(this);
ok_button->setGeometry(sizeHint().width()-140,sizeHint().height()-40,60,30);
ok_button->setDefault(true);
ok_button->setFont(font);
ok_button->setText(tr("&OK"));
connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));
//
// Cancel Button
//
QPushButton *cancel_button=new QPushButton(this);
cancel_button->setGeometry(sizeHint().width()-70,sizeHint().height()-40,
60,30);
cancel_button->setFont(font);
cancel_button->setText(tr("&Cancel"));
connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
}
QSize ChangeMode::sizeHint() const
{
return QSize(280,110);
}
QSizePolicy ChangeMode::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
void ChangeMode::closeEvent(QCloseEvent *e)
{
cancelData();
}
void ChangeMode::okData()
{
if(change_mode_box->currentItem()==change_index) {
done(-1);
return;
}
if(QMessageBox::warning(this,"RDHPIInfo",tr("The HPI driver will need to be restarted\nafter changing the mode. Continue?"),QMessageBox::Yes,QMessageBox::No)==QMessageBox::No) {
return;
}
done(hpi_mode_map[change_mode_box->currentItem()]);
return;
}
void ChangeMode::cancelData()
{
done(-1);
}

View File

@ -1,58 +0,0 @@
// change_mode.h
//
// Change the mode of an AudioScience Adapter
//
// (C) Copyright 2002-2005,2016 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#ifndef CHANGE_MODE_H
#define CHANGE_MODE_H
#define MAX_HPI_MODES 11
#include <qdialog.h>
#include <qcombobox.h>
#include <asihpi/hpi.h>
#ifndef HPI_ADAPTER_MODE_MULTICHANNEL
#define HPI_ADAPTER_MODE_MULTICHANNEL (9)
#endif
class ChangeMode : public QDialog
{
Q_OBJECT
public:
ChangeMode(unsigned short card,unsigned short type,int mode,
QWidget *parent=0);
QSize sizeHint() const;
QSizePolicy sizePolicy() const;
protected:
void closeEvent(QCloseEvent *e);
private slots:
void okData();
void cancelData();
private:
int change_index;
uint32_t hpi_mode_map[MAX_HPI_MODES];
QComboBox *change_mode_box;
};
#endif

View File

@ -1,481 +0,0 @@
// rdhpiinfo.cpp
//
// A Qt-based application for display information on ASI cards.
//
// (C) Copyright 2002-2014,2016 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <stdlib.h>
#include <stdint.h>
#include <qapplication.h>
#include <qwindowsstyle.h>
#include <qmessagebox.h>
#include <qpushbutton.h>
#include <qtextcodec.h>
#include <qtranslator.h>
#include <rdcmd_switch.h>
#include "rdhpiinfo.h"
#include "change_mode.h"
#include "virtdetails.h"
MainWidget::MainWidget(QWidget *parent)
:QWidget(parent)
{
setCaption(tr("RDHPIInfo")+" v"+VERSION);
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
//
// Load the command-line arguments
//
RDCmdSwitch *cmd=new RDCmdSwitch(qApp->argc(),qApp->argv(),"rdhpiinfo",
RDHPIINFO_USAGE);
delete cmd;
//
// Generate Fonts
//
QFont font("Helvetica",12,QFont::Normal);
font.setPixelSize(12);
QFont label_font("Helvetica",12,QFont::Bold);
label_font.setPixelSize(12);
//
// Open HPI
//
if(HPI_SubSysCreate()==NULL) {
QMessageBox::warning(this,tr("HPI Error"),
tr("The ASI HPI Driver is not loaded!"));
exit(1);
}
//
// HPI Version
//
HpiErr(HPI_SubSysGetVersionEx(NULL,&hpi_version),"HPI_SubSysGetVersionEx");
QLabel *label=new QLabel(tr("HPI Version:"),this);
label->setGeometry(10,10,85,20);
label->setFont(label_font);
label=new QLabel(QString().sprintf("%d.%02d.%02d",
(unsigned)((hpi_version>>16)&0xffff),
(unsigned)((hpi_version>>8)&0xff),
(unsigned)hpi_version&0xff),this);
label->setGeometry(100,10,100,20);
label->setFont(font);
//
// Adapter Name
//
info_name_box=new QComboBox(this);
info_name_box->setGeometry(100,34,sizeHint().width()-110,20);
info_name_box->setFont(font);
info_name_label=new QLabel(info_name_box,tr("Adapter:"),this);
info_name_label->setGeometry(10,34,85,20);
info_name_label->setFont(label_font);
info_name_label->setAlignment(AlignRight|AlignVCenter);
connect(info_name_box,SIGNAL(activated(int)),
this,SLOT(nameActivatedData(int)));
//
// Adapter Index
//
label=new QLabel(tr("Adapter Index:"),this);
label->setGeometry(10,58,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_index_label=new QLabel(this);
info_index_label->setGeometry(120,58,100,20);
info_index_label->setFont(font);
info_index_label->setAlignment(AlignLeft|AlignVCenter);
//
// Serial Number
//
label=new QLabel(tr("Serial Number:"),this);
label->setGeometry(10,78,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_serial_label=new QLabel(this);
info_serial_label->setGeometry(120,78,100,20);
info_serial_label->setFont(font);
info_serial_label->setAlignment(AlignLeft|AlignVCenter);
//
// Output Streams
//
label=new QLabel(tr("Input Streams:"),this);
label->setGeometry(10,98,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_istreams_label=new QLabel(this);
info_istreams_label->setGeometry(120,98,100,20);
info_istreams_label->setFont(font);
info_istreams_label->setAlignment(AlignLeft|AlignVCenter);
//
// Input Streams
//
label=new QLabel(tr("Output Streams:"),this);
label->setGeometry(10,118,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_ostreams_label=new QLabel(this);
info_ostreams_label->setGeometry(120,118,100,20);
info_ostreams_label->setFont(font);
info_ostreams_label->setAlignment(AlignLeft|AlignVCenter);
//
// DSP Version
//
label=new QLabel(tr("DSP Version:"),this);
label->setGeometry(10,138,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_dsp_label=new QLabel(this);
info_dsp_label->setGeometry(120,138,100,20);
info_dsp_label->setFont(font);
info_dsp_label->setAlignment(AlignLeft|AlignVCenter);
//
// Adapter Version
//
label=new QLabel(tr("Adapter Version:"),this);
label->setGeometry(10,158,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_adapter_label=new QLabel(this);
info_adapter_label->setGeometry(120,158,100,20);
info_adapter_label->setFont(font);
info_adapter_label->setAlignment(AlignLeft|AlignVCenter);
//
// DSP Utilization
//
info_utilization_label=new QLabel(tr("DSP Utilization")+":",this);
info_utilization_label->setGeometry(10,183,105,20);
info_utilization_label->setFont(label_font);
info_utilization_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
info_utilization_label->setDisabled(true);
info_utilization_edit=new QLineEdit(this);
info_utilization_edit->setGeometry(120,183,60,20);
info_utilization_edit->setFont(font);
info_utilization_edit->setReadOnly(true);
info_utilization_edit->setDisabled(true);
info_utilization_button=new QPushButton(tr("Details"),this);
info_utilization_button->setGeometry(190,180,70,26);
info_utilization_button->setFont(font);
info_utilization_button->setDisabled(true);
connect(info_utilization_button,SIGNAL(clicked()),
this,SLOT(utilizationData()));
//
// Adapter Mode
//
label=new QLabel(tr("Adapter Mode:"),this);
label->setGeometry(10,213,105,20);
label->setFont(label_font);
label->setAlignment(AlignRight|AlignVCenter);
info_mode_edit=new QLineEdit(this);
info_mode_edit->setGeometry(120,213,sizeHint().width()-210,20);
info_mode_edit->setReadOnly(true);
info_mode_edit->setFont(font);
info_mode_edit->setAlignment(AlignLeft|AlignVCenter);
info_changemode_button=
new QPushButton(tr("Change"),this);
info_changemode_button->setGeometry(sizeHint().width()-80,210,70,26);
info_changemode_button->setFont(font);
connect(info_changemode_button,SIGNAL(clicked()),
this,SLOT(changeModeData()));
//
// Close Button
//
QPushButton *button=new QPushButton(tr("Close"),this);
button->setGeometry(sizeHint().width()-60,sizeHint().height()-40,50,30);
button->setFont(label_font);
connect(button,SIGNAL(clicked()),qApp,SLOT(quit()));
LoadAdapters();
hpi_profile_timer=new QTimer(this);
connect(hpi_profile_timer,SIGNAL(timeout()),
this,SLOT(updateDspUtilization()));
if(info_name_box->count()>0) {
nameActivatedData(0);
hpi_profile_timer->start(1000);
}
}
MainWidget::~MainWidget()
{
HPI_SubSysFree(NULL);
}
QSize MainWidget::sizeHint() const
{
return QSize(400,290);
}
QSizePolicy MainWidget::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
void MainWidget::nameActivatedData(int id)
{
QString str;
int card=name_map[id];
info_index_label->
setText(QString().sprintf("%u",(unsigned)hpi_indexes[card]+1));
info_serial_label->
setText(QString().sprintf("%u",(unsigned)hpi_serial[card]));
info_istreams_label->
setText(QString().sprintf("%d",hpi_istreams[card]));
info_ostreams_label->
setText(QString().sprintf("%d",hpi_ostreams[card]));
info_dsp_label->setText(QString().sprintf("%d.%d",
hpi_card_version[card]>>13,
(hpi_card_version[card]>>7)&63));
info_adapter_label->
setText(QString().sprintf("%c%d",
((hpi_card_version[card]>>3)&15)+'A',
hpi_card_version[card]&7));
switch(hpi_mode[card]) {
case 0: // No mode support
info_mode_edit->setText(tr("Standard"));
info_changemode_button->setDisabled(true);
break;
case HPI_ADAPTER_MODE_4OSTREAM:
info_mode_edit->setText(tr("Four Output Streams"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_6OSTREAM:
info_mode_edit->setText(tr("Six Output Streams"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_8OSTREAM:
info_mode_edit->setText(tr("Eight Output Streams"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_12OSTREAM:
info_mode_edit->setText(tr("Twelve Output Streams"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_16OSTREAM:
info_mode_edit->setText(tr("Sixteen Output Streams"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_1OSTREAM:
info_mode_edit->setText(tr("One Output Stream"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_1:
info_mode_edit->setText(tr("Mode 1"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_2:
info_mode_edit->setText(tr("Mode 2"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_3:
info_mode_edit->setText(tr("Mode 3"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_MULTICHANNEL:
info_mode_edit->setText(tr("Surround Sound [SSX]"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_9OSTREAM:
info_mode_edit->setText(tr("Nine Output Stream"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_MONO:
info_mode_edit->setText(tr("Mono Mode"));
info_changemode_button->setEnabled(true);
break;
case HPI_ADAPTER_MODE_LOW_LATENCY:
info_mode_edit->setText(tr("Low Latency Mode"));
info_changemode_button->setEnabled(true);
break;
default:
info_mode_edit->setText(tr("N/A"));
info_changemode_button->setDisabled(true);
if(hpi_mode[card]!=hpi_serial[card]) {
str=QString(tr("rdhpiinfo: unknown adapter mode"));
fprintf(stderr,"%s %d\n",(const char *)str,hpi_mode[card]);
}
break;
}
}
void MainWidget::changeModeData()
{
int card=name_map[info_name_box->currentItem()];
int mode;
QString str;
hpi_err_t hpi_err;
char hpi_text[100];
ChangeMode *dialog=new ChangeMode(card,hpi_type[card],hpi_mode[card],this);
if((mode=dialog->exec())<0) {
delete dialog;
return;
}
delete dialog;
hpi_err=HPI_AdapterOpen(NULL,card);
if((hpi_err=HPI_AdapterSetMode(NULL,card,mode))==0) {
QMessageBox::information(this,tr("RdhpiInfo"),
tr("The adapter mode has been changed.\nYou must now restart the HPI driver!"));
}
else {
HPI_GetErrorText(hpi_err,hpi_text);
str=QString(tr("HPI Error"));
QMessageBox::warning(this,tr("RdhpiInfo"),
QString().sprintf("%s %d:\n\"%s\"",(const char *)str,
(int)hpi_err,hpi_text));
}
hpi_err=HPI_AdapterClose(NULL,card);
}
void MainWidget::utilizationData()
{
VirtDetails *d=new VirtDetails(hpi_indexes[info_name_box->currentItem()],
hpi_profile[info_name_box->currentItem()],
hpi_profile_quan[info_name_box->currentItem()],
this);
hpi_profile_timer->stop();
d->exec();
hpi_profile_timer->start(1000);
delete d;
}
void MainWidget::updateDspUtilization()
{
uint32_t util=0;
if(HpiErr(HPI_ProfileGetUtilization(NULL,
hpi_profile[info_name_box->currentItem()],
&util))==0) {
info_utilization_edit->setText(QString().sprintf("%5.1lf%%",
(double)util/100.0));
info_utilization_label->setEnabled(true);
info_utilization_edit->setEnabled(true);
info_utilization_button->setEnabled(true);
}
else {
info_utilization_edit->setText("xx.x");
info_utilization_label->setDisabled(true);
info_utilization_edit->setDisabled(true);
info_utilization_button->setDisabled(true);
}
}
void MainWidget::LoadAdapters()
{
int num_adapters;
HpiErr(HPI_SubSysGetNumAdapters(NULL,&num_adapters),
"HPI_SubSysGetNumAdapters");
for(int i=0;i<num_adapters;i++) {
HpiErr(HPI_SubSysGetAdapter(NULL,i,hpi_indexes+i,hpi_type+i),
"HPI_SubSysGetAdapter");
hpi_ostreams[i]=0;
hpi_istreams[i]=0;
hpi_card_version[i]=0;
hpi_serial[i]=0;
hpi_mode[i]=0;
if(hpi_type[i]!=0) {
info_name_box->insertItem(QString().sprintf("AudioScience %X [%d]",
hpi_type[i],i+1));
name_map[info_name_box->count()-1]=i;
HpiErr(HPI_AdapterOpen(NULL,hpi_indexes[i]),"HPI_AdapterOpen");
HpiErr(HPI_AdapterGetInfo(NULL,hpi_indexes[i],&hpi_ostreams[i],&hpi_istreams[i],
&hpi_card_version[i],hpi_serial+i,
&hpi_type[i]),"HPI_AdapterGetInfo");
HpiErr(HPI_AdapterGetMode(NULL,hpi_indexes[i],&hpi_mode[i]),
"HPI_AdapterGetMode");
HpiErr(HPI_AdapterClose(NULL,hpi_indexes[i]),"HPI_AdapterClose");
HpiErr(HPI_ProfileOpenAll(NULL,hpi_indexes[i],0,&hpi_profile[i],
&hpi_profile_quan[i]));
}
}
}
hpi_err_t MainWidget::HpiErr(hpi_err_t err,const char *func_name) const
{
char hpi_str[200];
if(err==HPI_ERROR_INVALID_FUNC) {
return err;
}
if(err!=0) {
HPI_GetErrorText(err,hpi_str);
if(func_name==NULL) {
fprintf(stderr,"rdhpiinfo: %s\n",hpi_str);
}
else {
fprintf(stderr,"rdhpiinfo[%s]: %s\n",func_name,hpi_str);
}
}
return err;
}
int main(int argc,char *argv[])
{
QApplication a(argc,argv);
//
// Start Event Loop
//
MainWidget *w=new MainWidget();
a.setMainWidget(w);
w->setGeometry(QRect(QPoint(0,0),w->sizeHint()));
w->show();
return a.exec();
}

View File

@ -1,86 +0,0 @@
// rdhpiinfo.h
//
// A Qt-based application for display info about ASI cards.
//
// (C) Copyright 2002-2005,2016 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#ifndef RDHPIINFO_H
#define RDHPIINFO_H
#include <qwidget.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qtimer.h>
#include <asihpi/hpi.h>
#if HPI_VER < 0x040600
typedef uint16_t hpi_err_t;
typedef uint32_t hpi_handle_t;
#endif
#define RDHPIINFO_USAGE "\n"
class MainWidget : public QWidget
{
Q_OBJECT
public:
MainWidget(QWidget *parent=0);
~MainWidget();
QSize sizeHint() const;
QSizePolicy sizePolicy() const;
private slots:
void nameActivatedData(int id);
void changeModeData();
void utilizationData();
void updateDspUtilization();
private:
void LoadAdapters();
hpi_err_t HpiErr(hpi_err_t err,const char *func_name=0) const;
QLabel *info_name_label;
QComboBox *info_name_box;
QLabel *info_utilization_label;
QLineEdit *info_utilization_edit;
QPushButton *info_utilization_button;
QLabel *info_index_label;
QLabel *info_serial_label;
QLabel *info_istreams_label;
QLabel *info_ostreams_label;
QLabel *info_dsp_label;
QLabel *info_adapter_label;
QLineEdit *info_mode_edit;
QPushButton *info_changemode_button;
uint32_t hpi_version;
QString hpi_name[HPI_MAX_ADAPTERS];
int name_map[HPI_MAX_ADAPTERS];
uint32_t hpi_indexes[HPI_MAX_ADAPTERS];
uint16_t hpi_ostreams[HPI_MAX_ADAPTERS];
uint16_t hpi_istreams[HPI_MAX_ADAPTERS];
uint16_t hpi_card_version[HPI_MAX_ADAPTERS];
uint32_t hpi_serial[HPI_MAX_ADAPTERS];
uint16_t hpi_type[HPI_MAX_ADAPTERS];
uint32_t hpi_mode[HPI_MAX_ADAPTERS];
hpi_handle_t hpi_profile[HPI_MAX_ADAPTERS];
uint16_t hpi_profile_quan[HPI_MAX_ADAPTERS];
QTimer *hpi_profile_timer;
};
#endif // RDHPIINFO_H

View File

@ -1,200 +0,0 @@
// virtdetails.cpp
//
// Show profile details for an AudioScience adapter.
//
// (C) Copyright 2014 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtimer.h>
#include "virtdetails.h"
VirtDetails::VirtDetails(uint16_t card,hpi_handle_t profile,
uint16_t profile_quan,QWidget *parent)
: QDialog(parent,"",true)
{
char name[200];
virt_card=card;
virt_profile=profile;
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setCaption(tr("RdHPIInfo - Profile Details"));
//
// Create Fonts
//
QFont font=QFont("Helvetica",12,QFont::Normal);
font.setPixelSize(12);
QFont label_font=QFont("Helvetica",12,QFont::Bold);
label_font.setPixelSize(12);
//
// Adapter Mode
//
virt_profile_box=new QComboBox(this);
virt_profile_box->setGeometry(75,10,sizeHint().width()-85,20);
virt_profile_box->setFont(font);
virt_profile_label=new QLabel(virt_profile_box,tr("Profile")+":",this);
virt_profile_label->setGeometry(10,10,60,20);
virt_profile_label->setFont(label_font);
virt_profile_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
for(uint16_t i=0;i<profile_quan;i++) {
if(HPI_ProfileGetName(NULL,profile,i,name,200)==0) {
if(QString(name).lower()!="unassigned") {
virt_profile_box->insertItem(name);
}
}
}
//
// Utilization Counter
//
virt_utilization_label=new QLabel(tr("Overall DSP Utilization")+":",this);
virt_utilization_label->setGeometry(10,35,160,20);
virt_utilization_label->setFont(label_font);
virt_utilization_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
virt_utilization_edit=new QLineEdit(this);
virt_utilization_edit->setGeometry(175,35,90,20);
virt_utilization_edit->setFont(font);
virt_utilization_edit->setReadOnly(true);
//
// Profile Interval Counter
//
virt_interval_label=new QLabel(tr("Profile Interval")+":",this);
virt_interval_label->setGeometry(10,57,160,20);
virt_interval_label->setFont(label_font);
virt_interval_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
virt_interval_edit=new QLineEdit(this);
virt_interval_edit->setGeometry(175,57,90,20);
virt_interval_edit->setFont(font);
virt_interval_edit->setReadOnly(true);
//
// Total Tick Count Counter
//
virt_total_ticks_label=new QLabel(tr("Total Tick Count")+":",this);
virt_total_ticks_label->setGeometry(10,79,160,20);
virt_total_ticks_label->setFont(label_font);
virt_total_ticks_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
virt_total_ticks_edit=new QLineEdit(this);
virt_total_ticks_edit->setGeometry(175,79,90,20);
virt_total_ticks_edit->setFont(font);
virt_total_ticks_edit->setReadOnly(true);
//
// Call Count Counter
//
virt_call_count_label=new QLabel(tr("Call Count")+":",this);
virt_call_count_label->setGeometry(10,101,160,20);
virt_call_count_label->setFont(label_font);
virt_call_count_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
virt_call_count_edit=new QLineEdit(this);
virt_call_count_edit->setGeometry(175,101,90,20);
virt_call_count_edit->setFont(font);
virt_call_count_edit->setReadOnly(true);
//
// Maximum Ticks Counter
//
virt_max_ticks_label=new QLabel(tr("Maximum Ticks / Pass")+":",this);
virt_max_ticks_label->setGeometry(10,123,160,20);
virt_max_ticks_label->setFont(label_font);
virt_max_ticks_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
virt_max_ticks_edit=new QLineEdit(this);
virt_max_ticks_edit->setGeometry(175,123,90,20);
virt_max_ticks_edit->setFont(font);
virt_max_ticks_edit->setReadOnly(true);
//
// Ticks per Millisecond Counter
//
virt_ticks_per_ms_label=new QLabel(tr("Ticks / mS")+":",this);
virt_ticks_per_ms_label->setGeometry(10,145,160,20);
virt_ticks_per_ms_label->setFont(label_font);
virt_ticks_per_ms_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
virt_ticks_per_ms_edit=new QLineEdit(this);
virt_ticks_per_ms_edit->setGeometry(175,145,90,20);
virt_ticks_per_ms_edit->setFont(font);
virt_ticks_per_ms_edit->setReadOnly(true);
//
// Close Button
//
QPushButton *close_button=new QPushButton(this);
close_button->setGeometry(sizeHint().width()-70,sizeHint().height()-40,
60,30);
close_button->setFont(font);
close_button->setText(tr("&Close"));
connect(close_button,SIGNAL(clicked()),this,SLOT(closeData()));
QTimer *timer=new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(updateProfileData()));
timer->start(1000);
}
QSize VirtDetails::sizeHint() const
{
return QSize(280,222);
}
QSizePolicy VirtDetails::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
void VirtDetails::updateProfileData()
{
uint32_t utilization;
uint16_t interval;
uint32_t total_ticks;
uint32_t call_count;
uint32_t max_ticks;
uint32_t ticks_per_ms;
if(HPI_ProfileGetUtilization(NULL,virt_profile,&utilization)==0) {
virt_utilization_edit->
setText(QString().sprintf("%5.1lf%%",(double)utilization/100.0));
}
if(HPI_ProfileGet(NULL,virt_profile,virt_profile_box->currentItem(),
&interval,&total_ticks,&call_count,&max_ticks,
&ticks_per_ms)==0) {
virt_interval_edit->setText(QString().sprintf("%u sec",interval));
virt_total_ticks_edit->setText(QString().sprintf("%u",total_ticks));
virt_call_count_edit->setText(QString().sprintf("%u",call_count));
virt_max_ticks_edit->setText(QString().sprintf("%u",max_ticks));
virt_ticks_per_ms_edit->setText(QString().sprintf("%u",ticks_per_ms));
}
}
void VirtDetails::closeData()
{
done(0);
}

View File

@ -1,66 +0,0 @@
// virtdetails.h
//
// Show profiling data for an AudioScience adapter
//
// (C) Copyright 2014 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#ifndef VIRTDETAILS_H
#define VIRTDETAILS_H
#include <stdint.h>
#include <qcombobox.h>
#include <qdialog.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <asihpi/hpi.h>
class VirtDetails : public QDialog
{
Q_OBJECT
public:
VirtDetails(uint16_t card,hpi_handle_t profile,uint16_t profile_quan,
QWidget *parent=0);
QSize sizeHint() const;
QSizePolicy sizePolicy() const;
private slots:
void updateProfileData();
void closeData();
private:
uint16_t virt_card;
hpi_handle_t virt_profile;
QLabel *virt_utilization_label;
QLineEdit *virt_utilization_edit;
QLabel *virt_profile_label;
QComboBox *virt_profile_box;
QLabel *virt_interval_label;
QLineEdit *virt_interval_edit;
QLabel *virt_total_ticks_label;
QLineEdit *virt_total_ticks_edit;
QLabel *virt_call_count_label;
QLineEdit *virt_call_count_edit;
QLabel *virt_max_ticks_label;
QLineEdit *virt_max_ticks_edit;
QLabel *virt_ticks_per_ms_label;
QLineEdit *virt_ticks_per_ms_edit;
};
#endif // VIRTDETAILS_H

View File

@ -31,7 +31,6 @@ install-exec-am:
cp rivendell-rddgimport.desktop $(DESTDIR)@prefix@/share/applications/
cp rivendell-rddiscimport.desktop $(DESTDIR)@prefix@/share/applications/
cp rivendell-rdgpimon.desktop $(DESTDIR)@prefix@/share/applications/
if test -f ../rdhpi/.libs/librdhpi-@VERSION@.so ; then cp rivendell-rdhpiinfo-root.desktop $(DESTDIR)@prefix@/share/applications/ ; fi
cp rivendell-rdlibrary.desktop $(DESTDIR)@prefix@/share/applications/
cp rivendell-rdlogedit.desktop $(DESTDIR)@prefix@/share/applications/
cp rivendell-rdlogin.desktop $(DESTDIR)@prefix@/share/applications/
@ -48,30 +47,21 @@ install-exec-am:
cp *.menu $(DESTDIR)/etc/xdg/menus/applications-merged/
mkdir -p $(DESTDIR)/etc/pam.d
cp rdalsaconfig-root-pam $(DESTDIR)/etc/pam.d/rdalsaconfig-root
if test -f ../rdhpi/.libs/librdhpi-@VERSION@.so ; then cp rdhpiinfo-root-pam $(DESTDIR)/etc/pam.d/rdhpiinfo-root ; fi
mkdir -p $(DESTDIR)/etc/security/console.apps
cp rdalsaconfig-root-consolehelper $(DESTDIR)/etc/security/console.apps/rdalsaconfig-root
if test -f ../rdhpi/.libs/librdhpi-@VERSION@.so ; then cp rdhpiinfo-root-consolehelper $(DESTDIR)/etc/security/console.apps/rdhpiinfo-root ; fi
rm -f $(DESTDIR)$(prefix)/bin/rdalsaconfig-root
ln -s /usr/bin/consolehelper $(DESTDIR)$(prefix)/bin/rdalsaconfig-root
rm -f $(DESTDIR)$(prefix)/bin/rdhpiinfo-root
if test -f ../rdhpi/.libs/librdhpi-@VERSION@.so ; then ln -s /usr/bin/consolehelper $(DESTDIR)$(prefix)/bin/rdhpiinfo-root ; fi
uninstall-local:
rm -f $(DESTDIR)@prefix@/share/applications/rivendell-*.desktop
rm -f $(DESTDIR)@prefix@/share/desktop-directories/rivendell-*.directory
rm -f $(DESTDIR)/etc/xdg/menus/applications-merged/rivendell-*.menu
rm -f $(DESTDIR)/etc/pam.d/rdalsaconfig-root
rm -f $(DESTDIR)/etc/pam.d/rdhpiinfo-root
rm -f $(DESTDIR)/etc/security/console.apps/rdalsaconfig-root
rm -f $(DESTDIR)/etc/security/console.apps/rdhpiinfo-root
rm -f $(DESTDIR)$(prefix)/bin/rdalsaconfig-root
rm -f $(DESTIDR)$(prefix)/bin/rdhpiinfo-root
EXTRA_DIST = rdalsaconfig-root-consolehelper\
rdalsaconfig-root-pam\
rdhpiinfo-root-consolehelper\
rdhpiinfo-root-pam\
rivendell-configuration.directory\
rivendell-documentation.directory\
rivendell-logtools.directory\
@ -87,8 +77,6 @@ EXTRA_DIST = rdalsaconfig-root-consolehelper\
rivendell-rddgimport.desktop\
rivendell-rddiscimport.desktop\
rivendell-rdgpimon.desktop\
rivendell-rdhpiinfo.desktop\
rivendell-rdhpiinfo-root.desktop\
rivendell-rdlibrary.desktop\
rivendell-rdlogedit.desktop\
rivendell-rdlogin.desktop\

View File

@ -1,3 +0,0 @@
USER=root
PROGRAM=/usr/bin/rdhpiinfo
SESSION=true

View File

@ -1,4 +0,0 @@
#%PAM-1.0
auth include config-util
account include config-util
session include config-util

View File

@ -1,10 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Terminal=false
Categories=Qt;KDE;Rivendell;
Name=RDHPIInfo
GenericName=AudioScience Card Information
Exec=rdhpiinfo-root
Icon=rivendell
Type=Application
Terminal=false

View File

@ -1,12 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Terminal=false
Categories=Qt;KDE;Rivendell;
Name=RDHPIInfo
GenericName=AudioScience Card Information
Exec=rdhpiinfo
Icon=rivendell
Type=Application
Terminal=false
X-KDE-SubstituteUID=true
X-KDE-Username=root