/* Copyright (c) 2004, Noah Sorscher
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 	¥ 	Redistributions of source code must retain the above copyright
 * 	notice, this list of conditions and the following disclaimer.
 * 	¥ 	Redistributions in binary form must reproduce the above copyright
 * 	notice, this list of conditions and the following disclaimer in the
 * 	documentation and/or other materials provided with the distribution.
 * 	¥ 	Neither the name of the Noah Sorscher nor the names of its
 * 	contributors may be used to endorse or promote products derived from
 * 	this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */
/* tChapters */

#import <Cocoa/Cocoa.h>
#import "MHChapters.h"
#import "MHMovie.h"
//#import "tController.h"
#import "tTableView.h"
//#import "MHBB.h"
#import "MHUtil.h"

@interface tChapters : NSObject
{
    IBOutlet id bySoundTrack, chapSamples, chapterMenu, setButton;
    IBOutlet id chapterTable2, chapWin;
    IBOutlet NSMovieView *movieView;
    IBOutlet id theTable;
    IBOutlet id tinit;
    IBOutlet id controller;
    IBOutlet id player, warn;
    IBOutlet id dvdWindow, dvdPopup;
    IBOutlet id searchButton, searchField, resultsField, picField;
	IBOutlet NSPopUpButton	* searchResultsPopUp;
    
    //NSLock *selectionChangeLock, *clickLock;
    int lastSelection, shouldEditVariable, lastClickedColumn;
    BOOL shouldChange;
    MHMovie *currentMovie, *dummyMovie;
	id bb;
	NSArray *dvdChapsFound;
}
+ (id)go;
- (void)populateMenu:(NSMenu *)aMenu;
- (void)setPrefSource:(id)source;
- (void)controlTextDidChange:(NSNotification *)aNotification;
- (void)chaptersDidChange:(id)chapters;
- (BOOL)windowShouldClose:(id)sender;
- (int)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView;
- (void)awakeFromNib;
- (void)movieDidChangeTo:(MHMovie *)aMovie;
- (IBAction)add2:(id)sender;
- (void)newChapter2;
- (IBAction)remove2:(id)sender;
//- (IBAction)getTimePoint:(id)sender;
- (IBAction)getTimePoint2:(id)sender;
//- (void)setTimeInSamples:(TimeValue)samples;
//- (void)setTimeInSamples2:(TimeValue)samples;
- (IBAction)autoNumber:(id)sender;
- (IBAction)deNumber:(id)sender;
- (IBAction)more:(id)sender;
- (IBAction)webSearch:(id)sender;
- (IBAction)webSearchAgain:(id)sender;
- (void)webSearchComplete;
- (IBAction)displayChaptersForMovie:(id)moviePopUp;
- (IBAction)choose:(id)sender;
- (void)saveColumns;
- (void)restoreColumns;

- (IBAction)byTracks:(id)sender;
- (IBAction)copyMenu:(id)sender;
- (IBAction)saveChaptersToMovie:(id)sender;
- (IBAction)saveChaptersToFile:(id)sender;
- (IBAction)openChaptersFromFile:(id)sender;
- (IBAction)revert:(id)sender;
- (IBAction)removeChapters:(id)sender;
- (BOOL)setChapters:(MHChapters *)newChapters;
- (IBAction)openDVD:(id)sender;
- (NSString *)getDVDPath;
- (IBAction)openDVDreal:(id)sender;

@end
