| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef CsoundHtmlWrapper_H |
| 24 |
#define CsoundHtmlWrapper_H |
| 25 |
|
| 26 |
#include <QObject> |
| 27 |
#include <QDebug> |
| 28 |
#include <thread> |
| 29 |
#include "csoundengine.h" |
| 30 |
|
| 31 |
class CsoundHtmlView; |
| 32 |
|
| 33 |
class CsoundHtmlWrapper : public QObject |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
public: |
| 37 |
explicit CsoundHtmlWrapper(QObject *parent = 0); |
| 38 |
void setCsoundHtmlView(CsoundHtmlView *csoundHtmlView); |
| 39 |
public slots: |
| 40 |
CSOUND *getCsound(); |
| 41 |
CsoundPerformanceThread *getThread(); |
| 42 |
CsoundUserData *getUserData(); |
| 43 |
void setCsoundEngine(CsoundEngine *csEngine); |
| 44 |
int compileCsd(const QString &filename); |
| 45 |
int compileCsdText(const QString &text); |
| 46 |
int compileOrc(const QString &text); |
| 47 |
double evalCode(const QString &text); |
| 48 |
double get0dBFS(); |
| 49 |
int getApiVersion(); |
| 50 |
double getControlChannel(const QString &name); |
| 51 |
qint64 getCurrentTimeSamples(); |
| 52 |
QString getEnv(const QString &name); |
| 53 |
int getKsmps(); |
| 54 |
int getNchnls(); |
| 55 |
int getNchnlsInput(); |
| 56 |
QString getOutputName(); |
| 57 |
double getScoreOffsetSeconds(); |
| 58 |
double getScoreTime(); |
| 59 |
int getSr(); |
| 60 |
QString getStringChannel(const QString &name); |
| 61 |
int getVersion(); |
| 62 |
bool isPlaying(); |
| 63 |
int isScorePending(); |
| 64 |
void message(const QString &text); |
| 65 |
int perform(); |
| 66 |
int readScore(const QString &text); |
| 67 |
void reset(); |
| 68 |
void rewindScore(); |
| 69 |
int runUtility(const QString &command, int argc, char **argv); |
| 70 |
int scoreEvent(char type, const double *pFields, long numFields); |
| 71 |
void setControlChannel(const QString &name, double value); |
| 72 |
int setGlobalEnv(const QString &name, const QString &value); |
| 73 |
void setInput(const QString &name); |
| 74 |
|
| 75 |
void setMessageCallback(QObject *callback); |
| 76 |
int setOption(const QString &name); |
| 77 |
void setOutput(const QString &name, const QString &type, const QString &format); |
| 78 |
void setScoreOffsetSeconds(double value); |
| 79 |
void setScorePending(bool value); |
| 80 |
void setStringChannel(const QString &name, const QString &value); |
| 81 |
int start(); |
| 82 |
void stop(); |
| 83 |
double tableGet(int table_number, int index); |
| 84 |
int tableLength(int table_number); |
| 85 |
void tableSet(int table_number, int index, double value); |
| 86 |
public: |
| 87 |
static void csoundMessageCallback_(CSOUND *csound, |
| 88 |
int attributes, |
| 89 |
const char *format, |
| 90 |
va_list args); |
| 91 |
void csoundMessageCallback(int attributes, |
| 92 |
const char *format, |
| 93 |
va_list args); |
| 94 |
private: |
| 95 |
QString csoundMessageBuffer; |
| 96 |
CsoundHtmlView *csoundHtmlView; |
| 97 |
CsoundEngine *m_csoundEngine; |
| 98 |
QObject *message_callback; |
| 99 |
}; |
| 100 |
|
| 101 |
#endif |