Music Hub
..
A session-wide music playback service
Loading...
Searching...
No Matches
recorder_observer.cpp
Go to the documentation of this file.
1
/*
2
* Copyright © 2014 Canonical Ltd.
3
* Copyright © 2022 UBports Foundation.
4
*
5
* Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6
*
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU Lesser General Public License version 3,
9
* as published by the Free Software Foundation.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*
19
* Authored by: Thomas Voß <thomas.voss@canonical.com>
20
*/
21
22
#include "
recorder_observer.h
"
23
24
#include "
hybris_recorder_observer.h
"
25
#include "
logging.h
"
26
#include "
player.h
"
27
#include "
stub_recorder_observer.h
"
28
29
namespace
media
=
lomiri::MediaHubService
;
30
31
using namespace
media
;
32
33
namespace
{
34
35
RecorderObserverPrivate
*
36
make_platform_default_recorder_observer(
RecorderObserver
*q)
37
{
38
const
media::AVBackend::Backend b {media::AVBackend::get_backend_type()};
39
switch
(b)
40
{
41
case
media::AVBackend::Backend::hybris:
42
return
new
media::HybrisRecorderObserver
(q);
43
case
media::AVBackend::Backend::mir:
44
case
media::AVBackend::Backend::none:
45
MH_WARNING
(
46
"No video backend selected. Video recording functionality won't work."
47
);
48
return
new
media::StubRecorderObserver
(q);
49
default
:
50
MH_INFO
(
"Invalid or no A/V backend specified, using \"hybris\" as a default."
);
51
return
new
media::HybrisRecorderObserver
(q);
52
}
53
}
54
55
}
// namespace
56
57
RecorderObserver::RecorderObserver
(
QObject
*parent):
58
QObject
(parent),
59
d_ptr(make_platform_default_recorder_observer(this))
60
{
61
}
62
63
RecorderObserver::~RecorderObserver
() =
default
;
64
65
RecordingState
RecorderObserver::recordingState
()
const
66
{
67
Q_D(
const
RecorderObserver
);
68
return
d->recordingState();
69
}
QObject
lomiri::MediaHubService::HybrisRecorderObserver
Definition
hybris_recorder_observer.h:34
lomiri::MediaHubService::RecorderObserverPrivate
Definition
recorder_observer_p.h:28
lomiri::MediaHubService::RecorderObserver
Definition
recorder_observer.h:45
lomiri::MediaHubService::RecorderObserver::recordingState
RecordingState recordingState() const
Definition
recorder_observer.cpp:65
lomiri::MediaHubService::RecorderObserver::~RecorderObserver
virtual ~RecorderObserver()
lomiri::MediaHubService::RecorderObserver::RecorderObserver
RecorderObserver(QObject *parent=nullptr)
Definition
recorder_observer.cpp:57
lomiri::MediaHubService::StubRecorderObserver
Definition
stub_recorder_observer.h:32
hybris_recorder_observer.h
MH_INFO
#define MH_INFO(...)
Definition
logging.h:39
MH_WARNING
#define MH_WARNING(...)
Definition
logging.h:40
lomiri::MediaHubService
Definition
context.h:29
lomiri::MediaHubService::RecordingState
RecordingState
Definition
recorder_observer.h:34
recorder_observer.h
logging.h
player.h
stub_recorder_observer.h
src
service
recorder_observer.cpp
Generated on Mon Mar 16 2026 06:06:21 for Music Hub by
1.9.8