Project
=======
client core size reduction.
Synopsis
========
We can reduce the size of the core by only including the audio
device we want to use, DirectSound or WaveOut, not both.
Fix
===
If HELIX_CONFIG_MINIMIZE_SIZE is defined we use the helix feature
HELIX_FEATURE_DIRECT_SOUND to determine what device to build and
instantiate. I have also remove a class that was used to do logging.
If any logging is needed in the future it should be done with out
new unified logging system, not a one off.
Files Modified
==============
auddevlib_win.pcf (conditionally compile files)
audio/device/hxaudev.cpp (only use one or the other)
audio/device/platform/win/hxaudevds.cpp (remove logging)
Branch(s)
=========
HEAD.
Image Size and Heap Use impact
==============================
7k image size reduction.
Platforms and Profiles Affected
===============================
windows HELIX_CONFIG_MINIMIZE_SIZE build only.
logging changes affect all windows builds.
--greg.
Index: auddevlib_win.pcf
===================================================================
RCS file: /cvsroot/audio/device/auddevlib_win.pcf,v
retrieving revision 1.2
diff -u -w -r1.2 auddevlib_win.pcf
--- auddevlib_win.pcf 11 May 2004 00:23:53 -0000 1.2
+++ auddevlib_win.pcf 24 Jun 2005 22:12:24 -0000
@@ -36,9 +36,16 @@
#
project.AddIncludes("pub/platform/win")
-project.AddSources("platform/win/winaudio.cpp")
+if "HELIX_CONFIG_MINIMIZE_SIZE" in project.defines:
+ if "HELIX_FEATURE_DIRECT_SOUND" in project.defines:
+ project.AddIncludes(GetSDKPath("dxsdk") + "/include")
+ project.AddSources("platform/win/hxaudevds.cpp")
+ else:
+ project.AddSources("platform/win/winaudio.cpp")
+else:
+ project.AddSources("platform/win/winaudio.cpp")
if "HELIX_FEATURE_DIRECT_SOUND" in project.defines:
project.AddIncludes(GetSDKPath("dxsdk") + "/include")
- project.AddSources("platform/win/hxaudevds.cpp",
- "platform/win/hxdslogger.cpp")
+ project.AddSources("platform/win/hxaudevds.cpp");
+
Index: hxaudev.cpp
===================================================================
RCS file: /cvsroot/audio/device/hxaudev.cpp,v
retrieving revision 1.28
diff -u -w -r1.28 hxaudev.cpp
--- hxaudev.cpp 5 May 2005 09:17:26 -0000 1.28
+++ hxaudev.cpp 24 Jun 2005 22:12:24 -0000
@@ -311,6 +311,7 @@
#if defined( _WINDOWS )
#if defined (HELIX_FEATURE_DIRECT_SOUND)
+# if !defined(HELIX_CONFIG_MINIMIZE_SIZE)
HXBOOL bUseDS = FALSE;
if(pPrefs)
{
@@ -328,6 +329,9 @@
else
pAudioDevice = new CAudioOutWindows;
#else
+ pAudioDevice = new CHXAudioDeviceDS;
+# endif
+#else
pAudioDevice = new CAudioOutWindows;
#endif //HELIX_FEATURE_DIRECT_SOUND
Index: platform/win/hxaudevds.cpp
===================================================================
RCS file: /cvsroot/audio/device/platform/win/hxaudevds.cpp,v
retrieving revision 1.28
diff -u -w -r1.28 hxaudevds.cpp
--- platform/win/hxaudevds.cpp 5 May 2005 09:18:52 -0000 1.28
+++ platform/win/hxaudevds.cpp 24 Jun 2005 22:12:24 -0000
@@ -114,10 +114,6 @@
const TCHAR* kDSDestroyMessage = TEXT("HX_DestroyDSWindowInternal");
const int BUFFER_TIME = 8;
-extern HXBOOL RMEnableLogging();
-extern void RMDSLog(const char* pFormatString, ...);
-#define RMDS_LOG RMDSLog
-
CHXAudioDeviceDS::CHXAudioDeviceDS():
m_bOpaqueFormat(FALSE)
, m_pWaveFormat(NULL)
@@ -651,7 +647,6 @@
if(res != DS_OK)
{
- RMDS_LOG(" Lock failed ulBufSize = %ld pAudioPtr1 = %ld ulAudioBytes1 = %ld
pAudioPtr2 = %ld ulAudioBytes2 = %ld \n", ulBufSize, pAudioPtr1, ulAudioBytes1,
pAudioPtr2, ulAudioBytes2);
return HXR_FAIL ;
}
@@ -691,7 +686,6 @@
res = m_pSecondaryBuffer->Unlock(pAudioPtr1, ulAudioBytes1, pAudioPtr2,
ulAudioBytes2);
if(res != DS_OK)
{
- RMDS_LOG(" Unlock failed ulBufSize = %ld pAudioPtr1 = %ld ulAudioBytes1 =
%ld pAudioPtr2 = %ld ulAudioBytes2 = %ld \n", ulBufSize, pAudioPtr1, ulAudioBytes1,
pAudioPtr2, ulAudioBytes2);
return HXR_FAIL ;
}
@@ -755,11 +749,6 @@
m_pSecondaryBuffer->Unlock(pAudioPtr1, ulAudioBytes1, pAudioPtr2,
ulAudioBytes2);
m_pSecondaryBuffer->SetCurrentPosition(0);
- RMDS_LOG("RESET \n \n \n \n");
- }
- else
- {
- RMDS_LOG(" Reset - Lock failed \n");
}
return HXR_OK;
@@ -793,7 +782,6 @@
{
if( (dwCurrentPlayCursor < m_ulLastPlayCursor) &&
((m_ulLastPlayCursor-dwCurrentPlayCursor) > (m_ulTotalBuffer/2)) )
{
- RMDS_LOG(" m_ulLastPlayCursor = %ld ; dwCurrentPlayCursor = %ld
\n", m_ulLastPlayCursor, dwCurrentPlayCursor);
m_ulLoops++;
m_ulCurrPlayTime = m_ulCurrLoopTime = (UINT32)
(m_ulLoopTime * 1000.0 * m_ulLoops);
m_ulLastPlayCursor = 0;
@@ -813,12 +801,6 @@
ulCurrentTime = m_ulCurrPlayTime;
}
- RMDS_LOG(" ulCurrentTime = %ld \n", ulCurrentTime);
-
- }
- else
- {
- RMDS_LOG(" GetCurrentPosition failed \n");
}
}
_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev