Controller.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #import "Controller.h"
  2. @implementation Controller
  3. - (void)awakeFromNib
  4. {
  5. NSRect rect;
  6. VLCPlaylistDataSource * aDataSource;
  7. /* Won't be released */
  8. videoView = [[VLCVideoView alloc] init];
  9. rect = [videoHolderView frame];
  10. [[window contentView] replaceSubview: videoHolderView with: videoView];
  11. [videoView setFrame: rect];
  12. [videoView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable];
  13. /* Won't be released */
  14. playlist = [[VLCPlaylist alloc] init];
  15. /* Won't be released */
  16. aDataSource = [[VLCPlaylistDataSource alloc] initWithPlaylist:playlist videoView:videoView];
  17. [playlistOutline setDataSource: aDataSource];
  18. [playlistOutline registerForDraggedTypes: [NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, nil]];
  19. }
  20. - (void)play:(id)sender
  21. {
  22. if(![videoView playlist])
  23. [videoView setPlaylist: playlist];
  24. if( [sender isKindOfClass:[NSTableView class]] && [sender selectedRow] >= 0)
  25. [videoView playItemAtIndex: [sender selectedRow]];
  26. }
  27. @end