Skip to content

Commit 982c3ef

Browse files
committed
Merge branch 'dev'
2 parents 5ccd20e + c2788de commit 982c3ef

27 files changed

+993
-612
lines changed

Classes/AudioService.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Created by Simon Toens on 04.10.16
2+
//
3+
// iUAE is free software: you may copy, redistribute
4+
// and/or modify it under the terms of the GNU General Public License as
5+
// published by the Free Software Foundation, either version 2 of the
6+
// License, or (at your option) any later version.
7+
//
8+
// This file is distributed in the hope that it will be useful, but
9+
// WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
// General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU General Public License
14+
// along with this program; if not, write to the Free Software
15+
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16+
17+
#import <Foundation/Foundation.h>
18+
19+
/**
20+
* The audio service handles interactions with the sound subsystem.
21+
*
22+
* Note that this class uses the emulator state as source of truth, it does not/should not read configuration.
23+
*/
24+
@interface AudioService : NSObject
25+
26+
/**
27+
* Sets the emulator volume: 0 = min, 1 = max.
28+
*/
29+
- (void)setVolume:(float)volume;
30+
31+
/**
32+
* Returns the emulator volume: 0 = min, 1 = max.
33+
*/
34+
- (float)getVolume;
35+
36+
@end

Classes/AudioService.mm

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Created by Simon Toens on 04.10.16
2+
//
3+
// iUAE is free software: you may copy, redistribute
4+
// and/or modify it under the terms of the GNU General Public License as
5+
// published by the Free Software Foundation, either version 2 of the
6+
// License, or (at your option) any later version.
7+
//
8+
// This file is distributed in the hope that it will be useful, but
9+
// WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
// General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU General Public License
14+
// along with this program; if not, write to the Free Software
15+
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16+
17+
#include "sysconfig.h"
18+
#include "sysdeps.h"
19+
#include "options.h"
20+
#include "fame.h"
21+
#include "audio.h"
22+
23+
#import "AudioService.h"
24+
25+
@implementation AudioService
26+
27+
- (void)setVolume:(float)volume {
28+
set_audio_volume(volume);
29+
}
30+
31+
- (float)getVolume {
32+
return get_audio_volume();
33+
}
34+
35+
@end

Classes/CoreSetting.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#import <Foundation/Foundation.h>
1818
#import "CoreSettingGroup.h"
1919

20+
//Wrapper Methods for C++ calls
2021
/**
2122
* A special setting (property/switch/toggle) that requires an emulator reset to take effect. For example, the rom being used.
2223
*
@@ -54,12 +55,18 @@
5455

5556
@interface DriveServiceBasedCoreSetting : CoreSetting @end // abstract
5657
@interface DiskDriveEnabledCoreSetting : DriveServiceBasedCoreSetting @end // abstract
57-
@interface RomCoreSetting : DriveServiceBasedCoreSetting @end
58+
59+
@interface RomCoreSetting : DriveServiceBasedCoreSetting
60+
+ (RomCoreSetting *)getInstance;
61+
@end
62+
5863
@interface DF1EnabledCoreSetting : DiskDriveEnabledCoreSetting @end
5964
@interface DF2EnabledCoreSetting : DiskDriveEnabledCoreSetting @end
6065
@interface DF3EnabledCoreSetting : DiskDriveEnabledCoreSetting @end
6166
@interface HardDriveBasedCoreSetting : CoreSetting @end // abstract
62-
@interface HD0PathCoreSetting : HardDriveBasedCoreSetting <CoreSettingGroupMember> @end
67+
@interface HD0PathCoreSetting : HardDriveBasedCoreSetting <CoreSettingGroupMember>
68+
+ (HD0PathCoreSetting *)getInstance;
69+
@end
6370
@interface HD0ReadOnlyCoreSetting : HardDriveBasedCoreSetting <CoreSettingGroupMember> @end
6471
@interface HD0SettingGroup : NSObject <CoreSettingGroup> @end
6572
@interface NTSCEnabledCoreSetting : CoreSetting @end
@@ -87,3 +94,5 @@
8794
+ (NTSCEnabledCoreSetting *)ntscEnabledCoreSetting;
8895

8996
@end
97+
98+

0 commit comments

Comments
 (0)