Skip to content

Commit fef48c2

Browse files
committed
Revert "Related to IOSCLOCK-30."
This reverts commit c096fab.
1 parent a9b7db7 commit fef48c2

File tree

12 files changed

+15
-84
lines changed

12 files changed

+15
-84
lines changed

ChessClock.xcodeproj/project.pbxproj

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,13 @@
4545
A20BE2691F27B79D002A7A2F /* ChessGlyph-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A20BE2681F27B79D002A7A2F /* ChessGlyph-Regular.ttf */; };
4646
A20E8EFE1F02C02400A2DFE6 /* CHIncrementCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A20E8EFD1F02C02400A2DFE6 /* CHIncrementCell.m */; };
4747
A20E8F001F02C04100A2DFE6 /* CHIncrementCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A20E8EFF1F02C04100A2DFE6 /* CHIncrementCell.xib */; };
48+
A255BEC51F575F1400AB36D6 /* switch1.wav in Resources */ = {isa = PBXBuildFile; fileRef = A255BEC31F575F1400AB36D6 /* switch1.wav */; };
49+
A255BEC61F575F1400AB36D6 /* switch2.wav in Resources */ = {isa = PBXBuildFile; fileRef = A255BEC41F575F1400AB36D6 /* switch2.wav */; };
4850
A255BEC81F575F8B00AB36D6 /* timeEnded.wav in Resources */ = {isa = PBXBuildFile; fileRef = A255BEC71F575F8B00AB36D6 /* timeEnded.wav */; };
4951
A255BECA1F57617D00AB36D6 /* reset.wav in Resources */ = {isa = PBXBuildFile; fileRef = A255BEC91F57617D00AB36D6 /* reset.wav */; };
5052
A255BECC1F57620000AB36D6 /* pause.wav in Resources */ = {isa = PBXBuildFile; fileRef = A255BECB1F57620000AB36D6 /* pause.wav */; };
5153
A255BECE1F57644B00AB36D6 /* start.wav in Resources */ = {isa = PBXBuildFile; fileRef = A255BECD1F57644B00AB36D6 /* start.wav */; };
5254
A25BFE0B1F02A16B00F216B7 /* CHTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A25BFE0A1F02A16B00F216B7 /* CHTableViewCell.m */; };
53-
A2C4396E1F58C9BA0034657B /* switch1_0.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A2C439661F58C9BA0034657B /* switch1_0.mp3 */; };
54-
A2C4396F1F58C9BA0034657B /* switch1_1.wav in Resources */ = {isa = PBXBuildFile; fileRef = A2C439671F58C9BA0034657B /* switch1_1.wav */; };
55-
A2C439701F58C9BA0034657B /* switch1_2.wav in Resources */ = {isa = PBXBuildFile; fileRef = A2C439681F58C9BA0034657B /* switch1_2.wav */; };
56-
A2C439711F58C9BA0034657B /* switch1_3.wav in Resources */ = {isa = PBXBuildFile; fileRef = A2C439691F58C9BA0034657B /* switch1_3.wav */; };
57-
A2C439721F58C9BA0034657B /* switch2_0.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A2C4396A1F58C9BA0034657B /* switch2_0.mp3 */; };
58-
A2C439731F58C9BA0034657B /* switch2_1.wav in Resources */ = {isa = PBXBuildFile; fileRef = A2C4396B1F58C9BA0034657B /* switch2_1.wav */; };
59-
A2C439741F58C9BA0034657B /* switch2_2.wav in Resources */ = {isa = PBXBuildFile; fileRef = A2C4396C1F58C9BA0034657B /* switch2_2.wav */; };
60-
A2C439751F58C9BA0034657B /* switch2_3.wav in Resources */ = {isa = PBXBuildFile; fileRef = A2C4396D1F58C9BA0034657B /* switch2_3.wav */; };
6155
A959644C2B9C7E74E625D42E /* libPods-ChessClockTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 879B7CCF3A2208ABB6BB6FD1 /* libPods-ChessClockTests.a */; };
6256
C00DBBCE18C52B8C00DDCB32 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C00DBBCD18C52B8C00DDCB32 /* Foundation.framework */; };
6357
C00DBBD018C52B8C00DDCB32 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C00DBBCF18C52B8C00DDCB32 /* CoreGraphics.framework */; };
@@ -155,20 +149,14 @@
155149
A20E8EFC1F02C02400A2DFE6 /* CHIncrementCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CHIncrementCell.h; path = Classes/Views/CHIncrementCell.h; sourceTree = "<group>"; };
156150
A20E8EFD1F02C02400A2DFE6 /* CHIncrementCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CHIncrementCell.m; path = Classes/Views/CHIncrementCell.m; sourceTree = "<group>"; };
157151
A20E8EFF1F02C04100A2DFE6 /* CHIncrementCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CHIncrementCell.xib; sourceTree = "<group>"; };
152+
A255BEC31F575F1400AB36D6 /* switch1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch1.wav; sourceTree = "<group>"; };
153+
A255BEC41F575F1400AB36D6 /* switch2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch2.wav; sourceTree = "<group>"; };
158154
A255BEC71F575F8B00AB36D6 /* timeEnded.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = timeEnded.wav; sourceTree = "<group>"; };
159155
A255BEC91F57617D00AB36D6 /* reset.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = reset.wav; sourceTree = "<group>"; };
160156
A255BECB1F57620000AB36D6 /* pause.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = pause.wav; sourceTree = "<group>"; };
161157
A255BECD1F57644B00AB36D6 /* start.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = start.wav; sourceTree = "<group>"; };
162158
A25BFE091F02A16B00F216B7 /* CHTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CHTableViewCell.h; path = Classes/Views/CHTableViewCell.h; sourceTree = "<group>"; };
163159
A25BFE0A1F02A16B00F216B7 /* CHTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CHTableViewCell.m; path = Classes/Views/CHTableViewCell.m; sourceTree = "<group>"; };
164-
A2C439661F58C9BA0034657B /* switch1_0.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = switch1_0.mp3; sourceTree = "<group>"; };
165-
A2C439671F58C9BA0034657B /* switch1_1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch1_1.wav; sourceTree = "<group>"; };
166-
A2C439681F58C9BA0034657B /* switch1_2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch1_2.wav; sourceTree = "<group>"; };
167-
A2C439691F58C9BA0034657B /* switch1_3.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch1_3.wav; sourceTree = "<group>"; };
168-
A2C4396A1F58C9BA0034657B /* switch2_0.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = switch2_0.mp3; sourceTree = "<group>"; };
169-
A2C4396B1F58C9BA0034657B /* switch2_1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch2_1.wav; sourceTree = "<group>"; };
170-
A2C4396C1F58C9BA0034657B /* switch2_2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch2_2.wav; sourceTree = "<group>"; };
171-
A2C4396D1F58C9BA0034657B /* switch2_3.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = switch2_3.wav; sourceTree = "<group>"; };
172160
C00DBBCA18C52B8C00DDCB32 /* ChessClock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ChessClock.app; sourceTree = BUILT_PRODUCTS_DIR; };
173161
C00DBBCD18C52B8C00DDCB32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
174162
C00DBBCF18C52B8C00DDCB32 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -369,14 +357,8 @@
369357
A255BECB1F57620000AB36D6 /* pause.wav */,
370358
A255BEC91F57617D00AB36D6 /* reset.wav */,
371359
A255BECD1F57644B00AB36D6 /* start.wav */,
372-
A2C439661F58C9BA0034657B /* switch1_0.mp3 */,
373-
A2C439671F58C9BA0034657B /* switch1_1.wav */,
374-
A2C439681F58C9BA0034657B /* switch1_2.wav */,
375-
A2C439691F58C9BA0034657B /* switch1_3.wav */,
376-
A2C4396A1F58C9BA0034657B /* switch2_0.mp3 */,
377-
A2C4396B1F58C9BA0034657B /* switch2_1.wav */,
378-
A2C4396C1F58C9BA0034657B /* switch2_2.wav */,
379-
A2C4396D1F58C9BA0034657B /* switch2_3.wav */,
360+
A255BEC31F575F1400AB36D6 /* switch1.wav */,
361+
A255BEC41F575F1400AB36D6 /* switch2.wav */,
380362
A255BEC71F575F8B00AB36D6 /* timeEnded.wav */,
381363
);
382364
name = sounds;
@@ -590,30 +572,24 @@
590572
isa = PBXResourcesBuildPhase;
591573
buildActionMask = 2147483647;
592574
files = (
593-
A2C439711F58C9BA0034657B /* switch1_3.wav in Resources */,
594-
A2C439751F58C9BA0034657B /* switch2_3.wav in Resources */,
595575
0F52D2531E56EF0700077F3C /* CHChessClockTimeControlView.xib in Resources */,
596576
C00DBBE918C52B8C00DDCB32 /* Images.xcassets in Resources */,
597577
A255BEC81F575F8B00AB36D6 /* timeEnded.wav in Resources */,
598-
A2C439721F58C9BA0034657B /* switch2_0.mp3 in Resources */,
599-
A2C439701F58C9BA0034657B /* switch1_2.wav in Resources */,
600-
A2C4396E1F58C9BA0034657B /* switch1_0.mp3 in Resources */,
601578
A255BECE1F57644B00AB36D6 /* start.wav in Resources */,
602579
0F5438D81E34EFF700DF08AC /* CHClock.storyboard in Resources */,
603580
0F52D2541E56EF0700077F3C /* CHChessClockTimeView.xib in Resources */,
604581
0F52D2461E56EAFE00077F3C /* Launch Screen.storyboard in Resources */,
605-
A2C4396F1F58C9BA0034657B /* switch1_1.wav in Resources */,
606582
0F52D2521E56EF0700077F3C /* CHChessClockTimeControlStageView.xib in Resources */,
607583
A20BE2691F27B79D002A7A2F /* ChessGlyph-Regular.ttf in Resources */,
608584
0F52D2501E56EF0700077F3C /* CHChessClockStageMovesCell.xib in Resources */,
585+
A255BEC61F575F1400AB36D6 /* switch2.wav in Resources */,
609586
A255BECA1F57617D00AB36D6 /* reset.wav in Resources */,
610-
A2C439741F58C9BA0034657B /* switch2_2.wav in Resources */,
611587
F31CC1A518C8C46F0072398C /* DefaultChessClockSettings.plist in Resources */,
588+
A255BEC51F575F1400AB36D6 /* switch1.wav in Resources */,
612589
A255BECC1F57620000AB36D6 /* pause.wav in Resources */,
613590
C00DBBD818C52B8C00DDCB32 /* InfoPlist.strings in Resources */,
614591
0F9FF0C51E75AB970015B1E4 /* CHTableViewHeader.xib in Resources */,
615592
0F52D2511E56EF0700077F3C /* CHChessClockTimeControlNameCell.xib in Resources */,
616-
A2C439731F58C9BA0034657B /* switch2_1.wav in Resources */,
617593
0F52D24F1E56EF0700077F3C /* CHChessClockIncrementView.xib in Resources */,
618594
A20E8F001F02C04100A2DFE6 /* CHIncrementCell.xib in Resources */,
619595
);

