<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/GeneralSettingsView/GeneralSettingsView.h<|end_filename|>
//
//  GeneralSettingsView.h
//  Equalizers
//
//  Created by <NAME> on 16.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "DPEqualizerSettings.h"

#import "AppConstants.h"

@class GeneralSettingsView;

@protocol GeneralSettingsViewDelegate <NSObject>

- (void) updateSettings : (GeneralSettingsMenuItemType) type newValue : (CGFloat) newValue ;

- (void) closeGeneralSettingsView : (GeneralSettingsView*) generalSettingsView;

@end


@interface GeneralSettingsView : UIView

@property (nonatomic, weak) id<GeneralSettingsViewDelegate> delegate;

+ (instancetype) createWithSettings : (DPEqualizerSettings*) settings;

- (void) showWihDuration : (CGFloat) duration;

- (void) closeWithDuration : (CGFloat) duration
                completion : (void (^)(BOOL finished)) completion;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomTableViewCells/SettingsMenuTableViewCells/SettingsMenuTableViewCell/SettingsMenuTableViewCell.h<|end_filename|>
//
//  SettingsMenuTableViewCell.h
//  Equalizers
//
//  Created by <NAME> on 16.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import "MainTableViewCell.h"

@interface SettingsMenuTableViewCell : MainTableViewCell


@end


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/DPMainEqualizerView.h<|end_filename|>
//
//  DPMainEqualizerView.h
//  Equalizers
//
//  Created by <NAME> on 09.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DPEqualizerSettings.h"
#import "DPAudioService.h"

@interface DPMainEqualizerView : UIView

- (instancetype)initWithFrame:(CGRect)frame andSettings : (DPEqualizerSettings*) settings;

- (void)updateBuffer:(float *)buffer withBufferSize:(UInt32)bufferSize;

- (DPAudioService*) audioService;

- (void) setupView;

- (void) updateNumberOfBins : (int) numberOfBins;

- (void) updateColors;

@property (strong, nonatomic) DPEqualizerSettings *equalizerSettings;

@property (nonatomic, strong) UIColor *equalizerBackgroundColor;

@property (nonatomic, strong) UIColor *lowFrequencyColor;

@property (nonatomic, strong) UIColor *hightFrequencyColor;

@property (nonatomic, strong) UIColor *equalizerBinColor;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomTableViewCells/SettingsMenuTableViewCells/ColorSettingsTableViewCell/ColorSettingsTableViewCell.h<|end_filename|>
//
//  ColorSettingsTableViewCell.h
//  Equalizers
//
//  Created by <NAME> on 14.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import "MainTableViewCell.h"

@interface ColorSettingsTableViewCell : MainTableViewCell

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/Models/ColorItem.h<|end_filename|>
//
//  ColorItem.h
//  Equalizers
//
//  Created by <NAME> on 15.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface ColorItem : NSObject

+ (instancetype) createWithColor : (UIColor*) color hidden : (BOOL) hidden;

@property (nonatomic, strong) UIColor *color;
@property (nonatomic, assign) BOOL isHidden;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/Constants/AppConstants.h<|end_filename|>
//
//  AppConstants.h
//  Equalizers
//
//  Created by <NAME> on 07.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

#define WSMainScreenSize [UIScreen mainScreen].bounds.size

#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))


typedef NS_ENUM(NSInteger, SettingsMenuItemType)
{
    CloseSettings,
    EqualizerBackgroundColor,
    EqualizerLowFrequencyColor,
    EqualizerHighFrequencyColor,
    EqualizerBinColor,
    EqualizerGeneralSettings
};

typedef NS_ENUM(NSInteger, GeneralSettingsMenuItemType)
{
    BinsType,
    GainType,
    GravityType
};

FOUNDATION_EXPORT NSString *const segue_showPlayRecordViewController;


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/DPCircleWaveEqualizer.h<|end_filename|>
//
//  CircleWaveEqualizer.h
//  Equalizers
//
//  Created by <NAME> on 10.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DPMainEqualizerView.h"

@interface DPCircleWaveEqualizer : DPMainEqualizerView

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/Models/SettingsMenuItem.h<|end_filename|>
//
//  SettingsMenuItem.h
//  Equalizers
//
//  Created by <NAME> on 14.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppConstants.h"
#import "DPEqualizerSettings.h"

