Recorder Class Reference

The Recorder element is designed for quick recording of other elements. More...

#include <Recorder.h>

Inheritance diagram for Recorder:

Inheritance graph
[legend]
Collaboration diagram for Recorder:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

The Recorder element is designed for quick recording of other elements.

TODO: Support starting/stopping recording/playback on beat/measure boundaries, rather than immediately when the command is pressed.

Note:
The API methods for this element do not take effect immediately. As JackFX performs all of it's processing in a separate thread, meaning that the command may seem delayed. The delay may vary on your system, depending on the latency of the Jack server, but it should never be more than a fraction of a second.

Definition at line 22 of file Recorder.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 12 of file Recorder.cpp.

References Clear().

00013 {
00014     Clear();
00015 }


Member Function Documentation

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 }


Member Data Documentation

list<SoundFrame*> Recorder::m_frames [private]

Definition at line 47 of file Recorder.h.

Referenced by Clear(), Play(), Process(), and Recorder().

list<SoundFrame*>::iterator Recorder::m_location [private]

Definition at line 48 of file Recorder.h.

Referenced by Clear(), Play(), Process(), and Recorder().

bool Recorder::m_looping [private]

Definition at line 45 of file Recorder.h.

Referenced by Loop(), and Process().

bool Recorder::m_playing [private]

Definition at line 44 of file Recorder.h.

Referenced by Clear(), Play(), Process(), and Stop().

bool Recorder::m_recording [private]

Definition at line 43 of file Recorder.h.

Referenced by Process(), Record(), and Stop().


The documentation for this class was generated from the following files:

Get JackFX at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated for JackFX by  doxygen