Search Results

Search found 12 results on 1 pages for 'blacksheep'.

Page 1/1 | 1 

  • set different volumes inside app

    - by blacksheep
    i'd lioke to set the volume inside the touchesBegan action on half the volume of the IBAction. (void) awakeFromNib { [super awakeFromNib]; engine = [[Finch alloc] init]; E = [[RevolverSound alloc] initWithFile:PATH(@"E.wav")rounds:9]; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.view]; if(CGRectContainsPoint(Edrop.frame,location)){ [E play]; } } (IBAction)bass:(id)sender { if(CGRectIntersectsRect(finga.frame,e.frame)){ if(finga.center.y <= e.center.y) [E play]; } } thanx, blacksheep

    Read the article

  • save and play recorded sound

    - by blacksheep
    i'd like to save and play again this recorded sounds: @interface Recorder : NSObject { NSMutableArray *times; NSMutableArray *samples; } @end @implementation Recorder – (id) init { [super init]; times = [[NSMutableArray alloc] init]; samples = [[NSMutableArray alloc] init]; return self; } – (void) recordSound: (id) someSound { CFAbsoluteTime now = CFAbsoluteTimeGetCurrent(); NSNumber *wrappedTime = [NSNumber numberWithDouble:now]; [times addObject:wrappedTime]; [samples addObject:someSound]; } @end thanx blacksheep

    Read the article

  • MySQL server with website hosting with managed hosting

    - by BlackSheep
    I work for a small business, and I am the "IT Department". I also happen to be a summer intern, so after I leave the number of IT staff will be 0 for an indefinite period of time. I need a place where I can reliably put up the company's website as well as the mySQL+PHP backend. Good redundancy is a plus, as well as easy administration for my IT-challenged colleagues. Managed hosting would be good, so the PHP versions can update without my company having to hire an admin. EDIT: The company already has a mySQL+PHP server running locally which hosts the existing website. My assignment is to find a remote server where the latest versions of mySQL+PHP will be maintained and where there is a very small chance of unintended downtime. Can you recommend anything?

    Read the article

  • finding the gedit plugin folder

    - by BlackSheep
    I am a bit confused as to where I should put externally downloaded plugins. I have tried putting them in: /usr/share/gedit/plugins ~/.local/gedit/plugins ~/.gnome2/gedit/plugins /usr/lib/gedit/plugins The way I have checked whether the plugins show up or not is going to Edit-Preferences-Plugins and looking for the ones I have downloaded (clickconfig, gedit-developer-plugins-...). Since I do not see any new plugins appearing, I have to assume that I am doing something wrong. None of these have worked. I am a bit tired of polluting my system. It's probably my own fault as it's written somewhere I have not thought to look. Please let me know how to add external plugins to gedit properly. I am running Ubuntu 11.10. My gedit version is 3.2.3 EDIT: I am still not able to solve this problem. I have tried the following folder now as well, and it hasn't worked: ~/.config/gedit/plugins

    Read the article

  • collision with moving objects

    - by blacksheep
    tried to write a collision with the moving "floats" but did not succeed. maybe wrong place of the "collision" code? thanx 4 help! // // FruitsView.m // import "FruitsView.h" import "Constants.h" import "Utilities.h" define kFloat1Speed 0.15 define kFloat2Speed 0.3 define kFloat3Speed 0.2 @interface FruitsView (Private) - (void) stopTimer; @end @implementation FruitsView @synthesize apple, float1, float2, float3, posFloat1, posFloat2, posFloat3; -(void)onTimer { float1.center = CGPointMake(float1.center.x+posFloat1.x,float1.cen ter.y+posFloat1.y); if(float1.center.x 380 || float1.center.x < -60) posFloat1.x = -posFloat1.x; if(float1.center.y 100 || float1.center.y < -40) posFloat1.y = -posFloat1.y; float2.center = CGPointMake(float2.center.x+posFloat2.x,float2.cen ter.y+posFloat2.y); if(float2.center.x 380 || float2.center.x < -50) posFloat2.x = -posFloat2.x; if(float2.center.y 150 || float2.center.y < -30) posFloat2.y = -posFloat2.y; float3.center = CGPointMake(float3.center.x+posFloat3.x,float3.cen ter.y+posFloat3.y); if(float3.center.x 380 || float3.center.x < -70) posFloat3.x = -posFloat3.x; if(float3.center.y 100 || float3.center.y < -20) posFloat3.y = -posFloat3.y; if(CGRectIntersectsRect(apple.frame,float1.frame)) { if(apple.center.y float1.center.y) { posApple.y = -posApple.y; } } if(CGRectIntersectsRect(apple.frame,float2.frame)) { if(apple.center.y float2.center.y) { posFloat2.y = -posFloat2.y; } } if(CGRectIntersectsRect(apple.frame,float3.frame)) { if(apple.center.y float3.center.y) { posFloat3.y = -posFloat3.y; } } } pragma mark Initialisation/destruction (void)awakeFromNib { [NSTimer scheduledTimerWithTimeInterval:0.0001 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; posFloat1 = CGPointMake(kFloat1Speed, 0); posFloat2 = CGPointMake(kFloat2Speed, 0); posFloat3 = CGPointMake(kFloat3Speed, 0); timer = nil; modeLock = lockNotYetChosen; defaultSize = self.bounds.size.width; modal = self.tag; [[UIAccelerometer sharedAccelerometer] setDelegate:self]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationRepeatCount:1]; eadbea.transform = CGAffineTransformMakeScale(0.5,0.5); [UIView commitAnimations]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationRepeatCount:1]; apple.transform = CGAffineTransformMakeScale(0.5,0.5); [UIView commitAnimations]; } pragma mark Background animation processing (void) startTimer { if (!timer) { timer = [[NSTimer scheduledTimerWithTimeInterval:1.0/60.0 target:self selector:@selector(timerTick:) userInfo:nil repeats:YES] retain]; } } (void) stopTimer { [timer invalidate]; [timer release]; timer = nil; } (void) check:(CGPoint*)position delta:(CGSize*)delta halfSize:(CGSize)halfSize forBouncingAgainst:(CGSize)containerSize { if ((position-x - halfSize.width)<0) { delta-width = fabsf(delta-width)*BOUNCE_DAMPING; position-x = halfSize.width; } if ((position-x + halfSize.width)containerSize.width) { delta-width = fabsf(delta-width)*-BOUNCE_DAMPING; position-x = containerSize.width - halfSize.width; } if ((position-y - halfSize.height)<0) { delta-height = fabsf(delta-height)*BOUNCE_DAMPING; position-y = halfSize.height; } if ((position-y + halfSize.height)containerSize.height) { delta-height = fabsf(delta-height)*-BOUNCE_DAMPING; position-y = containerSize.height - halfSize.height; } } (void) timerTick: (NSTimer*)timer { dragDelta = CGSizeScale(dragDelta, INERTIAL_DAMPING); if ((fabsf(dragDelta.width)DELTA_ZERO_THRESHOLD) || (fabsf(dragDelta.height)DELTA_ZERO_THRESHOLD)) { CGPoint ctr = CGPointApplyDelta(self.center, dragDelta); CGSize halfSize = CGSizeMake(self.bounds.size.width/4, self.bounds.size.height/4); [self check:&ctr delta:&dragDelta halfSize:halfSize forBouncingAgainst:self.superview.bounds.size]; self.center = ctr; } else { [self stopTimer]; } } pragma mark Input Handling (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent )event { NSSet allTouches = [event touchesForView:self]; if ([allTouches count]==1) { if (modeLocklockNotYetChosen) return; UITouch* anyTouch = [touches anyObject]; lastMove = anyTouch.timestamp; CGPoint now = [anyTouch locationInView: self.superview]; CGPoint then = [anyTouch previousLocationInView: self.superview]; dragDelta = CGPointDelta(now, then); self.center = CGPointApplyDelta(self.center, dragDelta); [self stopTimer]; } } (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSSet* allTouches = [event touchesForView:self]; if ([touches count]==[allTouches count]) { modeLock = lockNotYetChosen; if ((event.timestamp - lastMove) MOVEMENT_PAUSE_THRESHOLD) return; if ((fabsf(dragDelta.width)INERTIA_THRESHOLD) || (fabsf(dragDelta.height)INERTIA_THRESHOLD)) { [self startTimer]; } } } (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { modeLock = lockNotYetChosen; [self stopTimer]; } (void)dealloc { [float1 release]; [float2 release]; [float3 release]; [apple release]; [bear_head release]; [self stopTimer]; [super dealloc]; } @end

    Read the article

  • changing sounds when objects meet

    - by blacksheep
    i'd like to change sounds when tapping on an image and drag another image over several others. it is not working properly: the "MoveImage" is not dragable, the tapping is working outside the "TouchImage" and the sounds do not change when tapping on it. (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if(((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_1.frame)))) { [sound_E play]; } if (((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_2.frame)))) { [sound_F play]; } if (((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_3.frame)))) { [sound_D play]; } if (((CGRectContainsPoint(myTouchImage.frame, location)), (CGRectIntersectsRect(myMoveImage.frame,myImage_4.frame)))) { [sound_Dis play]; } } (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if (CGRectContainsPoint(myMoveImage.frame, location)){ CGPoint yLocation = CGPointMake(myMoveImage.center.x,location.y); myMoveImage.center = yLocation; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_1.frame)) { E_NOTE.text = @"E"; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_2.frame)) { F_NOTE.text = @"F"; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_3.frame)) { D_NOTE.text = @"D"; } if(CGRectIntersectsRect(myMoveImage.frame,myImage_4.frame)) { Dis_NOTE.text = @"D#"; } }

    Read the article

  • drag object vertically

    - by blacksheep
    i like to drag this object vertically instead of horizontally, which is doin it now: (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if (CGRectContainsPoint(myObject.frame, location)){ CGPoint xLocation = CGPointMake(location.x, myObject.center.y); myObject.center = xLocation; } }

    Read the article

1