Permalink
Browse files

new audio view

  • Loading branch information...
1 parent 92d107d commit 7a3ad7f23c56bc2731fed3739ae9e7162b642ab9 @vmariano committed Jul 25, 2011
@@ -9,13 +9,11 @@
#import <UIKit/UIKit.h>
@class MainViewController;
-
@interface SimpleMusicPlayerAppDelegate : NSObject <UIApplicationDelegate> {
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
-
@property (nonatomic, retain) IBOutlet MainViewController *mainViewController;
@end
@@ -3,22 +3,17 @@
// SimpleMusicPlayer
//
// Created by Mariano Vicente on 7/24/11.
-// Copyright 2011 FDV Solutions. All rights reserved.
//
#import "SimpleMusicPlayerAppDelegate.h"
-
#import "MainViewController.h"
@implementation SimpleMusicPlayerAppDelegate
-
-
@synthesize window=_window;
-
@synthesize mainViewController=_mainViewController;
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the main view controller's view to the window and display.
self.window.rootViewController = self.mainViewController;
@@ -65,8 +60,7 @@ - (void)applicationWillTerminate:(UIApplication *)application
*/
}
-- (void)dealloc
-{
+- (void)dealloc {
[_window release];
[_mainViewController release];
[super dealloc];
@@ -0,0 +1,22 @@
+//
+// AudioPlayerViewController.h
+// SimpleMusicPlayer
+//
+// Created by Mariano Vicente on 07/25/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface AudioPlayerViewController : UIViewController {
+
+ IBOutlet UISlider *volumeSlider;
+ IBOutlet UISlider *progresSlider;
+
+
+}
+- (IBAction)progressChanged:(UISlider *)sender;
+- (IBAction)volumeChanged:(UISlider *)sender;
+
+@end
@@ -0,0 +1,71 @@
+//
+// AudioPlayerViewController.m
+// SimpleMusicPlayer
+//
+// Created by Mariano Vicente on 07/25/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "AudioPlayerViewController.h"
+
+@implementation AudioPlayerViewController
+
+- (void)didReceiveMemoryWarning {
+ [super didReceiveMemoryWarning];
+}
+
+- (void)setupProgressBar {
+ UIImage *stretchLeftTrack = [[UIImage imageNamed:@"PROGRESS_BLACK.png"]
+ stretchableImageWithLeftCapWidth:(NSInteger)10.0
+ topCapHeight:(NSInteger)0.0];
+
+ UIImage *stretchyRightTrack = [[UIImage imageNamed:@"PROGRESS_GRAY.png"]
+ stretchableImageWithLeftCapWidth:(NSInteger)10.0
+ topCapHeight:(NSInteger)0.0];
+
+ [progresSlider setThumbImage: [UIImage imageNamed:@"PROGRESS_CIRCLE.png"]
+ forState:UIControlStateNormal];
+
+ [progresSlider setMinimumTrackImage:stretchLeftTrack forState:UIControlStateNormal];
+ [progresSlider setMaximumTrackImage:stretchyRightTrack forState:UIControlStateNormal];
+}
+#pragma mark - View lifecycle
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ [self setupProgressBar];
+ //[self setupVolumeBar];
+}
+
+- (void)viewDidUnload {
+ [volumeSlider release];
+ volumeSlider = nil;
+
+ [progresSlider release];
+ progresSlider = nil;
+
+ [super viewDidUnload];
+}
+
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+
+#pragma mark - User interaction events
+- (IBAction)progressChanged:(UISlider *)sender {
+
+}
+
+- (IBAction)volumeChanged:(UISlider *)sender {
+
+}
+
+#pragma mark -
+- (void)dealloc {
+ [volumeSlider release];
+ [progresSlider release];
+ [super dealloc];
+}
+
+@end
Oops, something went wrong.

0 comments on commit 7a3ad7f

Please sign in to comment.