diff --git a/EZAudio/EZAudioPlot.h b/EZAudio/EZAudioPlot.h
index 036cc5a9..f737ee9a 100644
--- a/EZAudio/EZAudioPlot.h
+++ b/EZAudio/EZAudioPlot.h
@@ -156,7 +156,10 @@ FOUNDATION_EXPORT UInt32 const EZAudioPlotDefaultMaxHistoryBufferLength;
//------------------------------------------------------------------------------
-- (void)initPlot;
+/**
+ Called after the view has been created. Subclasses should use to add any additional methods needed instead of overriding the init methods.
+ */
+- (void)setupPlot;
//------------------------------------------------------------------------------
diff --git a/EZAudio/EZAudioPlot.m b/EZAudio/EZAudioPlot.m
index d156b580..7abee323 100644
--- a/EZAudio/EZAudioPlot.m
+++ b/EZAudio/EZAudioPlot.m
@@ -151,11 +151,25 @@ - (void)initPlot
self.backgroundColor = nil;
[self.layer insertSublayer:self.waveformLayer atIndex:0];
+ //
+ // Allow subclass to initialize plot
+ //
+ [self setupPlot];
+
self.points = calloc(EZAudioPlotDefaultMaxHistoryBufferLength, sizeof(CGPoint));
self.pointCount = [self initialPointCount];
[self redraw];
}
+//------------------------------------------------------------------------------
+
+- (void)setupPlot
+{
+ //
+ // Override in subclass
+ //
+}
+
//------------------------------------------------------------------------------
#pragma mark - Setup
//------------------------------------------------------------------------------
diff --git a/EZAudio/EZAudioPlotGL.h b/EZAudio/EZAudioPlotGL.h
index 8ba2b516..70e5a007 100644
--- a/EZAudio/EZAudioPlotGL.h
+++ b/EZAudio/EZAudioPlotGL.h
@@ -206,6 +206,28 @@ typedef struct
//------------------------------------------------------------------------------
+/**
+ Called during the OpenGL run loop to constantly update the drawing 60 fps. Callers can use this force update the screen while subclasses can override this for complete control over their rendering. However, subclasses are more encouraged to use the `redrawWithPoints:pointCount:baseEffect:vertexBufferObject:vertexArrayBuffer:interpolated:mirrored:gain:`
+ */
+- (void)redraw;
+
+//------------------------------------------------------------------------------
+
+/**
+ Called after the view has been created. Subclasses should use to add any additional methods needed instead of overriding the init methods.
+ */
+- (void)setup;
+
+//------------------------------------------------------------------------------
+
+/**
+ Main method used to copy the sample data from the source buffer and update the
+ plot. Subclasses can overwrite this method for custom behavior.
+ @param data A float array of the sample data. Subclasses should copy this data to a separate array to avoid threading issues.
+ @param length The length of the float array as an int.
+ */
+- (void)setSampleData:(float *)data length:(int)length;
+
///-----------------------------------------------------------
/// @name Subclass Methods
///-----------------------------------------------------------
diff --git a/EZAudio/EZAudioPlotGL.m b/EZAudio/EZAudioPlotGL.m
index f68b9a23..f092b47f 100644
--- a/EZAudio/EZAudioPlotGL.m
+++ b/EZAudio/EZAudioPlotGL.m
@@ -182,6 +182,11 @@ - (void)setup
self.color = [NSColor colorWithCalibratedRed:1.0f green:1.0f blue:1.0f alpha:1.0f];
#endif
+ //
+ // Allow subclass to initialize plot
+ //
+ [self setupPlot];
+
//
// Create the display link
//
@@ -191,6 +196,15 @@ - (void)setup
//------------------------------------------------------------------------------
+- (void)setupPlot
+{
+ //
+ // Override in subclass
+ //
+}
+
+//------------------------------------------------------------------------------
+
- (void)setupOpenGL
{
self.baseEffect = [[GLKBaseEffect alloc] init];
@@ -247,6 +261,7 @@ - (void)setupOpenGL
#if !TARGET_OS_IPHONE
[self.openGLContext unlock];
#endif
+ self.frame = self.frame;
}
//------------------------------------------------------------------------------
diff --git a/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h b/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h
index 357d3d71..1bce923b 100644
--- a/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h
+++ b/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.h
@@ -57,6 +57,11 @@
*/
@property (nonatomic, weak) IBOutlet NSPopUpButton *microphoneInputChannelPopUpButton;
+/**
+ The checkbox button used to turn the microphone off/on
+ */
+@property (nonatomic, weak) IBOutlet NSButton *microphoneSwitch;
+
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
diff --git a/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.m b/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.m
index 7d6210d6..8bd18b5e 100644
--- a/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.m
+++ b/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.m
@@ -240,4 +240,25 @@ - (void)microphone:(EZMicrophone *)microphone
//------------------------------------------------------------------------------
+- (void)microphone:(EZMicrophone *)microphone changedPlayingState:(BOOL)isPlaying
+{
+ NSString *title = isPlaying ? @"Microphone On" : @"Microphone Off";
+ [self setTitle:title forButton:self.microphoneSwitch];
+}
+
+//------------------------------------------------------------------------------
+#pragma mark - Utility
+//------------------------------------------------------------------------------
+
+- (void)setTitle:(NSString *)title forButton:(NSButton *)button
+{
+ NSDictionary *attributes = @{ NSForegroundColorAttributeName : [NSColor whiteColor] };
+ NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:title
+ attributes:attributes];
+ button.attributedTitle = attributedTitle;
+ button.attributedAlternateTitle = attributedTitle;
+}
+
+//------------------------------------------------------------------------------
+
@end
\ No newline at end of file
diff --git a/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.xib b/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.xib
index d2ccd4b4..3dd665b6 100644
--- a/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.xib
+++ b/EZAudioExamples/OSX/EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample/CoreGraphicsWaveformViewController.xib
@@ -10,6 +10,7 @@
+
@@ -83,7 +84,7 @@
-
+
@@ -91,7 +92,7 @@
-
+
diff --git a/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.h b/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.h
index e1b454ca..01fe06cf 100644
--- a/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.h
+++ b/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.h
@@ -61,6 +61,11 @@
*/
@property (nonatomic, weak) IBOutlet NSPopUpButton *microphoneInputChannelPopUpButton;
+/**
+ The checkbox button used to turn the microphone off/on
+ */
+@property (nonatomic, weak) IBOutlet NSButton *microphoneSwitch;
+
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
diff --git a/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.m b/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.m
index c0d61562..d0f11611 100644
--- a/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.m
+++ b/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.m
@@ -226,8 +226,7 @@ - (void)microphone:(EZMicrophone *)microphone
//------------------------------------------------------------------------------
-- (void)microphone:(EZMicrophone *)microphone
- changedDevice:(EZAudioDevice *)device
+- (void)microphone:(EZMicrophone *)microphone changedDevice:(EZAudioDevice *)device
{
dispatch_async(dispatch_get_main_queue(), ^{
//
@@ -246,4 +245,25 @@ - (void)microphone:(EZMicrophone *)microphone
//------------------------------------------------------------------------------
+- (void)microphone:(EZMicrophone *)microphone changedPlayingState:(BOOL)isPlaying
+{
+ NSString *title = isPlaying ? @"Microphone On" : @"Microphone Off";
+ [self setTitle:title forButton:self.microphoneSwitch];
+}
+
+//------------------------------------------------------------------------------
+#pragma mark - Utility
+//------------------------------------------------------------------------------
+
+- (void)setTitle:(NSString *)title forButton:(NSButton *)button
+{
+ NSDictionary *attributes = @{ NSForegroundColorAttributeName : [NSColor whiteColor] };
+ NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:title
+ attributes:attributes];
+ button.attributedTitle = attributedTitle;
+ button.attributedAlternateTitle = attributedTitle;
+}
+
+//------------------------------------------------------------------------------
+
@end
diff --git a/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.xib b/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.xib
index 4a22fd64..5a4ca496 100644
--- a/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.xib
+++ b/EZAudioExamples/OSX/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample/OpenGLWaveformViewController.xib
@@ -10,6 +10,7 @@
+
@@ -86,7 +87,7 @@
-
+
@@ -94,7 +95,7 @@
-
+
diff --git a/EZAudioExamples/iOS/EZAudioFFTExample/EZAudioFFTExample.xcodeproj/project.pbxproj b/EZAudioExamples/iOS/EZAudioFFTExample/EZAudioFFTExample.xcodeproj/project.pbxproj
index 70403c98..0ff2926f 100644
--- a/EZAudioExamples/iOS/EZAudioFFTExample/EZAudioFFTExample.xcodeproj/project.pbxproj
+++ b/EZAudioExamples/iOS/EZAudioFFTExample/EZAudioFFTExample.xcodeproj/project.pbxproj
@@ -506,6 +506,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioFFTExample/EZAudioFFTExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioFFTExample/EZAudioFFTExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -519,6 +520,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioFFTExample/EZAudioFFTExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioFFTExample/EZAudioFFTExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
diff --git a/EZAudioExamples/iOS/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample.xcodeproj/project.pbxproj b/EZAudioExamples/iOS/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample.xcodeproj/project.pbxproj
index 72ea32c3..1f7a0e88 100644
--- a/EZAudioExamples/iOS/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample.xcodeproj/project.pbxproj
+++ b/EZAudioExamples/iOS/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample.xcodeproj/project.pbxproj
@@ -502,6 +502,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -515,6 +516,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
diff --git a/EZAudioExamples/iOS/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj b/EZAudioExamples/iOS/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj
index cd619715..12599dc4 100644
--- a/EZAudioExamples/iOS/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj
+++ b/EZAudioExamples/iOS/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj
@@ -502,6 +502,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -515,6 +516,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
diff --git a/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample.xcodeproj/project.pbxproj b/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample.xcodeproj/project.pbxproj
index f1af4cd6..2bdabc0a 100644
--- a/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample.xcodeproj/project.pbxproj
+++ b/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample.xcodeproj/project.pbxproj
@@ -506,6 +506,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioPlayFileExample/EZAudioPlayFileExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioPlayFileExample/EZAudioPlayFileExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -519,6 +520,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioPlayFileExample/EZAudioPlayFileExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioPlayFileExample/EZAudioPlayFileExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
diff --git a/EZAudioExamples/iOS/EZAudioRecordExample/EZAudioRecordExample.xcodeproj/project.pbxproj b/EZAudioExamples/iOS/EZAudioRecordExample/EZAudioRecordExample.xcodeproj/project.pbxproj
index 6d3763ef..2051aa0d 100644
--- a/EZAudioExamples/iOS/EZAudioRecordExample/EZAudioRecordExample.xcodeproj/project.pbxproj
+++ b/EZAudioExamples/iOS/EZAudioRecordExample/EZAudioRecordExample.xcodeproj/project.pbxproj
@@ -502,6 +502,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioRecordExample/EZAudioRecordExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioRecordExample/EZAudioRecordExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -515,6 +516,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioRecordExample/EZAudioRecordExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioRecordExample/EZAudioRecordExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
diff --git a/EZAudioExamples/iOS/EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample.xcodeproj/project.pbxproj b/EZAudioExamples/iOS/EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample.xcodeproj/project.pbxproj
index 8df74d86..ee7e3238 100644
--- a/EZAudioExamples/iOS/EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample.xcodeproj/project.pbxproj
+++ b/EZAudioExamples/iOS/EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample.xcodeproj/project.pbxproj
@@ -506,6 +506,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -519,6 +520,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioWaveformFromFileExample/EZAudioWaveformFromFileExample-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};