ChessClock/Classes/Other/CHSoundPlayer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,4 @@
2020
- (void)playResetSound;
2121
- (void)playPauseSound;
2222

23-
- (void)moveToNextSwitchSound;
24-
2523
@end

ChessClock/Classes/Other/CHSoundPlayer.m

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
@interface CHSoundPlayer()
1717

1818
@property (strong, nonatomic) OALSimpleAudio* oalSimpleAudio;
19-
@property (assign, nonatomic) NSUInteger currentSwitchSoundIndex;
2019

2120
@end
2221

@@ -25,13 +24,13 @@ @interface CHSoundPlayer()
2524
//------------------------------------------------------------------------------
2625
@implementation CHSoundPlayer
2726

27+
static NSString* const kCHSwitchOneSoundName = @"switch1";
28+
static NSString* const kCHSwitchTwoSoundName = @"switch2";
2829
static NSString* const kCHStartSoundName = @"start";
2930
static NSString* const kCHTimeEndedSoundName = @"timeEnded";
3031
static NSString* const kCHResetSoundName = @"reset";
3132
static NSString* const kCHPauseSoundName = @"pause";
3233

33-
static const NSUInteger kCHSwitchSoundsCount = 4;
34-
3534
+ (instancetype)sharedSoundPlayer
3635
{
3736
static dispatch_once_t predicate = 0;
@@ -52,36 +51,26 @@ - (id)init
5251
_oalSimpleAudio.allowIpod = YES;
5352
_oalSimpleAudio.useHardwareIfAvailable = NO;
5453
_oalSimpleAudio.honorSilentSwitch = YES;
55-
_currentSwitchSoundIndex = 0;
5654
}
5755

