Revision: 30750
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30750
Author:   nexyon
Date:     2010-07-26 11:29:36 +0200 (Mon, 26 Jul 2010)

Log Message:
-----------
Audaspace Py API:
* Renaming superpose and double to mix and join
* Making most of the static methods of Sound normal ones
* Minor documentation fixes

Modified Paths:
--------------
    branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp
    branches/soc-2010-nexyon/intern/audaspace/Python/doc/examples/tetris.py
    branches/soc-2010-nexyon/intern/audaspace/Python/doc/templates/Module.rst

Modified: branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp
===================================================================
--- branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp      
2010-07-26 09:23:34 UTC (rev 30749)
+++ branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp      
2010-07-26 09:29:36 UTC (rev 30750)
@@ -140,64 +140,54 @@
 Sound_file(PyObject* nothing, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
-                        "lowpass(sound, frequency)\n\n"
+                        "lowpass(frequency)\n\n"
                         "Creates a low quality lowpass filter.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg frequency: The cut off trequency of the 
lowpass.\n"
                         ":type frequency: float\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_lowpass(PyObject* nothing, PyObject* args);
+Sound_lowpass(Sound* self, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_delay_doc,
-                        "delay(sound, time)\n\n"
+                        "delay(time)\n\n"
                         "Delays a sound by playing silence before the sound 
starts.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg time: How many seconds of silence should be 
added before the sound.\n"
                         ":type time: float\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_delay(PyObject* nothing, PyObject* args);
+Sound_delay(Sound* self, PyObject* args);
 
-PyDoc_STRVAR(M_aud_Sound_double_doc,
-                        "double(first, second)\n\n"
+PyDoc_STRVAR(M_aud_Sound_join_doc,
+                        "join(sound)\n\n"
                         "Plays two sounds in sequence.\n\n"
-                        ":arg first: The sound to play first.\n"
-                        ":type first: aud.Sound\n"
-                        ":arg second: The sound to play second.\n"
-                        ":type second: aud.Sound\n"
+                        ":arg sound: The sound to play second.\n"
+                        ":type sound: aud.Sound\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound\n\n"
                         ".. note:: The two sounds have to have the same 
specifications "
                         "(channels and samplerate).");
 
 static PyObject *
-Sound_double(PyObject* nothing, PyObject* args);
+Sound_join(Sound* self, PyObject* object);
 
 PyDoc_STRVAR(M_aud_Sound_highpass_doc,
-                        "highpass(sound, frequency)\n\n"
+                        "highpass(frequency)\n\n"
                         "Creates a low quality highpass filter.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg frequency: The cut off trequency of the 
highpass.\n"
                         ":type frequency: float\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_highpass(PyObject* nothing, PyObject* args);
+Sound_highpass(Sound* self, PyObject* args);
 
-PyDoc_STRVAR(M_aud_Sound_limiter_doc,
-                        "limit(sound, start, end)\n\n"
+PyDoc_STRVAR(M_aud_Sound_limit_doc,
+                        "limit(start, end)\n\n"
                         "Limits a sound within a specific start and end 
time.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg start: Start time in seconds.\n"
                         ":type start: float\n"
                         ":arg end: End time in seconds.\n"
@@ -206,13 +196,11 @@
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_limiter(PyObject* nothing, PyObject* args);
+Sound_limit(Sound* self, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_pitch_doc,
-                        "pitch(sound, factor)\n\n"
+                        "pitch(factor)\n\n"
                         "Changes the pitch of a sound with a specific 
factor.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg factor: The factor to change the pitch with.\n"
                         ":type factor: float\n"
                         ":return: The created aud.Sound object.\n"
@@ -222,57 +210,53 @@
                         "value rounded and the factor may not be 100 % 
accurate.");
 
 static PyObject *
-Sound_pitch(PyObject* nothing, PyObject* args);
+Sound_pitch(Sound* self, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_volume_doc,
-                        "volume(sound, volume)\n\n"
+                        "volume(volume)\n\n"
                         "Changes the volume of a sound.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg volume: The new volume..\n"
                         ":type volume: float\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound\n\n"
-                        ".. note:: Should be in the range [0, 1] to avoid 
clipping.");
+                        ".. note:: Should be in the range [0, 1] to avoid 
clipping.\n\n"
+                        ".. note:: This is a filter function, you might 
consider using "
+                        "aud.Handle.pitch instead.");
 
 static PyObject *
-Sound_volume(PyObject* nothing, PyObject* args);
+Sound_volume(Sound* self, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_fadein_doc,
-                        "fadein(sound, start, length)\n\n"
+                        "fadein(start, length)\n\n"
                         "Fades a sound in.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg start: Time in seconds when the fading should 
start.\n"
-                        ":type filename: float\n"
+                        ":type start: float\n"
                         ":arg length: Time in seconds how long the fading 
should last.\n"
-                        ":type filename: float\n"
+                        ":type length: float\n"
                         ":return: The created aud.Sound object.\n"
-                        ":rtype: aud.Sound");
+                        ":rtype: aud.Sound\n\n"
+                        ".. note:: This is a filter function, you might 
consider using "
+                        "aud.Handle.volume instead.");
 
 static PyObject *
-Sound_fadein(PyObject* nothing, PyObject* args);
+Sound_fadein(Sound* self, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
-                        "fadeout(sound, start, length)\n\n"
+                        "fadeout(start, length)\n\n"
                         "Fades a sound out.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg start: Time in seconds when the fading should 
start.\n"
-                        ":type filename: float\n"
+                        ":type start: float\n"
                         ":arg length: Time in seconds how long the fading 
should last.\n"
-                        ":type filename: float\n"
+                        ":type length: float\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_fadeout(PyObject* nothing, PyObject* args);
+Sound_fadeout(Sound* self, PyObject* args);
 
 PyDoc_STRVAR(M_aud_Sound_loop_doc,
-                        "loop(sound, count)\n\n"
+                        "loop(count)\n\n"
                         "Loops a sound.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg count: How often the sound should be looped. "
                         "Negative values mean endlessly.\n"
                         ":type count: integer\n"
@@ -280,69 +264,61 @@
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_loop(PyObject* nothing, PyObject* args);
+Sound_loop(Sound* self, PyObject* args);
 
-PyDoc_STRVAR(M_aud_Sound_superpose_doc,
-                        "superpose(sound1, sound2)\n\n"
+PyDoc_STRVAR(M_aud_Sound_mix_doc,
+                        "mix(sound)\n\n"
                         "Mixes two sounds.\n\n"
-                        ":arg sound1: The sound to filter.\n"
-                        ":type sound1: aud.Sound\n"
-                        ":arg sound2: The sound to filter.\n"
-                        ":type sound2: aud.Sound\n"
+                        ":arg sound: The sound to mix over the other.\n"
+                        ":type sound: aud.Sound\n"
                         ":return: The created aud.Sound object.\n"
-                        ":rtype: aud.Sound");
+                        ":rtype: aud.Sound\n\n"
+                        ".. note:: The two sounds have to have the same 
specifications "
+                        "(channels and samplerate).");
 
 static PyObject *
-Sound_superpose(PyObject* nothing, PyObject* args);
+Sound_mix(Sound* self, PyObject* object);
 
 PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
-                        "pingpong(sound)\n\n"
+                        "pingpong()\n\n"
                         "Plays a sound forward and then backward.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound\n\n"
                         ".. note:: The sound has to be buffered to be played 
reverse.");
 
 static PyObject *
-Sound_pingpong(PyObject* nothing, PyObject* args);
+Sound_pingpong(Sound* self);
 
 PyDoc_STRVAR(M_aud_Sound_reverse_doc,
-                        "reverse(sound)\n\n"
+                        "reverse()\n\n"
                         "Plays a sound reversed.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound\n\n"
                         ".. note:: The sound has to be buffered to be played 
reverse.");
 
 static PyObject *
-Sound_reverse(PyObject* nothing, PyObject* args);
+Sound_reverse(Sound* self);
 
 PyDoc_STRVAR(M_aud_Sound_buffer_doc,
-                        "buffer(sound)\n\n"
+                        "buffer()\n\n"
                         "Buffers a sound into RAM.\n\n"
-                        ":arg sound: The sound to buffer.\n"
-                        ":type sound: aud.Sound\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound\n\n"
                         ".. note:: Raw PCM data needs a lot of space, only 
buffer short sounds.");
 
 static PyObject *
-Sound_buffer(PyObject* nothing, PyObject* args);
+Sound_buffer(Sound* self);
 
 PyDoc_STRVAR(M_aud_Sound_square_doc,
-                        "squre(sound, threshold)\n\n"
+                        "squre(threshold)\n\n"
                         "Makes a square wave out of an audio wave.\n\n"
-                        ":arg sound: The sound to filter.\n"
-                        ":type sound: aud.Sound\n"
                         ":arg threshold: Threshold value over which an 
amplitude counts non-zero.\n"
                         ":type threshold: float\n"
                         ":return: The created aud.Sound object.\n"
                         ":rtype: aud.Sound");
 
 static PyObject *
-Sound_square(PyObject* nothing, PyObject* args);
+Sound_square(Sound* self, PyObject* args);
 
 static PyMethodDef Sound_methods[] = {
        {"sine", (PyCFunction)Sound_sine, METH_VARARGS | METH_STATIC,
@@ -351,49 +327,49 @@
        {"file", (PyCFunction)Sound_file, METH_VARARGS | METH_STATIC,
         M_aud_Sound_file_doc
        },
-       {"lowpass", (PyCFunction)Sound_lowpass, METH_VARARGS | METH_STATIC,
+       {"lowpass", (PyCFunction)Sound_lowpass, METH_VARARGS,
         M_aud_Sound_lowpass_doc
        },
-       {"delay", (PyCFunction)Sound_delay, METH_VARARGS | METH_STATIC,
+       {"delay", (PyCFunction)Sound_delay, METH_VARARGS,
         M_aud_Sound_delay_doc
        },
-       {"double", (PyCFunction)Sound_double, METH_VARARGS | METH_STATIC,
-        M_aud_Sound_double_doc
+       {"join", (PyCFunction)Sound_join, METH_O,
+        M_aud_Sound_join_doc
        },
-       {"highpass", (PyCFunction)Sound_highpass, METH_VARARGS | METH_STATIC,
+       {"highpass", (PyCFunction)Sound_highpass, METH_VARARGS,
         M_aud_Sound_highpass_doc
        },
-       {"limiter", (PyCFunction)Sound_limiter, METH_VARARGS | METH_STATIC,
-        M_aud_Sound_limiter_doc
+       {"limit", (PyCFunction)Sound_limit, METH_VARARGS,
+        M_aud_Sound_limit_doc
        },
-       {"pitch", (PyCFunction)Sound_pitch, METH_VARARGS | METH_STATIC,
+       {"pitch", (PyCFunction)Sound_pitch, METH_VARARGS,
         M_aud_Sound_pitch_doc
        },
-       {"volume", (PyCFunction)Sound_volume, METH_VARARGS | METH_STATIC,
+       {"volume", (PyCFunction)Sound_volume, METH_VARARGS,
         M_aud_Sound_volume_doc
        },
-       {"fadein", (PyCFunction)Sound_fadein, METH_VARARGS | METH_STATIC,

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to