Console.txt error logging and fixed some shortcut bugs

git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@393 05730e5d-ab1b-0410-a4ac-84af385074fa
This commit is contained in:
Thorvald Natvig 2006-10-02 23:17:04 +00:00
parent d7cdbc3580
commit 349f01360b
3 changed files with 39 additions and 2 deletions

View File

@ -341,6 +341,8 @@ DXAudioOutput::DXAudioOutput() {
QMessageBox::warning(NULL, tr("Mumble"), tr("Opening chosen DirectSound Output failed. Using defaults."), QMessageBox::Ok, QMessageBox::NoButton);
qWarning("DXAudioOutput: Primary buffer of %ld Hz, %d channels, %d bits",wfxSet.nSamplesPerSec,wfxSet.nChannels,wfxSet.wBitsPerSample);
if (p3DListener)
qWarning("DXAudioOutput: 3D mode active");
bRunning = true;
}

View File

@ -232,7 +232,6 @@ BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE pdidi, LPVOID pContext
InputDevice *id = new InputDevice;
id->guid = pdidi->guidInstance;
cbgsw->qhInputDevices[id->guid] = id;
if (FAILED(hr = cbgsw->pDI->CreateDevice(pdidi->guidInstance, &id->pDID, NULL)))
qFatal("GlobalShortcutWin: CreateDevice: %lx", hr);
@ -281,8 +280,11 @@ BOOL GlobalShortcutWin::EnumDevicesCB(LPCDIDEVICEINSTANCE pdidi, LPVOID pContext
if(FAILED(hr = id->pDID->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)))
qFatal("GlobalShortcutWin::SetProperty");
cbgsw->qhInputDevices[id->guid] = id;
} else {
id->pDID->Release();
free(id);
}
return DIENUM_CONTINUE;
@ -310,7 +312,6 @@ void GlobalShortcutWin::remap() {
foreach(InputDevice *id, qhInputDevices) {
if (id->pDID) {
id->pDID->Unacquire();
id->pDID->Release();
}
free(id);
@ -358,6 +359,11 @@ void GlobalShortcutWin::remap() {
GlobalShortcutWin::~GlobalShortcutWin() {
unacquire();
foreach(InputDevice *id, qhInputDevices) {
if (id->pDID) {
id->pDID->Release();
}
}
pDI->Release();
}
@ -375,6 +381,7 @@ void GlobalShortcutWin::timeTicked() {
if (bNeedRemap)
remap();
foreach(InputDevice *id, qhInputDevices) {
DIDEVICEOBJECTDATA rgdod[DX_SAMPLE_BUFFER_SIZE];
DWORD dwItems = DX_SAMPLE_BUFFER_SIZE;
@ -402,6 +409,7 @@ void GlobalShortcutWin::timeTicked() {
pressed = true;
}
}
foreach(Shortcut *s, id->qmhOfsToShortcut.values(rgdod[j].dwOfs)) {
qpButton button(id->guid, id->qhOfsToType[rgdod[j].dwOfs]);
int idx;

View File

@ -50,6 +50,30 @@ namespace boost {
}
#endif
void mumbleMessageOutput(QtMsgType type, const char *msg)
{
FILE *f=NULL;
f=fopen("Console.txt", "a+");
if (!f)
f=stderr;
char c;
switch (type) {
case QtDebugMsg:
c='D';
break;
case QtWarningMsg:
c='W';
break;
case QtFatalMsg:
c='F';
break;
default:
c='X';
}
fprintf(f, "<%c>%s %s\n", c, qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz")), msg);
fclose(f);
}
int main(int argc, char **argv)
{
@ -68,6 +92,9 @@ int main(int argc, char **argv)
int res;
QT_REQUIRE_VERSION(argc, argv, "4.1.0");
#ifdef QT_NO_DEBUG
qInstallMsgHandler(mumbleMessageOutput);
#endif
// Initialize application object.
QApplication a(argc, argv);