File indexing completed on 2024-09-08 05:01:26
0001 /* 0002 SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 #pragma once 0007 0008 #include <QObject> 0009 #include <canberra.h> 0010 0011 namespace QPulseAudio 0012 { 0013 class CanberraContext : public QObject 0014 { 0015 Q_OBJECT 0016 0017 public: 0018 explicit CanberraContext(QObject *parent = nullptr); 0019 virtual ~CanberraContext(); 0020 0021 static CanberraContext *instance(); 0022 0023 ca_context *canberra(); 0024 0025 void ref(); 0026 void unref(); 0027 0028 private: 0029 ca_context *m_canberra = nullptr; 0030 int m_references = 0; 0031 0032 static CanberraContext *s_context; 0033 }; 0034 0035 }