-Ringbuffers are created on startup

main
Harry van Haaren 2013-04-20 11:54:16 +01:00
parent dbf259c433
commit f5ebe24caf
4 changed files with 14 additions and 3 deletions

View File

@ -2,6 +2,7 @@
#ifndef LUPPP_EVENT_HANDLER_H
#define LUPPP_EVENT_HANDLER_H
#include "event.hxx"
#include <jack/ringbuffer.h>
extern char* processDspMem;

View File

@ -17,7 +17,7 @@ using namespace std;
extern Jack* jack;
extern void handleDspEvents()
void handleDspEvents()
{
uint availableRead = jack_ringbuffer_read_space( rbToDsp );

View File

@ -5,6 +5,8 @@
#include <cstring>
#include <iostream>
#include "eventhandler.hxx"
using namespace std;
@ -47,8 +49,8 @@ void Jack::activate()
int Jack::process (jack_nframes_t nframes)
{
// update values from the ringbuffer
//processDsp();
// do events from the ringbuffer
handleDspEvents();
// get buffers
buffers.audio[Buffers::MASTER_INPUT] = (float*)jack_port_get_buffer( masterInput , nframes);

View File

@ -9,6 +9,7 @@
// Internal
#include "gui.hxx"
#include "jack.hxx"
#include "event.hxx"
char* processDspMem = 0;
@ -21,6 +22,13 @@ Jack* jack = 0;
int main()
{
// allocate data to read from
processDspMem = (char*)malloc( sizeof(EventBase) );
processOscMem = (char*)malloc( sizeof(EventBase) );
rbToDsp = jack_ringbuffer_create( 2000 * sizeof(EventBase));
rbToGui = jack_ringbuffer_create( 2000 * sizeof(EventBase));
jack = new Jack();