diff --git a/Application/AppController.m b/Application/AppController.m index bfa497b1a..d6989fdd8 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -658,6 +658,11 @@ static AppController *kAppController = nil; toAction:^{ [self clickSpam]; }]; + + [binder bindShortcutWithDefaultsKey:CogFadeShortcutKey + toAction:^{ + [self clickFade]; + }]; } - (void)clickPlay { @@ -684,6 +689,10 @@ static AppController *kAppController = nil; [playbackController spam:nil]; } +- (void)clickFade { + [playbackController fade:nil]; +} + - (void)clickSeek:(NSTimeInterval)position { [playbackController seek:self toTime:position]; } diff --git a/Preferences/Preferences/Base.lproj/Preferences.xib b/Preferences/Preferences/Base.lproj/Preferences.xib index 66c51b9ba..214f0f650 100644 --- a/Preferences/Preferences/Base.lproj/Preferences.xib +++ b/Preferences/Preferences/Base.lproj/Preferences.xib @@ -133,6 +133,7 @@ + @@ -141,7 +142,7 @@ - + - + @@ -165,7 +166,7 @@ - + @@ -174,7 +175,7 @@ - + @@ -183,7 +184,7 @@ - + @@ -192,23 +193,36 @@ - + - + - + - + + + + + + + + + + + + + + - + @@ -418,7 +432,7 @@ - + @@ -453,7 +467,7 @@ - + diff --git a/Preferences/Preferences/HotKeyPane.h b/Preferences/Preferences/HotKeyPane.h index ede8d382f..cc767d689 100644 --- a/Preferences/Preferences/HotKeyPane.h +++ b/Preferences/Preferences/HotKeyPane.h @@ -16,6 +16,7 @@ @property(strong) IBOutlet MASShortcutView *nextShortcutView; @property(strong) IBOutlet MASShortcutView *prevShortcutView; @property(strong) IBOutlet MASShortcutView *spamShortcutView; +@property(strong) IBOutlet MASShortcutView *fadeShortcutView; - (IBAction)resetToDefaultShortcuts:(id)sender; diff --git a/Preferences/Preferences/HotKeyPane.m b/Preferences/Preferences/HotKeyPane.m index 87c65d866..7102b77f7 100644 --- a/Preferences/Preferences/HotKeyPane.m +++ b/Preferences/Preferences/HotKeyPane.m @@ -48,18 +48,24 @@ MASShortcut *shortcutWithMigration(NSString *oldKeyCodePrefName, @"hotKeySpamModifiers", CogSpamShortcutKey, kVK_ANSI_C); + MASShortcut *fadeShortcut = shortcutWithMigration(@"hotKeyFadeKeyCode", + @"hotKeyFadeModifiers", + CogFadeShortcutKey, + kVK_ANSI_O); 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]; // Register default values to be used for the first app start NSDictionary *defaultShortcuts = @{ CogPlayShortcutKey: playShortcutData, CogNextShortcutKey: nextShortcutData, CogPrevShortcutKey: prevShortcutData, - CogSpamShortcutKey: spamShortcutData + CogSpamShortcutKey: spamShortcutData, + CogFadeShortcutKey: fadeShortcutData }; defaultsController = @@ -70,6 +76,7 @@ MASShortcut *shortcutWithMigration(NSString *oldKeyCodePrefName, _nextShortcutView.associatedUserDefaultsKey = CogNextShortcutKey; _prevShortcutView.associatedUserDefaultsKey = CogPrevShortcutKey; _spamShortcutView.associatedUserDefaultsKey = CogSpamShortcutKey; + _fadeShortcutView.associatedUserDefaultsKey = CogFadeShortcutKey; } - (NSString *)title { diff --git a/Preferences/Preferences/en.lproj/Preferences.strings b/Preferences/Preferences/en.lproj/Preferences.strings index a59a74550..96e4477db 100644 --- a/Preferences/Preferences/en.lproj/Preferences.strings +++ b/Preferences/Preferences/en.lproj/Preferences.strings @@ -238,3 +238,6 @@ /* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */ "ws4-en-un8.title" = "Add other files in the same folder when adding a file"; + +/* Class = "NSTextFieldCell"; title = "Fade in/out:"; ObjectID = "Gp4-rA-1UF"; */ +"Gp4-rA-1UF.title" = "Fade in/out:"; diff --git a/Preferences/Preferences/es.lproj/Preferences.strings b/Preferences/Preferences/es.lproj/Preferences.strings index 25b0772c3..b5eea291b 100644 --- a/Preferences/Preferences/es.lproj/Preferences.strings +++ b/Preferences/Preferences/es.lproj/Preferences.strings @@ -237,3 +237,6 @@ /* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */ "ws4-en-un8.title" = "Añadir otros archivos en la misma carpeta al añadir un archivo"; + +/* Class = "NSTextFieldCell"; title = "Fade in/out:"; ObjectID = "Gp4-rA-1UF"; */ +"Gp4-rA-1UF.title" = "Fundido:"; diff --git a/Preferences/Preferences/ru.lproj/Preferences.strings b/Preferences/Preferences/ru.lproj/Preferences.strings index 23780839d..e5a8cb097 100644 --- a/Preferences/Preferences/ru.lproj/Preferences.strings +++ b/Preferences/Preferences/ru.lproj/Preferences.strings @@ -199,3 +199,6 @@ /* Class = "NSButtonCell"; title = "Add other files in the same folder when adding a file"; ObjectID = "ws4-en-un8"; */ "ws4-en-un8.title" = "Add other files in the same folder when adding a file"; + +/* Class = "NSTextFieldCell"; title = "Fade in/out:"; ObjectID = "Gp4-rA-1UF"; */ +"Gp4-rA-1UF.title" = "Fade in/out:"; diff --git a/Preferences/Preferences/tr.lproj/Preferences.strings b/Preferences/Preferences/tr.lproj/Preferences.strings index 7f282c4a7..818687e1e 100644 --- a/Preferences/Preferences/tr.lproj/Preferences.strings +++ b/Preferences/Preferences/tr.lproj/Preferences.strings @@ -238,3 +238,6 @@ /* Class = "NSTextFieldCell"; title = "hh:mm:ss.ms"; ObjectID = "zaI-0m-tQf"; */ "zaI-0m-tQf.title" = "ss:dd:ss.ms"; + +/* Class = "NSTextFieldCell"; title = "Fade in/out:"; ObjectID = "Gp4-rA-1UF"; */ +"Gp4-rA-1UF.title" = "Fade in/out:"; diff --git a/Preferences/Shortcuts.h b/Preferences/Shortcuts.h index 6f38988d4..895887f58 100644 --- a/Preferences/Shortcuts.h +++ b/Preferences/Shortcuts.h @@ -9,3 +9,4 @@ static NSString *const CogPlayShortcutKey = @"cogPlayShortcut"; static NSString *const CogNextShortcutKey = @"cogNextShortcut"; static NSString *const CogPrevShortcutKey = @"cogPrevShortcut"; static NSString *const CogSpamShortcutKey = @"cogSpamShortcut"; +static NSString *const CogFadeShortcutKey = @"cogFadeShortcut";