Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

checkpoint

  • Loading branch information...
commit 79539d057f51af054b4330264ab4f40ab0cc8131 1 parent 0a34776
@amrox authored
View
14 AppDefaults.plist
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>shouldAddOnLastSecondEvent</key>
+ <false/>
+ <key>shouldUseCreatorTag</key>
+ <false/>
+ <key>creatorTag</key>
+ <string></string>
+ <key>shouldOutputXML</key>
+ <false/>
+</dict>
+</plist>
View
37 AppDelegate.h
@@ -0,0 +1,37 @@
+//
+// AppDelegate.h
+// FLVrInjectr
+//
+// Created by Andy Mroczkowski on 3/24/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface AppDelegate : NSWindowController
+{
+ IBOutlet NSArrayController* flvPathsController;
+ IBOutlet NSMatrix* saveOptionMatrix;
+ IBOutlet NSTableView* filesTableView;
+
+// BOOL _shouldUseCreatorTag;
+// NSString* _creatorTag;
+// BOOL _shouldAddOnLastSecondEvent;
+// BOOL _shouldOutputXML;
+
+ int _saveMode;
+}
+
+@property (nonatomic, assign) BOOL shouldUseCreatorTag;
+@property (nonatomic, retain) NSString* creatorTag;
+@property (nonatomic, assign) BOOL shouldAddOnLastSecondEvent;
+@property (nonatomic, assign) BOOL shouldOutputXML;
+
+@property (nonatomic, assign) int saveMode;
+
+- (IBAction) openFLVFiles:(id)sender;
+
+- (IBAction) go:(id)sender;
+
+@end
View
221 AppDelegate.m
@@ -0,0 +1,221 @@
+//
+// AppDelegate.m
+// FLVrInjectr
+//
+// Created by Andy Mroczkowski on 3/24/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+#import "YamdiRunner.h"
+
+@implementation AppDelegate
+
+//@synthesize shouldUseCreatorTag = _shouldUseCreatorTag;
+//@synthesize creatorTag = _creatorTag;
+//@synthesize shouldAddOnLastSecondEvent = _shouldAddOnLastSecondEvent;
+//@synthesize shouldOutputXML = _shouldOutputXML;
+@synthesize saveMode = _saveMode;
+
++ (void)initialize
+{
+ // -- Initialize Applications Defaults
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ NSDictionary *appDefaults = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"AppDefaults"
+ ofType:@"plist"]];
+ [defaults registerDefaults:appDefaults];
+}
+
+
+- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
+{
+// self.shouldUseCreatorTag = NO;
+// self.creatorTag = @"";
+// self.shouldAddOnLastSecondEvent = NO;
+// self.shouldOutputXML = NO;
+ self.saveMode = 1;
+ [saveOptionMatrix setEnabled:NO];
+}
+
+
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ if( [[[filename pathExtension] lowercaseString] isEqualToString:@"flv"] )
+ {
+ [[self window] makeKeyAndOrderFront:self];
+ [flvPathsController addObject:filename];
+ return YES;
+ }
+ return NO;
+}
+
+
+- (void) awakeFromNib
+{
+ // [filesTableView setDraggingSourceOperationMask:NSDragOperationNone forLocal:YES];
+ // [filesTableView setDraggingSourceOperationMask:NSDragOperationNone forLocal:NO];
+ [filesTableView registerForDraggedTypes:
+ [NSArray arrayWithObject:NSFilenamesPboardType]];
+}
+
+
+- (IBAction) openFLVFiles:(id)sender
+{
+ NSOpenPanel* openPanel = [NSOpenPanel openPanel];
+ [openPanel setCanChooseFiles:YES];
+ [openPanel setCanChooseDirectories:NO];
+ [openPanel setAllowsMultipleSelection:YES];
+ [openPanel setAllowsOtherFileTypes:NO];
+
+ [openPanel beginSheetForDirectory:nil
+ file:nil
+ types:[NSArray arrayWithObject:@"flv"]
+ modalForWindow:[self window]
+ modalDelegate:self
+ didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
+ contextInfo:NULL];
+}
+
+
+- (void) openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
+{
+ if( returnCode == NSOKButton )
+ {
+ for( NSString* f in panel.filenames )
+ {
+ [flvPathsController addObject:f];
+ }
+ }
+}
+
+
+- (IBAction) go:(id)sender
+{
+ NSError* error = nil;
+ YamdiRunner* runner = [[YamdiRunner alloc] init];
+
+ for( NSString* f in flvPathsController.arrangedObjects )
+ {
+ NSString* outputPath = [[f stringByDeletingPathExtension] stringByAppendingString:@"-tagged.flv"];
+ NSLog( @"doing %@", f );
+
+ NSString* xmlPath = nil;
+ if( self.shouldOutputXML )
+ xmlPath = [[f stringByDeletingPathExtension] stringByAppendingString:@"-tagged.xml"];
+
+ runner.inputPath = f;
+ runner.outputPath = outputPath;
+ runner.addOnLastSecondEvent = self.shouldAddOnLastSecondEvent;
+ if( self.shouldUseCreatorTag )
+ runner.creatorTag = self.creatorTag;
+ if( xmlPath )
+ runner.xmlOutputPath = xmlPath;
+
+ error = [runner run];
+ if( error )
+ NSLog( @"error: %@", error );
+ }
+}
+
+
+#pragma mark Table View Delegate
+
+- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard
+{
+ return NO;
+}
+
+
+- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op
+{
+ // make sure we're not dropping on ourself
+ if( [info draggingSource] != tv )
+ {
+ [tv setDropRow:-1 dropOperation:NSTableViewDropOn];
+ return NSDragOperationEvery;
+ }
+ else
+ {
+ return NSDragOperationNone;
+ }
+}
+
+
+- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info row:(int)row dropOperation:(NSTableViewDropOperation)operation
+{
+ NSPasteboard* pboard = [info draggingPasteboard];
+ if ( [[pboard types] containsObject:NSFilenamesPboardType] )
+ {
+ NSArray* filenames = [pboard propertyListForType:NSFilenamesPboardType];
+ for( NSString* file in filenames )
+ {
+ if( [[[file pathExtension] lowercaseString] isEqualToString:@"flv"] )
+ {
+ [flvPathsController addObject:file];
+ }
+ }
+ return YES;
+ }
+
+ return NO;
+}
+
+
+- (void)deleteSelectionFromTableView:(NSTableView *)tableView
+{
+ [flvPathsController removeObjectsAtArrangedObjectIndexes:[flvPathsController selectionIndexes]];
+}
+
+#pragma mark Accessors
+// seems like there would be a better way to do this
+
+- (BOOL) shouldAddOnLastSecondEvent
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"shouldAddOnLastSecondEvent"];
+}
+
+
+- (void) setShouldAddOnLastSecondEvent:(BOOL)yn
+{
+ [[NSUserDefaults standardUserDefaults] setBool:yn forKey:@"shouldAddOnLastSecondEvent"];
+}
+
+
+- (NSString*) creatorTag
+{
+ return [[NSUserDefaults standardUserDefaults] stringForKey:@"creatorTag"];
+}
+
+
+- (void) setCreatorTag:(NSString*)tag
+{
+ [[NSUserDefaults standardUserDefaults] setObject:tag forKey:@"creatorTag"];
+}
+
+
+- (BOOL) shouldUseCreatorTag
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"shouldUseCreatorTag"];
+}
+
+
+- (void) setShouldUseCreatorTag:(BOOL)yn
+{
+ [[NSUserDefaults standardUserDefaults] setBool:yn forKey:@"shouldUseCreatorTag"];
+}
+
+
+- (BOOL) shouldOutputXML
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"shouldOutputXML"];
+}
+
+
+- (void) setShouldOutputXML:(BOOL)yn
+{
+ [[NSUserDefaults standardUserDefaults] setBool:yn forKey:@"shouldOutputXML"];
+}
+
+
+@end
View
3,227 English.lproj/MainMenu.xib
1,478 additions, 1,749 deletions not shown
View
30 FLVrInjectr.xcodeproj/project.pbxproj
@@ -11,6 +11,8 @@
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+ A154FB9F0F7F38A4002BDE49 /* LTKeyPressTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A154FB9E0F7F38A4002BDE49 /* LTKeyPressTableView.m */; };
+ A154FBC60F7F3C25002BDE49 /* AppDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = A154FBC50F7F3C25002BDE49 /* AppDefaults.plist */; };
A1D4A0DF0F79D311008F1EE8 /* yamdi in Copy Bundle Executables */ = {isa = PBXBuildFile; fileRef = A1D4A0DE0F79D311008F1EE8 /* yamdi */; };
A1D4A0EC0F79D556008F1EE8 /* GTMScriptRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A0EA0F79D556008F1EE8 /* GTMScriptRunner.m */; };
A1D4A1000F79D6A0008F1EE8 /* GTMSenTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A0FF0F79D69F008F1EE8 /* GTMSenTestCase.m */; };
@@ -20,6 +22,9 @@
A1D4A1BD0F79DBA3008F1EE8 /* GTMUnitTestDevLog.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A1060F79D6F3008F1EE8 /* GTMUnitTestDevLog.m */; };
A1D4A1C00F79DC1F008F1EE8 /* GTMDevLog.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A14C0F79D9E9008F1EE8 /* GTMDevLog.m */; };
A1D4A2030F79E02C008F1EE8 /* taste_the_fame.flv in Resources */ = {isa = PBXBuildFile; fileRef = A1D4A2020F79E02C008F1EE8 /* taste_the_fame.flv */; };
+ A1D4A22C0F7B2B1A008F1EE8 /* YamdiRunner_Test.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A22B0F7B2B1A008F1EE8 /* YamdiRunner_Test.m */; };
+ A1D4A2800F7B3157008F1EE8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A20C0F79E0CE008F1EE8 /* AppDelegate.m */; };
+ A1D4A2CF0F7B3845008F1EE8 /* YamdiRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = A1D4A2070F79E0BD008F1EE8 /* YamdiRunner.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -57,6 +62,9 @@
32CA4F630368D1EE00C91783 /* FLVrInjectr_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLVrInjectr_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* FLVrInjectr.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FLVrInjectr.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ A154FB9D0F7F38A4002BDE49 /* LTKeyPressTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LTKeyPressTableView.h; path = Sources/3rdParty/LTKeyPressTableView/LTKeyPressTableView.h; sourceTree = "<group>"; };
+ A154FB9E0F7F38A4002BDE49 /* LTKeyPressTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LTKeyPressTableView.m; path = Sources/3rdParty/LTKeyPressTableView/LTKeyPressTableView.m; sourceTree = "<group>"; };
+ A154FBC50F7F3C25002BDE49 /* AppDefaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AppDefaults.plist; sourceTree = "<group>"; };
A1D4A0DE0F79D311008F1EE8 /* yamdi */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = yamdi; path = Resources/yamdi; sourceTree = "<group>"; };
A1D4A0E90F79D542008F1EE8 /* GTMScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMScriptRunner.h; path = "Sources/3rdParty/google-toolbox-for-mac-1-5-1/Foundation/GTMScriptRunner.h"; sourceTree = "<group>"; };
A1D4A0EA0F79D556008F1EE8 /* GTMScriptRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMScriptRunner.m; path = "Sources/3rdParty/google-toolbox-for-mac-1-5-1/Foundation/GTMScriptRunner.m"; sourceTree = "<group>"; };
@@ -73,6 +81,12 @@
A1D4A10B0F79D74B008F1EE8 /* GTMRegexTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMRegexTest.m; path = "Sources/3rdParty/google-toolbox-for-mac-1-5-1/Foundation/GTMRegexTest.m"; sourceTree = "<group>"; };
A1D4A14C0F79D9E9008F1EE8 /* GTMDevLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMDevLog.m; path = "Sources/3rdParty/google-toolbox-for-mac-1-5-1/DebugUtils/GTMDevLog.m"; sourceTree = "<group>"; };
A1D4A2020F79E02C008F1EE8 /* taste_the_fame.flv */ = {isa = PBXFileReference; lastKnownFileType = file; name = taste_the_fame.flv; path = "Sample Data/taste_the_fame.flv"; sourceTree = "<group>"; };
+ A1D4A2060F79E0BD008F1EE8 /* YamdiRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YamdiRunner.h; sourceTree = "<group>"; };
+ A1D4A2070F79E0BD008F1EE8 /* YamdiRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YamdiRunner.m; sourceTree = "<group>"; };
+ A1D4A20B0F79E0CE008F1EE8 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ A1D4A20C0F79E0CE008F1EE8 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ A1D4A22A0F7B2B1A008F1EE8 /* YamdiRunner_Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YamdiRunner_Test.h; sourceTree = "<group>"; };
+ A1D4A22B0F7B2B1A008F1EE8 /* YamdiRunner_Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YamdiRunner_Test.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -97,6 +111,12 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
+ A1D4A20B0F79E0CE008F1EE8 /* AppDelegate.h */,
+ A1D4A20C0F79E0CE008F1EE8 /* AppDelegate.m */,
+ A1D4A2060F79E0BD008F1EE8 /* YamdiRunner.h */,
+ A1D4A2070F79E0BD008F1EE8 /* YamdiRunner.m */,
+ A154FB9D0F7F38A4002BDE49 /* LTKeyPressTableView.h */,
+ A154FB9E0F7F38A4002BDE49 /* LTKeyPressTableView.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -131,10 +151,10 @@
29B97314FDCFA39411CA2CEA /* FLVrInjectr */ = {
isa = PBXGroup;
children = (
- A1D4A2000F79E014008F1EE8 /* Tests */,
080E96DDFE201D6D7F000001 /* Classes */,
A1D4A0E40F79D4F0008F1EE8 /* GTM */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
+ A1D4A2000F79E014008F1EE8 /* Tests */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
@@ -155,6 +175,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
+ A154FBC50F7F3C25002BDE49 /* AppDefaults.plist */,
A1D4A0DE0F79D311008F1EE8 /* yamdi */,
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
@@ -219,6 +240,8 @@
isa = PBXGroup;
children = (
A1D4A2010F79E01D008F1EE8 /* Test Data */,
+ A1D4A22A0F7B2B1A008F1EE8 /* YamdiRunner_Test.h */,
+ A1D4A22B0F7B2B1A008F1EE8 /* YamdiRunner_Test.m */,
);
name = Tests;
sourceTree = "<group>";
@@ -297,6 +320,7 @@
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
+ A154FBC60F7F3C25002BDE49 /* AppDefaults.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -335,6 +359,9 @@
A1D4A0EC0F79D556008F1EE8 /* GTMScriptRunner.m in Sources */,
A1D4A10C0F79D74B008F1EE8 /* GTMRegex.m in Sources */,
A1D4A1C00F79DC1F008F1EE8 /* GTMDevLog.m in Sources */,
+ A1D4A2800F7B3157008F1EE8 /* AppDelegate.m in Sources */,
+ A1D4A2CF0F7B3845008F1EE8 /* YamdiRunner.m in Sources */,
+ A154FB9F0F7F38A4002BDE49 /* LTKeyPressTableView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -346,6 +373,7 @@
A1D4A1020F79D6AC008F1EE8 /* GTMScriptRunnerTest.m in Sources */,
A1D4A10E0F79D752008F1EE8 /* GTMRegexTest.m in Sources */,
A1D4A1BD0F79DBA3008F1EE8 /* GTMUnitTestDevLog.m in Sources */,
+ A1D4A22C0F7B2B1A008F1EE8 /* YamdiRunner_Test.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
4 Info.plist
@@ -23,7 +23,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
+ <string>net.mrox.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -33,7 +33,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.0</string>
+ <string>0.1</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
View
35 Sources/3rdParty/LTKeyPressTableView/LTKeyPressTableView.h
@@ -0,0 +1,35 @@
+//
+// LTKeyPressTableView.h
+//
+// Created by Jacob Godwin-Jones on 1/18/07.
+// Copyright 2007 Like Thought.
+
+/*
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to
+ do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+@interface LTKeyPressTableView : NSTableView
+@end
+
+@interface LTKeyPressOutlineView : NSOutlineView
+@end
+
+@protocol LTKeyPressTableViewDelegate
+@optional
+- (void)deleteSelectionFromTableView:(NSTableView *)tableView;
+- (BOOL)preventEnterEditingTableView:(NSTableView *)tableView;
+- (void)goLeftFromTableView:(NSTableView *)tableView;
+- (void)goRightFromTableView:(NSTableView *)tableView;
+@end
View
74 Sources/3rdParty/LTKeyPressTableView/LTKeyPressTableView.m
@@ -0,0 +1,74 @@
+//
+// LTKeyPressTableView.m
+//
+// Created by Jacob Godwin-Jones on 1/18/07.
+// Copyright 2007 Like Thought.
+
+/*
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to
+ do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#import "LTKeyPressTableView.h"
+
+BOOL LTKeyPressTableViewKeyDown(NSEvent *event, NSTableView *table, id delegate)
+{
+ unichar key = [[event charactersIgnoringModifiers] characterAtIndex:0];
+ if ((key == NSDeleteCharacter) && [delegate respondsToSelector:@selector(deleteSelectionFromTableView:)]) {
+ if ([table selectedRow] == -1)
+ NSBeep();
+ else
+ [delegate deleteSelectionFromTableView:table];
+ return YES;
+ } else if ((key == 0xf702) && [delegate respondsToSelector:@selector(goLeftFromTableView:)]) {
+ [delegate goLeftFromTableView:table];
+ return YES;
+ } else if ((key == 0xf703) && [delegate respondsToSelector:@selector(goRightFromTableView:)]) {
+ [delegate goRightFromTableView:table];
+ return YES;
+ } else if (((key == NSEnterCharacter) || (key == NSCarriageReturnCharacter)) && (![delegate respondsToSelector:@selector(preventEnterEditingTableView:)] || ![delegate preventEnterEditingTableView:table])) {
+ NSInteger selectedRow = [table selectedRow];
+ if (selectedRow == -1) {
+ NSBeep();
+ return YES;
+ } else {
+ NSArray *columns = [table tableColumns];
+ for(NSTableColumn *column in columns) {
+ if ([[column dataCell] isEditable]) {
+ [table editColumn:[columns indexOfObject:column] row:selectedRow withEvent:nil select:YES];
+ return YES;
+ }
+ }
+ }
+ }
+ return NO;
+}
+
+@implementation LTKeyPressTableView
+
+- (void)keyDown:(NSEvent *)event;
+{
+ if (!LTKeyPressTableViewKeyDown(event, self, [self delegate]))
+ [super keyDown:event];
+}
+
+@end
+
+@implementation LTKeyPressOutlineView
+
+- (void)keyDown:(NSEvent *)event;
+{
+ if (!LTKeyPressTableViewKeyDown(event, self, [self delegate]))
+ [super keyDown:event];
+}
+
+@end
View
28 YamdiRunner.h
@@ -0,0 +1,28 @@
+//
+// YamdiRunner.h
+// FLVrInjectr
+//
+// Created by Andy Mroczkowski on 3/24/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface YamdiRunner : NSObject {
+ NSString* _inputPath;
+ NSString* _outputPath;
+ NSString* _creatorTag;
+ NSString* _xmlOutputPath;
+ BOOL _addOnLastSecondEvent;
+}
+
+@property (nonatomic, retain) NSString *inputPath;
+@property (nonatomic, retain) NSString *outputPath;
+@property (nonatomic, retain) NSString *creatorTag;
+@property (nonatomic, retain) NSString *xmlOutputPath;
+@property (nonatomic, assign) BOOL addOnLastSecondEvent;
+
+- (NSError *)run;
+
+@end
View
84 YamdiRunner.m
@@ -0,0 +1,84 @@
+//
+// YamdiRunner.m
+// FLVrInjectr
+//
+// Created by Andy Mroczkowski on 3/24/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import "YamdiRunner.h"
+
+const int kYamdiMaxArgCount = 9;
+
+@implementation YamdiRunner
+
+NSString *yamdiPath = nil;
+
++ (void) initialize
+{
+ yamdiPath = [[[[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"yamdi"] retain];
+}
+
+@synthesize inputPath = _inputPath;
+@synthesize outputPath = _outputPath;
+@synthesize creatorTag = _creatorTag;
+@synthesize xmlOutputPath = _xmlOutputPath;
+@synthesize addOnLastSecondEvent = _addOnLastSecondEvent;
+
+- (NSError *)run
+{
+ NSError* error = nil;
+ NSMutableArray* args = [NSMutableArray arrayWithCapacity:kYamdiMaxArgCount];
+
+ // -- inputPath
+ if( self.inputPath )
+ {
+ [args addObject:@"-i"];
+ [args addObject:self.inputPath];
+ }
+ else
+ {
+ goto bail;
+ }
+
+ // -- outputPath
+ if( self.outputPath )
+ {
+ [args addObject:@"-o"];
+ [args addObject:self.outputPath];
+ }
+ else
+ {
+ goto bail;
+ }
+
+ // -- creatorTag
+ if( self.creatorTag)
+ {
+ [args addObject:@"-c"];
+ [args addObject:self.creatorTag];
+ }
+
+ // -- xmlOutputPath
+ if( self.xmlOutputPath )
+ {
+ [args addObject:@"-x"];
+ [args addObject:self.xmlOutputPath];
+ }
+
+ if( self.addOnLastSecondEvent )
+ {
+ [args addObject:@"-l"];
+ }
+
+ NSLog( @"yamdiPath: %@", yamdiPath );
+ NSTask* task = [NSTask launchedTaskWithLaunchPath:yamdiPath
+ arguments:args];
+
+ [task waitUntilExit];
+
+bail:
+ return error;
+}
+
+@end
View
16 YamdiRunner_Test.h
@@ -0,0 +1,16 @@
+//
+// YamdiRunner_Test.h
+// FLVrInjectr
+//
+// Created by Andy Mroczkowski on 3/25/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import <SenTestingKit/SenTestingKit.h>
+
+
+@interface YamdiRunner_Test : SenTestCase {
+
+}
+
+@end
View
38 YamdiRunner_Test.m
@@ -0,0 +1,38 @@
+//
+// YamdiRunner_Test.m
+// FLVrInjectr
+//
+// Created by Andy Mroczkowski on 3/25/09.
+// Copyright 2009 __MyCompanyName__. All rights reserved.
+//
+
+#import "YamdiRunner_Test.h"
+
+#import "YamdiRunner.h"
+
+@implementation YamdiRunner_Test
+
+- (void)testRun
+{
+ NSString* testFilePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"taste_the_fame"
+ ofType:@"flv"];
+ STAssertNotNil( testFilePath, @"could not find file %@", testFilePath );
+
+ NSString* outputPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[testFilePath lastPathComponent]];
+
+ YamdiRunner* yamdiRunner = [[YamdiRunner alloc] init];
+ yamdiRunner.inputPath = testFilePath;
+ yamdiRunner.outputPath = outputPath;
+
+ NSError* error = [yamdiRunner run];
+ STAssertNil( error, @"error: %@", error );
+
+ NSFileManager* fm = [NSFileManager defaultManager];
+ BOOL exists = [fm fileExistsAtPath:outputPath];
+ STAssertTrue( exists, @"output file not found: %@", outputPath );
+
+ if( exists )
+ [fm removeFileAtPath:outputPath handler:NULL];
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.