~ubuntu-branches/ubuntu/quantal/python-pyo/quantal

« back to all changes in this revision

Viewing changes to src/objects/distomodule.c

  • Committer: Package Import Robot
  • Author(s): Tiago Bortoletto Vaz
  • Date: 2012-07-03 23:45:41 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120703234541-jh5jg00lvljnwq8m
Tags: 0.6.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
static void
238
238
Disto_dealloc(Disto* self)
239
239
{
240
 
    free(self->data);
 
240
    pyo_DEALLOC
241
241
    Disto_clear(self);
242
242
    self->ob_type->tp_free((PyObject*)self);
243
243
}
244
244
 
245
 
static PyObject * Disto_deleteStream(Disto *self) { DELETE_STREAM };
246
 
 
247
245
static PyObject *
248
246
Disto_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
249
247
{
250
248
    int i;
 
249
    PyObject *inputtmp, *input_streamtmp, *drivetmp=NULL, *slopetmp=NULL, *multmp=NULL, *addtmp=NULL;
251
250
    Disto *self;
252
251
    self = (Disto *)type->tp_alloc(type, 0);
253
252
 
262
261
    INIT_OBJECT_COMMON
263
262
    Stream_setFunctionPtr(self->stream, Disto_compute_next_data_frame);
264
263
    self->mode_func_ptr = Disto_setProcMode;
265
 
    
266
 
    return (PyObject *)self;
267
 
}
268
 
 
269
 
static int
270
 
Disto_init(Disto *self, PyObject *args, PyObject *kwds)
271
 
{
272
 
    PyObject *inputtmp, *input_streamtmp, *drivetmp=NULL, *slopetmp=NULL, *multmp=NULL, *addtmp=NULL;
273
264
 
274
265
    static char *kwlist[] = {"input", "drive", "slope", "mul", "add", NULL};
275
266
 
276
267
    if (! PyArg_ParseTupleAndKeywords(args, kwds, "O|OOOO", kwlist, &inputtmp, &drivetmp, &slopetmp, &multmp, &addtmp))
277
 
        return -1; 
 
268
        Py_RETURN_NONE;
278
269
 
279
270
    INIT_INPUT_STREAM
280
271
    
294
285
        PyObject_CallMethod((PyObject *)self, "setAdd", "O", addtmp);
295
286
    }
296
287
            
297
 
    Py_INCREF(self->stream);
298
288
    PyObject_CallMethod(self->server, "addStream", "O", self->stream);
299
289
 
300
290
    (*self->mode_func_ptr)(self);
301
 
 
302
 
    Py_INCREF(self);
303
 
    return 0;
 
291
    
 
292
    return (PyObject *)self;
304
293
}
305
294
 
306
295
static PyObject * Disto_getServer(Disto* self) { GET_SERVER };
405
394
static PyMethodDef Disto_methods[] = {
406
395
    {"getServer", (PyCFunction)Disto_getServer, METH_NOARGS, "Returns server object."},
407
396
    {"_getStream", (PyCFunction)Disto_getStream, METH_NOARGS, "Returns stream object."},
408
 
    {"deleteStream", (PyCFunction)Disto_deleteStream, METH_NOARGS, "Remove stream from server and delete the object."},
409
397
    {"play", (PyCFunction)Disto_play, METH_VARARGS|METH_KEYWORDS, "Starts computing without sending sound to soundcard."},
410
398
    {"out", (PyCFunction)Disto_out, METH_VARARGS|METH_KEYWORDS, "Starts computing and sends sound to soundcard channel speficied by argument."},
411
399
    {"stop", (PyCFunction)Disto_stop, METH_NOARGS, "Stops computing."},
497
485
    0,                         /* tp_descr_get */
498
486
    0,                         /* tp_descr_set */
499
487
    0,                         /* tp_dictoffset */
500
 
    (initproc)Disto_init,      /* tp_init */
 
488
    0,      /* tp_init */
501
489
    0,                         /* tp_alloc */
502
490
    Disto_new,                 /* tp_new */
503
491
};
695
683
static void
696
684
Clip_dealloc(Clip* self)
697
685
{
698
 
    free(self->data);
 
686
    pyo_DEALLOC
699
687
    Clip_clear(self);
700
688
    self->ob_type->tp_free((PyObject*)self);
701
689
}
702
690
 
