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

[pygame] Re: Pygame2 sdlmixer documentation contribution + error



Here's the patch I forgot to attach; apply it to doc/src/sdlmixerbase.xml.


--
Evan Kroske
http://welcome2obscurity.blogspot.com/
The code, comments, and challenges of a novice
software developer desperate for attention.
Index: sdlmixerbase.xml
===================================================================
--- sdlmixerbase.xml	(revision 2600)
+++ sdlmixerbase.xml	(working copy)
@@ -11,60 +11,91 @@
       Do not use :mod:`pygame2.sdlmixer` and :mod:`pygame2.sdl.audio` at the
       same time. As they both deal with audio hardware access, this can lead
       to problems and weird behaviour.
-  
   </desc>
 
   <class name="Channel">
-    <constructor>TODO</constructor>
-    <desc></desc>
+    <constructor>Channel () -> Channel</constructor>
+    <desc>
+      Creates a new Channel object for playing 
+      :class:`pygame2.sdlmixer.Chunk` of sound.
+    </desc>
     <attr name="chunk">
-      <desc></desc>
+      <desc>
+        The :class:`pygame2.sdlmixer.Chunk` of sound that has been loaded.
+      </desc>
     </attr>
     <method name="expire">
-      <call></call>
+      <call>expire (arg)</call>
       <desc></desc>
     </method>
     <method name="fade_in">
-      <call></call>
+      <call>fade_in (chunk, int)</call>
       <desc></desc>
     </method>
     <method name="fade_out">
-      <call></call>
+      <call>fade_out (arg)</call>
       <desc></desc>
     </method>
     <attr name="fading">
-      <desc></desc>
+      <desc>TODO</desc>
     </attr>
     <method name="halt">
-      <call></call>
-      <desc></desc>
+      <call>halt ()</call>
+      <desc>
+        Appears to halt music playback until another 
+        :class:`pygame2.sdlmixer.Chunk` is played with :meth:`play`.
+      </desc>
     </method>
     <method name="pause">
-      <call></call>
-      <desc></desc>
+      <call>pause ()</call>
+      <desc>
+        Pauses playing :class:`pygame2.sdlmixer.Chunk` of sound. Paused 
+        :class:`pygame2.sdlmixer.Chunk` can be resumed where it left off with 
+        :meth:`resume`.
+      </desc>
     </method>
     <attr name="paused">
-      <desc></desc>
+      <desc>
+        A boolean that represents the state of the 
+        :class:`pygame2.sdlmixer.Channel`. If True, the 
+        :class:`pygame2.sdlmixer.Chunk` has been paused; if false, the 
+        :class:`pygame2.sdlmixer.Chunk` is not paused. Please note that if 
+        :attr:`paused` is False, the :class:`pygame2.sdlmixer.Chunk` isn't 
+        necessarily playing.
+      </desc>
     </attr>
     <method name="play">
-      <call></call>
-      <desc></desc>
+      <call>play (chunk)</call>
+      <desc>
+        Plays :class:`pygame2.sdlmixer.Chunk` *chunk* of sound which was 
+        passed to it.
+      </desc>
     </method>
     <attr name="playing">
-      <desc></desc>
+      <desc>
+        A boolean that represents the state of the 
+        :class:`pygame2.sdlmixer.Channel`. If true, the 
+        :class:`pygame2.sdlmixer.Chunk` is playing; if false, the 
+        :class:`pygame2.sdlmixer.Chunk` is not playing. Please note that if 
+        :attr:`paused` is False, the :class:`pygame2.sdlmixer.Chunk` isn't 
+        necessarily paused.
+      </desc>
     </attr>
     <method name="resume">
-      <call></call>
-      <desc></desc>
+      <call>resume ()</call>
+      <desc>
+        Resumes the play back of a paused :class:`pygame2.sdlmixer.Chunk`.
+      </desc>
     </method>
     <attr name="volume">
-      <desc></desc>
+      <desc>TODO</desc>
     </attr>
   </class>
 
   <class name="Chunk">
-    <constructor>TODO</constructor>
+    <constructor>Chunk (file) -> Chunk</constructor>
     <desc>
+      A chunk of sound loaded from audio file *file*.
 
       .. note::
 
@@ -72,72 +103,90 @@
         access. This is especially important for Python 3.x users.
     </desc>
     <attr name="buf">
-      <desc></desc>
+      <desc>TODO</desc>
     </attr>
     <attr name="len">
-      <desc></desc>
+      <desc>TODO</desc>
     </attr>
     <attr name="volume">
-      <desc></desc>
+      <desc>TODO</desc>
     </attr>
   </class>
 
   <class name="Music">
-    <constructor>TODO</constructor>
+    <constructor>Music (file) -> Music</constructor>
     <desc>
-
       .. note::
 
         The file object *must* support binary read and write
         access. This is especially important for Python 3.x users.
     </desc>
     <method name="fade_in">
-      <call></call>
+      <call>fade_in (arg)</call>
       <desc></desc>
     </method>
     <method name="play">
-      <call></call>
+      <call>play ()</call>
       <desc></desc>
     </method>
     <attr name="type">
-      <desc></desc>
+      <desc>TODO</desc>
     </attr>
   </class>
 
   <func name="close_audio">
-    <call></call>
-    <desc></desc>
+    <call>close_audio ()</call>
+    <desc>
+      Closes the audio and resets the settings passed to :meth:`open_audio`
+    </desc>
   </func>
   <func name="get_compiled_version">
-    <call></call>
+    <call>get_compiled_version ()</call>
     <desc></desc>
   </func>
   <func name="get_error">
-    <call></call>
+    <call>get_error ()</call>
     <desc></desc>
   </func>
   <func name="get_version">
-    <call></call>
+    <call>get_version ()</call>
     <desc></desc>
   </func>
   <func name="init">
-    <call></call>
-    <desc></desc>
+    <call>init ()</call>
+    <desc>
+      Initializes the sdlmixer system. Please note that you must also use 
+      :meth:`open_audio` to set some vital settings before you can play sounds
+      with :class:`pygame2.sdlmixer.Channel` and :class:`pygame2.sdlmixer.Chunk`.
+    </desc>
   </func>
   <func name="open_audio">
-    <call></call>
-    <desc></desc>
+    <call>open_audio (audio_rate, audio_format, audio_channels, audio_buffers)</call>
+    <desc>
+      Initializes audio settings before any sound can be played. I have no idea 
+      what any of the arguments do, but they're all mandatory. From 
+      http://kekkai.org/roger/sdl/mixer/index.html I learned that these are 
+      acceptable settings::
+      
+      * audio_rate 22050
+      * audio_format 0x8010
+      * audio_channels 2
+      * audio_buffers 4096
+      
+    </desc>
   </func>
   <func name="query_spec">
-    <call></call>
+    <call>query_spec ()</call>
     <desc></desc>
   </func>
   <func name="quit">
-    <call></call>
-    <desc></desc>
+    <call>quit ()</call>
+    <desc>
+      Shuts down the sdlmixer system.
+    </desc>
   </func>
   <func name="was_init">
-    <call></call>
+    <call>was_init ()</call>
     <desc></desc>
   </func>
 </module>