Cocoa Port:

- Fix bug where the user can force activate the mic while the emulator is idle by manipulating its mute control.
- Fix bug where the mic icon remains black if the emulator resets while in execute.
- Further optimize mic icon updates.
This commit is contained in:
rogerman 2015-03-20 08:48:40 +00:00
parent 3088fd581e
commit b906b233c5
10 changed files with 88 additions and 3585 deletions

View File

@ -904,8 +904,6 @@ volatile bool execute = true;
[self setCoreState:CORESTATE_PAUSE];
[self applyDynaRec];
[self applySlot1Device];
[[self cdsController] resetMicLevel];
[[self cdsController] updateMicLevel];
pthread_mutex_lock(&threadParam.mutexThreadExecute);
NDS_Reset();
@ -913,7 +911,9 @@ volatile bool execute = true;
pthread_mutex_unlock(&threadParam.mutexThreadExecute);
[self restoreCoreState];
self.masterExecute = YES;
[self setMasterExecute:YES];
[[self cdsController] reset];
[[self cdsController] updateMicLevel];
}
- (NSUInteger) frameNumber
@ -1134,7 +1134,7 @@ static void* RunCoreThread(void *arg)
// Make sure that the mic level is updated at least once per frame, regardless
// of whether the NDS actually reads the mic or not.
[cdsController updateMicLevel];
[cdsController resetMicLevel];
[cdsController clearMicLevelMeasure];
pthread_mutex_lock(&param->mutexOutputList);

View File

@ -82,8 +82,7 @@ typedef struct
- (void) doMicLevelUpdateFromController:(CocoaDSController *)cdsController;
- (void) doMicHardwareStateChangedFromController:(CocoaDSController *)cdsController
isEnabled:(BOOL)isHardwareEnabled
isLocked:(BOOL)isHardwareLocked
isMuted:(BOOL)isHardwareMuted;
isLocked:(BOOL)isHardwareLocked;
- (void) doMicHardwareGainChangedFromController:(CocoaDSController *)cdsController gain:(float)gainValue;
@ -94,7 +93,7 @@ typedef struct
id <CocoaDSControllerDelegate> delegate;
float micLevel;
BOOL autohold;
BOOL isAutoholdCleared;
BOOL _isAutoholdCleared;
BOOL _useHardwareMic;
size_t _availableMicSamples;
std::vector<uint8_t> *_hwMicLevelList;
@ -145,14 +144,14 @@ typedef struct
- (void) clearAutohold;
- (void) flush;
- (void) flushEmpty;
- (void) reset;
- (void) resetMicLevel;
- (void) clearMicLevelMeasure;
- (void) updateMicLevel;
- (uint8_t) handleMicSampleRead:(CoreAudioInput *)caInput softwareMic:(AudioGenerator *)sampleGenerator;
- (void) handleMicHardwareStateChanged:(CoreAudioInputDeviceInfo *)deviceInfo
isEnabled:(BOOL)isHardwareEnabled
isLocked:(BOOL)isHardwareLocked
isMuted:(BOOL)isHardwareMuted;
isLocked:(BOOL)isHardwareLocked;
- (void) handleMicHardwareGainChanged:(float)gainValue;
@end
@ -167,7 +166,6 @@ uint8_t CASampleReadCallback(void *inParam1, void *inParam2);
void CAHardwareStateChangedCallback(CoreAudioInputDeviceInfo *deviceInfo,
const bool isHardwareEnabled,
const bool isHardwareLocked,
const bool isHardwareMuted,
void *inParam1,
void *inParam2);
void CAHardwareGainChangedCallback(float normalizedGain, void *inParam1, void *inParam2);

View File

