Skip to content
Snippets Groups Projects
trtaudioout.h 2.41 KiB
Newer Older
  • Learn to ignore specific revisions
  • SeeLook's avatar
    SeeLook committed
    /***************************************************************************
    
     *   Copyright (C) 2013-2019 by Tomasz Bojczuk                             *
    
     *   seelook@gmail.com                                                     *
    
    SeeLook's avatar
    SeeLook committed
     *                                                                         *
     *   This program is free software; you can redistribute it and/or modify  *
     *   it under the terms of the GNU General Public License as published by  *
     *   the Free Software Foundation; either version 3 of the License, or     *
     *   (at your option) any later version.                                   *
     *                                                                         *
     *   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, see <http://www.gnu.org/licenses/>.  *
     ***************************************************************************/
    
    #ifndef TRTAUDIOOUT_H
    #define TRTAUDIOOUT_H
    
    
    SeeLook's avatar
    SeeLook committed
    #include "tabstractplayer.h"
    
     * Nootka audio output through @p RtAudio
    
    class NOOTKASOUND_EXPORT TaudioOUT : public TabstractPlayer, public TrtAudio
    
    SeeLook's avatar
    SeeLook committed
    {
    
    SeeLook's avatar
    SeeLook committed
    public:
    
        TaudioOUT(TaudioParams *_params, QObject *parent = nullptr);
        ~TaudioOUT() override;
    
        static QStringList getAudioDevicesList();
    
        void stop() override;
    
        void setAudioOutParams();
    
        static bool outCallBack(void *outBuff, void *inBuff, unsigned int nBufferFrames);
    
        void decodeNextSlot();
    
        void startPlaying() override;
    
        void updateSlot() { setAudioOutParams(); }
        void playingFinishedDelay();
        void playingFinishedSlot();
    
    #if defined(Q_OS_WIN)
    
        void ASIORestartSlot();
    
        static TaudioOUT *instance; /**< Static pointer of this class instance. */
        ToggScale *oggScale;
        int ratioOfRate; /**< ratio of current sample rate to 44100 */
    
    SeeLook's avatar
    SeeLook committed
    private:
    
        bool m_callBackIsBussy;
        bool m_singleNotePlayed = false;
    
    SeeLook's avatar
    SeeLook committed
    };
    
    #endif // TRTAUDIOOUT_H