[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30725] branches/soc-2010-nexyon/intern/ audaspace/Python/AUD_PyAPI.cpp: Removing unnecessary _ functions from device as the c_device is a device too and doesn 't have it's own api.

Joerg Mueller nexyon at gmail.com
Mon Jul 26 00:35:48 CEST 2010


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

Log Message:
-----------
Removing unnecessary _ functions from device as the c_device is a device too and doesn't have it's own api.

Modified Paths:
--------------
    branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp

Modified: branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp
===================================================================
--- branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp	2010-07-25 22:23:40 UTC (rev 30724)
+++ branches/soc-2010-nexyon/intern/audaspace/Python/AUD_PyAPI.cpp	2010-07-25 22:35:48 UTC (rev 30725)
@@ -1094,693 +1094,226 @@
 static PyObject *
 Handle_pause(Handle *self)
 {
-	return PyObject_CallMethod(self->device, const_cast<char*>("_pause"), const_cast<char*>("(O)"), self);
-}
+	Device* device = (Device*)self->device;
 
-PyDoc_STRVAR(M_aud_Handle_resume_doc,
-			 "resume()\n\n"
-			 "Resumes playback.\n\n"
-			 ":return: Whether the action succeeded.\n"
-			 ":rtype: boolean");
-
-static PyObject *
-Handle_resume(Handle *self)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_resume"), const_cast<char*>("(O)"), self);
-}
-
-PyDoc_STRVAR(M_aud_Handle_stop_doc,
-			 "stop()\n\n"
-			 "Stops playback.\n\n"
-			 ":return: Whether the action succeeded.\n"
-			 ":rtype: boolean");
-
-static PyObject *
-Handle_stop(Handle *self)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_stop"), const_cast<char*>("(O)"), self);
-}
-
-PyDoc_STRVAR(M_aud_Handle_update_doc,
-			 "update(info)\n\n"
-			 "Updates the 3D information of the source.\n\n"
-			 ":arg info: The 3D info in the format (fff)(fff)((fff)(fff)(fff))."
-			 " Position, velocity and a 3x3 orientation matrix.\n"
-			 ":type info: float tuple\n"
-			 ":return: Whether the action succeeded.\n"
-			 ":rtype: boolean");
-
-static PyObject *
-Handle_update(Handle *self, PyObject *data)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_update_source"), const_cast<char*>("(OO)"), self, data);
-}
-
-static PyMethodDef Handle_methods[] = {
-	{"pause", (PyCFunction)Handle_pause, METH_NOARGS,
-	 M_aud_Handle_pause_doc
-	},
-	{"resume", (PyCFunction)Handle_resume, METH_NOARGS,
-	 M_aud_Handle_resume_doc
-	},
-	{"stop", (PyCFunction)Handle_stop, METH_NOARGS,
-	 M_aud_Handle_stop_doc
-	},
-	{"update", (PyCFunction)Handle_update, METH_O,
-	 M_aud_Handle_update_doc
-	},
-	{NULL}  /* Sentinel */
-};
-
-PyDoc_STRVAR(M_aud_Handle_position_doc,
-			 "The playback position of the sound.");
-
-static PyObject *
-Handle_get_position(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_position"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_position(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_seek"), const_cast<char*>("(OO)"), self, args);
-	if(result)
+	try
 	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_keep_doc,
-			 "Whether the sound should be kept paused in the device when its end is reached.");
-
-static int
-Handle_set_keep(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_keep"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_status_doc,
-			 "Whether the sound is playing, paused or stopped.");
-
-static PyObject *
-Handle_get_status(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_status"), const_cast<char*>("(O)"), self);
-}
-
-PyDoc_STRVAR(M_aud_Handle_volume_doc,
-			 "The volume of the sound.");
-
-static PyObject *
-Handle_get_volume(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_volume"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_volume(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_volume"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_pitch_doc,
-			 "The pitch of the sound.");
-
-static int
-Handle_set_pitch(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_pitch"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_loop_count_doc,
-			 "The (remaining) loop count of the sound. A negative value indicates infinity.");
-
-static int
-Handle_set_loop_count(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_loop_count"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_relative_doc,
-			 "Whether the source's position is relative or absolute to the listener.");
-
-static PyObject *
-Handle_get_relative(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_is_relative"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_relative(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_relative"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_min_gain_doc,
-			 "The minimum gain of the source.");
-
-static PyObject *
-Handle_get_min_gain(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_min_gain"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_min_gain(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_min_gain"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_max_gain_doc,
-			 "The maximum gain of the source.");
-
-static PyObject *
-Handle_get_max_gain(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_max_gain"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_max_gain(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_max_gain"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_reference_distance_doc,
-			 "The reference distance of the source.");
-
-static PyObject *
-Handle_get_reference_distance(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_reference_distance"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_reference_distance(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_reference_distance"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_max_distance_doc,
-			 "The maximum distance of the source.");
-
-static PyObject *
-Handle_get_max_distance(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_max_distance"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_max_distance(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_max_distance"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_rolloff_factor_doc,
-			 "The rolloff factor of the source.");
-
-static PyObject *
-Handle_get_rolloff_factor(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_rolloff_factor"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_rolloff_factor(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_rolloff_factor"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_cone_inner_angle_doc,
-			 "The cone inner angle of the source.");
-
-static PyObject *
-Handle_get_cone_inner_angle(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_cone_inner_angle"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_cone_inner_angle(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_cone_inner_angle"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_cone_outer_angle_doc,
-			 "The cone outer angle of the source.");
-
-static PyObject *
-Handle_get_cone_outer_angle(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_cone_outer_angle"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_cone_outer_angle(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_cone_outer_angle"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-PyDoc_STRVAR(M_aud_Handle_cone_outer_gain_doc,
-			 "The cone outer gain of the source.");
-
-static PyObject *
-Handle_get_cone_outer_gain(Handle *self, void* nothing)
-{
-	return PyObject_CallMethod(self->device, const_cast<char*>("_get_cone_outer_gain"), const_cast<char*>("(O)"), self);
-}
-
-static int
-Handle_set_cone_outer_gain(Handle *self, PyObject* args, void* nothing)
-{
-	PyObject* result = PyObject_CallMethod(self->device, const_cast<char*>("_set_cone_outer_gain"), const_cast<char*>("(OO)"), self, args);
-	if(result)
-	{
-		Py_DECREF(result);
-		return 0;
-	}
-	return -1;
-}
-
-static PyGetSetDef Handle_properties[] = {
-	{(char*)"position", (getter)Handle_get_position, (setter)Handle_set_position,
-	 M_aud_Handle_position_doc, NULL },
-	{(char*)"keep", NULL, (setter)Handle_set_keep,
-	 M_aud_Handle_keep_doc, NULL },
-	{(char*)"status", (getter)Handle_get_status, NULL,
-	 M_aud_Handle_status_doc, NULL },
-	{(char*)"volume", (getter)Handle_get_volume, (setter)Handle_set_volume,
-	 M_aud_Handle_volume_doc, NULL },
-	{(char*)"pitch", NULL, (setter)Handle_set_pitch,
-	 M_aud_Handle_pitch_doc, NULL },

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list