/* Controller.m created by stark on Fri 04-Apr-1997 */

#import "Controller.h"
#import "MiscAutoTextScroller.h"

@implementation Controller

- (void)startScroll:sender
{	[itsTextScroller startScroll:self];
}

- (void)stopScroll:sender
{	[itsTextScroller stopScroll:self];
}

- (void)chooseFile:sender
{	id theOpenPanel = [[NSOpenPanel openPanel] retain];
	if ([theOpenPanel runModalForTypes:[NSArray arrayWithObjects:@"rtf", @"rtfd", nil]]==NSOKButton)
		if (![itsTextScroller setTextFromRTFDPath:[theOpenPanel filename]])
			NSBeep();
	[theOpenPanel release];
}

- (void)takeAnimRateFrom:sender
{	[itsTextScroller setFrameCountPerSecond:[sender floatValue]];
//	NSLog( @"fps:%f time/100:%f", (double)[itsTextScroller frameCountPerSecond], [itsTextScroller scrollTime] );
}

- (void)takeSpeedFrom:sender
{	[itsTextScroller setScrollTime:[sender floatValue]];
//	NSLog( @"fps:%f time/100:%f", (double)[itsTextScroller frameCountPerSecond], [itsTextScroller scrollTime] );
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{	[itsSpeedSlider setFloatValue:[itsTextScroller scrollTime]];
	[itsAnimRateSlider setFloatValue:[itsTextScroller frameCountPerSecond]];
}

@end