703
 
static PyObject * Clip_deleteStream(Clip *self) { DELETE_STREAM };
704
 
 
705
691
static PyObject *
706
692
Clip_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
707
693
{
708
694
    int i;
 
695
    PyObject *inputtmp, *input_streamtmp, *mintmp=NULL, *maxtmp=NULL, *multmp=NULL, *addtmp=NULL;
709
696
    Clip *self;
710
697
    self = (Clip *)type->tp_alloc(type, 0);
711
698
    
719
706
    INIT_OBJECT_COMMON
720
707
    Stream_setFunctionPtr(self->stream, Clip_compute_next_data_frame);
721
708
    self->mode_func_ptr = Clip_setProcMode;
722
 
    
723
 
    return (PyObject *)self;
724
 
}
725
709
 
726
 
static int
727
 
Clip_init(Clip *self, PyObject *args, PyObject *kwds)
728
 
{
729
 
    PyObject *inputtmp, *input_streamtmp, *mintmp=NULL, *maxtmp=NULL, *multmp=NULL, *addtmp=NULL;
730
 
    
731
710
    static char *kwlist[] = {"input", "min", "max", "mul", "add", NULL};
732
711
    
733
712
    if (! PyArg_ParseTupleAndKeywords(args, kwds, "O|OOOO", kwlist, &inputtmp, &mintmp, &maxtmp, &multmp, &addtmp))
734
 
        return -1; 
 
713
        Py_RETURN_NONE;
735
714
    
736
715
    INIT_INPUT_STREAM
737
716
    
751
730
        PyObject_CallMethod((PyObject *)self, "setAdd", "O", addtmp);
752
731
    }
753
732
    
754
 
    Py_INCREF(self->stream);
755
733
    PyObject_CallMethod(self->server, "addStream", "O", self->stream);
756
734
    
757
735
    (*self->mode_func_ptr)(self);
758
 
        
759
 
    Py_INCREF(self);
760
 
    return 0;
 
736
    
 
737
    return (PyObject *)self;
761
738
}
762
739
 
763
740
static PyObject * Clip_getServer(Clip* self) { GET_SERVER };
862
839
static PyMethodDef Clip_methods[] = {
863
840
{"getServer", (PyCFunction)Clip_getServer, METH_NOARGS, "Returns server object."},
864
841
{"_getStream", (PyCFunction)Clip_getStream, METH_NOARGS, "Returns stream object."},
865
 
{"deleteStream", (PyCFunction)Clip_deleteStream, METH_NOARGS, "Remove stream from server and delete the object."},
866
842
{"play", (PyCFunction)Clip_play, METH_VARARGS|METH_KEYWORDS, "Starts computing without sending sound to soundcard."},
867
843
{"out", (PyCFunction)Clip_out, METH_VARARGS|METH_KEYWORDS, "Starts computing and sends sound to soundcard channel speficied by argument."},
868
844
{"stop", (PyCFunction)Clip_stop, METH_NOARGS, "Stops computing."},
954
930
0,                         /* tp_descr_get */
955
931
0,                         /* tp_descr_set */
956
932
0,                         /* tp_dictoffset */
957
 
(initproc)Clip_init,      /* tp_init */
 
933
0,      /* tp_init */
958
934
0,                         /* tp_alloc */
959
935
Clip_new,                 /* tp_new */
960
936
};
1182
1158
static void
1183
1159
Mirror_dealloc(Mirror* self)
1184
1160
{
1185
 
    free(self->data);
 
1161
    pyo_DEALLOC
1186
1162
    Mirror_clear(self);
1187
1163
    self->ob_type->tp_free((PyObject*)self);
1188
1164
}
1189
1165
 
