本文整理汇总了C++中MainWin::PostMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ MainWin::PostMessage方法的具体用法?C++ MainWin::PostMessage怎么用?C++ MainWin::PostMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWin
的用法示例。
在下文中一共展示了MainWin::PostMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
void
MainWin::PlayBuffer(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format) {
int64 frames = 0;
playTrack->ReadFrames(buffer, &frames);
MainWin *window = (MainWin *)cookie;
bigtime_t now;
if (sp->CurrentTime() < time)
now = time + sp->CurrentTime();
else
now = time = sp->CurrentTime();
char timestamp[64];
MainWin::Timestamp(timestamp, time);
BMessage *update = new BMessage(MSG_UPDATE_PROGRESS);
update->AddFloat("current", (float) now);
update->AddString("time", timestamp);
window->PostMessage(update);
if (frames <= 0) {
sp->SetHasData(false);
window->PostMessage(MSG_NEXT);
}
}
示例2: NewWindow
void
MainApp::ReadyToRun()
{
// make sure we have at least one window open
if (fPlayerCount == 0) {
MainWin* window = NewWindow();
if (window == NULL) {
PostMessage(B_QUIT_REQUESTED);
return;
}
BMessage lastPlaylistArchive;
if (_RestoreCurrentPlaylist(&lastPlaylistArchive) == B_OK) {
lastPlaylistArchive.what = M_OPEN_PREVIOUS_PLAYLIST;
window->PostMessage(&lastPlaylistArchive);
} else
window->Show();
}
// setup the settings window now, we need to have it
fSettingsWindow = new SettingsWindow(BRect(150, 150, 450, 520));
fSettingsWindow->Hide();
fSettingsWindow->Show();
_InstallPlaylistMimeType();
}