[ekiga/ds-gsettings3] Audio/Video Cores: Added anoter get_devices method.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gsettings3] Audio/Video Cores: Added anoter get_devices method.
- Date: Sun, 8 Dec 2013 17:35:21 +0000 (UTC)
commit 3f2e1cd9c4489b78bd0cc45477003cff1ce88600
Author: Damien Sandras <dsandras beip be>
Date: Sun Dec 8 18:19:59 2013 +0100
Audio/Video Cores: Added anoter get_devices method.
The new method returns a vector of devices represented by their string
descriptions.
The string description is used by the prefs and in various parts of the
program. The new method has the big advantage of having the same
signature whatever the core is unlike the former method which required
different arguments for each core.
lib/engine/audioinput/audioinput-core.cpp | 13 +++++++++++++
lib/engine/audioinput/audioinput-core.h | 1 +
lib/engine/audiooutput/audiooutput-core.cpp | 13 +++++++++++++
lib/engine/audiooutput/audiooutput-core.h | 1 +
lib/engine/videoinput/videoinput-core.cpp | 13 +++++++++++++
lib/engine/videoinput/videoinput-core.h | 1 +
6 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/lib/engine/audioinput/audioinput-core.cpp b/lib/engine/audioinput/audioinput-core.cpp
index 69e557a..bcfa83a 100644
--- a/lib/engine/audioinput/audioinput-core.cpp
+++ b/lib/engine/audioinput/audioinput-core.cpp
@@ -141,6 +141,19 @@ void AudioInputCore::visit_managers (boost::function1<bool, AudioInputManager &>
go_on = visitor (*(*iter));
}
+void AudioInputCore::get_devices (std::vector <std::string> & devices)
+{
+ std::vector <AudioInputDevice> d;
+ get_devices (d);
+
+ devices.clear ();
+
+ for (std::vector<AudioInputDevice>::iterator iter = d.begin ();
+ iter != d.end ();
+ ++iter)
+ devices.push_back (iter->GetString ());
+}
+
void AudioInputCore::get_devices (std::vector <AudioInputDevice> & devices)
{
yield = true;
diff --git a/lib/engine/audioinput/audioinput-core.h b/lib/engine/audioinput/audioinput-core.h
index ddaacaf..0c9dade 100644
--- a/lib/engine/audioinput/audioinput-core.h
+++ b/lib/engine/audioinput/audioinput-core.h
@@ -159,6 +159,7 @@ namespace Ekiga
/** Get a list of all devices supported by all managers registered to the core.
* @param devices a vector of device names to be filled by the core.
*/
+ void get_devices(std::vector <std::string> & devices);
void get_devices(std::vector <AudioInputDevice> & devices);
/** Set a specific device
diff --git a/lib/engine/audiooutput/audiooutput-core.cpp b/lib/engine/audiooutput/audiooutput-core.cpp
index 15f1d41..87bbd23 100644
--- a/lib/engine/audiooutput/audiooutput-core.cpp
+++ b/lib/engine/audiooutput/audiooutput-core.cpp
@@ -309,6 +309,19 @@ void AudioOutputCore::stop_play_event (const std::string & event_name)
audio_event_scheduler->remove_event_from_queue(event_name);
}
+void AudioOutputCore::get_devices (std::vector <std::string> & devices)
+{
+ std::vector <AudioOutputDevice> d;
+ get_devices (d);
+
+ devices.clear ();
+
+ for (std::vector<AudioOutputDevice>::iterator iter = d.begin ();
+ iter != d.end ();
+ ++iter)
+ devices.push_back (iter->GetString ());
+}
+
void AudioOutputCore::get_devices (std::vector <AudioOutputDevice> & devices)
{
yield = true;
diff --git a/lib/engine/audiooutput/audiooutput-core.h b/lib/engine/audiooutput/audiooutput-core.h
index df946b3..f0f05f3 100644
--- a/lib/engine/audiooutput/audiooutput-core.h
+++ b/lib/engine/audiooutput/audiooutput-core.h
@@ -152,6 +152,7 @@ namespace Ekiga
/** Get a list of all devices supported by all managers registered to the core.
* @param devices a vector of device names to be filled by the core.
*/
+ void get_devices(std::vector <std::string> & devices);
void get_devices(std::vector <AudioOutputDevice> & devices);
/** Set a specific device
diff --git a/lib/engine/videoinput/videoinput-core.cpp b/lib/engine/videoinput/videoinput-core.cpp
index 0c097ab..0aa5773 100644
--- a/lib/engine/videoinput/videoinput-core.cpp
+++ b/lib/engine/videoinput/videoinput-core.cpp
@@ -261,6 +261,19 @@ void VideoInputCore::visit_managers (boost::function1<bool, VideoInputManager &>
go_on = visitor (*(*iter));
}
+void VideoInputCore::get_devices (std::vector <std::string> & devices)
+{
+ std::vector <VideoInputDevice> d;
+ get_devices (d);
+
+ devices.clear ();
+
+ for (std::vector<VideoInputDevice>::iterator iter = d.begin ();
+ iter != d.end ();
+ ++iter)
+ devices.push_back (iter->GetString ());
+}
+
void VideoInputCore::get_devices (std::vector <VideoInputDevice> & devices)
{
PWaitAndSignal m(core_mutex);
diff --git a/lib/engine/videoinput/videoinput-core.h b/lib/engine/videoinput/videoinput-core.h
index fc5e082..8516eaa 100644
--- a/lib/engine/videoinput/videoinput-core.h
+++ b/lib/engine/videoinput/videoinput-core.h
@@ -154,6 +154,7 @@ namespace Ekiga
/** Get a list of all devices supported by all managers registered to the core.
* @param devices a vector of device names to be filled by the core.
*/
+ void get_devices(std::vector <std::string> & devices);
void get_devices(std::vector <VideoInputDevice> & devices);
/** Set a specific device
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]