#include #import #import #import "MixerHostAudio.h" #import "recordAudioVC.h" #import "UIImage-Extensions.h" /* void audioRouteChangeListenerCallback1 ( void *inUserData, AudioSessionPropertyID inPropertyID, UInt32 inPropertyValueSize, const void *inPropertyValue ){ if(inUserData == nil) return; recordViewController *jxrecorder = (recordViewController *) inUserData; if(!jxrecorder.view.userInteractionEnabled) return; CFDictionaryRef routeChangeDictionary = inPropertyValue; CFNumberRef routeChangeReasonRef = CFDictionaryGetValue (routeChangeDictionary,CFSTR (kAudioSession_AudioRouteChangeKey_Reason)); SInt32 routeChangeReason; CFNumberGetValue (routeChangeReasonRef, kCFNumberSInt32Type, &routeChangeReason); if (routeChangeReason == kAudioSessionRouteChangeReason_OldDeviceUnavailable) { [jxrecorder pause:nil]; BOOL b = [jxrecorder getHeadsetMode]; jxrecorder.isHeadsetTrue = b; [jxrecorder headsetChanged:b]; } if (routeChangeReason == kAudioSessionRouteChangeReason_NewDeviceAvailable) { // Headset is plugged in.. BOOL b = [jxrecorder getHeadsetMode]; jxrecorder.isHeadsetTrue = b; [jxrecorder headsetChanged:b]; } jxrecorder = nil; }*/ @implementation recordAudioVC @synthesize delegate; @synthesize didRecord; @synthesize timeLen; @synthesize outputFileName; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nil bundle:nil]; //self.view.frame = g_window.bounds; self.view.backgroundColor = [UIColor blackColor]; [self build]; [self prepareToRecord]; _pSelf = self; return self; } -(void)dealloc{ [self stop:nil]; // [_mixRecorder release]; // NSLog(@"recordAudioVC.dealloc"); // [super dealloc]; } -(void)build{ _iv = [[JXImageView alloc] initWithFrame:CGRectMake(0, 0, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-200)]; _iv.userInteractionEnabled = YES; [self.view addSubview:_iv]; // [_iv release]; _effectType = [[UIScrollView alloc] initWithFrame:CGRectMake(0, _iv.frame.size.height, JX_SCREEN_WIDTH, 80)]; _effectType.backgroundColor = HEXCOLOR(0x111111); [self.view addSubview:_effectType]; // [_effectType release]; UIView* bottom = [[UIView alloc] initWithFrame:CGRectMake(0, _iv.frame.size.height+80, JX_SCREEN_WIDTH, 120)]; bottom.backgroundColor = HEXCOLOR(0x111111); [self.view addSubview:bottom]; // [bottom release]; int n = 5; _effectType.contentSize = CGSizeMake((n+1) * 80, _effectType.frame.size.height); for(int i=0;i