summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/appkit/NSSound.inc
blob: 35da347f3fa1da9c588410133a99d2216f3e7432 (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
{ Parsed from Appkit.framework NSSound.h }

{$ifdef TYPES}
{$ifndef NSSOUND_PAS_T}
{$define NSSOUND_PAS_T}

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSSOUND_PAS_R}
{$define NSSOUND_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSSOUND_PAS_F}
{$define NSSOUND_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSSOUND_PAS_S}
{$define NSSOUND_PAS_S}

{ External string constants }
var
  NSSoundPboardType: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}
  NSSoundDelegateProtocol = objcprotocol;
  NSSound = objcclass;
  NSSoundPointer = ^NSSound;
  NSSoundPtr = NSSoundPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSSOUND_PAS_C}
{$define NSSOUND_PAS_C}

{ NSSound }
  NSSound = objcclass external (NSObject)
  private
    _delegate: id;
    _info: id;
    _reserved: array[0..(6)-1] of id;
    _sFlags: NSUInteger;
    
  public
    class function soundNamed(name_: NSString): id; message 'soundNamed:';
    function initWithContentsOfURL_byReference(url: NSURL; byRef: Boolean): id; message 'initWithContentsOfURL:byReference:';
    function initWithContentsOfFile_byReference(path: NSString; byRef: Boolean): id; message 'initWithContentsOfFile:byReference:';
    function initWithData(data: NSData): id; message 'initWithData:';
    function setName(string_: NSString): Boolean; message 'setName:';
    function name: NSString; message 'name';
    class function canInitWithPasteboard(pasteboard: NSPasteboard): Boolean; message 'canInitWithPasteboard:';
    class function soundUnfilteredTypes: NSArray; message 'soundUnfilteredTypes';
    function initWithPasteboard(pasteboard: NSPasteboard): id; message 'initWithPasteboard:';
    procedure writeToPasteboard(pasteboard: NSPasteboard); message 'writeToPasteboard:';
    function play: Boolean; message 'play';
    function pause: Boolean; message 'pause';
    function resume: Boolean; message 'resume';
    function stop: Boolean; message 'stop';
    function isPlaying: Boolean; message 'isPlaying';
    function delegate: NSSoundDelegateProtocol; message 'delegate';
    procedure setDelegate(aDelegate: NSSoundDelegateProtocol); message 'setDelegate:';
    function duration: NSTimeInterval; message 'duration';
    procedure setVolume(volume_: single); message 'setVolume:';
    function volume: single; message 'volume';
    function currentTime: NSTimeInterval; message 'currentTime';
    procedure setCurrentTime(seconds: NSTimeInterval); message 'setCurrentTime:';
    procedure setLoops(val: Boolean); message 'setLoops:';
    function loops: Boolean; message 'loops';
    procedure setPlaybackDeviceIdentifier(deviceUID: NSString); message 'setPlaybackDeviceIdentifier:';
    function playbackDeviceIdentifier: NSString; message 'playbackDeviceIdentifier';
    procedure setChannelMapping(channelMapping_: NSArray); message 'setChannelMapping:';
    function channelMapping: NSArray; message 'channelMapping';
  end;

{ NSDeprecated_NSSoundCategory }
  NSDeprecated_NSSoundCategory = objccategory external name 'NSDeprecated' (NSSound)
    class function soundUnfilteredFileTypes: NSArray; message 'soundUnfilteredFileTypes'; deprecated 'in Mac OS X 10.5 and later';
    class function soundUnfilteredPasteboardTypes: NSArray; message 'soundUnfilteredPasteboardTypes'; deprecated 'in Mac OS X 10.5 and later';
  end;

{ NSBundleSoundExtensionsCategory }
  NSBundleSoundExtensionsCategory = objccategory external (NSBundle)
    function pathForSoundResource(name: NSString): NSString; message 'pathForSoundResource:';
  end;

{$endif}
{$endif}
{$ifdef PROTOCOLS}
{$ifndef NSSOUND_PAS_P}
{$define NSSOUND_PAS_P}
  
{ NSSoundDelegate Protocol }
  NSSoundDelegateProtocol = objcprotocol external name 'NSSoundDelegate'
  optional
    procedure sound_didFinishPlaying(sound: NSSound; aBool: Boolean); message 'sound:didFinishPlaying:';
  end;
{$endif}
{$endif}