Skip to content

Commit

Permalink
forgot to commit changes, :P
Browse files Browse the repository at this point in the history
  • Loading branch information
softboysxp committed Feb 10, 2011
1 parent 282cccd commit ace44ed
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 181 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
.DS_Store
*xcworkspace*
*xcuserdata*
iTunes.h

26 changes: 26 additions & 0 deletions NowPlaying.xcodeproj/project.pbxproj
Expand Up @@ -17,6 +17,10 @@
80A0B3F91302C824002128B3 /* NowPlayingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 80A0B3F81302C824002128B3 /* NowPlayingAppDelegate.m */; };
80A0B3FC1302C825002128B3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 80A0B3FA1302C825002128B3 /* MainMenu.xib */; };
80A0B4041302C8C4002128B3 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 80A0B4031302C8C4002128B3 /* Icon.icns */; };
80C7EAD713047F7A008F0CFE /* Appirater.m in Sources */ = {isa = PBXBuildFile; fileRef = 80C7EAD613047F7A008F0CFE /* Appirater.m */; };
80C7EAD913047FFE008F0CFE /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 80C7EAD813047FFE008F0CFE /* LICENSE */; };
80C7EADB13048053008F0CFE /* README in Resources */ = {isa = PBXBuildFile; fileRef = 80C7EADA13048053008F0CFE /* README */; };
80C7EADD13048429008F0CFE /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80C7EADC13048429008F0CFE /* SystemConfiguration.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -39,13 +43,19 @@
80A0B3F81302C824002128B3 /* NowPlayingAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NowPlayingAppDelegate.m; sourceTree = "<group>"; };
80A0B3FB1302C825002128B3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
80A0B4031302C8C4002128B3 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = "<group>"; };
80C7EAD513047F7A008F0CFE /* Appirater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Appirater.h; sourceTree = "<group>"; };
80C7EAD613047F7A008F0CFE /* Appirater.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Appirater.m; sourceTree = "<group>"; };
80C7EAD813047FFE008F0CFE /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
80C7EADA13048053008F0CFE /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
80C7EADC13048429008F0CFE /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
80A0B3DE1302C824002128B3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
80C7EADD13048429008F0CFE /* SystemConfiguration.framework in Frameworks */,
802C55F913030F8B00D601A9 /* ScriptingBridge.framework in Frameworks */,
808FD9081302F0BC00F9948D /* QuartzCore.framework in Frameworks */,
80A0B3E61302C824002128B3 /* Cocoa.framework in Frameworks */,
Expand Down Expand Up @@ -87,6 +97,7 @@
80A0B3E51302C824002128B3 /* Cocoa.framework */,
808FD9071302F0BC00F9948D /* QuartzCore.framework */,
802C55F813030F8B00D601A9 /* ScriptingBridge.framework */,
80C7EADC13048429008F0CFE /* SystemConfiguration.framework */,
80A0B3E71302C824002128B3 /* Other Frameworks */,
);
name = Frameworks;
Expand All @@ -105,6 +116,7 @@
80A0B3EB1302C824002128B3 /* NowPlaying */ = {
isa = PBXGroup;
children = (
80C7EAD313047F61008F0CFE /* Appirater */,
803957EC1304242F00C0CD17 /* UI */,
802C55F613030F7D00D601A9 /* iTunes.h */,
80A0B3F71302C824002128B3 /* NowPlayingAppDelegate.h */,
Expand All @@ -124,10 +136,21 @@
80A0B3F11302C824002128B3 /* NowPlaying-Prefix.pch */,
80A0B3F21302C824002128B3 /* main.m */,
80A0B3F41302C824002128B3 /* Credits.rtf */,
80C7EAD813047FFE008F0CFE /* LICENSE */,
80C7EADA13048053008F0CFE /* README */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
80C7EAD313047F61008F0CFE /* Appirater */ = {
isa = PBXGroup;
children = (
80C7EAD513047F7A008F0CFE /* Appirater.h */,
80C7EAD613047F7A008F0CFE /* Appirater.m */,
);
name = Appirater;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -179,6 +202,8 @@
80A0B3F61302C824002128B3 /* Credits.rtf in Resources */,
80A0B3FC1302C825002128B3 /* MainMenu.xib in Resources */,
80A0B4041302C8C4002128B3 /* Icon.icns in Resources */,
80C7EAD913047FFE008F0CFE /* LICENSE in Resources */,
80C7EADB13048053008F0CFE /* README in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -192,6 +217,7 @@
80A0B3F31302C824002128B3 /* main.m in Sources */,
80A0B3F91302C824002128B3 /* NowPlayingAppDelegate.m in Sources */,
803957F01304246400C0CD17 /* TrackInfoView.m in Sources */,
80C7EAD713047F7A008F0CFE /* Appirater.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
6 changes: 3 additions & 3 deletions NowPlaying/Appirater.h
Expand Up @@ -48,7 +48,7 @@ extern NSString *const kAppiraterDeclinedToRate;
/*
Place your Apple generated software id here.
*/
#define APPIRATER_APP_ID 301377083
#define APPIRATER_APP_ID 413533448

/*
Your app's name.
Expand Down Expand Up @@ -85,7 +85,7 @@ extern NSString *const kAppiraterDeclinedToRate;
Users will need to have the same version of your app installed for this many
days before they will be prompted to rate it.
*/
#define APPIRATER_DAYS_UNTIL_PROMPT 30 // double
#define APPIRATER_DAYS_UNTIL_PROMPT 0 // double

/*
An example of a 'use' would be if the user launched the app. Bringing the app
Expand All @@ -97,7 +97,7 @@ extern NSString *const kAppiraterDeclinedToRate;
Users need to 'use' the same version of the app this many times before
before they will be prompted to rate it.
*/
#define APPIRATER_USES_UNTIL_PROMPT 20 // integer
#define APPIRATER_USES_UNTIL_PROMPT 7 // integer

/*
A significant event can be anything you want to be in your app. In a
Expand Down
12 changes: 6 additions & 6 deletions NowPlaying/Appirater.m
Expand Up @@ -124,12 +124,12 @@ - (BOOL)ratingConditionsHaveBeenMet {
return NO;

// check if the app has been used enough
int useCount = [userDefaults integerForKey:kAppiraterUseCount];
NSInteger useCount = [userDefaults integerForKey:kAppiraterUseCount];
if (useCount <= APPIRATER_USES_UNTIL_PROMPT)
return NO;

// check if the user has done enough significant events
int sigEventCount = [userDefaults integerForKey:kAppiraterSignificantEventCount];
NSInteger sigEventCount = [userDefaults integerForKey:kAppiraterSignificantEventCount];
if (sigEventCount <= APPIRATER_SIG_EVENTS_UNTIL_PROMPT)
return NO;

Expand Down Expand Up @@ -178,11 +178,11 @@ - (void)incrementUseCount {
}

// increment the use count
int useCount = [userDefaults integerForKey:kAppiraterUseCount];
NSInteger useCount = [userDefaults integerForKey:kAppiraterUseCount];
useCount++;
[userDefaults setInteger:useCount forKey:kAppiraterUseCount];
if (APPIRATER_DEBUG)
NSLog(@"APPIRATER Use count: %d", useCount);
NSLog(@"APPIRATER Use count: %ld", useCount);
}
else
{
Expand Down Expand Up @@ -226,11 +226,11 @@ - (void)incrementSignificantEventCount {
}

// increment the significant event count
int sigEventCount = [userDefaults integerForKey:kAppiraterSignificantEventCount];
NSInteger sigEventCount = [userDefaults integerForKey:kAppiraterSignificantEventCount];
sigEventCount++;
[userDefaults setInteger:sigEventCount forKey:kAppiraterSignificantEventCount];
if (APPIRATER_DEBUG)
NSLog(@"APPIRATER Significant event count: %d", sigEventCount);
NSLog(@"APPIRATER Significant event count: %ld", sigEventCount);
}
else
{
Expand Down
8 changes: 8 additions & 0 deletions NowPlaying/LICENSE
@@ -0,0 +1,8 @@
Copyright 2010 softboysxp.com. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11 changes: 11 additions & 0 deletions NowPlaying/NowPlayingAppDelegate.h
@@ -1,3 +1,14 @@
/*
Copyright 2010 softboysxp.com. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

//
// NowPlayingAppDelegate.h
// NowPlaying
Expand Down
15 changes: 15 additions & 0 deletions NowPlaying/NowPlayingAppDelegate.m
@@ -1,3 +1,14 @@
/*
Copyright 2010 softboysxp.com. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

//
// NowPlayingAppDelegate.m
// NowPlaying
Expand All @@ -10,6 +21,8 @@

#import "iTunes.h"

#import "Appirater.h"

#import "TrackInfoView.h"

#define SYSTEM_STATUS_BAR_HEIGHT ([[NSStatusBar systemStatusBar] thickness])
Expand Down Expand Up @@ -253,6 +266,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[self updateTrack];

[NSTimer scheduledTimerWithTimeInterval:UPDATE_INTERVAL target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES];

[Appirater appLaunched:YES];
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
Expand Down
6 changes: 6 additions & 0 deletions NowPlaying/README
@@ -0,0 +1,6 @@
NowPlaying for Mac is [available in the Mac App Store](http://itunes.apple.com/us/app/nowplaying-for-mac/id413533448?mt=12)

While being a paid app in MAS, NowPlaying for Mac is still free (in the sense of 'freedom') software licensed under the New BSD License.

# GLUE CODE
The "iTunes.h" file is generated with Scripting Bridge and is not included in the git repo to avoid copyright issues. You can follow the instructions [here](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/Introduction/Introduction.html) to generate iTunes.h.
11 changes: 11 additions & 0 deletions NowPlaying/TrackInfoView.h
@@ -1,3 +1,14 @@
/*
Copyright 2010 softboysxp.com. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

//
// TrackInfoView.h
// NowPlaying
Expand Down
11 changes: 11 additions & 0 deletions NowPlaying/TrackInfoView.m
@@ -1,3 +1,14 @@
/*
Copyright 2010 softboysxp.com. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

//
// TrackInfoView.m
// NowPlaying
Expand Down
4 changes: 2 additions & 2 deletions NowPlaying/en.lproj/Credits.rtf
Expand Up @@ -7,8 +7,8 @@

\f0\b\fs24 \cf0 Website\
\pard\tx560\pardeftab560\ri-340\qc
{\field{\*\fldinst{HYPERLINK "http://softboysxp.com/"}}{\fldrslt
\b0 \cf2 \ul \ulc2 http://softboysxp.com/}}
{\field{\*\fldinst{HYPERLINK "https://github.com/softboysxp/NowPlaying"}}{\fldrslt
\b0 \cf2 \ul \ulc2 https://github.com/softboysxp/NowPlaying}}
\b0 \
\
\pard\tx560\pardeftab560\ri-340\qc
Expand Down

0 comments on commit ace44ed

Please sign in to comment.