mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-15 09:01:14 +01:00
2021-07-02 Fred Gleason <fredg@paravelsystems.com>
* Added an 'AUDIO_INPUTS.LABEL' field to the database. * Added an 'AUDIO_OUTPUTS.LABEL' field to the database. * Incremented the database version to 350. * Added 'RDAudioPort::inputPortLabel()', 'RDAudioPort::setInputPortLabel()' 'RDAudioPort::outputPortLabel()' and 'RDAudioPort::setOutputPortLabel()' methods. * Added 'Label' fields to the 'Input Port' and 'Output Port' sections of the 'Edit Audio Ports' dialog in rdadmin(1). * Added code to rdairplay(1) to use port labels on audio meters. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -44,7 +44,8 @@ RDAudioPort::RDAudioPort(QString station,int card)
|
||||
"`PORT_NUMBER`,"+ // 00
|
||||
"`LEVEL`,"+ // 01
|
||||
"`TYPE`,"+ // 02
|
||||
"`MODE` "+ // 03
|
||||
"`MODE`,"+ // 03
|
||||
"`LABEL` "+ // 04
|
||||
"from `AUDIO_INPUTS` where "+
|
||||
"`STATION_NAME`='"+RDEscapeString(port_station)+"' && "+
|
||||
QString().sprintf("`CARD_NUMBER`=%d",port_card);
|
||||
@@ -55,18 +56,21 @@ RDAudioPort::RDAudioPort(QString station,int card)
|
||||
(RDAudioPort::PortType)q->value(2).toInt();
|
||||
audio_input_port_mode[q->value(0).toInt()]=
|
||||
(RDCae::ChannelMode)q->value(3).toInt();
|
||||
audio_input_port_labels[q->value(0).toInt()]=q->value(4).toString();
|
||||
}
|
||||
delete q;
|
||||
|
||||
sql=QString("select ")+
|
||||
"`PORT_NUMBER`,"+ // 00
|
||||
"`LEVEL` "+ // 01
|
||||
"`LEVEL`,"+ // 01
|
||||
"`LABEL` "+ // 02
|
||||
"from `AUDIO_OUTPUTS` where "+
|
||||
"`STATION_NAME`='"+RDEscapeString(port_station)+"' && "+
|
||||
QString().sprintf("`CARD_NUMBER`=%d",port_card);
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
audio_output_port_level[q->value(0).toInt()]=q->value(1).toInt();
|
||||
audio_output_port_labels[q->value(0).toInt()]=q->value(2).toString();
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
@@ -110,6 +114,31 @@ void RDAudioPort::setClockSource(RDCae::ClockSource src)
|
||||
}
|
||||
|
||||
|
||||
QString RDAudioPort::inputPortLabel(int port) const
|
||||
{
|
||||
if(port<0||port>RD_MAX_PORTS) {
|
||||
return QObject::tr("ERR");
|
||||
}
|
||||
|
||||
return audio_input_port_labels[port];
|
||||
}
|
||||
|
||||
|
||||
void RDAudioPort::setInputPortLabel(int port,const QString &str)
|
||||
{
|
||||
if(port<0||port>RD_MAX_PORTS) {
|
||||
return;
|
||||
}
|
||||
audio_input_port_labels[port]=str;
|
||||
QString sql=QString("update `AUDIO_INPUTS` set ")+
|
||||
"`LABEL`='"+RDEscapeString(str)+"' where "+
|
||||
"`STATION_NAME`='"+RDEscapeString(port_station)+"' && "+
|
||||
QString().sprintf("`CARD_NUMBER`=%d && ",port_card)+
|
||||
QString().sprintf("`PORT_NUMBER`=%d",port);
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
RDAudioPort::PortType RDAudioPort::inputPortType(int port)
|
||||
{
|
||||
if(port<0||port>RD_MAX_PORTS) {
|
||||
@@ -188,6 +217,31 @@ void RDAudioPort::setInputPortLevel(int port,int level)
|
||||
}
|
||||
|
||||
|
||||
QString RDAudioPort::outputPortLabel(int port) const
|
||||
{
|
||||
if(port<0||port>RD_MAX_PORTS) {
|
||||
return QObject::tr("ERR");
|
||||
}
|
||||
|
||||
return audio_output_port_labels[port];
|
||||
}
|
||||
|
||||
|
||||
void RDAudioPort::setOutputPortLabel(int port,const QString &str)
|
||||
{
|
||||
if(port<0||port>RD_MAX_PORTS) {
|
||||
return;
|
||||
}
|
||||
audio_output_port_labels[port]=str;
|
||||
QString sql=QString("update `AUDIO_OUTPUTS` set ")+
|
||||
"`LABEL`='"+RDEscapeString(str)+"' where "+
|
||||
"`STATION_NAME`='"+RDEscapeString(port_station)+"' && "+
|
||||
QString().sprintf("`CARD_NUMBER`=%d && ",port_card)+
|
||||
QString().sprintf("`PORT_NUMBER`=%d",port);
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
int RDAudioPort::outputPortLevel(int port)
|
||||
{
|
||||
if(port<0||port>RD_MAX_PORTS) {
|
||||
|
||||
Reference in New Issue
Block a user