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
5fb6cff9
Commit
5fb6cff9
authored
Jul 15, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: update singleton creation
parent
9632dfbb
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
246 additions
and
254 deletions
+246
-254
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AppleRemote.m
+38
-38
modules/gui/macosx/AudioEffects.m
modules/gui/macosx/AudioEffects.m
+12
-9
modules/gui/macosx/ConvertAndSave.m
modules/gui/macosx/ConvertAndSave.m
+6
-9
modules/gui/macosx/CoreInteraction.m
modules/gui/macosx/CoreInteraction.m
+8
-10
modules/gui/macosx/DebugMessageVisualizer.m
modules/gui/macosx/DebugMessageVisualizer.m
+11
-7
modules/gui/macosx/ExtensionsDialogProvider.m
modules/gui/macosx/ExtensionsDialogProvider.m
+13
-7
modules/gui/macosx/InputManager.m
modules/gui/macosx/InputManager.m
+3
-3
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+21
-21
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+16
-18
modules/gui/macosx/SharedDialogs.m
modules/gui/macosx/SharedDialogs.m
+12
-17
modules/gui/macosx/StringUtility.m
modules/gui/macosx/StringUtility.m
+6
-8
modules/gui/macosx/TrackSynchronization.m
modules/gui/macosx/TrackSynchronization.m
+11
-8
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VLCVoutWindowController.m
+1
-1
modules/gui/macosx/VideoEffects.m
modules/gui/macosx/VideoEffects.m
+12
-8
modules/gui/macosx/bookmarks.m
modules/gui/macosx/bookmarks.m
+6
-9
modules/gui/macosx/coredialogs.m
modules/gui/macosx/coredialogs.m
+7
-12
modules/gui/macosx/eyetv.m
modules/gui/macosx/eyetv.m
+16
-13
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-1
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+11
-18
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+6
-9
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+2
-2
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs.m
+11
-7
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+11
-9
modules/gui/macosx/wizard.m
modules/gui/macosx/wizard.m
+6
-10
No files found.
modules/gui/macosx/AppleRemote.m
View file @
5fb6cff9
...
...
@@ -66,17 +66,20 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
#pragma public interface
static
AppleRemote
*
_o_sharedInstance
=
nil
;
+
(
AppleRemote
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
AppleRemote
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
AppleRemote
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
_openInExclusiveMode
=
YES
;
queue
=
NULL
;
hidDeviceInterface
=
NULL
;
...
...
@@ -107,9 +110,6 @@ static AppleRemote *_o_sharedInstance = nil;
/* defaults */
_simulatesPlusMinusHold
=
YES
;
_maximumClickCountTimeDifference
=
DEFAULT_MAXIMUM_CLICK_TIME_DIFFERENCE
;
}
return
_o_sharedInstance
;
}
-
(
void
)
dealloc
{
...
...
modules/gui/macosx/AudioEffects.m
View file @
5fb6cff9
...
...
@@ -51,11 +51,17 @@
#pragma mark Initialization
@implementation
VLCAudioEffects
static
VLCAudioEffects
*
_o_sharedInstance
=
nil
;
+
(
VLCAudioEffects
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
VLCAudioEffects
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCAudioEffects
new
];
});
return
sharedInstance
;
}
+
(
void
)
initialize
{
...
...
@@ -94,13 +100,10 @@ static VLCAudioEffects *_o_sharedInstance = nil;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
self
=
[
super
init
];
p_intf
=
VLCIntf
;
i_old_profile_index
=
-
1
;
_o_sharedInstance
=
[
super
init
];
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/ConvertAndSave.m
View file @
5fb6cff9
...
...
@@ -65,8 +65,6 @@
@implementation
VLCConvertAndSave
static
VLCConvertAndSave
*
_o_sharedInstance
=
nil
;
#pragma mark -
#pragma mark Initialization
...
...
@@ -120,15 +118,14 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
+
(
VLCConvertAndSave
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCConvertAndSave
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
_o_sharedInstance
=
[
super
init
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCConvertAndSave
new
];
});
return
_o_
sharedInstance
;
return
sharedInstance
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/CoreInteraction.m
View file @
5fb6cff9
...
...
@@ -47,21 +47,19 @@
@end
@implementation
VLCCoreInteraction
static
VLCCoreInteraction
*
_o_sharedInstance
=
nil
;
+
(
VLCCoreInteraction
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
}
#pragma mark - Initialization
-
(
id
)
init
+
(
VLCCoreInteraction
*
)
sharedInstance
{
if
(
!
_o_sharedInstance
)
_o_sharedInstance
=
[
super
init
];
static
VLCCoreInteraction
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCCoreInteraction
new
];
});
return
_o_
sharedInstance
;
return
sharedInstance
;
}
-
(
void
)
dealloc
...
...
modules/gui/macosx/DebugMessageVisualizer.m
View file @
5fb6cff9
...
...
@@ -64,23 +64,27 @@ static void MsgCallback(void *data, int type, const vlc_log_t *item, const char
@implementation
VLCDebugMessageVisualizer
static
VLCDebugMessageVisualizer
*
_sharedMainInstance
=
nil
;
+
(
VLCDebugMessageVisualizer
*
)
sharedInstance
{
return
_sharedMainInstance
?
_sharedMainInstance
:
[[
self
alloc
]
init
];
static
VLCDebugMessageVisualizer
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCDebugMessageVisualizer
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_sharedMainInstance
)
{
_sharedMainInstance
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
_msg_lock
=
[[
NSLock
alloc
]
init
];
_msg_arr
=
[
NSMutableArray
arrayWithCapacity
:
600
];
BOOL
loaded
=
[
NSBundle
loadNibNamed
:
@"DebugMessageVisualizer"
owner
:
self
];
}
return
_sharedMainInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/ExtensionsDialogProvider.m
View file @
5fb6cff9
...
...
@@ -276,30 +276,36 @@ static int dialogCallback(vlc_object_t *p_this, const char *psz_variable,
@implementation
ExtensionsDialogProvider
static
ExtensionsDialogProvider
*
_o_
sharedInstance
=
nil
;
static
ExtensionsDialogProvider
*
sharedInstance
=
nil
;
+
(
ExtensionsDialogProvider
*
)
sharedInstance
:(
intf_thread_t
*
)
_p_intf
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
initWithIntf
:
_p_intf
];
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[[
ExtensionsDialogProvider
alloc
]
initWithIntf
:
_p_intf
];
});
return
sharedInstance
;
}
+
(
void
)
killInstance
{
_o_
sharedInstance
=
nil
;
sharedInstance
=
nil
;
}
-
(
id
)
initWithIntf
:(
intf_thread_t
*
)
_p_intf
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
p_intf
=
_p_intf
;
// The Cocoa interface already called dialog_Register()
var_Create
(
p_intf
,
"dialog-extension"
,
VLC_VAR_ADDRESS
);
var_AddCallback
(
p_intf
,
"dialog-extension"
,
dialogCallback
,
NULL
);
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
dealloc
...
...
modules/gui/macosx/InputManager.m
View file @
5fb6cff9
...
...
@@ -74,7 +74,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
break
;
case
INPUT_EVENT_STATISTICS
:
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[[
[
VLCMain
sharedInstance
]
info
]
updateStatistics
];
[[
VLCInfo
sharedInstance
]
updateStatistics
];
});
break
;
case
INPUT_EVENT_ES
:
...
...
@@ -395,14 +395,14 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
-
(
void
)
updateMetaAndInfo
{
if
(
!
p_current_input
)
{
[[
o_main
info
]
updatePanelWithItem
:
nil
];
[[
VLCInfo
sharedInstance
]
updatePanelWithItem
:
nil
];
return
;
}
input_item_t
*
p_input_item
=
input_GetItem
(
p_current_input
);
[[[
o_main
playlist
]
model
]
updateItem
:
p_input_item
];
[[
o_main
info
]
updatePanelWithItem
:
p_input_item
];
[[
VLCInfo
sharedInstance
]
updatePanelWithItem
:
p_input_item
];
}
-
(
void
)
updateMainWindow
...
...
modules/gui/macosx/MainMenu.m
View file @
5fb6cff9
...
...
@@ -55,7 +55,6 @@
@interface
VLCMainMenu
()
{
intf_thread_t
*
p_intf
;
BOOL
b_mainMenu_setup
;
BOOL
b_nib_videoeffects_loaded
;
BOOL
b_nib_audioeffects_loaded
;
...
...
@@ -81,20 +80,25 @@
@end
@implementation
VLCMainMenu
static
VLCMainMenu
*
_o_sharedInstance
=
nil
;
+
(
VLCMainMenu
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
VLCMainMenu
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCMainMenu
new
];
});
return
sharedInstance
;
}
#pragma mark - Initialization
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
o_ptc_translation_dict
=
[[
NSDictionary
alloc
]
initWithObjectsAndKeys
:
_NS
(
"Track Number"
),
TRACKNUM_COLUMN
,
_NS
(
"Title"
),
TITLE_COLUMN
,
...
...
@@ -114,8 +118,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
DESCRIPTION_COLUMN
,
DATE_COLUMN
,
LANGUAGE_COLUMN
,
URI_COLUMN
,
FILESIZE_COLUMN
,
nil
];
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
dealloc
...
...
@@ -143,8 +146,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
[
self
setRateControlsEnabled
:
NO
];
p_intf
=
VLCIntf
;
#ifdef HAVE_SPARKLE
[
o_mi_checkForUpdate
setAction
:
@selector
(
checkForUpdates
:)];
[
o_mi_checkForUpdate
setTarget
:[
SUUpdater
sharedUpdater
]];
...
...
@@ -167,6 +168,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
return
;
/* Get ExtensionsManager */
intf_thread_t
*
p_intf
=
VLCIntf
;
o_extMgr
=
[
ExtensionsManager
getInstance
:
p_intf
];
[
self
initStrings
];
...
...
@@ -332,7 +334,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
module_config_t
*
p_item
;
[
menu
removeAllItems
];
p_item
=
config_FindConfig
(
VLC_OBJECT
(
p_i
ntf
),
psz_name
);
p_item
=
config_FindConfig
(
VLC_OBJECT
(
VLCI
ntf
),
psz_name
);
/* serious problem, if no item found */
assert
(
p_item
);
...
...
@@ -344,7 +346,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
else
if
(
p_item
->
list
.
i
[
i
])
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
[
NSString
stringWithFormat
:
@"%d"
,
p_item
->
list
.
i
[
i
]]
action
:
NULL
keyEquivalent
:
@""
];
else
{
msg_Err
(
p_i
ntf
,
"item %d of pref %s failed to be created"
,
i
,
psz_name
);
msg_Err
(
VLCI
ntf
,
"item %d of pref %s failed to be created"
,
i
,
psz_name
);
continue
;
}
...
...
@@ -566,8 +568,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
-
(
void
)
releaseRepresentedObjects
:(
NSMenu
*
)
the_menu
{
if
(
!
p_intf
)
return
;
NSArray
*
menuitems_array
=
[
the_menu
itemArray
];
NSUInteger
menuItemCount
=
[
menuitems_array
count
];
for
(
NSUInteger
i
=
0
;
i
<
menuItemCount
;
i
++
)
{
...
...
@@ -583,7 +583,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
-
(
void
)
setupMenus
{
playlist_t
*
p_playlist
=
pl_Get
(
p_i
ntf
);
playlist_t
*
p_playlist
=
pl_Get
(
VLCI
ntf
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
(
p_input
!=
NULL
)
{
[
self
setupVarMenuItem
:
o_mi_program
target
:
(
vlc_object_t
*
)
p_input
...
...
@@ -792,7 +792,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
bool
b_value
=
!
var_CreateGetBool
(
p_playlist
,
"play-and-exit"
);
var_SetBool
(
p_playlist
,
"play-and-exit"
,
b_value
);
config_PutInt
(
p_i
ntf
,
"play-and-exit"
,
b_value
);
config_PutInt
(
VLCI
ntf
,
"play-and-exit"
,
b_value
);
}
-
(
IBAction
)
toggleRecord
:(
id
)
sender
...
...
@@ -926,7 +926,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
vout_thread_t
*
p_vout
=
getVoutForActiveWindow
();
if
(
p_vout
)
{
BOOL
b_fs
=
var_ToggleBool
(
p_vout
,
"video-on-top"
);
var_SetBool
(
pl_Get
(
p_i
ntf
),
"video-on-top"
,
b_fs
);
var_SetBool
(
pl_Get
(
VLCI
ntf
),
"video-on-top"
,
b_fs
);
vlc_object_release
(
p_vout
);
}
...
...
@@ -1030,7 +1030,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
int
intValue
=
[
sender
tag
];
NSString
*
representedObject
=
[
sender
representedObject
];
config_PutInt
(
p_i
ntf
,
[
representedObject
UTF8String
],
intValue
);
config_PutInt
(
VLCI
ntf
,
[
representedObject
UTF8String
],
intValue
);
NSMenu
*
menu
=
[
sender
menu
];
NSUInteger
count
=
(
NSUInteger
)
[
menu
numberOfItems
];
...
...
@@ -1041,7 +1041,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
-
(
IBAction
)
switchSubtitleBackgroundOpacity
:(
id
)
sender
{
config_PutInt
(
p_i
ntf
,
"freetype-background-opacity"
,
[
sender
intValue
]);
config_PutInt
(
VLCI
ntf
,
"freetype-background-opacity"
,
[
sender
intValue
]);
}
-
(
IBAction
)
telxTransparent
:(
id
)
sender
...
...
@@ -1272,7 +1272,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
-
(
IBAction
)
showInformationPanel
:(
id
)
sender
{
[[
[
VLCMain
sharedInstance
]
info
]
initPanel
];
[[
VLCInfo
sharedInstance
]
initPanel
];
}
#pragma mark - convinience stuff for other objects
...
...
@@ -1528,7 +1528,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSString
*
o_title
=
[
o_mi
title
];
BOOL
bEnabled
=
TRUE
;
vlc_value_t
val
;
playlist_t
*
p_playlist
=
pl_Get
(
p_i
ntf
);
playlist_t
*
p_playlist
=
pl_Get
(
VLCI
ntf
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
if
([
o_title
isEqualToString
:
_NS
(
"Stop"
)])
{
...
...
modules/gui/macosx/MainWindow.m
View file @
5fb6cff9
...
...
@@ -77,34 +77,32 @@ static const float f_min_window_height = 307.;
@implementation
VLCMainWindow
static
VLCMainWindow
*
_o_sharedInstance
=
nil
;
+
(
VLCMainWindow
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
}
#pragma mark -
#pragma mark Initialization
-
(
id
)
init
static
VLCMainWindow
*
sharedInstance
=
nil
;
+
(
VLCMainWindow
*
)
sharedInstance
{
if
(
!
_o_sharedInstance
)
_o_sharedInstance
=
[
super
init
];
return
_o_sharedInstance
;
return
sharedInstance
;
}
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
styleMask
:(
NSUInteger
)
styleMask
backing
:(
NSBackingStoreType
)
backingType
defer
:(
BOOL
)
flag
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
styleMask
:(
NSUInteger
)
styleMask
backing
:(
NSBackingStoreType
)
backingType
defer
:(
BOOL
)
flag
{
self
=
[
super
initWithContentRect
:
contentRect
styleMask
:
styleMask
backing:
backingType
defer
:
flag
];
_o_sharedInstance
=
self
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
super
initWithContentRect
:
contentRect
styleMask:
styleMask
backing:
backingType
defer:
flag
];
});
[[
VLCMain
sharedInstance
]
updateTogglePlaylistState
];
return
s
elf
;
return
s
haredInstance
;
}
-
(
BOOL
)
isEvent
:(
NSEvent
*
)
o_event
forKey
:(
const
char
*
)
keyString
...
...
modules/gui/macosx/SharedDialogs.m
View file @
5fb6cff9
...
...
@@ -23,21 +23,17 @@
#import "SharedDialogs.h"
static
VLCEnterTextPanel
*
_textPanelInstance
=
nil
;
static
VLCSelectItemInPopupPanel
*
_selectItemPanelInstance
=
nil
;
@implementation
VLCEnterTextPanel
+
(
VLCEnterTextPanel
*
)
sharedInstance
{
return
_textPanelInstance
?
_textPanelInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCEnterTextPanel
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_textPanelInstance
)
_textPanelInstance
=
[
super
init
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCEnterTextPanel
new
];
});
return
_textPanel
Instance
;
return
shared
Instance
;
}
-
(
IBAction
)
windowElementAction
:(
id
)
sender
...
...
@@ -77,15 +73,14 @@ static VLCSelectItemInPopupPanel *_selectItemPanelInstance = nil;
+
(
VLCSelectItemInPopupPanel
*
)
sharedInstance
{
return
_selectItemPanelInstance
?
_selectItemPanelInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCSelectItemInPopupPanel
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_selectItemPanelInstance
)
_selectItemPanelInstance
=
[
super
init
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCSelectItemInPopupPanel
new
];
});
return
_selectItemPanel
Instance
;
return
shared
Instance
;
}
-
(
IBAction
)
windowElementAction
:(
id
)
sender
...
...
modules/gui/macosx/StringUtility.m
View file @
5fb6cff9
...
...
@@ -33,19 +33,17 @@
@implementation
VLCStringUtility
static
VLCStringUtility
*
_o_sharedInstance
=
nil
;
+
(
VLCStringUtility
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCStringUtility
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
_o_sharedInstance
=
[
super
init
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCStringUtility
new
];
});
return
_o_
sharedInstance
;
return
sharedInstance
;
}
#pragma mark -
...
...
modules/gui/macosx/TrackSynchronization.m
View file @
5fb6cff9
...
...
@@ -41,21 +41,24 @@
@end
@implementation
VLCTrackSynchronization
static
VLCTrackSynchronization
*
_o_sharedInstance
=
nil
;
+
(
VLCTrackSynchronization
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
VLCTrackSynchronization
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCTrackSynchronization
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
self
=
[
super
init
];
p_intf
=
VLCIntf
;
_o_sharedInstance
=
[
super
init
];
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/VLCVoutWindowController.m
View file @
5fb6cff9
...
...
@@ -430,7 +430,7 @@
[[
VLCVideoEffects
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCAudioEffects
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
[
VLCMain
sharedInstance
]
info
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCInfo
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCBookmarks
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCTrackSynchronization
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[[
VLCMain
sharedInstance
]
resumeDialog
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
...
...
modules/gui/macosx/VideoEffects.m
View file @
5fb6cff9
...
...
@@ -39,11 +39,17 @@
#pragma mark Initialization
@implementation
VLCVideoEffects
static
VLCVideoEffects
*
_o_sharedInstance
=
nil
;
+
(
VLCVideoEffects
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
VLCVideoEffects
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCVideoEffects
new
];
});
return
sharedInstance
;
}
+
(
void
)
initialize
...
...
@@ -55,13 +61,11 @@ static VLCVideoEffects *_o_sharedInstance = nil;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
self
=
[
super
init
];
p_intf
=
VLCIntf
;
i_old_profile_index
=
-
1
;
_o_sharedInstance
=
[
super
init
];
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/bookmarks.m
View file @
5fb6cff9
...
...
@@ -47,19 +47,16 @@
@implementation
VLCBookmarks
static
VLCBookmarks
*
_o_sharedInstance
=
nil
;
+
(
VLCBookmarks
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCBookmarks
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
_o_sharedInstance
=
[
super
init
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCBookmarks
new
];
});
return
_o_
sharedInstance
;
return
sharedInstance
;
}
/*****************************************************************************
...
...
modules/gui/macosx/coredialogs.m
View file @
5fb6cff9
...
...
@@ -40,32 +40,27 @@
@implementation
VLCCoreDialogProvider
static
VLCCoreDialogProvider
*
_o_sharedInstance
=
nil
;
+
(
VLCCoreDialogProvider
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCCoreDialogProvider
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
_progressCancelled
=
NO
;
}
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCCoreDialogProvider
new
];
});
return
_o_
sharedInstance
;
return
sharedInstance
;
}
-
(
void
)
awakeFromNib
{
_progressCancelled
=
NO
;
[
o_auth_login_txt
setStringValue
:
_NS
(
"Username"
)];
[
o_auth_pw_txt
setStringValue
:
_NS
(
"Password"
)];
[
o_auth_cancel_btn
setTitle
:
_NS
(
"Cancel"
)];
[
o_auth_ok_btn
setTitle
:
_NS
(
"OK"
)];
[
o_prog_cancel_btn
setTitle
:
_NS
(
"Cancel"
)];
[
o_prog_bar
setUsesThreadedAnimation
:
YES
];
}
-
(
void
)
performEventWithObject
:
(
NSValue
*
)
o_value
ofType
:
(
const
char
*
)
type
...
...
modules/gui/macosx/eyetv.m
View file @
5fb6cff9
...
...
@@ -30,27 +30,30 @@
@implementation
VLCEyeTVController
static
VLCEyeTVController
*
_o_sharedInstance
=
nil
;
+
(
VLCEyeTVController
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
VLCEyeTVController
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCEyeTVController
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
[[
NSDistributedNotificationCenter
defaultCenter
]
addObserver:
self
selector:
@selector
(
globalNotificationReceived
:)
name:
NULL
object:
@"VLCEyeTVSupport"
suspensionBehavior:
NSNotificationSuspensionBehaviorDeliverImmediately
];
addObserver:
self
selector:
@selector
(
globalNotificationReceived
:)
name:
NULL
object:
@"VLCEyeTVSupport"
suspensionBehavior:
NSNotificationSuspensionBehaviorDeliverImmediately
];
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
globalNotificationReceived
:
(
NSNotification
*
)
theNotification
...
...
modules/gui/macosx/intf.h
View file @
5fb6cff9
...
...
@@ -92,7 +92,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-
(
id
)
simplePreferences
;
-
(
id
)
preferences
;
-
(
VLCPlaylist
*
)
playlist
;
-
(
VLCInfo
*
)
info
;
-
(
id
)
wizard
;
-
(
id
)
coreDialogProvider
;
-
(
ResumeDialogController
*
)
resumeDialog
;
...
...
modules/gui/macosx/intf.m
View file @
5fb6cff9
...
...
@@ -544,17 +544,21 @@ audio_output_t *getAout(void)
#pragma mark -
#pragma mark Initialization
static
VLCMain
*
_o_sharedMainInstance
=
nil
;
+
(
VLCMain
*
)
sharedInstance
{
return
_o_sharedMainInstance
?
_o_sharedMainInstance
:
[[
self
alloc
]
init
];
static
VLCMain
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCMain
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_o_sharedMainInstance
)
_o_sharedMainInstance
=
[
super
init
];
self
=
[
super
init
];
p_intf
=
NULL
;
...
...
@@ -576,7 +580,7 @@ static VLCMain *_o_sharedMainInstance = nil;
_voutController
=
[[
VLCVoutWindowController
alloc
]
init
];
return
_o_sharedMainInstance
;
return
self
;
}
-
(
void
)
setIntf
:
(
intf_thread_t
*
)
p_mainintf
...
...
@@ -641,7 +645,7 @@ static VLCMain *_o_sharedMainInstance = nil;
/* init Apple Remote support */
o_remote
=
[[
AppleRemote
alloc
]
init
];
[
o_remote
setClickCountEnabledButtons
:
kRemoteButtonPlay
];
[
o_remote
setDelegate
:
_o_sharedMainInstance
];
[
o_remote
setDelegate
:
self
];
/* yeah, we are done */
_nativeFullscreenMode
=
NO
;
...
...
@@ -1312,17 +1316,6 @@ static VLCMain *_o_sharedMainInstance = nil;
return
o_playlist
;
}
-
(
VLCInfo
*
)
info
{
if
(
!
o_info
)
o_info
=
[[
VLCInfo
alloc
]
init
];
if
(
!
nib_info_loaded
)
nib_info_loaded
=
[
NSBundle
loadNibNamed
:
@"MediaInfo"
owner
:
NSApp
];
return
o_info
;
}
-
(
id
)
wizard
{
if
(
!
o_wizard
)
...
...
modules/gui/macosx/open.m
View file @
5fb6cff9
...
...
@@ -97,19 +97,16 @@ struct display_info_t
#pragma mark -
#pragma mark Init
static
VLCOpen
*
_o_sharedMainInstance
=
nil
;
+
(
VLCOpen
*
)
sharedInstance
{
return
_o_sharedMainInstance
?
_o_sharedMainInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCOpen
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_o_sharedMainInstance
)
_o_sharedMainInstance
=
[
super
init
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCOpen
new
];
});
return
_o_sharedMain
Instance
;
return
shared
Instance
;
}
-
(
void
)
dealloc
...
...
modules/gui/macosx/playlist.m
View file @
5fb6cff9
...
...
@@ -330,7 +330,7 @@
// }
//
// /* update our info-panel to reflect the new item */
// [[
[VLCMain sharedInstance] info
] updatePanelWithItem:p_item->p_input];
// [[
VLCInfo sharedInstance
] updatePanelWithItem:p_item->p_input];
// }
}
...
...
@@ -542,7 +542,7 @@
-
(
IBAction
)
showInfoPanel
:(
id
)
sender
{
[[
[
VLCMain
sharedInstance
]
info
]
initPanel
];
[[
VLCInfo
sharedInstance
]
initPanel
];
}
-
(
void
)
deletionCompleted
...
...
modules/gui/macosx/prefs.m
View file @
5fb6cff9
...
...
@@ -156,23 +156,27 @@
@implementation
VLCPrefs
static
VLCPrefs
*
_o_sharedMainInstance
=
nil
;
+
(
VLCPrefs
*
)
sharedInstance
{
return
_o_sharedMainInstance
?
_o_sharedMainInstance
:
[[
self
alloc
]
init
];
static
VLCPrefs
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCPrefs
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_o_sharedMainInstance
)
{
_o_sharedMainInstance
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
p_intf
=
VLCIntf
;
o_empty_view
=
[[
NSView
alloc
]
init
];
_rootTreeItem
=
[[
VLCTreeMainItem
alloc
]
init
];
}
return
_o_sharedMainInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/simple_prefs.m
View file @
5fb6cff9
...
...
@@ -202,23 +202,25 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id
@implementation
VLCSimplePrefs
static
VLCSimplePrefs
*
_o_sharedInstance
=
nil
;
#pragma mark Initialisation
+
(
VLCSimplePrefs
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
];
static
VLCSimplePrefs
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCSimplePrefs
new
];
});
return
sharedInstance
;
}
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
self
=
[
super
init
];
p_intf
=
VLCIntf
;
}
return
_o_sharedInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
...
...
modules/gui/macosx/wizard.m
View file @
5fb6cff9
...
...
@@ -55,20 +55,16 @@
@implementation
VLCWizard
static
VLCWizard
*
_o_sharedInstance
=
nil
;
+
(
VLCWizard
*
)
sharedInstance
{
return
_o_sharedInstance
?
_o_sharedInstance
:
[[
self
alloc
]
init
]
;
}
static
VLCWizard
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
-
(
id
)
init
{
if
(
!
_o_sharedInstance
)
{
_o_sharedInstance
=
[
super
init
];
}
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCWizard
new
];
});
return
_o_
sharedInstance
;
return
sharedInstance
;
}
-
(
void
)
awakeFromNib
...
...
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