Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
58a23fb8
Commit
58a23fb8
authored
Jul 27, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: store counting mode of the time field (default is to count up)
Fixes #3078
parent
df7cc617
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
11 deletions
+23
-11
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.h
+0
-2
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+4
-8
modules/gui/macosx/misc.h
modules/gui/macosx/misc.h
+1
-0
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+18
-1
No files found.
modules/gui/macosx/MainWindow.h
View file @
58a23fb8
...
...
@@ -59,7 +59,6 @@
BOOL
b_dark_interface
;
BOOL
b_video_playback_enabled
;
BOOL
b_time_remaining
;
int
i_lastShownVolume
;
BOOL
b_mute
;
input_state_e
cachedInputState
;
...
...
@@ -94,7 +93,6 @@
-
(
IBAction
)
repeat
:(
id
)
sender
;
-
(
IBAction
)
shuffle
:(
id
)
sender
;
-
(
IBAction
)
timeSliderAction
:(
id
)
sender
;
-
(
IBAction
)
timeFieldWasClicked
:(
id
)
sender
;
-
(
IBAction
)
volumeAction
:(
id
)
sender
;
-
(
IBAction
)
effects
:(
id
)
sender
;
-
(
IBAction
)
fullscreen
:(
id
)
sender
;
...
...
modules/gui/macosx/MainWindow.m
View file @
58a23fb8
...
...
@@ -29,6 +29,7 @@
#import "CoreInteraction.h"
#import "AudioEffects.h"
#import "MainMenu.h"
#import "misc.h"
#import "controls.h" // TODO: remove me
#import <vlc_playlist.h>
#import <vlc_aout_intf.h>
...
...
@@ -415,7 +416,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
var_Get
(
p_input
,
"time"
,
&
time
);
mtime_t
dur
=
input_item_GetDuration
(
input_GetItem
(
p_input
)
);
if
(
b_time_remaining
&&
dur
!=
-
1
)
if
(
[
o_time_fld
timeRemaining
]
&&
dur
!=
-
1
)
{
o_time
=
[
NSString
stringWithFormat
:
@"-%s"
,
secstotimestr
(
psz_time
,
((
dur
-
time
.
i_time
)
/
1000000
)
)];
}
...
...
@@ -429,12 +430,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
self
drawFancyGradientEffectForTimeSlider
];
}
-
(
IBAction
)
timeFieldWasClicked
:(
id
)
sender
{
b_time_remaining
=
!
b_time_remaining
;
NSLog
(
@"b_time_remaining %i"
,
b_time_remaining
);
}
-
(
IBAction
)
volumeAction
:(
id
)
sender
{
if
(
sender
==
o_volume_sld
)
...
...
@@ -477,7 +472,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
var_Get
(
p_input
,
"time"
,
&
time
);
mtime_t
dur
=
input_item_GetDuration
(
input_GetItem
(
p_input
)
);
if
(
b_time_remaining
&&
dur
!=
-
1
)
if
(
[
o_time_fld
timeRemaining
]
&&
dur
!=
-
1
)
{
o_time
=
[
NSString
stringWithFormat
:
@"-%s"
,
secstotimestr
(
psz_time
,
((
dur
-
time
.
i_time
)
/
1000000
))];
}
...
...
@@ -485,6 +480,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
o_time
=
[
NSString
stringWithUTF8String
:
secstotimestr
(
psz_time
,
(
time
.
i_time
/
1000000
)
)];
[
o_time_fld
setStringValue
:
o_time
];
[
o_time_fld
setNeedsDisplay
:
YES
];
// [[[[VLCMain sharedInstance] controls] fspanel] setStreamPos: f_updated andTime: o_time];
}
else
...
...
modules/gui/macosx/misc.h
View file @
58a23fb8
...
...
@@ -146,4 +146,5 @@
@interface
VLCTimeField
:
NSTextField
{
}
-
(
BOOL
)
timeRemaining
;
@end
modules/gui/macosx/misc.m
View file @
58a23fb8
...
...
@@ -658,11 +658,28 @@ void _drawFrameInRect(NSRect frameRect)
*****************************************************************************/
@implementation
VLCTimeField
+
(
void
)
initialize
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSDictionary
*
appDefaults
=
[
NSDictionary
dictionaryWithObject
:
@"NO"
forKey
:
@"DisplayTimeAsTimeRemaining"
];
[
defaults
registerDefaults
:
appDefaults
];
}
-
(
void
)
mouseDown
:
(
NSEvent
*
)
ourEvent
{
if
(
[
ourEvent
clickCount
]
>
1
)
[[[
VLCMain
sharedInstance
]
controls
]
goToSpecificTime
:
nil
];
else
[[
VLCMainWindow
sharedInstance
]
timeFieldWasClicked
:
self
];
{
if
([[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
@"DisplayTimeAsTimeRemaining"
])
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@"NO"
forKey
:
@"DisplayTimeAsTimeRemaining"
];
else
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@"YES"
forKey
:
@"DisplayTimeAsTimeRemaining"
];
}
}
-
(
BOOL
)
timeRemaining
{
return
[[
NSUserDefaults
standardUserDefaults
]
boolForKey
:
@"DisplayTimeAsTimeRemaining"
];
}
@end
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