mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-10 06:34:22 +00:00
Add a bundle ID property for apps in the AppleScript API.
This commit is contained in:
parent
c0a556be04
commit
213c339309
12 changed files with 27 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2016, 2017, 2020 Kyle Neideck
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
// Sets up and tears down the app.
|
||||
//
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2016-2020 Kyle Neideck
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
// Self Include
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2016, 2017 Kyle Neideck
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
// Local Includes
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
//
|
||||
// Copyright © 2016-2020 Kyle Neideck
|
||||
// Copyright © 2017 Andrew Tonner
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
// Self Include
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2017 Kyle Neideck
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
// Local Includes
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
//
|
||||
// Copyright © 2017, 2018 Kyle Neideck
|
||||
// Copyright © 2017 Andrew Tonner
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
// Self Include
|
||||
|
|
|
@ -92,7 +92,11 @@
|
|||
|
||||
+ (NSArray<id<BGMMusicPlayer>>*) createInstancesWithDefaults:(BGMUserDefaults*)userDefaults {
|
||||
#pragma unused (userDefaults)
|
||||
// TODO: Fix this warning properly.
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wobjc-literal-conversion"
|
||||
return @[ [self new] ];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (NSImage* __nullable) icon {
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2021 Marcus Wu
|
||||
// Copyright © 2021 Kyle Neideck
|
||||
//
|
||||
// An AppleScript class for volume and pan settings for running applications.
|
||||
//
|
||||
|
@ -41,6 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
index:(int)i;
|
||||
|
||||
@property (readonly) NSString* name;
|
||||
@property (readonly) NSString* bundleID;
|
||||
@property int volume;
|
||||
@property int pan;
|
||||
@end
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2021 Marcus Wu
|
||||
// Copyright © 2021 Kyle Neideck
|
||||
//
|
||||
|
||||
// Self Include
|
||||
|
@ -48,6 +49,10 @@
|
|||
return [NSString stringWithFormat:@"%@", [application localizedName]];
|
||||
}
|
||||
|
||||
- (NSString*) bundleID {
|
||||
return [NSString stringWithFormat:@"%@", [application bundleIdentifier]];
|
||||
}
|
||||
|
||||
- (int) volume {
|
||||
return [appVolumesController getVolumeAndPanForApp:application].volume;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,14 @@
|
|||
<cocoa key="name"/>
|
||||
</property>
|
||||
|
||||
<property name="bundleID"
|
||||
code="bdid"
|
||||
description="The bundle ID of the application, e.g. 'com.somecompany.coolapp'."
|
||||
type="text"
|
||||
access="r">
|
||||
<cocoa key="bundleID"/>
|
||||
</property>
|
||||
|
||||
<property name="vol"
|
||||
code="pVol"
|
||||
type="integer"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2017 Kyle Neideck
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
#import "BGMAppDelegate.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// BGMApp
|
||||
//
|
||||
// Copyright © 2017 Kyle Neideck
|
||||
// Copyright © 2021 Marcus Wu
|
||||
//
|
||||
|
||||
// Self Include
|
||||
|
|
Loading…
Reference in a new issue