@interface SettingsMenuItem : NSObject

@property (nonatomic, strong) DPEqualizerSettings *settings;

@property (nonatomic, assign) SettingsMenuItemType type;

@property (nonatomic, strong) NSString *cellId;

+ (instancetype) createWithSetiings : (DPEqualizerSettings*) settings
                               type : (SettingsMenuItemType) type
                             cellId : (NSString*) cellId;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/Models/Equalizer.h<|end_filename|>
//
//  Equalizer.h
//  Equalizers
//
//  Created by <NAME> on 09.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppConstants.h"
#import "DPConstants.h"

@interface Equalizer : NSObject

@property (nonatomic, assign) DPEqualizerType type;
@property (nonatomic, assign) NSString *name;

+ (instancetype) createWithType : (DPEqualizerType) type
                           name : (NSString*) name;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/ViewControllers/EqualizerTypeListViewController.h<|end_filename|>
//
//  EqualizerTypeListViewController.h
//  Equalizers
//
//  Created by <NAME> on 09.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface EqualizerTypeListViewController : UIViewController

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/AppDelegate.h<|end_filename|>
//
//  DPAppDelegate.h
//  DisPlayers-Audio-Visualizers
//
//  Created by <EMAIL> on 03/20/2017.
//  Copyright (c) 2017 <EMAIL>. All rights reserved.
//

@import UIKit;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/UIImage+DPGradientImage.h<|end_filename|>
//
//  UIImage+GradientImage.h
//  Equalizers
//
//  Created by <NAME> on 07.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (DPGradientImage)

+ (UIImage*) convertGradientToImage: (NSArray*) colors frame : (CGRect) frame;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomTableViewCells/GeneralSliderTableViewCell/GeneralSliderTableViewCell.h<|end_filename|>
//
//  GeneralSliderTableViewCell.h
//  Equalizers
//
//  Created by <NAME> on 16.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import "MainTableViewCell.h"

@class GeneralSliderTableViewCell;

@protocol GeneralSliderTableViewCellDelegate <NSObject>

- (void) generalSliderTableViewCell : (GeneralSliderTableViewCell*) generalSliderTableViewCell propertyValueChanged : (CGFloat) newValue;

@end

@interface GeneralSliderTableViewCell : MainTableViewCell

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/Models/GeneralSettingsMenuItem.h<|end_filename|>
//
//  GeneralSettingsMenuItem.h
//  Equalizers
//
//  Created by <NAME> on 16.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AppConstants.h"
#import "DPEqualizerSettings.h"

@interface GeneralSettingsMenuItem : NSObject

@property (nonatomic, strong) DPEqualizerSettings *settings;

@property (nonatomic, assign) GeneralSettingsMenuItemType type;

@property (nonatomic, strong) NSString *cellId;

+ (instancetype) createWithSetiings : (DPEqualizerSettings*) settings
                               type : (GeneralSettingsMenuItemType) type
                             cellId : (NSString*) cellId;

@end


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/DPConstants.h<|end_filename|>
//
//  DPConstants.h
//  Equalizers
//
//  Created by <NAME> on 17.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) \
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

typedef NS_ENUM(NSInteger, DPPlotType)
{
    /**
     Plot that displays only the samples of the current buffer
     */
    DPPlotTypeBuffer,
    /**
     Plot that displays a rolling history of values using the RMS calculated for each incoming buffer
     */
    DPPlotTypeRolling
};


typedef NS_ENUM(NSInteger, DPEqualizerType)
{
    /**
     Histogram equalizer type
     */
    DPHistogram,
    /**
     Rolling equalizer type
     */
    DPRolling,
    /**
     Rolling wave equalizer type with fill
     */
    DPRollingWave,
    /**
     Wave equalizer type with fill
     */
    DPFillWave,
    /**
     Wave equalizer type
     */
    DPWave,
    /**
     Circle wave equalizer type with fill
     */
    DPCircleWave
};


<|start_filename|>Example/DisPlayers-Audio-Visualizers/ViewControllers/PlayRecordViewController.h<|end_filename|>
//
//  PlayRecordViewController.h
//  Equalizers
//
//  Created by <NAME> on 07.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "EZAudio.h"
#import "AppConstants.h"
#import "DPConstants.h"

