add hack to not play connect/disconnect sounds after resetting USB
This commit is contained in:
@@ -35,6 +35,8 @@ MemoryCardManager::MemoryCardManager()
|
|||||||
}
|
}
|
||||||
m_pDriver->GetStorageDevices( m_vStorageDevices );
|
m_pDriver->GetStorageDevices( m_vStorageDevices );
|
||||||
|
|
||||||
|
m_bDontPlaySoundsOnce = false;
|
||||||
|
|
||||||
m_soundReady.Load( THEME->GetPathToS("MemoryCardManager ready") );
|
m_soundReady.Load( THEME->GetPathToS("MemoryCardManager ready") );
|
||||||
m_soundError.Load( THEME->GetPathToS("MemoryCardManager error") );
|
m_soundError.Load( THEME->GetPathToS("MemoryCardManager error") );
|
||||||
m_soundTooLate.Load( THEME->GetPathToS("MemoryCardManager too late") );
|
m_soundTooLate.Load( THEME->GetPathToS("MemoryCardManager too late") );
|
||||||
@@ -248,6 +250,8 @@ match:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !m_bDontPlaySoundsOnce )
|
||||||
|
{
|
||||||
// play sound
|
// play sound
|
||||||
if( m_bWriteError[p] )
|
if( m_bWriteError[p] )
|
||||||
m_soundError.Play();
|
m_soundError.Play();
|
||||||
@@ -259,6 +263,9 @@ match:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_bDontPlaySoundsOnce = false;
|
||||||
|
}
|
||||||
|
|
||||||
void MemoryCardManager::FlushAndReset()
|
void MemoryCardManager::FlushAndReset()
|
||||||
{
|
{
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
@@ -271,6 +278,8 @@ void MemoryCardManager::FlushAndReset()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_pDriver->ResetUsbStorage(); // forces cards to be re-detected
|
m_pDriver->ResetUsbStorage(); // forces cards to be re-detected
|
||||||
|
|
||||||
|
m_bDontPlaySoundsOnce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MemoryCardManager::PathIsMemCard( CString sDir ) const
|
bool MemoryCardManager::PathIsMemCard( CString sDir ) const
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ protected:
|
|||||||
bool m_bWriteError[NUM_PLAYERS]; // couldn't write to the card
|
bool m_bWriteError[NUM_PLAYERS]; // couldn't write to the card
|
||||||
UsbStorageDevice m_Device[NUM_PLAYERS]; // device in the memory card slot, NULL if none
|
UsbStorageDevice m_Device[NUM_PLAYERS]; // device in the memory card slot, NULL if none
|
||||||
|
|
||||||
|
// don't play sounds on the first assign after resetting the driver
|
||||||
|
bool m_bDontPlaySoundsOnce;
|
||||||
|
|
||||||
RageSound m_soundReady;
|
RageSound m_soundReady;
|
||||||
RageSound m_soundError;
|
RageSound m_soundError;
|
||||||
RageSound m_soundTooLate;
|
RageSound m_soundTooLate;
|
||||||
|
|||||||
Reference in New Issue
Block a user