[Q] What type the Final Cut Pro expect when a file is drag&dropped to its project?
[Q] What type the Final Cut Pro expect when a file is drag&dropped to its project?
- Subject: [Q] What type the Final Cut Pro expect when a file is drag&dropped to its project?
- From: JongAm Park <email@hidden>
- Date: Wed, 17 Dec 2008 16:32:41 -0800
Hello.
I wrote some codes which will enable drag&drop from my application to
FCP's project.
Before implementing it, I tried dragging and dropping a file from a
Finder to an FCP's project which was opened with the FCP.
After confirming that the FCP supports drag&drop from the Finder, I
started implementing codes like below.
In awakeFromNib
/////////////////////////////////////////////////////
// Registering the drag type for Drag & Drop support
[mClipTable registerForDraggedTypes:[NSArray
arrayWithObjects:NSFilenamesPboardType,nil]];
// Allow that the drag target or where it drops is other application,
// especially the Final Cut Pro.
[mClipTable setDraggingSourceOperationMask:NSDragOperationEvery
forLocal:NO];
////////////////////////////////////////////////////
- (BOOL)tableView:(NSTableView *)aTableView
writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard
*)pboard
{
JALog(@"--[Initiation of Drag]--");
JALog(@"rowIndexes : %@", rowIndexes);
NSMutableArray *fileNamesArray = [NSMutableArray array];
// The pasteboard is for NSFilenamesPboard
[pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType]
owner:self];
NSString *configPath = [preferenceSetting configPath];
NSIndexSet *selectedRowsIndexSet = [mClipTable selectedRowIndexes];
unsigned int anIndex;
int indexInClipsArray;
NSString *fileName;
anIndex = [selectedRowsIndexSet firstIndex];
while( anIndex != NSNotFound )
{
// For NSFilenamesPboardType
indexInClipsArray = [self getClipsArrayIndex:anIndex];
fileName = [NSString stringWithFormat:@"%@/%@", configPath,
[[mClipArray objectAtIndex:indexInClipsArray] longName]];
[fileNamesArray addObject:fileName];
// next index
anIndex = [selectedRowsIndexSet indexGreaterThanIndex:anIndex];
}
[pboard setPropertyList:fileNamesArray forType:NSFilenamesPboardType];
return YES;
}
When I drag and dropped a file which is shown in my application to the
FCP, the FCP displayed a dialog box which said "File Error: Unknown
file.". Because the paste board type to use is NSFilenamesPboardType, I
populate file names with its path prefixed. But it didn't work.
Can anyone tell me what paste board type the FCP can accept and how to
pass the file's reference, whether it is file name or not, to the FCP?
Thank you.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden