/* 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.
 */
/* tPlayback */

#import <Cocoa/Cocoa.h>
#import <ApplicationServices/ApplicationServices.h>
#import "tWindow.h"
#import "tTimeline.h"
#import "MHTableView.h"

@interface tPlayback : NSObject
{

    NSString *currentTitle;
    MHMovie *currentMovie;

    //IBOutlet id model;
    IBOutlet id chapters, chapScroll;
    IBOutlet id controller, controllerMenuItem;
    IBOutlet id exit, exitPlay, fsAspect, ffButton, rwButton, advButton, revButton,
                fullscreenContentView, fullscreenLevelPopup, ffMute;
    IBOutlet NSMovieView *fullscreenMovieView;
    IBOutlet id hides, iconDrawer,
                jumpToText;
    IBOutlet id jumpSheet, mainTabView, menuChap, menuLang, miniWin, movieController, movieControls;
    IBOutlet NSMovieView *movieView;
    IBOutlet id playButton, playOn, overscan, scrubber, scrubName, timeE, timeR, iRight, iLeft,
                showController, sizeMenu;
    IBOutlet id theTable, timeline, tlWindow;
    IBOutlet id toSize;
    IBOutlet id viewWindow, volScroll;
    IBOutlet id whichScreen, windowedMovieView;
    
    
    tWindow *bigWindow;
    NSMovieView *playingMovieView;
    TimeScale timescale;
    int timeDisplayMode;
    BOOL wasAutoSleep;
    float oldSpeed;
    
    //NSMutableArray *jumpFrom, *jumpTo;
    //long theFrom, theTo;
    NSRange skips[2];
}


    typedef enum {
        lastMovie,
        thisMovie,
        nextMovie
    } movieOrderT;

+ (id)nibInstance;
- (BOOL)windowShouldClose:(id)sender;
- (NSWindow *)fullscreenWindow;
- (void)showMini;
- (IBAction)scrubberAction:(id)sender;
- (IBAction)langMenu:(id)sender;
- (IBAction)chapMenu:(id)sender;
- (IBAction)cycleText:(id)sender;
- (IBAction)playMovies:(id)sender;
- (IBAction)stopMovies:(id)sender;
- (IBAction)pause:(id)sender;
+ (IBAction)toggleController:(id)sender;
- (IBAction)toggleController:(id)sender;
- (void)    setPMovieView:(id)newView;
- (IBAction)nextMovie:(id)sender;
+ (void)    nextMovie;
- (IBAction)lastMovie:(id)sender;
+ (void)    lastMovie;
- (IBAction)fullScreen:(id)sender;
+ (void)fullScreen;
- (IBAction)inMainWindow:(id)sender;
- (void) setMovieFrameInFrame:(NSRect)outerFrame;
- (IBAction)refreshMonitors:(id)sender;
- (IBAction)pickMonitor:(id)sender;
- (BOOL)playOnExitFullScreen;
- (IBAction)setRate:(id)sender;
- (IBAction)halfSize:(id)sender;
- (IBAction)origSize:(id)sender;
- (IBAction)doubleSize:(id)sender;
- (IBAction)fullscreenSize:(id)sender;
- (IBAction)inMainWindowSize:(id)sender;
- (void) setSizeMenuStates:(id)sender;
- (IBAction)maxVolume:(id)sender;
- (IBAction)minVolume:(id)sender;
- (IBAction)setVolume:(id)sender;
- (IBAction)bigger:(id)sender;
- (IBAction)smaller:(id)sender;
- (void)setViewSize:(double)size;
- (void)setViewWidth:(int)w height:(int)h;
- (double)getTimeValue;
- (long)getSampleTimeValue;
- (IBAction)savePrefs:(id)sender;
- (IBAction)chapScroll:(id)sender;
- (void)awakeFromNib;
- (IBAction)setWhichExit:(id)sender;
- (void)shouldExitFullScreen;
+ (void)shouldExitFullScreen;
- (MHMovie *)currentMovie;
- (void)movieDidChangeTo:(MHMovie *)aMovie;
- (void)setChapterTicks;
- (void)setLangState;
- (int)numLangs:(MHMovie *)aMovie;
- (void) makeMovieGoNow:(movieOrderT)whichMovie;
- (IBAction) ff:(id)sender;
- (IBAction) rw:(id)sender;
- (IBAction) jumpF:(id)sender;
- (IBAction) jumpB:(id)sender;
- (IBAction)jumpToSheet:(id)sender;
- (IBAction)endJumpToSheet:(id)sender;
- (IBAction)jumpTo:(id)sender;
- (void) jump:(double)seconds;
- (IBAction)gotoChapter:(id)sender;
- (void)tick:(id)info;
- (int)whichExit;
+ (int)whichExit;
- (void)shouldFreeMovie:(MHMovie *)aMovie;

@end
