summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSound.java
blob: 0a9a293718add917576a555009c2ce6667fac27d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package org.eclipse.swt.internal.cocoa;

public class NSSound extends NSObject {

public NSSound() {
	super();
}

public NSSound(int id) {
	super(id);
}

public static boolean canInitWithPasteboard(NSPasteboard pasteboard) {
	return OS.objc_msgSend(OS.class_NSSound, OS.sel_canInitWithPasteboard_1, pasteboard != null ? pasteboard.id : 0) != 0;
}

public NSArray channelMapping() {
	int result = OS.objc_msgSend(this.id, OS.sel_channelMapping);
	return result != 0 ? new NSArray(result) : null;
}

public double currentTime() {
	return OS.objc_msgSend_fpret(this.id, OS.sel_currentTime);
}

public id delegate() {
	int result = OS.objc_msgSend(this.id, OS.sel_delegate);
	return result != 0 ? new id(result) : null;
}

public double duration() {
	return OS.objc_msgSend_fpret(this.id, OS.sel_duration);
}

public id initWithContentsOfFile(NSString path, boolean byRef) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1byReference_1, path != null ? path.id : 0, byRef);
	return result != 0 ? new id(result) : null;
}

public id initWithContentsOfURL(NSURL url, boolean byRef) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1byReference_1, url != null ? url.id : 0, byRef);
	return result != 0 ? new id(result) : null;
}

public id initWithData(NSData data) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
	return result != 0 ? new id(result) : null;
}

public id initWithPasteboard(NSPasteboard pasteboard) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithPasteboard_1, pasteboard != null ? pasteboard.id : 0);
	return result != 0 ? new id(result) : null;
}

public boolean isPlaying() {
	return OS.objc_msgSend(this.id, OS.sel_isPlaying) != 0;
}

public boolean loops() {
	return OS.objc_msgSend(this.id, OS.sel_loops) != 0;
}

public NSString name() {
	int result = OS.objc_msgSend(this.id, OS.sel_name);
	return result != 0 ? new NSString(result) : null;
}

public boolean pause() {
	return OS.objc_msgSend(this.id, OS.sel_pause) != 0;
}

public boolean play() {
	return OS.objc_msgSend(this.id, OS.sel_play) != 0;
}

public NSString playbackDeviceIdentifier() {
	int result = OS.objc_msgSend(this.id, OS.sel_playbackDeviceIdentifier);
	return result != 0 ? new NSString(result) : null;
}

public boolean resume() {
	return OS.objc_msgSend(this.id, OS.sel_resume) != 0;
}

public void setChannelMapping(NSArray channelMapping) {
	OS.objc_msgSend(this.id, OS.sel_setChannelMapping_1, channelMapping != null ? channelMapping.id : 0);
}

public void setCurrentTime(double seconds) {
	OS.objc_msgSend(this.id, OS.sel_setCurrentTime_1, seconds);
}

public void setDelegate(id aDelegate) {
	OS.objc_msgSend(this.id, OS.sel_setDelegate_1, aDelegate != null ? aDelegate.id : 0);
}

public void setLoops(boolean val) {
	OS.objc_msgSend(this.id, OS.sel_setLoops_1, val);
}

public boolean setName(NSString string) {
	return OS.objc_msgSend(this.id, OS.sel_setName_1, string != null ? string.id : 0) != 0;
}

public void setPlaybackDeviceIdentifier(NSString deviceUID) {
	OS.objc_msgSend(this.id, OS.sel_setPlaybackDeviceIdentifier_1, deviceUID != null ? deviceUID.id : 0);
}

public void setVolume(float volume) {
	OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume);
}

public static id soundNamed(NSString name) {
	int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundNamed_1, name != null ? name.id : 0);
	return result != 0 ? new id(result) : null;
}

public static NSArray soundUnfilteredFileTypes() {
	int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundUnfilteredFileTypes);
	return result != 0 ? new NSArray(result) : null;
}

public static NSArray soundUnfilteredPasteboardTypes() {
	int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundUnfilteredPasteboardTypes);
	return result != 0 ? new NSArray(result) : null;
}

public static NSArray soundUnfilteredTypes() {
	int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundUnfilteredTypes);
	return result != 0 ? new NSArray(result) : null;
}

public boolean stop() {
	return OS.objc_msgSend(this.id, OS.sel_stop) != 0;
}

public float volume() {
	return (float)OS.objc_msgSend_fpret(this.id, OS.sel_volume);
}

public void writeToPasteboard(NSPasteboard pasteboard) {
	OS.objc_msgSend(this.id, OS.sel_writeToPasteboard_1, pasteboard != null ? pasteboard.id : 0);
}

}