3 * \brief Declare interface to sound and music configuration panel used by
7 #import <Cocoa/Cocoa.h>
11 * Declare a protocol to encapsulate changes to the settings for sounds and
14 @protocol SoundAndMusicChanges
15 - (void)changeSoundEnabled:(BOOL)newv;
16 - (void)changeSoundVolume:(NSInteger)newv;
17 - (void)changeMusicEnabled:(BOOL)newv;
18 - (void)changeMusicPausedWhenInactive:(BOOL)newv;
19 - (void)changeMusicVolume:(NSInteger)newv;
20 - (void)changeMusicTransitionTime:(NSInteger)newv;
21 - (void)soundAndMusicPanelWillClose;
26 * Declare a NSWindowController subclass to load the panel from the nib file.
28 @interface SoundAndMusicPanelController : NSWindowController <NSWindowDelegate>
31 * Hold whether or not incidental sounds (and beeps) are played.
33 @property (nonatomic, getter=isSoundEnabled) BOOL soundEnabled;
36 * Hold the volume for incidental sounds as a percentage (1 to 100) of the
39 @property (nonatomic) NSInteger soundVolume;
42 * Hold whether or not background music is played.
44 @property (nonatomic, getter=isMusicEnabled) BOOL musicEnabled;
47 * Hold whether or not currently playing music tracks are paused when the
48 * containing application becomes inactive.
50 @property (nonatomic, getter=isMusicPausedWhenInactive)
51 BOOL musicPausedWhenInactive;
54 * Hold the volume for background music as a percentage (1 to 100) of the
57 @property (nonatomic) NSInteger musicVolume;
60 * Hold the transition time in milliseconds for when a background music track
61 * is started when another background music track is already playing. If
62 * than or equal to zero, the current track is stopped and the new track
63 * starts playing at full volume without any extra delay.
65 @property (nonatomic) NSInteger musicTransitionTime;
68 * Is the delegate that responds when one of the settings changes.
70 @property (weak, nonatomic) id<SoundAndMusicChanges> changeHandler;
72 /* These are implementation details. */
73 @property (strong) IBOutlet NSPanel *window;
74 @property (strong) IBOutlet NSButton *soundEnabledControl;
75 @property (strong) IBOutlet NSSlider *soundVolumeControl;
76 @property (strong) IBOutlet NSButton *musicEnabledControl;
77 @property (strong) IBOutlet NSButton *musicPausedWhenInactiveControl;
78 @property (strong) IBOutlet NSSlider *musicVolumeControl;
79 @property (strong) IBOutlet NSSlider *musicTransitionTimeControl;