-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from baz2142/audio-control-devices
Audio control: Speakers and microphones support
- Loading branch information
Showing
15 changed files
with
197 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 0 additions & 67 deletions
67
packages/ghaf-audio-control/src/lib/include/GhafAudioControl/models/AppVmModel.hpp
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
packages/ghaf-audio-control/src/lib/include/GhafAudioControl/models/DeviceListModel.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <GhafAudioControl/IAudioControlBackend.hpp> | ||
#include <GhafAudioControl/models/DeviceModel.hpp> | ||
|
||
#include <glibmm/object.h> | ||
#include <glibmm/property.h> | ||
|
||
#include <giomm/liststore.h> | ||
|
||
namespace ghaf::AudioControl | ||
{ | ||
|
||
class DeviceListModel final : public Glib::Object | ||
{ | ||
private: | ||
explicit DeviceListModel(std::string name, std::string namePrefix = ""); | ||
|
||
public: | ||
static Glib::RefPtr<DeviceListModel> create(std::string name, std::string namePrefix = ""); | ||
|
||
static int compare(const Glib::RefPtr<const DeviceListModel>& a, const Glib::RefPtr<const DeviceListModel>& b); | ||
|
||
void addDevice(IAudioControlBackend::ISink::Ptr sink); | ||
|
||
[[nodiscard]] Glib::RefPtr<Gio::ListStore<DeviceModel>> getDeviceModels() noexcept | ||
{ | ||
return m_devices; | ||
} | ||
|
||
[[nodiscard]] auto getAppNameProperty() const | ||
{ | ||
return m_name.get_proxy(); | ||
} | ||
|
||
[[nodiscard]] auto getNamePrefix() const | ||
{ | ||
return m_namePrefix; | ||
} | ||
|
||
private: | ||
Glib::Property<Glib::ustring> m_name; | ||
std::string m_namePrefix; | ||
|
||
Glib::RefPtr<Gio::ListStore<DeviceModel>> m_devices; | ||
std::map<IAudioControlBackend::IDevice::IntexT, sigc::connection> m_deviceConnections; | ||
}; | ||
|
||
} // namespace ghaf::AudioControl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.