Update to new combined build

This commit is contained in:
Chris Cannam
2012-09-09 16:57:42 +01:00
parent 4ecb1fa6f1
commit 93c38b50a0
77 changed files with 10427 additions and 897 deletions

View File

@@ -1,15 +1,24 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Rubber Band
Rubber Band Library
An audio time-stretching and pitch-shifting library.
Copyright 2007-2011 Chris Cannam.
Copyright 2007-2012 Particular Programs Ltd.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. See the file
COPYING included with this distribution for more information.
Alternatively, if you have a valid commercial licence for the
Rubber Band Library obtained by agreement with the copyright
holders, you may redistribute and/or modify it under the terms
described in that licence.
If you wish to distribute code using the Rubber Band Library
under terms other than those of the GNU General Public License,
you must obtain a valid commercial licence before doing so.
*/
#ifndef _RUBBERBAND_THREAD_H_
@@ -17,11 +26,16 @@
#include <string>
#ifndef NO_THREADING
#ifdef _WIN32
#include <windows.h>
#else /* !_WIN32 */
#ifdef USE_PTHREADS
#include <pthread.h>
#else /* !USE_PTHREADS */
#error No thread implementation selected
#endif /* !USE_PTHREADS */
#endif /* !_WIN32 */
//#define DEBUG_THREAD 1
@@ -37,7 +51,9 @@ public:
#ifdef _WIN32
typedef HANDLE Id;
#else
#ifdef USE_PTHREADS
typedef pthread_t Id;
#endif
#endif
Thread();
@@ -59,10 +75,12 @@ private:
bool m_extant;
static DWORD WINAPI staticRun(LPVOID lpParam);
#else
#ifdef USE_PTHREADS
pthread_t m_id;
bool m_extant;
static void *staticRun(void *);
#endif
#endif
};
class Mutex
@@ -82,12 +100,14 @@ private:
DWORD m_lockedBy;
#endif
#else
#ifdef USE_PTHREADS
pthread_mutex_t m_mutex;
#ifndef NO_THREAD_CHECKS
pthread_t m_lockedBy;
bool m_locked;
#endif
#endif
#endif
};
class MutexLocker
@@ -133,10 +153,12 @@ private:
HANDLE m_condition;
bool m_locked;
#else
#ifdef USE_PTHREADS
pthread_mutex_t m_mutex;
pthread_cond_t m_condition;
bool m_locked;
#endif
#endif
#ifdef DEBUG_CONDITION
std::string m_name;
#endif
@@ -144,5 +166,67 @@ private:
}
#else
/* Stub threading interface. We do not have threading support in this code. */
namespace RubberBand
{
class Thread
{
public:
typedef unsigned int Id;
Thread() { }
virtual ~Thread() { }
Id id() { return 0; }
void start() { }
void wait() { }
static bool threadingAvailable() { return false; }
protected:
virtual void run() = 0;
private:
};
class Mutex
{
public:
Mutex() { }
~Mutex() { }
void lock() { }
void unlock() { }
bool trylock() { return false; }
};
class MutexLocker
{
public:
MutexLocker(Mutex *) { }
~MutexLocker() { }
};
class Condition
{
public:
Condition(std::string name) { }
~Condition() { }
void lock() { }
void unlock() { }
void wait(int us = 0) { }
void signal() { }
};
}
#endif /* NO_THREADING */
#endif