From 0f02a397dee3eeac0523de642d3a0dd069a349d4 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sun, 14 Aug 2011 01:57:32 +0200 Subject: [PATCH] Make media time reflect selected annotation --- Medianno/MADocWindow.h | 2 +- Medianno/MADocWindow.mm | 11 +++++++++++ Medianno/en.lproj/MADocument.xib | 12 ++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Medianno/MADocWindow.h b/Medianno/MADocWindow.h index bfb2979..9e231f1 100644 --- a/Medianno/MADocWindow.h +++ b/Medianno/MADocWindow.h @@ -8,7 +8,7 @@ #import -@interface MADocWindow : NSWindowController { +@interface MADocWindow : NSWindowController { IBOutlet NSArrayController* mediaController; IBOutlet NSArrayController* annotationController; IBOutlet QTMovieView * movieView; diff --git a/Medianno/MADocWindow.mm b/Medianno/MADocWindow.mm index 9bf21b3..3694d50 100644 --- a/Medianno/MADocWindow.mm +++ b/Medianno/MADocWindow.mm @@ -11,6 +11,7 @@ #import "MADocWindow.h" #import "MAAddMediaSheet.h" #import "MADocument.h" +#import "MAAnno.h" @implementation MADocWindow @@ -206,6 +207,16 @@ static NSTimeInterval sLastSkip = 0.0; return subview != [[splitView subviews] objectAtIndex:0]; } +#pragma mark Annotation Table + +- (void)tableViewSelectionDidChange:(NSNotification *)notification +{ + NSArray * selection = [annotationController selectedObjects]; + if ([selection count]) + if (MAAnno * firstSelectedAnno = [selection objectAtIndex:0]) + [[movieView movie] setCurrentTime:QTTimeFromString([firstSelectedAnno location])]; +} + @end @implementation MADocumentWindow diff --git a/Medianno/en.lproj/MADocument.xib b/Medianno/en.lproj/MADocument.xib index 050d546..3bc7503 100644 --- a/Medianno/en.lproj/MADocument.xib +++ b/Medianno/en.lproj/MADocument.xib @@ -644,7 +644,7 @@ 0 - 0 + 4 0 NO @@ -1077,6 +1077,14 @@ 100180 + + + delegate + + + + 100181 + @@ -1468,7 +1476,7 @@ - 100180 + 100181