//
//  NvDouyinEditView.h
//  SDKDemo
//
//  Created by shizhouhu on 2018/8/31.
 //
//

#import <UIKit/UIKit.h>
#import "NvsLiveWindow.h"
#import "NvEffectWrapper.h"
#import "NvTimelineEditor.h"

typedef enum {
    NV_TIMELINE_FX_TYPE_INVALID = -1,
    NV_TIMELINE_FX_TYPE_REVERSE = 1,
    NV_TIMELINE_FX_TYPE_REPEAT,
    NV_TIMELINE_FX_TYPE_SLOW
} NvTimelineFxType;

@protocol NvDouyinEditViewDelegate <NSObject>
@optional
- (void)cancelBtnClicked;
- (void)saveBtnClicked;
- (void)liveWindowTappedStop;
- (void)imageViewTappedPlay;
- (void)startFilter:(NSString *)filterId;
- (void)stopFilter;
- (void)revertClick;
- (void)fxLongWithFxName:(NSString *)fxName;
- (void)sliderValueChanged:(UISlider *)slider;
- (void)timeFxClick:(NSIndexPath*)indexPath;
- (void)videoFxClick;//点击滤镜特效
- (void)timeFxClick;//点击时间特效
//0-1的点
- (void)repeatPointValue:(float)value forStatus:(UIGestureRecognizerState)status;

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

- (BOOL)currentConvertStatus;

@end

@interface NvDouyinEditView : UIView

@property (weak, nonatomic) id<NvDouyinEditViewDelegate> delegate;
@property (strong, nonatomic) NvEffectWrapper *effectWrapper;                //滤镜特效控件：包含缩略图，颜色条，拖动条
@property (strong, nonatomic) UIImageView *playImageView;    //视频播放窗口播放按钮
@property (strong, nonatomic) NvTimelineEditor *timelineEditor;
@property (strong, nonatomic) UIImageView *repeatView;
@property (strong, nonatomic) UIButton *revertBtn;           //撤销按钮

- (void)setupEffectWrapper:(NSMutableArray *)descArray duration:(int64_t)duration;
- (void)updateColorBarView:(NSMutableArray *)filterModelArray;
- (NvsLiveWindow *)getLiveWindow;
- (void)setupTimelineEditor:(NSMutableArray *)descArray duration:(int64_t)duration;

- (void)finishConvert;

- (void)selectIndex:(int)index;

@end
