some cleanup: remove unnecessary GUI messages (they are not used because we only have callback based sound interfaces right now)
This commit is contained in:
parent
2980c195a4
commit
e9a5962ef1
3 changed files with 6 additions and 41 deletions
|
@ -1178,8 +1178,6 @@ void CClientDlg::customEvent ( QEvent* Event )
|
||||||
|
|
||||||
switch ( iMessType )
|
switch ( iMessType )
|
||||||
{
|
{
|
||||||
case MS_SOUND_IN:
|
|
||||||
case MS_SOUND_OUT:
|
|
||||||
case MS_JIT_BUF_PUT:
|
case MS_JIT_BUF_PUT:
|
||||||
case MS_JIT_BUF_GET:
|
case MS_JIT_BUF_GET:
|
||||||
// buffer status -> if any buffer goes red, this LED will go red
|
// buffer status -> if any buffer goes red, this LED will go red
|
||||||
|
|
11
src/global.h
11
src/global.h
|
@ -262,13 +262,10 @@ typedef unsigned char uint8_t;
|
||||||
|
|
||||||
/* Definitions for window message system ------------------------------------ */
|
/* Definitions for window message system ------------------------------------ */
|
||||||
typedef unsigned int _MESSAGE_IDENT;
|
typedef unsigned int _MESSAGE_IDENT;
|
||||||
#define MS_RESET_ALL 0 // MS: Message
|
#define MS_RESET_ALL 0 // MS: Message
|
||||||
#define MS_SOUND_IN 1
|
#define MS_JIT_BUF_PUT 1
|
||||||
#define MS_SOUND_OUT 2
|
#define MS_JIT_BUF_GET 2
|
||||||
#define MS_JIT_BUF_PUT 3
|
#define MS_PACKET_RECEIVED 3
|
||||||
#define MS_JIT_BUF_GET 4
|
|
||||||
#define MS_PACKET_RECEIVED 5
|
|
||||||
#define MS_ERROR_IN_THREAD 6
|
|
||||||
|
|
||||||
#define MUL_COL_LED_RED 0
|
#define MUL_COL_LED_RED 0
|
||||||
#define MUL_COL_LED_YELLOW 1
|
#define MUL_COL_LED_YELLOW 1
|
||||||
|
|
|
@ -82,47 +82,17 @@ void CSoundBase::Stop()
|
||||||
|
|
||||||
void CSoundBase::run()
|
void CSoundBase::run()
|
||||||
{
|
{
|
||||||
// Set thread priority (The working thread should have a higher
|
|
||||||
// priority than the GUI)
|
|
||||||
#ifdef _WIN32
|
|
||||||
SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL );
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
// set the process to realtime privs, taken from
|
|
||||||
// "http://www.gardena.net/benno/linux/audio" but does not seem to work,
|
|
||||||
// maybe a problem with user rights
|
|
||||||
struct sched_param schp;
|
|
||||||
memset ( &schp, 0, sizeof ( schp ) );
|
|
||||||
schp.sched_priority = sched_get_priority_max ( SCHED_FIFO );
|
|
||||||
sched_setscheduler ( 0, SCHED_FIFO, &schp );
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// main loop of working thread
|
// main loop of working thread
|
||||||
while ( bRun )
|
while ( bRun )
|
||||||
{
|
{
|
||||||
// get audio from sound card (blocking function)
|
// get audio from sound card (blocking function)
|
||||||
if ( Read ( vecsAudioSndCrdStereo ) )
|
Read ( vecsAudioSndCrdStereo );
|
||||||
{
|
|
||||||
PostWinMessage ( MS_SOUND_IN, MUL_COL_LED_RED );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PostWinMessage ( MS_SOUND_IN, MUL_COL_LED_GREEN );
|
|
||||||
}
|
|
||||||
|
|
||||||
// process audio data
|
// process audio data
|
||||||
(*fpProcessCallback) ( vecsAudioSndCrdStereo, pProcessCallbackArg );
|
(*fpProcessCallback) ( vecsAudioSndCrdStereo, pProcessCallbackArg );
|
||||||
|
|
||||||
// play the new block
|
// play the new block
|
||||||
if ( Write ( vecsAudioSndCrdStereo ) )
|
Write ( vecsAudioSndCrdStereo );
|
||||||
{
|
|
||||||
PostWinMessage ( MS_SOUND_OUT, MUL_COL_LED_RED );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PostWinMessage ( MS_SOUND_OUT, MUL_COL_LED_GREEN );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue