diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bea433 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.DS_Store diff --git a/README.md b/README.md index 58d96e8..a69c56b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,17 @@ osx-project-3 ============= -OS X Development Course, Project 3 \ No newline at end of file +OS X Development Course, Project 3 + +На данный момент работает: +- полное управление iTunes +- переделан интерфейс окон со словами песен и настроек +- приложение полностью находится в статус баре, без иконки в доке и системного меню +- показываются нотификации в Notification Center(с кнопками и без) +- слова песни можно редактировать, но изменения пока не отправляются в iTunes + +не работает: +- скроблинг в ластфм (ищется хорошая библиотека с минимальным количеством зависимостей и поддержкой ARC) +- сохранение настроек в defaults +- горячие клавиши, опять же нужна хорошая библиотека с поддержкой ARC и внятной документацией +- shuffle и repeat из-за особенностей iTunes 11, с 10-м все хорошо. Жду когда обновят header для SB diff --git a/piTunes/piTunes.xcodeproj/project.pbxproj b/piTunes/piTunes.xcodeproj/project.pbxproj new file mode 100644 index 0000000..eac050f --- /dev/null +++ b/piTunes/piTunes.xcodeproj/project.pbxproj @@ -0,0 +1,347 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + E10D46ED16982DD300E9266C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E10D46EC16982DD300E9266C /* Cocoa.framework */; }; + E10D46F716982DD300E9266C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E10D46F516982DD300E9266C /* InfoPlist.strings */; }; + E10D46F916982DD300E9266C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E10D46F816982DD300E9266C /* main.m */; }; + E10D46FD16982DD300E9266C /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = E10D46FB16982DD300E9266C /* Credits.rtf */; }; + E10D470016982DD300E9266C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E10D46FF16982DD300E9266C /* AppDelegate.m */; }; + E10D470316982DD300E9266C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E10D470116982DD300E9266C /* MainMenu.xib */; }; + E10D470E16983DF800E9266C /* LyricsController.m in Sources */ = {isa = PBXBuildFile; fileRef = E10D470D16983DF800E9266C /* LyricsController.m */; }; + E10D471116983E1E00E9266C /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = E10D471016983E1E00E9266C /* PreferencesController.m */; }; + E10D471316983FAF00E9266C /* Lyrics.xib in Resources */ = {isa = PBXBuildFile; fileRef = E10D471216983FAF00E9266C /* Lyrics.xib */; }; + E19A2F9516984AE60044B4CA /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E19A2F9416984AE60044B4CA /* ScriptingBridge.framework */; }; + E19A2FBE169A66050044B4CA /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = E19A2FBD169A66050044B4CA /* README.md */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + E10D46E816982DD300E9266C /* piTunes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = piTunes.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E10D46EC16982DD300E9266C /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + E10D46EF16982DD300E9266C /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + E10D46F016982DD300E9266C /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + E10D46F116982DD300E9266C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + E10D46F416982DD300E9266C /* piTunes-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "piTunes-Info.plist"; sourceTree = ""; }; + E10D46F616982DD300E9266C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + E10D46F816982DD300E9266C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + E10D46FA16982DD300E9266C /* piTunes-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "piTunes-Prefix.pch"; sourceTree = ""; }; + E10D46FC16982DD300E9266C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + E10D46FE16982DD300E9266C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + E10D46FF16982DD300E9266C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + E10D470216982DD300E9266C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; + E10D470916983AD200E9266C /* iTunes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iTunes.h; sourceTree = ""; }; + E10D470C16983DF800E9266C /* LyricsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LyricsController.h; sourceTree = ""; }; + E10D470D16983DF800E9266C /* LyricsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LyricsController.m; sourceTree = ""; }; + E10D470F16983E1E00E9266C /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = ""; }; + E10D471016983E1E00E9266C /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = ""; }; + E10D471216983FAF00E9266C /* Lyrics.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Lyrics.xib; sourceTree = ""; }; + E19A2F9416984AE60044B4CA /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = System/Library/Frameworks/ScriptingBridge.framework; sourceTree = SDKROOT; }; + E19A2FBD169A66050044B4CA /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E10D46E516982DD300E9266C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E19A2F9516984AE60044B4CA /* ScriptingBridge.framework in Frameworks */, + E10D46ED16982DD300E9266C /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E10D46DD16982DD300E9266C = { + isa = PBXGroup; + children = ( + E19A2FBD169A66050044B4CA /* README.md */, + E10D46F216982DD300E9266C /* piTunes */, + E10D46EB16982DD300E9266C /* Frameworks */, + E10D46E916982DD300E9266C /* Products */, + ); + sourceTree = ""; + }; + E10D46E916982DD300E9266C /* Products */ = { + isa = PBXGroup; + children = ( + E10D46E816982DD300E9266C /* piTunes.app */, + ); + name = Products; + sourceTree = ""; + }; + E10D46EB16982DD300E9266C /* Frameworks */ = { + isa = PBXGroup; + children = ( + E19A2F9416984AE60044B4CA /* ScriptingBridge.framework */, + E10D46EC16982DD300E9266C /* Cocoa.framework */, + E10D46EE16982DD300E9266C /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + E10D46EE16982DD300E9266C /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + E10D46EF16982DD300E9266C /* AppKit.framework */, + E10D46F016982DD300E9266C /* CoreData.framework */, + E10D46F116982DD300E9266C /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + E10D46F216982DD300E9266C /* piTunes */ = { + isa = PBXGroup; + children = ( + E10D470B16983BFD00E9266C /* Lyrics */, + E10D470A16983BEE00E9266C /* Preferences */, + E10D46FE16982DD300E9266C /* AppDelegate.h */, + E10D46FF16982DD300E9266C /* AppDelegate.m */, + E10D470116982DD300E9266C /* MainMenu.xib */, + E10D46F316982DD300E9266C /* Supporting Files */, + ); + path = piTunes; + sourceTree = ""; + }; + E10D46F316982DD300E9266C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + E10D470916983AD200E9266C /* iTunes.h */, + E10D46F416982DD300E9266C /* piTunes-Info.plist */, + E10D46F516982DD300E9266C /* InfoPlist.strings */, + E10D46F816982DD300E9266C /* main.m */, + E10D46FA16982DD300E9266C /* piTunes-Prefix.pch */, + E10D46FB16982DD300E9266C /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + E10D470A16983BEE00E9266C /* Preferences */ = { + isa = PBXGroup; + children = ( + E10D470F16983E1E00E9266C /* PreferencesController.h */, + E10D471016983E1E00E9266C /* PreferencesController.m */, + ); + name = Preferences; + sourceTree = ""; + }; + E10D470B16983BFD00E9266C /* Lyrics */ = { + isa = PBXGroup; + children = ( + E10D470C16983DF800E9266C /* LyricsController.h */, + E10D470D16983DF800E9266C /* LyricsController.m */, + E10D471216983FAF00E9266C /* Lyrics.xib */, + ); + name = Lyrics; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E10D46E716982DD300E9266C /* piTunes */ = { + isa = PBXNativeTarget; + buildConfigurationList = E10D470616982DD300E9266C /* Build configuration list for PBXNativeTarget "piTunes" */; + buildPhases = ( + E10D46E416982DD300E9266C /* Sources */, + E10D46E516982DD300E9266C /* Frameworks */, + E10D46E616982DD300E9266C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = piTunes; + productName = piTunes; + productReference = E10D46E816982DD300E9266C /* piTunes.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E10D46DF16982DD300E9266C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = aquaxp; + }; + buildConfigurationList = E10D46E216982DD300E9266C /* Build configuration list for PBXProject "piTunes" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = E10D46DD16982DD300E9266C; + productRefGroup = E10D46E916982DD300E9266C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E10D46E716982DD300E9266C /* piTunes */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E10D46E616982DD300E9266C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E10D46F716982DD300E9266C /* InfoPlist.strings in Resources */, + E10D46FD16982DD300E9266C /* Credits.rtf in Resources */, + E10D470316982DD300E9266C /* MainMenu.xib in Resources */, + E10D471316983FAF00E9266C /* Lyrics.xib in Resources */, + E19A2FBE169A66050044B4CA /* README.md in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E10D46E416982DD300E9266C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E10D46F916982DD300E9266C /* main.m in Sources */, + E10D470016982DD300E9266C /* AppDelegate.m in Sources */, + E10D470E16983DF800E9266C /* LyricsController.m in Sources */, + E10D471116983E1E00E9266C /* PreferencesController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + E10D46F516982DD300E9266C /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + E10D46F616982DD300E9266C /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + E10D46FB16982DD300E9266C /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + E10D46FC16982DD300E9266C /* en */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + E10D470116982DD300E9266C /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + E10D470216982DD300E9266C /* en */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + E10D470416982DD300E9266C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + E10D470516982DD300E9266C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; + }; + name = Release; + }; + E10D470716982DD300E9266C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "piTunes/piTunes-Prefix.pch"; + INFOPLIST_FILE = "piTunes/piTunes-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + E10D470816982DD300E9266C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "piTunes/piTunes-Prefix.pch"; + INFOPLIST_FILE = "piTunes/piTunes-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E10D46E216982DD300E9266C /* Build configuration list for PBXProject "piTunes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E10D470416982DD300E9266C /* Debug */, + E10D470516982DD300E9266C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E10D470616982DD300E9266C /* Build configuration list for PBXNativeTarget "piTunes" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E10D470716982DD300E9266C /* Debug */, + E10D470816982DD300E9266C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E10D46DF16982DD300E9266C /* Project object */; +} diff --git a/piTunes/piTunes.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/piTunes/piTunes.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..10dc22c --- /dev/null +++ b/piTunes/piTunes.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/piTunes/piTunes.xcodeproj/project.xcworkspace/xcuserdata/mindworm.xcuserdatad/UserInterfaceState.xcuserstate b/piTunes/piTunes.xcodeproj/project.xcworkspace/xcuserdata/mindworm.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b5a8c4a Binary files /dev/null and b/piTunes/piTunes.xcodeproj/project.xcworkspace/xcuserdata/mindworm.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 0000000..05301bc --- /dev/null +++ b/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcschemes/piTunes.xcscheme b/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcschemes/piTunes.xcscheme new file mode 100644 index 0000000..5ac8f32 --- /dev/null +++ b/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcschemes/piTunes.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcschemes/xcschememanagement.plist b/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..c27f7fe --- /dev/null +++ b/piTunes/piTunes.xcodeproj/xcuserdata/mindworm.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + piTunes.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + E10D46E716982DD300E9266C + + primary + + + + + diff --git a/piTunes/piTunes/AppDelegate.h b/piTunes/piTunes/AppDelegate.h new file mode 100644 index 0000000..b56db50 --- /dev/null +++ b/piTunes/piTunes/AppDelegate.h @@ -0,0 +1,55 @@ +// +// AppDelegate.h +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import +#import "iTunes.h" + +@class LyricsController; + +@interface AppDelegate : NSObject { + NSStatusItem *statusItem; + IBOutlet NSMenu *playingMenu; + IBOutlet NSMenu *closedMenu; + iTunesApplication* iTunes; + NSUserNotificationCenter *notificationCenter; + LyricsController *lyricsWindow; + + //temporary + NSImage* image; +} + +//iTunes playing menu items +@property (weak) IBOutlet NSMenuItem *menuItemName; +@property (weak) IBOutlet NSMenuItem *menuItemArtist; +@property (weak) IBOutlet NSMenuItem *menuItemAlbum; +@property (weak) IBOutlet NSMenuItem *menuItemSeparator0; +@property (weak) IBOutlet NSMenuItem *menuItemPlay; +@property (weak) IBOutlet NSMenuItem *menuItemShuffleOn; +@property (weak) IBOutlet NSMenuItem *menuItemOff; +@property (weak) IBOutlet NSMenuItem *menuItemRepeatOn; +@property (weak) IBOutlet NSMenuItem *menuItemRepeatOff; + +- (IBAction)menuItemPlay:(id)sender; +- (IBAction)menuItemNext:(id)sender; +- (IBAction)menuItemPrevious:(id)sender; +- (IBAction)menuItemShuffleOn:(id)sender; +- (IBAction)menuItemShuffleOff:(id)sender; +- (IBAction)menuItemRepeatOn:(id)sender; +- (IBAction)menuItemRepeatOff:(id)sender; +- (IBAction)menuItemLyrics:(id)sender; + +//iTunes shared items +- (IBAction)menuItemPreferences:(id)sender; + +//iTunes closed menu items +@property (weak) IBOutlet NSMenuItem *menuItemStatus; +@property (weak) IBOutlet NSMenuItem *menuItemRun; + +- (IBAction)menuItemRun:(id)sender; + +@end diff --git a/piTunes/piTunes/AppDelegate.m b/piTunes/piTunes/AppDelegate.m new file mode 100644 index 0000000..d8a3e70 --- /dev/null +++ b/piTunes/piTunes/AppDelegate.m @@ -0,0 +1,230 @@ +// +// AppDelegate.m +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import "AppDelegate.h" +#import "LyricsController.h" + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + [self startWatching]; + statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; + iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]; + notificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter]; + notificationCenter.delegate = self; + [statusItem setTitle:@"π"]; + + if (![iTunes isRunning]){ + [statusItem setMenu:closedMenu]; + [statusItem setHighlightMode:YES]; + [statusItem setEnabled:YES]; + + } + else{ + [statusItem setMenu:playingMenu]; + [statusItem setHighlightMode:YES]; + [statusItem setEnabled:YES]; + } + + [self updateData]; + + +} + +//core func +- (void)startWatching{ + [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(updateData) name:@"com.apple.iTunes.playerInfo" object:nil]; +} + +- (void)stopWatching{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)updateData{ + if (![iTunes isRunning]) { + [self changeToITC]; + } + else{ + switch ([iTunes playerState]) { + case iTunesEPlSStopped: + [_menuItemPlay setTitle:@"Play"]; + break; + case iTunesEPlSPaused: + [_menuItemPlay setTitle:@"Play"]; + break; + case iTunesEPlSPlaying: + [_menuItemPlay setTitle:@"Pause"]; + break; + default: + [_menuItemPlay setTitle:@"Play/Pause"]; + break; + } + [lyricsWindow updateLyrics:[[iTunes currentTrack] lyrics]]; + [self updateMenu]; + } + [self showNotification]; +} + +- (void)updateMenu{ + [_menuItemName setTitle:[[iTunes currentTrack] name]]; + [_menuItemArtist setTitle:[[iTunes currentTrack] artist]]; + [_menuItemAlbum setTitle:[[iTunes currentTrack] album]]; + //hide? + //[_menuItemSeparator0 setHidden:YES]]; + switch ([[iTunes currentPlaylist] songRepeat]) { + case iTunesERptAll: + //[_menuItemRepeat setTitle:@"Repeat: On"]; + [_menuItemRepeatOn setState:NSOnState]; + [_menuItemRepeatOff setState:NSOffState]; + break; + case iTunesERptOff: + //[_menuItemRepeat setTitle:@"Repeat: Off"]; + [_menuItemRepeatOn setState:NSOffState]; + [_menuItemRepeatOff setState:NSOnState]; + break; + case iTunesERptOne: + //[_menuItemRepeat setTitle:@"Repeat: One"]; + [_menuItemRepeatOn setState:NSOffState]; + [_menuItemRepeatOff setState:NSOffState]; + break; + } + if([[iTunes currentPlaylist] shuffle] == YES){ + //[_menuItemShuffle setTitle:@"Shuffle: On"]; + [_menuItemShuffleOn setState:NSOnState]; + [_menuItemOff setState:NSOffState]; + + } + else if ([[iTunes currentPlaylist] shuffle] == NO){ + //[_menuItemShuffle setTitle:@"Shuffle: Off"]; + [_menuItemShuffleOn setState:NSOffState]; + [_menuItemOff setState:NSOnState]; + + } + else{ + //iTUNES doesn't support shuffle(11) + //[_menuItemShuffle setTitle:@"Shuffle: N/A"]; + NSLog(@"shuff = NULL"); + } +} + +//NotificationCenter func +-(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification{ + return YES; +} + +-(void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification{ + if ([notification activationType] == NSUserNotificationActivationTypeContentsClicked && [iTunes isRunning]){ + [iTunes activate]; + } + else if(![iTunes isRunning]){ + [iTunes run]; + [iTunes activate]; + [self changeToITO]; + } +} + +-(void)showNotification{ + NSUserNotification *notification = [[NSUserNotification alloc] init]; + if([iTunes isRunning]){ + switch ([iTunes playerState]) { + case iTunesEPlSPaused: + [notification setTitle:@"Paused"]; + [notification setSubtitle:[[iTunes currentTrack] name]]; + [notification setInformativeText:[[iTunes currentTrack] artist]]; + [notification setActionButtonTitle:@"Show iTunes"]; + [notification setOtherButtonTitle:@"Hide"]; + [notificationCenter deliverNotification: notification]; + break; + case iTunesEPlSPlaying: + [notification setTitle:@"Now Playing"]; + [notification setSubtitle:[[iTunes currentTrack] name]]; + [notification setInformativeText:[[iTunes currentTrack] artist]]; + [notification setActionButtonTitle:@"Show iTunes"]; + [notification setOtherButtonTitle:@"Hide"]; + [notificationCenter deliverNotification: notification]; + + break; + default: + break; + } + } + else{ + [notification setTitle:@"iTunes is not running"]; + [notification setSubtitle:@"Please run iTunes"]; + [notification setActionButtonTitle:@"Run iTunes"]; + [notification setOtherButtonTitle:@"Hide"]; + [notificationCenter deliverNotification: notification]; + } +} + +//menu change +- (void)changeToITC{ + [statusItem setMenu:closedMenu]; +} + +- (void)changeToITO{ + [statusItem setMenu:playingMenu]; +} + +//menu action +- (IBAction)menuItemPlay:(id)sender { + [iTunes playpause]; +} + +- (IBAction)menuItemNext:(id)sender { + [iTunes nextTrack]; +} + +- (IBAction)menuItemPrevious:(id)sender { + [iTunes previousTrack]; +} + +- (IBAction)menuItemShuffleOn:(id)sender { + +} + +- (IBAction)menuItemShuffleOff:(id)sender { + +} + +- (IBAction)menuItemRepeatOn:(id)sender { + //[_menuItemRepeatOn setState:NSOnState]; + //[_menuItemRepeatOff setState:NSOffState]; + [[iTunes currentPlaylist] setSongRepeat:iTunesERptAll]; +} + +- (IBAction)menuItemRepeatOff:(id)sender { + //[_menuItemRepeatOn setState:NSOffState]; + //[_menuItemRepeatOff setState:NSOnState]; + [[iTunes currentPlaylist] setSongRepeat:iTunesERptOff]; +} + +- (IBAction)menuItemLyrics:(id)sender { + if(!lyricsWindow){ + lyricsWindow = [[LyricsController alloc] init]; + } + [lyricsWindow showWindow:self]; + [lyricsWindow updateLyrics:[[iTunes currentTrack] lyrics]]; +} + +- (IBAction)menuItemPreferences:(id)sender { + NSLog(@"run preferences"); +} + + +- (IBAction)menuItemRun:(id)sender { + [iTunes run]; + [self changeToITO]; +} + + +- (void)dealloc{ + [self stopWatching]; +} +@end diff --git a/piTunes/piTunes/Lyrics.xib b/piTunes/piTunes/Lyrics.xib new file mode 100644 index 0000000..ed652d5 --- /dev/null +++ b/piTunes/piTunes/Lyrics.xib @@ -0,0 +1,921 @@ + + + + 1080 + 12C60 + 2844 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSScrollView + NSScroller + NSTextView + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + LyricsController + + + FirstResponder + + + NSApplication + + + 8223 + 2 + {{139, 81}, {276, 432}} + 611845120 + Window + NSPanel + + + + + 256 + + + + 256 + + + + 2304 + + + + 2322 + {236, 368} + + + _NS:13 + + + + + + + + + + + + 182 + + + + 236 + 1 + + + 11365 + 0 + + + 3 + MQA + + + + 6 + System + selectedTextBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + selectedTextColor + + 3 + MAA + + + + + + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + 1 + + 6 + {463, 10000000} + + + + {236, 368} + + + _NS:11 + + + + {4, 5} + + 12582912 + + + + + + TU0AKgAAEAj///8A////qwAAAP8AAAD/AwMD/BYWFtIFBQVuAAAABv///wD///8E6+vrTGhoaLYtLS3p +BAQE/QAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+rAAAA/wAAAP8AAAD/AAAA/wAAAP8EBATSX19fK9HR0ZciIiLv +AAAA/wAAAP8AAAD/AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////CsPDw0CRkZG1FxcX9AAAAP8bGxvr +ICAg8AAAAP8ICAjlFRUVVQAAAA////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wrm5uab +FxcX9AAAAP8AAAD/AQEB3wAAAA////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///zaXl5fGAAAA/wAAAP8AAABR////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////CO7u7q8AAAD/AAAA/wAAAAz///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/ +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+r +AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///6sAAAD/AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/AAAA/wAAAP8AAAD/ +AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+rAAAA/wAAAP8AAAD/ +AAAA/wAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///+rAAAA/wAAAP////8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///6sAAAD/AAAA/////wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qwAAAP8AAAD/ +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+r +AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////CO7u7q8AAAD/AAAA/wAAAAz///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///80mpqaxQAAAP8AAAD/AAAATv///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////CuXl5ZYeHh7xAAAA/wAAAP8CAgLXAAAAD////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////EKurq0mOjo63FxcX9AAAAP8bGxvrICAg8AAAAP8ICAjlHh4eXAAAABj///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qwAAAP8AAAD/AAAA/wAAAP8AAAD/BAQE1V9fXyvS0tKZICAg8AAAAP8AAAD/ +AAAA/wAAAP8AAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+rAAAA/wAAAP8AAAD/FBQU1AUFBXEAAAAG////AP///wTr6+tO +ZWVluC4uLuoAAAD/AAAA/wAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8AABABAAADAAAAAQAgAAABAQADAAAAAQAgAAABAgADAAAABAAA +EM4BAwADAAAAAQABAAABBgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAE +AAABFgADAAAAAQAgAAABFwAEAAAAAQAAEAABGgAFAAAAAQAAENYBGwAFAAAAAQAAEN4BHAADAAAAAQAB +AAABKAADAAAAAQACAAABUgADAAAAAQACAAABUwADAAAABAAAEOYAAAAAAAgACAAIAAgSAAAAACAAABIA +AAAAIAAAAAEAAQABAAE + + + + + + + + TU0AKgAABAj///9VQ0ND/wAAAP////8A////AP///6pDQ0P/AAAA/////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///+qAAAA/////6oAAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///6oAAAD/////AP///wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///+qAAAA/////wD///8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////qgAAAP////8A////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///6oAAAD/////AP///wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+qAAAA/////wD///8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qgAAAP////8A +////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////qgAAAP8AAAD/ +AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///+q +AAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////qgAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///6oAAAD/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///+qAAAA/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qgAAAP////8A////AP///wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///8A////qgAAAP////+qAAAA/////wD///8A////AP///wD///8A////AP///wD///8A +////AP///wD///9VQ0ND/wAAAP////8A////AP///6pDQ0P/AAAA/////wD///8A////AP///wD///8A +////AP///wD///8AAA4BAAADAAAAAQAQAAABAQADAAAAAQAQAAABAgADAAAABAAABLYBAwADAAAAAQAB +AAABBgADAAAAAQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAEAAABFgADAAAAAQAQ +AAABFwAEAAAAAQAABAABHAADAAAAAQABAAABUgADAAAAAQACAAABUwADAAAABAAABL6HcwAHAAAHqAAA +BMYAAAAAAAgACAAIAAgAAQABAAEAAQAAB6hhcHBsAiAAAG1udHJSR0IgWFlaIAfZAAIAGQALABoAC2Fj +c3BBUFBMAAAAAGFwcGwAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC2Rlc2MAAAEIAAAAb2RzY20AAAF4AAAFbGNw +cnQAAAbkAAAAOHd0cHQAAAccAAAAFHJYWVoAAAcwAAAAFGdYWVoAAAdEAAAAFGJYWVoAAAdYAAAAFHJU +UkMAAAdsAAAADmNoYWQAAAd8AAAALGJUUkMAAAdsAAAADmdUUkMAAAdsAAAADmRlc2MAAAAAAAAAFEdl +bmVyaWMgUkdCIFByb2ZpbGUAAAAAAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAA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2jAAAD3AAA +wGw + + + + + + 3 + MCAwAA + + + + 2 + + + + 256 + {{220, 0}, {16, 368}} + + + _NS:83 + NO + + _doScroller: + 1 + 0.85256409645080566 + 2 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + + _NS:33 + NO + 1 + + _doScroller: + 1 + 0.94565218687057495 + 2 + + + {{20, 20}, {236, 368}} + + + _NS:9 + 133136 + + + + 2 + 0.25 + 4 + 1 + + + + 268 + {{20, 395}, {62, 17}} + + + _NS:9 + YES + + -2080374784 + 134217728 + Edit + + LucidaGrande-Bold + 11 + 3357 + + _NS:9 + + -2030288896 + 39 + + 549650432 + {1, 1} + + + + + + TU0AKgAAAAoAAAAOAQAAAwAAAAEAAQAAAQEAAwAAAAEAAQAAAQIAAwAAAAIACAAIAQMAAwAAAAEAAQAA +AQYAAwAAAAEAAQAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAAQAA +ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABh3MABwAAB7gAAAC4 +AAAAAAAAB7hhcHBsAiAAAG1udHJHUkFZWFlaIAfQAAIADgAMAAAAAGFjc3BBUFBMAAAAAG5vbmUAAAAA +AAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAABWRlc2MAAADAAAAAb2RzY20AAAEwAAAGLGNwcnQAAAdcAAAAOHd0cHQAAAeU +AAAAFGtUUkMAAAeoAAAADmRlc2MAAAAAAAAAFUdlbmVyaWMgR3JheSBQcm9maWxlAAAAAAAAAAAAAAAV +R2VuZXJpYyBHcmF5IFByb2ZpbGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAABtbHVjAAAAAAAAAB4AAAAMc2tTSwAAACoAAAF4aHJIUgAAADoAAAG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ZXNlcnZlZC4AWFlaIAAAAAAAAPNRAAEAAAABFsxjdXJ2AAAAAAAAAAEBzQAA +A + + + + + + + + + 200 + 25 + + NO + + + + -2147483380 + {{194, 395}, {62, 17}} + + + _NS:9 + YES + + -2080374784 + 134217728 + Done + + _NS:9 + + 922501120 + 39 + + 549650432 + {1, 1} + + + + + + TU0AKgAAAAoAAAAOAQAAAwAAAAEAAQAAAQEAAwAAAAEAAQAAAQIAAwAAAAIACAAIAQMAAwAAAAEAAQAA +AQYAAwAAAAEAAQAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAAQAA +ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABh3MABwAAB7gAAAC4 +AAAAAAAAB7hhcHBsAiAAAG1udHJHUkFZWFlaIAfQAAIADgAMAAAAAGFjc3BBUFBMAAAAAG5vbmUAAAAA +AAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAABWRlc2MAAADAAAAAb2RzY20AAAEwAAAGLGNwcnQAAAdcAAAAOHd0cHQAAAeU +AAAAFGtUUkMAAAeoAAAADmRlc2MAAAAAAAAAFUdlbmVyaWMgR3JheSBQcm9maWxlAAAAAAAAAAAAAAAV +R2VuZXJpYyBHcmF5IFByb2ZpbGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAABtbHVjAAAAAAAAAB4AAAAMc2tTSwAAACoAAAF4aHJIUgAAADoAAAGiY2FFUwAAACwAAAHc +cHRCUgAAACoAAAIIdWtVQQAAACwAAAIyZnJGVQAAACoAAAJeemhUVwAAABAAAAKIaXRJVAAAAC4AAAKY +bmJOTwAAACwAAALGa29LUgAAABgAAALyY3NDWgAAACQAAAMKaGVJTAAAACAAAAMuZGVERQAAADoAA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BzAGsAIABnAHIA5QBzAGsAYQBsAGUAcAByAG8AZgBpAGxmbpAacHBepmPPj/Blh072 +TgCCLDCwMOwwpDDXMO0w1TChMKQw6wBQAHIAbwBmAGkAbAAgAGcAcgBpACAAZwBlAG4AZQByAGkDkwO1 +A70DuQO6A8wAIAPAA8EDvwPGA68DuwAgA7MDugPBA7kAUABlAHIAZgBpAGwAIABnAGUAbgDpAHIAaQBj +AG8AIABkAGUAIABjAGkAbgB6AGUAbgB0AG8AcwBBAGwAZwBlAG0AZQBlAG4AIABnAHIAaQBqAHMAcABy +AG8AZgBpAGUAbABQAGUAcgBmAGkAbAAgAGcAcgBpAHMAIABnAGUAbgDpAHIAaQBjAG8OQg4bDiMORA4f +DiUOTA4qDjUOQA4XDjIOFw4xDkgOJw5EDhsARwBlAG4AZQBsACAARwByAGkAIABQAHIAbwBmAGkAbABp +AFkAbABlAGkAbgBlAG4AIABoAGEAcgBtAGEAYQBwAHIAbwBmAGkAaQBsAGkAVQBuAGkAdwBlAHIAcwBh +AGwAbgB5ACAAcAByAG8AZgBpAGwAIABzAHoAYQByAG8BWwBjAGkEHgQxBEkEOAQ5ACAEQQQ1BEAESwQ5 +ACAEPwRABD4ERAQ4BDsETAZFBkQGQQAgBioGOQYxBkoGQQAgAEcAcgBhAHkAIAYnBkQGOQYnBkUARwBl +AG4AZQByAGkAYwAgAEcAcgBhAHkAIABQAHIAbwBmAGkAbABlAEcAZQBuAGUAcgBlAGwAIABnAHIA5QB0 +AG8AbgBlAGIAZQBzAGsAcgBpAHYAZQBsAHMAZXRleHQAAAAAQ29weXJpZ2h0IDIwMDcgQXBwbGUgSW5j +LiwgYWxsIHJpZ2h0cyByZXNlcnZlZC4AWFlaIAAAAAAAAPNRAAEAAAABFsxjdXJ2AAAAAAAAAAEBzQAA +A + + + + + + + + + 200 + 25 + + NO + + + {276, 432} + + + _NS:21 + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES + + + + + + + lyricsTextView + + + + 14 + + + + window + + + + 62 + + + + buttonEdit + + + + 112 + + + + buttonDone + + + + 113 + + + + editLyrics: + + + + 114 + + + + commitLyrics: + + + + 115 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + + + + + 3 + + + + + + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 10 + + + + + 11 + + + + + 64 + + + + + 67 + + + + + + 7 + 0 + + 0 + 1 + + 62 + + 1000 + + 3 + 9 + 1 + + + + + + 68 + + + + + 99 + + + + + 100 + + + + + 7 + 0 + + 0 + 1 + + 62 + + 1000 + + 3 + 9 + 1 + + + + + + + 102 + + + + + 103 + + + + + 106 + + + + + 107 + + + + + 109 + + + + + 110 + + + + + 111 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 115 + + + 0 + IBCocoaFramework + YES + 3 + YES + + diff --git a/piTunes/piTunes/LyricsController.h b/piTunes/piTunes/LyricsController.h new file mode 100644 index 0000000..5766cc1 --- /dev/null +++ b/piTunes/piTunes/LyricsController.h @@ -0,0 +1,23 @@ +// +// LyricsController.h +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import + +@interface LyricsController : NSWindowController{ + NSString* lyrics; +} + +@property (unsafe_unretained) IBOutlet NSTextView *lyricsTextView; +@property (weak) IBOutlet NSButton *buttonEdit; +@property (weak) IBOutlet NSButton *buttonDone; + +- (void)updateLyrics:(NSString *)text; +- (IBAction)editLyrics:(id)sender; +- (IBAction)commitLyrics:(id)sender; + +@end diff --git a/piTunes/piTunes/LyricsController.m b/piTunes/piTunes/LyricsController.m new file mode 100644 index 0000000..68f1c40 --- /dev/null +++ b/piTunes/piTunes/LyricsController.m @@ -0,0 +1,56 @@ +// +// LyricsController.m +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import "LyricsController.h" + +@interface LyricsController () + +@end + +@implementation LyricsController + +- (id)init{ + lyrics = @"no lyrics"; + return [super initWithWindowNibName:@"Lyrics"]; +} + +- (void)updateLyrics:(NSString *)text{ + lyrics = text; + //if (lyrics == @""){ lyrics = @"No lyrics";} + [_lyricsTextView setTextColor:[NSColor whiteColor]]; + [_lyricsTextView setString:lyrics]; +} + +- (IBAction)editLyrics:(id)sender { + if([_buttonEdit title] == @"Edit"){ + [_buttonEdit setTitle:@"Cancel"]; + [_lyricsTextView setEditable:YES]; + [_buttonDone setHidden:NO]; + } + else{ + [_buttonEdit setTitle:@"Edit"]; + [_lyricsTextView setEditable:NO]; + [self updateLyrics:lyrics]; + [_buttonDone setHidden:YES]; + } +} + +- (IBAction)commitLyrics:(id)sender { + [_buttonEdit setTitle:@"Edit"]; + [_lyricsTextView setEditable:NO]; + [_buttonDone setHidden:YES]; + + [self updateLyrics:lyrics]; + + +} +-(void)showWindow:(id)sender{ + [super showWindow:sender]; +} + +@end diff --git a/piTunes/piTunes/PreferencesController.h b/piTunes/piTunes/PreferencesController.h new file mode 100644 index 0000000..f513d6a --- /dev/null +++ b/piTunes/piTunes/PreferencesController.h @@ -0,0 +1,13 @@ +// +// PreferencesController.h +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import + +@interface PreferencesController : NSWindowController + +@end diff --git a/piTunes/piTunes/PreferencesController.m b/piTunes/piTunes/PreferencesController.m new file mode 100644 index 0000000..b57cade --- /dev/null +++ b/piTunes/piTunes/PreferencesController.m @@ -0,0 +1,34 @@ +// +// PreferencesController.m +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import "PreferencesController.h" + +@interface PreferencesController () + +@end + +@implementation PreferencesController + +- (id)initWithWindow:(NSWindow *)window +{ + self = [super initWithWindow:window]; + if (self) { + // Initialization code here. + } + + return self; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. +} + +@end diff --git a/piTunes/piTunes/en.lproj/Credits.rtf b/piTunes/piTunes/en.lproj/Credits.rtf new file mode 100644 index 0000000..46576ef --- /dev/null +++ b/piTunes/piTunes/en.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/piTunes/piTunes/en.lproj/InfoPlist.strings b/piTunes/piTunes/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/piTunes/piTunes/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/piTunes/piTunes/en.lproj/MainMenu.xib b/piTunes/piTunes/en.lproj/MainMenu.xib new file mode 100644 index 0000000..12e2db0 --- /dev/null +++ b/piTunes/piTunes/en.lproj/MainMenu.xib @@ -0,0 +1,692 @@ + + + + 1080 + 12C60 + 2844 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2844 + + + NSCustomObject + NSMenu + NSMenuItem + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + NSApplication + + + FirstResponder + + + NSApplication + + + AppDelegate + + + NSFontManager + + + + + + + Name + + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + + + + Artist + + 2147483647 + + + + + + Album + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Play/Pause + + 2147483647 + + + + + + Next + + 2147483647 + + + + + + Previous + + 2147483647 + + + + + + Shuffle + S + 2147483647 + + + submenuAction: + + Shuffle + + + + On + + 2147483647 + + + + + + Off + + 2147483647 + + + + + + + + + Repeat + Gw + 2147483647 + + + submenuAction: + + Repeat + + + + On + + 2147483647 + + + + + + Off + + 2147483647 + + + + + + + + + Lyrics... + + 2147483647 + + + + + + Preferences... + + 2147483647 + + + + + + Quit + + 2147483647 + + + + + + + + + + + YES + iTunes is not running + + 2147483647 + + + + + + Run iTunes + + 2147483647 + + + + + + Preferences... + + 2147483647 + + + + + + Quit + + 2147483647 + + + + + + + + + + + terminate: + + + + 598 + + + + terminate: + + + + 599 + + + + delegate + + + + 495 + + + + menuItemName + + + + 565 + + + + menuItemArtist + + + + 566 + + + + menuItemAlbum + + + + 567 + + + + menuItemSeparator0 + + + + 568 + + + + menuItemPlay + + + + 569 + + + + menuItemPlay: + + + + 570 + + + + menuItemNext: + + + + 571 + + + + menuItemPrevious: + + + + 572 + + + + menuItemShuffleOn: + + + + 574 + + + + menuItemShuffleOff: + + + + 575 + + + + menuItemRepeatOn: + + + + 582 + + + + menuItemRepeatOff: + + + + 584 + + + + menuItemLyrics: + + + + 585 + + + + menuItemPreferences: + + + + 586 + + + + menuItemStatus + + + + 588 + + + + menuItemRun + + + + 589 + + + + menuItemRun: + + + + 590 + + + + menuItemPreferences: + + + + 591 + + + + closedMenu + + + + 593 + + + + playingMenu + + + + 594 + + + + menuItemRepeatOff + + + + 603 + + + + menuItemRepeatOn + + + + 604 + + + + menuItemShuffle + + + + 606 + + + + menuItemShuffleOn + + + + 607 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 420 + + + + + 494 + + + + + 536 + + + + + + + + + + + + + + + + + + + 537 + + + + + 538 + + + + + 539 + + + + + 540 + + + + + + + + + + + 541 + + + + + 542 + + + + + 543 + + + + + 544 + + + + + 545 + + + + + 546 + + + + + 548 + + + + + 549 + + + + + 551 + + + + + 552 + + + + + + + + 553 + + + + + + + + + 554 + + + + + 556 + + + + + 558 + + + + + 559 + + + + + 560 + + + + + + + + 561 + + + + + + + + + 562 + + + + + 564 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 609 + + + 0 + IBCocoaFramework + YES + 3 + + {11, 11} + {10, 3} + + YES + + diff --git a/piTunes/piTunes/iTunes.h b/piTunes/piTunes/iTunes.h new file mode 100644 index 0000000..5da6f8d --- /dev/null +++ b/piTunes/piTunes/iTunes.h @@ -0,0 +1,506 @@ +/* + * iTunes.h + */ + +#import +#import + + +@class iTunesPrintSettings, iTunesApplication, iTunesItem, iTunesArtwork, iTunesEncoder, iTunesEQPreset, iTunesPlaylist, iTunesAudioCDPlaylist, iTunesDevicePlaylist, iTunesLibraryPlaylist, iTunesRadioTunerPlaylist, iTunesSource, iTunesTrack, iTunesAudioCDTrack, iTunesDeviceTrack, iTunesFileTrack, iTunesSharedTrack, iTunesURLTrack, iTunesUserPlaylist, iTunesFolderPlaylist, iTunesVisual, iTunesWindow, iTunesBrowserWindow, iTunesEQWindow, iTunesPlaylistWindow; + +enum iTunesEKnd { + iTunesEKndTrackListing = 'kTrk' /* a basic listing of tracks within a playlist */, + iTunesEKndAlbumListing = 'kAlb' /* a listing of a playlist grouped by album */, + iTunesEKndCdInsert = 'kCDi' /* a printout of the playlist for jewel case inserts */ +}; +typedef enum iTunesEKnd iTunesEKnd; + +enum iTunesEnum { + iTunesEnumStandard = 'lwst' /* Standard PostScript error handling */, + iTunesEnumDetailed = 'lwdt' /* print a detailed report of PostScript errors */ +}; +typedef enum iTunesEnum iTunesEnum; + +enum iTunesEPlS { + iTunesEPlSStopped = 'kPSS', + iTunesEPlSPlaying = 'kPSP', + iTunesEPlSPaused = 'kPSp', + iTunesEPlSFastForwarding = 'kPSF', + iTunesEPlSRewinding = 'kPSR' +}; +typedef enum iTunesEPlS iTunesEPlS; + +enum iTunesERpt { + iTunesERptOff = 'kRpO', + iTunesERptOne = 'kRp1', + iTunesERptAll = 'kAll' +}; +typedef enum iTunesERpt iTunesERpt; + +enum iTunesEVSz { + iTunesEVSzSmall = 'kVSS', + iTunesEVSzMedium = 'kVSM', + iTunesEVSzLarge = 'kVSL' +}; +typedef enum iTunesEVSz iTunesEVSz; + +enum iTunesESrc { + iTunesESrcLibrary = 'kLib', + iTunesESrcIPod = 'kPod', + iTunesESrcAudioCD = 'kACD', + iTunesESrcMP3CD = 'kMCD', + iTunesESrcDevice = 'kDev', + iTunesESrcRadioTuner = 'kTun', + iTunesESrcSharedLibrary = 'kShd', + iTunesESrcUnknown = 'kUnk' +}; +typedef enum iTunesESrc iTunesESrc; + +enum iTunesESrA { + iTunesESrAAlbums = 'kSrL' /* albums only */, + iTunesESrAAll = 'kAll' /* all text fields */, + iTunesESrAArtists = 'kSrR' /* artists only */, + iTunesESrAComposers = 'kSrC' /* composers only */, + iTunesESrADisplayed = 'kSrV' /* visible text fields */, + iTunesESrASongs = 'kSrS' /* song names only */ +}; +typedef enum iTunesESrA iTunesESrA; + +enum iTunesESpK { + iTunesESpKNone = 'kNon', + iTunesESpKBooks = 'kSpA', + iTunesESpKFolder = 'kSpF', + iTunesESpKGenius = 'kSpG', + iTunesESpKITunesU = 'kSpU', + iTunesESpKLibrary = 'kSpL', + iTunesESpKMovies = 'kSpI', + iTunesESpKMusic = 'kSpZ', + iTunesESpKPartyShuffle = 'kSpS', + iTunesESpKPodcasts = 'kSpP', + iTunesESpKPurchasedMusic = 'kSpM', + iTunesESpKTVShows = 'kSpT' +}; +typedef enum iTunesESpK iTunesESpK; + +enum iTunesEVdK { + iTunesEVdKNone = 'kNon' /* not a video or unknown video kind */, + iTunesEVdKMovie = 'kVdM' /* movie track */, + iTunesEVdKMusicVideo = 'kVdV' /* music video track */, + iTunesEVdKTVShow = 'kVdT' /* TV show track */ +}; +typedef enum iTunesEVdK iTunesEVdK; + +enum iTunesERtK { + iTunesERtKUser = 'kRtU' /* user-specified rating */, + iTunesERtKComputed = 'kRtC' /* iTunes-computed rating */ +}; +typedef enum iTunesERtK iTunesERtK; + + + +/* + * Standard Suite + */ + +@interface iTunesPrintSettings : SBObject + +@property (readonly) NSInteger copies; // the number of copies of a document to be printed +@property (readonly) BOOL collating; // Should printed copies be collated? +@property (readonly) NSInteger startingPage; // the first page of the document to be printed +@property (readonly) NSInteger endingPage; // the last page of the document to be printed +@property (readonly) NSInteger pagesAcross; // number of logical pages laid across a physical page +@property (readonly) NSInteger pagesDown; // number of logical pages laid out down a physical page +@property (readonly) iTunesEnum errorHandling; // how errors are handled +@property (copy, readonly) NSDate *requestedPrintTime; // the time at which the desktop printer should print the document +@property (copy, readonly) NSArray *printerFeatures; // printer specific options +@property (copy, readonly) NSString *faxNumber; // for fax number +@property (copy, readonly) NSString *targetPrinter; // for target printer + +- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s) +- (void) close; // Close an object +- (void) delete; // Delete an element from an object +- (SBObject *) duplicateTo:(SBObject *)to; // Duplicate one or more object(s) +- (BOOL) exists; // Verify if an object exists +- (void) open; // open the specified object(s) +- (void) playOnce:(BOOL)once; // play the current track or the specified track or file. + +@end + + + +/* + * iTunes Suite + */ + +// The application program +@interface iTunesApplication : SBApplication + +- (SBElementArray *) browserWindows; +- (SBElementArray *) encoders; +- (SBElementArray *) EQPresets; +- (SBElementArray *) EQWindows; +- (SBElementArray *) playlistWindows; +- (SBElementArray *) sources; +- (SBElementArray *) visuals; +- (SBElementArray *) windows; + +@property (copy) iTunesEncoder *currentEncoder; // the currently selected encoder (MP3, AIFF, WAV, etc.) +@property (copy) iTunesEQPreset *currentEQPreset; // the currently selected equalizer preset +@property (copy, readonly) iTunesPlaylist *currentPlaylist; // the playlist containing the currently targeted track +@property (copy, readonly) NSString *currentStreamTitle; // the name of the current song in the playing stream (provided by streaming server) +@property (copy, readonly) NSString *currentStreamURL; // the URL of the playing stream or streaming web site (provided by streaming server) +@property (copy, readonly) iTunesTrack *currentTrack; // the current targeted track +@property (copy) iTunesVisual *currentVisual; // the currently selected visual plug-in +@property BOOL EQEnabled; // is the equalizer enabled? +@property BOOL fixedIndexing; // true if all AppleScript track indices should be independent of the play order of the owning playlist. +@property BOOL frontmost; // is iTunes the frontmost application? +@property BOOL fullScreen; // are visuals displayed using the entire screen? +@property (copy, readonly) NSString *name; // the name of the application +@property BOOL mute; // has the sound output been muted? +@property NSInteger playerPosition; // the player’s position within the currently playing track in seconds. +@property (readonly) iTunesEPlS playerState; // is iTunes stopped, paused, or playing? +@property (copy, readonly) SBObject *selection; // the selection visible to the user +@property NSInteger soundVolume; // the sound output volume (0 = minimum, 100 = maximum) +@property (copy, readonly) NSString *version; // the version of iTunes +@property BOOL visualsEnabled; // are visuals currently being displayed? +@property iTunesEVSz visualSize; // the size of the displayed visual + +- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s) +- (void) run; // run iTunes +- (void) quit; // quit iTunes +- (iTunesTrack *) add:(NSArray *)x to:(SBObject *)to; // add one or more files to a playlist +- (void) backTrack; // reposition to beginning of current track or go to previous track if already at start of current track +- (iTunesTrack *) convert:(NSArray *)x; // convert one or more files or tracks +- (void) fastForward; // skip forward in a playing track +- (void) nextTrack; // advance to the next track in the current playlist +- (void) pause; // pause playback +- (void) playOnce:(BOOL)once; // play the current track or the specified track or file. +- (void) playpause; // toggle the playing/paused state of the current track +- (void) previousTrack; // return to the previous track in the current playlist +- (void) resume; // disable fast forward/rewind and resume playback, if playing. +- (void) rewind; // skip backwards in a playing track +- (void) stop; // stop playback +- (void) update; // update the specified iPod +- (void) eject; // eject the specified iPod +- (void) subscribe:(NSString *)x; // subscribe to a podcast feed +- (void) updateAllPodcasts; // update all subscribed podcast feeds +- (void) updatePodcast; // update podcast feed +- (void) openLocation:(NSString *)x; // Opens a Music Store or audio stream URL + +@end + +// an item +@interface iTunesItem : SBObject + +@property (copy, readonly) SBObject *container; // the container of the item +- (NSInteger) id; // the id of the item +@property (readonly) NSInteger index; // The index of the item in internal application order. +@property (copy) NSString *name; // the name of the item +@property (copy, readonly) NSString *persistentID; // the id of the item as a hexidecimal string. This id does not change over time. + +- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s) +- (void) close; // Close an object +- (void) delete; // Delete an element from an object +- (SBObject *) duplicateTo:(SBObject *)to; // Duplicate one or more object(s) +- (BOOL) exists; // Verify if an object exists +- (void) open; // open the specified object(s) +- (void) playOnce:(BOOL)once; // play the current track or the specified track or file. +- (void) reveal; // reveal and select a track or playlist + +@end + +// a piece of art within a track +@interface iTunesArtwork : iTunesItem + +@property (copy) NSImage *data; // data for this artwork, in the form of a picture +@property (copy) NSString *objectDescription; // description of artwork as a string +@property (readonly) BOOL downloaded; // was this artwork downloaded by iTunes? +@property (copy, readonly) NSNumber *format; // the data format for this piece of artwork +@property NSInteger kind; // kind or purpose of this piece of artwork +@property (copy) NSData *rawData; // data for this artwork, in original format + + +@end + +// converts a track to a specific file format +@interface iTunesEncoder : iTunesItem + +@property (copy, readonly) NSString *format; // the data format created by the encoder + + +@end + +// equalizer preset configuration +@interface iTunesEQPreset : iTunesItem + +@property double band1; // the equalizer 32 Hz band level (-12.0 dB to +12.0 dB) +@property double band2; // the equalizer 64 Hz band level (-12.0 dB to +12.0 dB) +@property double band3; // the equalizer 125 Hz band level (-12.0 dB to +12.0 dB) +@property double band4; // the equalizer 250 Hz band level (-12.0 dB to +12.0 dB) +@property double band5; // the equalizer 500 Hz band level (-12.0 dB to +12.0 dB) +@property double band6; // the equalizer 1 kHz band level (-12.0 dB to +12.0 dB) +@property double band7; // the equalizer 2 kHz band level (-12.0 dB to +12.0 dB) +@property double band8; // the equalizer 4 kHz band level (-12.0 dB to +12.0 dB) +@property double band9; // the equalizer 8 kHz band level (-12.0 dB to +12.0 dB) +@property double band10; // the equalizer 16 kHz band level (-12.0 dB to +12.0 dB) +@property (readonly) BOOL modifiable; // can this preset be modified? +@property double preamp; // the equalizer preamp level (-12.0 dB to +12.0 dB) +@property BOOL updateTracks; // should tracks which refer to this preset be updated when the preset is renamed or deleted? + + +@end + +// a list of songs/streams +@interface iTunesPlaylist : iTunesItem + +- (SBElementArray *) tracks; + +@property (readonly) NSInteger duration; // the total length of all songs (in seconds) +@property (copy) NSString *name; // the name of the playlist +@property (copy, readonly) iTunesPlaylist *parent; // folder which contains this playlist (if any) +@property BOOL shuffle; // play the songs in this playlist in random order? +@property (readonly) long long size; // the total size of all songs (in bytes) +@property iTunesERpt songRepeat; // playback repeat mode +@property (readonly) iTunesESpK specialKind; // special playlist kind +@property (copy, readonly) NSString *time; // the length of all songs in MM:SS format +@property (readonly) BOOL visible; // is this playlist visible in the Source list? + +- (void) moveTo:(SBObject *)to; // Move playlist(s) to a new location +- (iTunesTrack *) searchFor:(NSString *)for_ only:(iTunesESrA)only; // search a playlist for tracks matching the search string. Identical to entering search text in the Search field in iTunes. + +@end + +// a playlist representing an audio CD +@interface iTunesAudioCDPlaylist : iTunesPlaylist + +- (SBElementArray *) audioCDTracks; + +@property (copy) NSString *artist; // the artist of the CD +@property BOOL compilation; // is this CD a compilation album? +@property (copy) NSString *composer; // the composer of the CD +@property NSInteger discCount; // the total number of discs in this CD’s album +@property NSInteger discNumber; // the index of this CD disc in the source album +@property (copy) NSString *genre; // the genre of the CD +@property NSInteger year; // the year the album was recorded/released + + +@end + +// a playlist representing the contents of a portable device +@interface iTunesDevicePlaylist : iTunesPlaylist + +- (SBElementArray *) deviceTracks; + + +@end + +// the master music library playlist +@interface iTunesLibraryPlaylist : iTunesPlaylist + +- (SBElementArray *) fileTracks; +- (SBElementArray *) URLTracks; +- (SBElementArray *) sharedTracks; + + +@end + +// the radio tuner playlist +@interface iTunesRadioTunerPlaylist : iTunesPlaylist + +- (SBElementArray *) URLTracks; + + +@end + +// a music source (music library, CD, device, etc.) +@interface iTunesSource : iTunesItem + +- (SBElementArray *) audioCDPlaylists; +- (SBElementArray *) devicePlaylists; +- (SBElementArray *) libraryPlaylists; +- (SBElementArray *) playlists; +- (SBElementArray *) radioTunerPlaylists; +- (SBElementArray *) userPlaylists; + +@property (readonly) long long capacity; // the total size of the source if it has a fixed size +@property (readonly) long long freeSpace; // the free space on the source if it has a fixed size +@property (readonly) iTunesESrc kind; + +- (void) update; // update the specified iPod +- (void) eject; // eject the specified iPod + +@end + +// playable audio source +@interface iTunesTrack : iTunesItem + +- (SBElementArray *) artworks; + +@property (copy) NSString *album; // the album name of the track +@property (copy) NSString *albumArtist; // the album artist of the track +@property NSInteger albumRating; // the rating of the album for this track (0 to 100) +@property (readonly) iTunesERtK albumRatingKind; // the rating kind of the album rating for this track +@property (copy) NSString *artist; // the artist/source of the track +@property (readonly) NSInteger bitRate; // the bit rate of the track (in kbps) +@property double bookmark; // the bookmark time of the track in seconds +@property BOOL bookmarkable; // is the playback position for this track remembered? +@property NSInteger bpm; // the tempo of this track in beats per minute +@property (copy) NSString *category; // the category of the track +@property (copy) NSString *comment; // freeform notes about the track +@property BOOL compilation; // is this track from a compilation album? +@property (copy) NSString *composer; // the composer of the track +@property (readonly) NSInteger databaseID; // the common, unique ID for this track. If two tracks in different playlists have the same database ID, they are sharing the same data. +@property (copy, readonly) NSDate *dateAdded; // the date the track was added to the playlist +@property (copy) NSString *objectDescription; // the description of the track +@property NSInteger discCount; // the total number of discs in the source album +@property NSInteger discNumber; // the index of the disc containing this track on the source album +@property (readonly) double duration; // the length of the track in seconds +@property BOOL enabled; // is this track checked for playback? +@property (copy) NSString *episodeID; // the episode ID of the track +@property NSInteger episodeNumber; // the episode number of the track +@property (copy) NSString *EQ; // the name of the EQ preset of the track +@property double finish; // the stop time of the track in seconds +@property BOOL gapless; // is this track from a gapless album? +@property (copy) NSString *genre; // the music/audio genre (category) of the track +@property (copy) NSString *grouping; // the grouping (piece) of the track. Generally used to denote movements within a classical work. +@property (copy, readonly) NSString *kind; // a text description of the track +@property (copy) NSString *longDescription; +@property (copy) NSString *lyrics; // the lyrics of the track +@property (copy, readonly) NSDate *modificationDate; // the modification date of the content of this track +@property NSInteger playedCount; // number of times this track has been played +@property (copy) NSDate *playedDate; // the date and time this track was last played +@property (readonly) BOOL podcast; // is this track a podcast episode? +@property NSInteger rating; // the rating of this track (0 to 100) +@property (readonly) iTunesERtK ratingKind; // the rating kind of this track +@property (copy, readonly) NSDate *releaseDate; // the release date of this track +@property (readonly) NSInteger sampleRate; // the sample rate of the track (in Hz) +@property NSInteger seasonNumber; // the season number of the track +@property BOOL shufflable; // is this track included when shuffling? +@property NSInteger skippedCount; // number of times this track has been skipped +@property (copy) NSDate *skippedDate; // the date and time this track was last skipped +@property (copy) NSString *show; // the show name of the track +@property (copy) NSString *sortAlbum; // override string to use for the track when sorting by album +@property (copy) NSString *sortArtist; // override string to use for the track when sorting by artist +@property (copy) NSString *sortAlbumArtist; // override string to use for the track when sorting by album artist +@property (copy) NSString *sortName; // override string to use for the track when sorting by name +@property (copy) NSString *sortComposer; // override string to use for the track when sorting by composer +@property (copy) NSString *sortShow; // override string to use for the track when sorting by show name +@property (readonly) NSInteger size; // the size of the track (in bytes) +@property double start; // the start time of the track in seconds +@property (copy, readonly) NSString *time; // the length of the track in MM:SS format +@property NSInteger trackCount; // the total number of tracks on the source album +@property NSInteger trackNumber; // the index of the track on the source album +@property BOOL unplayed; // is this track unplayed? +@property iTunesEVdK videoKind; // kind of video track +@property NSInteger volumeAdjustment; // relative volume adjustment of the track (-100% to 100%) +@property NSInteger year; // the year the track was recorded/released + + +@end + +// a track on an audio CD +@interface iTunesAudioCDTrack : iTunesTrack + +@property (copy, readonly) NSURL *location; // the location of the file represented by this track + + +@end + +// a track residing on a portable music player +@interface iTunesDeviceTrack : iTunesTrack + + +@end + +// a track representing an audio file (MP3, AIFF, etc.) +@interface iTunesFileTrack : iTunesTrack + +@property (copy) NSURL *location; // the location of the file represented by this track + +- (void) refresh; // update file track information from the current information in the track’s file + +@end + +// a track residing in a shared library +@interface iTunesSharedTrack : iTunesTrack + + +@end + +// a track representing a network stream +@interface iTunesURLTrack : iTunesTrack + +@property (copy) NSString *address; // the URL for this track + +- (void) download; // download podcast episode + +@end + +// custom playlists created by the user +@interface iTunesUserPlaylist : iTunesPlaylist + +- (SBElementArray *) fileTracks; +- (SBElementArray *) URLTracks; +- (SBElementArray *) sharedTracks; + +@property BOOL shared; // is this playlist shared? +@property (readonly) BOOL smart; // is this a Smart Playlist? + + +@end + +// a folder that contains other playlists +@interface iTunesFolderPlaylist : iTunesUserPlaylist + + +@end + +// a visual plug-in +@interface iTunesVisual : iTunesItem + + +@end + +// any window +@interface iTunesWindow : iTunesItem + +@property NSRect bounds; // the boundary rectangle for the window +@property (readonly) BOOL closeable; // does the window have a close box? +@property (readonly) BOOL collapseable; // does the window have a collapse (windowshade) box? +@property BOOL collapsed; // is the window collapsed? +@property NSPoint position; // the upper left position of the window +@property (readonly) BOOL resizable; // is the window resizable? +@property BOOL visible; // is the window visible? +@property (readonly) BOOL zoomable; // is the window zoomable? +@property BOOL zoomed; // is the window zoomed? + + +@end + +// the main iTunes window +@interface iTunesBrowserWindow : iTunesWindow + +@property BOOL minimized; // is the small player visible? +@property (copy, readonly) SBObject *selection; // the selected songs +@property (copy) iTunesPlaylist *view; // the playlist currently displayed in the window + + +@end + +// the iTunes equalizer window +@interface iTunesEQWindow : iTunesWindow + +@property BOOL minimized; // is the small EQ window visible? + + +@end + +// a sub-window showing a single playlist +@interface iTunesPlaylistWindow : iTunesWindow + +@property (copy, readonly) SBObject *selection; // the selected songs +@property (copy, readonly) iTunesPlaylist *view; // the playlist displayed in the window + + +@end + diff --git a/piTunes/piTunes/main.m b/piTunes/piTunes/main.m new file mode 100644 index 0000000..814fd1a --- /dev/null +++ b/piTunes/piTunes/main.m @@ -0,0 +1,14 @@ +// +// main.m +// piTunes +// +// Created by mindworm on 1/5/13. +// Copyright (c) 2013 aquaxp. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/piTunes/piTunes/piTunes-Info.plist b/piTunes/piTunes/piTunes-Info.plist new file mode 100644 index 0000000..e69c2be --- /dev/null +++ b/piTunes/piTunes/piTunes-Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSApplicationCategoryType + public.app-category.music + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + LSUIElement + + NSHumanReadableCopyright + Copyright © 2013 aquaxp. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/piTunes/piTunes/piTunes-Prefix.pch b/piTunes/piTunes/piTunes-Prefix.pch new file mode 100644 index 0000000..98a338a --- /dev/null +++ b/piTunes/piTunes/piTunes-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'piTunes' target in the 'piTunes' project +// + +#ifdef __OBJC__ + #import +#endif