aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-05-28 09:35:09 +0200
committerCharles Kerr <charles.kerr@canonical.com>2014-05-28 09:35:09 +0200
commit170d4e9ca354000aab81db6d7d6cce7058bb5d51 (patch)
treeee5d8cc7c5a9caca696dc8e097f9b2a937da7afd /src/snap.cpp
parent9f7acc63171a5d7052aa7a9d48b09d38f2a1b936 (diff)
downloadayatana-indicator-datetime-170d4e9ca354000aab81db6d7d6cce7058bb5d51.tar.gz
ayatana-indicator-datetime-170d4e9ca354000aab81db6d7d6cce7058bb5d51.tar.bz2
ayatana-indicator-datetime-170d4e9ca354000aab81db6d7d6cce7058bb5d51.zip
don't ca_context_cache() the default alarm sound, since we don't use it on desktop and caching fails on phone
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 0856069..a087a75 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -50,7 +50,6 @@ namespace
// arbitrary number, but we need a consistent id for play/cancel
const int32_t alarm_ca_id = 1;
-gboolean media_cached = FALSE;
ca_context *c_context = nullptr;
guint timeout_tag = 0;
@@ -65,18 +64,6 @@ ca_context* get_ca_context()
g_warning("Failed to create canberra context: %s\n", ca_strerror(rv));
c_context = nullptr;
}
- else
- {
- const char* filename = ALARM_SOUND_FILENAME;
- rv = ca_context_cache(c_context,
- CA_PROP_EVENT_ID, "alarm",
- CA_PROP_MEDIA_FILENAME, filename,
- CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
- NULL);
- media_cached = rv == CA_SUCCESS;
- if (rv != CA_SUCCESS)
- g_warning("Couldn't add '%s' to canberra cache: %s", filename, ca_strerror(rv));
- }
}
return c_context;
@@ -106,8 +93,6 @@ void play_alarm_sound()
ca_proplist* props = nullptr;
ca_proplist_create(&props);
- if (media_cached)
- ca_proplist_sets(props, CA_PROP_EVENT_ID, "alarm");
ca_proplist_sets(props, CA_PROP_MEDIA_FILENAME, filename);
const auto rv = ca_context_play_full(context, alarm_ca_id, props, on_alarm_play_done, nullptr);
@@ -307,7 +292,6 @@ Snap::Snap()
Snap::~Snap()
{
- media_cached = false;
g_clear_pointer(&c_context, ca_context_destroy);
}