@interface PlayRecordViewController : UIViewController

- (void) configureWithEqualizerType : (DPEqualizerType) type;

@end


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/DPHistogramEqualizerView.h<|end_filename|>
//
//  HistogramEqualizerView.h
//  Equalizers
//
//  Created by <NAME> on 09.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DPMainEqualizerView.h"

@interface DPHistogramEqualizerView : DPMainEqualizerView

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/ColorSettingsView/ColorSettingsView.h<|end_filename|>
//
//  ColorSettingsView.h
//  Equalizers
//
//  Created by <NAME> on 14.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "DPEqualizerSettings.h"

#import "AppConstants.h"

@class ColorSettingsView;

@protocol ColorSettingsViewDelegate <NSObject>

- (void) updateColors : (ColorSettingsView*) colorSettingsView;

@end

@interface ColorSettingsView : UIView

@property (nonatomic, weak) id<ColorSettingsViewDelegate> delegate;

+ (instancetype) createWithSettings : (DPEqualizerSettings*) audioSettings type : (SettingsMenuItemType) type;

- (CGFloat) height;

- (void) showFromPoint : (CGPoint) topPoint duration : (CGFloat) duration;

- (void) updateColorSettings : (SettingsMenuItemType) type
                    topPoint : (CGPoint) topPoint
                    duration : (CGFloat) duration;

- (void) closeWithDuration : (CGFloat) duration
                completion : (void (^)(BOOL finished)) completion;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomTableViewCells/EqualizerTypeListTableViewCell/EqualizerTypeListTableViewCell.h<|end_filename|>
//
//  EqualizerTypeListTableViewCell.h
//  Equalizers
//
//  Created by <NAME> on 09.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import "MainTableViewCell.h"

@interface EqualizerTypeListTableViewCell : MainTableViewCell

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/SettingsMenuView/SettingsMenuView.h<|end_filename|>
//
//  SettingsMenuView.h
//  Equalizers
//
//  Created by <NAME> on 14.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "DPEqualizerSettings.h"
#import "SettingsMenuItem.h"

@class SettingsMenuView;

@protocol SettingsMenuViewDelegate <NSObject>

@optional

- (void) showColorsSettings : (SettingsMenuView*) settingsMenuView settingsMenuItem : (SettingsMenuItem*) settingsMenuItem topCellPoint : (CGPoint) point ;

- (void) changeColorsSettings : (SettingsMenuView*) settingsMenuView settingsMenuItem : (SettingsMenuItem*) settingsMenuItem topCellPoint : (CGPoint) point ;

- (void) closeColorsSettings : (SettingsMenuView*) settingsMenuView;

- (void) closeSettingsMenuView : (SettingsMenuView*) settingsMenuView;

- (void) showGeneralSettings : (SettingsMenuView*) settingsMenuView;

- (void) closeGeneralSettings : (SettingsMenuView*) settingsMenuView;

@end


@interface SettingsMenuView : UIView

+ (instancetype) createWithSettings : (DPEqualizerSettings*) settings;

+ (CGSize) size;

- (void) update;

- (void) deselectMenuItem;

- (void) showWihDuration : (CGFloat) duration;

- (void) closeWithDuration : (CGFloat) duration
                completion : (void (^)(BOOL finished)) completion;

@property (nonatomic, weak) id<SettingsMenuViewDelegate> delegate;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomTableViewCells/ColorSliderTableViewCell/ColorSliderTableViewCell.h<|end_filename|>
//
//  ColorSliderTableViewCell.h
//  Equalizers
//
//  Created by <NAME> on 14.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import "MainTableViewCell.h"

@class ColorSliderTableViewCell;

@protocol ColorSliderTableViewCellDelegate <NSObject>

- (void) colorSliderTableViewCell : (ColorSliderTableViewCell*) colorSliderTableViewCell colorDidChange : (UIColor*) newColor;

- (void) colorSliderTableViewCell : (ColorSliderTableViewCell*) colorSliderTableViewCell needToAddNewColor : (BOOL) needToAddNewColor;

@end

@interface ColorSliderTableViewCell : MainTableViewCell

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomSliderView/GeneralSettingsSlider/GeneralSettingsSlider.h<|end_filename|>
//
//  GeneralSettingsSlider.h
//  Equalizers
//
//  Created by <NAME> on 16.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface GeneralSettingsSlider : UISlider

