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
25#include "logging.h"
26#include "player.h"
28
30
31using namespace media;
32
33namespace {
34
36make_platform_default_recorder_observer(RecorderObserver *q)
37{
39 switch (b)
40 {
42 return new media::HybrisRecorderObserver(q);
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
58 QObject(parent),
59 d_ptr(make_platform_default_recorder_observer(this))
60{
61}
62
64
66{
67 Q_D(const RecorderObserver);
68 return d->recordingState();
69}
#define MH_INFO(...)
Definition logging.h:39
#define MH_WARNING(...)
Definition logging.h:40
static Backend get_backend_type()
Returns the type of audio/video decoding/encoding backend being used.
Definition backend.cpp:28