void Log::ToggleEnabled( int type ) { if ( !IsTypeEnabled( type ) ) EnableType( type ); else DisableType( type ); }
int ChangedListeningInfo() { // m_log(_T("ChangedListeningInfo"), _T("Start")); BOOL changed = FALSE; BOOL playing = FALSE; int first = (players[WATRACK]->enabled ? WATRACK : GENERIC); int last = (players[WATRACK]->enabled ? WATRACK + 1 : NUM_PLAYERS); for (int i = first; i < last; i++) { if (!players[i]->enabled) continue; LISTENINGTOINFO lti = {0}; if (!players[i]->GetListeningInfo(<i)) continue; if (!IsTypeEnabled(<i)) { FreeListeningInfo(<i); continue; } playing = TRUE; // m_log(_T("ChangedListeningInfo"), _T("Has : %s : %d"), players[i]->name, lti.cbSize); if (Equals(¤t, <i)) { // m_log(_T("ChangedListeningInfo"), _T("Is equals")); FreeListeningInfo(<i); } else { // m_log(_T("ChangedListeningInfo"), _T("Is different")); FreeListeningInfo(¤t); memcpy(¤t, <i, sizeof(current)); changed = 1; } break; } if (!playing && current.cbSize != 0) { FreeListeningInfo(¤t); changed = 1; } if (!changed) return 0; else return current.cbSize == 0 ? -1 : 1; }
void Log::Write( LOG_TYPE type, const std::string& message ) { #ifdef ENABLE_LOGGING if ( enable && IsTypeEnabled( type ) ) { // ::wxLogMessage( message.c_str() ); // ::OutputDebugStringA( ( message + "\r\n" ).c_str() ); mFile << message << std::endl; static int flushInterval = 0; flushInterval++; if ( flushInterval >= 10000 ) { mFile.flush(); flushInterval = 0; } } #endif }