1190
 
static PyObject * Mirror_deleteStream(Mirror *self) { DELETE_STREAM };
1191
 
 
1192
1166
static PyObject *
1193
1167
Mirror_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1194
1168
{
1195
1169
    int i;
 
1170
    PyObject *inputtmp, *input_streamtmp, *mintmp=NULL, *maxtmp=NULL, *multmp=NULL, *addtmp=NULL;
1196
1171
    Mirror *self;
1197
1172
    self = (Mirror *)type->tp_alloc(type, 0);
1198
1173
    
1206
1181
    INIT_OBJECT_COMMON
1207
1182
    Stream_setFunctionPtr(self->stream, Mirror_compute_next_data_frame);
1208
1183
    self->mode_func_ptr = Mirror_setProcMode;
1209
 
    
1210
 
    return (PyObject *)self;
1211
 
}
1212
1184
 
1213
 
static int
1214
 
Mirror_init(Mirror *self, PyObject *args, PyObject *kwds)
1215
 
{
1216
 
    PyObject *inputtmp, *input_streamtmp, *mintmp=NULL, *maxtmp=NULL, *multmp=NULL, *addtmp=NULL;
1217
 
    
1218
1185
    static char *kwlist[] = {"input", "min", "max", "mul", "add", NULL};
1219
1186
    
1220
1187
    if (! PyArg_ParseTupleAndKeywords(args, kwds, "O|OOOO", kwlist, &inputtmp, &mintmp, &maxtmp, &multmp, &addtmp))
1221
 
        return -1; 
 
1188
        Py_RETURN_NONE;
1222
1189
    
1223
1190
    INIT_INPUT_STREAM
1224
1191
    
1238
1205
        PyObject_CallMethod((PyObject *)self, "setAdd", "O", addtmp);
1239
1206
    }
1240
1207
    
1241
 
    Py_INCREF(self->stream);
1242
1208
    PyObject_CallMethod(self->server, "addStream", "O", self->stream);
1243
1209
    
1244
1210
    (*self->mode_func_ptr)(self);
1245
1211
    
1246
 
    Py_INCREF(self);
1247
 
    return 0;
 
1212
    return (PyObject *)self;
1248
1213
}
1249
1214
 
1250
1215
static PyObject * Mirror_getServer(Mirror* self) { GET_SERVER };
1349
1314
static PyMethodDef Mirror_methods[] = {
1350
1315
    {"getServer", (PyCFunction)Mirror_getServer, METH_NOARGS, "Returns server object."},
1351
1316
    {"_getStream", (PyCFunction)Mirror_getStream, METH_NOARGS, "Returns stream object."},
1352
 
    {"deleteStream", (PyCFunction)Mirror_deleteStream, METH_NOARGS, "Remove stream from server and delete the object."},
1353
1317
    {"play", (PyCFunction)Mirror_play, METH_VARARGS|METH_KEYWORDS, "Starts computing without sending sound to soundcard."},
1354
1318
    {"out", (PyCFunction)Mirror_out, METH_VARARGS|METH_KEYWORDS, "Starts computing and sends sound to soundcard channel speficied by argument."},
1355
1319
    {"stop", (PyCFunction)Mirror_stop, METH_NOARGS, "Stops computing."},
1441
1405
    0,                         /* tp_descr_get */
1442
1406
    0,                         /* tp_descr_set */
1443
1407
    0,                         /* tp_dictoffset */
1444
 
    (initproc)Mirror_init,      /* tp_init */
 
1408
    0,      /* tp_init */
1445
1409
    0,                         /* tp_alloc */
1446
1410
    Mirror_new,                 /* tp_new */
1447
1411
};
1685
1649
static void
1686
1650
Wrap_dealloc(Wrap* self)
1687
1651
{
1688
 
    free(self->data);
 
1652
    pyo_DEALLOC
1689
1653
    Wrap_clear(self);
1690
1654
    self->ob_type->tp_free((PyObject*)self);
1691
1655
}
1692
1656
 
