Ver código fonte

Added (empty) AudioVisualizer class files

Thomas Buck 9 anos atrás
pai
commit
915b720eb5

+ 6
- 0
CaseLights.xcodeproj/project.pbxproj Ver arquivo

@@ -9,6 +9,7 @@
9 9
 /* Begin PBXBuildFile section */
10 10
 		E9101B871C36B11500720A6E /* EZAudioOSX.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E9101B831C36B0C100720A6E /* EZAudioOSX.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
11 11
 		E9101B881C36B4B100720A6E /* EZAudioOSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9101B831C36B0C100720A6E /* EZAudioOSX.framework */; };
12
+		E9101B8B1C36C8D400720A6E /* AudioVisualizer.m in Sources */ = {isa = PBXBuildFile; fileRef = E9101B8A1C36C8D400720A6E /* AudioVisualizer.m */; };
12 13
 		E9109B111C2AACF400726111 /* SystemInfoKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9109B0B1C2AAC1B00726111 /* SystemInfoKit.framework */; };
13 14
 		E9109B151C2AAEFD00726111 /* SystemInfoKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E9109B0B1C2AAC1B00726111 /* SystemInfoKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14 15
 		E9109B191C2AAFE100726111 /* GPUStats.m in Sources */ = {isa = PBXBuildFile; fileRef = E9109B181C2AAFE100726111 /* GPUStats.m */; };
@@ -81,6 +82,8 @@
81 82
 
82 83
 /* Begin PBXFileReference section */
83 84
 		E9101B7B1C36B0C100720A6E /* EZAudio.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = EZAudio.xcodeproj; path = EZAudio/EZAudio.xcodeproj; sourceTree = "<group>"; };
85
+		E9101B891C36C8D400720A6E /* AudioVisualizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioVisualizer.h; sourceTree = "<group>"; };
86
+		E9101B8A1C36C8D400720A6E /* AudioVisualizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioVisualizer.m; sourceTree = "<group>"; };
84 87
 		E9109B051C2AAC1B00726111 /* SystemInfoKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SystemInfoKit.xcodeproj; path = JSystemInfoKit/SystemInfoKit.xcodeproj; sourceTree = "<group>"; };
85 88
 		E9109B171C2AAFE100726111 /* GPUStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPUStats.h; path = CaseLights/GPUStats.h; sourceTree = "<group>"; };
86 89
 		E9109B181C2AAFE100726111 /* GPUStats.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GPUStats.m; path = CaseLights/GPUStats.m; sourceTree = "<group>"; };
@@ -165,6 +168,8 @@
165 168
 			children = (
166 169
 				E9F13E011C28B3D3004C6B95 /* AppDelegate.h */,
167 170
 				E9F13E021C28B3D3004C6B95 /* AppDelegate.m */,
171
+				E9101B891C36C8D400720A6E /* AudioVisualizer.h */,
172
+				E9101B8A1C36C8D400720A6E /* AudioVisualizer.m */,
168 173
 				E9109B161C2AAFA200726111 /* LowLevel */,
169 174
 				E9F13E071C28B3D3004C6B95 /* Assets.xcassets */,
170 175
 				E9F13E091C28B3D3004C6B95 /* MainMenu.xib */,