@ -42,7 +42,7 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
@dynamic hardwareMicEnabled;
@dynamic hardwareMicLocked;
@dynamic hardwareMicGain;
@dynamic hardwareMicMute;
@synthesize hardwareMicMute;
@dynamic hardwareMicPause;
@dynamic softwareMicState;
@dynamic softwareMicMode;
@ -76,14 +76,14 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
delegate = nil;
spinlockControllerState = OS_SPINLOCK_INIT;
autohold = NO;
isAutoholdCleared = YES;
micLevel = 0.0f;
_isAutoholdCleared = YES;
_useHardwareMic = NO;
_availableMicSamples = 0;
_hwMicLevelList = new std::vector<uint8_t>;
_hwMicLevelList->reserve(1024);
_hwMicLevelList->clear();
micLevel = 0.0f;
micMode = MICMODE_NONE;
selectedAudioFileGenerator = NULL;
@ -161,20 +161,9 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
return CAInputDevice->GetGain();
}
- (void) setHardwareMicMute:(BOOL)isMicMuted
{
bool muteState = (isMicMuted) ? true : false;
CAInputDevice->SetMuteState(muteState);
}
- (BOOL) hardwareMicMute
{
return (CAInputDevice->GetMuteState()) ? YES : NO;
}
- (void) setHardwareMicPause:(BOOL)isMicPaused
{
bool pauseState = (isMicPaused) ? true : false;
bool pauseState = (isMicPaused || [self hardwareMicMute]) ? true : false;
CAInputDevice->SetPauseState(pauseState);
}
@ -219,10 +208,10 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
autohold = theState;
if (autohold && isAutoholdCleared)
if (autohold && _isAutoholdCleared)
{
memset(ndsInput, 0, sizeof(ndsInput));
isAutoholdCleared = NO;
_isAutoholdCleared = NO;
}
if (!autohold)
@ -295,10 +284,10 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
[self setAutohold:NO];
OSSpinLockLock(&spinlockControllerState);
if (!isAutoholdCleared)
if (!_isAutoholdCleared)
{
memset(ndsInput, 0, sizeof(ndsInput));
isAutoholdCleared = YES;
_isAutoholdCleared = YES;
}
OSSpinLockUnlock(&spinlockControllerState);
@ -510,7 +499,22 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
NDS_setMic(false);
}
- (void) resetMicLevel
- (void) reset
{
for (size_t i = 0; i < DSControllerState_StatesCount; i++)
{
memset(ndsInput, 0, sizeof(ndsInput));
}
[self setAutohold:NO];
[self setMicLevel:0.0f];
_isAutoholdCleared = YES;
_availableMicSamples = 0;
_hwMicLevelList->clear();
}
- (void) clearMicLevelMeasure
{
_hwMicLevelList->clear();
}
@ -576,7 +580,6 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
- (void) handleMicHardwareStateChanged:(CoreAudioInputDeviceInfo *)deviceInfo
isEnabled:(BOOL)isHardwareEnabled
isLocked:(BOOL)isHardwareLocked
isMuted:(BOOL)isHardwareMuted
{
if (deviceInfo->objectID == kAudioObjectUnknown)
{
@ -596,14 +599,14 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
[self setHardwareMicSampleRateString:[NSString stringWithFormat:@"%1.1f Hz", (double)deviceInfo->sampleRate]];
}
[self resetMicLevel];
[self clearMicLevelMeasure];
[self setMicLevel:0.0f];
if (delegate != nil && [delegate respondsToSelector:@selector(doMicHardwareStateChangedFromController:isEnabled:isLocked:isMuted:)])
if (delegate != nil && [delegate respondsToSelector:@selector(doMicHardwareStateChangedFromController:isEnabled:isLocked:)])
{
[[self delegate] doMicHardwareStateChangedFromController:self
isEnabled:isHardwareEnabled
isLocked:isHardwareLocked
isMuted:isHardwareMuted];
isLocked:isHardwareLocked];
}
}
@ -632,15 +635,13 @@ uint8_t CASampleReadCallback(void *inParam1, void *inParam2)
void CAHardwareStateChangedCallback(CoreAudioInputDeviceInfo *deviceInfo,
const bool isHardwareEnabled,
const bool isHardwareLocked,
const bool isHardwareMuted,
void *inParam1,
void *inParam2)
{
CocoaDSController *cdsController = (CocoaDSController *)inParam1;
[cdsController handleMicHardwareStateChanged:(CoreAudioInputDeviceInfo *)deviceInfo
isEnabled:((isHardwareEnabled) ? YES : NO)
isLocked:((isHardwareLocked) ? YES : NO)
isMuted:((isHardwareMuted) ? YES : NO)];
isLocked:((isHardwareLocked) ? YES : NO)];
}
void CAHardwareGainChangedCallback(float normalizedGain, void *inParam1, void *inParam2)

View File