1693
 
static PyObject * Wrap_deleteStream(Wrap *self) { DELETE_STREAM };
1694
 
 
1695
1657
static PyObject *
1696
1658
Wrap_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1697
1659
{
1698
1660
    int i;
 
1661
    PyObject *inputtmp, *input_streamtmp, *mintmp=NULL, *maxtmp=NULL, *multmp=NULL, *addtmp=NULL;
1699
1662
    Wrap *self;
1700
1663
    self = (Wrap *)type->tp_alloc(type, 0);
1701
1664
    
1709
1672
    INIT_OBJECT_COMMON
1710
1673
    Stream_setFunctionPtr(self->stream, Wrap_compute_next_data_frame);
1711
1674
    self->mode_func_ptr = Wrap_setProcMode;
1712
 
    
1713
 
    return (PyObject *)self;
1714
 
}
1715
1675
 
1716
 
static int
1717
 
Wrap_init(Wrap *self, PyObject *args, PyObject *kwds)
1718
 
{
1719
 
    PyObject *inputtmp, *input_streamtmp, *mintmp=NULL, *maxtmp=NULL, *multmp=NULL, *addtmp=NULL;
1720
 
    
1721
1676
    static char *kwlist[] = {"input", "min", "max", "mul", "add", NULL};
1722
1677
    
1723
1678
    if (! PyArg_ParseTupleAndKeywords(args, kwds, "O|OOOO", kwlist, &inputtmp, &mintmp, &maxtmp, &multmp, &addtmp))
1724
 
        return -1; 
 
1679
        Py_RETURN_NONE;
1725
1680
    
1726
1681
    INIT_INPUT_STREAM
1727
1682
    
1741
1696
        PyObject_CallMethod((PyObject *)self, "setAdd", "O", addtmp);
1742
1697
    }
1743
1698
    
1744
 
    Py_INCREF(self->stream);
1745
1699
    PyObject_CallMethod(self->server, "addStream", "O", self->stream);
1746
1700
    
1747
1701
    (*self->mode_func_ptr)(self);
1748
1702
    
1749
 
    Py_INCREF(self);
1750
 
    return 0;
 
1703
    return (PyObject *)self;
1751
1704
}
1752
1705
 
1753
1706
static PyObject * Wrap_getServer(Wrap* self) { GET_SERVER };
1852
1805
static PyMethodDef Wrap_methods[] = {
1853
1806
    {"getServer", (PyCFunction)Wrap_getServer, METH_NOARGS, "Returns server object."},
1854
1807
    {"_getStream", (PyCFunction)Wrap_getStream, METH_NOARGS, "Returns stream object."},
1855
 
    {"deleteStream", (PyCFunction)Wrap_deleteStream, METH_NOARGS, "Remove stream from server and delete the object."},
1856
1808
    {"play", (PyCFunction)Wrap_play, METH_VARARGS|METH_KEYWORDS, "Starts computing without sending sound to soundcard."},
1857
1809
    {"out", (PyCFunction)Wrap_out, METH_VARARGS|METH_KEYWORDS, "Starts computing and sends sound to soundcard channel speficied by argument."},
1858
1810
    {"stop", (PyCFunction)Wrap_stop, METH_NOARGS, "Stops computing."},
1944
1896
    0,                         /* tp_descr_get */
1945
1897
    0,                         /* tp_descr_set */
1946
1898
    0,                         /* tp_dictoffset */
1947
 
    (initproc)Wrap_init,      /* tp_init */
 
1899
    0,      /* tp_init */
1948
1900
    0,                         /* tp_alloc */
1949
1901
    Wrap_new,                 /* tp_new */
1950
1902
};
2185
2137
static void
2186
2138
Degrade_dealloc(Degrade* self)
2187
2139
{
2188
 
    free(self->data);
 
2140
    pyo_DEALLOC
2189
2141
    Degrade_clear(self);
2190
2142
    self->ob_type->tp_free((PyObject*)self);
2191
2143
}
2192
2144
 
