mamburu: Added bar that shows name of currently playing entry
parent
984502469a
commit
0ad3106355
|
@ -3,6 +3,7 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "NDHotKeyEvent.h"
|
||||
#import "NowPlayingBarController.h"
|
||||
|
||||
@class PlaybackController;
|
||||
@class PlaylistController;
|
||||
|
@ -12,12 +13,15 @@
|
|||
|
||||
@interface AppController : NSObject
|
||||
{
|
||||
IBOutlet NSObjectController *currentEntryController;
|
||||
|
||||
IBOutlet PlaybackController *playbackController;
|
||||
|
||||
IBOutlet PlaylistController *playlistController;
|
||||
IBOutlet PlaylistLoader *playlistLoader;
|
||||
|
||||
IBOutlet NSWindow *mainWindow;
|
||||
IBOutlet NSSplitView *mainView;
|
||||
|
||||
IBOutlet NSSegmentedControl *playbackButtons;
|
||||
IBOutlet NSButton *infoButton;
|
||||
|
@ -46,6 +50,8 @@
|
|||
NDHotKeyEvent *prevHotKey;
|
||||
NDHotKeyEvent *nextHotKey;
|
||||
NDHotKeyEvent *spamHotKey;
|
||||
|
||||
NowPlayingBarController *nowPlaying;
|
||||
|
||||
AppleRemote *remote;
|
||||
BOOL remoteButtonHeld; /* true as long as the user holds the left,right,plus or minus on the remote control */
|
||||
|
|
|
@ -271,6 +271,9 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
|||
[playbackController playEntryAtIndex:lastIndex];
|
||||
[playbackController seek:[NSNumber numberWithDouble:[[NSUserDefaults standardUserDefaults] floatForKey:@"lastTrackPosition"]]];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterFullscreen) name:NSWindowDidEnterFullScreenNotification object:mainWindow];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitFullscreen) name:NSWindowDidExitFullScreenNotification object:mainWindow];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification
|
||||
|
@ -513,6 +516,50 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
|||
}
|
||||
}
|
||||
|
||||
- (void)enterFullscreen
|
||||
{
|
||||
NSLog(@"Entering fullscreen");
|
||||
if (nil == nowPlaying)
|
||||
{
|
||||
nowPlaying = [[NowPlayingBarController alloc] init];
|
||||
[nowPlaying retain];
|
||||
|
||||
NSView *contentView = [mainWindow contentView];
|
||||
NSRect contentRect = [contentView frame];
|
||||
const NSSize windowSize = [contentView convertSize:[mainWindow frame].size fromView: nil];
|
||||
|
||||
NSRect nowPlayingFrame = [[nowPlaying view] frame];
|
||||
nowPlayingFrame.size.width = windowSize.width;
|
||||
[[nowPlaying view] setFrame: nowPlayingFrame];
|
||||
|
||||
[contentView addSubview: [nowPlaying view]];
|
||||
[[nowPlaying view] setFrameOrigin: NSMakePoint(0.0, NSMaxY(contentRect) - nowPlayingFrame.size.height)];
|
||||
|
||||
NSRect mainViewFrame = [mainView frame];
|
||||
mainViewFrame.size.height -= nowPlayingFrame.size.height;
|
||||
[mainView setFrame:mainViewFrame];
|
||||
|
||||
[[nowPlaying text] bind:@"value" toObject:currentEntryController withKeyPath:@"content.display" options:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)exitFullscreen
|
||||
{
|
||||
NSLog(@"Exiting fullscreen");
|
||||
if (nowPlaying)
|
||||
{
|
||||
NSRect nowPlayingFrame = [[nowPlaying view] frame];
|
||||
NSRect mainViewFrame = [mainView frame];
|
||||
mainViewFrame.size.height += nowPlayingFrame.size.height;
|
||||
[mainView setFrame:mainViewFrame];
|
||||
// [mainView setFrameOrigin:NSMakePoint(0.0, 0.0)];
|
||||
|
||||
[[nowPlaying view] removeFromSuperview];
|
||||
[nowPlaying release];
|
||||
nowPlaying = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)clickPlay
|
||||
{
|
||||
[playbackController playPauseResume:self];
|
||||
|
|
|
@ -148,6 +148,9 @@
|
|||
8359009D17FF06570060F3ED /* ArchiveSource.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8359FF3117FEF35D0060F3ED /* ArchiveSource.bundle */; };
|
||||
8360EF6D17F92E56005208A4 /* HighlyComplete.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8360EF0517F92B24005208A4 /* HighlyComplete.bundle */; };
|
||||
8375B36517FFEF130092A79F /* Opus.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8375B05717FFEA410092A79F /* Opus.bundle */; };
|
||||
838491211807F38A00E7332D /* NowPlayingBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8384911D1807F38A00E7332D /* NowPlayingBarView.m */; };
|
||||
838491221807F38A00E7332D /* NowPlayingBarController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8384911E1807F38A00E7332D /* NowPlayingBarController.xib */; };
|
||||
838491231807F38A00E7332D /* NowPlayingBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8384911F1807F38A00E7332D /* NowPlayingBarController.m */; };
|
||||
8399D4E21805A55000B503B1 /* XmlContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8399D4E01805A55000B503B1 /* XmlContainer.m */; };
|
||||
83BCB8DE17FC971300760340 /* FFMPEG.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = B09E94350D747F7B0064F138 /* FFMPEG.bundle */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
|
@ -737,6 +740,11 @@
|
|||
8359FF2C17FEF35C0060F3ED /* ArchiveSource.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ArchiveSource.xcodeproj; path = Plugins/ArchiveSource/ArchiveSource.xcodeproj; sourceTree = "<group>"; };
|
||||
8360EF0017F92B23005208A4 /* HighlyComplete.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = HighlyComplete.xcodeproj; path = Plugins/HighlyComplete/HighlyComplete.xcodeproj; sourceTree = "<group>"; };
|
||||
8375B05117FFEA400092A79F /* Opus.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Opus.xcodeproj; path = Plugins/Opus/Opus.xcodeproj; sourceTree = "<group>"; };
|
||||
8384911D1807F38A00E7332D /* NowPlayingBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NowPlayingBarView.m; path = Window/NowPlayingBarView.m; sourceTree = "<group>"; };
|
||||
8384911E1807F38A00E7332D /* NowPlayingBarController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = NowPlayingBarController.xib; path = Window/NowPlayingBarController.xib; sourceTree = "<group>"; };
|
||||
8384911F1807F38A00E7332D /* NowPlayingBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NowPlayingBarController.m; path = Window/NowPlayingBarController.m; sourceTree = "<group>"; };
|
||||
838491201807F38A00E7332D /* NowPlayingBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NowPlayingBarController.h; path = Window/NowPlayingBarController.h; sourceTree = "<group>"; };
|
||||
838491241807F75D00E7332D /* NowPlayingBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NowPlayingBarView.h; path = Window/NowPlayingBarView.h; sourceTree = "<group>"; };
|
||||
8399D4E01805A55000B503B1 /* XmlContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XmlContainer.m; sourceTree = "<group>"; };
|
||||
8399D4E11805A55000B503B1 /* XmlContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XmlContainer.h; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
|
@ -1174,6 +1182,10 @@
|
|||
17E0D5D20F520E75005B6FED /* Window */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8384911D1807F38A00E7332D /* NowPlayingBarView.m */,
|
||||
838491241807F75D00E7332D /* NowPlayingBarView.h */,
|
||||
8384911F1807F38A00E7332D /* NowPlayingBarController.m */,
|
||||
838491201807F38A00E7332D /* NowPlayingBarController.h */,
|
||||
1752C36A0F59E00100F85F28 /* PlaybackButtons.h */,
|
||||
1752C36B0F59E00100F85F28 /* PlaybackButtons.m */,
|
||||
172A123A0F5912AE0078EF0C /* ShuffleTransformers.h */,
|
||||
|
@ -1282,6 +1294,7 @@
|
|||
178456C00F6320B5007E8021 /* SpotlightPanel.xib */,
|
||||
17E41E060C130DFF00AC744D /* Credits.html */,
|
||||
17D1B1DA0F6330D400694C57 /* Feedback.xib */,
|
||||
8384911E1807F38A00E7332D /* NowPlayingBarController.xib */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
|
@ -1821,6 +1834,7 @@
|
|||
1791005E0CB44D6D0070BC5C /* Cog.scriptSuite in Resources */,
|
||||
1791005F0CB44D6D0070BC5C /* Cog.scriptTerminology in Resources */,
|
||||
17D1B27D0CF8B2830028F5B5 /* cue.icns in Resources */,
|
||||
838491221807F38A00E7332D /* NowPlayingBarController.xib in Resources */,
|
||||
17D1B27E0CF8B2830028F5B5 /* it.icns in Resources */,
|
||||
17D1B27F0CF8B2830028F5B5 /* pls.icns in Resources */,
|
||||
17D1B2800CF8B2830028F5B5 /* s3m.icns in Resources */,
|
||||
|
@ -1894,6 +1908,7 @@
|
|||
8E9A30160BA792DC0091081B /* NSFileHandle+CreateFile.m in Sources */,
|
||||
179790E10C087AB7001D6996 /* OpenURLPanel.m in Sources */,
|
||||
1791FF900CB43A2C0070BC5C /* MediaKeysApplication.m in Sources */,
|
||||
838491211807F38A00E7332D /* NowPlayingBarView.m in Sources */,
|
||||
178BAB990CD4E1B700B33D47 /* GCOneShotEffectTimer.m in Sources */,
|
||||
178BAB9A0CD4E1B700B33D47 /* GCWindowMenu.m in Sources */,
|
||||
178BAB9B0CD4E1B700B33D47 /* PopupButton.m in Sources */,
|
||||
|
@ -1923,6 +1938,7 @@
|
|||
07D971E60ED1DAA800E7602E /* TagEditorController.m in Sources */,
|
||||
173A43A10F3FD26500676A7B /* ToolTipWindow.m in Sources */,
|
||||
17E0D5E90F520F02005B6FED /* DualWindow.m in Sources */,
|
||||
838491231807F38A00E7332D /* NowPlayingBarController.m in Sources */,
|
||||
17E0D5EA0F520F02005B6FED /* MainWindow.m in Sources */,
|
||||
17E0D5EB0F520F02005B6FED /* MiniWindow.m in Sources */,
|
||||
17E0D5EC0F520F02005B6FED /* PositionSlider.m in Sources */,
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="994CBAE0-3E74-406B-959D-9367068C0CF9" id="1801">
|
||||
<imageCell key="dataCell" controlSize="small" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="139EAE20-7EF7-4D8B-B72A-E18459698F54" id="1801">
|
||||
<font key="font" metaFont="system"/>
|
||||
</imageCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
|
@ -1363,8 +1363,10 @@ Gw
|
|||
<customObject id="2405" customClass="PlaybackEventController"/>
|
||||
<customObject id="226" userLabel="AppController" customClass="AppController">
|
||||
<connections>
|
||||
<outlet property="currentEntryController" destination="1897" id="49h-Dv-ved"/>
|
||||
<outlet property="fileButton" destination="1631" id="1661"/>
|
||||
<outlet property="infoButton" destination="1627" id="1663"/>
|
||||
<outlet property="mainView" destination="2123" id="1rG-oa-1Yy"/>
|
||||
<outlet property="mainWindow" destination="21" id="359"/>
|
||||
<outlet property="playbackController" destination="705" id="1300"/>
|
||||
<outlet property="playlistController" destination="218" id="236"/>
|
||||
|
@ -1648,7 +1650,7 @@ Gw
|
|||
<customObject id="2434" customClass="FeedbackController"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="994CBAE0-3E74-406B-959D-9367068C0CF9" width="17" height="17">
|
||||
<image name="139EAE20-7EF7-4D8B-B72A-E18459698F54" width="17" height="17">
|
||||
<mutableData key="keyedArchiveRepresentation">
|
||||
YnBsaXN0MDDUAQIDBAUGRkdYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QDwcI
|
||||
ExQZHh8qKyw0NzpAQ1UkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5T
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// NowPlayingBarController.h
|
||||
// Cog
|
||||
//
|
||||
// Created by Dmitry Promsky on 2/25/12.
|
||||
// Copyright 2012 dmitry.promsky@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NowPlayingBarController : NSViewController
|
||||
{
|
||||
IBOutlet NSTextField *text;
|
||||
}
|
||||
|
||||
- (NSTextField*)text;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// NowPlayingBarController.m
|
||||
// Cog
|
||||
//
|
||||
// Created by Dmitry Promsky on 2/25/12.
|
||||
// Copyright 2012 dmitry.promsky@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NowPlayingBarController.h"
|
||||
|
||||
@implementation NowPlayingBarController
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super initWithNibName:@"NowPlayingBarController" bundle:nil];
|
||||
if (self)
|
||||
{
|
||||
// Initialization code here.
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSTextField*)text
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,204 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1070</int>
|
||||
<string key="IBDocument.SystemVersion">11D50b</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1617</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.32</string>
|
||||
<string key="IBDocument.HIToolboxVersion">568.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">1617</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSCustomView</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSCustomObject</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</array>
|
||||
<dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="NSCustomObject" id="1001">
|
||||
<string key="NSClassName">NowPlayingBarController</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1003">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1004">
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="1005">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">266</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSTextField" id="694180626">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">266</int>
|
||||
<string key="NSFrame">{{0, 4}, {480, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:3936</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="969413413">
|
||||
<int key="NSCellFlags">70385217</int>
|
||||
<int key="NSCellFlags2">138413056</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<string key="NSCellIdentifier">_NS:3936</string>
|
||||
<reference key="NSControlView" ref="694180626"/>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{480, 24}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="694180626"/>
|
||||
<string key="NSClassName">NowPlayingBarView</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1005"/>
|
||||
</object>
|
||||
<int key="connectionID">2</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">text</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="694180626"/>
|
||||
</object>
|
||||
<int key="connectionID">6</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="1001"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="1003"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">First Responder</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-3</int>
|
||||
<reference key="object" ref="1004"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Application</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="1005"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="694180626"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">3</int>
|
||||
<reference key="object" ref="694180626"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="969413413"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="969413413"/>
|
||||
<reference key="parent" ref="694180626"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">6</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NowPlayingBarController</string>
|
||||
<string key="superclassName">NSViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">text</string>
|
||||
<string key="NS.object.0">NSTextField</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">text</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">text</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/NowPlayingBarController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NowPlayingBarView</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/NowPlayingBarView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
</data>
|
||||
</archive>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// NowPlayingBarView.h
|
||||
// Cog
|
||||
//
|
||||
// Created by Dmitry Promsky on 2/24/12.
|
||||
// Copyright 2012 dmitry.promsky@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NowPlayingBarView : NSView
|
||||
{
|
||||
NSGradient *gradient;
|
||||
}
|
||||
@end
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
//
|
||||
// NowPlayingBarView.m
|
||||
// Cog
|
||||
//
|
||||
// Created by Dmitry Promsky on 2/24/12.
|
||||
// Copyright 2012 dmitry.promsky@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NowPlayingBarView.h"
|
||||
|
||||
@implementation NowPlayingBarView
|
||||
|
||||
- (id)initWithFrame:(NSRect)rect
|
||||
{
|
||||
if ((self = [super initWithFrame: rect]))
|
||||
{
|
||||
NSColor *lightColor = [NSColor colorWithCalibratedRed: 160.0/255.0 green: 160.0/255.0 blue: 160.0/255.0 alpha: 1.0];
|
||||
NSColor *darkColor = [NSColor colorWithCalibratedRed: 155.0/255.0 green: 155.0/255.0 blue: 155.0/255.0 alpha: 1.0];
|
||||
gradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
const BOOL active = [[self window] isMainWindow];
|
||||
|
||||
NSInteger count = 0;
|
||||
NSRect gridRects[2];
|
||||
NSColor * colorRects[2];
|
||||
|
||||
NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
|
||||
|
||||
if (NSIntersectsRect(lineBorderRect, rect))
|
||||
{
|
||||
gridRects[count] = lineBorderRect;
|
||||
colorRects[count] = [NSColor colorWithCalibratedWhite: 0.75 alpha: 1.0];
|
||||
++count;
|
||||
|
||||
rect.size.height -= 1.0;
|
||||
}
|
||||
|
||||
lineBorderRect.origin.y = 0.0;
|
||||
if (NSIntersectsRect(lineBorderRect, rect))
|
||||
{
|
||||
gridRects[count] = lineBorderRect;
|
||||
colorRects[count] = active ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
|
||||
: [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
|
||||
++count;
|
||||
|
||||
rect.origin.y += 1.0;
|
||||
rect.size.height -= 1.0;
|
||||
}
|
||||
|
||||
if (!NSIsEmptyRect(rect))
|
||||
{
|
||||
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
|
||||
[gradient drawInRect: gradientRect angle: 270.0];
|
||||
}
|
||||
|
||||
NSRectFillListWithColors(gridRects, colorRects, count);
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[gradient release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue