mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
macosx: implemented A->B Loop (close #5187)
This commit is contained in:
parent
2974427561
commit
6ebb704940
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
@interface VLCCoreInteraction : NSObject {
|
@interface VLCCoreInteraction : NSObject {
|
||||||
int i_currentPlaybackRate;
|
int i_currentPlaybackRate;
|
||||||
|
mtime_t timeA, timeB;
|
||||||
}
|
}
|
||||||
+ (VLCCoreInteraction *)sharedInstance;
|
+ (VLCCoreInteraction *)sharedInstance;
|
||||||
@property (readwrite) int volume;
|
@property (readwrite) int volume;
|
||||||
@ -61,6 +62,8 @@
|
|||||||
- (void)repeatAll;
|
- (void)repeatAll;
|
||||||
- (void)repeatOff;
|
- (void)repeatOff;
|
||||||
- (void)shuffle;
|
- (void)shuffle;
|
||||||
|
- (void)setAtoB;
|
||||||
|
- (void)updateAtoB;
|
||||||
|
|
||||||
- (void)volumeUp;
|
- (void)volumeUp;
|
||||||
- (void)volumeDown;
|
- (void)volumeDown;
|
||||||
|
@ -417,6 +417,39 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setAtoB
|
||||||
|
{
|
||||||
|
if (!timeA) {
|
||||||
|
input_thread_t * p_input = pl_CurrentInput(VLCIntf);
|
||||||
|
if (p_input) {
|
||||||
|
timeA = var_GetTime(p_input, "time");
|
||||||
|
vlc_object_release(p_input);
|
||||||
|
}
|
||||||
|
} else if (!timeB) {
|
||||||
|
input_thread_t * p_input = pl_CurrentInput(VLCIntf);
|
||||||
|
if (p_input) {
|
||||||
|
timeB = var_GetTime(p_input, "time");
|
||||||
|
vlc_object_release(p_input);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
timeA = 0;
|
||||||
|
timeB = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)updateAtoB
|
||||||
|
{
|
||||||
|
if (timeB) {
|
||||||
|
input_thread_t * p_input = pl_CurrentInput(VLCIntf);
|
||||||
|
if (p_input) {
|
||||||
|
mtime_t currentTime = var_GetTime(p_input, "time");
|
||||||
|
if ( currentTime >= timeB || currentTime < timeA)
|
||||||
|
var_SetTime(p_input, "time", timeA);
|
||||||
|
vlc_object_release(p_input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)volumeUp
|
- (void)volumeUp
|
||||||
{
|
{
|
||||||
intf_thread_t *p_intf = VLCIntf;
|
intf_thread_t *p_intf = VLCIntf;
|
||||||
|
@ -102,6 +102,7 @@
|
|||||||
IBOutlet NSMenuItem * o_mi_random;
|
IBOutlet NSMenuItem * o_mi_random;
|
||||||
IBOutlet NSMenuItem * o_mi_repeat;
|
IBOutlet NSMenuItem * o_mi_repeat;
|
||||||
IBOutlet NSMenuItem * o_mi_loop;
|
IBOutlet NSMenuItem * o_mi_loop;
|
||||||
|
IBOutlet NSMenuItem * o_mi_AtoBloop;
|
||||||
IBOutlet NSMenuItem * o_mi_quitAfterPB;
|
IBOutlet NSMenuItem * o_mi_quitAfterPB;
|
||||||
IBOutlet NSMenuItem * o_mi_fwd;
|
IBOutlet NSMenuItem * o_mi_fwd;
|
||||||
IBOutlet NSMenuItem * o_mi_bwd;
|
IBOutlet NSMenuItem * o_mi_bwd;
|
||||||
@ -231,6 +232,7 @@
|
|||||||
- (void)updateRecordState:(BOOL)b_value;
|
- (void)updateRecordState:(BOOL)b_value;
|
||||||
- (IBAction)setPlaybackRate:(id)sender;
|
- (IBAction)setPlaybackRate:(id)sender;
|
||||||
- (void)updatePlaybackRate;
|
- (void)updatePlaybackRate;
|
||||||
|
- (IBAction)toggleAtoBloop:(id)sender;
|
||||||
|
|
||||||
- (IBAction)toggleFullscreen:(id)sender;
|
- (IBAction)toggleFullscreen:(id)sender;
|
||||||
- (IBAction)resizeVideoWindow:(id)sender;
|
- (IBAction)resizeVideoWindow:(id)sender;
|
||||||
|
@ -320,6 +320,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
|
|||||||
[o_mi_random setTitle: _NS("Random")];
|
[o_mi_random setTitle: _NS("Random")];
|
||||||
[o_mi_repeat setTitle: _NS("Repeat One")];
|
[o_mi_repeat setTitle: _NS("Repeat One")];
|
||||||
[o_mi_loop setTitle: _NS("Repeat All")];
|
[o_mi_loop setTitle: _NS("Repeat All")];
|
||||||
|
[o_mi_AtoBloop setTitle: _NS("A→B Loop")];
|
||||||
[o_mi_quitAfterPB setTitle: _NS("Quit after Playback")];
|
[o_mi_quitAfterPB setTitle: _NS("Quit after Playback")];
|
||||||
[o_mi_fwd setTitle: _NS("Step Forward")];
|
[o_mi_fwd setTitle: _NS("Step Forward")];
|
||||||
[o_mi_bwd setTitle: _NS("Step Backward")];
|
[o_mi_bwd setTitle: _NS("Step Backward")];
|
||||||
@ -693,6 +694,11 @@ static VLCMainMenu *_o_sharedInstance = nil;
|
|||||||
[o_mi_rate_sld setIntValue: i];
|
[o_mi_rate_sld setIntValue: i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)toggleAtoBloop:(id)sender
|
||||||
|
{
|
||||||
|
[[VLCCoreInteraction sharedInstance] setAtoB];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark video menu
|
#pragma mark video menu
|
||||||
|
|
||||||
|
@ -1328,6 +1328,7 @@ static VLCMain *_o_sharedMainInstance = nil;
|
|||||||
- (void)updatePlaybackPosition
|
- (void)updatePlaybackPosition
|
||||||
{
|
{
|
||||||
[o_mainwindow updateTimeSlider];
|
[o_mainwindow updateTimeSlider];
|
||||||
|
[[VLCCoreInteraction sharedInstance] updateAtoB];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateVolume
|
- (void)updateVolume
|
||||||
|
Loading…
Reference in New Issue
Block a user