@end


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/DPAudioService.h<|end_filename|>
//
//  DPAudioService.h
//  Equalizers
//
//  Created by <NAME> on 8/2/14. Modified by <NAME> on 07.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

//Objects
#import "DPEqualizerSettings.h"

@protocol DPAudioServiceDelegate <NSObject>

@optional

- (void) refreshEqualizerDisplay;

@end

@interface DPAudioService : NSObject

+ (instancetype) alloc __attribute__((unavailable("alloc not available, call manager instead")));
- (instancetype) init __attribute__((unavailable("init not available, call manager instead")));
+ (instancetype) new __attribute__((unavailable("new not available, call manager instead")));


@property (nonatomic, weak) id<DPAudioServiceDelegate> delegate;

@property (assign, nonatomic) DPPlotType plotType;

@property (nonatomic) NSUInteger numOfBins;

+ (instancetype) serviceWith : (DPEqualizerSettings*) audioSettings;

- (float*) frequencyHeights;

- (NSMutableArray*) timeHeights;

- (void) updateBuffer: (float *)buffer
       withBufferSize: (UInt32)bufferSize;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomTableViewCells/MainTableViewCell/MainTableViewCell.h<|end_filename|>
//
//  MainTableViewCell.h
//  Equalizers
//
//  Created by <NAME> on 09.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MainTableViewCell : UITableViewCell

@property (nonatomic, weak) id delegate;

+ (NSString*) cellID;
+ (CGFloat) heightForCell;

+ (instancetype) cell;
+ (id) cellNib;

- (void) configurationForObject:(id)object;

@end


<|start_filename|>Example/DisPlayers-Audio-Visualizers/CustomViews/CustomSliderView/ColorSlider/ColorSlider.h<|end_filename|>
//
//  ColorSlider.h
//  Equalizers
//
//  Created by <NAME> on 14.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ColorSlider : UISlider

@property (nonatomic, strong)UIColor *color;
@property (nonatomic)int colorTrackHeight;

@end


<|start_filename|>DisPlayers-Audio-Visualizers/Classes/DPEqualizerSettings.h<|end_filename|>
//
//  AudioSettings.h
//  Equalizers
//
//  Created by <NAME> on 07.03.17.
//  Copyright © 2017 Agilie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "DPConstants.h"

@interface DPEqualizerSettings : NSObject

/// Creates a new default instance of the DPEqualizerSettings.
/// @return The newly created DPEqualizerSettings instance.
+ (instancetype) create;

/// Creates a new instance of the DPEqualizerSettings using a DPEqualizerType.
/// @param type The type of equalizer that can be displayed in the view.
/// @return The newly created DPEqualizerSettings instance.
+ (instancetype) createByType : (DPEqualizerType) type;

/// The highest bound of the frequency. Default: 7000Hz
@property (nonatomic) float maxFrequency;

/// The lowest bound of the frequency. Default: 400Hz
@property (nonatomic) float minFrequency;

/// The number of bins in the audio plot. Default: 40
@property (nonatomic) NSUInteger numOfBins;

/// The padding of each bin in percent width. Default: 0.2
@property (nonatomic) CGFloat padding;

/// The gain applied to the height of each bin. Default: 10
@property (nonatomic) CGFloat gain;

/// A float that specifies the vertical gravitational acceleration applied to each bin.
/// Default: 10 pixel/sec^2
@property (nonatomic) float gravity;

/// The number of max bin height. Default: Screen height.
@property (assign, nonatomic) CGFloat maxBinHeight;

/// The type of plot that can be displayed in the view using the data. Default: DPPlotTypeBuffer.
@property (assign, nonatomic) DPPlotType plotType;

/// The type of equalizer that can be displayed in the view using the data. Default: DPHistogram.
@property (assign, nonatomic) DPEqualizerType equalizerType;

/// The colors of equalizer background that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *equalizerBackgroundColors;

/// The colors of low frequency that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *lowFrequencyColors;

/// The colors of hight frequency that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *hightFrequencyColors;

/// The colors of bins that can be displayed in the view.
@property (nonatomic, strong) NSMutableArray *equalizerBinColors;

@property (nonatomic, assign) BOOL fillGraph;

@end