5856
return self;
5957
}
6058

6159
- (void)preloadSounds
6260
{
63-
for (NSUInteger i = 0; i < kCHSwitchSoundsCount; i++)
64-
{
65-
NSString* switchOneSound = [self soundPathForSoundName:[self switchSoundNameWithIsForPlayerOne:YES currentSoundIndex:i]];
66-
NSString* switchTwoSound = [self soundPathForSoundName:[self switchSoundNameWithIsForPlayerOne:NO currentSoundIndex:i]];
67-
68-
[self.oalSimpleAudio preloadEffect:switchOneSound];
69-
[self.oalSimpleAudio preloadEffect:switchTwoSound];
70-
}
71-
61+
[self.oalSimpleAudio preloadEffect:[self soundPathForSoundName:kCHSwitchOneSoundName]];
62+
[self.oalSimpleAudio preloadEffect:[self soundPathForSoundName:kCHSwitchTwoSoundName]];
7263
[self.oalSimpleAudio preloadEffect:[self soundPathForSoundName:kCHTimeEndedSoundName]];
7364
}
7465

7566
- (void)playSwitch1Sound
7667
{
77-
NSString* switchSoundName = [self switchSoundNameWithIsForPlayerOne:YES currentSoundIndex:self.currentSwitchSoundIndex];
78-
[self.oalSimpleAudio playEffect:[self soundPathForSoundName:switchSoundName]];
68+
[self.oalSimpleAudio playEffect:[self soundPathForSoundName:kCHSwitchOneSoundName]];
7969
}
8070

