summaryrefslogtreecommitdiffstats
path: root/kipi-plugins/mpegencoder/kimg2mpg.h
blob: 4402e5c372bd22dd3d90c8573bc52ed1b21fa29c (plain)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//////////////////////////////////////////////////////////////////////////////
//
//    KIMG2MPG.H
//
//    Copyright (C) 2003 Gilles Caulier <caulier dot gilles at gmail dot com>
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
//
//////////////////////////////////////////////////////////////////////////////


#ifndef KImg2mpgData_included
#define KImg2mpgData_included

// Include files for TQt

#include <tqstring.h>
#include <tqcolor.h>
#include <tqtimer.h>
#include <tqguardedptr.h>
#include <tqdatetime.h>

// Include files for KDE

#include <kdialog.h>
#include <klistbox.h>
#include <kprocess.h>
#include <kio/previewjob.h>

// Include files for KIPI

#include "kpaboutdata.h"
#include <libkipi/interface.h>

// Local includes

#include "kimg2mpgbase.h"

class KFileItem;
class TQPushButton;
class TQComboBox;
class TQSpinBox;
class TQGroupBox;
class TQListBoxItem;
class TQLabel;
class TQWidget;
class TQPixmap;

class KConfig;
class KProcess;
class KLineEdit;
class KIconLoader;
class KColorButton;
class KListBox;
class KButtonBox;
class KProgress;
class KURL::List;

namespace KIPIMPEGEncoderPlugin
{

class KShowDebuggingOutput;
class OptionsDialog;

class ListImageItems : public KListBox
{
Q_OBJECT
  

public:
    ListImageItems(TQWidget *parent=0, const char *name=0);

signals:
    void addedDropItems(KURL::List filesUrl);

protected:
    void dragEnterEvent(TQDragEnterEvent *e);
    void dropEvent(TQDropEvent *e);
};


class KImg2mpgData : public KImg2mpgBase
{
Q_OBJECT
  

public:

  KImg2mpgData( KIPI::Interface* interface, TQWidget* parent = 0, const char * name = 0 );
  virtual ~KImg2mpgData();

  void show();
  void ShowNumberImages( int Number );
  void closeEvent(TQCloseEvent*);
  TQPixmap LoadIcon( TQString Name, int Group );
  void addItems(const KURL::List& fileList);
  void writeSettings();
  void readSettings();

  OptionsDialog* m_OptionDlg;

public slots:

  void reset();
  void readStderr(KProcess *proc, char *buffer, int buflen);
  void EncodeDone(KProcess* );
  void slotMPEGFilenameDialog( void );
  void slotAudioFilenameDialog( void );
  void slotImagesFilesButtonAdd( void );
  void slotImagesFilesButtonDelete( void );
  void slotImagesFilesButtonUp( void );
  void slotImagesFilesButtonDown( void );
  void slotEncode( void );
  void slotOptions( void );
  void slotClose( void );
  void slotHelp( void );
  void slotImagesFilesSelected( TQListBoxItem *item );
  void SlotPortfolioDurationChanged ( int );
  void slotOptionDlgOkClicked( void );
  void slotGotPreview(const KFileItem* , const TQPixmap &pixmap);
  void slotFailedPreview(const KFileItem*);
  void slotAddDropItems(KURL::List filesUrl);

private:
  
  TQString               m_VideoFormatConfig;
  TQString               m_VideoTypeConfig;
  TQString               m_ChromaConfig;
  TQString               m_ImageDurationConfig;
  TQString               m_TransitionSpeedConfig;
  TQString               m_MPEGOutputFileConfig;
  TQString               m_AudioInputFileConfig;
  TQString               m_IMBinFolderConfig;
  TQString               m_MJBinFolderConfig;
  TQString               m_TmpFolderConfig;
  TQString               m_NoneLabel;
  TQString               m_EncodeString;
  TQString               m_DebugOuputMessages;
  TQString               m_CommandLine;
  TQString               m_ImagesFilesSort;

  TQColor                m_BackgroundColorConfig;

  KConfig*              m_config;

  KIO::PreviewJob*      m_thumbJob;

  TQTime                 m_EncodingDuration;
  TQTime                 m_DurationTime;

  bool                  m_Abort;
  bool                  m_Encoding;

  pid_t                 m_Img2mpgPidNum;

  KProcess*             m_Proc;

  KIconLoader*          m_Icons;

  KIPI::Interface*      m_interface;

  KIPIPlugins::KPAboutData* m_about;

  class KShowDebuggingOutput* m_DebuggingDialog;

  void RemoveTmpFiles( void );
  bool DeleteDir(TQString dirname);
  bool deldir(TQString dirname);
};

}  // NameSpace KIPIMPEGEncoderPlugin

#endif // KImg2mpgData_included