Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
KMix
Commits
873ddac9
Commit
873ddac9
authored
Oct 04, 2020
by
Jonathan Marten
Browse files
ViewBase: Make protected data private, use access functions
parent
1658f158
Changes
3
Hide whitespace changes
Inline
Side-by-side
gui/viewbase.h
View file @
873ddac9
...
...
@@ -85,7 +85,11 @@ public:
ProfControl
*
findMdw
(
const
QString
&
mdwId
,
GuiVisibility
visibility
=
GuiVisibility
::
Default
)
const
;
KActionCollection
*
actionCollection
()
const
{
return
(
_actions
);
}
const
QList
<
Mixer
*>
&
getMixers
()
const
{
return
(
_mixers
);
}
const
QList
<
Mixer
*>
&
getMixers
()
const
{
return
(
_mixers
);
}
void
clearMixers
()
{
_mixers
.
clear
();
}
const
MixSet
&
getMixSet
()
const
{
return
(
_mixSet
);
}
void
addToMixSet
(
shared_ptr
<
MixDevice
>
md
)
{
_mixSet
.
append
(
md
);
}
int
mixDeviceCount
()
const
{
return
(
_mdws
.
count
());
}
QWidget
*
mixDeviceAt
(
int
i
)
const
{
return
(
_mdws
.
at
(
i
));
}
...
...
@@ -117,9 +121,9 @@ private:
void
updateMediaPlaybackIcons
();
void
popupReset
();
pr
otec
te
d
:
pr
iva
te:
MixSet
_mixSet
;
QList
<
Mixer
*>
_mixers
;
QList
<
Mixer
*>
_mixers
;
protected:
void
resetMdws
();
...
...
gui/viewdockareapopup.cpp
View file @
873ddac9
...
...
@@ -296,11 +296,11 @@ Application: KMix (kmix), signal: Segmentation fault
// Adding all mixers, as we potentially want to show all master controls.
// Due to hotplugging we have to redo the list on each initLayout() instead of
// setting it once in the constructor.
_mixers
.
clear
();
clearMixers
();
QSet
<
QString
>
preferredMixersForSoundmenu
=
GlobalConfig
::
instance
().
getMixersForSoundmenu
();
//qCDebug(KMIX_LOG) << "Launch with " << preferredMixersForSoundmenu;
for
each
(
Mixer
*
mixer
,
Mixer
::
mixers
()
)
for
(
Mixer
*
mixer
:
qAsConst
(
Mixer
::
mixers
()
)
)
{
bool
useMixer
=
preferredMixersForSoundmenu
.
isEmpty
()
||
preferredMixersForSoundmenu
.
contains
(
mixer
->
id
());
if
(
useMixer
)
addMixer
(
mixer
);
...
...
@@ -309,9 +309,9 @@ Application: KMix (kmix), signal: Segmentation fault
// The following loop is for the case when everything gets filtered out. We "reset" to show everything then.
// Hint: Filtering everything out can only be an "accident", e.g. when restarting KMix with changed hardware or
// backends.
if
(
_m
ixers
.
isEmpty
()
)
if
(
getM
ixers
()
.
isEmpty
())
{
for
each
(
Mixer
*
mixer
,
Mixer
::
mixers
()
)
for
(
Mixer
*
mixer
:
qAsConst
(
Mixer
::
mixers
()
)
)
{
addMixer
(
mixer
);
}
...
...
@@ -334,7 +334,7 @@ Application: KMix (kmix), signal: Segmentation fault
//
// Maybe need a configuration option?
for
each
(
const
Mixer
*
mixer
,
_m
ixers
)
for
(
const
Mixer
*
mixer
:
qAsConst
(
getM
ixers
())
)
{
//qCDebug(KMIX_LOG) << "ADD? mixerId=" << mixer->id();
// Get the configured master control for the mixer.
...
...
@@ -355,17 +355,17 @@ Application: KMix (kmix), signal: Segmentation fault
if
(
dockMD
->
playbackVolume
().
hasVolume
()
||
dockMD
->
captureVolume
().
hasVolume
())
{
//qCDebug(KMIX_LOG) << "ADD? mixerId=" << mixer->id() << ", md=" << dockMD->id() << ": YES";
_mixSet
.
append
(
dockMD
);
addToMixSet
(
dockMD
);
}
}
}
// loop over all cards
// Finally add all application streams
for
each
(
const
Mixer
*
mixer
,
_m
ixers
)
for
(
const
Mixer
*
mixer
:
qAsConst
(
getM
ixers
())
)
{
for
each
(
shared_ptr
<
MixDevice
>
md
,
mixer
->
getMixSet
())
for
(
shared_ptr
<
MixDevice
>
md
:
qAsConst
(
mixer
->
getMixSet
())
)
{
if
(
md
->
isApplicationStream
())
_mixSet
.
append
(
md
);
if
(
md
->
isApplicationStream
())
addToMixSet
(
md
);
}
}
}
...
...
@@ -493,16 +493,7 @@ void ViewDockAreaPopup::refreshVolumeLevels()
void
ViewDockAreaPopup
::
configureView
()
{
// Q_ASSERT( !pulseaudioPresent() );
// QSet<QString> currentlyActiveMixersInDockArea;
// foreach ( Mixer* mixer, _mixers )
// {
// currentlyActiveMixersInDockArea.insert(mixer->id());
// }
KMixPrefDlg
*
prefDlg
=
KMixPrefDlg
::
getInstance
();
//prefDlg->setActiveMixersInDock(currentlyActiveMixersInDockArea);
KMixPrefDlg
*
prefDlg
=
KMixPrefDlg
::
getInstance
();
prefDlg
->
switchToPage
(
KMixPrefDlg
::
PrefSoundMenu
);
}
...
...
gui/viewsliders.cpp
View file @
873ddac9
...
...
@@ -189,6 +189,8 @@ void ViewSliders::initLayout()
m_emptyStreamHint
->
setIcon
(
QIcon
::
fromTheme
(
"dialog-information"
));
m_emptyStreamHint
->
setMessageType
(
KMessageWidget
::
Information
);
m_emptyStreamHint
->
setCloseButtonVisible
(
false
);
m_emptyStreamHint
->
setMaximumWidth
(
200
);
m_emptyStreamHint
->
setWordWrap
(
true
);
m_layoutSliders
->
addWidget
(
m_emptyStreamHint
);
if
(
orientation
()
==
Qt
::
Horizontal
)
// horizontal sliders
...
...
@@ -217,7 +219,7 @@ void ViewSliders::initLayout()
const
GUIProfile
*
guiprof
=
guiProfile
();
if
(
guiprof
!=
nullptr
)
{
for
each
(
Mixer
*
mixer
,
_m
ixers
)
for
(
const
Mixer
*
mixer
:
getM
ixers
()
)
{
const
MixSet
&
mixset
=
mixer
->
getMixSet
();
...
...
@@ -232,7 +234,7 @@ void ViewSliders::initLayout()
if
(
md
->
id
().
contains
(
idRegexp
))
{
// match found (by name)
if
(
_m
ixSet
.
contains
(
md
))
if
(
getM
ixSet
()
.
contains
(
md
))
{
// check for duplicate already
continue
;
}
...
...
@@ -259,7 +261,7 @@ void ViewSliders::initLayout()
else
if
(
control
->
getSwitchtype
()
==
"Off"
)
md
->
playbackVolume
().
setSwitchType
(
Volume
::
OffSwitch
);
}
_mixSet
.
append
(
md
);
addToMixSet
(
md
);
#ifdef TEST_MIXDEVICE_COMPOSITE
if
(
md
->
id
()
==
"Front:0"
||
md
->
id
()
==
"Surround:0"
)
...
...
@@ -277,7 +279,7 @@ void ViewSliders::initLayout()
// Show a hint why a tab is empty (dynamic controls!)
// TODO: 'visibleControls()==0' could be used for the !isDynamic() case
m_emptyStreamHint
->
setVisible
(
_m
ixSet
.
isEmpty
()
&&
isDynamic
());
m_emptyStreamHint
->
setVisible
(
getM
ixSet
()
.
isEmpty
()
&&
isDynamic
());
#ifdef TEST_MIXDEVICE_COMPOSITE
// @todo: This is currently hardcoded, and instead must be read as usual from the Profile
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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