Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSSound.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
37 super(id); | 37 super(id); |
38 } | 38 } |
39 | 39 |
40 public static bool canInitWithPasteboard (NSPasteboard pasteboard) | 40 public static bool canInitWithPasteboard (NSPasteboard pasteboard) |
41 { | 41 { |
42 return OS.objc_msgSend(OS.class_NSSound, OS.sel_canInitWithPasteboard_1, pasteboard !is null ? pasteboard.id : null) !is null; | 42 return OS.objc_msgSend(OS.class_NSSound, OS.sel_canInitWithPasteboard_1, pasteboard !is null ? pasteboard.id_ : null) !is null; |
43 } | 43 } |
44 | 44 |
45 public NSArray channelMapping () | 45 public NSArray channelMapping () |
46 { | 46 { |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_channelMapping); | 47 objc.id result = OS.objc_msgSend(this.id_, OS.sel_channelMapping); |
48 return result !is null ? new NSArray(result) : null; | 48 return result !is null ? new NSArray(result) : null; |
49 } | 49 } |
50 | 50 |
51 public NSTimeInterval currentTime () | 51 public NSTimeInterval currentTime () |
52 { | 52 { |
53 return cast(NSTimeInterval) OS.objc_msgSend_fpret(this.id, OS.sel_currentTime); | 53 return cast(NSTimeInterval) OS.objc_msgSend_fpret(this.id_, OS.sel_currentTime); |
54 } | 54 } |
55 | 55 |
56 public id delegatee () | 56 public id delegatee () |
57 { | 57 { |
58 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | 58 objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate); |
59 return result !is null ? new id(result) : null; | 59 return result !is null ? new id(result) : null; |
60 } | 60 } |
61 | 61 |
62 public NSTimeInterval duration () | 62 public NSTimeInterval duration () |
63 { | 63 { |
64 return cast(NSTimeInterval) OS.objc_msgSend_fpret(this.id, OS.sel_duration); | 64 return cast(NSTimeInterval) OS.objc_msgSend_fpret(this.id_, OS.sel_duration); |
65 } | 65 } |
66 | 66 |
67 public id initWithContentsOfFile (NSString path, bool byRef) | 67 public id initWithContentsOfFile (NSString path, bool byRef) |
68 { | 68 { |
69 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1byReference_1, path !is null ? path.id : null, byRef); | 69 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfFile_1byReference_1, path !is null ? path.id_ : null, byRef); |
70 return result !is null ? new id(result) : null; | 70 return result !is null ? new id(result) : null; |
71 } | 71 } |
72 | 72 |
73 public id initWithContentsOfURL (NSURL url, bool byRef) | 73 public id initWithContentsOfURL (NSURL url, bool byRef) |
74 { | 74 { |
75 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1byReference_1, url !is null ? url.id : null, byRef); | 75 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContentsOfURL_1byReference_1, url !is null ? url.id_ : null, byRef); |
76 return result !is null ? new id(result) : null; | 76 return result !is null ? new id(result) : null; |
77 } | 77 } |
78 | 78 |
79 public id initWithData (NSData data) | 79 public id initWithData (NSData data) |
80 { | 80 { |
81 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data !is null ? data.id : null); | 81 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithData_1, data !is null ? data.id_ : null); |
82 return result !is null ? new id(result) : null; | 82 return result !is null ? new id(result) : null; |
83 } | 83 } |
84 | 84 |
85 public id initWithPasteboard (NSPasteboard pasteboard) | 85 public id initWithPasteboard (NSPasteboard pasteboard) |
86 { | 86 { |
87 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithPasteboard_1, pasteboard !is null ? pasteboard.id : null); | 87 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithPasteboard_1, pasteboard !is null ? pasteboard.id_ : null); |
88 return result !is null ? new id(result) : null; | 88 return result !is null ? new id(result) : null; |
89 } | 89 } |
90 | 90 |
91 public bool isPlaying () | 91 public bool isPlaying () |
92 { | 92 { |
93 return OS.objc_msgSend(this.id, OS.sel_isPlaying) !is null; | 93 return OS.objc_msgSend(this.id_, OS.sel_isPlaying) !is null; |
94 } | 94 } |
95 | 95 |
96 public bool loops () | 96 public bool loops () |
97 { | 97 { |
98 return OS.objc_msgSend(this.id, OS.sel_loops) !is null; | 98 return OS.objc_msgSend(this.id_, OS.sel_loops) !is null; |
99 } | 99 } |
100 | 100 |
101 public NSString name () | 101 public NSString name () |
102 { | 102 { |
103 objc.id result = OS.objc_msgSend(this.id, OS.sel_name); | 103 objc.id result = OS.objc_msgSend(this.id_, OS.sel_name); |
104 return result !is null ? new NSString(result) : null; | 104 return result !is null ? new NSString(result) : null; |
105 } | 105 } |
106 | 106 |
107 public bool pause () | 107 public bool pause () |
108 { | 108 { |
109 return OS.objc_msgSend(this.id, OS.sel_pause) !is null; | 109 return OS.objc_msgSend(this.id_, OS.sel_pause) !is null; |
110 } | 110 } |
111 | 111 |
112 public bool play () | 112 public bool play () |
113 { | 113 { |
114 return OS.objc_msgSend(this.id, OS.sel_play) !is null; | 114 return OS.objc_msgSend(this.id_, OS.sel_play) !is null; |
115 } | 115 } |
116 | 116 |
117 public NSString playbackDeviceIdentifier () | 117 public NSString playbackDeviceIdentifier () |
118 { | 118 { |
119 objc.id result = OS.objc_msgSend(this.id, OS.sel_playbackDeviceIdentifier); | 119 objc.id result = OS.objc_msgSend(this.id_, OS.sel_playbackDeviceIdentifier); |
120 return result !is null ? new NSString(result) : null; | 120 return result !is null ? new NSString(result) : null; |
121 } | 121 } |
122 | 122 |
123 public bool resume () | 123 public bool resume () |
124 { | 124 { |
125 return OS.objc_msgSend(this.id, OS.sel_resume) !is null; | 125 return OS.objc_msgSend(this.id_, OS.sel_resume) !is null; |
126 } | 126 } |
127 | 127 |
128 public void setChannelMapping (NSArray channelMapping) | 128 public void setChannelMapping (NSArray channelMapping) |
129 { | 129 { |
130 OS.objc_msgSend(this.id, OS.sel_setChannelMapping_1, channelMapping !is null ? channelMapping.id : null); | 130 OS.objc_msgSend(this.id_, OS.sel_setChannelMapping_1, channelMapping !is null ? channelMapping.id_ : null); |
131 } | 131 } |
132 | 132 |
133 public void setCurrentTime (NSTimeInterval seconds) | 133 public void setCurrentTime (NSTimeInterval seconds) |
134 { | 134 { |
135 OS.objc_msgSend(this.id, OS.sel_setCurrentTime_1, seconds); | 135 OS.objc_msgSend(this.id_, OS.sel_setCurrentTime_1, seconds); |
136 } | 136 } |
137 | 137 |
138 public void setDelegate (id aDelegate) | 138 public void setDelegate (id aDelegate) |
139 { | 139 { |
140 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, aDelegate !is null ? aDelegate.id : null); | 140 OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, aDelegate !is null ? aDelegate.id_ : null); |
141 } | 141 } |
142 | 142 |
143 public void setLoops (bool val) | 143 public void setLoops (bool val) |
144 { | 144 { |
145 OS.objc_msgSend(this.id, OS.sel_setLoops_1, val); | 145 OS.objc_msgSend(this.id_, OS.sel_setLoops_1, val); |
146 } | 146 } |
147 | 147 |
148 public bool setName (NSString string) | 148 public bool setName (NSString string) |
149 { | 149 { |
150 return OS.objc_msgSend(this.id, OS.sel_setName_1, string !is null ? string.id : null) !is null; | 150 return OS.objc_msgSend(this.id_, OS.sel_setName_1, string !is null ? string.id_ : null) !is null; |
151 } | 151 } |
152 | 152 |
153 public void setPlaybackDeviceIdentifier (NSString deviceUID) | 153 public void setPlaybackDeviceIdentifier (NSString deviceUID) |
154 { | 154 { |
155 OS.objc_msgSend(this.id, OS.sel_setPlaybackDeviceIdentifier_1, deviceUID !is null ? deviceUID.id : null); | 155 OS.objc_msgSend(this.id_, OS.sel_setPlaybackDeviceIdentifier_1, deviceUID !is null ? deviceUID.id_ : null); |
156 } | 156 } |
157 | 157 |
158 public void setVolume (float volume) | 158 public void setVolume (float volume) |
159 { | 159 { |
160 OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume); | 160 OS.objc_msgSend(this.id_, OS.sel_setVolume_1, volume); |
161 } | 161 } |
162 | 162 |
163 public static id soundNamed (NSString name) | 163 public static id soundNamed (NSString name) |
164 { | 164 { |
165 objc.id result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundNamed_1, name !is null ? name.id : null); | 165 objc.id result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundNamed_1, name !is null ? name.id_ : null); |
166 return result !is null ? new id(result) : null; | 166 return result !is null ? new id(result) : null; |
167 } | 167 } |
168 | 168 |
169 public static NSArray soundUnfilteredFileTypes () | 169 public static NSArray soundUnfilteredFileTypes () |
170 { | 170 { |
184 return result !is null ? new NSArray(result) : null; | 184 return result !is null ? new NSArray(result) : null; |
185 } | 185 } |
186 | 186 |
187 public bool stop () | 187 public bool stop () |
188 { | 188 { |
189 return OS.objc_msgSend(this.id, OS.sel_stop) !is null; | 189 return OS.objc_msgSend(this.id_, OS.sel_stop) !is null; |
190 } | 190 } |
191 | 191 |
192 public float volume () | 192 public float volume () |
193 { | 193 { |
194 return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_volume); | 194 return cast(float) OS.objc_msgSend_fpret(this.id_, OS.sel_volume); |
195 } | 195 } |
196 | 196 |
197 public void writeToPasteboard (NSPasteboard pasteboard) | 197 public void writeToPasteboard (NSPasteboard pasteboard) |
198 { | 198 { |
199 OS.objc_msgSend(this.id, OS.sel_writeToPasteboard_1, pasteboard !is null ? pasteboard.id : null); | 199 OS.objc_msgSend(this.id_, OS.sel_writeToPasteboard_1, pasteboard !is null ? pasteboard.id_ : null); |
200 } | 200 } |
201 | 201 |
202 } | 202 } |