[gsound] Rename gsound_context_change_attrs() to set_attributes()



commit 4bce22d1e39fcfe8be5161a6f13a777f93684c0d
Author: Tristan Brindle <t c brindle gmail com>
Date:   Sat Nov 15 13:38:46 2014 +0800

    Rename gsound_context_change_attrs() to set_attributes()
    
    This method just wraps "ca_context_change_props()", which is how
    it got its name. But I think the abbreviation of "attribute" is
    just confusing, and this is conceptually a "set" operation.
    
    Mind you, calling it "set" like this might lead people to wonder
    why there is no corresponding "get"...?

 gsound/GSound-1.0.metadata |    6 +++---
 gsound/gsound-context.c    |   22 +++++++++++-----------
 gsound/gsound-context.h    |    4 ++--
 tools/gsound-play.vala     |    2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/gsound/GSound-1.0.metadata b/gsound/GSound-1.0.metadata
index 7bf7472..7da89a8 100644
--- a/gsound/GSound-1.0.metadata
+++ b/gsound/GSound-1.0.metadata
@@ -3,9 +3,9 @@
 
 ATTR_* skip=false name="ATTR_(.+)" parent="GSound.Attribute"
 
-Context.change_attrs skip=false throws="GLib.Error"
-Context.change_attrs.error skip
-Context.change_attrsv skip=false
+Context.set_attributes skip=false throws="GLib.Error"
+Context.set_attributes.error skip
+Context.set_attributesv skip=false
 
 Context.play_simple skip=false throws="GLib.Error"
 Context.play_simple.error skip
diff --git a/gsound/gsound-context.c b/gsound/gsound-context.c
index bb4775b..b328a2a 100644
--- a/gsound/gsound-context.c
+++ b/gsound/gsound-context.c
@@ -25,7 +25,7 @@
  * is:
  * 
  * * Initialize the #GSoundContext
- * * [Optional] Set any global attributes using gsound_context_change_attrs()
+ * * [Optional] Set any global attributes using gsound_context_set_attributes()
  * * [Optional] Cache any frequently-used sounds (for example, sound
  *   effects for a game) using gsound_context_cache()
  * * Play sounds using gsound_context_play_simple() or gsound_context_play_full()
@@ -104,7 +104,7 @@
  * 
  * GSound supplies information to the sound server by means of attributes.
  * Attributes can be set on the #GSoundContext itself using
- * gsound_context_change_attrs(), or supplied in a `play()` call. Attributes
+ * gsound_context_set_attributes(), or supplied in a `play()` call. Attributes
  * set on the context will automatically applied to any subsequent `play()`
  * calls, unless overridden by that call.
  * 
@@ -247,7 +247,7 @@ gsound_context_new (GCancellable *cancellable, GError **error)
  * @error: Return location for error
  *
  * Attempts to open a connection to the backend sound driver. It is recommended
- * that you set context attributes with gsound_context_change_attrs() before
+ * that you set context attributes with gsound_context_set_attributes() before
  * calling this function.
  *
  * > A connection is automatically opened before playing or caching sounds,
@@ -289,7 +289,7 @@ gsound_context_set_driver (GSoundContext *self,
 }
 
 /**
- * gsound_context_change_attrs: (skip)
+ * gsound_context_set_attributes: (skip)
  * @context: A #GSoundContext
  * @error: Return location for error
  * @...: %NULL terminated list of attribute name-value pairs
@@ -304,9 +304,9 @@ gsound_context_set_driver (GSoundContext *self,
  * Returns: %TRUE if attributes were updated successfully
  */
 gboolean
-gsound_context_change_attrs (GSoundContext *self,
-                             GError       **error,
-                             ...)
+gsound_context_set_attributes (GSoundContext *self,
+                               GError       **error,
+                               ...)
 {
   ca_proplist *pl;
   va_list args;
@@ -329,7 +329,7 @@ gsound_context_change_attrs (GSoundContext *self,
 }
 
 /**
- * gsound_context_change_attrsv: (rename-to gsound_context_change_attrs)
+ * gsound_context_set_attributesv: (rename-to gsound_context_set_attributes)
  * @context: A #GSoundContext
  * @attrs: (element-type utf8 utf8): Hash table of attributes to set
  * @error: Return location for error, or %NULL
@@ -344,9 +344,9 @@ gsound_context_change_attrs (GSoundContext *self,
  * Returns: %TRUE if attributes were updated successfully
  */
 gboolean
-gsound_context_change_attrsv (GSoundContext *self,
-                              GHashTable    *attrs,
-                              GError       **error)
+gsound_context_set_attributesv (GSoundContext *self,
+                                GHashTable    *attrs,
+                                GError       **error)
 {
   ca_proplist *pl;
   int res;
diff --git a/gsound/gsound-context.h b/gsound/gsound-context.h
index 58b01f1..4c0df87 100644
--- a/gsound/gsound-context.h
+++ b/gsound/gsound-context.h
@@ -65,11 +65,11 @@ GSoundContext    *gsound_context_new               (GCancellable  *cancellable,
 gboolean          gsound_context_open              (GSoundContext  *context,
                                                     GError        **error);
 
-gboolean          gsound_context_change_attrs      (GSoundContext  *context,
+gboolean          gsound_context_set_attributes    (GSoundContext  *context,
                                                     GError        **error,
                                                     ...) G_GNUC_NULL_TERMINATED;
 
-gboolean          gsound_context_change_attrsv     (GSoundContext  *context,
+gboolean          gsound_context_set_attributesv   (GSoundContext  *context,
                                                     GHashTable     *attrs,
                                                     GError        **error);
 
diff --git a/tools/gsound-play.vala b/tools/gsound-play.vala
index bc3507e..db9d4a0 100644
--- a/tools/gsound-play.vala
+++ b/tools/gsound-play.vala
@@ -52,7 +52,7 @@ int main(string[] args)
         }
         
         gs_ctx = new GSound.Context();
-        gs_ctx.change_attrs(GSound.Attribute.APPLICATION_ID, "org.gnome.gsound-test");
+        gs_ctx.set_attributes(GSound.Attribute.APPLICATION_ID, "org.gnome.gsound-test");
         
         if (driver != null) {
             gs_ctx.set_driver(driver);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]