mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
NO-OP: clang-format whitespace
This commit is contained in:
parent
876e780e4d
commit
8e78827deb
2 changed files with 1106 additions and 1138 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -17,25 +17,22 @@
|
|||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef _ZITA_CONVOLVER_H
|
||||
#define _ZITA_CONVOLVER_H
|
||||
|
||||
|
||||
#include <fftw3.h>
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
#include <fftw3.h>
|
||||
|
||||
#include "zita-convolver/zconvolver_visibility.h"
|
||||
|
||||
namespace ArdourZita {
|
||||
|
||||
|
||||
#ifdef ZCSEMA_IS_IMPLEMENTED
|
||||
#undef ZCSEMA_IS_IMPLEMENTED
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
|
||||
#include <semaphore.h>
|
||||
|
|
@ -43,27 +40,46 @@ namespace ArdourZita {
|
|||
class LIBZCONVOLVER_API ZCsema
|
||||
{
|
||||
public:
|
||||
ZCsema (void)
|
||||
{
|
||||
init (0, 0);
|
||||
}
|
||||
|
||||
ZCsema (void) { init (0, 0); }
|
||||
~ZCsema (void) { sem_destroy (&_sema); }
|
||||
~ZCsema (void)
|
||||
{
|
||||
sem_destroy (&_sema);
|
||||
}
|
||||
|
||||
ZCsema (const ZCsema&); // disabled
|
||||
ZCsema& operator= (const ZCsema&); // disabled
|
||||
|
||||
int init (int s, int v) { return sem_init (&_sema, s, v); }
|
||||
int post (void) { return sem_post (&_sema); }
|
||||
int wait (void) { return sem_wait (&_sema); }
|
||||
int trywait (void) { return sem_trywait (&_sema); }
|
||||
int init (int s, int v)
|
||||
{
|
||||
return sem_init (&_sema, s, v);
|
||||
}
|
||||
|
||||
int post (void)
|
||||
{
|
||||
return sem_post (&_sema);
|
||||
}
|
||||
|
||||
int wait (void)
|
||||
{
|
||||
return sem_wait (&_sema);
|
||||
}
|
||||
|
||||
int trywait (void)
|
||||
{
|
||||
return sem_trywait (&_sema);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
sem_t _sema;
|
||||
};
|
||||
|
||||
#define ZCSEMA_IS_IMPLEMENTED
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
// NOTE: ***** I DO NOT REPEAT NOT PROVIDE SUPPORT FOR OSX *****
|
||||
|
|
@ -76,7 +92,6 @@ private:
|
|||
class LIBZCONVOLVER_API ZCsema
|
||||
{
|
||||
public:
|
||||
|
||||
ZCsema (void) : _count (0)
|
||||
{
|
||||
init (0, 0);
|
||||
|
|
@ -101,7 +116,8 @@ public:
|
|||
{
|
||||
pthread_mutex_lock (&_mutex);
|
||||
_count++;
|
||||
if (_count == 1) pthread_cond_signal (&_cond);
|
||||
if (_count == 1)
|
||||
pthread_cond_signal (&_cond);
|
||||
pthread_mutex_unlock (&_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -109,7 +125,8 @@ public:
|
|||
int wait (void)
|
||||
{
|
||||
pthread_mutex_lock (&_mutex);
|
||||
while (_count < 1) pthread_cond_wait (&_cond, &_mutex);
|
||||
while (_count < 1)
|
||||
pthread_cond_wait (&_cond, &_mutex);
|
||||
_count--;
|
||||
pthread_mutex_unlock (&_mutex);
|
||||
return 0;
|
||||
|
|
@ -117,9 +134,9 @@ public:
|
|||
|
||||
int trywait (void)
|
||||
{
|
||||
if (pthread_mutex_trylock (&_mutex)) return -1;
|
||||
if (_count < 1)
|
||||
{
|
||||
if (pthread_mutex_trylock (&_mutex))
|
||||
return -1;
|
||||
if (_count < 1) {
|
||||
pthread_mutex_unlock (&_mutex);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -129,7 +146,6 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
|
||||
int _count;
|
||||
pthread_mutex_t _mutex;
|
||||
pthread_cond_t _cond;
|
||||
|
|
@ -138,19 +154,15 @@ private:
|
|||
#define ZCSEMA_IS_IMPLEMENTED
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ZCSEMA_IS_IMPLEMENTED
|
||||
#error "The ZCsema class is not implemented."
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
class LIBZCONVOLVER_API Inpnode
|
||||
{
|
||||
private:
|
||||
|
||||
friend class Convlevel;
|
||||
|
||||
Inpnode (uint16_t inp);
|
||||
|
|
@ -164,11 +176,9 @@ private:
|
|||
uint16_t _inp;
|
||||
};
|
||||
|
||||
|
||||
class LIBZCONVOLVER_API Macnode
|
||||
{
|
||||
private:
|
||||
|
||||
friend class Convlevel;
|
||||
|
||||
Macnode (Inpnode* inpn);
|
||||
|
|
@ -183,11 +193,9 @@ private:
|
|||
uint16_t _npar;
|
||||
};
|
||||
|
||||
|
||||
class LIBZCONVOLVER_API Outnode
|
||||
{
|
||||
private:
|
||||
|
||||
friend class Convlevel;
|
||||
|
||||
Outnode (uint16_t out, int32_t size);
|
||||
|
|
@ -199,13 +207,10 @@ private:
|
|||
uint16_t _out;
|
||||
};
|
||||
|
||||
|
||||
class LIBZCONVOLVER_API Converror
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
BAD_STATE = -1,
|
||||
BAD_PARAM = -2,
|
||||
MEM_ALLOC = -3
|
||||
|
|
@ -214,26 +219,21 @@ public:
|
|||
Converror (int error) : _error (error) {}
|
||||
|
||||
private:
|
||||
|
||||
int _error;
|
||||
};
|
||||
|
||||
|
||||
class LIBZCONVOLVER_API Convlevel
|
||||
{
|
||||
private:
|
||||
|
||||
friend class Convproc;
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
OPT_FFTW_MEASURE = 1,
|
||||
OPT_VECTOR_MODE = 2,
|
||||
OPT_LATE_CONTIN = 4
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
ST_IDLE,
|
||||
ST_TERM,
|
||||
ST_PROC
|
||||
|
|
@ -289,7 +289,6 @@ private:
|
|||
|
||||
Macnode* findmacnode (uint32_t inp, uint32_t out, bool create);
|
||||
|
||||
|
||||
volatile uint32_t _stat; // current processing state
|
||||
int _prio; // relative priority
|
||||
uint32_t _offs; // offset from start of impulse response
|
||||
|
|
@ -318,40 +317,33 @@ private:
|
|||
float** _outbuff; // array of shared output buffers
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
class LIBZCONVOLVER_API Convproc
|
||||
{
|
||||
public:
|
||||
|
||||
Convproc (void);
|
||||
~Convproc (void);
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
ST_IDLE,
|
||||
ST_STOP,
|
||||
ST_WAIT,
|
||||
ST_PROC
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
FL_LATE = 0x0000FFFF,
|
||||
FL_LOAD = 0x01000000
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
OPT_FFTW_MEASURE = Convlevel::OPT_FFTW_MEASURE,
|
||||
OPT_VECTOR_MODE = Convlevel::OPT_VECTOR_MODE,
|
||||
OPT_LATE_CONTIN = Convlevel::OPT_LATE_CONTIN
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
MAXINP = 64,
|
||||
MAXOUT = 64,
|
||||
MAXLEV = 8,
|
||||
|
|
@ -435,7 +427,6 @@ public:
|
|||
void print (FILE* F = stdout);
|
||||
|
||||
private:
|
||||
|
||||
uint32_t _state; // current state
|
||||
float* _inpbuff[MAXINP]; // input buffers
|
||||
float* _outbuff[MAXOUT]; // output buffers
|
||||
|
|
@ -458,10 +449,8 @@ private:
|
|||
static float _fft_cost;
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
} /* end namespace */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue