Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from dieskim/master
Browse files Browse the repository at this point in the history
Thank you for great pull request.
  • Loading branch information
hoyo committed Feb 23, 2015
2 parents 9e3a3c0 + c88c2bb commit d9a30a2
Show file tree
Hide file tree
Showing 18 changed files with 530 additions and 375 deletions.
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TiRemoteControl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.appcelerator.titanium.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.appcelerator.titanium.mobile.module.nature</nature>
</natures>
</projectDescription>
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.1 (10 March 2013)
----
- First release.

0.1.1 (Jan 2015)
----
- Added ability to set albumArtwork via URL for lockscreen info (@kossso)

0.1.2 (Feb 2015)
----
- Added 64Bit Support (@dieskim)
14 changes: 14 additions & 0 deletions Classes/NetHoyohoyoTiremotecontrolModule.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,26 @@ -(void)setNowPlayingInfo:(id)args
NSString *title = [TiUtils stringValue:@"title" properties:args def:@""];
NSString *albumTitle = [TiUtils stringValue:@"albumTitle" properties:args def:@""];

NSString *albumArtwork = [TiUtils stringValue:@"albumArtwork" properties:args def:nil];

Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");

if (playingInfoCenter) {

NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init];

if(albumArtwork != nil){

UIImage *artworkImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:albumArtwork]]];

MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage:artworkImage];
[songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork];
}

[songInfo setObject:artist forKey:MPMediaItemPropertyArtist];
[songInfo setObject:title forKey:MPMediaItemPropertyTitle];
[songInfo setObject:albumTitle forKey:MPMediaItemPropertyAlbumTitle];

[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];
}
}
Expand Down
151 changes: 0 additions & 151 deletions README

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This module makes your titanium applications to extend AV-related functions of i
- You can handle events of earphone's remote-control. (play, pause, nextTrack and so on.)
- You can show some information of playing track to a locked screen and etc.

- Update : Added albumArtwork (using URL) to lockscreen info. (@Kosso)

How to Use
----
Expand All @@ -16,7 +17,8 @@ var Control = require('net.hoyohoyo.tiremotecontrol');
Control.setNowPlayingInfo({
artist: 'someone',
title: 'Happy Birthday to You',
albumTitle: 'unknown'
albumTitle: 'unknown',
albumArtwork : 'http://an.image.url'
});

Control.addEventListener('remotecontrol', function(e) {
Expand Down
61 changes: 22 additions & 39 deletions TiRemoteControl.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXAggregateTarget section */
Expand Down Expand Up @@ -152,8 +152,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
};
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "TiRemoteControl" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -214,15 +217,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ARCHS = (
armv6,
armv7,
);
"ARCHS[sdk=iphoneos*]" = (
armv6,
armv7,
);
"ARCHS[sdk=iphonesimulator*]" = i386;
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
"ARCHS[sdk=iphonesimulator*]" = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DSTROOT = /tmp/NetHoyohoyoTiremotecontrol.dst;
Expand All @@ -231,6 +227,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NetHoyohoyoTiremotecontrol_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
GCC_THUMB_SUPPORT = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = NO;
Expand All @@ -242,6 +239,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LIBRARY_SEARCH_PATHS = "";
OTHER_CFLAGS = (
"-DDEBUG",
Expand All @@ -262,21 +260,15 @@
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
armv7,
);
"ARCHS[sdk=iphoneos*]" = (
armv6,
armv7,
);
"ARCHS[sdk=iphonesimulator*]" = i386;
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
"ARCHS[sdk=iphonesimulator*]" = "$(ARCHS_STANDARD)";
DSTROOT = /tmp/NetHoyohoyoTiremotecontrol.dst;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NetHoyohoyoTiremotecontrol_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
GCC_THUMB_SUPPORT = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = NO;
Expand All @@ -288,7 +280,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LIBRARY_SEARCH_PATHS = "";
OTHER_CFLAGS = "-DTI_POST_1_2";
OTHER_LDFLAGS = "-ObjC";
Expand All @@ -303,15 +295,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ARCHS = (
armv6,
armv7,
);
"ARCHS[sdk=iphoneos*]" = (
armv6,
armv7,
);
"ARCHS[sdk=iphonesimulator*]" = i386;
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
"ARCHS[sdk=iphonesimulator*]" = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DSTROOT = /tmp/NetHoyohoyoTiremotecontrol.dst;
Expand All @@ -320,6 +305,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NetHoyohoyoTiremotecontrol_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
GCC_THUMB_SUPPORT = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = NO;
Expand All @@ -331,6 +317,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DDEBUG",
"-DTI_POST_1_2",
Expand All @@ -350,21 +337,15 @@
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
armv7,
);
"ARCHS[sdk=iphoneos*]" = (
armv6,
armv7,
);
"ARCHS[sdk=iphonesimulator*]" = i386;
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
"ARCHS[sdk=iphonesimulator*]" = "$(ARCHS_STANDARD)";
DSTROOT = /tmp/NetHoyohoyoTiremotecontrol.dst;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NetHoyohoyoTiremotecontrol_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)";
GCC_THUMB_SUPPORT = NO;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = NO;
Expand Down Expand Up @@ -393,6 +374,7 @@
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_THUMB_SUPPORT = NO;
PRODUCT_NAME = "Build & test";
};
name = Debug;
Expand All @@ -404,6 +386,7 @@
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_THUMB_SUPPORT = NO;
PRODUCT_NAME = "Build & test";
ZERO_LINK = NO;
};
Expand Down
Loading

0 comments on commit d9a30a2

Please sign in to comment.