@@ -315,6 +320,7 @@
315 320
 			files = (
316 321
 				E9AB18011C29F8CD00BF3C51 /* Serial.m in Sources */,
317 322
 				E9109B191C2AAFE100726111 /* GPUStats.m in Sources */,
323
+				E9101B8B1C36C8D400720A6E /* AudioVisualizer.m in Sources */,
318 324
 				E9640E8A1C30511B0081D46C /* Screenshot.m in Sources */,
319 325
 				E9F13E061C28B3D3004C6B95 /* main.m in Sources */,
320 326
 				E9F13E031C28B3D3004C6B95 /* AppDelegate.m in Sources */,

+ 2
- 20
CaseLights/AppDelegate.h Ver arquivo

@@ -15,28 +15,10 @@
15 15
 
16 16
 @interface AppDelegate : NSObject <NSApplicationDelegate, EZMicrophoneDelegate>
17 17
 
18
-@property (weak) IBOutlet NSMenu *statusMenu;
19
-@property (weak) IBOutlet NSApplication *application;
20
-
21
-@property (weak) IBOutlet NSMenu *menuColors;
22
-@property (weak) IBOutlet NSMenu *menuAnimations;
23
-@property (weak) IBOutlet NSMenu *menuVisualizations;
24
-@property (weak) IBOutlet NSMenuItem *menuItemDisplays;
25
-@property (weak) IBOutlet NSMenu *menuDisplays;
26
-@property (weak) IBOutlet NSMenuItem *menuItemAudio;
27
-@property (weak) IBOutlet NSMenu *menuAudio;
28
-@property (weak) IBOutlet NSMenu *menuPorts;
29
-
30
-@property (weak) IBOutlet NSMenuItem *buttonOff;
31
-@property (weak) IBOutlet NSMenuItem *brightnessItem;
32
-@property (weak) IBOutlet NSSlider *brightnessSlider;
33
-@property (weak) IBOutlet NSMenuItem *brightnessLabel;
34
-@property (weak) IBOutlet NSMenuItem *buttonLights;
35
-
36
-@property (strong) NSMenuItem *menuItemColor;
37
-
38 18
 - (void)clearDisplayUI;
39 19
 - (void)updateDisplayUI:(NSArray *)displayIDs;
40 20
 
21
+- (void)setLightsR:(unsigned char)r G:(unsigned char)g B:(unsigned char)b;
22
+
41 23
 @end
42 24
 

+ 23
- 2
CaseLights/AppDelegate.m Ver arquivo

@@ -10,6 +10,7 @@
10 10
 #import "Serial.h"
11 11
 #import "GPUStats.h"
12 12
 #import "Screenshot.h"
13
+#import "AudioVisualizer.h"
13 14
 
14 15
 // These are the values stored persistently in the preferences
15 16
 #define PREF_SERIAL_PORT @"SerialPort"
@@ -62,6 +63,26 @@
62 63
 
63 64
 @interface AppDelegate ()
64 65
 
66
+@property (weak) IBOutlet NSMenu *statusMenu;
67
+@property (weak) IBOutlet NSApplication *application;
68
+
69
+@property (weak) IBOutlet NSMenu *menuColors;
70
+@property (weak) IBOutlet NSMenu *menuAnimations;
71
+@property (weak) IBOutlet NSMenu *menuVisualizations;
72
+@property (weak) IBOutlet NSMenuItem *menuItemDisplays;
73
+@property (weak) IBOutlet NSMenu *menuDisplays;
74
+@property (weak) IBOutlet NSMenuItem *menuItemAudio;
75
+@property (weak) IBOutlet NSMenu *menuAudio;
76
+@property (weak) IBOutlet NSMenu *menuPorts;
77
+
78
+@property (weak) IBOutlet NSMenuItem *buttonOff;
79
+@property (weak) IBOutlet NSMenuItem *brightnessItem;
80
+@property (weak) IBOutlet NSSlider *brightnessSlider;
81
+@property (weak) IBOutlet NSMenuItem *brightnessLabel;
82
+@property (weak) IBOutlet NSMenuItem *buttonLights;
83
+
84
+@property (strong) NSMenuItem *menuItemColor;
85
+
65 86
 @property (strong) NSStatusItem *statusItem;
66 87
 @property (strong) NSImage *statusImage;
67 88
 @property (strong) NSDictionary *staticColors;
@@ -87,6 +108,7 @@
87 108
 
88 109
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
89 110
     srand((unsigned)time(NULL));
111
+    [AudioVisualizer setDelegate:self];
90 112
     
91 113
     serial = [[Serial alloc] init];
92 114
     lastLEDMode = nil;
@@ -863,8 +885,7 @@
863 885
         return; // Old buffer from before we changed mode
864 886
     }
865 887
     
866
-    // TODO visualize sound data somehow
867
-    //NSLog(@".");
888
+    [AudioVisualizer updateBuffer:buffer withBufferSize:bufferSize];
868 889
 }
869 890
 
870 891
 // ------------------------------------------------------

+ 18
- 0
CaseLights/AudioVisualizer.h Ver arquivo

@@ -0,0 +1,18 @@
1
+//
2
+//  AudioVisualizer.h
3
+//  CaseLights
4
+//
5
+//  Created by Thomas Buck on 01.01.16.
6
+//  Copyright © 2016 xythobuz. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+
11
+@class AppDelegate;
12
+
13
+@interface AudioVisualizer : NSObject
14
+
15
++ (void)setDelegate:(AppDelegate *)delegate;
16
++ (void)updateBuffer:(float *)buffer withBufferSize:(UInt32)bufferSize;
17
+
18
+@end

+ 24
- 0
CaseLights/AudioVisualizer.m Ver arquivo

@@ -0,0 +1,24 @@
1
+//
2
+//  AudioVisualizer.m
3
+//  CaseLights
4
+//
5
+//  Created by Thomas Buck on 01.01.16.
6
+//  Copyright © 2016 xythobuz. All rights reserved.
7
+//
8
+
9
+#import "AudioVisualizer.h"
10
+#import "AppDelegate.h"
11
+
12
+static AppDelegate *appDelegate = nil;
13
+
14
+@implementation AudioVisualizer
15
+
16
++ (void)setDelegate:(AppDelegate *)delegate {
17
+    appDelegate = delegate;
18
+}
19
+
20
++ (void)updateBuffer:(float *)buffer withBufferSize:(UInt32)bufferSize {
21
+    
22
+}
23
+
24
+@end

+ 1
- 1
CaseLights/Info.plist Ver arquivo

@@ -21,7 +21,7 @@
21 21
 	<key>CFBundleSignature</key>
22 22
 	<string>????</string>
23 23
 	<key>CFBundleVersion</key>
24
-	<string>180</string>
24
+	<string>182</string>
25 25
 	<key>LSApplicationCategoryType</key>
26 26
 	<string>public.app-category.utilities</string>
27 27
 	<key>LSMinimumSystemVersion</key>

Carregando…
Cancelar
Salvar