diff --git a/Application/AppController.m b/Application/AppController.m index ecbfda20d..341ecbe49 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -729,12 +729,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 = @{ @@ -742,10 +748,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]; } @@ -779,6 +786,16 @@ static NSUserDefaultsController *shortcutDefaultsController = nil; toAction:^{ [self clickFade]; }]; + + [binder bindShortcutWithDefaultsKey:CogSeekBackwardShortcutKey + toAction:^{ + [self clickSeekBack]; + }]; + + [binder bindShortcutWithDefaultsKey:CogSeekForwardShortcutKey + toAction:^{ + [self clickSeekForward]; + }]; } - (void)clickPlay { @@ -813,6 +830,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 fc391cd66..f92bb8749 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 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -340,7 +368,7 @@ - + @@ -446,7 +474,7 @@ - + @@ -485,7 +513,7 @@ - + @@ -520,7 +548,7 @@ - + @@ -689,7 +717,7 @@ - + @@ -710,7 +738,7 @@ - + @@ -770,7 +798,7 @@ - + @@ -779,7 +807,7 @@ - + @@ -796,7 +824,7 @@ - + @@ -826,7 +854,7 @@ - + @@ -856,7 +884,7 @@ - + @@ -886,7 +914,7 @@ - + @@ -895,7 +923,7 @@ - + @@ -911,7 +939,7 @@ - + @@ -920,7 +948,7 @@ - + @@ -929,7 +957,7 @@ - + @@ -945,7 +973,7 @@ - + @@ -954,7 +982,7 @@ - + @@ -963,7 +991,7 @@ - + @@ -976,7 +1004,7 @@ - + @@ -985,7 +1013,7 @@ - + @@ -994,7 +1022,7 @@ - + @@ -1007,7 +1035,7 @@ - + @@ -1154,7 +1182,7 @@ - + @@ -1185,7 +1213,7 @@ - + @@ -1227,7 +1255,7 @@ - + @@ -1269,7 +1297,7 @@ - + @@ -1311,7 +1339,7 @@ - + @@ -1353,7 +1381,7 @@ - + @@ -1395,7 +1423,7 @@ - + @@ -1437,7 +1465,7 @@ - + @@ -1479,7 +1507,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";