[vlc-commits] macosx: expand vout menu
Felix Paul Kühne
git at videolan.org
Mon Aug 19 13:40:45 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Mon Aug 19 12:59:37 2019 +0200| [33ee620840ad5acc23168383e88c2f4c781ebd72] | committer: Felix Paul Kühne
macosx: expand vout menu
This adds ES management and recording.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=33ee620840ad5acc23168383e88c2f4c781ebd72
---
modules/gui/macosx/UI/MainMenu.xib | 32 ++++++++++++++++++++++++++++++++
modules/gui/macosx/menus/VLCMainMenu.h | 8 ++++++++
modules/gui/macosx/menus/VLCMainMenu.m | 25 +++++++++++++++++++------
3 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/modules/gui/macosx/UI/MainMenu.xib b/modules/gui/macosx/UI/MainMenu.xib
index ea72fd3f1e..6afda1b692 100644
--- a/modules/gui/macosx/UI/MainMenu.xib
+++ b/modules/gui/macosx/UI/MainMenu.xib
@@ -156,6 +156,14 @@
<outlet property="vol_down" destination="1065" id="iI9-ay-pAs"/>
<outlet property="vol_up" destination="1064" id="8I9-3j-p1J"/>
<outlet property="voutMenu" destination="2730" id="ZHq-j3-Ggd"/>
+ <outlet property="voutMenuAudiotrack" destination="n8w-vf-ZVR" id="b8A-Vn-Xoe"/>
+ <outlet property="voutMenuAudiotrackMenu" destination="y7z-2t-aNd" id="fzG-vh-4te"/>
+ <outlet property="voutMenuOpenSubtitleFile" destination="dqb-Ht-ibF" id="4Y5-vb-c51"/>
+ <outlet property="voutMenuRecord" destination="LA2-yH-mAD" id="SJJ-ZD-ee1"/>
+ <outlet property="voutMenuSubtitlestrack" destination="5H6-1N-Hjz" id="LdO-F9-cTL"/>
+ <outlet property="voutMenuSubtitlestrackMenu" destination="juF-Df-Fzd" id="exR-TY-zmI"/>
+ <outlet property="voutMenuVideotrack" destination="mqn-dW-9kE" id="Y9j-G3-FF3"/>
+ <outlet property="voutMenuVideotrackMenu" destination="UmV-y6-gd3" id="RqR-qO-YSj"/>
<outlet property="voutMenufullscreen" destination="2732" id="NC7-qA-BIE"/>
<outlet property="voutMenumute" destination="2743" id="k5B-Oz-GjX"/>
<outlet property="voutMenunext" destination="2739" id="CkI-w1-GZo"/>
@@ -875,6 +883,12 @@
<action selector="stop:" target="-2" id="3I6-RI-EYq"/>
</connections>
</menuItem>
+ <menuItem title="Record" enabled="NO" id="LA2-yH-mAD">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="toggleRecord:" target="-2" id="hpP-Ik-xWJ"/>
+ </connections>
+ </menuItem>
<menuItem isSeparatorItem="YES" id="2737">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
@@ -909,6 +923,23 @@
<menuItem isSeparatorItem="YES" id="2738">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
+ <menuItem title="Audio track" id="n8w-vf-ZVR">
+ <menu key="submenu" title="Audio track" id="y7z-2t-aNd"/>
+ </menuItem>
+ <menuItem title="Video track" id="mqn-dW-9kE">
+ <menu key="submenu" title="Video track" id="UmV-y6-gd3"/>
+ </menuItem>
+ <menuItem title="Open File..." id="dqb-Ht-ibF">
+ <connections>
+ <action selector="addSubtitleFile:" target="-2" id="YXj-Mu-ank"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Subtitle track" id="5H6-1N-Hjz">
+ <menu key="submenu" title="Subtitle track" id="juF-Df-Fzd"/>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="K9n-42-WrB">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
<menuItem title="Fullscreen" id="2732">
<connections>
<action selector="toggleFullscreen:" target="-2" id="7fK-95-1OE"/>
@@ -923,6 +954,7 @@
</connections>
</menuItem>
</items>
+ <point key="canvasLocation" x="-35" y="361"/>
</menu>
<customView id="4596" userLabel="Rate Menu View">
<rect key="frame" x="0.0" y="0.0" width="307" height="53"/>
diff --git a/modules/gui/macosx/menus/VLCMainMenu.h b/modules/gui/macosx/menus/VLCMainMenu.h
index c5b8c2ad8a..1892e8d088 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.h
+++ b/modules/gui/macosx/menus/VLCMainMenu.h
@@ -197,11 +197,19 @@
@property (readwrite, strong) IBOutlet NSMenu *voutMenu;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenuplay;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenustop;
+ at property (readwrite, strong) IBOutlet NSMenuItem *voutMenuRecord;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenuprev;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenunext;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenuvolup;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenuvoldown;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenumute;
+ at property (readwrite, strong) IBOutlet NSMenuItem *voutMenuAudiotrack;
+ at property (readwrite, strong) IBOutlet NSMenu *voutMenuAudiotrackMenu;
+ at property (readwrite, strong) IBOutlet NSMenuItem *voutMenuVideotrack;
+ at property (readwrite, strong) IBOutlet NSMenu *voutMenuVideotrackMenu;
+ at property (readwrite, strong) IBOutlet NSMenuItem *voutMenuOpenSubtitleFile;
+ at property (readwrite, strong) IBOutlet NSMenuItem *voutMenuSubtitlestrack;
+ at property (readwrite, strong) IBOutlet NSMenu *voutMenuSubtitlestrackMenu;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenufullscreen;
@property (readwrite, strong) IBOutlet NSMenuItem *voutMenusnapshot;
diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m
index ebbe0296b4..2a20fc8406 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.m
+++ b/modules/gui/macosx/menus/VLCMainMenu.m
@@ -502,6 +502,13 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
[_voutMenuvolup setTitle: _NS("Volume Up")];
[_voutMenuvoldown setTitle: _NS("Volume Down")];
[_voutMenumute setTitle: _NS("Mute")];
+ [_voutMenuAudiotrack setTitle: _NS("Audio Track")];
+ [_voutMenuAudiotrackMenu setTitle: _NS("Audio Track")];
+ [_voutMenuVideotrack setTitle: _NS("Video Track")];
+ [_voutMenuVideotrackMenu setTitle: _NS("Video Track")];
+ [_voutMenuOpenSubtitleFile setTitle:_NS("Add Subtitle File...")];
+ [_voutMenuSubtitlestrack setTitle: _NS("Subtitles Track")];
+ [_voutMenuSubtitlestrackMenu setTitle: _NS("Subtitles Track")];
[_voutMenufullscreen setTitle: _NS("Fullscreen")];
[_voutMenusnapshot setTitle: _NS("Snapshot")];
}
@@ -713,6 +720,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
- (void)setSubtitleMenuEnabled:(BOOL)b_enabled
{
[_openSubtitleFile setEnabled: b_enabled];
+ [_voutMenuOpenSubtitleFile setEnabled: b_enabled];
if (b_enabled) {
[_subtitle_bgopacityLabel_gray setHidden: YES];
[_subtitle_bgopacityLabel setHidden: NO];
@@ -836,7 +844,9 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
- (void)updateRecordState
{
- [_record setState:_playerController.enableRecording];
+ NSControlStateValue state = _playerController.enableRecording ? NSOnState : NSOffState;
+ [_record setState:state];
+ [_voutMenuRecord setState:state];
}
- (IBAction)setPlaybackRate:(id)sender
@@ -891,17 +901,20 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
NSArray *tracks = _playerController.audioTracks;
NSUInteger numberOfTracks = tracks.count;
[self rebuildTracksMenu:_audiotrackMenu withMetadata:tracks count:numberOfTracks category:AUDIO_ES];
- _audiotrack.enabled = numberOfTracks > 0 ? YES : NO;
+ [self rebuildTracksMenu:_voutMenuAudiotrackMenu withMetadata:tracks count:numberOfTracks category:AUDIO_ES];
+ _voutMenuAudiotrack.enabled = _audiotrack.enabled = numberOfTracks > 0 ? YES : NO;
tracks = _playerController.videoTracks;
numberOfTracks = tracks.count;
[self rebuildTracksMenu:_videotrackMenu withMetadata:tracks count:numberOfTracks category:VIDEO_ES];
- _videotrack.enabled = numberOfTracks > 0 ? YES : NO;
+ [self rebuildTracksMenu:_voutMenuVideotrackMenu withMetadata:tracks count:numberOfTracks category:VIDEO_ES];
+ _voutMenuVideotrack.enabled = _videotrack.enabled = numberOfTracks > 0 ? YES : NO;
tracks = _playerController.subtitleTracks;
numberOfTracks = tracks.count;
[self rebuildTracksMenu:_subtitle_tracksMenu withMetadata:tracks count:numberOfTracks category:SPU_ES];
- _subtitle_track.enabled = numberOfTracks > 0 ? YES : NO;
+ [self rebuildTracksMenu:_voutMenuSubtitlestrackMenu withMetadata:tracks count:numberOfTracks category:SPU_ES];
+ _voutMenuSubtitlestrack.enabled = _subtitle_track.enabled = numberOfTracks > 0 ? YES : NO;
}
- (void)rebuildTracksMenu:(NSMenu *)menu
@@ -1787,7 +1800,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
mi == _voutMenunext ||
mi == _dockMenunext) {
enabled = _playlistController.hasNextPlaylistItem;
- } else if (mi == _record) {
+ } else if (mi == _record || mi == _voutMenuRecord) {
enabled = _playerController.recordable;
} else if (mi == _random) {
enum vlc_playlist_playback_order playbackOrder = [_playlistController playbackOrder];
@@ -1829,7 +1842,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
vout_Release(p_vout);
}
- } else if (mi == _openSubtitleFile) {
+ } else if (mi == _openSubtitleFile || mi == _voutMenuOpenSubtitleFile) {
enabled = YES;
} else {
NSMenuItem *_parent = [mi parentItem];
More information about the vlc-commits
mailing list