]> git.sesse.net Git - vlc/blob - modules/gui/macosx/asystm.h
* Mac OS X audio device discovery and selection, patch courtesy of
[vlc] / modules / gui / macosx / asystm.h
1 //
2 //  asystm.h
3 //  
4 //
5 //  Created by Heiko Panther on Tue Sep 10 2002.
6 //  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <CoreAudio/CoreAudio.h>
11 #import "adev_discovery.h"
12 #import "intf.h"
13
14 /*****************************************************************************
15 * MacOSXSoundOption
16 * Each audio device can give several sound options: there might be several
17 * streams on one device, each can have different formats which might qualify
18 * as an option.
19 * We record format and channels, since these attributes are requirements
20 * from the user and the aout should deliver what the user wants. This
21 * selection is basically done when the user chooses the output option.
22 * We do not record sample rate and bit depth, since these attributes are
23 * tied to the media source, and the device format that matches these media
24 * formats best should be selected. This selection is done when the aout
25 * module is created with a certain stream, and asks the asystm for a device.
26 *****************************************************************************/
27 @interface MacOSXSoundOption:NSObject
28 {
29     NSString *name;
30     AudioDeviceID deviceID;
31     UInt32 streamIndex;
32     UInt32 mFormatID;
33     UInt32 mChannels;
34 }
35 - (id)initWithName:(NSString*)_name deviceID:(AudioDeviceID)devID streamIndex:(UInt32)strInd formatID:(UInt32)formID chans:(UInt32)chans;
36 - (AudioDeviceID)deviceID;
37 - (UInt32)streamIndex;
38 - (UInt32)mFormatID;
39 - (UInt32)mChannels;
40 - (void)dealloc;
41 - (NSString*)name;
42 @end
43
44
45 @interface MacOSXAudioSystem : NSObject {
46     VLCMain *main;
47     /* selected output device */
48     NSMenuItem *selectedOutput;
49     NSMenu *newMenu;
50 }
51 - (id)initWithGUI:(VLCMain*)main;
52 - (AudioStreamID) getStreamIDForIndex:(UInt32)streamIndex device:(AudioDeviceID)deviceID;
53 - (void)CheckDevice:(AudioDeviceID)deviceID isInput:(bool)isInput;
54 - (void)registerSoundOption:(MacOSXSoundOption*)option;
55 - (void)selectAction:(id)sender;
56 - (AudioStreamID)getSelectedDeviceSetToRate:(int)preferredSampleRate;
57 - (void)dealloc;
58 @end