本文整理汇总了C++中ITheFramework类的典型用法代码示例。如果您正苦于以下问题:C++ ITheFramework类的具体用法?C++ ITheFramework怎么用?C++ ITheFramework使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ITheFramework类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ex_xml
bool ex_xml(void *arg) {
XMLPipeline *xmlpipe = ssi_create(XMLPipeline, 0, false);
xmlpipe->SetRegisterDllFptr(Factory::RegisterDLL);
xmlpipe->setLogLevel(SSI_LOG_LEVEL_DEBUG);
ssi_size_t n_confs = 3;
ssi_char_t *confs[] = { "global", "global2", "global3" };
xmlpipe->parse("my", 3, confs, true);
//IThePainter *painter = Factory::GetPainter();
ITheFramework *frame = Factory::GetFramework();
//ITheEventBoard *eboard = Factory::GetEventBoard();
frame->Start();
/*
if (xmlpipe->startEventBoard()) {
eboard->Start();
}
*/
ssi_print("\n\n\tpress enter to continue\n\n");
getchar();
/*
if (xmlpipe->startEventBoard()) {
eboard->Stop();
}*/
frame->Stop();
frame->Clear();
//painter->Clear();
//eboard->Clear();
delete xmlpipe;
return true;
}
示例2: ConsoleHandler
BOOL WINAPI ConsoleHandler(DWORD CEvent)
{
switch(CEvent)
{
case CTRL_CLOSE_EVENT:
ITheFramework *frame = Factory::GetFramework ();
IThePainter *painter = 0;
painter = Factory::GetPainter ();
ITheEventBoard *eboard = 0;
eboard = Factory::GetEventBoard ();
if (eboard) {
eboard->Stop ();
}
frame->Stop ();
frame->Clear ();
if (eboard) {
eboard->Clear ();
}
if (painter) {
painter->Clear ();
}
Factory::Clear ();
::SetCurrentDirectory (_workdir);
break;
}
return TRUE;
}
示例3: ex_diff
bool ex_diff(void *args)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonFilter *py_diff = ssi_create(PythonFilter, 0, true);
py_diff->getOptions()->setScript("ssi_diff");
ITransformable *py_diff_t = frame->AddTransformer(cursor_t, py_diff, "0.1s");
SignalPainter *plot = 0;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("DIFF (PYTHON)");
plot->getOptions()->size = 10;
frame->AddConsumer(py_diff_t, plot, "1");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例4: ex_print
bool ex_print(void *args)
{
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *button_t = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonConsumer *py_print = ssi_create(PythonConsumer, 0, true);
py_print->getOptions()->setScript("ssi_print");
ITransformable *input[] = { button_t, cursor_t };
//py_print->getOptions()->add("path", "result.txt");
frame->AddConsumer(2, input, py_print, "100ms");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例5: ex_event
bool ex_event(void *args)
{
ITheFramework *frame = Factory::GetFramework();
ITheEventBoard *board = Factory::GetEventBoard();
Decorator *decorator = ssi_create(Decorator, 0, true);
frame->AddDecorator(decorator);
Mouse *mouse = ssi_create(Mouse, 0, true);
mouse->getOptions()->mask = Mouse::LEFT;
ITransformable *button_t = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
ITransformable *cursor_t = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor(mouse);
PythonConsumer *py_send = ssi_create_id(PythonConsumer, 0, "pysend");
py_send->getOptions()->setScript("ssi_send");
ITransformable *input[] = { button_t, cursor_t };
frame->AddConsumer(2, input, py_send, "100ms");
board->RegisterSender(*py_send);
PythonObject *py_listen = ssi_create_id(PythonObject, 0, "pylisten");
py_listen->getOptions()->setScript("ssi_listen");
board->RegisterListener(*py_listen, py_send->getEventAddress());
EventMonitor *monitor = ssi_create_id(EventMonitor, 0, "monitor");
board->RegisterListener(*monitor, 0, 10000u);
SignalPainter *plot = 0;
plot = ssi_create_id(SignalPainter, 0, "plot");
plot->getOptions()->setTitle("CURSOR");
frame->AddEventConsumer(cursor_t, plot, board, py_send->getEventAddress());
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
board->Stop();
frame->Clear();
board->Clear();
return true;
}
示例6: ex_export
bool ex_export(void *arg) {
ITheFramework *frame = Factory::GetFramework();
XMLPipeline *xmlpipe = ssi_create(XMLPipeline, 0, false);
ssi_size_t n_confs = 3;
ssi_char_t *confs[] = { "global", "global2", "global3" };
xmlpipe->parse("my", 3, confs, false);
const ssi_char_t *dir = "dlls";
ssi_mkdir(dir);
Factory::ExportDlls(dir);
delete xmlpipe;
frame->Clear();
return true;
}
示例7: ex_stream_info
bool ex_stream_info(void *arg) {
Factory::RegisterDLL("ssimouse");
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
ITheEventBoard *board = Factory::GetEventBoard();
//ClockEventSender *eclock = ssi_create(ClockEventSender, 0, true);
Mouse *mouse = ssi_create(Mouse, "mouse", true);
mouse->getOptions()->mask = Mouse::LEFT;
mouse->getOptions()->scale = true;
mouse->getOptions()->single = false;
mouse->getOptions()->sendEvent = true;
ITransformable *cursor_p = frame->AddProvider(mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
ITransformable *button_p = frame->AddProvider(mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
frame->AddSensor(mouse);
board->RegisterSender(*mouse);
Websocket *websocket = ssi_create(Websocket, 0, true);
websocket->getOptions()->setHttpRoot("stream_to_browser_info");
websocket->getOptions()->send_info = true;
//frame->AddConsumer(cursor_p, websocket, "0.25s");
ssi::ITransformable *src[2] = { cursor_p, button_p };
frame->AddConsumer(2, src, websocket, "1");
board->RegisterSender(*websocket);
board->RegisterListener(*websocket);
EventMonitor *monitor = ssi_create_id (EventMonitor, 0, "monitor");
board->RegisterListener(*monitor);
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例8: ex_async
bool ex_async (void *arg) {
ITheFramework *frame = Factory::GetFramework ();
ssi_pcast(TheFramework, frame)->getOptions()->setConsolePos(800, 200, 400, 200);
//IThePainter *painter = Factory::GetPainter ();
Mouse *mouse = ssi_create (Mouse, 0, false);
ITransformable *cursor_p = frame->AddProvider (mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
frame->AddSensor (mouse);
// trans
Delay delay;
ITransformable *filter_t = frame->AddTransformer (cursor_p, &delay, "0.2s");
Asynchronous *delay_async = ssi_create (Asynchronous, 0, true);
//Asynchronous *delay_async = ssi_pcast (Asynchronous, Asynchronous::Create (0));
delay_async->setTransformer (&delay);
ITransformable *filter_async_t = frame->AddTransformer (cursor_p, delay_async, "0.2s");
// output
/*
SignalPainter *signal_painter = 0;
signal_painter = ssi_create (SignalPainter, 0, true);
signal_painter->getOptions ()->size = 60.0;
signal_painter->getOptions ()->setName ("cursor");
frame->AddConsumer (cursor_p, signal_painter, "0.2s");
signal_painter = ssi_create (SignalPainter, 0, true);
signal_painter->getOptions ()->size = 60.0;
signal_painter->getOptions ()->setName ("delay");
frame->AddConsumer (filter_t, signal_painter, "0.2s");
signal_painter = ssi_create (SignalPainter, 0, true);
signal_painter->getOptions ()->size = 60.0;
signal_painter->getOptions ()->setName ("delay async");
frame->AddConsumer (filter_async_t, signal_painter, "0.2s");
*/
// run
frame->Start ();
//painter->Arrange (1,3,0,0,800,400);
frame->Wait ();
frame->Stop ();
frame->Clear ();
//painter->Clear ();
return true;
}
示例9: ex_xml
void ex_xml () {
ITheFramework *frame = Factory::GetFramework ();
IThePainter *painter = Factory::GetPainter ();
ITheEventBoard *board = Factory::GetEventBoard ();
XMLPipeline *xmlpipe = ssi_factory_create (XMLPipeline, 0, true);
xmlpipe->parse ("my.pipeline");
frame->Start ();
board->Start ();
frame->Wait ();
board->Stop ();
frame->Stop ();
board->Clear ();
frame->Clear ();
painter->Clear ();
}
示例10: ex_sensor
bool ex_sensor (void *arg) {
ITheFramework *frame = Factory::GetFramework ();
//IThePainter *painter = Factory::GetPainter ();
//ITheEventBoard *board = Factory::GetEventBoard ();
Mouse *mouse = ssi_pcast (Mouse, Factory::Create (Mouse::GetCreateName (), "mouse"));
mouse->getOptions ()->mask = Mouse::LEFT;
ITransformable *cursor_p = frame->AddProvider (mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
ITransformable *button_p = frame->AddProvider (mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
frame->AddSensor (mouse);
ZeroEventSender *ezero = ssi_create (ZeroEventSender, "ezero", true);
ezero->getOptions ()->mindur = 0.2;
frame->AddConsumer (cursor_p, ezero, "0.25s");
/*
board->RegisterSender (*ezero);
SignalPainter *sigpaint = ssi_create (SignalPainter, 0, true);
sigpaint->getOptions ()->setName ("mouse");
sigpaint->getOptions ()->size = 2.0;
frame->AddConsumer (cursor_p, sigpaint, "0.2s");
sigpaint= ssi_create (SignalPainter, 0, true);
sigpaint->getOptions ()->setName ("mouse (tr)");
frame->AddEventConsumer (cursor_p, sigpaint, board, ezero->getEventAddress ());
*/
frame->Start ();
//board->Start ();
//painter->Arrange (2, 1, 0, 0, 800, 400);
frame->Wait ();
//board->Stop ();
frame->Stop ();
frame->Clear ();
//board->Clear ();
//painter->Clear ();
return true;
}
示例11: ex_trigger
bool ex_trigger (void *arg) {
ITheFramework *frame = Factory::GetFramework ();
//ssi_pcast(TheFramework, frame)->getOptions()->setConsolePos(800, 200, 400, 200);
Mouse *mouse = ssi_create (Mouse, 0, false);
mouse->getOptions ()->mask = Mouse::LEFT;
ITransformable *cursor_p = frame->AddProvider (mouse, SSI_MOUSE_CURSOR_PROVIDER_NAME);
ITransformable *button_p = frame->AddProvider (mouse, SSI_MOUSE_BUTTON_PROVIDER_NAME);
frame->AddSensor (mouse);
FileWriter *writer = ssi_create (FileWriter, 0, true);
writer->getOptions ()->type = File::ASCII;
frame->AddConsumer (cursor_p, writer, "0.2s", 0, 0, button_p);
frame->Start ();
frame->Wait ();
frame->Stop ();
frame->Clear ();
return true;
}
示例12: ex_simulator
bool ex_simulator(void *arg) {
if (!ssi_exists("cursor_txt.stream")) {
ex_writer(0);
}
ITheFramework *frame = Factory::GetFramework ();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
File::SetLogLevel (SSI_LOG_LEVEL_DEBUG);
FileReader *reader = ssi_create (FileReader, 0, true);
reader->getOptions()->setPath("cursor_txt");
reader->getOptions()->block = 0.05;
reader->getOptions()->loop = true;
reader->getOptions()->offset = 0.1;
ITransformable *cursor_p = frame->AddProvider(reader, SSI_FILEREADER_PROVIDER_NAME);
frame->AddSensor(reader);
FileWriter *writer = ssi_create (FileWriter, 0, true);
writer->getOptions()->type = File::ASCII;
frame->AddConsumer(cursor_p, writer, "0.05s");
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
frame->Start();
reader->wait();
frame->Stop();
frame->Clear();
return true;
}
示例13: ex_events_string
bool ex_events_string(void *arg) {
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
ITheEventBoard *board = Factory::GetEventBoard();
ClockEventSender *eclock = ssi_create(ClockEventSender, 0, true);
eclock->getOptions()->clock = 1000;
eclock->getOptions()->empty = false;
eclock->getOptions()->setString("test");
board->RegisterSender(*eclock);
frame->AddRunnable(eclock);
Websocket *websocket = ssi_create(Websocket, 0, true);
board->RegisterSender(*websocket);
board->RegisterListener(*websocket);
EventMonitor *monitor = ssi_create_id (EventMonitor, 0, "monitor");
board->RegisterListener(*monitor);
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例14: ex_mobile_events
bool ex_mobile_events(void *arg)
{
Factory::RegisterDLL("ssiioput");
ITheFramework *frame = Factory::GetFramework();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
ITheEventBoard *board = Factory::GetEventBoard();
Websocket *websocket = ssi_create(Websocket, 0, true);
websocket->getOptions()->setHttpRoot("mobile_browser_to_SSI");
board->RegisterSender(*websocket);
board->RegisterListener(*websocket);
EventMonitor *monitor = ssi_create_id (EventMonitor, 0, "monitor");
board->RegisterListener(*monitor);
FileEventWriter *writer = ssi_create(FileEventWriter, 0, true);
writer->getOptions()->setPath("sensor_data");
board->RegisterListener(*writer);
decorator->add("console", 0, 0, 650, 800);
decorator->add("plot*", 650, 0, 400, 400);
decorator->add("monitor*", 650, 400, 400, 400);
board->Start();
frame->Start();
frame->Wait();
frame->Stop();
frame->Clear();
return true;
}
示例15: ex_pitch
void ex_pitch () {
ITheFramework *frame = Factory::GetFramework ();
Decorator *decorator = ssi_create (Decorator, 0, true);
frame->AddDecorator(decorator);
// audio sensor
#ifndef SIMULATE
Audio *audio = ssi_create (Audio, "audio", true);
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_AUDIO_PROVIDER_NAME);
#else
WavReader *audio = ssi_create (WavReader, 0, true);
audio->getOptions()->setPath("audio.wav");
audio->getOptions()->scale = true;
ITransformable *audio_p = frame->AddProvider(audio, SSI_WAVREADER_PROVIDER_NAME);
#endif
frame->AddSensor(audio);
// fft
OSTransformFFT *fft = ssi_create (OSTransformFFT, "OSTransformFFT", true);
fft->getWindow()->getOptions()->type = OSWindow::GAUSS;
fft->getWindow()->getOptions()->gain = 1.0;
fft->getWindow()->getOptions()->sigma = 0.4;
double frameSize = audio_p->getSampleRate() * 0.01;
double deltaSize = audio_p->getSampleRate() * 0.04;
fft->getOptions()->nfft = smileMath_ceilToNextPowOf2(frameSize + deltaSize); //we set the FFT frame size so it's a power of 2 but can also fit all the samples
ITransformable *fft_t = frame->AddTransformer(audio_p, fft, "0.01s", "0.04s");
// fftmag
OSFFTmagphase *fftmag = ssi_create (OSFFTmagphase, "OSFFTmagphase", true);
ITransformable *fftmag_t = frame->AddTransformer(fft_t, fftmag, "0.1s");
// specscale
OSSpecScale *specscale = ssi_create (OSSpecScale, "OSSpecScale", true);
specscale->getOptions()->srcScale = OSSpecScale::LINEAR;
specscale->getOptions()->dstScale = OSSpecScale::LOG;
specscale->getOptions()->dstLogScaleBase = 2.0;
specscale->getOptions()->minF = 20;
specscale->getOptions()->smooth = true;
specscale->getOptions()->enhance = true;
specscale->getOptions()->weight = true;
specscale->getOptions()->fsSec = 0.064; // BUG?
ITransformable *specscale_t = frame->AddTransformer(fftmag_t, specscale, "0.1s");
// pitchshs
OSPitchShs *pitchshs = ssi_create (OSPitchShs, "OSPitchShs", false);
pitchshs->getOptions()->maxPitch = 620;
pitchshs->getOptions()->minPitch = 42;
pitchshs->getOptions()->nCandidates = 6;
pitchshs->getOptions()->scores = true;
pitchshs->getOptions()->voicing = true;
pitchshs->getOptions()->F0C1 = false;
pitchshs->getOptions()->voicingC1 = false;
pitchshs->getOptions()->F0raw = false;
pitchshs->getOptions()->voicingClip = false;
pitchshs->getOptions()->voicingCutoff = 0.7;
pitchshs->getOptions()->octaveCorrection = false;
pitchshs->getOptions()->fsSec = 0.064; // BUG?
pitchshs->getOptions()->baseSr = audio_p->getSampleRate();
ITransformable *pitchshs_t = frame->AddTransformer(specscale_t, pitchshs, "0.1s");
// pitchsmooth
OSPitchSmoother *pitchsmooth = ssi_create (OSPitchSmoother, "OSPitchSmoother", true);
pitchsmooth->getOptions()->medianFilter0 = 0;
pitchsmooth->getOptions()->postSmoothing = 0;
pitchsmooth->getOptions()->postSmoothingMethod = OSPitchSmoother::SIMPLE;
pitchsmooth->getOptions()->octaveCorrection = false;
pitchsmooth->getOptions()->F0final = true;
pitchsmooth->getOptions()->F0finalEnv = false;
pitchsmooth->getOptions()->voicingFinalClipped = false;
pitchsmooth->getOptions()->voicingFinalUnclipped = true;
pitchsmooth->getOptions()->F0raw = false;
pitchsmooth->getOptions()->voicingC1 = false;
pitchsmooth->getOptions()->voicingClip = false;
ITransformable *pitchsmooth_t = frame->AddTransformer(pitchshs_t, pitchsmooth, "0.1s");
// plot
SignalPainter *plot = 0;
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("audio");
plot->getOptions()->type = PaintSignalType::AUDIO;
plot->getOptions()->size = 10.0;
frame->AddConsumer(audio_p, plot, "0.1s");
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("fft");
plot->getOptions()->size = 10.0;
plot->getOptions()->type = PaintSignalType::IMAGE;
frame->AddConsumer(fft_t, plot, "0.1s");
plot = ssi_create_id (SignalPainter, 0, "plot");
plot->getOptions()->setTitle("fftmag");
plot->getOptions()->size = 10.0;
plot->getOptions()->type = PaintSignalType::IMAGE;
frame->AddConsumer(fftmag_t, plot, "0.1s");
plot = ssi_create_id (SignalPainter, 0, "plot");
//.........这里部分代码省略.........