From 0f9cd5c116c5893b9d9feb423863dd5f09386362 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Tue, 22 Aug 2023 15:04:43 -0400 Subject: [PATCH] 2023-08-22 Fred Gleason * Removed 'RDSetMixerPorts()' from 'lib/rdmixer.[cpp|h]'. * Removed 'RDSetMixerOutputPort()' from 'lib/rdmixer.[cpp|h]'. * Added a 'RDCae::setOutputPort()' method. Signed-off-by: Fred Gleason --- ChangeLog | 4 +++ lib/Makefile.am | 1 - lib/rdcae.cpp | 11 ++++++++ lib/rdcae.h | 3 ++ lib/rdlogplay.cpp | 6 ++-- lib/rdmarkerdialog.cpp | 3 +- lib/rdmarkerplayer.cpp | 5 ++-- lib/rdmixer.cpp | 55 ------------------------------------- lib/rdmixer.h | 31 --------------------- lib/rdplay_deck.cpp | 1 - rdcatch/rdcatch.cpp | 9 +++--- rdcatchd/rdcatchd.cpp | 9 +++--- rdlibrary/record_cut.cpp | 5 ++-- rdvairplayd/rdvairplayd.cpp | 1 - 14 files changed, 33 insertions(+), 111 deletions(-) delete mode 100644 lib/rdmixer.cpp delete mode 100644 lib/rdmixer.h diff --git a/ChangeLog b/ChangeLog index b19467f4..393c231a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24358,3 +24358,7 @@ * Removed dead code from the 'RDPlayDeck' class. 2023-08-22 Fred Gleason * Added a 'RDPlayDeck::dumpCutPoints()' method. +2023-08-22 Fred Gleason + * Removed 'RDSetMixerPorts()' from 'lib/rdmixer.[cpp|h]'. + * Removed 'RDSetMixerOutputPort()' from 'lib/rdmixer.[cpp|h]'. + * Added a 'RDCae::setOutputPort()' method. diff --git a/lib/Makefile.am b/lib/Makefile.am index ce422a30..ea23c1d6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -197,7 +197,6 @@ dist_librd_la_SOURCES = dbversion.h\ rdmblookup.cpp rdmblookup.h\ rdmeteraverage.cpp rdmeteraverage.h\ rdmeterstrip.cpp rdmeterstrip.h\ - rdmixer.cpp rdmixer.h\ rdmonitor_config.cpp rdmonitor_config.h\ rdmp4.cpp rdmp4.h\ rdmulticaster.cpp rdmulticaster.h\ diff --git a/lib/rdcae.cpp b/lib/rdcae.cpp index b7262034..369a7ef1 100644 --- a/lib/rdcae.cpp +++ b/lib/rdcae.cpp @@ -276,6 +276,17 @@ void RDCae::setOutputVolume(int card,int stream,int port,int level) } +void RDCae::setOutputPort(int card,int stream,int port) +{ + for(int i=0;ienforceLength()) { logline->setTimescalingActive(true); } - RDSetMixerOutputPort(play_cae,playdeck->card(), - playdeck->stream(), - playdeck->port()); + play_cae-> + setOutputPort(playdeck->card(),playdeck->stream(),playdeck->port()); if((int)logline->playPosition()>logline->effectiveLength()) { rda->syslog(LOG_DEBUG,"log engine: *** position out of bounds: Line: %d Cart: %d Pos: %d ***",line,logline->cartNumber(),logline->playPosition()); logline->setPlayPosition(0); diff --git a/lib/rdmarkerdialog.cpp b/lib/rdmarkerdialog.cpp index 3eb0d85f..2efeab17 100644 --- a/lib/rdmarkerdialog.cpp +++ b/lib/rdmarkerdialog.cpp @@ -2,7 +2,7 @@ // // Rivendell Audio Marker Editor // -// (C) Copyright 2021 Fred Gleason +// (C) Copyright 2021-2023 Fred Gleason // // 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 @@ -22,7 +22,6 @@ #include "rdaudioinfo.h" #include "rdmarkerdialog.h" -#include "rdmixer.h" RDMarkerDialog::RDMarkerDialog(const QString &caption,int card,int port, QWidget *parent) diff --git a/lib/rdmarkerplayer.cpp b/lib/rdmarkerplayer.cpp index 2a215b61..6dc72829 100644 --- a/lib/rdmarkerplayer.cpp +++ b/lib/rdmarkerplayer.cpp @@ -2,7 +2,7 @@ // // Audio player for RDMarkerDialog // -// (C) Copyright 2021-2022 Fred Gleason +// (C) Copyright 2021-2023 Fred Gleason // // 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 @@ -20,7 +20,6 @@ #include "rdconf.h" #include "rdescape_string.h" -#include "rdmixer.h" #include "rdmarkerplayer.h" RDMarkerPlayer::RDMarkerPlayer(int card,int port,QWidget *parent) @@ -237,7 +236,7 @@ bool RDMarkerPlayer::setCut(unsigned cartnum,int cutnum) return false; } rda->cae()->positionPlay(d_cae_handle,0); - RDSetMixerOutputPort(rda->cae(),d_cards.first(),d_cae_stream,d_port); + rda->cae()->setOutputPort(d_cards.first(),d_cae_stream,d_port); QString sql=QString("select ")+ "`START_POINT`,"+ // 00 diff --git a/lib/rdmixer.cpp b/lib/rdmixer.cpp deleted file mode 100644 index f2360919..00000000 --- a/lib/rdmixer.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// rdmixer.cpp -// -// Mixer Functions for Rivendell. -// -// (C) Copyright 2002-2004,2016 Fred Gleason -// -// 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 -#include - -#include - -void RDSetMixerPorts(QString station,RDCae *cae) -{ - for(int i=0;isetClockSource(i,port->clockSource()); - for(int j=0;jinputPortType(j)==RDAudioPort::Analog) { - cae->setInputType(i,j,RDCae::Analog); - } - else { - cae->setInputType(i,j,RDCae::AesEbu); - } - cae->setInputLevel(i,j,RD_BASE_ANALOG+port->inputPortLevel(j)); - cae->setOutputLevel(i,j,RD_BASE_ANALOG+port->outputPortLevel(j)); - cae->setInputMode(i,j,port->inputPortMode(j)); - } - delete port; - } -} - - -void RDSetMixerOutputPort(RDCae *cae,int card,int stream,int port) -{ - for(int i=0;isetOutputVolume(card,stream,i,-10000); - } - } - cae->setOutputVolume(card,stream,port,0); -} diff --git a/lib/rdmixer.h b/lib/rdmixer.h deleted file mode 100644 index 8c98930e..00000000 --- a/lib/rdmixer.h +++ /dev/null @@ -1,31 +0,0 @@ -// rdmixer.h -// -// Mixer Functions for Rivendell. -// -// (C) Copyright 2002-2003,2016 Fred Gleason -// -// 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 RDMIXER_H -#define RDMIXER_H - -#include -#include - -void RDSetMixerPorts(QString station,RDCae *cae); -void RDSetMixerOutputPort(RDCae *cae,int card,int stream,int port); - - -#endif // RDMIXER_H diff --git a/lib/rdplay_deck.cpp b/lib/rdplay_deck.cpp index eec90cb3..c1242fb1 100644 --- a/lib/rdplay_deck.cpp +++ b/lib/rdplay_deck.cpp @@ -20,7 +20,6 @@ #include -#include "rdmixer.h" #include "rdplay_deck.h" RDPlayDeck::RDPlayDeck(RDCae *cae,int id,QObject *parent) diff --git a/rdcatch/rdcatch.cpp b/rdcatch/rdcatch.cpp index 59fb3784..3364475a 100644 --- a/rdcatch/rdcatch.cpp +++ b/rdcatch/rdcatch.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include "add_recording.h" #include "colors.h" @@ -711,8 +710,8 @@ void MainWidget::headButtonData() if(catch_audition_stream<0) { return; } - RDSetMixerOutputPort(rda->cae(),catch_audition_card,catch_audition_stream, - catch_audition_port); + rda->cae()->setOutputPort(catch_audition_card,catch_audition_stream, + catch_audition_port); rda->cae()->positionPlay(catch_play_handle,cut->startPoint()); rda->cae()->setPlayPortActive(catch_audition_card,catch_audition_port, catch_audition_stream); @@ -742,8 +741,8 @@ void MainWidget::tailButtonData() if(catch_audition_stream<0) { return; } - RDSetMixerOutputPort(rda->cae(),catch_audition_card,catch_audition_stream, - catch_audition_port); + rda->cae()->setOutputPort(catch_audition_card,catch_audition_stream, + catch_audition_port); if((cut->endPoint()-cut->startPoint()-RDCATCH_AUDITION_LENGTH)>0) { rda->cae()->positionPlay(catch_play_handle, cut->endPoint()-RDCATCH_AUDITION_LENGTH); diff --git a/rdcatchd/rdcatchd.cpp b/rdcatchd/rdcatchd.cpp index 7bb5da9c..f323eeb2 100644 --- a/rdcatchd/rdcatchd.cpp +++ b/rdcatchd/rdcatchd.cpp @@ -2,7 +2,7 @@ // // The Rivendell Netcatcher Daemon // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // 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 @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -1336,9 +1335,9 @@ void MainObject::StartPlayout(int event) catch_events[event].cutName(), &catch_playout_stream[deck-129], &catch_playout_handle[deck-129]); - RDSetMixerOutputPort(rda->cae(),catch_playout_card[deck-129], - catch_playout_stream[deck-129], - catch_playout_port[deck-129]); + rda->cae()->setOutputPort(catch_playout_card[deck-129], + catch_playout_stream[deck-129], + catch_playout_port[deck-129]); rda->cae()->positionPlay(catch_playout_handle[deck-129],start); catch_playout_event_player[deck-129]->start(start); rda->cae()-> diff --git a/rdlibrary/record_cut.cpp b/rdlibrary/record_cut.cpp index 79bef0db..a797c21c 100644 --- a/rdlibrary/record_cut.cpp +++ b/rdlibrary/record_cut.cpp @@ -2,7 +2,7 @@ // // Record a Rivendell Cut // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // 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 @@ -21,7 +21,6 @@ #include #include -#include #include #include "globals.h" @@ -656,7 +655,7 @@ void RecordCut::playData() if((!is_recording)&&(!is_playing)&&(!is_ready)) { // Start Play rda->cae()->loadPlay(rec_card_no[1],rec_cut->cutName(), &rec_stream_no[1],&rec_play_handle); - RDSetMixerOutputPort(rda->cae(),rec_card_no[1],rec_stream_no[1],rec_port_no[1]); + rda->cae()->setOutputPort(rec_card_no[1],rec_stream_no[1],rec_port_no[1]); rda->cae()->positionPlay(rec_play_handle,start); rda->cae()->setPlayPortActive(rec_card_no[1],rec_port_no[1],rec_stream_no[1]); rda->cae()->setOutputVolume(rec_card_no[1],rec_stream_no[1],rec_port_no[1], diff --git a/rdvairplayd/rdvairplayd.cpp b/rdvairplayd/rdvairplayd.cpp index afcd1963..ef55fa41 100644 --- a/rdvairplayd/rdvairplayd.cpp +++ b/rdvairplayd/rdvairplayd.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "rdvairplayd.h"