Skip to content
Browse files

Release the player!

  • Loading branch information...
1 parent 4d55ec8 commit c0f8f9778b01930887a5adbe2aa8d5f80152653f @vladkorotnev committed Jul 17, 2011
View
2 .theos/packages/com.vladkorotnev.startupsound-0.0.1
@@ -1 +1 @@
-0.0.1-3
+0.0.1-4
View
2 Makefile
@@ -1,7 +1,7 @@
include theos/makefiles/common.mk
TWEAK_NAME = StartupSound
-StartupSound_FILES = Tweak.xm
+StartupSound_FILES = Tweak.xm SndDelegate.m
StartupSound_FRAMEWORKS = AVFoundation UIKit Foundation
include $(THEOS_MAKE_PATH)/tweak.mk
View
8 SndDelegate.h
@@ -0,0 +1,8 @@
+#import <AVFoundation/AVFoundation.h>
+#import <objc/runtime.h>
+
+@interface SndDelegate : NSObject <AVAudioPlayerDelegate> {
+
+}
+
+@end
View
11 SndDelegate.m
@@ -0,0 +1,11 @@
+#import <AVFoundation/AVFoundation.h>
+#import <objc/runtime.h>
+#import "SndDelegate.h"
+@implementation SndDelegate
+
+- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag {
+[player release];
+[self release];
+}
+
+@end
View
4 Tweak.xm
@@ -1,15 +1,17 @@
#import <AVFoundation/AVFoundation.h>
#import <objc/runtime.h>
-
+#import "SndDelegate.h"
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)x {
%orig;
//startup sound
NSFileManager *fm=[NSFileManager defaultManager];
+ SndDelegate *ololo = [SndDelegate alloc];
if([fm fileExistsAtPath:@"/var/mobile/startup.wav"]){
NSURL *newURL = [[NSURL alloc] initFileURLWithPath:@"/var/mobile/startup.wav"];
AVAudioPlayer *player = [[AVAudioPlayer alloc]initWithContentsOfURL:newURL error:nil];
[player prepareToPlay];
+ [player setDelegate:ololo];
[player play];
[newURL release];
}
View
2 _/DEBIAN/control
@@ -1,7 +1,7 @@
Package: com.vladkorotnev.startupsound
Name: StartupSound
Depends: mobilesubstrate
-Version: 0.0.1-3
+Version: 0.0.1-4
Architecture: iphoneos-arm
Description: Sound after iPhone finished booting!
Maintainer: Vladislav Korotnev
View
BIN _/Library/MobileSubstrate/DynamicLibraries/StartupSound.dylib
Binary file not shown.
View
BIN com.vladkorotnev.startupsound_0.0.1-4_iphoneos-arm.deb
Binary file not shown.
View
BIN obj/SndDelegate.m.o
Binary file not shown.
View
BIN obj/StartupSound.dylib
Binary file not shown.
View
BIN obj/Tweak.xm.o
Binary file not shown.

0 comments on commit c0f8f97

Please sign in to comment.
Something went wrong with that request. Please try again.