Commit 0d05deab authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/CoreInteraction: modernize getters and setters API

parent f76f40b2
......@@ -29,6 +29,13 @@
int i_currentPlaybackRate;
}
+ (VLCCoreInteraction *)sharedInstance;
@property (readwrite) int volume;
@property (readwrite) int playbackRate;
@property (nonatomic, readwrite) BOOL aspectRatioIsLocked;
@property (readonly) int durationOfCurrentPlaylistItem;
@property (readonly) NSURL * URLOfCurrentPlaylistItem;
@property (readonly) NSString * nameOfCurrentPlaylistItem;
@property (nonatomic, readwrite) BOOL mute;
- (void)play;
- (void)pause;
......@@ -37,13 +44,8 @@
- (void)slower;
- (void)normalSpeed;
- (void)toggleRecord;
- (void)setPlaybackRate:(int)i_value;
- (int)playbackRate;
- (void)next;
- (void)previous;
- (int)durationOfCurrentPlaylistItem;
- (NSURL*)URLOfCurrentPlaylistItem;
- (NSString*)nameOfCurrentPlaylistItem;
- (void)forward; //LEGACY SUPPORT
- (void)backward; //LEGACY SUPPORT
- (void)forwardExtraShort;
......@@ -62,15 +64,9 @@
- (void)volumeUp;
- (void)volumeDown;
- (void)mute;
- (BOOL)isMuted;
- (int)volume;
- (void)setVolume:(int)i_value;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
- (void)setAspectRatioLocked:(BOOL)b_value;
- (BOOL)aspectRatioIsLocked;
- (void)toggleFullscreen;
- (BOOL)fixPreferences;
......
......@@ -446,16 +446,16 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
aout_VolumeDown( pl_Get( p_intf ), 1, NULL );
}
- (void)mute
- (void)setMute:(BOOL)b_value
{
intf_thread_t *p_intf = VLCIntf;
if( !p_intf )
return;
aout_MuteToggle( pl_Get( p_intf ) );
aout_MuteSet( pl_Get( p_intf ), b_value );
}
- (BOOL)isMuted
- (BOOL)mute
{
intf_thread_t *p_intf = VLCIntf;
if( !p_intf )
......@@ -544,7 +544,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
#pragma mark -
#pragma mark video output stuff
- (void)setAspectRatioLocked:(BOOL)b_value
- (void)setAspectRatioIsLocked:(BOOL)b_value
{
config_PutInt( VLCIntf, "macosx-lock-aspect-ratio", b_value );
}
......
......@@ -1293,7 +1293,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
}
else if( [o_title isEqualToString: _NS("Mute")] )
{
[o_mi setState: [[VLCCoreInteraction sharedInstance] isMuted] ? NSOnState : NSOffState];
[o_mi setState: [[VLCCoreInteraction sharedInstance] mute] ? NSOnState : NSOffState];
[self setupMenus]; /* Make sure audio menu is up to date */
}
else if( [o_title isEqualToString: _NS("Half Size")] ||
......
......@@ -329,7 +329,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_play_btn setAlternateImage: o_play_pressed_img];
[o_detached_play_btn setImage: o_play_img];
[o_detached_play_btn setAlternateImage: o_play_pressed_img];
BOOL b_mute = ![[VLCCoreInteraction sharedInstance] isMuted];
BOOL b_mute = ![[VLCCoreInteraction sharedInstance] mute];
[o_volume_sld setEnabled: b_mute];
[o_volume_up_btn setEnabled: b_mute];
......@@ -1207,7 +1207,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
else if (sender == o_volume_down_btn)
{
[[VLCCoreInteraction sharedInstance] mute];
[[VLCCoreInteraction sharedInstance] setMute: YES];
}
else
[[VLCCoreInteraction sharedInstance] setVolume: AOUT_VOLUME_MAX];
......@@ -1593,7 +1593,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
{
playlist_t * p_playlist = pl_Get( VLCIntf );
int i_volume = lroundf(aout_VolumeGet( p_playlist ) * AOUT_VOLUME_DEFAULT);
BOOL b_muted = [[VLCCoreInteraction sharedInstance] isMuted];
BOOL b_muted = [[VLCCoreInteraction sharedInstance] mute];
if( !b_muted )
{
......
......@@ -118,7 +118,7 @@
}
else if ( [o_command isEqualToString:@"mute"] )
{
[[VLCCoreInteraction sharedInstance] mute];
[[VLCCoreInteraction sharedInstance] setMute: YES];
}
else if ( [o_command isEqualToString:@"volumeUp"] )
{
......@@ -220,7 +220,7 @@
}
- (BOOL) muted {
return [[VLCCoreInteraction sharedInstance] isMuted];
return [[VLCCoreInteraction sharedInstance] mute];
}
- (BOOL) playing {
......
......@@ -146,7 +146,7 @@
- (IBAction)mute:(id)sender
{
[[VLCCoreInteraction sharedInstance] mute];
[[VLCCoreInteraction sharedInstance] setMute: YES];
}
- (IBAction)volumeSliderUpdated:(id)sender
......@@ -209,7 +209,7 @@
- (IBAction)lockVideosAspectRatio:(id)sender
{
[[VLCCoreInteraction sharedInstance] setAspectRatioLocked: ![sender state]];
[[VLCCoreInteraction sharedInstance] setAspectRatioIsLocked: ![sender state]];
[sender setState: [[VLCCoreInteraction sharedInstance] aspectRatioIsLocked]];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment