diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-07-27 11:01:30 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-07-27 11:01:30 -0500 |
commit | b0936139bfef6fe169b5c17be4b2dafa3c2e2c3a (patch) | |
tree | e4c9149fc11dca4d607066053258884dba0efec1 /src/sound.cpp | |
parent | 7271b2139a5c600a2c3cdb4e552e05ddb0f374dd (diff) | |
download | ayatana-indicator-datetime-b0936139bfef6fe169b5c17be4b2dafa3c2e2c3a.tar.gz ayatana-indicator-datetime-b0936139bfef6fe169b5c17be4b2dafa3c2e2c3a.tar.bz2 ayatana-indicator-datetime-b0936139bfef6fe169b5c17be4b2dafa3c2e2c3a.zip |
copyediting: comments, use anonymous namespace
Diffstat (limited to 'src/sound.cpp')
-rw-r--r-- | src/sound.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/sound.cpp b/src/sound.cpp index 052b168..7658658 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -63,13 +63,14 @@ public: gst_object_unref(bus); g_debug("Playing '%s'", m_uri.c_str()); - play(); + g_object_set(G_OBJECT (m_play), "uri", m_uri.c_str(), + "volume", get_volume(), + nullptr); + gst_element_set_state (m_play, GST_STATE_PLAYING); } ~Impl() { - stop(); - g_source_remove(m_watch_source); if (m_play != nullptr) @@ -81,24 +82,6 @@ public: private: - void stop() - { - if (m_play != nullptr) - { - gst_element_set_state (m_play, GST_STATE_PAUSED); - } - } - - void play() - { - g_return_if_fail(m_play != nullptr); - - g_object_set(G_OBJECT (m_play), "uri", m_uri.c_str(), - "volume", get_volume(), - nullptr); - gst_element_set_state (m_play, GST_STATE_PLAYING); - } - // convert settings range [1..100] to gst playbin's range is [0...1.0] gdouble get_volume() const { |