Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
879924ec
Commit
879924ec
authored
May 11, 2020
by
Jean-Baptiste Mardelle
Browse files
Don't fetch frame for audiospectrum if it is hidden
parent
31a5423f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/mainwindow.cpp
View file @
879924ec
...
...
@@ -328,6 +328,9 @@ void MainWindow::init()
// Audio spectrum scope
m_audioSpectrum
=
new
AudioGraphSpectrum
(
pCore
->
monitorManager
());
QDockWidget
*
spectrumDock
=
addDock
(
i18n
(
"Audio Spectrum"
),
QStringLiteral
(
"audiospectrum"
),
m_audioSpectrum
);
connect
(
spectrumDock
,
&
QDockWidget
::
visibilityChanged
,
[
&
](
bool
visible
)
{
m_audioSpectrum
->
dockVisible
(
visible
);
});
// Close library and audiospectrum on first run
screenGrabDock
->
close
();
libraryDock
->
close
();
...
...
src/monitor/scopes/audiographspectrum.cpp
View file @
879924ec
...
...
@@ -303,7 +303,7 @@ AudioGraphSpectrum::AudioGraphSpectrum(MonitorManager *manager, QWidget *parent)
QAction
*
a
=
new
QAction
(
i18n
(
"Enable Audio Spectrum"
),
this
);
a
->
setCheckable
(
true
);
a
->
setChecked
(
KdenliveSettings
::
enableaudiospectrum
());
if
(
KdenliveSettings
::
enableaudiospectrum
())
{
if
(
KdenliveSettings
::
enableaudiospectrum
()
&&
isVisible
()
)
{
connect
(
m_manager
,
&
MonitorManager
::
frameDisplayed
,
this
,
&
ScopeWidget
::
onNewFrame
,
Qt
::
UniqueConnection
);
}
connect
(
a
,
&
QAction
::
triggered
,
this
,
&
AudioGraphSpectrum
::
activate
);
...
...
@@ -317,6 +317,17 @@ AudioGraphSpectrum::~AudioGraphSpectrum()
delete
m_filter
;
}
void
AudioGraphSpectrum
::
dockVisible
(
bool
visible
)
{
if
(
KdenliveSettings
::
enableaudiospectrum
())
{
if
(
!
visible
)
{
disconnect
(
m_manager
,
&
MonitorManager
::
frameDisplayed
,
this
,
&
ScopeWidget
::
onNewFrame
);
}
else
{
connect
(
m_manager
,
&
MonitorManager
::
frameDisplayed
,
this
,
&
ScopeWidget
::
onNewFrame
);
}
}
}
void
AudioGraphSpectrum
::
activate
(
bool
enable
)
{
if
(
enable
)
{
...
...
src/monitor/scopes/audiographspectrum.h
View file @
879924ec
...
...
@@ -80,6 +80,7 @@ class AudioGraphSpectrum : public ScopeWidget
public:
AudioGraphSpectrum
(
MonitorManager
*
manager
,
QWidget
*
parent
=
nullptr
);
~
AudioGraphSpectrum
()
override
;
void
dockVisible
(
bool
visible
);
private:
MonitorManager
*
m_manager
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment