i+d=pumpún

Pumpún Dixital. Marqués de Valadares, 14, 5º Ofic 10. APP DEV. Desenvolvemos aplicacións para o ollo e o oído I+D+i PLUS.

Parse Automatic Backup / code by linoman

Parse Automatic Backups provides a option to automate through a cron job the backup of a Parse

Install

Requires composer

  • clone the mercurial repository hg clone https://man@bitbucket.org/man/parse-automatic-backup or download the zip and extract it
  • do the composer install
  • rename the file ‘config.php.copy’ to ‘config.php’ and fill it with your params

Usage

Launch the index.php file in a web browser or in a cron job. That’s all folks!

Download code

https://bitbucket.org/man/parse-automatic-backup

Direct Download (ZIP Format)

Parse

parse-logo

This entry was written by Pumpun Dixital, posted on 18 Decembro, 2014 at 8:38, filed under Code and tagged , , . Leave a comment or view the discussion at the permalink.

Guerrilla Sample Box ios app: source code (AVAudioPlayer class)

The audio pad app “Guerrilla Sample Box” is written using the ios 5 sdk and AVAudioPlayer class from AVFoundation.

The app source code can be downloaded from the Pumpún github repository

The part of the code that deals with the audio pad interface and sound manipulation is located at PMPPlayViewController.m. The process of playing sounds is quite simple, and can be divided in 2:

First, a NSMutableArray is created, which holds several AVAudioPlayer objects, one per sound. They are initiated with a pathForResource.

Second, a playButtonPressed method is created, which is fired from buttons located at PlayView nib. Each time they are pressed all sounds are stopped, and the sound related to the tag property of the button starts playing.

#import "PMPPlayViewController.h"
 
@interface PMPPlayViewController ()
 
@end
 
@implementation PMPPlayViewController
@synthesize statusText;
 
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {		
 
		sonsMutables = [NSMutableArray arrayWithCapacity:20];
		NSError *error;
		nSons = 20;
 
		for (int i= 0; i<nSons; i++) {
			AVAudioPlayer *playerMutable;
			NSString *pathMutable = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"Sound_%ld", i] ofType:@"mp3"];
			playerMutable = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:pathMutable] error:&error];
			playerMutable.volume = 1.0f;
			[playerMutable prepareToPlay];
			[playerMutable setNumberOfLoops:0];
 
			[sonsMutables addObject:playerMutable];
		}
 
 
 
 
 
    }
    return self;
}
 
- (void)viewDidLoad{
    [super viewDidLoad];
}
 
- (void)viewDidUnload{
    [super viewDidUnload];
}
 
- (IBAction)playButtonPressed:(id)sender{
	UIButton *button = (UIButton*) sender;
	int toneIndex = button.tag;
 
	for(int i=0; i<nSons; i++){
		[[sonsMutables objectAtIndex:i] stop];
	}
 
	AVAudioPlayer *playerFinal;
	playerFinal = [sonsMutables objectAtIndex:toneIndex];
	[playerFinal setVolume:1.0f];
 
	if([playerFinal isPlaying]){
		[playerFinal stop];    
	}
 
	playerFinal.currentTime = 0;
	[playerFinal play];    
 
 
 
 
	NSString *title = [sender titleForState:UIControlStateNormal];
	statusText.text = [NSString stringWithFormat:@"%@ ...", title];
 
}
 
- (IBAction)stopSounds:(id)sender {
	for(int i=0; i<nSons; i++){
		[[sonsMutables objectAtIndex:i] stop];
	}
}
 
@end

SoundBOX (Guerrilla Samples Box) is a sound machine that can be used as a citizen tool é unha máquina de son que pretende servir como ferramenta cidadá. Contains chants hymns and other standards that can be heard in public events in Spain.

Almost all sounds were taken from recordings of Pedro Jimenez, Kamen, Chinowski (Tesladream), Grupo Numax and Edu Comelles, all of them were released at Mediateletipos.net as part of the “sound archive #spanishrevolution Yes, we klang!).

Guerrilla sample box front

Guerrilla sample box back

This entry was written by berio, posted on 25 Xuño, 2012 at 15:47, filed under Code. Leave a comment or view the discussion at the permalink.