refactor: return list of currently passthrough'd/input'd apps instead of size
This commit is contained in:
parent
d88e97b708
commit
9642159de9
@ -2,6 +2,7 @@
|
||||
#if defined(__linux__)
|
||||
#include <core/enums/enums.hpp>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -39,8 +40,8 @@ namespace Soundux
|
||||
virtual bool revertDefault() = 0;
|
||||
virtual bool muteInput(bool) = 0;
|
||||
|
||||
virtual bool isCurrentlyPassingThrough() = 0;
|
||||
virtual std::size_t passedThroughApplications() = 0;
|
||||
virtual std::set<std::string> currentlyInputApps() = 0;
|
||||
virtual std::set<std::string> currentlyPassedThrough() = 0;
|
||||
|
||||
virtual bool stopAllPassthrough() = 0;
|
||||
virtual bool stopPassthrough(const std::string &) = 0;
|
||||
|
@ -668,9 +668,25 @@ namespace Soundux::Objects
|
||||
return success;
|
||||
}
|
||||
|
||||
bool PipeWire::isCurrentlyPassingThrough()
|
||||
std::set<std::string> PipeWire::currentlyInputApps()
|
||||
{
|
||||
return !passthroughLinks.empty();
|
||||
std::set<std::string> rtn;
|
||||
for (const auto &[app, links] : soundInputLinks)
|
||||
{
|
||||
rtn.emplace(app);
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
std::set<std::string> PipeWire::currentlyPassedThrough()
|
||||
{
|
||||
std::set<std::string> rtn;
|
||||
for (const auto &[app, links] : passthroughLinks)
|
||||
{
|
||||
rtn.emplace(app);
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
bool PipeWire::stopPassthrough(const std::string &name)
|
||||
@ -701,10 +717,5 @@ namespace Soundux::Objects
|
||||
passthroughLinks.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
std::size_t PipeWire::passedThroughApplications()
|
||||
{
|
||||
return passthroughLinks.size();
|
||||
}
|
||||
} // namespace Soundux::Objects
|
||||
#endif
|
@ -103,9 +103,10 @@ namespace Soundux
|
||||
bool revertDefault() override;
|
||||
bool muteInput(bool state) override;
|
||||
|
||||
std::set<std::string> currentlyInputApps() override;
|
||||
std::set<std::string> currentlyPassedThrough() override;
|
||||
|
||||
bool stopAllPassthrough() override;
|
||||
bool isCurrentlyPassingThrough() override;
|
||||
std::size_t passedThroughApplications() override;
|
||||
bool stopPassthrough(const std::string &name) override;
|
||||
bool passthroughFrom(std::shared_ptr<PlaybackApp> app) override;
|
||||
|
||||
|
@ -635,11 +635,6 @@ namespace Soundux::Objects
|
||||
return success;
|
||||
}
|
||||
|
||||
bool PulseAudio::isCurrentlyPassingThrough()
|
||||
{
|
||||
return !movedPassthroughApplications.empty();
|
||||
}
|
||||
|
||||
bool PulseAudio::switchOnConnectPresent()
|
||||
{
|
||||
bool isPresent = false;
|
||||
@ -702,9 +697,26 @@ namespace Soundux::Objects
|
||||
|
||||
return false;
|
||||
}
|
||||
std::size_t PulseAudio::passedThroughApplications()
|
||||
|
||||
std::set<std::string> PulseAudio::currentlyInputApps()
|
||||
{
|
||||
return movedPassthroughApplications.size();
|
||||
std::set<std::string> rtn;
|
||||
for (const auto &[app, original] : movedApplications)
|
||||
{
|
||||
rtn.emplace(app);
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
std::set<std::string> PulseAudio::currentlyPassedThrough()
|
||||
{
|
||||
std::set<std::string> rtn;
|
||||
for (const auto &[app, original] : movedPassthroughApplications)
|
||||
{
|
||||
rtn.emplace(app);
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
} // namespace Soundux::Objects
|
||||
#endif
|
@ -76,9 +76,10 @@ namespace Soundux
|
||||
bool revertDefault() override;
|
||||
bool muteInput(bool state) override;
|
||||
|
||||
std::set<std::string> currentlyInputApps() override;
|
||||
std::set<std::string> currentlyPassedThrough() override;
|
||||
|
||||
bool stopAllPassthrough() override;
|
||||
bool isCurrentlyPassingThrough() override;
|
||||
std::size_t passedThroughApplications() override;
|
||||
bool stopPassthrough(const std::string &name) override;
|
||||
bool passthroughFrom(std::shared_ptr<PlaybackApp> app) override;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user