~ubuntu-branches/ubuntu/wily/oolite/wily-proposed

« back to all changes in this revision

Viewing changes to DebugOXP/Source/OODebugSoundInspector.m

  • Committer: Package Import Robot
  • Author(s): Nicolas Boulenguez
  • Date: 2011-12-22 00:22:39 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20111222002239-pr3upeupp4jw1psp
Tags: 1.76-1
* New upstream.
* watch: scan upstream stable releases instead of dev snapshots.
* control: use default gobjc instead of explicit 4.6.
* rules: use dpkg-dev build flags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
OODebugSoundInspector.m
 
4
olite Debug OXP
 
5
 
 
6
 
 
7
Copyright (C) 2010 Jens Ayton
 
8
 
 
9
Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
of this software and associated documentation files (the "Software"), to deal
 
11
in the Software without restriction, including without limitation the rights
 
12
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
copies of the Software, and to permit persons to whom the Software is
 
14
furnished to do so, subject to the following conditions:
 
15
 
 
16
The above copyright notice and this permission notice shall be included in all
 
17
copies or substantial portions of the Software.
 
18
 
 
19
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
25
SOFTWARE.
 
26
 
 
27
*/
 
28
 
 
29
 
 
30
#import "OODebugSoundInspector.h"
 
31
#import "OOLogging.h"
 
32
#import <Cocoa/Cocoa.h>
 
33
 
 
34
 
 
35
@implementation OODebugSoundInspector
 
36
 
 
37
- (id) init
 
38
{
 
39
        if ((self = [super init]))
 
40
        {
 
41
                if (![NSBundle loadNibNamed:@"OODebugSoundInspector" owner:self])
 
42
                {
 
43
                        OOLog(@"debugOXP.load.soundInspector.failed", @"Failed to load sound inspector nib.");
 
44
                        DESTROY(self);
 
45
                }
 
46
                else  OOSoundRegisterDebugMonitor(self);
 
47
        }
 
48
        
 
49
        return self;
 
50
}
 
51
 
 
52
 
 
53
- (void) soundDebugMonitorNoteChannelMaxCount:(OOUInteger)maxChannels
 
54
{
 
55
        
 
56
}
 
57
 
 
58
 
 
59
- (void) soundDebugMonitorNoteActiveChannelCount:(OOUInteger)usedChannels
 
60
{
 
61
        [_currentField setIntValue:usedChannels];
 
62
        if (usedChannels > _channelCountHighWaterMark)
 
63
        {
 
64
                _channelCountHighWaterMark = usedChannels;
 
65
                [_maxField setIntValue:usedChannels];
 
66
        }
 
67
}
 
68
 
 
69
 
 
70
- (void) soundDebugMonitorNoteState:(OOCASoundDebugMonitorChannelState)state ofChannel:(OOUInteger)channel
 
71
{
 
72
        [[_checkBoxes cellWithTag:channel] setIntValue:state];
 
73
}
 
74
 
 
75
 
 
76
- (void) soundDebugMonitorNoteAUGraphLoad:(float)load
 
77
{
 
78
        [_loadBar setFloatValue:load * 100.0f];
 
79
        if (load > _loadHighWaterMark)
 
80
        {
 
81
                _loadHighWaterMark = load;
 
82
        }
 
83
}
 
84
 
 
85
 
 
86
- (IBAction) show:(id)sender
 
87
{
 
88
        [_inspectorWindow makeKeyAndOrderFront:sender];
 
89
}
 
90
 
 
91
@end