Add fade global shortcut
Defaulting to ctrl-cmd-O, though I may change this if someone has any better ideas for a default. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
696f060ffc
commit
26fa9496de
9 changed files with 57 additions and 13 deletions
|
@ -698,6 +698,11 @@ static AppController *kAppController = nil;
|
|||
toAction:^{
|
||||
[self clickSpam];
|
||||
}];
|
||||
|
||||
[binder bindShortcutWithDefaultsKey:CogFadeShortcutKey
|
||||
toAction:^{
|
||||
[self clickFade];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)clickPlay {
|
||||
|
@ -724,6 +729,10 @@ static AppController *kAppController = nil;
|
|||
[playbackController spam:nil];
|
||||
}
|
||||
|
||||
- (void)clickFade {
|
||||
[playbackController fade:nil];
|
||||
}
|
||||
|
||||
- (void)clickSeek:(NSTimeInterval)position {
|
||||
[playbackController seek:self toTime:position];
|
||||
}
|
||||
|
|
|
@ -134,6 +134,7 @@
|
|||
</customView>
|
||||
<customObject id="6" userLabel="HotKeyPane" customClass="HotKeyPane">
|
||||
<connections>
|
||||
<outlet property="fadeShortcutView" destination="vEd-Af-7tR" id="DMK-Z9-Sm5"/>
|
||||
<outlet property="nextShortcutView" destination="Dse-4d-oBd" id="mYF-gy-OEU"/>
|
||||
<outlet property="playShortcutView" destination="OBW-Zy-nz0" id="OkD-1k-vay"/>
|
||||
<outlet property="prevShortcutView" destination="Ujw-ux-fCg" id="oOW-gF-QBo"/>
|
||||
|
@ -142,7 +143,7 @@
|
|||
</connections>
|
||||
</customObject>
|
||||
<customView id="11" userLabel="HotKeyView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="640" height="132"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="640" height="163"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YtT-gE-hX3">
|
||||
|
@ -157,7 +158,7 @@
|
|||
</connections>
|
||||
</button>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="24">
|
||||
<rect key="frame" x="18" y="103" width="145" height="17"/>
|
||||
<rect key="frame" x="34" y="134" width="145" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Play:" id="198">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -166,7 +167,7 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="25">
|
||||
<rect key="frame" x="18" y="72" width="145" height="17"/>
|
||||
<rect key="frame" x="34" y="103" width="145" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Previous:" id="199">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -175,7 +176,7 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="26">
|
||||
<rect key="frame" x="18" y="42" width="145" height="17"/>
|
||||
<rect key="frame" x="4" y="73" width="175" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="right" title="Next:" id="200">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -184,7 +185,7 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eid-M4-6Cs">
|
||||
<rect key="frame" x="18" y="11" width="145" height="17"/>
|
||||
<rect key="frame" x="4" y="14" width="175" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Copy now playing:" id="SMd-GA-jrH">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -193,23 +194,36 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OBW-Zy-nz0" userLabel="Play Shortcut" customClass="MASShortcutView">
|
||||
<rect key="frame" x="169" y="102" width="163" height="19"/>
|
||||
<rect key="frame" x="185" y="133" width="163" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ujw-ux-fCg" userLabel="Previous Shortcut" customClass="MASShortcutView">
|
||||
<rect key="frame" x="169" y="71" width="163" height="19"/>
|
||||
<rect key="frame" x="185" y="102" width="163" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dse-4d-oBd" userLabel="Next Shortcut" customClass="MASShortcutView">
|
||||
<rect key="frame" x="169" y="41" width="163" height="19"/>
|
||||
<rect key="frame" x="185" y="72" width="163" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="80X-iX-vxp" userLabel="Spam Shortcut" customClass="MASShortcutView">
|
||||
<rect key="frame" x="169" y="10" width="163" height="19"/>
|
||||
<rect key="frame" x="185" y="13" width="163" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Gp4-rA-1UF">
|
||||
<rect key="frame" x="4" y="44" width="175" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Fade in/out:" id="D5K-pO-8Sj">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vEd-Af-7tR" userLabel="Fade Shortcut" customClass="MASShortcutView">
|
||||
<rect key="frame" x="185" y="43" width="163" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="-151" y="-34"/>
|
||||
<point key="canvasLocation" x="-151" y="-18.5"/>
|
||||
</customView>
|
||||
<customView id="50" userLabel="UpdatesView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="640" height="56"/>
|
||||
|
@ -437,7 +451,7 @@
|
|||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="EEt-uJ-j6o">
|
||||
<rect key="frame" x="8" y="0.0" width="443" height="24"/>
|
||||
<rect key="frame" x="18" y="0.0" width="443" height="24"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7l9-R2-FVF">
|
||||
|
@ -472,7 +486,7 @@
|
|||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="EDi-gi-Vg9">
|
||||
<rect key="frame" x="468" y="0.0" width="100" height="24"/>
|
||||
<rect key="frame" x="478" y="0.0" width="100" height="24"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0TJ-dK-Rfk">
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<NSString *, NSData *> *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 {
|
||||
|
|
|
@ -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:";
|
||||
|
|
|
@ -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:";
|
||||
|
|
|
@ -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:";
|
||||
|
|
|
@ -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:";
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue