| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef CsoundHtmlOnlyWrapper_H |
| 24 |
#define CsoundHtmlOnlyWrapper_H |
| 25 |
|
| 26 |
#include <QObject> |
| 27 |
#include <QDebug> |
| 28 |
#include <csound_threaded.hpp> |
| 29 |
#include "csoundengine.h" |
| 30 |
|
| 31 |
class CsoundHtmlView; |
| 32 |
|
| 33 |
class CsoundHtmlOnlyWrapper : public QObject |
| 34 |
{ |
| 35 |
Q_OBJECT |
| 36 |
public: |
| 37 |
explicit CsoundHtmlOnlyWrapper(QObject *parent = 0); |
| 38 |
virtual ~CsoundHtmlOnlyWrapper(); |
| 39 |
void setCsoundHtmlView(CsoundHtmlView *csoundHtmlView); |
| 40 |
public slots: |
| 41 |
void registerConsole(ConsoleWidget *console); |
| 42 |
int compileCsd(const QString &filename); |
| 43 |
|
| 44 |
|
| 45 |
int CompileCsd(const QString &filename) { return compileCsd(filename);} |
| 46 |
int compileCsdText(const QString &text); |
| 47 |
int CompileCsdText(const QString &text) { return compileCsdText(text);} |
| 48 |
int compileOrc(const QString &text); |
| 49 |
int CompileOrc(const QString &text) { return compileOrc(text);} |
| 50 |
double evalCode(const QString &text); |
| 51 |
double EvalCode(const QString &text) { return evalCode(text); } |
| 52 |
double get0dBFS(); |
| 53 |
double Get0dBFS() {return get0dBFS();} |
| 54 |
int getApiVersion(); |
| 55 |
double getControlChannel(const QString &name); |
| 56 |
|
| 57 |
qint64 getCurrentTimeSamples(); |
| 58 |
QString getEnv(const QString &name); |
| 59 |
int getKsmps(); |
| 60 |
int getNchnls(); |
| 61 |
int getNchnlsInput(); |
| 62 |
QString getOutputName(); |
| 63 |
double getScoreOffsetSeconds(); |
| 64 |
double getScoreTime(); |
| 65 |
double GetScoreTime() {return getScoreTime();} |
| 66 |
int getSr(); |
| 67 |
QString getStringChannel(const QString &name); |
| 68 |
int getVersion(); |
| 69 |
bool isPlaying(); |
| 70 |
int isScorePending(); |
| 71 |
void message(const QString &text); |
| 72 |
int perform(); |
| 73 |
int readScore(const QString &text); |
| 74 |
int ReadScore(const QString &text) {return readScore(text);} |
| 75 |
int Event(const QString &text) {return readScore(text);} |
| 76 |
void reset(); |
| 77 |
void Reset() {reset();} |
| 78 |
void rewindScore(); |
| 79 |
int runUtility(const QString &command, int argc, char **argv); |
| 80 |
int scoreEvent(char type, const double *pFields, long numFields); |
| 81 |
void setControlChannel(const QString &name, double value); |
| 82 |
void SetChannel(const QString &name, double value) {setControlChannel(name, value);} |
| 83 |
int setGlobalEnv(const QString &name, const QString &value); |
| 84 |
void setInput(const QString &name); |
| 85 |
|
| 86 |
void setMessageCallback(QObject *callback); |
| 87 |
int setOption(const QString &name); |
| 88 |
void setOutput(const QString &name, const QString &type, const QString &format); |
| 89 |
void setScoreOffsetSeconds(double value); |
| 90 |
void setScorePending(bool value); |
| 91 |
void setStringChannel(const QString &name, const QString &value); |
| 92 |
void SetStringChannel(const QString &name, const QString &value) { setStringChannel(name, value); } |
| 93 |
int start(); |
| 94 |
int Start(); |
| 95 |
void Play() {start(); perform();} |
| 96 |
void PlayCsd(const QString &csd) { compileCsd(csd); Play(); } |
| 97 |
void stop(); |
| 98 |
void Stop() { stop();} |
| 99 |
|
| 100 |
double tableGet(int table_number, int index); |
| 101 |
int tableLength(int table_number); |
| 102 |
void tableSet(int table_number, int index, double value); |
| 103 |
void SetTable(int table_number, int index, double value) { tableSet(table_number, index, value); } |
| 104 |
void setOptions(CsoundOptions * options); |
| 105 |
signals: |
| 106 |
void passMessages(QString message); |
| 107 |
private: |
| 108 |
static void csoundMessageCallback_(CSOUND *csound, |
| 109 |
int attributes, |
| 110 |
const char *format, |
| 111 |
va_list args); |
| 112 |
void csoundMessageCallback(int attributes, |
| 113 |
const char *format, |
| 114 |
va_list args); |
| 115 |
QObject *message_callback; |
| 116 |
ConsoleWidget *console; |
| 117 |
CsoundThreaded csound; |
| 118 |
CsoundHtmlView *csoundHtmlView; |
| 119 |
private: |
| 120 |
CsoundOptions *m_options; |
| 121 |
QString csoundMessageBuffer; |
| 122 |
}; |
| 123 |
|
| 124 |
#endif |