mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-10 06:34:22 +00:00
Add auto-pause support for Swinsian. See #141.
This commit is contained in:
parent
7171cfcb78
commit
ed06a257a8
13 changed files with 420 additions and 16 deletions
|
@ -51,6 +51,9 @@
|
|||
1C837DD91F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C837DD71F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.mm */; };
|
||||
1C837DDA1F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C837DD71F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.mm */; };
|
||||
1C86DA6A1F91EE3B000C8CCF /* CAPThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C8034C21BDAFD5700668E00 /* CAPThread.cpp */; };
|
||||
1C8D8304204238DB00A838F2 /* BGMSwinsian.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C8D8302204238DB00A838F2 /* BGMSwinsian.m */; };
|
||||
1C8D830520423E1C00A838F2 /* BGMSwinsian.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C8D8302204238DB00A838F2 /* BGMSwinsian.m */; };
|
||||
1C8D830620423E2400A838F2 /* BGMSwinsian.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C8D8302204238DB00A838F2 /* BGMSwinsian.m */; };
|
||||
1CACCF391F3175AD007F86CA /* BGMBackgroundMusicDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CACCF371F3175AD007F86CA /* BGMBackgroundMusicDevice.cpp */; };
|
||||
1CACCF3A1F334447007F86CA /* BGMBackgroundMusicDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CACCF371F3175AD007F86CA /* BGMBackgroundMusicDevice.cpp */; };
|
||||
1CACCF3B1F334450007F86CA /* BGMBackgroundMusicDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CACCF371F3175AD007F86CA /* BGMBackgroundMusicDevice.cpp */; };
|
||||
|
@ -259,6 +262,9 @@
|
|||
1C8034C31BDAFD5700668E00 /* CAPThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAPThread.h; path = PublicUtility/CAPThread.h; sourceTree = "<group>"; };
|
||||
1C837DD61F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGMOutputVolumeMenuItem.h; sourceTree = "<group>"; };
|
||||
1C837DD71F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BGMOutputVolumeMenuItem.mm; sourceTree = "<group>"; };
|
||||
1C8D8301204238DB00A838F2 /* Swinsian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Swinsian.h; path = "Music Players/Swinsian.h"; sourceTree = "<group>"; };
|
||||
1C8D8302204238DB00A838F2 /* BGMSwinsian.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BGMSwinsian.m; path = "Music Players/BGMSwinsian.m"; sourceTree = "<group>"; };
|
||||
1C8D8303204238DB00A838F2 /* BGMSwinsian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BGMSwinsian.h; path = "Music Players/BGMSwinsian.h"; sourceTree = "<group>"; };
|
||||
1CACCF371F3175AD007F86CA /* BGMBackgroundMusicDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BGMBackgroundMusicDevice.cpp; sourceTree = "<group>"; };
|
||||
1CACCF381F3175AD007F86CA /* BGMBackgroundMusicDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGMBackgroundMusicDevice.h; sourceTree = "<group>"; };
|
||||
1CB8B3361BBA75EF000E2DD1 /* Background Music.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Background Music.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
@ -493,6 +499,8 @@
|
|||
1C2336DE1BEAE10C004C1C4E /* BGMSpotify.m */,
|
||||
279F48751DD6D73900768A85 /* BGMHermes.h */,
|
||||
279F48761DD6D73900768A85 /* BGMHermes.m */,
|
||||
1C8D8303204238DB00A838F2 /* BGMSwinsian.h */,
|
||||
1C8D8302204238DB00A838F2 /* BGMSwinsian.m */,
|
||||
27379B881C7C562D0084A24C /* BGMVLC.h */,
|
||||
27379B891C7C562D0084A24C /* BGMVLC.m */,
|
||||
273F10DD1CC3D0B900C1C6DA /* BGMVOX.h */,
|
||||
|
@ -657,9 +665,10 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
27F7D4911D2484A300821C4B /* Decibel.h */,
|
||||
279F48781DD6D94000768A85 /* Hermes.h */,
|
||||
27379B851C7C54870084A24C /* iTunes.h */,
|
||||
27379B861C7C54870084A24C /* Spotify.h */,
|
||||
279F48781DD6D94000768A85 /* Hermes.h */,
|
||||
1C8D8301204238DB00A838F2 /* Swinsian.h */,
|
||||
27379B871C7C552A0084A24C /* VLC.h */,
|
||||
273F10DC1CC3CF9C00C1C6DA /* VOX.h */,
|
||||
);
|
||||
|
@ -972,6 +981,7 @@
|
|||
1C837DD81F6AA1F2004B1E60 /* BGMOutputVolumeMenuItem.mm in Sources */,
|
||||
1C1963011BCAC0F6008A4DF7 /* CACFString.cpp in Sources */,
|
||||
1C1962E71BC94E91008A4DF7 /* BGMPlayThrough.cpp in Sources */,
|
||||
1C8D8304204238DB00A838F2 /* BGMSwinsian.m in Sources */,
|
||||
1C1962FA1BCAC061008A4DF7 /* CADebugMacros.cpp in Sources */,
|
||||
27FB8C2F1DE468320084DB9D /* BGM_Utils.cpp in Sources */,
|
||||
1C1962F31BCABFC5008A4DF7 /* CAHALAudioDevice.cpp in Sources */,
|
||||
|
@ -988,6 +998,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1C8D830520423E1C00A838F2 /* BGMSwinsian.m in Sources */,
|
||||
1CACCF3A1F334447007F86CA /* BGMBackgroundMusicDevice.cpp in Sources */,
|
||||
1C780FF31FEF6C3B00497FAD /* BGMSystemSoundsVolume.mm in Sources */,
|
||||
1CC6593D1F91DEB400B0CCDC /* BGMTermination.mm in Sources */,
|
||||
|
@ -1071,6 +1082,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1C8D830620423E2400A838F2 /* BGMSwinsian.m in Sources */,
|
||||
1C227C0B1FA4C48200A95B6D /* BGMAppVolumes.m in Sources */,
|
||||
1CEACF4D1F34793700FEC143 /* CAHALAudioDevice.cpp in Sources */,
|
||||
1CACCF3B1F334450007F86CA /* BGMBackgroundMusicDevice.cpp in Sources */,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -40,7 +40,7 @@
|
|||
BGMScriptingBridge* scriptingBridge;
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
- (instancetype) init {
|
||||
if ((self = [super initWithMusicPlayerID:[BGMMusicPlayerBase makeID:@"A9790CD5-4886-47C7-9FFC-DD70743CF2BF"]
|
||||
name:@"Decibel"
|
||||
bundleID:@"org.sbooth.Decibel"])) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -39,7 +39,7 @@
|
|||
BGMScriptingBridge* scriptingBridge;
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
- (instancetype) init {
|
||||
// If you're copying this class, replace the ID string with a new one generated by uuidgen. (Command line tool.)
|
||||
if ((self = [super initWithMusicPlayerID:[BGMMusicPlayerBase makeID:@"0CDC67B0-56D3-4D94-BC06-6E380D8F5E34"]
|
||||
name:@"Hermes"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#import "BGMMusicPlayer.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#import "BGMVOX.h"
|
||||
#import "BGMDecibel.h"
|
||||
#import "BGMHermes.h"
|
||||
#import "BGMSwinsian.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -54,7 +55,8 @@
|
|||
[BGMSpotify class],
|
||||
[BGMiTunes class],
|
||||
[BGMDecibel class],
|
||||
[BGMHermes class] ]
|
||||
[BGMHermes class],
|
||||
[BGMSwinsian class] ]
|
||||
userDefaults:defaults];
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -42,7 +42,7 @@
|
|||
BGMScriptingBridge* scriptingBridge;
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
- (instancetype) init {
|
||||
// If you're copying this class, replace the ID string with a new one generated by uuidgen. (Command line tool.)
|
||||
if ((self = [super initWithMusicPlayerID:[BGMMusicPlayerBase makeID:@"EC2A907F-8515-4687-9570-1BF63176E6D8"]
|
||||
name:@"Spotify"
|
||||
|
|
34
BGMApp/BGMApp/Music Players/BGMSwinsian.h
Normal file
34
BGMApp/BGMApp/Music Players/BGMSwinsian.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
// This file is part of Background Music.
|
||||
//
|
||||
// Background Music is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Background Music is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Background Music. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//
|
||||
// BGMSwinsian.h
|
||||
// BGMApp
|
||||
//
|
||||
// Copyright © 2018 Kyle Neideck
|
||||
//
|
||||
|
||||
// Superclass/Protocol Import
|
||||
#import "BGMMusicPlayer.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
||||
@interface BGMSwinsian : BGMMusicPlayerBase<BGMMusicPlayer>
|
||||
|
||||
@end
|
||||
|
||||
#pragma clang assume_nonnull end
|
||||
|
104
BGMApp/BGMApp/Music Players/BGMSwinsian.m
Normal file
104
BGMApp/BGMApp/Music Players/BGMSwinsian.m
Normal file
|
@ -0,0 +1,104 @@
|
|||
// This file is part of Background Music.
|
||||
//
|
||||
// Background Music is free software: you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 2 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// Background Music is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Background Music. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//
|
||||
// BGMSwinsian.m
|
||||
// BGMApp
|
||||
//
|
||||
// Copyright © 2018 Kyle Neideck
|
||||
//
|
||||
|
||||
// Self Include
|
||||
#import "BGMSwinsian.h"
|
||||
|
||||
// Auto-generated Scripting Bridge header
|
||||
#import "Swinsian.h"
|
||||
|
||||
// Local Includes
|
||||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
||||
@implementation BGMSwinsian {
|
||||
BGMScriptingBridge* scriptingBridge;
|
||||
}
|
||||
|
||||
- (instancetype) init {
|
||||
// If you're copying this class, replace the ID string with a new one generated by uuidgen (the
|
||||
// command line tool).
|
||||
NSUUID* musicPlayerID = [BGMMusicPlayerBase makeID:@"B74D18F6-DFF7-4D88-B719-429CFF98CFFA"];
|
||||
|
||||
if ((self = [super initWithMusicPlayerID:musicPlayerID
|
||||
name:@"Swinsian"
|
||||
bundleID:@"com.swinsian.Swinsian"])) {
|
||||
scriptingBridge = [[BGMScriptingBridge alloc] initWithBundleID:(NSString*)self.bundleID];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (SwinsianApplication* __nullable) swinsian {
|
||||
return (SwinsianApplication* __nullable)scriptingBridge.application;
|
||||
}
|
||||
|
||||
- (BOOL) isRunning {
|
||||
// Note that this will return NO if is self.swinsian is nil (i.e. Swinsian isn't running).
|
||||
return self.swinsian.running;
|
||||
}
|
||||
|
||||
// isPlaying and isPaused check self.running first just in case Swinsian is closed but self.swinsian
|
||||
// hasn't become nil yet. In that case, reading self.swinsian.playerState could make Scripting
|
||||
// Bridge open Swinsian.
|
||||
|
||||
- (BOOL) isPlaying {
|
||||
return self.running && (self.swinsian.playerState == SwinsianPlayerStatePlaying);
|
||||
}
|
||||
|
||||
- (BOOL) isPaused {
|
||||
return self.running && (self.swinsian.playerState == SwinsianPlayerStatePaused);
|
||||
}
|
||||
|
||||
- (BOOL) pause {
|
||||
// isPlaying checks isRunning, so we don't need to check it here and waste an Apple event.
|
||||
BOOL wasPlaying = self.playing;
|
||||
|
||||
if (wasPlaying) {
|
||||
DebugMsg("BGMSwinsian::pause: Pausing Swinsian");
|
||||
[self.swinsian pause];
|
||||
}
|
||||
|
||||
return wasPlaying;
|
||||
}
|
||||
|
||||
- (BOOL) unpause {
|
||||
// isPaused checks isRunning, so we don't need to check it here and waste an Apple event.
|
||||
BOOL wasPaused = self.paused;
|
||||
|
||||
if (wasPaused) {
|
||||
DebugMsg("BGMSwinsian::unpause: Unpausing Swinsian");
|
||||
[self.swinsian play];
|
||||
}
|
||||
|
||||
return wasPaused;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma clang assume_nonnull end
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -40,7 +40,7 @@
|
|||
BGMScriptingBridge* scriptingBridge;
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
- (instancetype) init {
|
||||
if ((self = [super initWithMusicPlayerID:[BGMMusicPlayerBase makeID:@"5226F4B9-C740-4045-A273-4B8EABC0E8FC"]
|
||||
name:@"VLC"
|
||||
bundleID:@"org.videolan.vlc"])) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -39,7 +39,7 @@
|
|||
BGMScriptingBridge* scriptingBridge;
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
- (instancetype) init {
|
||||
if ((self = [super initWithMusicPlayerID:[BGMMusicPlayerBase makeID:@"26498C5D-C18B-4689-8B41-9DA91A78FFAD"]
|
||||
name:@"VOX"
|
||||
bundleID:@"com.coppertino.Vox"])) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#import "BGMScriptingBridge.h"
|
||||
|
||||
// PublicUtility Includes
|
||||
#include "CADebugMacros.h"
|
||||
#import "CADebugMacros.h"
|
||||
|
||||
|
||||
#pragma clang assume_nonnull begin
|
||||
|
@ -45,7 +45,7 @@
|
|||
return (NSUUID*)musicPlayerID;
|
||||
}
|
||||
|
||||
- (id) init {
|
||||
- (instancetype) init {
|
||||
if ((self = [super initWithMusicPlayerID:[BGMiTunes sharedMusicPlayerID]
|
||||
name:@"iTunes"
|
||||
bundleID:@"com.apple.iTunes"])) {
|
||||
|
|
252
BGMApp/BGMApp/Music Players/Swinsian.h
Normal file
252
BGMApp/BGMApp/Music Players/Swinsian.h
Normal file
|
@ -0,0 +1,252 @@
|
|||
/*
|
||||
* Swinsian.h
|
||||
*
|
||||
* Generated with
|
||||
* sdef /Applications/Swinsian.app | sdp -fh --basename Swinsian
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <ScriptingBridge/ScriptingBridge.h>
|
||||
|
||||
|
||||
@class SwinsianItem, SwinsianColor, SwinsianWindow, SwinsianApplication, SwinsianPlaylist, SwinsianLibrary, SwinsianTrack, SwinsianLibraryTrack, SwinsianIPodTrack, SwinsianQueue, SwinsianSmartPlaylist, SwinsianNormalPlaylist, SwinsianPlaylistFolder, SwinsianAudioDevice;
|
||||
|
||||
enum SwinsianSaveOptions {
|
||||
SwinsianSaveOptionsYes = 'yes ' /* Save the file. */,
|
||||
SwinsianSaveOptionsNo = 'no ' /* Do not save the file. */,
|
||||
SwinsianSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */
|
||||
};
|
||||
typedef enum SwinsianSaveOptions SwinsianSaveOptions;
|
||||
|
||||
enum SwinsianPlayerState {
|
||||
SwinsianPlayerStateStopped = 'kPSS',
|
||||
SwinsianPlayerStatePlaying = 'kPSP',
|
||||
SwinsianPlayerStatePaused = 'kPSp'
|
||||
};
|
||||
typedef enum SwinsianPlayerState SwinsianPlayerState;
|
||||
|
||||
@protocol SwinsianGenericMethods
|
||||
|
||||
- (void) closeSaving:(SwinsianSaveOptions)saving savingIn:(NSURL *)savingIn; // Close an object.
|
||||
- (void) delete; // Delete an object.
|
||||
- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
|
||||
- (BOOL) exists; // Verify if an object exists.
|
||||
- (void) moveTo:(SBObject *)to; // Move object(s) to a new location.
|
||||
- (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save an object.
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Standard Suite
|
||||
*/
|
||||
|
||||
// A scriptable object.
|
||||
@interface SwinsianItem : SBObject <SwinsianGenericMethods>
|
||||
|
||||
@property (copy) NSDictionary *properties; // All of the object's properties.
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// A color.
|
||||
@interface SwinsianColor : SBObject <SwinsianGenericMethods>
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// A window.
|
||||
@interface SwinsianWindow : SBObject <SwinsianGenericMethods>
|
||||
|
||||
@property (copy) NSString *name; // The full title of the window.
|
||||
- (NSNumber *) id; // The unique identifier of the window.
|
||||
@property NSRect bounds; // The bounding rectangle of the window.
|
||||
@property (readonly) BOOL closeable; // Whether the window has a close box.
|
||||
@property (readonly) BOOL titled; // Whether the window has a title bar.
|
||||
@property (copy) NSNumber *index; // The index of the window in the back-to-front window ordering.
|
||||
@property (readonly) BOOL floating; // Whether the window floats.
|
||||
@property (readonly) BOOL miniaturizable; // Whether the window can be miniaturized.
|
||||
@property BOOL miniaturized; // Whether the window is currently miniaturized.
|
||||
@property (readonly) BOOL modal; // Whether the window is the application's current modal window.
|
||||
@property (readonly) BOOL resizable; // Whether the window can be resized.
|
||||
@property BOOL visible; // Whether the window is currently visible.
|
||||
@property (readonly) BOOL zoomable; // Whether the window can be zoomed.
|
||||
@property BOOL zoomed; // Whether the window is currently zoomed.
|
||||
@property (copy, readonly) NSArray<SwinsianTrack *> *selection; // Currently seleted tracks
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Swinsian Suite
|
||||
*/
|
||||
|
||||
// The application
|
||||
@interface SwinsianApplication : SBApplication
|
||||
|
||||
- (SBElementArray<SwinsianWindow *> *) windows;
|
||||
- (SBElementArray<SwinsianPlaylist *> *) playlists;
|
||||
- (SBElementArray<SwinsianSmartPlaylist *> *) smartPlaylists;
|
||||
- (SBElementArray<SwinsianNormalPlaylist *> *) normalPlaylists;
|
||||
- (SBElementArray<SwinsianLibrary *> *) libraries;
|
||||
- (SBElementArray<SwinsianTrack *> *) tracks;
|
||||
- (SBElementArray<SwinsianAudioDevice *> *) audioDevices;
|
||||
|
||||
@property (copy, readonly) NSString *name; // The name of the application.
|
||||
@property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
|
||||
@property (copy, readonly) NSString *version; // The version of the application.
|
||||
@property NSInteger playerPosition; // the player’s position within the currently playing track in seconds.
|
||||
@property (copy, readonly) SwinsianTrack *currentTrack; // the currently playing track
|
||||
@property (copy) NSNumber *soundVolume; // the volume. (0 minimum, 100 maximum)
|
||||
@property (readonly) SwinsianPlayerState playerState; // are we stopped, paused or still playing?
|
||||
@property (copy, readonly) SwinsianQueue *playbackQueue; // the currently queued tracks
|
||||
@property (copy) SwinsianAudioDevice *outputDevice; // current audio output device
|
||||
|
||||
- (void) open:(NSURL *)x; // Open an object.
|
||||
- (void) print:(NSURL *)x; // Print an object.
|
||||
- (void) quitSaving:(SwinsianSaveOptions)saving; // Quit an application.
|
||||
- (void) play; // begin playing the current playlist
|
||||
- (void) pause; // pause playback
|
||||
- (void) nextTrack; // skip to the next track in the current playlist
|
||||
- (void) stop; // stop playback
|
||||
- (NSArray<SwinsianTrack *> *) searchPlaylist:(SwinsianPlaylist *)playlist for:(NSString *)for_; // search a playlist for tracks matching a string
|
||||
- (void) previousTrack; // skip back to the previous track
|
||||
- (void) playpause; // toggle play/pause
|
||||
- (void) addTracks:(NSArray<SwinsianTrack *> *)tracks to:(SwinsianNormalPlaylist *)to; // add a track to a playlist
|
||||
- (void) notify; // show currently playing track notification
|
||||
- (void) rescanTags:(NSArray<SwinsianTrack *> *)x; // rescan tags on tracks
|
||||
- (NSArray<SwinsianTrack *> *) findTrack:(NSString *)x; // Finds tracks for the given path
|
||||
- (void) removeTracks:(NSArray<SwinsianTrack *> *)tracks from:(SwinsianNormalPlaylist *)from; // remove tracks from a playlist
|
||||
|
||||
@end
|
||||
|
||||
// generic playlist type, subcasses include smart playlist and normal playlist
|
||||
@interface SwinsianPlaylist : SwinsianItem
|
||||
|
||||
- (SBElementArray<SwinsianTrack *> *) tracks;
|
||||
|
||||
@property (copy) NSString *name; // the name of the playlist
|
||||
@property (readonly) BOOL smart; // is this a smart playlist
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface SwinsianLibrary : SwinsianItem
|
||||
|
||||
- (SBElementArray<SwinsianTrack *> *) tracks;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// a music track
|
||||
@interface SwinsianTrack : SwinsianItem
|
||||
|
||||
@property (copy) NSString *album; // the album of the track
|
||||
@property (copy) NSString *artist; // the artist
|
||||
@property (copy) NSString *composer; // the composer
|
||||
@property (copy) NSString *genre; // the genre
|
||||
@property (copy, readonly) NSString *time; // the length of the track in text format as MM:SS
|
||||
@property NSInteger year; // the year the track was recorded
|
||||
@property (copy, readonly) NSDate *dateAdded; // the date the track was added to the library
|
||||
@property (readonly) double duration; // the length of the track in seconds
|
||||
@property (copy, readonly) NSString *location; // location on disk
|
||||
@property (readonly) BOOL iPodTrack; // TRUE if the track is on an iPod
|
||||
@property (copy) NSString *name; // the title of the track (same as title)
|
||||
@property (readonly) NSInteger bitRate; // the bitrate of the track
|
||||
@property (copy, readonly) NSString *kind; // a text description of the type of file the track is
|
||||
@property (copy) NSNumber *rating; // Track rating. 0-5
|
||||
@property NSInteger trackNumber; // the Track number
|
||||
@property (readonly) NSInteger fileSize; // file size in bytes
|
||||
@property (copy, readonly) NSImage *albumArt; // the album artwork
|
||||
@property (copy, readonly) NSString *artFormat; // the data format for this piece of artwork. text that will be "PNG" or "JPEG". getting the album art property first will mean this information has been retrieved already, otherwise the tags for the file will have to be re-read
|
||||
@property (copy) NSNumber *discNumber; // the disc number
|
||||
@property (copy) NSNumber *discCount; // the total number of discs in the album
|
||||
- (NSString *) id; // uuid
|
||||
@property (copy) NSString *albumArtist; // the album artist
|
||||
@property (copy, readonly) NSString *albumArtistOrArtist; // the album artist of the track, or is none is set, the artist
|
||||
@property BOOL compilation; // compilation flag
|
||||
@property (copy) NSString *title; // track title (the same as name)
|
||||
@property (copy) NSString *comment; // the comment
|
||||
@property (copy, readonly) NSDate *dateCreated; // the date created
|
||||
@property (readonly) NSInteger channels; // audio channel count
|
||||
@property (readonly) NSInteger sampleRate; // audio sample rate
|
||||
@property (readonly) NSInteger bitDepth; // the audio bit depth
|
||||
@property (copy) NSDate *lastPlayed; // date track was last played
|
||||
@property (copy) NSString *lyrics; // track lyrics
|
||||
@property (copy, readonly) NSString *path; // POSIX style path
|
||||
@property (copy) NSString *grouping; // grouping
|
||||
@property (copy) NSString *publisher; // the publisher
|
||||
@property (copy) NSString *conductor; // the conductor
|
||||
@property (copy) NSString *objectDescription; // the description
|
||||
@property (copy, readonly) NSString *encoder; // the encoder
|
||||
@property (copy, readonly) NSString *copyright; // the copyright
|
||||
@property (copy) NSString *catalogNumber; // the catalog number
|
||||
@property (copy, readonly) NSDate *dateModified; // the date modified
|
||||
@property NSInteger playCount; // the play count
|
||||
@property (copy) NSNumber *trackCount; // the total number of tracks in the album
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface SwinsianLibraryTrack : SwinsianTrack
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface SwinsianIPodTrack : SwinsianTrack
|
||||
|
||||
@property (copy, readonly) NSString *iPodName; // the name of the iPod this track is on
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// The playback queue
|
||||
@interface SwinsianQueue : SwinsianItem
|
||||
|
||||
- (SBElementArray<SwinsianTrack *> *) tracks;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// a smart playlist
|
||||
@interface SwinsianSmartPlaylist : SwinsianPlaylist
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// a normal, non-smart, playlist
|
||||
@interface SwinsianNormalPlaylist : SwinsianPlaylist
|
||||
|
||||
- (SBElementArray<SwinsianTrack *> *) tracks;
|
||||
|
||||
- (NSString *) id; // uuid
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// folder of playlists
|
||||
@interface SwinsianPlaylistFolder : SwinsianPlaylist
|
||||
|
||||
- (SBElementArray<SwinsianPlaylist *> *) playlists;
|
||||
|
||||
- (NSString *) id; // uuid
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// an audio output device
|
||||
@interface SwinsianAudioDevice : SBObject <SwinsianGenericMethods>
|
||||
|
||||
@property (copy, readonly) NSString *name; // device name
|
||||
- (NSString *) id; // uuid
|
||||
- (void) setId: (NSString *) id;
|
||||
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in a new issue