diff --git a/Application/AppController.m b/Application/AppController.m index 5a55582be..713d725ba 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -754,12 +754,18 @@ static NSUserDefaultsController *shortcutDefaultsController = nil; modifierFlags:NSEventModifierFlagControl | NSEventModifierFlagCommand]; MASShortcut *fadeShortcut = [MASShortcut shortcutWithKeyCode:kVK_ANSI_O modifierFlags:NSEventModifierFlagControl | NSEventModifierFlagCommand]; + MASShortcut *seekBkwdShortcut = [MASShortcut shortcutWithKeyCode:kVK_LeftArrow + modifierFlags:NSEventModifierFlagControl | NSEventModifierFlagCommand]; + MASShortcut *seekFwdShortcut = [MASShortcut shortcutWithKeyCode:kVK_RightArrow + modifierFlags:NSEventModifierFlagControl | NSEventModifierFlagCommand]; NSData *playShortcutData = [NSKeyedArchiver archivedDataWithRootObject:playShortcut]; NSData *nextShortcutData = [NSKeyedArchiver archivedDataWithRootObject:nextShortcut]; NSData *prevShortcutData = [NSKeyedArchiver archivedDataWithRootObject:prevShortcut]; NSData *spamShortcutData = [NSKeyedArchiver archivedDataWithRootObject:spamShortcut]; NSData *fadeShortcutData = [NSKeyedArchiver archivedDataWithRootObject:fadeShortcut]; + NSData *seekBkwdShortcutData = [NSKeyedArchiver archivedDataWithRootObject:seekBkwdShortcut]; + NSData *seekFwdShortcutData = [NSKeyedArchiver archivedDataWithRootObject:seekFwdShortcut]; // Register default values to be used for the first app start NSDictionary *defaultShortcuts = @{ @@ -767,10 +773,11 @@ static NSUserDefaultsController *shortcutDefaultsController = nil; CogNextShortcutKey: nextShortcutData, CogPrevShortcutKey: prevShortcutData, CogSpamShortcutKey: spamShortcutData, - CogFadeShortcutKey: fadeShortcutData + CogFadeShortcutKey: fadeShortcutData, + CogSeekBackwardShortcutKey: seekBkwdShortcutData, + CogSeekForwardShortcutKey: seekFwdShortcutData }; - [[NSUserDefaults standardUserDefaults] registerDefaults:defaultShortcuts]; shortcutDefaultsController = [[NSUserDefaultsController sharedUserDefaultsController] initWithDefaults:nil initialValues:defaultShortcuts]; } @@ -804,6 +811,16 @@ static NSUserDefaultsController *shortcutDefaultsController = nil; toAction:^{ [self clickFade]; }]; + + [binder bindShortcutWithDefaultsKey:CogSeekBackwardShortcutKey + toAction:^{ + [self clickSeekBack]; + }]; + + [binder bindShortcutWithDefaultsKey:CogSeekForwardShortcutKey + toAction:^{ + [self clickSeekForward]; + }]; } - (void)clickPlay { @@ -838,6 +855,14 @@ static NSUserDefaultsController *shortcutDefaultsController = nil; [playbackController seek:self toTime:position]; } +- (void)clickSeekBack { + [playbackController seekBackward:10.0]; +} + +- (void)clickSeekForward { + [playbackController seekForward:10.0]; +} + - (void)changeFontSize:(float)size { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; float fCurrentSize = [defaults floatForKey:@"fontSize"]; diff --git a/Preferences/Preferences/Base.lproj/Preferences.xib b/Preferences/Preferences/Base.lproj/Preferences.xib index 163bad74a..bf1c0168c 100644 --- a/Preferences/Preferences/Base.lproj/Preferences.xib +++ b/Preferences/Preferences/Base.lproj/Preferences.xib @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -144,16 +144,18 @@ + + - + - - + + @@ -162,11 +164,11 @@ - + - - + + @@ -175,11 +177,11 @@ - + - - + + @@ -188,11 +190,11 @@ - + - - + + @@ -201,11 +203,11 @@ - + - - + + @@ -214,7 +216,33 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -358,7 +386,7 @@ - + @@ -464,7 +492,7 @@ - + @@ -503,7 +531,7 @@ - + @@ -538,7 +566,7 @@ - + @@ -707,7 +735,7 @@ - + @@ -728,7 +756,7 @@ - + @@ -788,7 +816,7 @@ - + @@ -797,7 +825,7 @@ - + @@ -814,7 +842,7 @@ - + @@ -844,7 +872,7 @@ - + @@ -874,7 +902,7 @@ - + @@ -904,7 +932,7 @@ - + @@ -913,7 +941,7 @@ - + @@ -929,7 +957,7 @@ - + @@ -938,7 +966,7 @@ - + @@ -947,7 +975,7 @@ - + @@ -963,7 +991,7 @@ - + @@ -972,7 +1000,7 @@ - + @@ -981,7 +1009,7 @@ - + @@ -994,7 +1022,7 @@ - + @@ -1003,7 +1031,7 @@ - + @@ -1012,7 +1040,7 @@ - + @@ -1025,7 +1053,7 @@ - + @@ -1172,7 +1200,7 @@ - + @@ -1203,7 +1231,7 @@ - + @@ -1245,7 +1273,7 @@ - + @@ -1287,7 +1315,7 @@ - + @@ -1329,7 +1357,7 @@ - + @@ -1371,7 +1399,7 @@ - + @@ -1413,7 +1441,7 @@ - + @@ -1455,7 +1483,7 @@ - + @@ -1497,7 +1525,7 @@ - + diff --git a/Preferences/Preferences/HotKeyPane.h b/Preferences/Preferences/HotKeyPane.h index cc767d689..777889872 100644 --- a/Preferences/Preferences/HotKeyPane.h +++ b/Preferences/Preferences/HotKeyPane.h @@ -17,6 +17,8 @@ @property(strong) IBOutlet MASShortcutView *prevShortcutView; @property(strong) IBOutlet MASShortcutView *spamShortcutView; @property(strong) IBOutlet MASShortcutView *fadeShortcutView; +@property(strong) IBOutlet MASShortcutView *seekBkwdShortcutView; +@property(strong) IBOutlet MASShortcutView *seekFwdShortcutView; - (IBAction)resetToDefaultShortcuts:(id)sender; diff --git a/Preferences/Preferences/HotKeyPane.m b/Preferences/Preferences/HotKeyPane.m index e7fe2a513..f747d55e8 100644 --- a/Preferences/Preferences/HotKeyPane.m +++ b/Preferences/Preferences/HotKeyPane.m @@ -22,6 +22,8 @@ _prevShortcutView.associatedUserDefaultsKey = CogPrevShortcutKey; _spamShortcutView.associatedUserDefaultsKey = CogSpamShortcutKey; _fadeShortcutView.associatedUserDefaultsKey = CogFadeShortcutKey; + _seekBkwdShortcutView.associatedUserDefaultsKey = CogSeekBackwardShortcutKey; + _seekFwdShortcutView.associatedUserDefaultsKey = CogSeekForwardShortcutKey; } - (NSString *)title { diff --git a/Preferences/Preferences/en.lproj/Preferences.strings b/Preferences/Preferences/en.lproj/Preferences.strings index bc47ea3a4..4b3c5dc31 100644 --- a/Preferences/Preferences/en.lproj/Preferences.strings +++ b/Preferences/Preferences/en.lproj/Preferences.strings @@ -122,6 +122,12 @@ /* Class = "NSTextFieldCell"; title = "Copy now playing:"; ObjectID = "SMd-GA-jrH"; */ "SMd-GA-jrH.title" = "Copy now playing:"; +/* Class = "NSTextFieldCell"; title = "Seek backward:"; ObjectID = "2Jq-rQ-73W"; */ +"2Jq-rQ-73W.title" = "Seek backward:"; + +/* Class = "NSTextFieldCell"; title = "Seek forward:"; ObjectID = "fDI-hi-ZTg"; */ +"fDI-hi-ZTg.title" = "Seek forward:"; + /* Class = "NSMenu"; title = "OtherViews"; ObjectID = "V8o-Xy-HUW"; */ "V8o-Xy-HUW.title" = "OtherViews"; diff --git a/Preferences/Preferences/es.lproj/Preferences.strings b/Preferences/Preferences/es.lproj/Preferences.strings index 044a522c0..cf7109ea9 100644 --- a/Preferences/Preferences/es.lproj/Preferences.strings +++ b/Preferences/Preferences/es.lproj/Preferences.strings @@ -118,6 +118,12 @@ /* Class = "NSTextFieldCell"; title = "Copy now playing:"; ObjectID = "SMd-GA-jrH"; */ "SMd-GA-jrH.title" = "Copiar info de pista actual:"; +/* Class = "NSTextFieldCell"; title = "Seek backward:"; ObjectID = "2Jq-rQ-73W"; */ +"2Jq-rQ-73W.title" = "Retroceder:"; + +/* Class = "NSTextFieldCell"; title = "Seek forward:"; ObjectID = "fDI-hi-ZTg"; */ +"fDI-hi-ZTg.title" = "Avanzar:"; + /* Class = "NSMenu"; title = "OtherViews"; ObjectID = "V8o-Xy-HUW"; */ "V8o-Xy-HUW.title" = "Otras vistas"; diff --git a/Preferences/Shortcuts.h b/Preferences/Shortcuts.h index 895887f58..0b0b2f3c9 100644 --- a/Preferences/Shortcuts.h +++ b/Preferences/Shortcuts.h @@ -10,3 +10,5 @@ static NSString *const CogNextShortcutKey = @"cogNextShortcut"; static NSString *const CogPrevShortcutKey = @"cogPrevShortcut"; static NSString *const CogSpamShortcutKey = @"cogSpamShortcut"; static NSString *const CogFadeShortcutKey = @"cogFadeShortcut"; +static NSString *const CogSeekBackwardShortcutKey = @"cogSeekBackwardShortcut"; +static NSString *const CogSeekForwardShortcutKey = @"cogSeekForwardShortcut";