raDIYo 0.4
swplayercontrol.h
1/***************************************************************************
2
3 source::worx raDIYo
4 Copyright © 2020-2022 c.holzheuer
5 c.holzheuer@sourceworx.org
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12***************************************************************************/
13
14
15#ifndef SWPLAYERCONTROL_H
16#define SWPLAYERCONTROL_H
17
18
19#include <QMediaPlayer>
20#include <QAudioFormat>
21#include <QAudioProbe>
22#include <QAudioDeviceInfo>
23
24#include <ui_swplayercontrol.h>
25#include <swabstractcontrol.h>
26#include <swfftcalc.h>
27
28
29QT_BEGIN_NAMESPACE
30namespace Ui { class SWPlayerControl; }
31QT_END_NAMESPACE
32
33
34class SWPlayerControl : public SWAbstractControl, private Ui_SWPlayerControl
35{
36 Q_OBJECT
37
38public:
39
40 explicit SWPlayerControl( SWRaDIYoMainWidget* parent );
41 virtual ~SWPlayerControl();
42
43 void startPlaying( const QString& urlText );
44 void stopPlaying();
45
46 void loadSettings();
47 void saveSettings();
48
49public slots:
50
51 void onDialClicked() override;
52 void onDialValueChanged( int value ) override;
53
54 void onAudioProbed( QAudioBuffer audiobuffer );
55 void onSpectrumReady( const SWDoubleVec& spectrum );
56
57protected:
58
59 //void reset();
60
61 int _volume = 0;
62 QMediaPlayer _player;
63 QAudioProbe _audioProbe;
64
65 SWFFTCalc _FFTCalc;
66
67};
68
69#endif // SWPLAYERCONTROL_H
void startPlaying(const QString &urlText)
SWPlayerControl::startPlaying: Erwartet eine ordentliche URL als String.