- (BOOL)songIsPlaying
{
- NSString *identifier;
+ NSString *identifier = nil;
NS_DURING
identifier = [[self currentRemote] playerStateUniqueIdentifier];
NS_HANDLER
- (BOOL)radioIsPlaying
{
- ITMTRemotePlayerPlaylistClass class;
+ ITMTRemotePlayerPlaylistClass class = nil;
NS_DURING
class = [[self currentRemote] currentPlaylistClass];
NS_HANDLER
- (BOOL)songChanged
{
- NSString *identifier;
+ NSString *identifier = nil;
NS_DURING
identifier = [[self currentRemote] playerStateUniqueIdentifier];
NS_HANDLER
[[PreferencesController sharedPrefs] showPrefsWindow:self];
}
+- (void)showTestWindow
+{
+ [self showCurrentTrackInfo];
+}
+
- (void)quitMenuTunes
{
ITDebugLog(@"Quitting MenuTunes.");
- (void)showCurrentTrackInfo
{
- ITMTRemotePlayerSource source;
- NSString *title;
+ ITMTRemotePlayerSource source = 0;
+ NSString *title = nil;
NSString *album = nil;
NSString *artist = nil;
NSString *time = nil;
}
if ( [df boolForKey:@"showTrackNumber"] ) {
- int trackNo;
- int trackCount;
+ int trackNo = 0;
+ int trackCount = 0;
NS_DURING
trackNo = [[self currentRemote] currentSongTrack];
}
if ( [df boolForKey:@"showTrackRating"] ) {
- float currentRating;
+ float currentRating = 0;
NS_DURING
currentRating = [[self currentRemote] currentSongRating];
- (void)showUpcomingSongs
{
- int numSongs;
+ int numSongs = 0;
NS_DURING
numSongs = [[self currentRemote] numberOfSongsInPlaylistAtIndex:[[self currentRemote] currentPlaylistIndex]];
NS_HANDLER
IBOutlet NSPopUpButton *appearanceEffectPopup;
IBOutlet NSSlider *appearanceSpeedSlider;
IBOutlet NSButton *artistCheckbox;
+ IBOutlet NSPopUpButton *backgroundStylePopup;
+ IBOutlet NSColorWell *backgroundColorWell;
IBOutlet NSTextField *clientPasswordTextField;
IBOutlet NSTextField *hostTextField;
IBOutlet NSTableView *hotKeysTableView;
- (IBAction)clearHotKey:(id)sender;
- (IBAction)editHotKey:(id)sender;
- (IBAction)showPrefsWindow:(id)sender;
+- (IBAction)showTestWindow:(id)sender;
- (void)registerDefaults;
- (void)deletePressedInTableView:(NSTableView *)tableView;
#import <ITKit/ITWindowPositioning.h>
#import <ITKit/ITKeyBroadcaster.h>
+#import <ITKit/ITTSWBackgroundView.h>
#import <ITKit/ITCutWindowEffect.h>
#import <ITKit/ITDissolveWindowEffect.h>
#import <ITKit/ITSlideHorizontallyWindowEffect.h>
controller = nil;
[self setupWindow]; // Load in the nib, and perform any initial setup.
+ [[NSColorPanel sharedColorPanel] setShowsAlpha:YES];
}
return self;
}
[window performSelector:@selector(makeKeyAndOrderFront:) withObject:self afterDelay:0.0];
}
+- (IBAction)showTestWindow:(id)sender
+{
+ [controller showTestWindow];
+}
+
- (IBAction)changeGeneralSetting:(id)sender
{
ITDebugLog(@"Changing general setting of tag %i.", [sender tag]);
[sw setExitDelay:[sender floatValue]];
} else if ( [sender tag] == 2080) {
[df setBool:SENDER_STATE forKey:@"showSongInfoOnChange"];
+ } else if ( [sender tag] == 2090) {
+
+ int setting = [sender indexOfSelectedItem];
+
+ if ( setting == 0 ) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundApple];
+ [backgroundColorWell setEnabled:NO];
+ } else if ( setting == 1 ) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundReadable];
+ [backgroundColorWell setEnabled:NO];
+ } else if ( setting == 2 ) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundColored];
+ [backgroundColorWell setEnabled:YES];
+ }
+
+ [df setInteger:setting forKey:@"statusWindowBackgroundMode"];
+
+ } else if ( [sender tag] == 2091) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundColor:[sender color]];
+ [df setObject:[NSArchiver archivedDataWithRootObject:[sender color]] forKey:@"statusWindowBackgroundColor"];
}
+
[df synchronize];
}
NSMutableArray *loginarray;
NSEnumerator *loginEnum, *keyArrayEnum;
NSString *serverName;
+ int selectedBGStyle;
id anItem;
ITDebugLog(@"Setting up preferences UI.");
[appearanceSpeedSlider setFloatValue:-([df floatForKey:@"statusWindowAppearanceSpeed"])];
[vanishSpeedSlider setFloatValue:-([df floatForKey:@"statusWindowVanishSpeed"])];
[vanishDelaySlider setFloatValue:[df floatForKey:@"statusWindowVanishDelay"]];
- [showOnChangeCheckbox setState:([df boolForKey:@"showSongInfoOnChange"] ? NSOnState : NSOffState)];
+
+ // Setup General Controls
+ selectedBGStyle = [df integerForKey:@"statusWindowBackgroundMode"];
+ [backgroundStylePopup selectItem:[backgroundStylePopup itemAtIndex:[backgroundStylePopup indexOfItemWithTag:selectedBGStyle]]];
+
+ if ( selectedBGStyle == ITTSWBackgroundColored ) {
+ [backgroundColorWell setEnabled:YES];
+ } else {
+ [backgroundColorWell setEnabled:NO];
+ }
+
+ [backgroundColorWell setColor:(NSColor *)[NSUnarchiver unarchiveObjectWithData:[df dataForKey:@"statusWindowBackgroundColor"]]];
+ [showOnChangeCheckbox setState:([df boolForKey:@"showSongInfoOnChange"] ? NSOnState : NSOffState)];
+
// Setup the sharing controls
if ([df boolForKey:@"enableSharing"]) {
[shareMenuTunesCheckbox setState:NSOnState];
NSString *object = [myItems objectAtIndex:rowIndex];
if ([[aTableColumn identifier] isEqualToString:@"name"]) {
if ([object isEqualToString:@"showPlayer"]) {
- NSString *string;
+ NSString *string = nil;
NS_DURING
string = [NSString stringWithFormat:@"%@ %@", NSLocalizedString(@"show", @"Show"), [[controller currentRemote] playerSimpleName]];
NS_HANDLER
NSString *object = [availableItems objectAtIndex:rowIndex];
if ([[aTableColumn identifier] isEqualToString:@"name"]) {
if ([object isEqualToString:@"showPlayer"]) {
- NSString *string;
+ NSString *string = nil;
NS_DURING
string = [NSString stringWithFormat:@"%@ %@", NSLocalizedString(@"show", @"Show"), [[controller currentRemote] playerSimpleName]];
NS_HANDLER
#import "PreferencesController.h"
#import "MainController.h"
+#import <ITKit/ITTSWBackgroundView.h>
#import <ITKit/ITWindowEffect.h>
#import <ITKit/ITCutWindowEffect.h>
#import <ITKit/ITDissolveWindowEffect.h>
[[_window entryEffect] setEffectTime:(entrySpeed ? entrySpeed : 0.8)];
[[_window exitEffect] setEffectTime:(exitSpeed ? exitSpeed : 0.8)];
+
+ [(ITTSWBackgroundView *)[_window contentView]setBackgroundMode:
+ (ITTSWBackgroundMode)[df integerForKey:@"statusWindowBackgroundMode"]];
+
+ [(ITTSWBackgroundView *)[_window contentView]setBackgroundColor:
+ (NSColor *)[NSUnarchiver unarchiveObjectWithData:[df dataForKey:@"statusWindowBackgroundColor"]]];
}
return self;