@ -40,7 +40,6 @@ CoreAudioInput::CoreAudioInput()
_inputGainNormalized = 0.0f;
_inputElement = 0;
_isMuted = false;
_hwDeviceInfo.objectID = kAudioObjectUnknown;
_hwDeviceInfo.name = CFSTR("Unknown Device");
_hwDeviceInfo.manufacturer = CFSTR("Unknown Manufacturer");
@ -530,7 +529,6 @@ void CoreAudioInput::Start()
this->_hwStateChangedCallbackFunc(&this->_hwDeviceInfo,
this->IsHardwareEnabled(),
this->IsHardwareLocked(),
this->_isMuted,
this->_hwStateChangedCallbackParam1,
this->_hwStateChangedCallbackParam2);
}
@ -575,23 +573,6 @@ bool CoreAudioInput::IsHardwareLocked() const
return this->_isHardwareLocked;
}
bool CoreAudioInput::GetMuteState() const
{
return this->_isMuted;
}
void CoreAudioInput::SetMuteState(bool muteState)
{
this->_isMuted = muteState;
this->SetPauseState(muteState);
this->_hwStateChangedCallbackFunc(&this->_hwDeviceInfo,
this->IsHardwareEnabled(),
this->IsHardwareLocked(),
this->_isMuted,
this->_hwStateChangedCallbackParam1,
this->_hwStateChangedCallbackParam2);
}
bool CoreAudioInput::GetPauseState() const
{
return this->_isPaused;
@ -606,7 +587,7 @@ void CoreAudioInput::SetPauseState(bool pauseState)
OSSpinLockUnlock(this->_spinlockAUHAL);
AUGraphStop(this->_auGraph);
}
else if (!pauseState && this->GetPauseState() && !this->IsHardwareLocked() && !this->GetMuteState())
else if (!pauseState && this->GetPauseState() && !this->IsHardwareLocked())
{
OSSpinLockLock(this->_spinlockAUHAL);
AudioOutputUnitStart(this->_auHALInputDevice);
@ -614,7 +595,7 @@ void CoreAudioInput::SetPauseState(bool pauseState)
AUGraphStart(this->_auGraph);
}
this->_isPaused = (this->IsHardwareLocked() || this->GetMuteState()) ? true : pauseState;
this->_isPaused = (this->IsHardwareLocked()) ? true : pauseState;
}
float CoreAudioInput::GetGain() const
@ -711,7 +692,6 @@ void CoreAudioInput::UpdateHardwareLock()
this->_hwStateChangedCallbackFunc(&this->_hwDeviceInfo,
this->IsHardwareEnabled(),
this->IsHardwareLocked(),
this->_isMuted,
this->_hwStateChangedCallbackParam1,
this->_hwStateChangedCallbackParam2);
}
@ -856,7 +836,6 @@ void CoreAudioInputAUHALChanged(void *inRefCon,
void CoreAudioInputDefaultHardwareStateChangedCallback(CoreAudioInputDeviceInfo *deviceInfo,
const bool isHardwareEnabled,
const bool isHardwareLocked,
const bool isHardwareMuted,
void *inParam1,
void *inParam2)
{

View File

@ -39,7 +39,6 @@ typedef CoreAudioInputDeviceInfo CoreAudioInputDeviceInfo;
typedef void (*CoreAudioInputHardwareStateChangedCallback)(CoreAudioInputDeviceInfo *deviceInfo,
const bool isHardwareEnabled,
const bool isHardwareLocked,
const bool isHardwareMuted,
void *inParam1,
void *inParam2);
@ -73,7 +72,6 @@ private:
CoreAudioInputDeviceInfo _hwDeviceInfo;
bool _isHardwareEnabled;
bool _isHardwareLocked;
bool _isMuted;
OSStatus InitInputAUHAL(UInt32 deviceID);
@ -93,8 +91,6 @@ public:
bool IsHardwareEnabled() const;
bool IsHardwareLocked() const;
bool GetMuteState() const;
void SetMuteState(bool muteState);
bool GetPauseState() const;
void SetPauseState(bool pauseState);
float GetGain() const;
@ -173,7 +169,6 @@ OSStatus CoreAudioOutputRenderCallback(void *inRefCon,
void CoreAudioInputDefaultHardwareStateChangedCallback(CoreAudioInputDeviceInfo *deviceInfo,
const bool isHardwareEnabled,
const bool isHardwareLocked,
const bool isHardwareMuted,
void *inParam1,
void *inParam2);

View File

@ -284,7 +284,7 @@
<nil key="NSUserInterfaceItemIdentifier"/>
<string key="NSWindowContentMinSize">{256, 408}</string>
<object class="NSView" key="NSWindowView" id="1027645320">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSProgressIndicator" id="963885183">
@ -292,7 +292,6 @@
<int key="NSvFlags">5156</int>
<string key="NSFrame">{{2, 3}, {16, 16}}</string>
<reference key="NSSuperview" ref="1027645320"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="731708450"/>
<int key="NSpiFlags">28938</int>
<double key="NSMaxValue">100</double>
@ -302,7 +301,6 @@
<int key="NSvFlags">294</int>
<string key="NSFrame">{{17, 5}, {137, 14}}</string>
<reference key="NSSuperview" ref="1027645320"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="154157914"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="644649254">
@ -344,7 +342,6 @@
<array class="NSMutableArray" key="NSSubviews"/>
<string key="NSFrame">{{0, 24}, {256, 384}}</string>
<reference key="NSSuperview" ref="1027645320"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="963885183"/>
<bool key="NSViewCanDrawConcurrently">YES</bool>
<string key="NSClassName">DisplayView</string>
@ -354,8 +351,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{192, -1}, {40, 26}}</string>
<reference key="NSSuperview" ref="1027645320"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:791</string>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="1063916850">
@ -426,7 +421,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{151, -1}, {42, 26}}</string>
<reference key="NSSuperview" ref="1027645320"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="347607109"/>
<string key="NSReuseIdentifierKey">_NS:791</string>
<bool key="NSEnabled">YES</bool>
@ -487,8 +481,6 @@
</object>
</array>
<string key="NSFrameSize">{256, 408}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="740908585"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1177}}</string>
@ -621,7 +613,7 @@
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="545736283">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSButton" id="208921964">
@ -629,8 +621,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{2, 0}, {49, 18}}</string>
<reference key="NSSuperview" ref="545736283"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:682</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="169016076">
@ -661,7 +651,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{-3, 20}, {66, 11}}</string>
<reference key="NSSuperview" ref="545736283"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="208921964"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="30057499">
@ -736,7 +725,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 31}, {21, 105}}</string>
<reference key="NSSuperview" ref="545736283"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="261027162"/>
<string key="NSReuseIdentifierKey">_NS:768</string>
<bool key="NSEnabled">YES</bool>
@ -759,14 +747,12 @@
</object>
</array>
<string key="NSFrameSize">{55, 139}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="738109744"/>
<string key="NSReuseIdentifierKey">_NS:1109</string>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="552471306">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="1023402314">
@ -774,8 +760,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{-1, 6}, {51, 11}}</string>
<reference key="NSSuperview" ref="552471306"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="999175719">
<int key="NSCellFlags">68157504</int>
@ -836,7 +820,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{12, 17}, {21, 105}}</string>
<reference key="NSSuperview" ref="552471306"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1023402314"/>
<string key="NSReuseIdentifierKey">_NS:768</string>
<bool key="NSEnabled">YES</bool>
@ -859,8 +842,6 @@
</object>
</array>
<string key="NSFrameSize">{45, 125}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="782084649"/>
<string key="NSReuseIdentifierKey">_NS:1109</string>
<string key="NSClassName">NSView</string>
@ -1004,6 +985,14 @@
</object>
<int key="connectionID">207</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">changeHardwareMicMute:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="208921964"/>
</object>
<int key="connectionID">233</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
@ -1806,539 +1795,9 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">232</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">DisplayView</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="225754194">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../userinterface/DisplayWindowController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">DisplayWindowController</string>
<string key="superclassName">NSWindowController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="changeCoreSpeed:">id</string>
<string key="changeDisplayGap:">id</string>
<string key="changeDisplayMode:">id</string>
<string key="changeDisplayOrder:">id</string>
<string key="changeDisplayOrientation:">id</string>
<string key="changeHardwareMicGain:">id</string>
<string key="changeRotation:">id</string>
<string key="changeRotationRelative:">id</string>
<string key="changeScale:">id</string>
<string key="changeVideoOutputFilter:">id</string>
<string key="changeVideoPixelScaler:">id</string>
<string key="changeVolume:">id</string>
<string key="copy:">id</string>
<string key="openRom:">id</string>
<string key="reset:">id</string>
<string key="saveScreenshotAs:">id</string>
<string key="toggleExecutePause:">id</string>
<string key="toggleFullScreenDisplay:">id</string>
<string key="toggleKeepMinDisplaySizeAtNormal:">id</string>
<string key="toggleStatusBar:">id</string>
<string key="toggleVideoSourceDeposterize:">id</string>
<string key="writeDefaultsDisplayGap:">id</string>
<string key="writeDefaultsDisplayRotation:">id</string>
<string key="writeDefaultsDisplayVideoSettings:">id</string>
<string key="writeDefaultsHUDSettings:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="changeCoreSpeed:">
<string key="name">changeCoreSpeed:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayGap:">
<string key="name">changeDisplayGap:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayMode:">
<string key="name">changeDisplayMode:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayOrder:">
<string key="name">changeDisplayOrder:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayOrientation:">
<string key="name">changeDisplayOrientation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeHardwareMicGain:">
<string key="name">changeHardwareMicGain:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeRotation:">
<string key="name">changeRotation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeRotationRelative:">
<string key="name">changeRotationRelative:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeScale:">
<string key="name">changeScale:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeVideoOutputFilter:">
<string key="name">changeVideoOutputFilter:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeVideoPixelScaler:">
<string key="name">changeVideoPixelScaler:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeVolume:">
<string key="name">changeVolume:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="copy:">
<string key="name">copy:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="openRom:">
<string key="name">openRom:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="reset:">
<string key="name">reset:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveScreenshotAs:">
<string key="name">saveScreenshotAs:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleExecutePause:">
<string key="name">toggleExecutePause:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleFullScreenDisplay:">
<string key="name">toggleFullScreenDisplay:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleKeepMinDisplaySizeAtNormal:">
<string key="name">toggleKeepMinDisplaySizeAtNormal:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleStatusBar:">
<string key="name">toggleStatusBar:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleVideoSourceDeposterize:">
<string key="name">toggleVideoSourceDeposterize:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsDisplayGap:">
<string key="name">writeDefaultsDisplayGap:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsDisplayRotation:">
<string key="name">writeDefaultsDisplayRotation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsDisplayVideoSettings:">
<string key="name">writeDefaultsDisplayVideoSettings:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsHUDSettings:">
<string key="name">writeDefaultsHUDSettings:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="microphoneGainControlView">NSView</string>
<string key="microphoneGainMenuItem">NSMenuItem</string>
<string key="microphoneGainSlider">NSSlider</string>
<string key="microphoneMuteButton">NSButton</string>
<string key="outputVolumeControlView">NSView</string>
<string key="outputVolumeMenuItem">NSMenuItem</string>
<string key="saveScreenshotPanelAccessoryView">NSView</string>
<string key="view">DisplayView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="microphoneGainControlView">
<string key="name">microphoneGainControlView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="microphoneGainMenuItem">
<string key="name">microphoneGainMenuItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo" key="microphoneGainSlider">
<string key="name">microphoneGainSlider</string>
<string key="candidateClassName">NSSlider</string>
</object>
<object class="IBToOneOutletInfo" key="microphoneMuteButton">
<string key="name">microphoneMuteButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="outputVolumeControlView">
<string key="name">outputVolumeControlView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="outputVolumeMenuItem">
<string key="name">outputVolumeMenuItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo" key="saveScreenshotPanelAccessoryView">
<string key="name">saveScreenshotPanelAccessoryView</string>
<string key="candidateClassName">NSView</string>
</object>
<object class="IBToOneOutletInfo" key="view">
<string key="name">view</string>
<string key="candidateClassName">DisplayView</string>
</object>
</dictionary>
<reference key="sourceIdentifier" ref="225754194"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">DisplayWindowController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="changeCoreSpeed:">id</string>
<string key="changeDisplayGap:">id</string>
<string key="changeDisplayMode:">id</string>
<string key="changeDisplayOrder:">id</string>
<string key="changeDisplayOrientation:">id</string>
<string key="changeHardwareMicGain:">id</string>
<string key="changeRotation:">id</string>
<string key="changeRotationRelative:">id</string>
<string key="changeScale:">id</string>
<string key="changeVideoOutputFilter:">id</string>
<string key="changeVideoPixelScaler:">id</string>
<string key="changeVolume:">id</string>
<string key="copy:">id</string>
<string key="openRom:">id</string>
<string key="reset:">id</string>
<string key="saveScreenshotAs:">id</string>
<string key="toggleExecutePause:">id</string>
<string key="toggleFullScreenDisplay:">id</string>
<string key="toggleKeepMinDisplaySizeAtNormal:">id</string>
<string key="toggleStatusBar:">id</string>
<string key="toggleVideoSourceDeposterize:">id</string>
<string key="writeDefaultsDisplayGap:">id</string>
<string key="writeDefaultsDisplayRotation:">id</string>
<string key="writeDefaultsDisplayVideoSettings:">id</string>
<string key="writeDefaultsHUDSettings:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="changeCoreSpeed:">
<string key="name">changeCoreSpeed:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayGap:">
<string key="name">changeDisplayGap:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayMode:">
<string key="name">changeDisplayMode:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayOrder:">
<string key="name">changeDisplayOrder:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeDisplayOrientation:">
<string key="name">changeDisplayOrientation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeHardwareMicGain:">
<string key="name">changeHardwareMicGain:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeRotation:">
<string key="name">changeRotation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeRotationRelative:">
<string key="name">changeRotationRelative:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeScale:">
<string key="name">changeScale:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeVideoOutputFilter:">
<string key="name">changeVideoOutputFilter:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeVideoPixelScaler:">
<string key="name">changeVideoPixelScaler:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="changeVolume:">
<string key="name">changeVolume:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="copy:">
<string key="name">copy:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="openRom:">
<string key="name">openRom:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="reset:">
<string key="name">reset:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveScreenshotAs:">
<string key="name">saveScreenshotAs:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleExecutePause:">
<string key="name">toggleExecutePause:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleFullScreenDisplay:">
<string key="name">toggleFullScreenDisplay:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleKeepMinDisplaySizeAtNormal:">
<string key="name">toggleKeepMinDisplaySizeAtNormal:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleStatusBar:">
<string key="name">toggleStatusBar:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleVideoSourceDeposterize:">
<string key="name">toggleVideoSourceDeposterize:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsDisplayGap:">
<string key="name">writeDefaultsDisplayGap:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsDisplayRotation:">
<string key="name">writeDefaultsDisplayRotation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsDisplayVideoSettings:">
<string key="name">writeDefaultsDisplayVideoSettings:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="writeDefaultsHUDSettings:">
<string key="name">writeDefaultsHUDSettings:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../userinterface/DisplayWindowController.mm</string>
</object>
</object>
</array>
<array class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<object class="IBPartialClassDescription">
<string key="className">NSActionCell</string>
<string key="superclassName">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSButton</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSButtonCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSCell</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSFormatter</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenu</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenuItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenuItemCell</string>
<string key="superclassName">NSButtonCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenuItemCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSNumberFormatter</string>
<string key="superclassName">NSFormatter</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSNumberFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSPopUpButton</string>
<string key="superclassName">NSButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPopUpButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSPopUpButtonCell</string>
<string key="superclassName">NSMenuItemCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPopUpButtonCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSProgressIndicator</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSSlider</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSlider.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSSliderCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSliderCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextField</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextFieldCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSToolbar</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSToolbarItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindowController</string>
<string key="superclassName">NSResponder</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showWindow:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showWindow:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showWindow:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
</object>
</object>
</array>
<int key="maxID">233</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">NO</bool>

