//
//  NvVideoSlider.h
//  NvCheez
//
//  Created by 刘东旭 on 2017/12/5.
//  Copyright © 2017年 刘东旭. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NvVideoSliderView.h"

@interface NvVideoSliderInfo : NSObject

@property (nonatomic, strong) NSString* mediaFilePath;
@property (nonatomic, assign) int64_t inPoint;
@property (nonatomic, assign) int64_t outPoint;
@property (nonatomic, assign) int64_t trimIn;
@property (nonatomic, assign) int64_t trimOut;
@property (nonatomic, assign) bool stillImageHint;

@end

@protocol NvVideoSliderDelegate <NSObject>

@optional

- (void)timelineEditor:(id)timelineEditor dragHandleStarted:(int64_t)trimin trimOut:(int64_t)trimout;

- (void)timelineEditor:(id)timelineEditor draggingHandle:(int64_t)trimin trimOut:(int64_t)trimout;

- (void)timelineEditor:(id)timelineEditor dragHandleEnded:(int64_t)trimin trimOut:(int64_t)trimout;

- (void)timelineEditor:(id)timelineEditor dragScrollingTimeline:(int64_t)timestamp;

- (void)timelineEditor:(id)timelineEditor dragScrollTimelineEnded:(int64_t)timestamp;
@end

@interface NvVideoSlider : UIView

@property (nonatomic, weak) id <NvVideoSliderDelegate> delegate;
@property (nonatomic, assign) bool canOverlapTimeSpan;
@property (nonatomic, assign) bool caneditTimeSpan;
@property (nonatomic, assign) int64_t timelinePosition;
@property (nonatomic) CGFloat startPadding;
@property (nonatomic, assign) double displayDuration;
@property (nonatomic, assign) int64_t timelineDuration;
@property (nonatomic, assign) int64_t maximumDuration;

@property (nonatomic, strong, readonly) UIImageView *leftSliderView;
@property (nonatomic, strong, readonly) UIImageView *rightSliderView;

- (instancetype)initWithFrame:(CGRect)frame;

- (void) initTimelineEditor:(NSArray*) timelineEditorInfos timelineDuration:(int64_t)timelineDuration;
- (void)setSequencePointsPerMicrosecond:(int)duration;

- (void)setTimespanMiddleHandlePosition:(int64_t)position;

@end
