本文整理汇总了C++中UIWindow::Show方法的典型用法代码示例。如果您正苦于以下问题:C++ UIWindow::Show方法的具体用法?C++ UIWindow::Show怎么用?C++ UIWindow::Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIWindow
的用法示例。
在下文中一共展示了UIWindow::Show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UIWindow
void
App::ReadyToRun()
{
// faust ui
UIWindow* uiWindow = new UIWindow(BRect(512, 512, 512 + 320, 512 + 240),
"UIWindow");
uiWindow->Show();
// audio
//fFaustDSP = new KarplusDSP();
//fFaustDSP = new FreeverbDSP();
fFaustDSP = new PitchShifterDSP();
//fFaustDSP = new DbMeterDSP();
//fFaustDSP = new MixerDSP();
fFaustDSP->buildUserInterface(uiWindow->FaustUserInterface());
// registering our media node
status_t err;
fMediaRoster = BMediaRoster::Roster(&err);
if (fMediaRoster == NULL || err != B_OK) {
/* the Media Server appears to be dead -- handle that here */
printf("Oh! The Media Server appears to be dead :(\n");
} else {
fMainMediaNode = new GenericAudioFilterNode(fFaustDSP);
err = fMediaRoster->RegisterNode(fMainMediaNode);
if (err != B_OK) {
printf("Error registering the audio node\n");
return;
} else
printf("Registered the audio node successfully\n");
}
// connecting main output to the mixer
media_node mixerNode;
err = fMediaRoster->GetAudioMixer(&mixerNode);
if (err == B_OK) {
_ConnectAudioNodes(fMainMediaNode->Node(), mixerNode);
} else {
printf("Error! Couldn't GetAudioMixer\n");
}
// connecting to mediaplayer
int32 nodeInfoCount = 512;
live_node_info* nodeInfos = new live_node_info[nodeInfoCount];
err = fMediaRoster->GetLiveNodes(nodeInfos, &nodeInfoCount);//,
//const media_format* hasInput = NULL,
// const media_format* hasOutput = NULL,
// const char* name = NULL,
//uint64 nodeKinds = 0);
media_node mediaPlayerNode;
if (err == B_OK) {
for (int i = 0; i < nodeInfoCount; i++) {
printf("found node '%s' id=%ld\n", nodeInfos[i].name, nodeInfos[i].node.node);
if (strcmp(nodeInfos[i].name, "MediaPlayer audio out") == 0) {
printf("found 'MediaPlayer Audio Out' try connecting\n");
mediaPlayerNode = nodeInfos[i].node;
err = _ConnectAudioNodes(mediaPlayerNode, fMainMediaNode->Node());
if (err == B_OK)
break;
// todo stop the loop if succeed
}
}
} else {
printf("Error! Couldn't get live nodes\n");
}
}