Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Started adding circle of 5ths menu

  • Loading branch information...
commit 6c7c58241d60ce5c57f9a0beaddc0546c699872c 1 parent 3ada218
cnharris authored
View
6 Staff.xcodeproj/project.pbxproj
@@ -25,6 +25,7 @@
0826BDE31523EFED004A9B22 /* ChordOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0826BDE21523EFED004A9B22 /* ChordOptionsViewController.m */; };
0826BDEB1523F6B7004A9B22 /* DeleteIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0826BDEA1523F6B7004A9B22 /* DeleteIcon.png */; };
08ACF4BC152B9D1F00512760 /* star.png in Resources */ = {isa = PBXBuildFile; fileRef = 08ACF4BB152B9D1F00512760 /* star.png */; };
+ 2A8E8FBA15374EF80067DB3D /* Circleof5thsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A8E8FB915374EF80067DB3D /* Circleof5thsController.m */; };
2AE1DE7415154B72008C538D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AE1DE7315154B72008C538D /* UIKit.framework */; };
2AE1DE7615154B72008C538D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AE1DE7515154B72008C538D /* Foundation.framework */; };
2AE1DE7815154B72008C538D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AE1DE7715154B72008C538D /* CoreGraphics.framework */; };
@@ -63,6 +64,8 @@
0826BDE21523EFED004A9B22 /* ChordOptionsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChordOptionsViewController.m; sourceTree = "<group>"; };
0826BDEA1523F6B7004A9B22 /* DeleteIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DeleteIcon.png; sourceTree = "<group>"; };
08ACF4BB152B9D1F00512760 /* star.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = star.png; sourceTree = "<group>"; };
+ 2A8E8FB815374EF80067DB3D /* Circleof5thsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Circleof5thsController.h; sourceTree = "<group>"; };
+ 2A8E8FB915374EF80067DB3D /* Circleof5thsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Circleof5thsController.m; sourceTree = "<group>"; };
2AE1DE6F15154B72008C538D /* Staff.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Staff.app; sourceTree = BUILT_PRODUCTS_DIR; };
2AE1DE7315154B72008C538D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
2AE1DE7515154B72008C538D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -146,6 +149,8 @@
0826BDB11523E5AF004A9B22 /* Chord.m */,
0826BDB41523E5AF004A9B22 /* ChordViewController.h */,
0826BDB51523E5AF004A9B22 /* ChordViewController.m */,
+ 2A8E8FB815374EF80067DB3D /* Circleof5thsController.h */,
+ 2A8E8FB915374EF80067DB3D /* Circleof5thsController.m */,
0826BDE11523EFED004A9B22 /* ChordOptionsViewController.h */,
0826BDE21523EFED004A9B22 /* ChordOptionsViewController.m */,
08ACF4BB152B9D1F00512760 /* star.png */,
@@ -261,6 +266,7 @@
0826BDD71523E5C2004A9B22 /* solidLine.m in Sources */,
0826BDD81523E5C2004A9B22 /* StaffController.m in Sources */,
0826BDE31523EFED004A9B22 /* ChordOptionsViewController.m in Sources */,
+ 2A8E8FBA15374EF80067DB3D /* Circleof5thsController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
BIN  Staff.xcodeproj/project.xcworkspace/xcuserdata/christopherharris.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
3  Staff/ChordViewController.m
@@ -11,6 +11,7 @@
#import "DraggedChord.h"
#import "ChordOptionsViewController.h"
#import "DataController.h"
+#import "Circleof5thsController.h"
@implementation ChordViewController
@@ -205,6 +206,7 @@ -(void) layoutStars
- (void) loadView
{
+ AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
self.view = [[UIView alloc] initWithFrame: CGRectMake(400, 0, 624, 768)];
[self.view setBackgroundColor:[UIColor brownColor]];
@@ -213,6 +215,7 @@ - (void) loadView
[self layoutControlBar];
[self layoutStars];
[self setupMetronome];
+ [mainDelegate.viewController.circleOf5thsController setup];
}
View
28 Staff/Circleof5thsController.h
@@ -0,0 +1,28 @@
+//
+// Circleof5thsController.h
+// Staff
+//
+// Created by Christopher Harris on 4/12/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface Circleof5thsController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource>
+{
+ IBOutlet UIView *circleOf5thsView;
+ IBOutlet UIView *circleOf5thsTab;
+ IBOutlet UIPickerView *circleOf5thsPicker;
+ IBOutlet UIButton *circleOf5thsButton;
+ NSArray *circleOf5thsPickerElements;
+}
+
+@property (nonatomic, retain) IBOutlet UIView *circleOf5thsView;
+@property (nonatomic, retain) IBOutlet UIView *circleOf5thsTab;
+@property (nonatomic, retain) IBOutlet UIPickerView *circleOf5thsPicker;
+@property (nonatomic, retain) IBOutlet UIButton *circleOf5thsButton;
+@property NSArray *circleOf5thsPickerElements;
+
+- (void)setup;
+- (void)circleOf5thsTabTapped:(UITapGestureRecognizer *)recognizer;
+@end
View
128 Staff/Circleof5thsController.m
@@ -0,0 +1,128 @@
+//
+// Circleof5thsController.m
+// Staff
+//
+// Created by Christopher Harris on 4/12/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import "Circleof5thsController.h"
+
+@implementation Circleof5thsController
+
+@synthesize circleOf5thsView;
+@synthesize circleOf5thsButton;
+@synthesize circleOf5thsPicker;
+@synthesize circleOf5thsPickerElements;
+@synthesize circleOf5thsTab;
+
+- (id)init
+{
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+}
+
+- (void)setup
+{
+ AppDelegate *mainDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
+ circleOf5thsPickerElements = [[NSArray alloc]
+ initWithObjects:@"F#/Gb",@"B",@"E",@"A",@"D",@"G",@"C",@"F",@"Bb",@"Eb",@"Ab",@"Db",@"Gb/F#", nil];
+ circleOf5thsView = [[UIView alloc] initWithFrame:CGRectMake(577, 200, 330, 310)];
+ [circleOf5thsView setBackgroundColor:[UIColor whiteColor]];
+ [[circleOf5thsView layer] setCornerRadius:10];
+ [[circleOf5thsView layer] setBorderColor:[UIColor blackColor].CGColor];
+ [[circleOf5thsView layer] setBorderWidth:2];
+ [[circleOf5thsView layer] setShadowColor:[UIColor blackColor].CGColor];
+ [[circleOf5thsView layer] setShadowOpacity:0.7f];
+ [[circleOf5thsView layer] setShadowOffset:CGSizeMake(10.0f, 10.0f)];
+ [[circleOf5thsView layer] setShadowRadius:10.0f];
+ [[circleOf5thsView layer] setMasksToBounds:NO];
+ UIBezierPath *path = [UIBezierPath bezierPathWithRect:circleOf5thsView.bounds];
+ [[circleOf5thsView layer] setShadowPath:path.CGPath];
+
+ circleOf5thsTab = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 310)];
+ [[circleOf5thsTab layer] setCornerRadius:10];
+ [circleOf5thsTab setBackgroundColor:[UIColor lightGrayColor]];
+
+ circleOf5thsPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(60, 10, 250, 216)];
+ [circleOf5thsPicker setDelegate:self];
+ [circleOf5thsPicker setDataSource:self];
+ [circleOf5thsPicker setShowsSelectionIndicator:YES];
+
+ circleOf5thsButton = [[UIButton alloc] initWithFrame:CGRectMake(60, 240, 250, 50)];
+ [circleOf5thsButton setTitle:@"Select" forState:UIControlStateNormal];
+ [[circleOf5thsButton layer] setBorderWidth:1];
+ [[circleOf5thsButton layer] setBorderColor:[UIColor colorWithRed:204.0/255 green:204.0/255 blue:204.0/255 alpha:1].CGColor];
+ [circleOf5thsButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+ [[circleOf5thsButton layer] setCornerRadius:10];
+
+ [circleOf5thsView addSubview:circleOf5thsTab];
+ [circleOf5thsView addSubview:circleOf5thsPicker];
+ [circleOf5thsView addSubview:circleOf5thsButton];
+
+ [mainDelegate.viewController.chordController.view addSubview:circleOf5thsView];
+ [circleOf5thsPicker selectRow:6 inComponent:0 animated:YES];
+
+ UITapGestureRecognizer *tapCircleOf5thsTab = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(circleOf5thsTabTapped:)];
+ [circleOf5thsTab addGestureRecognizer:tapCircleOf5thsTab];
+}
+
+- (void)circleOf5thsTabTapped:(UITapGestureRecognizer *)recognizer;
+{
+ NSLog(@"here");
+ NSLog(@"%f",circleOf5thsView.layer.position.x);
+
+ double x = circleOf5thsView.layer.position.x;
+ double y = circleOf5thsView.layer.position.y;
+ if(x < 500){
+ [[circleOf5thsView layer] setPosition:CGPointMake(742, y)];
+ } else {
+ [[circleOf5thsView layer] setPosition:CGPointMake(472, y)];
+ }
+
+}
+
+// Number of components.
+-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
+{
+ return 1;
+}
+
+// Total rows in our component.
+-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
+{
+ return [circleOf5thsPickerElements count];
+}
+
+// Display each row's data.
+-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
+{
+ return [circleOf5thsPickerElements objectAtIndex: row];
+}
+
+// Do something with the selected row.
+-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
+{
+
+ NSLog(@"You selected this: %@", [circleOf5thsPickerElements objectAtIndex: row]);
+}
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+@end
View
5 Staff/MainController.h
@@ -10,6 +10,7 @@
#import "StaffController.h"
#import "DataController.h"
#import "ChordViewController.h"
+#import "Circleof5thsController.h"
@interface MainController : UIViewController
@@ -17,7 +18,9 @@
@property (strong, nonatomic) ChordViewController *chordController;
-@property (strong, nonatomic) DataController* dataController;
+@property (strong, nonatomic) DataController *dataController;
+
+@property (strong, nonatomic) Circleof5thsController *circleOf5thsController;
@end
View
3  Staff/MainController.m
@@ -11,10 +11,12 @@
#import "DataController.h"
#import "StaffController.h"
#import "ChordViewController.h"
+#import "Circleof5thsController.h"
@implementation MainController
@synthesize staffController = _staffController, dataController = _dataController, chordController = _chordController;
+@synthesize circleOf5thsController = _circleOf5thsController;
- (void)viewDidLoad
{
@@ -23,6 +25,7 @@ - (void)viewDidLoad
_dataController = [[DataController alloc] init];
_staffController = [[StaffController alloc] init];
_chordController = [[ChordViewController alloc] init];
+ _circleOf5thsController = [[Circleof5thsController alloc] init];
[_chordController loadView];
[_dataController loadData];
View
101 Staff/MainController.xib
@@ -11,8 +11,10 @@
<string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
- <string>IBProxyObject</string>
+ <string>IBUIPickerView</string>
+ <string>IBUIButton</string>
<string>IBUIView</string>
+ <string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -33,14 +35,77 @@
<object class="IBUIView" id="766721923">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUIView" id="241956787">
+ <reference key="NSNextResponder" ref="766721923"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUIPickerView" id="999974728">
+ <reference key="NSNextResponder" ref="241956787"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrame">{{50, 10}, {250, 216}}</string>
+ <reference key="NSSuperview" ref="241956787"/>
+ <reference key="NSNextKeyView" ref="916329636"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ <bool key="IBUIShowsSelectionIndicator">YES</bool>
+ </object>
+ <object class="IBUIButton" id="916329636">
+ <reference key="NSNextResponder" ref="241956787"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{50, 240}, {250, 50}}</string>
+ <reference key="NSSuperview" ref="241956787"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Select</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ <object class="IBUIFontDescription" key="IBUIFontDescription">
+ <int key="type">2</int>
+ <double key="pointSize">15</double>
+ </object>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrame">{{716, 200}, {300, 300}}</string>
+ <reference key="NSSuperview" ref="766721923"/>
+ <reference key="NSNextKeyView" ref="999974728"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace" id="670679740">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ </array>
<string key="NSFrame">{{0, 20}, {1024, 748}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSNextKeyView" ref="241956787"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
- <object class="NSColorSpace" key="NSCustomColorSpace">
- <int key="NSID">2</int>
- </object>
+ <reference key="NSCustomColorSpace" ref="670679740"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
@@ -86,9 +151,30 @@
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="766721923"/>
- <array class="NSMutableArray" key="children"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="241956787"/>
+ </array>
<reference key="parent" ref="0"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="241956787"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="916329636"/>
+ <reference ref="999974728"/>
+ </array>
+ <reference key="parent" ref="766721923"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="999974728"/>
+ <reference key="parent" ref="241956787"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="916329636"/>
+ <reference key="parent" ref="241956787"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -97,12 +183,15 @@
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">4</int>
+ <int key="maxID">8</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
Please sign in to comment.
Something went wrong with that request. Please try again.