#include <Recorder.h>
Public Member Functions | |
void | Clear () |
void | Loop (bool looping) |
void | Play () |
void | Process (jack_nframes_t count) |
void | Record () |
Recorder () | |
void | Stop () |
~Recorder () | |
Private Attributes | |
list< SoundFrame * > | m_frames |
list< SoundFrame * >::iterator | m_location |
bool | m_looping |
bool | m_playing |
bool | m_recording |
TODO: Support starting/stopping recording/playback on beat/measure boundaries, rather than immediately when the command is pressed.
Definition at line 22 of file Recorder.h.
Recorder::Recorder | ( | ) |
Definition at line 7 of file Recorder.cpp.
References m_frames, and m_location.
00008 { 00009 m_location = m_frames.begin(); 00010 }
Recorder::~Recorder | ( | ) |
void Recorder::Clear | ( | ) |
Definition at line 17 of file Recorder.cpp.
References m_frames, m_location, and m_playing.
Referenced by BOOST_PYTHON_MODULE(), and ~Recorder().
00018 { 00019 Lock l(this); 00020 m_playing = false; 00021 while (m_location != m_frames.end()) { 00022 delete *m_location; 00023 m_frames.erase(m_location); 00024 m_location = m_frames.begin(); 00025 } 00026 }
void Recorder::Loop | ( | bool | looping | ) |
Definition at line 34 of file Recorder.cpp.
References m_looping.
Referenced by BOOST_PYTHON_MODULE().
00035 { 00036 m_looping = looping; 00037 }
void Recorder::Play | ( | ) |
Definition at line 28 of file Recorder.cpp.
References m_frames, m_location, and m_playing.
Referenced by BOOST_PYTHON_MODULE().
00029 { 00030 m_location = m_frames.begin(); 00031 m_playing = true; 00032 }
void Recorder::Process | ( | jack_nframes_t | count | ) | [virtual] |
Reimplemented from ISoundElement.
Definition at line 51 of file Recorder.cpp.
References ISoundElement::GetPipe(), m_frames, m_location, m_looping, m_playing, m_recording, and SoundFrame::Set().
00052 { 00053 Lock l(this); 00054 ISoundElement::Process(count); 00055 00056 if (m_recording) { 00057 SoundFrame* f = new SoundFrame(); 00058 f->Set(GetPipe()); 00059 m_frames.push_back(f); 00060 } 00061 00062 if (m_playing && m_location != m_frames.end()) { 00063 GetPipe().Set(**m_location); 00064 ++m_location; 00065 00066 if (m_location == m_frames.end()) { 00067 m_location = m_frames.begin(); 00068 if (!m_looping) { 00069 m_playing = false; 00070 } 00071 } 00072 } 00073 }
void Recorder::Record | ( | ) |
Definition at line 45 of file Recorder.cpp.
References m_recording.
Referenced by BOOST_PYTHON_MODULE().
00046 { 00047 m_recording = true; 00048 }
void Recorder::Stop | ( | ) |
Definition at line 39 of file Recorder.cpp.
References m_playing, and m_recording.
Referenced by BOOST_PYTHON_MODULE().
00040 { 00041 m_playing = false; 00042 m_recording = false; 00043 }
list<SoundFrame*> Recorder::m_frames [private] |
list<SoundFrame*>::iterator Recorder::m_location [private] |
bool Recorder::m_looping [private] |
bool Recorder::m_playing [private] |
bool Recorder::m_recording [private] |