mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-10 06:34:22 +00:00
Fix problem setting pan to -1
This commit is contained in:
parent
c7df7506bc
commit
e9e13a3056
4 changed files with 8 additions and 8 deletions
|
@ -36,7 +36,7 @@
|
|||
bgmMenu:(NSMenu*)inMenu
|
||||
appVolumeView:(NSView*)inView;
|
||||
|
||||
// Pass -1 for initialVolume or initialPan to leave the volume/pan at its default level.
|
||||
// Pass -1 for initialVolume or INT_MAX for initialPan to leave the volume/pan at its default level.
|
||||
- (void) insertMenuItemForApp:(NSRunningApplication*)app
|
||||
initialVolume:(int)volume
|
||||
initialPan:(int)pan;
|
||||
|
|
|
@ -153,7 +153,7 @@ static NSString* const kMoreAppsMenuTitle = @"More Apps";
|
|||
- (BGMAppVolumeAndPan) getVolumeAndPanForApp:(NSRunningApplication*)app {
|
||||
BGMAppVolumeAndPan result = {
|
||||
.volume = -1,
|
||||
.pan = -1
|
||||
.pan = INT_MIN
|
||||
};
|
||||
|
||||
NSMenuItem *item = [self getMenuItemForApp:app];
|
||||
|
@ -191,7 +191,7 @@ static NSString* const kMoreAppsMenuTitle = @"More Apps";
|
|||
}
|
||||
|
||||
// Set the pan position.
|
||||
if (volumeAndPan.pan != -1 && [subview isKindOfClass:[BGMAVM_PanSlider class]]) {
|
||||
if (volumeAndPan.pan != INT_MIN && [subview isKindOfClass:[BGMAVM_PanSlider class]]) {
|
||||
[(BGMAVM_PanSlider*)subview setPanPosition:volumeAndPan.pan];
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ static NSString* const kMoreAppsMenuTitle = @"More Apps";
|
|||
}
|
||||
|
||||
// Set the pan position.
|
||||
if (pan != -1 && [subview isKindOfClass:[BGMAVM_PanSlider class]]) {
|
||||
if (pan != INT_MIN && [subview isKindOfClass:[BGMAVM_PanSlider class]]) {
|
||||
[(BGMAVM_PanSlider*)subview setPanPosition:pan];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,10 +106,10 @@
|
|||
|
||||
- (void) setVolumeAndPan:(BGMAppVolumeAndPan)volumeAndPan forApp:(NSRunningApplication*)app {
|
||||
[appVolumes setVolumeAndPan:volumeAndPan forApp:app];
|
||||
if (volumeAndPan.volume != -1) {
|
||||
if (volumeAndPan.volume != -1 {
|
||||
[self setVolume:volumeAndPan.volume forAppWithProcessID:app.processIdentifier bundleID:app.bundleIdentifier];
|
||||
}
|
||||
if (volumeAndPan.pan != -1) {
|
||||
if (volumeAndPan.pan != INT_MIN) {
|
||||
[self setPanPosition:volumeAndPan.pan forAppWithProcessID:app.processIdentifier bundleID:app.bundleIdentifier];
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@
|
|||
fromVolumes:(const CACFArray&)volumes {
|
||||
BGMAppVolumeAndPan volumeAndPan = {
|
||||
.volume = -1,
|
||||
.pan = -1
|
||||
.pan = INT_MIN
|
||||
};
|
||||
|
||||
for (UInt32 i = 0; i < volumes.GetNumberItems(); i++) {
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
- (void) setVolume:(int)vol {
|
||||
BGMAppVolumeAndPan volume = {
|
||||
.volume = vol,
|
||||
.pan = -1
|
||||
.pan = INT_MIN
|
||||
};
|
||||
[appVolumesController setVolumeAndPan:volume forApp:application];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue