📄 example.cpp
字号:
#include <windows.h>
#include <conio.h>
#include "tf_main.h"
using namespace Tunefish;
#include "song.h"
#include "instruments.h"
#include "effects.h"
int main()
{
printf("Tunefish 0.9.3\n");
// synth...
Tunefish::Song *song = new Tunefish::Song((unsigned char *)notes, (double *)instruments);
Tunefish::Synth *synth = new Tunefish::Synth(song, (double *)effects);
if (!synth)
return 0;
synth->play(1.0f, false);
bool more = true;
while (synth->process(&more) && !_kbhit())
{
#ifdef _WIN32
Sleep(10);
#else
sleep(1);
#endif
}
synth->stop();
delete synth;
delete song;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -