Mercurial > projects > dstep
annotate dstep/appkit/NSSound.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
rev | line source |
---|---|
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
1 /** |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
3 * Authors: Jacob Carlborg |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
4 * Version: Initial created: Sep 24, 2009 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
6 */ |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
7 module dstep.appkit.NSSound; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
8 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
9 import dstep.appkit.AppKitDefines; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
10 import dstep.appkit.NSPasteboard; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
11 import dstep.foundation.NSArray; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
12 import dstep.foundation.NSBundle; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
13 import dstep.foundation.NSCoder; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
14 import dstep.foundation.NSData; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
15 import dstep.foundation.NSDate; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
16 import dstep.foundation.NSObject; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
17 import dstep.foundation.NSString; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
18 import dstep.foundation.NSURL; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
19 import dstep.foundation.NSZone; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
20 import dstep.objc.bridge.Bridge; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
21 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
22 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
23 import bindings = dstep.appkit.NSSound_bindings; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
24 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
25 private |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
26 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
27 NSString NSSoundPboardType_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
28 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
29 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
30 NSString NSSoundPboardType () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
31 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
32 if (NSSoundPboardType_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
33 return NSSoundPboardType_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
34 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
35 return NSSoundPboardType_ = new NSString(bindings.NSSoundPboardType); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
36 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
37 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
38 class NSSound : NSObject, INSCopying, INSCoding |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
39 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
40 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
41 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
42 this (NSCoder aDecoder) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
43 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
44 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
45 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
46 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
47 void encodeWithCoder (NSCoder aCoder) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
48 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
49 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
50 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
51 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
52 typeof(this) initWithCoder (NSCoder aDecoder) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
53 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
54 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
55 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
56 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
57 typeof(this) copyWithZone (NSZone* zone) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
58 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
59 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
60 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
61 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
62 static Object soundNamed (NSString name) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
63 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
64 return invokeObjcSelfClass!(Object, "soundNamed:", NSString)(name); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
65 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
66 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
67 NSSound initWithContentsOfURL (NSURL url, bool byRef) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
68 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
69 id result = invokeObjcSelf!(id, "initWithContentsOfURL:byReference:", NSURL, bool)(url, byRef); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
70 return result is this.objcObject ? this : (result !is null ? new NSSound(result) : null); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
71 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
72 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
73 this (NSURL url, bool byRef) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
74 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
75 super(NSSound.alloc.initWithContentsOfURL(url, byRef).objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
76 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
77 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
78 NSSound initWithContentsOfFile (NSString path, bool byRef) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
79 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
80 id result = invokeObjcSelf!(id, "initWithContentsOfFile:byReference:", NSString, bool)(path, byRef); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
81 return result is this.objcObject ? this : (result !is null ? new NSSound(result) : null); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
82 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
83 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
84 this (NSString path, bool byRef) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
85 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
86 super(NSSound.alloc.initWithContentsOfFile(path, byRef).objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
87 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
88 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
89 NSSound initWithData (NSData data) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
90 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
91 id result = invokeObjcSelf!(id, "initWithData:", NSData)(data); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
92 return result is this.objcObject ? this : (result !is null ? new NSSound(result) : null); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
93 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
94 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
95 this (NSData data) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
96 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
97 super(NSSound.alloc.initWithData(data).objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
98 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
99 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
100 bool setName (NSString string) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
101 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
102 return invokeObjcSelf!(bool, "setName:", NSString)(string); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
103 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
104 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
105 NSString name () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
106 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
107 return invokeObjcSelf!(NSString, "name"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
108 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
109 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
110 static bool canInitWithPasteboard (NSPasteboard pasteboard) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
111 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
112 return invokeObjcSelfClass!(bool, "canInitWithPasteboard:", NSPasteboard)(pasteboard); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
113 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
114 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
115 static NSArray soundUnfilteredTypes () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
116 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
117 return invokeObjcSelfClass!(NSArray, "soundUnfilteredTypes"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
118 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
119 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
120 NSSound initWithPasteboard (NSPasteboard pasteboard) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
121 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
122 id result = invokeObjcSelf!(id, "initWithPasteboard:", NSPasteboard)(pasteboard); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
123 return result is this.objcObject ? this : (result !is null ? new NSSound(result) : null); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
124 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
125 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
126 this (NSPasteboard pasteboard) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
127 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
128 super(NSSound.alloc.initWithPasteboard(pasteboard).objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
129 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
130 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
131 void writeToPasteboard (NSPasteboard pasteboard) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
132 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
133 return invokeObjcSelf!(void, "writeToPasteboard:", NSPasteboard)(pasteboard); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
134 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
135 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
136 bool play () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
137 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
138 return invokeObjcSelf!(bool, "play"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
139 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
140 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
141 bool pause () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
142 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
143 return invokeObjcSelf!(bool, "pause"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
144 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
145 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
146 bool resume () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
147 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
148 return invokeObjcSelf!(bool, "resume"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
149 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
150 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
151 bool stop () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
152 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
153 return invokeObjcSelf!(bool, "stop"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
154 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
155 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
156 bool isPlaying () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
157 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
158 return invokeObjcSelf!(bool, "isPlaying"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
159 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
160 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
161 Object delegate_ () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
162 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
163 return invokeObjcSelf!(Object, "delegate"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
164 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
165 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
166 void setDelegate (Object aDelegate) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
167 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
168 return invokeObjcSelf!(void, "setDelegate:", Object)(aDelegate); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
169 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
170 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
171 double duration () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
172 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
173 return invokeObjcSelf!(double, "duration"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
174 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
175 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
176 void setVolume (float volume) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
177 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
178 return invokeObjcSelf!(void, "setVolume:", float)(volume); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
179 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
180 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
181 float volume () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
182 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
183 return invokeObjcSelf!(float, "volume"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
184 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
185 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
186 double currentTime () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
187 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
188 return invokeObjcSelf!(double, "currentTime"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
189 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
190 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
191 void setCurrentTime (double seconds) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
192 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
193 return invokeObjcSelf!(void, "setCurrentTime:", double)(seconds); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
194 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
195 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
196 void setLoops (bool val) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
197 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
198 return invokeObjcSelf!(void, "setLoops:", bool)(val); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
199 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
200 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
201 bool loops () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
202 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
203 return invokeObjcSelf!(bool, "loops"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
204 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
205 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
206 void setPlaybackDeviceIdentifier (NSString deviceUID) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
207 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
208 return invokeObjcSelf!(void, "setPlaybackDeviceIdentifier:", NSString)(deviceUID); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
209 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
210 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
211 NSString playbackDeviceIdentifier () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
212 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
213 return invokeObjcSelf!(NSString, "playbackDeviceIdentifier"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
214 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
215 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
216 void setChannelMapping (NSArray channelMapping) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
217 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
218 return invokeObjcSelf!(void, "setChannelMapping:", NSArray)(channelMapping); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
219 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
220 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
221 NSArray channelMapping () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
222 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
223 return invokeObjcSelf!(NSArray, "channelMapping"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
224 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
225 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
226 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
227 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
228 const TNSBundleSoundExtensions = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
229 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
230 NSString pathForSoundResource (NSString name) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
231 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
232 return invokeObjcSelf!(NSString, "pathForSoundResource:", NSString)(name); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
233 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
234 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
235 //mixin ObjcBindMethod!(pathForSoundResource, "pathForSoundResource:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
236 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
237 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
238 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
239 const TNSSoundDelegateMethods = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
240 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
241 void sound (NSSound sound, bool aBool) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
242 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
243 return invokeObjcSelf!(void, "sound:didFinishPlaying:", NSSound, bool)(sound, aBool); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
244 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
245 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
246 //mixin ObjcBindMethod!(sound, "sound:didFinishPlaying:"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
247 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
248 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
diff
changeset
|
249 |