OSDN Git Service

Mac: implement background music
[hengbandforosx/hengbandosx.git] / src / cocoa / SoundAndMusic.h
1 /**
2  * \file SoundAndMusc.h
3  * \brief Declare interface to sound and music configuration panel used by
4  * the OS X front end.
5  */
6
7 #import <Cocoa/Cocoa.h>
8
9
10 /**
11  * Declare a protocol to encapsulate changes to the settings for sounds and
12  * music.
13  */
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;
22 @end
23
24
25 /**
26  * Declare a NSWindowController subclass to load the panel from the nib file.
27  */
28 @interface SoundAndMusicPanelController : NSWindowController <NSWindowDelegate>
29
30 /**
31  * Hold whether or not incidental sounds (and beeps) are played.
32  */
33 @property (nonatomic, getter=isSoundEnabled) BOOL soundEnabled;
34
35 /**
36  * Hold the volume for incidental sounds as a percentage (1 to 100) of the
37  * system volume.
38  */
39 @property (nonatomic) NSInteger soundVolume;
40
41 /**
42  * Hold whether or not background music is played.
43  */
44 @property (nonatomic, getter=isMusicEnabled) BOOL musicEnabled;
45
46 /**
47  * Hold whether or not currently playing music tracks are paused when the
48  * containing application becomes inactive.
49  */
50 @property (nonatomic, getter=isMusicPausedWhenInactive)
51                 BOOL musicPausedWhenInactive;
52
53 /**
54  * Hold the volume for background music as a percentage (1 to 100) of the
55  * system volume.
56  */
57 @property (nonatomic) NSInteger musicVolume;
58
59 /**
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.
64  */
65 @property (nonatomic) NSInteger musicTransitionTime;
66
67 /**
68  * Is the delegate that responds when one of the settings changes.
69  */
70 @property (weak, nonatomic) id<SoundAndMusicChanges> changeHandler;
71
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;
80
81 @end