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
e34a1cb1
Commit
e34a1cb1
authored
Jul 30, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: convert debug message visualizer to NSWindowController
... and get rid of another singleton.
parent
cb8e4a6d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
30 deletions
+57
-30
extras/package/macosx/Resources/English.lproj/DebugMessageVisualizer.xib
...macosx/Resources/English.lproj/DebugMessageVisualizer.xib
+28
-14
modules/gui/macosx/DebugMessageVisualizer.h
modules/gui/macosx/DebugMessageVisualizer.h
+2
-3
modules/gui/macosx/DebugMessageVisualizer.m
modules/gui/macosx/DebugMessageVisualizer.m
+13
-12
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+1
-1
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.
extras/package/macosx/Resources/English.lproj/DebugMessageVisualizer.xib
View file @
e34a1cb1
...
...
@@ -2,13 +2,13 @@
<archive
type=
"com.apple.InterfaceBuilder3.Cocoa.XIB"
version=
"8.00"
>
<data>
<int
key=
"IBDocument.SystemTarget"
>
1060
</int>
<string
key=
"IBDocument.SystemVersion"
>
14
B25
</string>
<string
key=
"IBDocument.InterfaceBuilderVersion"
>
6254
</string>
<string
key=
"IBDocument.AppKitVersion"
>
134
3.16
</string>
<string
key=
"IBDocument.HIToolboxVersion"
>
75
5.0
0
</string>
<string
key=
"IBDocument.SystemVersion"
>
14
F6a
</string>
<string
key=
"IBDocument.InterfaceBuilderVersion"
>
7706
</string>
<string
key=
"IBDocument.AppKitVersion"
>
134
8.17
</string>
<string
key=
"IBDocument.HIToolboxVersion"
>
75
8.7
0
</string>
<object
class=
"NSMutableDictionary"
key=
"IBDocument.PluginVersions"
>
<string
key=
"NS.key.0"
>
com.apple.InterfaceBuilder.CocoaPlugin
</string>
<string
key=
"NS.object.0"
>
6254
</string>
<string
key=
"NS.object.0"
>
7706
</string>
</object>
<array
key=
"IBDocument.IntegratedClassDependencies"
>
<string>
NSButton
</string>
...
...
@@ -317,11 +317,11 @@
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
_msgs_panel
</string>
<string
key=
"label"
>
window
</string>
<reference
key=
"source"
ref=
"1001"
/>
<reference
key=
"destination"
ref=
"401114513"
/>
</object>
<int
key=
"connectionID"
>
2
3
</int>
<int
key=
"connectionID"
>
2
4
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBOutletConnection"
key=
"connection"
>
...
...
@@ -476,13 +476,13 @@
<nil
key=
"activeLocalization"
/>
<dictionary
class=
"NSMutableDictionary"
key=
"localizations"
/>
<nil
key=
"sourceID"
/>
<int
key=
"maxID"
>
2
3
</int>
<int
key=
"maxID"
>
2
4
</int>
</object>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<array
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptions"
>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
VLCDebugMessageVisualizer
</string>
<string
key=
"superclassName"
>
NS
Object
</string>
<string
key=
"superclassName"
>
NS
WindowController
</string>
<dictionary
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"saveDebugLog:"
>
id
</string>
<string
key=
"updateMessagesPanel:"
>
id
</string>
...
...
@@ -498,16 +498,11 @@
</object>
</dictionary>
<dictionary
class=
"NSMutableDictionary"
key=
"outlets"
>
<string
key=
"_msgs_panel"
>
NSWindow
</string>
<string
key=
"_msgs_refresh_btn"
>
NSButton
</string>
<string
key=
"_msgs_save_btn"
>
NSButton
</string>
<string
key=
"_msgs_table"
>
id
</string>
</dictionary>
<dictionary
class=
"NSMutableDictionary"
key=
"toOneOutletInfosByName"
>
<object
class=
"IBToOneOutletInfo"
key=
"_msgs_panel"
>
<string
key=
"name"
>
_msgs_panel
</string>
<string
key=
"candidateClassName"
>
NSWindow
</string>
</object>
<object
class=
"IBToOneOutletInfo"
key=
"_msgs_refresh_btn"
>
<string
key=
"name"
>
_msgs_refresh_btn
</string>
<string
key=
"candidateClassName"
>
NSButton
</string>
...
...
@@ -685,6 +680,25 @@
<string
key=
"minorKey"
>
AppKit.framework/Headers/NSWindow.h
</string>
</object>
</object>
<object
class=
"IBPartialClassDescription"
>
<string
key=
"className"
>
NSWindowController
</string>
<string
key=
"superclassName"
>
NSResponder
</string>
<object
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"NS.key.0"
>
showWindow:
</string>
<string
key=
"NS.object.0"
>
id
</string>
</object>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
<string
key=
"NS.key.0"
>
showWindow:
</string>
<object
class=
"IBActionInfo"
key=
"NS.object.0"
>
<string
key=
"name"
>
showWindow:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</object>
<object
class=
"IBClassDescriptionSource"
key=
"sourceIdentifier"
>
<string
key=
"majorKey"
>
IBFrameworkSource
</string>
<string
key=
"minorKey"
>
AppKit.framework/Headers/NSWindowController.h
</string>
</object>
</object>
</array>
</object>
<int
key=
"IBDocument.localizationMode"
>
0
</int>
...
...
modules/gui/macosx/DebugMessageVisualizer.h
View file @
e34a1cb1
...
...
@@ -25,16 +25,15 @@
#import <Cocoa/Cocoa.h>
@interface
VLCDebugMessageVisualizer
:
NS
Object
@interface
VLCDebugMessageVisualizer
:
NS
WindowController
{
IBOutlet
NSWindow
*
_msgs_panel
;
IBOutlet
NSButton
*
_msgs_save_btn
;
IBOutlet
NSButton
*
_msgs_refresh_btn
;
IBOutlet
id
_msgs_table
;
}
+
(
VLCDebugMessageVisualizer
*
)
sharedInstance
;
-
(
void
)
show
Panel
;
-
(
void
)
show
Window
:(
id
)
sender
;
-
(
IBAction
)
updateMessagesPanel
:(
id
)
sender
;
-
(
IBAction
)
saveDebugLog
:(
id
)
sender
;
...
...
modules/gui/macosx/DebugMessageVisualizer.m
View file @
e34a1cb1
...
...
@@ -47,6 +47,9 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
static
void
MsgCallback
(
void
*
data
,
int
type
,
const
vlc_log_t
*
item
,
const
char
*
format
,
va_list
ap
)
{
@autoreleasepool
{
VLCDebugMessageVisualizer
*
visualizer
=
(
__bridge
VLCDebugMessageVisualizer
*
)
data
;
int
canc
=
vlc_savecancel
();
char
*
str
;
...
...
@@ -55,7 +58,7 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
return
;
}
[
[
VLCDebugMessageVisualizer
sharedInstance
]
processReceivedlibvlcMessage
:
item
ofType
:
type
withStr
:
str
];
[
visualizer
processReceivedlibvlcMessage
:
item
ofType
:
type
withStr
:
str
];
vlc_restorecancel
(
canc
);
free
(
str
);
...
...
@@ -78,33 +81,31 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
-
(
id
)
init
{
self
=
[
super
init
];
self
=
[
super
init
WithWindowNibName
:
@"DebugMessageVisualizer"
];
if
(
self
)
{
_msg_lock
=
[[
NSLock
alloc
]
init
];
_msg_arr
=
[
NSMutableArray
arrayWithCapacity
:
600
];
BOOL
loaded
=
[
NSBundle
loadNibNamed
:
@"DebugMessageVisualizer"
owner
:
self
];
}
return
self
;
}
-
(
void
)
awakeFromNib
-
(
void
)
windowDidLoad
{
[
_msgs_panel
setExcludedFromWindowsMenu
:
YES
];
[
_msgs_panel
setDelegate
:
self
];
[
_msgs_panel
setTitle
:
_NS
(
"Messages"
)];
[
self
.
window
setExcludedFromWindowsMenu
:
YES
];
[
self
.
window
setDelegate
:
self
];
[
self
.
window
setTitle
:
_NS
(
"Messages"
)];
[
_msgs_save_btn
setTitle
:
_NS
(
"Save this Log..."
)];
[
_msgs_refresh_btn
setImage
:
[
NSImage
imageNamed
:
NSImageNameRefreshTemplate
]];
}
#pragma mark - UI interaction
-
(
void
)
show
Panel
-
(
void
)
show
Window
:(
id
)
sender
{
/* subscribe to LibVLCCore's messages */
vlc_LogSet
(
VLCIntf
->
p_libvlc
,
MsgCallback
,
NULL
);
vlc_LogSet
(
VLCIntf
->
p_libvlc
,
MsgCallback
,
(
__bridge
void
*
)
self
);
/* show panel */
[
_msgs_panel
makeKeyAndOrderFront
:
nil
];
[
super
showWindow
:
sender
];
}
-
(
IBAction
)
updateMessagesPanel
:(
id
)
sender
...
...
@@ -132,7 +133,7 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
[
saveFolderPanel
setCanCreateDirectories
:
YES
];
[
saveFolderPanel
setAllowedFileTypes
:
[
NSArray
arrayWithObject
:
@"rtf"
]];
[
saveFolderPanel
setNameFieldStringValue
:[
NSString
stringWithFormat
:
_NS
(
"VLC Debug Log (%s).rtf"
),
VERSION_MESSAGE
]];
[
saveFolderPanel
beginSheetModalForWindow
:
_msgs_panel
completionHandler
:
^
(
NSInteger
returnCode
)
{
[
saveFolderPanel
beginSheetModalForWindow
:
self
.
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
if
(
returnCode
==
NSOKButton
)
{
NSUInteger
count
=
[
_msg_arr
count
];
NSMutableAttributedString
*
string
=
[[
NSMutableAttributedString
alloc
]
init
];
...
...
modules/gui/macosx/MainMenu.m
View file @
e34a1cb1
...
...
@@ -1335,7 +1335,7 @@
-
(
IBAction
)
showMessagesPanel
:(
id
)
showMessagesPanel
{
[[
VLCDebugMessageVisualizer
sharedInstance
]
showPanel
];
[[
[
VLCMain
sharedInstance
]
debugMsgPanel
]
showWindow
:
self
];
}
-
(
IBAction
)
showMainWindow
:(
id
)
sender
...
...
modules/gui/macosx/intf.h
View file @
e34a1cb1
...
...
@@ -64,6 +64,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
@class
VLCCoreDialogProvider
;
@class
VLCBookmarks
;
@class
VLCOpen
;
@class
VLCDebugMessageVisualizer
;
@interface
VLCMain
:
NSObject
<
NSWindowDelegate
,
NSApplicationDelegate
>
{
...
...
@@ -88,6 +89,8 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-
(
VLCCoreDialogProvider
*
)
coreDialogProvider
;
-
(
ResumeDialogController
*
)
resumeDialog
;
-
(
VLCInputManager
*
)
inputManager
;
-
(
VLCDebugMessageVisualizer
*
)
debugMsgPanel
;
-
(
void
)
setActiveVideoPlayback
:(
BOOL
)
b_value
;
-
(
BOOL
)
activeVideoPlayback
;
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
;
...
...
modules/gui/macosx/intf.m
View file @
e34a1cb1
...
...
@@ -58,6 +58,7 @@
#import "ExtensionsManager.h"
#import "BWQuincyManager.h"
#import "ResumeDialogController.h"
#import "DebugMessageVisualizer.h"
#import "VideoEffects.h"
#import "AudioEffects.h"
...
...
@@ -157,6 +158,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
ResumeDialogController
*
_resume_dialog
;
VLCInputManager
*
_input_manager
;
VLCPlaylist
*
_playlist
;
VLCDebugMessageVisualizer
*
_messagePanelController
;
bool
b_intf_terminating
;
/* Makes sure applicationWillTerminate will be called only once */
}
...
...
@@ -521,6 +523,14 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
return
_input_manager
;
}
-
(
VLCDebugMessageVisualizer
*
)
debugMsgPanel
{
if
(
!
_messagePanelController
)
_messagePanelController
=
[[
VLCDebugMessageVisualizer
alloc
]
init
];
return
_messagePanelController
;
}
-
(
VLCBookmarks
*
)
bookmarks
{
if
(
!
_bookmarks
)
...
...
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