#include "common.h"
#include "JackClient.h"
#include "ISoundElement.h"
#include "JackPort.h"
#include <sstream>
#include "Waveform.h"
#include "Amp.h"
#include "Recorder.h"
Go to the source code of this file.
Functions | |
BOOST_PYTHON_MODULE (jackfx) | |
void | Halt () |
void | Init () |
BOOST_PYTHON_MODULE | ( | jackfx | ) |
Definition at line 22 of file main.cpp.
References ISoundElement::AddInput(), Recorder::Clear(), JackPort::ConnectTo(), ISoundElement::DelParameter(), JackMidiPort::GetPyEventQueue(), Halt(), Init(), Recorder::Loop(), Recorder::Play(), Recorder::Record(), ISoundElement::RemoveInput(), Amp::SetAmplitude(), Waveform::SetAmplitude(), Waveform::SetFrequency(), Waveform::SetOffset(), ISoundElement::SetParameter(), Waveform::SetPhase(), Recorder::Stop(), Waveform::W_RSAW, Waveform::W_SAW, Waveform::W_SIN, Waveform::W_SQU, and Waveform::W_TRI.
00023 { 00024 using namespace boost::python; 00025 def("Start", Init); 00026 def("Stop", Halt); 00027 00028 class_<ISoundElement>("SoundElement", no_init) 00029 .def("AddInput", &ISoundElement::AddInput) 00030 .def("RemoveInput", &ISoundElement::RemoveInput) 00031 00032 .def("SetParameter", &ISoundElement::SetParameter) 00033 //.def("GetParameter", &ISoundElement::GetParameter) 00034 .def("DelParameter", &ISoundElement::DelParameter) 00035 ; 00036 class_<ISoundSource, bases<ISoundElement> >("SoundSource", no_init); 00037 00038 class_<JackPort>("JackPort", no_init) 00039 .def("ConnectTo", &JackPort::ConnectTo) 00040 ; 00041 00042 class_<JackMidiPort, bases<JackPort> >("JackMidiPort", init<string>()) 00043 .def("GetEvents", &JackMidiPort::GetPyEventQueue) 00044 ; 00045 00046 class_<JackAudioPort, bases<JackPort> >("JackAudioPort", no_init); 00047 00048 class_<JackOutput, bases<ISoundElement, JackAudioPort> >("JackSink", init<string>()); 00049 class_<JackInput, bases<ISoundSource, JackAudioPort> >("JackSource", init<string>()); 00050 00051 00052 class_<Waveform, bases<ISoundSource> >("Waveform", init<Waveform::WaveType>()) 00053 .def("SetFrequency", &Waveform::SetFrequency) 00054 .def("SetAmplitude", &Waveform::SetAmplitude) 00055 .def("SetOffset", &Waveform::SetOffset) 00056 .def("SetPhase", &Waveform::SetPhase) 00057 ; 00058 00059 enum_<Waveform::WaveType>("WaveType") 00060 .value("SIN", Waveform::W_SIN) 00061 .value("TRIANGLE", Waveform::W_TRI) 00062 .value("SAWTOOTH", Waveform::W_SAW) 00063 .value("RSAWTOOTH", Waveform::W_RSAW) 00064 .value("SQUARE", Waveform::W_SQU) 00065 ; 00066 00067 class_<Amp, bases<ISoundElement> >("Amp") 00068 .def("SetAmplitude", &Amp::SetAmplitude) 00069 ; 00070 00071 class_<Recorder, bases<ISoundElement> >("Recorder") 00072 .def("Clear", &Recorder::Clear) 00073 .def("Play", &Recorder::Play) 00074 .def("Loop", &Recorder::Loop) 00075 .def("Stop", &Recorder::Stop) 00076 .def("Record", &Recorder::Record) 00077 ; 00078 00079 /* enum_<Recorder::PlaybackFlags>("PlaybackFlags") 00080 .value("PLAYING", Recorder::PB_PLAYING) 00081 .value("REVERSE", Recorder::PB_REVERSE) 00082 .value("DESTRUCTIVE", Recorder::PB_DESTRUCTIVE) 00083 .value("LOOPING", Recorder::PB_LOOPING) 00084 ; 00085 00086 enum_<Recorder::RecordType>("RecordState") 00087 .value("APPEND", Recorder::REC_APPEND) 00088 .value("OVERWRITE", Recorder::REC_OVERWRITE) 00089 .value("MODULATE", Recorder::REC_MODULATE) 00090 .value("SUM", Recorder::REC_SUM) 00091 ;*/ 00092 }
void Halt | ( | ) |
Definition at line 16 of file main.cpp.
References JackClient::GetSingleton().
Referenced by BOOST_PYTHON_MODULE().
00017 { 00018 delete JackClient::GetSingleton(); 00019 }
void Init | ( | ) |
Definition at line 11 of file main.cpp.
Referenced by BOOST_PYTHON_MODULE().
00012 { 00013 new JackClient(); 00014 }