File diff suppressed because it is too large Load Diff

View File

@ -719,6 +719,11 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
[emuControl changeHardwareMicGain:sender];
}
- (IBAction) changeHardwareMicMute:(id)sender
{
[emuControl changeHardwareMicMute:sender];
}
- (IBAction) changeVolume:(id)sender
{
[emuControl changeVolume:sender];

View File

@ -215,6 +215,7 @@ class AudioSampleBlockGenerator;
- (IBAction) changeCoreEmuFlags:(id)sender;
- (IBAction) changeFirmwareSettings:(id)sender;
- (IBAction) changeHardwareMicGain:(id)sender;
- (IBAction) changeHardwareMicMute:(id)sender;
- (IBAction) changeVolume:(id)sender;
- (IBAction) changeAudioEngine:(id)sender;
- (IBAction) changeSpuAdvancedLogic:(id)sender;

View File

@ -845,6 +845,15 @@
[[cdsCore cdsController] setHardwareMicGain:([self currentMicGainValue]/100.0f)];
}
- (IBAction) changeHardwareMicMute:(id)sender
{
const BOOL muteState = [CocoaDSUtil getIBActionSenderButtonStateBool:sender];
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
[[cdsCore cdsController] setHardwareMicMute:muteState];
[[cdsCore cdsController] setHardwareMicPause:([cdsCore coreState] != CORESTATE_EXECUTE)];
[self updateMicStatusIcon];
}
- (IBAction) changeVolume:(id)sender
{
const float vol = [self currentVolumeValue];
@ -1050,7 +1059,6 @@
const NSInteger micMode = cmdAttr.intValue[1];
[cdsController setSoftwareMicState:theState];
[cdsController setSoftwareMicMode:micMode];
//[self updateMicStatusIcon];
const float sineWaveFrequency = cmdAttr.floatValue[0];
[cdsController setSineWaveGeneratorFrequency:sineWaveFrequency];
@ -1876,7 +1884,7 @@
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
[cdsCore setSlot1StatusText:NSSTRING_STATUS_EMULATION_NOT_RUNNING];
[[cdsCore cdsController] resetMicLevel];
[[cdsCore cdsController] reset];
[[cdsCore cdsController] updateMicLevel];
result = YES;
@ -1926,9 +1934,9 @@
- (void) updateMicStatusIcon
{
NSImage *micIcon = iconMicDisabled;
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
CocoaDSController *cdsController = [cdsCore cdsController];
NSImage *micIcon = iconMicDisabled;
if ([self isSoftwareMicActive])
{
@ -1953,8 +1961,11 @@
}
}
if (micIcon != [self currentMicStatusIcon])
{
[self performSelectorOnMainThread:@selector(setCurrentMicStatusIcon:) withObject:micIcon waitUntilDone:NO];
}
}
- (AudioSampleBlockGenerator *) selectedAudioFileGenerator
{
@ -2464,51 +2475,15 @@
- (void) doMicLevelUpdateFromController:(CocoaDSController *)cdsController
{
BOOL needsUpdate = NO;
const BOOL controllerSoftwareMicState = [cdsController softwareMicState];
const BOOL isEmuSoftwareMicActive = [self isSoftwareMicActive];
// Check if the software mic state transitioned.
if (( controllerSoftwareMicState && !isEmuSoftwareMicActive) ||
(!controllerSoftwareMicState && isEmuSoftwareMicActive))
{
[self setIsSoftwareMicActive:controllerSoftwareMicState];
needsUpdate = YES;
}
// If we're reading the hardware mic, then check the sample value and make
// sure to check the mic's level state.
if (!controllerSoftwareMicState)
{
const BOOL isIdleHardware = [cdsController isHardwareMicIdle];
const BOOL isIdleEmuControl = [self isHardwareMicIdle];
if (( isIdleHardware && !isIdleEmuControl) ||
(!isIdleHardware && isIdleEmuControl))
{
[self setIsHardwareMicIdle:isIdleHardware];
needsUpdate = YES;
}
const BOOL isClipHardware = [cdsController isHardwareMicInClip];
const BOOL isClipEmuControl = [self isHardwareMicInClip];
if (( isClipHardware && !isClipEmuControl) ||
(!isClipHardware && isClipEmuControl))
{
[self setIsHardwareMicInClip:isClipHardware];
needsUpdate = YES;
}
}
if (needsUpdate)
{
[self setIsSoftwareMicActive:[cdsController softwareMicState]];
[self setIsHardwareMicIdle:[cdsController isHardwareMicIdle]];
[self setIsHardwareMicInClip:[cdsController isHardwareMicInClip]];
[self updateMicStatusIcon];
}
}
- (void) doMicHardwareStateChangedFromController:(CocoaDSController *)cdsController
isEnabled:(BOOL)isHardwareEnabled
isLocked:(BOOL)isHardwareLocked
isMuted:(BOOL)isHardwareMuted
{
const BOOL hwMicAvailable = (isHardwareEnabled && !isHardwareLocked);
[self setIsHardwareMicAvailable:hwMicAvailable];