-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcxtextpopupdlg.h
161 lines (146 loc) · 4.24 KB
/
cxtextpopupdlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#ifndef CXTEXTPOPUPDLG_H
#define CXTEXTPOPUPDLG_H
#include <QDialog>
#include <QProcess>
#include <QTime>
#include <QMediaPlayer>
#include <QBasicTimer>
#include <QTimerEvent>
#include "cxgraphicsscene.h"
#include "ui_dlg_text_select.h"
#include "cxtextitem.h"
#include "cxprogressdlg.h"
#define CREATENEWMP4 0
#define INSERTINSIDEVIDEO 1
#define ADDIMAGETOSCENE 2
#define SINGLEVIDEOMODE 3
#define FREEVIDEOMODE 4
#define CALCDURATIONSTATE 0
#define CREATEAUDIOSTATE 1
class CxTextPopupDlg : public QDialog
{
Q_OBJECT
public:
CxTextPopupDlg(QWidget *parent);
~CxTextPopupDlg();
Ui::Dialog_Text_Popup form(){ return ui ;}
void initMe( int role ) ;
void setParentScene(CxGraphicsScene* sc) ;
void setCurrentScene(int sceneId) ;
CxTextItem* textItem(){ return m_item ; }
int state(){ return m_addState ; }
bool isNewMovie(){ return m_addState == CREATENEWMP4 ; }
QString audioPath(){ return m_audioPath ; }
QString singleVideoAudioPath(){ return m_singleAudioPath ; }
QString singleVideoImagePath(){ return m_singleImagePath ; }
int audioDuration(){ return m_audioEn - m_audioSt ; }
int textDuration(){ return m_itemDur ; }
QPixmap getImage() ;
QPixmap getFreezeImage() ;
void setSceneExist( bool on ) ;
QList<CxGraphicsScene*> sceneList(){ return m_sceneList ; }
CxGraphicsScene* parentScene(){ return m_parentScene ; }
int insertTimeMSec() ;
void setSceneSize( QSize sz ) ;
int freezeTime(){ return ui.lbl_seek->freezeTime() ; }
protected:
void closeEvent(QCloseEvent* event) ;
void mouseMoveEvent(QMouseEvent *event) ;
void timerEvent(QTimerEvent* event) ;
private slots:
void onCreateAction() ;
void onSelectAudio() ;
void onCreateVideo(int role=CREATENEWMP4) ;
void onInsertIntoVideo() ;
void onBold() ;
void onItalic() ;
void onUnderline() ;
void onLeft() ;
void onRight() ;
void onCenter() ;
void onJustify() ;
void onSelectTextColor() ;
void onSelectBackColor() ;
void currentCharFormatChanged(const QTextCharFormat &format);
void cursorPositionChanged();
void mergeFormatOnWordOrSelection(const QTextCharFormat &format) ;
void alignmentChanged(Qt::Alignment a) ;
void textFamily(const QString &f) ;
void textSize(const QString &p) ;
void onInsertText(int) ;
void onProcessStandardOutput() ;
void onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) ;
void onTextColorClicked(QAbstractButton* ) ;
void onBackColorClicked(QAbstractButton* ) ;
void onDrawRect() ;
void onDrawCircle() ;
void onDrawLine() ;
void onDrawMark() ;
void onAddImage(bool isFullScreen=false) ;
void onAddFullScreenImage() ;
void draw( int role ) ;
void onItemSelectionChanged() ;
void onAddImageToScene() ;
void onSave() ;
void onShowFlexMenu(bool on=true) ;
void onWhiteTextClicked() ;
void onFlexTextClicked() ;
void onImageFullScreen() ;
void onFill() ;
void onLeftArrow() ;
void onRightArrow() ;
void onUpArrow() ;
void onDownArrow() ;
void onMovementMode() ;
void onSelectSingleImageAudio() ;
void onSelectSingleImage() ;
void onCreateSingleVideo() ;
void onNextVideo() ;
void onPrevVideo() ;
void onAddNewScene() ;
void onDeleteScene() ;
void onSceneDurationChanged( double val ) ;
void onPlay() ;
void onDeleteItem() ;
void onShowAddImagePanel() ;
void onCreateFreezeVideo() ;
void onAddBlackCircle() ;
void onInitDrawRole() ;
void onScenePreview(int msec,bool isPressed) ;
private:
Ui::Dialog_Text_Popup ui ;
CxTextItem* m_item ;
void initConnection() ;
void setItemData() ;
void setTextItemAlignment( Qt::Alignment val ) ;
void startPlay( bool on ) ;
void setDurationToSeekBar() ;
void freeze( bool on ) ;
int m_addState ;
int m_processState ;
QString m_audioPath ;
QString m_audioTmp ;
QProcess* m_process ;
int m_audioSt, m_audioEn, m_itemDur ;
CxGraphicsScene* m_scene ;
CxGraphicsScene* m_parentScene ;
CxTextItem* m_curSelectedTextItem ;
bool m_close ;
QWidget* m_flexbuttonWidget ;
QToolButton* m_flexTextBtn ;
QString m_singleAudioPath ;
QString m_singleImagePath ;
QList<CxGraphicsScene*> m_sceneList ;
int m_curSceneId ;
bool m_isPlaying ;
bool m_audioSeeked ;
int m_playStartTime, m_currentPlayingTime ;
int m_SeekStartTime ;
QMediaPlayer* m_audioTrack ;
QBasicTimer m_timer ;
int m_curSceneElapsed ;
int m_dlgRole ;
bool m_isFreezeState ;
CxProgressDlg* m_progressBar ;
};
#endif // CXTEXTPOPUPDLG_H