xref: /haiku/src/apps/mediaconverter/MediaConverterApp.h (revision 93a78ecaa45114d68952d08c4778f073515102f2)
1 // Copyright 1999, Be Incorporated. All Rights Reserved.
2 // Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
3 // Copyright 2007, Stephan Aßmus. All Rights Reserved.
4 // This file may be used under the terms of the Be Sample Code License.
5 #ifndef MEDIA_CONVERTER_APP_H
6 #define MEDIA_CONVERTER_APP_H
7 
8 
9 #include <Application.h>
10 #include <Directory.h>
11 #include <Entry.h>
12 #include <MediaDefs.h>
13 #include <MediaFormats.h>
14 
15 
16 class BMediaFile;
17 class MediaConverterWindow;
18 
19 class MediaConverterApp : public BApplication {
20 	public:
21 								MediaConverterApp();
22 	virtual						~MediaConverterApp();
23 
24 	protected:
25 
26 	virtual void				MessageReceived(BMessage* message);
27 	virtual void				ReadyToRun();
28 	virtual void				RefsReceived(BMessage* message);
29 
30 	public:
31 			bool				IsConverting() const;
32 			void				StartConverting();
33 
34 			void				SetStatusMessage(const char* message);
35 
36 	private:
37 			BEntry				_CreateOutputFile(BDirectory directory,
38 									entry_ref* ref,
39 									media_file_format* outputFormat);
40 
41 	static	int32				_RunConvertEntry(void* castToMediaConverterApp);
42 			void				_RunConvert();
43 			status_t			_ConvertFile(BMediaFile* inFile,
44 									BMediaFile* outFile,
45 									media_codec_info* audioCodec,
46 									media_codec_info* videoCodec,
47 									int32 audioQuality, int32 videoQuality,
48 									bigtime_t StartTime, bigtime_t EndTime);
49 
50 			MediaConverterWindow* fWin;
51 			thread_id			fConvertThreadID;
52 			bool				fConverting;
53 	volatile bool				fCancel;
54 };
55 
56 #endif // MEDIA_CONVERTER_APP_H
57