#import "iDeeJay.h" typedef enum { kUIControlEventMouseDown = 1 << 0, kUIControlEventMouseMovedInside = 1 << 2, kUIControlEventMouseMovedOutside = 1 << 3, kUIControlEventMouseUpInside = 1 << 6, kUIControlEventMouseUpOutside = 1 << 7, kUIControlAllEvents = (kUIControlEventMouseDown | kUIControlEventMouseMovedInside | kUIControlEventMouseMovedOutside | kUIControlEventMouseUpInside | kUIControlEventMouseUpOutside) } UIControlEventMasks; @implementation iDeeJay - (void) buttonPressed { NSLog(@"bajs?"); } - (void) showDecks { UIImage *vinylDecks[2]; vinylDecks[0] = [UIImage imageNamed:@"vinyl_001.png"]; vinylDecks[1] = [UIImage imageNamed:@"vinyl_001.png"]; } - (void)navigationBar:(UINavigationBar*)nav buttonClicked:(int)button { switch(button) { case 0: [window setRotationDegrees:0 duration:0.5]; break; case 1: NSLog(@"lol"); } } - (void) applicationDidFinishLaunching: (id) unused { float black[4] = {0.0f, 0.0f, 0.0f, 1.0f}; float bajs[4] = {0.0f, 0.0f, 0.0f, 0.0f}; [UIHardware _setStatusBarHeight:0.0f]; [self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0]; struct CGRect rect = [UIHardware fullScreenApplicationContentRect]; rect.origin.x = rect.origin.y = 0; /* Initialize the main window */ UIWindow* window = [[UIWindow alloc] initWithContentRect: CGRectMake(0.0f, 75.0f, 480.0f, 480.0f)]; [window orderFront: self]; [window makeKey: self]; [window _setHidden: false]; [window setRotationDegrees:90 duration:0.5]; /* Background Image -- The mixertable n shit :) */ bg = [[UIImageView alloc] initWithFrame: CGRectMake(20.0, 50.0, 100.0, 100.0)]; [bg setImage: [UIImage imageNamed: @"bg.png"]]; /* Navigation-bar -- Needed? */ UINavigationBar *nav = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 480.0f, 37.0f)]; [nav showButtonsWithLeftTitle: @"Exit" rightTitle: @"Playlists" leftBack: YES]; [nav setBarStyle: 2]; [nav setDelegate:self]; /*PlayButton's! Images and LEFT playbutton. Well, to make it play? :) */ UIImage* plybtnImage = [UIImage imageNamed:@"play_button_up.png"]; UIImage* plybtnImagePressed = [UIImage imageNamed:@"play_button_down.png"]; UIPushButton* playButtonL = [[UIPushButton alloc] initWithTitle:@"" autosizesToFit:NO]; [playButtonL setFrame: CGRectMake(50.0, 220.0, 40.0, 20.0)]; [playButtonL setDrawsShadow: YES]; [playButtonL setStretchBackground:YES]; [playButtonL setEnabled:YES]; [playButtonL setBackgroundColor: CGColorCreate(CGColorSpaceCreateDeviceRGB(), bajs)]; [playButtonL setBackground:plybtnImage forState:0]; [playButtonL setBackground:plybtnImagePressed forState:1]; /* RIGHT Playbutton! */ UIPushButton* playButtonR = [[UIPushButton alloc] initWithTitle:@"" autosizesToFit:NO]; [playButtonR setFrame: CGRectMake(320.0, 220.0, 40.0, 20.0)]; [playButtonR setDrawsShadow: YES]; [playButtonR setStretchBackground:YES]; [playButtonR setEnabled:YES]; [playButtonR setBackground:plybtnImage forState:0]; [playButtonR setBackground:plybtnImagePressed forState:1]; /* Initialize the main view */ UIView* mainView = [[[UIView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 480.0f, 320.0f)] autorelease]; [mainView setBackgroundColor: CGColorCreate(CGColorSpaceCreateDeviceRGB(), black)]; [window setContentView: mainView]; [mainView addSubview: nav]; [mainView addSubview: bg]; [mainView addSubview: playButtonL]; [mainView addSubview: playButtonR]; [self showDecks]; } @end