BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / mediaconverter / MediaEncoderWindow.cpp
blob2272ddd1700e21740dc0d1a6c709f2522abf9f05
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 #include "MediaEncoderWindow.h"
7 #include <stdio.h>
9 #include <Catalog.h>
10 #include <Locale.h>
11 #include <View.h>
14 #undef B_TRANSLATION_CONTEXT
15 #define B_TRANSLATION_CONTEXT "MediaConverter-EncoderWindow"
18 MediaEncoderWindow::MediaEncoderWindow(BRect frame, BView* view)
19 : BWindow(frame, B_TRANSLATE("Encoder parameters"), B_DOCUMENT_WINDOW_LOOK,
20 B_MODAL_APP_WINDOW_FEEL,
21 B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
23 // create and acquire the quit semaphore
24 fQuitSem = create_sem(0, "encoder_view");
26 fView = view;
27 AddChild(fView);
28 ResizeTo(fView->Bounds().Width(), fView->Bounds().Height());
32 MediaEncoderWindow::~MediaEncoderWindow()
34 // The view must continue to exist until conversion complete.
35 RemoveChild(fView);
36 delete_sem(fQuitSem);
40 void
41 MediaEncoderWindow::MessageReceived(BMessage *msg)
46 bool
47 MediaEncoderWindow::QuitRequested()
49 return true;
53 void
54 MediaEncoderWindow::Go()
56 this->Show();
58 // wait until window is quit
59 while (acquire_sem(fQuitSem) == B_INTERRUPTED)