Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
91e3caa6
Commit
91e3caa6
authored
Aug 05, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: convert cas to NSWindowController subclass, remove singleton
parent
dc7a2831
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
40 deletions
+27
-40
modules/gui/macosx/ConvertAndSave.h
modules/gui/macosx/ConvertAndSave.h
+1
-6
modules/gui/macosx/ConvertAndSave.m
modules/gui/macosx/ConvertAndSave.m
+12
-25
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+1
-9
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+3
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+10
-0
No files found.
modules/gui/macosx/ConvertAndSave.h
View file @
91e3caa6
...
...
@@ -27,10 +27,9 @@
@class
VLCDropDisabledImageView
;
@class
VLCDragDropView
;
@interface
VLCConvertAndSave
:
NS
Object
@interface
VLCConvertAndSave
:
NS
WindowController
// main panel
@property
(
weak
)
IBOutlet
NSWindow
*
window
;
@property
(
weak
)
IBOutlet
VLCDragDropView
*
dropBox
;
@property
(
weak
)
IBOutlet
NSTextField
*
dropLabel
;
...
...
@@ -141,10 +140,6 @@
@property
(
nonatomic
)
int
audChannels
;
+
(
VLCConvertAndSave
*
)
sharedInstance
;
-
(
IBAction
)
toggleWindow
;
-
(
IBAction
)
finalizePanel
:(
id
)
sender
;
-
(
IBAction
)
openMedia
:(
id
)
sender
;
-
(
IBAction
)
switchProfile
:(
id
)
sender
;
...
...
modules/gui/macosx/ConvertAndSave.m
View file @
91e3caa6
...
...
@@ -118,21 +118,16 @@
[
defaults
registerDefaults
:
appDefaults
];
}
+
(
VLCConvertAndSave
*
)
sharedInstance
-
(
id
)
init
{
static
VLCConvertAndSave
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
self
=
[
super
initWithWindowNibName
:
@"ConvertAndSave"
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCConvertAndSave
new
];
});
return
sharedInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
-
(
void
)
windowDidLoad
{
[
_
window
setTitle
:
_NS
(
"Convert & Stream"
)];
[
self
.
window
setTitle
:
_NS
(
"Convert & Stream"
)];
[
_okButton
setTitle
:
_NS
(
"Go!"
)];
[
_dropLabel
setStringValue
:
_NS
(
"Drop media here"
)];
[
_dropButton
setTitle
:
_NS
(
"Open media..."
)];
...
...
@@ -254,14 +249,6 @@
[
self
resetCustomizationSheetBasedOnProfile
:[
self
.
profileValueList
firstObject
]];
}
# pragma mark -
# pragma mark Code to Communicate with other objects
-
(
void
)
toggleWindow
{
[
_window
makeKeyAndOrderFront
:
nil
];
}
# pragma mark -
# pragma mark User Interaction
...
...
@@ -271,7 +258,7 @@
if
([[[
_streamTypePopup
selectedItem
]
title
]
isEqualToString
:
@"HTTP"
])
{
NSString
*
muxformat
=
[
self
.
currentProfile
firstObject
];
if
([
muxformat
isEqualToString
:
@"wav"
]
||
[
muxformat
isEqualToString
:
@"mov"
]
||
[
muxformat
isEqualToString
:
@"mp4"
]
||
[
muxformat
isEqualToString
:
@"mkv"
])
{
NSBeginInformationalAlertSheet
(
_NS
(
"Invalid container format for HTTP streaming"
),
_NS
(
"OK"
),
@""
,
@""
,
_
window
,
NSBeginInformationalAlertSheet
(
_NS
(
"Invalid container format for HTTP streaming"
),
_NS
(
"OK"
),
@""
,
@""
,
self
.
window
,
nil
,
nil
,
nil
,
nil
,
_NS
(
"Media encapsulated as %@ cannot be streamed through the HTTP protocol for technical reasons."
),
[[
self
currentEncapsulationFormatAsFileExtension
:
YES
]
uppercaseString
]);
...
...
@@ -307,7 +294,7 @@
/* we're done with this input */
vlc_gc_decref
(
p_input
);
[
_
window
performClose
:
sender
];
[
self
.
window
performClose
:
sender
];
}
-
(
IBAction
)
openMedia
:(
id
)
sender
...
...
@@ -317,7 +304,7 @@
[
openPanel
setCanChooseDirectories
:
NO
];
[
openPanel
setResolvesAliases
:
YES
];
[
openPanel
setAllowsMultipleSelection
:
NO
];
[
openPanel
beginSheetModalForWindow
:
_
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
[
openPanel
beginSheetModalForWindow
:
self
.
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
if
(
returnCode
==
NSOKButton
)
{
[
self
setMRL
:
toNSStr
(
vlc_path2uri
([[[
openPanel
URL
]
path
]
UTF8String
],
NULL
))];
...
...
@@ -337,7 +324,7 @@
-
(
IBAction
)
customizeProfile
:(
id
)
sender
{
[
NSApp
beginSheet
:
_customizePanel
modalForWindow
:
_
window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
[
NSApp
beginSheet
:
_customizePanel
modalForWindow
:
self
.
window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
}
-
(
IBAction
)
closeCustomizationSheet
:(
id
)
sender
...
...
@@ -373,7 +360,7 @@
[
panel
setPopupButtonContent
:
self
.
profileNames
];
[
panel
setTarget
:
self
];
[
panel
runModalForWindow
:
_
window
];
[
panel
runModalForWindow
:
self
.
window
];
}
-
(
IBAction
)
iWantAFile
:(
id
)
sender
...
...
@@ -426,7 +413,7 @@
[
saveFilePanel
setCanCreateDirectories
:
YES
];
if
([[
_customizeEncapMatrix
selectedCell
]
tag
]
!=
RAW
)
// there is no clever guess for this
[
saveFilePanel
setAllowedFileTypes
:[
NSArray
arrayWithObject
:[
self
currentEncapsulationFormatAsFileExtension
:
YES
]]];
[
saveFilePanel
beginSheetModalForWindow
:
_
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
[
saveFilePanel
beginSheetModalForWindow
:
self
.
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
if
(
returnCode
==
NSOKButton
)
{
[
self
setOutputDestination
:[[
saveFilePanel
URL
]
path
]];
[
_fileDestinationFileName
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
_outputDestination
]];
...
...
@@ -443,7 +430,7 @@
-
(
IBAction
)
showStreamPanel
:(
id
)
sender
{
[
NSApp
beginSheet
:
_streamPanel
modalForWindow
:
_
window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
[
NSApp
beginSheet
:
_streamPanel
modalForWindow
:
self
.
window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
}
-
(
IBAction
)
closeStreamPanel
:(
id
)
sender
...
...
modules/gui/macosx/MainMenu.m
View file @
91e3caa6
...
...
@@ -54,11 +54,9 @@
@interface
VLCMainMenu
()
{
BOOL
b_nib_bookmarks_loaded
;
BOOL
b_nib_convertandsave_loaded
;
AboutWindowController
*
_aboutWindowController
;
HelpWindowController
*
_helpWindowController
;
VLCConvertAndSave
*
_convertAndSaveWindowController
;
AddonsWindowController
*
_addonsController
;
ExtensionsManager
*
_extensionManager
;
...
...
@@ -1266,13 +1264,7 @@
-
(
IBAction
)
showConvertAndSave
:(
id
)
sender
{
if
(
_convertAndSaveWindowController
==
nil
)
_convertAndSaveWindowController
=
[[
VLCConvertAndSave
alloc
]
init
];
if
(
!
b_nib_convertandsave_loaded
)
b_nib_convertandsave_loaded
=
[
NSBundle
loadNibNamed
:
@"ConvertAndSave"
owner
:
_convertAndSaveWindowController
];
[
_convertAndSaveWindowController
toggleWindow
];
[[[
VLCMain
sharedInstance
]
convertAndSaveWindow
]
showWindow
:
self
];
}
-
(
IBAction
)
showVideoEffects
:(
id
)
sender
...
...
modules/gui/macosx/intf.h
View file @
91e3caa6
...
...
@@ -68,6 +68,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
@class
VLCTrackSynchronization
;
@class
VLCAudioEffects
;
@class
VLCVideoEffects
;
@class
VLCConvertAndSave
;
@interface
VLCMain
:
NSObject
<
NSWindowDelegate
,
NSApplicationDelegate
>
{
...
...
@@ -98,6 +99,8 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-
(
VLCAudioEffects
*
)
audioEffectsPanel
;
-
(
VLCVideoEffects
*
)
videoEffectsPanel
;
-
(
VLCConvertAndSave
*
)
convertAndSaveWindow
;
-
(
void
)
setActiveVideoPlayback
:(
BOOL
)
b_value
;
-
(
BOOL
)
activeVideoPlayback
;
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
;
...
...
modules/gui/macosx/intf.m
View file @
91e3caa6
...
...
@@ -59,6 +59,7 @@
#import "BWQuincyManager.h"
#import "ResumeDialogController.h"
#import "DebugMessageVisualizer.h"
#import "ConvertAndSave.h"
#import "VideoEffects.h"
#import "AudioEffects.h"
...
...
@@ -158,6 +159,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
VLCTrackSynchronization
*
_trackSyncPanel
;
VLCAudioEffects
*
_audioEffectsPanel
;
VLCVideoEffects
*
_videoEffectsPanel
;
VLCConvertAndSave
*
_convertAndSaveWindow
;
bool
b_intf_terminating
;
/* Makes sure applicationWillTerminate will be called only once */
}
...
...
@@ -569,6 +571,14 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
return
_open
;
}
-
(
VLCConvertAndSave
*
)
convertAndSaveWindow
{
if
(
_convertAndSaveWindow
==
nil
)
_convertAndSaveWindow
=
[[
VLCConvertAndSave
alloc
]
init
];
return
_convertAndSaveWindow
;
}
-
(
VLCSimplePrefs
*
)
simplePreferences
{
if
(
!
_sprefs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment