[OSX][iOS]調と調号
音楽関連アプリケーションも興味がある分野だ。アプリケーション開発の為に調べたことを記事にしてみた。
- アートのための数学/オーム社
- ¥2,100
- Amazon.co.jp
調と調号の関係を図にしてみた。
ハ長調 C C#D D#E F F#G G#A A#B C C#D D#E F F#G G#A A#B C
□■□■□□■□■□■□□■□■□□■□■□■□□
全 全 半全 全 全 半全 全 半全 全 全 半全
ト長調 #→ #→
全 全 全 半全 全 半全 全 全 半全 全 半全
↑主音 ↑主音
ニ長調 #→ #→ #→ #→
半全 全 半全 全 全 半全 全 半全 全 全
↑主音 ↑主音
嬰(シャープ)や変(フラット)で変化できる音は決まっていて、これをやるというのは、全音と半音がずれるという事で、長調の場合、全全半全全全半とう並びがずれるという理解で良さそうだ。
関連情報
超やさしい楽譜の読み方
アートのための数学
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
- 超やさしい楽譜の読み方―これだけは覚えよう!ポイント16/音楽之友社
- ¥840
- Amazon.co.jp
[OSX][iOS]音階
音階の周波数と比を調べてみた。
C | C# | D | D# | E | F | F# | G | G# | A | A# | B | C | C# | D | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
周波数 | 261.6300 | 277.19 | 293.66 | 311.13 | 329.63 | 349.23 | 370.00 | 392.00 | 415.31 | 440.00 | 466.17 | 493.88 | 523.26 | 554.37 | 587.34 |
比 | 1.000 | 1.059 | 1.122 | 1.189 | 1.260 | 1.335 | 1.414 | 1.498 | 1.587 | 1.682 | 1.782 | 1.888 | 2.000 | ||
純正律 | 4対 | 5対 | 6対 | ||||||||||||
純正律 | 4対 | 5対 | 6対 | ||||||||||||
純正律 | 4対 | 5対 | 6対 |
周波数と比は平均律の値で、平均率とは1オクターブを均等に12個に分けた音階だ。そして、純正律は「ドミソ」「ソシレ」「ファラド」が4:5:6の比になるようにチューニングした音階だ。
平均律の場合は、純正律と比較すると、整数比になっていなのだが、まあ、近いと考えて、純正律で整数と成っている音階に印をつけると、印がついていない音階は#がついている。
ドレミファは何故12個でない。音と音の距離が全音だったら半音だったり何故?と思っていたのだが、なるほど、響きあう音をドレミにしたということか。
関連情報
超やさしい楽譜の読み方
アートのための数学
- 超やさしい楽譜の読み方―これだけは覚えよう!ポイント16/音楽之友社
- ¥840
- Amazon.co.jp
- アートのための数学/オーム社
- ¥2,100
- Amazon.co.jp
- アートのための数学/オーム社
[OSX][iOS]内容フィルタ
サンプルコードのFilteredViewは、IBActionのスペルが間違っている。なので、スペル間違いを我慢して、FilteredView.mのメソッド名を変更するか、FilteredView.hのIBActionを正しいスペルに変更し、MainMenu.nibのIBActionの繋がりを張り直す必要がある。ちなみに、著者は後者を選択した。
内容フィルタとは、フィルタを適用したビューの下位ビューに適用されるフィルタのことのようだ。
フィルタの定義は以下のとおり。
- (void)pointillize
{
CIVector *center = [CIVector vectorWithX:NSMidX([self bounds])
Y:NSMidY([self bounds])];
CIFilter *pointillize = [CIFilter
filterWithName:@"CIPointillize"
keysAndValues:kCIInputRadiusKey,
[NSNumber numberWithFloat:1.0f],
kCIInputCenterKey, center, nil];
pointillize.name = @"pointillize";
[controls setContentFilters:[NSArray arrayWithObjects:pointillize, nil]];
}
CIPointillizeフィルターは、点描スタイルでレンダリングするフィルタだ。
フィルタを実行するIBActionの記述は以下のとおり。
- (IBAction)noPointillize:(id)sender
{
if (0 < [[controls contentFilters] count]) {
[controls setContentFilters:nil];
}
}
- (IBAction)heavyPointillize:(id)sender
{
if (nil == [controls contentFilters]
|| 0 == [[controls contentFilters] count]) {
[self pointillize];
}
NSString *path = [NSString stringWithFormat:
@"contentFilters.pointillize.%@", kCIInputRadiusKey];
[controls setValue:[NSNumber numberWithInt:5.0f] forKeyPath:path];
}
- (IBAction)lightPointillize:(id)sender
{
if (nil == [controls contentFilters]
|| 0 == [[controls contentFilters] count]) {
[self pointillize];
}
NSString *path = [NSString stringWithFormat:
@"contentFilters.pointillize.%@", kCIInputRadiusKey];
[controls setValue:[NSNumber numberWithInt:1.0f]
forKeyPath:path];
}
Heavy Pointalize(スペル間違い!)ボタンを押下すると、コントロール類が荒い点描に、Light Pointalize(これもスペル間違い!)ボタンを押下すると、コントロール類が細かい点描に。ポップアップするメニューでNo Pointalize(これまたスペル間違い)を選択すると、元に戻る。
関連情報
Core Animation for Max OS X and the iPhone
Core Animation for Max OS X and the iPhone
Core Image プログラミングガイド概論
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
- Core Animation for Max OS X and the iPhone: Cre.../Pragmatic Bookshelf
- ¥3,480
- Amazon.co.jp
関東第58回Cocoa勉強会
前回に引き続いて、新宿三丁目で開催。
チーム開発というタイトルでiOプロビジョニングポータルやredmineについてと、USキーボード利用者を想定して英数/ナカかなキーボードの紹介、アンドゥ/リドゥ管理、performSelectorを使った遅延実行などについての発表があった。
関連情報
Cocoa勉強会
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
[OSX][iOS]背景フィルタ
『Core Animation for Max OS X and the iPhone』の『6.2 Background Filters』について説明する。
背景フィルタは、自身の配下に下位ビューが存在しているビューに対して、フェルタ効果を適用する為の機能だ。そして、当然だが、背景となるビューを下位ビューが不透明で覆い被さっている場合は、意味をなさないものとなる。
サンプルコードのフィルタの定義は以下のとおり。
- (void)applyFilter {
CIVector *center = [CIVector
vectorWithX:NSMidX([self bounds])
Y:NSMidY([self bounds])];
CIFilter *torus = [CIFilter filterWithName:@"CITorusLensDistortion"
keysAndValues:kCIInputCenterKey, center,
kCIInputRadiusKey, [NSNumber numberWithFloat:150.0f],
kCIInputWidthKey, [NSNumber numberWithFloat:2.0f],
kCIInputRefractionKey, [NSNumber numberWithFloat:1.7f],
nil];
torus.name = @"torus";
[controls setBackgroundFilters:[NSArray arrayWithObjects:torus, nil]];
[self addAnimationToTorusFilter];
}
controllsは背景となりビューのことだ。CITorusLensDistortionフィルタの名前を"torus"と設定しているので、これがキーとなる。
アニメーションの定義は以下のとおり。
- (void)addAnimationToTorusFilter {
NSString *keyPath = [NSString stringWithFormat:
@"backgroundFilters.torus.%@",
kCIInputWidthKey];
CABasicAnimation *animation = [CABasicAnimation
animationWithKeyPath:keyPath];
animation.fromValue = [NSNumber numberWithFloat:50.0f];
animation.toValue = [NSNumber numberWithFloat:80.0f];
animation.duration = 1.0;
animation.repeatCount = 1e100f;
animation.timingFunction = [CAMediaTimingFunction functionWithName:
kCAMediaTimingFunctionEaseInEaseOut];
animation.autoreverses = YES;
[[controls layer] addAnimation:animation forKey:@"torusAnimation"];
}
ビューのbackgroundFiltersプロパティに"torus"という名前でフィルタを登録したので、キーパスは"backgroundFilters.torus"となる。そして、操作するキーパスは"backgroundFilters.torus.kCIInputWidthKey"ということなので、フィルタのkCIInputWidthKeyプロパティの値がアニメーションすることになる。
関連情報
Core Animation for Max OS X and the iPhone
Core Animation for Max OS X and the iPhone
Core Image プログラミングガイド概論
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
- Core Animation for Max OS X and the iPhone: Cre.../Pragmatic Bookshelf
- ¥3,480
- Amazon.co.jp
[Web]INTER-MediatorとSQLite
使えるデータベースはSQLiteのみのサイトをINTER-Mediatorで構築してみる。
ツールとして、Coda2とDiet Codaを使ってみたのだが、iPad miniでPHPが編集できるなんて、素晴らしい世の中になったものだ。
SQLiteのデータベースファイルは、事前に生成した物をサイトにアップする事にしたので、スキーム・ファイルの設計が必要だ。
CREATE TABLE person
);
CREATE UNIQUE INDEX person_id ON person (id);
INSERT INTO person(id,membership_number,name) VALUES (1,'012345','Yukio Murakami');
INSERT INTO person(id,membership_number,name) VALUES (2,'000002','Someone');
INSERT INTO person(id,membership_number,name) VALUES (3,'000003','Anyone');
CREATE TABLE attendance
);
CREATE UNIQUE INDEX attendance_id ON attendance (id);
CREATE INDEX attendance_person_id ON attendance (person_id);
INSERT INTO attendance (person_id,class_name,date) VALUES (1,'General','2013-1-6');
INSERT INTO attendance (person_id,class_name,date) VALUES (1,'General','2013-1-11');
INSERT INTO attendance (person_id,class_name,date) VALUES (1,'Special','2013-1-12');
スキーム・ファイルの名前は、rollbook_schema_sqlite.txtとした。
次は、データベースファイルを生成。
$ mkdir db
$ mkdir db/im
$ sudo sqlite3 -init rollbook_schema_sqlite.txt db/im/rollbook.sq3
sqlite> .quit
$ sudo chown _www db/im
$ sudo chown _www db/im/rollbook.sq3
定義ファイルは以下のとおり。
<require_once ('INTER-Mediator/INTER-Mediator.php');
IM_Entry(
array(
array(
'records' => 1,
'paging' => true,
'name' => 'person',
'key' => 'id',
'query' => array( /* array( 'field'=>'id', 'value'=>'5', 'operator'=>'eq' ),*/),
'sort' => array(array('field' => 'id', 'direction' => 'asc'),),
'repeat-control' => 'insert delete',
),
array(
'name' => 'attendance',
'key' => 'id',
'relation' => array(
array('foreign-key' => 'person_id', 'join-field' => 'id', 'operator' => '=')
),
'repeat-control' => 'insert delete',
),
),
array(
'formatter' => array(),
'aliases' => array(
'attendanceid' => 'attendance@person_id@value',
'attendancename' => 'attendance@name_person@innerHTML',
),
),
array(
'db-class' => 'PDO',
'dsn' => 'sqlite:/それぞれの環境のパスを記述/db/im/rollbook.sq3',
),
0
);
?>
実は、第二引数のaliasesに何を指定したらいいのか分かっていない。nullを指定すると上手く動かなかったので、サンプルを見よう見まねで真似た。
ページファイルは、Amebaブログではエラーになったので掲載していない。あしからず。
上手く動いているようだ。
今回、サイト側の作業はCoda2を使ったのだが、便利だね!
関連情報
INTER-Mediator
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
- エレガントなWeb開発・美しいコードCODA入門/技術評論社
- ¥2,604
- Amazon.co.jp
[OSX][iOS]CIPointillizeフィルタ
『Core Animation for Max OS X and the iPhone』によると /Developer/Extras/Core Image/ CI Filter Browser widget (CI Filter Browser.wdgt) が存在するということだが、Xcodeがアプリケーション一体型になったのでDownloads for Apple Developerサイトを確認したところ、Graphics Tools for Xcodeに含まれているということでダウンロードしてみたのだが、含まれていなかった。無くなったのかな?なくても進められるので気にしない事にする。
Core Imageのフィルターの例として、ポインティライズ(CIPointillizeフィルタ)が紹介されていたので、それを前回までのサンプルに組み込んでみる。
文書によると、CIPointillizeには以下のパラメータが存在するようだ。
inputImage: 対象となるCIImageインスタンス
inputRadius: 矩形セルおよびドットのサイズ(1.0~100.0)。
inputCenter: 矩形セルの底辺を指定する値。
inputRadiusの意味はなんとなく分かるのだが、inputCenterがよく分からない。ただ、サンプルでは、対象の中心を指定しているので、真似る事にする。
フィルタの登録は、以下のとおり。
- (void)pointillize
{
CIVector *center = [CIVector vectorWithX:NSMidX([self bounds])
Y:NSMidY([self bounds])];
CIFilter *pointillize = [CIFilter filterWithName:@"CIPointillize"
keysAndValues:kCIInputRadiusKey,
[NSNumber numberWithFloat:1.0],
kCIInputCenterKey,
center, nil];
pointillize.name = @"pointillize";
[self setContentFilters:[NSArray arrayWithObjects:pointillize, nil]];
}
マウス押下されるとフィルタが掛かるようにした。
- (void)move
{
if (nil != [self.pentagonImageView superview]) {
[[self animator] replaceSubview:self.pentagonImageView with:self.starImageView];
[self pointillize];
NSString *path = [NSString stringWithFormat:
@"contentFilters.pointillize.%@", kCIInputRadiusKey];
[self setValue:[NSNumber numberWithInt:10.0f] forKeyPath:path];
}
else if (nil != [self.starImageView superview]) {
[[self animator] replaceSubview:self.starImageView with:self.pentagonImageView];
[self pointillize];
NSString *path = [NSString stringWithFormat:
@"contentFilters.pointillize.%@", kCIInputRadiusKey];
[self setValue:[NSNumber numberWithInt:1.0f] forKeyPath:path];
}
}
フィルタは、ビューのcontentFiltersに登録され、フィルタの名前はpointillizeに、変化させたいのはkCIInputRadiusKeyなので、これを指すパスで値を変更するとフィルタが掛かるということのようだ。
泡のような感じになった。
関連情報
Core Animation for Max OS X and the iPhone
Core Animation for Max OS X and the iPhone
Core Image プログラミングガイド概論
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
- Core Animation for Max OS X and the iPhone: Cre.../Pragmatic Bookshelf
- ¥3,405
- Amazon.co.jp
[OSX][iOS]ログ出力
Xcodeでデバッグしていて不満があるのは、デバッグ実行すると、前のログがクリアされてしまう事だ。このログの保存を上手くやれる方法がないか調べて見つけたのが、ASL (Apple System Logger) API。ログの出力方法は以下のとおり。
#import <asl.h>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
aslclient log_client;
log_client = asl_open("bitz-asl", "Bitz ASL", ASL_OPT_STDERR);
asl_log(log_client, NULL, ASL_LEVEL_EMERG, "%s", "Hello, World!");
asl_close(log_client);
}
return 0;
}
ASLの出力内容は、Xcodeのコンソールにも出力されるので、NSLogと似た使い方も出来る。
Feb 4 21:59:35 powermac.local bitz-asl[1481] : Hello, World!
また、Syslogを直接参照する方法もできる。
$ grep bitz-asl system.log
Feb 4 21:59:35 powermac bitz-asl[1481]: Hello, World!
関連情報
Logging Errors and Warnings
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
[OSX][iOS]透明度と角度
今回で、『Core Animation for Max OS X and the iPhone』の『CHAPTER 5. LAYER-BACKED VIEWS』からのサンプルを終えようと思う。。
ビューの透明度はプロパティで変更できる。
self.pentagonImageView.alphaValue = 0.5;
self.starImageView.alphaValue = 0.5;
角度も同様だ。
CGFloat rotate = self.pentagonImageView.frameCenterRotation;
self.starImageView.frameCenterRotation = rotate + 15.0;
以前のサンプルから色々と変わっているので、再度、全ソースを載せる。
@interface BaseView ()
@property (strong, nonatomic) NSImageView *mover;
@property (assign, nonatomic) NSRect leftFramePosiotion;
@property (assign, nonatomic) NSRect rightFramePosiotion;
@property (assign, nonatomic) BOOL isRight;
@property (assign, nonatomic) CGMutablePathRef heartPath;
@property (strong, nonatomic) NSImageView *pentagonImageView;
@property (strong, nonatomic) NSImageView *starImageView;
- (void)initializeFramePositions;
- (void)addImageToSubview;
- (void)move;
- (CAKeyframeAnimation *)opacityAnimation;
- (void)applyShadow:(NSView *)view;
@end
@implementation BaseView
@synthesize mover = _mover;
@synthesize leftFramePosiotion = _leftFramePosiotion;
@synthesize rightFramePosiotion = _rightFramePosiotion;
@synthesize isRight = _isRight;
@synthesize heartPath = _heartPath;
@synthesize pentagonImageView = _pentagonImageView;
@synthesize starImageView = _starImageView;
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initializeFramePositions];
[self addImageToSubview];
[self addSubview:self.mover];
[self addSubview:self.pentagonImageView];
[self setWantsLayer:YES];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
[self initializeFramePositions];
[self addImageToSubview];
[self addSubview:self.mover];
[self addSubview:self.pentagonImageView];
[self setWantsLayer:YES];
}
return self;
}
+ (id)defaultAnimationForKey:(NSString *)key
{
DBGMSG(@"%s, key:%@", __func__, key);
id result = [super defaultAnimationForKey:key];
DBGMSG(@"%s, animation:%@", __func__, result);
return result;
}
- (id)animationForKey:(NSString *)key
{
DBGMSG(@"%s, key:%@", __func__, key);
id result = [super animationForKey:key];
DBGMSG(@"%s, animation:%@", __func__, result);
return result;
}
- (BOOL)acceptsFirstResponder
{
return YES;
}
- (void)mouseDown:(NSEvent*)theEvent
{
[self move];
}
- (void)initializeFramePositions
{
CGFloat frameX = NSWidth(self.frame);
CGFloat frameY = NSHeight(self.frame);
self.leftFramePosiotion = NSMakeRect(0.0, 0.0, frameX / 4.0, frameY / 4.0);
self.rightFramePosiotion = NSMakeRect(7.0 * frameX / 8.0, 7.0 * frameY / 16.0, frameX / 8.0, frameY / 8.0);
CGFloat xInset = 3.0 * (NSWidth(self.frame) / 8.0);
CGFloat yInset = 3.0 * (NSHeight(self.frame) / 8.0);
NSRect moverFrame = NSInsetRect(self.frame, xInset, yInset);
self.mover = [[MyImageView alloc] initWithFrame:moverFrame];
self.isRight = NO;
self.heartPath = NULL;
self.animations = [NSDictionary dictionaryWithObjectsAndKeys:
[self transitionAnimation], @"subviews",
nil];
self.pentagonImageView = [[MyImageView alloc] initWithFrame:NSMakeRect(self.frame.origin.x + 20.0,
self.frame.origin.y + 20.0,
self.frame.size.width - 40.0,
self.frame.size.height - 40.0)];
self.starImageView = [[MyImageView alloc] initWithFrame:NSMakeRect(self.frame.origin.x + 20.0,
self.frame.origin.y + 20.0,
self.frame.size.width - 40.0,
self.frame.size.height - 40.0)];
self.pentagonImageView.alphaValue = 0.5;
self.starImageView.alphaValue = 0.5;
[self applyShadow:self.pentagonImageView];
[self applyShadow:self.starImageView];
}
- (void)addImageToSubview
{
[self.mover setImageScaling:NSScaleToFit];
[self.mover setImage:[NSImage imageNamed:@"snapshot.jpg"]];
[self.pentagonImageView setImageScaling:NSScaleToFit];
[self.pentagonImageView setImage:[NSImage imageNamed:@"pentagon.png"]];
[self.starImageView setImageScaling:NSScaleToFit];
[self.starImageView setImage:[NSImage imageNamed:@"star.png"]];
}
- (void)move
{
if (nil != [self.pentagonImageView superview]) {
CGFloat rotate = self.pentagonImageView.frameCenterRotation;
self.starImageView.frameCenterRotation = rotate + 15.0;
[[self animator] replaceSubview:self.pentagonImageView with:self.starImageView];
}
else if (nil != [self.starImageView superview]) {
CGFloat rotate = self.starImageView.frameCenterRotation;
self.pentagonImageView.frameCenterRotation = rotate + 15.0;
[[self animator] replaceSubview:self.starImageView with:self.pentagonImageView];
}
}
- (CAKeyframeAnimation *)opacityAnimation
{
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"alphaValue"];
animation.duration = 4.0;
animation.values = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.0],
[NSNumber numberWithFloat:0.75],
[NSNumber numberWithFloat:0.0], nil];
animation.keyTimes = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.25],
[NSNumber numberWithFloat:0.50],
[NSNumber numberWithFloat:0.75], nil];
animation.timingFunctions = [NSArray arrayWithObjects:
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut], nil];
return animation;
}
- (CABasicAnimation *)opacityAnimationBasic
{
CABasicAnimation *animation = [CABasicAnimation animation];
animation.duration = 4.0;
animation.fromValue = [NSNumber numberWithFloat:1.0];
animation.toValue = [NSNumber numberWithFloat:0.0];
return animation;
}
- (CAKeyframeAnimation *)originAnimation
{
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"frameOrigin"];
animation.duration = 4.0;
animation.path = self.heartPath;
animation.calculationMode = kCAAnimationPaced;
return animation;
}
- (CGMutablePathRef)heartPath
{
if (! _heartPath) {
NSRect frame = self.mover.frame;
_heartPath = CGPathCreateMutable();
CGPathMoveToPoint(_heartPath, NULL, NSMinX(frame), NSMinY(frame));
CGPathAddLineToPoint(_heartPath, NULL,
NSMinX(frame) - NSWidth(frame),
NSMinY(frame) + NSHeight(frame) * 0.85);
CGPathAddLineToPoint(_heartPath, NULL,
NSMinX(frame),
NSMinY(frame) - NSHeight(frame) * 1.5);
CGPathAddLineToPoint(_heartPath, NULL,
NSMinX(frame) + NSWidth(frame),
NSMinY(frame) + NSHeight(frame) * 0.85);
CGPathAddLineToPoint(_heartPath, NULL,
NSMinX(frame),
NSMinY(frame));
CGPathCloseSubpath(_heartPath);
}
return _heartPath;
}
- (CAAnimationGroup *)groupAnimation
{
CAAnimationGroup *animation = [CAAnimationGroup animation];
animation.animations = [NSArray arrayWithObjects:
[self opacityAnimation],
[self originAnimation], nil];
animation.duration = 4.0;
return animation;
}
- (CATransition *)transitionAnimation
{
CATransition *animation = [CATransition animation];
animation.type = kCATransitionMoveIn;
animation.subtype = kCATransitionFromTop;
animation.timingFunction = [self getTimingFunction];
return animation;
}
- (CAMediaTimingFunction *)getTimingFunction
{
CGFloat c1x = 0.5;
CGFloat c1y = 1.0;
CGFloat c2x = 0.5;
CGFloat c2y = 0.0;
return [[CAMediaTimingFunction alloc] initWithControlPoints:c1x :c1y :c2x :c2y];
}
- (void)applyShadow:(NSView *)view
{
NSShadow *shadow = [[NSShadow alloc] init];
[shadow setShadowOffset:NSMakeSize(10.0, -10.0)];
[shadow setShadowBlurRadius:10.0];
[shadow setShadowColor:[NSColor blackColor]];
[view setShadow:shadow];
}
@end
関連情報
Core Animation for Max OS X and the iPhone
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)
[OSX][Android]Android SDK ADT Bundle for OSX
Android Develpersサイトで、ADT (Android Developers Tools) が組み込まれたEclipseを配流するようになったようだ。EclipseはAndroid開発用だけで使用する場合は便利だと思う。
Get the Android SDK
以前と異なるので戸惑ったが、OS Xの場合、adt-bundle-mac-x86_64というフォルダがダウンロードされる為、このフォルダを任意の場所に置けばインストールは完了だ。(著者は、間違えてEclipseのサイトにいって、Eclipseを単体でダウンロードしてしまったが不要だった。)
adt-bundle-mac-x86_64フォルダには、Eclipseが格納されているので、それを起動する。
Setting Up the ADT Bundle
Setting Up an Existing IDE
そして、ADT Pluginを組み込む。ここは、以前と同じだと思う。
Setting Up an Existing IDE
次は、新規プロジェクトを作成して、エミュレータで動作させてみよう。
Creating an Android Project
Android Virtual Device Managerが更新されていたのは驚いた。
Managing Virtual Devices
CPUが選べるようになっている。
関連情報
Android Developers
【Cocoa練習帳】
http://www.bitz.co.jp/weblog/
http://ameblo.jp/bitz/(ミラー・サイト)