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_WINDOW_H 6 #define MEDIA_CONVERTER_WINDOW_H 7 8 9 #include <Directory.h> 10 #include <MediaDefs.h> 11 #include <MediaFormats.h> 12 #include <Window.h> 13 14 15 class BBox; 16 class BButton; 17 class BFilePanel; 18 class BMediaFile; 19 class BMenuField; 20 class BSlider; 21 class BStringView; 22 class BTextControl; 23 class MediaFileInfoView; 24 class MediaFileListView; 25 class StatusView; 26 27 class MediaConverterWindow : public BWindow { 28 public: 29 MediaConverterWindow(BRect frame); 30 virtual ~MediaConverterWindow(); 31 32 protected: 33 // virtual void DispatchMessage(BMessage* message, 34 // BHandler* handler); 35 virtual void MessageReceived(BMessage* message); 36 virtual bool QuitRequested(); 37 38 public: 39 void LanguageChanged(); 40 41 void BuildFormatMenu(); 42 void BuildAudioVideoMenus(); 43 void GetSelectedFormatInfo( 44 media_file_format** _format, 45 media_codec_info** _audio, 46 media_codec_info** _video); 47 48 void SetStatusMessage(const char *message); 49 void SetFileMessage(const char *message); 50 51 bool AddSourceFile(BMediaFile* file, 52 const entry_ref& ref); 53 void RemoveSourceFile(int32 index); 54 int32 CountSourceFiles(); 55 status_t GetSourceFileAt(int32 index, BMediaFile** _file, 56 entry_ref* ref); 57 58 void SourceFileSelectionChanged(); 59 60 void SetEnabled(bool enabled, bool convertEnabled); 61 bool IsEnabled(); 62 63 const char* StartDuration() const; 64 const char* EndDuration() const; 65 66 int32 AudioQuality() const 67 { return fAudioQuality; } 68 int32 VideoQuality() const 69 { return fVideoQuality; } 70 71 void SetAudioQualityLabel(const char* label); 72 void SetVideoQualityLabel(const char* label); 73 74 BDirectory OutputDirectory() const; 75 76 private: 77 void _UpdateLabels(); 78 void _UpdateBBoxLayoutInsets(BBox* box); 79 void _CreateMenu(); 80 void _DestroyMenu(); 81 void _SetOutputFolder(BEntry entry); 82 83 BButton* fConvertButton; 84 85 BButton* fDestButton; 86 BButton* fPreviewButton; 87 BBox* fSourcesBox; 88 BBox* fInfoBox; 89 BBox* fOutputBox; 90 91 BMenuBar* fMenuBar; 92 BMenuField* fFormatMenu; 93 BMenuField* fVideoMenu; 94 BMenuField* fAudioMenu; 95 BStringView* fFileStatus; 96 BStringView* fStatus; 97 MediaFileListView* fListView; 98 MediaFileInfoView* fInfoView; 99 BStringView* fOutputFolder; 100 BTextControl* fStartDurationTC; 101 BTextControl* fEndDurationTC; 102 103 BSlider* fVideoQualitySlider; 104 BSlider* fAudioQualitySlider; 105 106 int32 fVideoQuality; 107 int32 fAudioQuality; 108 109 BFilePanel* fSaveFilePanel; 110 BFilePanel* fOpenFilePanel; 111 112 BDirectory fOutputDir; 113 bool fOutputDirSpecified; 114 115 bool fEnabled; 116 bool fConverting; 117 bool fCancelling; 118 }; 119 120 #endif // MEDIA_CONVERTER_WINDOW_H 121 122 123