8171
- (void)playSwitch2Sound
8272
{
83-
NSString* switchSoundName = [self switchSoundNameWithIsForPlayerOne:NO currentSoundIndex:self.currentSwitchSoundIndex];
84-
[self.oalSimpleAudio playEffect:[self soundPathForSoundName:switchSoundName]];
73+
[self.oalSimpleAudio playEffect:[self soundPathForSoundName:kCHSwitchTwoSoundName]];
8574
}
8675

8776
- (void)playStartSound
@@ -104,34 +93,12 @@ - (void)playPauseSound
10493
[self.oalSimpleAudio playEffect:[self soundPathForSoundName:kCHPauseSoundName]];
10594
}
10695

107-
- (void)moveToNextSwitchSound
108-
{
109-
self.currentSwitchSoundIndex++;
110-
111-
if (self.currentSwitchSoundIndex >= kCHSwitchSoundsCount)
112-
{
113-
self.currentSwitchSoundIndex = 0;
114-
}
115-
}
116-
11796
//------------------------------------------------------------------------------
11897
#pragma mark - Private methods definitions
11998
//------------------------------------------------------------------------------
12099
- (NSString*)soundPathForSoundName:(NSString*)soundName
121100
{
122-
NSString* type = @"wav";
123-
if ([soundName isEqualToString:@"switch1_0"] ||
124-
[soundName isEqualToString:@"switch2_0"])
125-
{
126-
type = @"mp3";
127-
}
128-
129-
return [[NSBundle mainBundle] pathForResource:soundName ofType:type];
130-
}
131-
132-
- (NSString*)switchSoundNameWithIsForPlayerOne:(BOOL)isForPlayerOne currentSoundIndex:(NSUInteger)currentSoundIndex
133-
{
134-
return [NSString stringWithFormat:@"switch%@_%@", isForPlayerOne ? @(1) : @(2), @(currentSoundIndex)];
101+
return [[NSBundle mainBundle] pathForResource:soundName ofType:@"wav"];
135102
}
136103

137104
@end

ChessClock/Classes/ViewControllers/CHChessClockViewController.m

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ - (void)viewDidLoad
8787
delegate:self];
8888

8989
[self resetClockWithPlaySound:NO];
90-
91-
UITapGestureRecognizer* recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeSwitchSounds)];
92-
recognizer.numberOfTapsRequired = 2;
93-
recognizer.numberOfTouchesRequired = 2;
94-
[self.view addGestureRecognizer:recognizer];
9590
}
9691

9792
- (void)viewWillAppear:(BOOL)animated
@@ -200,11 +195,6 @@ - (void)pauseTappedWithPlaySound:(BOOL)playSound
200195
}
201196
}
202197

203-
- (void)changeSwitchSounds
204-
{
205-
[[CHSoundPlayer sharedSoundPlayer] moveToNextSwitchSound];
206-
}
207-
208198
//------------------------------------------------------------------------------
209199
#pragma mark - IBAction methods
210200
//------------------------------------------------------------------------------
-7.93 KB
Binary file not shown.
-381 KB
Binary file not shown.
-353 KB
Binary file not shown.
-8.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)