2193
 
static PyObject * Degrade_deleteStream(Degrade *self) { DELETE_STREAM };
2194
 
 
2195
2145
static PyObject *
2196
2146
Degrade_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
2197
2147
{
2198
2148
    int i;
 
2149
    PyObject *inputtmp, *input_streamtmp, *bitdepthtmp=NULL, *srscaletmp=NULL, *multmp=NULL, *addtmp=NULL;
2199
2150
    Degrade *self;
2200
2151
    self = (Degrade *)type->tp_alloc(type, 0);
2201
2152
    
2211
2162
    INIT_OBJECT_COMMON
2212
2163
    Stream_setFunctionPtr(self->stream, Degrade_compute_next_data_frame);
2213
2164
    self->mode_func_ptr = Degrade_setProcMode;
2214
 
    
2215
 
    return (PyObject *)self;
2216
 
}
2217
2165
 
2218
 
static int
2219
 
Degrade_init(Degrade *self, PyObject *args, PyObject *kwds)
2220
 
{
2221
 
    PyObject *inputtmp, *input_streamtmp, *bitdepthtmp=NULL, *srscaletmp=NULL, *multmp=NULL, *addtmp=NULL;
2222
 
    
2223
2166
    static char *kwlist[] = {"input", "bitdepth", "srscale", "mul", "add", NULL};
2224
2167
    
2225
2168
    if (! PyArg_ParseTupleAndKeywords(args, kwds, "O|OOOO", kwlist, &inputtmp, &bitdepthtmp, &srscaletmp, &multmp, &addtmp))
2226
 
        return -1; 
 
2169
        Py_RETURN_NONE;
2227
2170
    
2228
2171
    INIT_INPUT_STREAM
2229
2172
    
2243
2186
        PyObject_CallMethod((PyObject *)self, "setAdd", "O", addtmp);
2244
2187
    }
2245
2188
    
2246
 
    Py_INCREF(self->stream);
2247
2189
    PyObject_CallMethod(self->server, "addStream", "O", self->stream);
2248
2190
    
2249
2191
    (*self->mode_func_ptr)(self);
2250
 
        
2251
 
    Py_INCREF(self);
2252
 
    return 0;
 
2192
    
 
2193
    return (PyObject *)self;
2253
2194
}
2254
2195
 
2255
2196
static PyObject * Degrade_getServer(Degrade* self) { GET_SERVER };
2354
2295
static PyMethodDef Degrade_methods[] = {
2355
2296
{"getServer", (PyCFunction)Degrade_getServer, METH_NOARGS, "Returns server object."},
2356
2297
{"_getStream", (PyCFunction)Degrade_getStream, METH_NOARGS, "Returns stream object."},
2357
 
{"deleteStream", (PyCFunction)Degrade_deleteStream, METH_NOARGS, "Remove stream from server and delete the object."},
2358
2298
{"play", (PyCFunction)Degrade_play, METH_VARARGS|METH_KEYWORDS, "Starts computing without sending sound to soundcard."},
2359
2299
{"out", (PyCFunction)Degrade_out, METH_VARARGS|METH_KEYWORDS, "Starts computing and sends sound to soundcard channel speficied by argument."},
2360
2300
{"stop", (PyCFunction)Degrade_stop, METH_NOARGS, "Stops computing."},
2446
2386
0,                         /* tp_descr_get */
2447
2387
0,                         /* tp_descr_set */
2448
2388
0,                         /* tp_dictoffset */
2449
 
(initproc)Degrade_init,      /* tp_init */
 
2389
0,      /* tp_init */
2450
2390
0,                         /* tp_alloc */
2451
2391
Degrade_new,                 /* tp_new */
2452
2392
};