[ekiga] Made the Ekiga::AudioInputCore api received a shared pointer to the audio output instead of a refere
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Made the Ekiga::AudioInputCore api received a shared pointer to the audio output instead of a refere
- Date: Sun, 26 Sep 2010 15:29:43 +0000 (UTC)
commit 8e9a0054f732fa9280a71ab61426c0d534845566
Author: Julien Puydt <jpuydt gnome org>
Date: Sun Sep 26 13:49:45 2010 +0200
Made the Ekiga::AudioInputCore api received a shared pointer to the audio output instead of a reference
Notice that the code behind doesn't look good because we unwrap the
protection with *_audio_output_core.get (), but at least the external api
looks better.
(I also removed an unhelpful comment : the api already forces us to do
things in the right order... which is a good sign)
lib/engine/audioinput/audioinput-core.cpp | 5 ++---
lib/engine/audioinput/audioinput-core.h | 2 +-
lib/engine/engine.cpp | 7 ++-----
3 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/lib/engine/audioinput/audioinput-core.cpp b/lib/engine/audioinput/audioinput-core.cpp
index 8bbda31..a4661a3 100644
--- a/lib/engine/audioinput/audioinput-core.cpp
+++ b/lib/engine/audioinput/audioinput-core.cpp
@@ -108,9 +108,8 @@ void AudioInputCore::AudioPreviewManager::Main ()
}*/
}
-AudioInputCore::AudioInputCore (AudioOutputCore& _audio_output_core)
-: preview_manager(*this, _audio_output_core)
-
+AudioInputCore::AudioInputCore (boost::shared_ptr<AudioOutputCore> _audio_output_core):
+ preview_manager(*this, *_audio_output_core.get ())
{
PWaitAndSignal m_var(core_mutex);
PWaitAndSignal m_vol(volume_mutex);
diff --git a/lib/engine/audioinput/audioinput-core.h b/lib/engine/audioinput/audioinput-core.h
index 2e04aef..fa4b103 100644
--- a/lib/engine/audioinput/audioinput-core.h
+++ b/lib/engine/audioinput/audioinput-core.h
@@ -97,7 +97,7 @@ namespace Ekiga
/** The constructor
* @param _videooutput_core reference ot the audio output core.
*/
- AudioInputCore (AudioOutputCore& _audio_output_core);
+ AudioInputCore (boost::shared_ptr<AudioOutputCore> _audio_output_core);
/** The destructor
*/
diff --git a/lib/engine/engine.cpp b/lib/engine/engine.cpp
index dc77f9f..79e0a16 100644
--- a/lib/engine/engine.cpp
+++ b/lib/engine/engine.cpp
@@ -116,17 +116,14 @@ engine_init (Ekiga::ServiceCorePtr service_core,
service_core->add (Ekiga::ServicePtr(new Ekiga::NotificationCore));
- /* VideoInputCore depends on VideoOutputCore and must this *
- * be constructed thereafter */
-
boost::shared_ptr<Ekiga::AccountCore> account_core (new Ekiga::AccountCore);
boost::shared_ptr<Ekiga::ContactCore> contact_core (new Ekiga::ContactCore);
boost::shared_ptr<Ekiga::CallCore> call_core (new Ekiga::CallCore);
boost::shared_ptr<Ekiga::ChatCore> chat_core (new Ekiga::ChatCore);
boost::shared_ptr<Ekiga::VideoOutputCore> videooutput_core (new Ekiga::VideoOutputCore);
- boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core (new Ekiga::VideoInputCore(videooutput_core));
+ boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core (new Ekiga::VideoInputCore (videooutput_core));
boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core (new Ekiga::AudioOutputCore);
- boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core (new Ekiga::AudioInputCore(*audiooutput_core));
+ boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core (new Ekiga::AudioInputCore (audiooutput_core));
boost::shared_ptr<Ekiga::HalCore> hal_core (new Ekiga::HalCore);
boost::shared_ptr<Ekiga::FriendOrFoe> friend_or_foe (new Ekiga::FriendOrFoe);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]