#
lib/beos.so: $(PLUGIN_BEOS)
- $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot
+ $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot -ltracker
lib/esd.so: $(PLUGIN_ESD)
ifneq (,$(findstring bsd,$(SYS)))
const int32 kSpeakerIconBitmapWidth = 16;
const int32 kSpeakerIconBitmapHeight = 9;
+const BPoint kSpeakerButtonSize(kSpeakerIconBitmapWidth - 1, kSpeakerIconBitmapHeight - 1);
+
const unsigned char kSpeakerIconBits [] = {
0xff,0xff,0xff,0xff,0xff,0x10,0x10,0xff,0xff,0xff,0xff,0x10,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0x10,0x10,0xff,0xff,0xff,0xff,0x10,0xff,0xff,0xff,0xff,
};
+const unsigned char kPressedSpeakerIconBits [] = {
+ 0xff,0xff,0xff,0xff,0xff,0x34,0x34,0xff,0xff,0xff,0xff,0x34,0xff,0xff,0xff,0xff,
+ 0x34,0x34,0x34,0xff,0x34,0x1d,0x34,0xff,0xff,0xff,0xff,0xff,0x34,0xff,0xff,0xff,
+ 0x34,0x1d,0x34,0x34,0x1d,0x1d,0x34,0xff,0xff,0x34,0xff,0xff,0x34,0xff,0xff,0xff,
+ 0x34,0x1d,0x34,0x1d,0x1d,0x1d,0x34,0xff,0xff,0xff,0x34,0xff,0xff,0x34,0xff,0xff,
+ 0x34,0x1d,0x34,0x1d,0x1d,0x1d,0x34,0xff,0x34,0xff,0x34,0xff,0xff,0x34,0xff,0xff,
+ 0x34,0x1d,0x34,0x1d,0x1d,0x1d,0x34,0xff,0xff,0xff,0x34,0xff,0xff,0x34,0xff,0xff,
+ 0x34,0x1d,0x34,0x34,0x1d,0x1d,0x34,0xff,0xff,0x34,0xff,0xff,0x34,0xff,0xff,0xff,
+ 0x34,0x34,0x34,0xff,0x34,0x1d,0x34,0xff,0xff,0xff,0xff,0xff,0x34,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x34,0x34,0xff,0xff,0xff,0xff,0x34,0xff,0xff,0xff,0xff,
+};
+
// #pragma mark play
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+#define MENU_HEIGHT 15
+
class InterfaceWindow : public BWindow
{
public:
BCheckBox * p_mute;
sem_id fScrubSem;
bool fSeeking;
+ BFilePanel *file_panel;
};
class InterfaceView : public BView
};
-class SeekSlider : public BSlider
+class MediaSlider : public BSlider
+{
+public:
+ MediaSlider(BRect frame,
+ BMessage *message,
+ int32 minValue,
+ int32 maxValue);
+ ~MediaSlider();
+ virtual void DrawThumb(void);
+};
+
+
+class SeekSlider : public MediaSlider
{
public:
SeekSlider(BRect frame,
#define PLAYING 0
#define PAUSED 1
+const uint32 OPEN_FILE = 'OPFL';
const uint32 OPEN_DVD = 'OPDV';
const uint32 STOP_PLAYBACK = 'STPL';
const uint32 START_PLAYBACK = 'PLAY';
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: intf_beos.cpp,v 1.14 2001/03/05 13:28:47 richards Exp $
+ * $Id: intf_beos.cpp,v 1.15 2001/03/05 20:36:04 richards Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <NodeInfo.h>
#include <Locker.h>
#include <DirectWindow.h>
-
+#include <Box.h>
+#include <MenuBar.h>
+#include <MenuItem.h>
+#include <FilePanel.h>
+#include <Alert.h>
#include <malloc.h>
#include <string.h>
: BWindow(frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK |B_ASYNCHRONOUS_CONTROLS)
{
+ file_panel = NULL;
p_intf = p_interface;
BRect ButtonRect;
float xStart = 2.0;
- float yStart = 10.0;
+ float yStart = 40.0;
SetName( "interface" );
SetTitle(VOUT_TITLE " (BeOS interface)");
+ BRect rect(0, 0, 0, MENU_HEIGHT);
- BView* p_view;
+ BMenuBar *menu_bar;
+ menu_bar = new BMenuBar(rect, "main menu");
+ AddChild( menu_bar );
+
+ BMenu *m;
+ BMenuItem *i;
+
+ menu_bar->AddItem( m = new BMenu("File") );
+ menu_bar->ResizeToPreferred();
+ m->AddItem( new BMenuItem("Open file...", new BMessage(OPEN_FILE), 'O'));
+ m->AddItem( new BMenuItem("Open DVD...", new BMessage(OPEN_DVD), 'D'));
+ m->AddSeparatorItem();
+ m->AddItem( new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q'));
+
- /* Add the view */
- p_view = new BView( Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW );
- p_view->SetViewColor(216,216,216);
+ rect = Bounds();
+ rect.top += menu_bar->Bounds().IntegerHeight()+1;
+
+ BBox* p_view;
+ p_view = new BBox( rect, NULL, B_FOLLOW_ALL, B_WILL_DRAW );
+ p_view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
/* Buttons */
/* Slow play */
kDisabledStopButtonBitmapBits,
new BMessage(STOP_PLAYBACK));
p_view->AddChild( p_stop );
-
+
+ ButtonRect.SetLeftTop(BPoint(xStart + 5, yStart + 6));
+ ButtonRect.SetRightBottom(ButtonRect.LeftTop() + kSpeakerButtonSize);
+ xStart += kSpeakerIconBitmapWidth;
+
+ TransportButton* p_mute = new TransportButton(ButtonRect, B_EMPTY_STRING,
+ kSpeakerIconBits,
+ kPressedSpeakerIconBits,
+ kSpeakerIconBits,
+ new BMessage(VOLUME_MUTE));
+
+ p_view->AddChild( p_mute );
+
/* Seek Status */
- p_seek = new SeekSlider(BRect(5,35,355,65), this, 0, 100,
+ rgb_color fill_color = {0,255,0};
+ p_seek = new SeekSlider(BRect(5,10,250,30), this, 0, 100,
B_TRIANGLE_THUMB);
p_seek->SetValue(0);
- p_seek->UseFillColor(TRUE);
+ p_seek->UseFillColor(true, &fill_color);
p_view->AddChild( p_seek );
/* Volume Slider */
- p_vol = new BSlider(BRect(xStart,2,300,20), "vol", "Volume",
- new BMessage(VOLUME_CHG), 0, VOLUME_MAX);
+ p_vol = new MediaSlider(BRect(xStart,40,250,60), new BMessage(VOLUME_CHG),
+ 0, VOLUME_MAX);
p_vol->SetValue(VOLUME_DEFAULT);
+ p_vol->UseFillColor(true, &fill_color);
p_view->AddChild( p_vol );
- /* Volume Mute */
- p_mute = new BCheckBox(BRect(300,10,355,25), "mute", "Mute",
- new BMessage(VOLUME_MUTE));
- p_view->AddChild( p_mute );
-
/* Set size and Show */
AddChild( p_view );
- ResizeTo(360,70);
+ ResizeTo(260,70 + menu_bar->Bounds().IntegerHeight()+1);
Show();
}
int vol_val = p_vol->Value(); // remember the current volume
static int playback_status; // remember playback state
+ BAlert *alert;
+
Activate();
switch( p_message->what )
{
+ case OPEN_FILE:
+ if(file_panel)
+ {
+ file_panel->Show();
+ break;
+ }
+ file_panel = new BFilePanel();
+ file_panel->SetTarget(this);
+ file_panel->Show();
+ break;
+
case OPEN_DVD:
+ alert = new BAlert(VOUT_TITLE, "Opening DVDs not yet implemented", "Bummer");
+ alert->Go();
break;
+
case STOP_PLAYBACK:
// this currently stops playback not nicely
if (p_intf->p_input != NULL )
// mute
if (p_main->p_aout != NULL)
{
- if (p_mute->Value() == B_CONTROL_OFF)
+ if (p_main->p_aout->vol == 0)
{
p_main->p_aout->vol = vol_val;
}
break;
case SELECT_CHANNEL:
break;
+ case B_REFS_RECEIVED:
case B_SIMPLE_DATA:
{
entry_ref ref;
{
BPath path( &ref );
char * psz_name = strdup(path.Path());
- intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'",
- psz_name );
intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_name );
}
return( false );
}
+/*****************************************************************************
+ * MediaSlider
+ *****************************************************************************/
+MediaSlider::MediaSlider(BRect frame,
+ BMessage *message,
+ int32 minValue,
+ int32 maxValue)
+ :BSlider(frame, NULL, NULL, message, minValue, maxValue)
+{
+
+}
+
+MediaSlider::~MediaSlider()
+{
+
+}
+
+void MediaSlider::DrawThumb(void)
+{
+ BRect r;
+ BView *v;
+
+ r = ThumbFrame();
+ v = OffscreenView();
+ v->SetHighColor(0,0,0);
+ r.InsetBy(r.IntegerWidth()/4, r.IntegerHeight()/6);
+ v->StrokeEllipse(r);
+ v->SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR));
+ r.InsetBy(1,1);
+ v->FillEllipse(r);
+}
/*****************************************************************************
* SeekSlider
int32 minValue,
int32 maxValue,
thumb_style thumbType = B_TRIANGLE_THUMB)
- :BSlider(frame, B_EMPTY_STRING, B_EMPTY_STRING,
- NULL, minValue, maxValue, thumbType)
+ :MediaSlider(frame, NULL, minValue, maxValue)
{
fOwner = owner;
fMouseDown = false;
w->Lock();
if( w->fDirty )
{
- if(!w->fUsingOverlay)
- w->view->DrawBitmap(w->bitmap[w->i_buffer_index], w->bitmap[w->i_buffer_index]->Bounds(), w->Bounds());
- w->fDirty = false;
+ w->view->DrawBitmap(w->bitmap[w->i_buffer_index], w->bitmap[w->i_buffer_index]->Bounds(), w->Bounds());
+ w->fDirty = false;
}
w->Unlock();
snooze(20000);
*****************************************************************************/
VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_output )
- : BWindow(frame, name, B_TITLED_WINDOW, NULL)
+ : BWindow(frame, name, B_DOCUMENT_WINDOW, NULL)
{
float minWidth, minHeight, maxWidth, maxHeight;
teardownwindow = false;
is_zoomed = false;
p_vout = p_video_output;
+ fDrawThreadID = NULL;
rect = Frame();
view = new VLCView(Bounds());
SetTitle(VOUT_TITLE " (BBitmap output)");
}
+ i_bytes_per_pixel = bitmap[0]->BytesPerRow()/bitmap[0]->Bounds().IntegerWidth();
+ fRowBytes = bitmap[0]->BytesPerRow();
+ fDirty = false;
+
if(fUsingOverlay)
{
memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength());
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
SetSizeLimits((float) Bounds().IntegerWidth(), maxWidth, (float) Bounds().IntegerHeight(), maxHeight);
}
-
- i_bytes_per_pixel = bitmap[0]->BytesPerRow()/bitmap[0]->Bounds().IntegerWidth();
- fRowBytes = bitmap[0]->BytesPerRow();
- fDirty = false;
- fDrawThreadID = spawn_thread(DrawingThread, "drawing_thread",
+ else
+ {
+ fDrawThreadID = spawn_thread(DrawingThread, "drawing_thread",
B_DISPLAY_PRIORITY, (void*) this);
- resume_thread(fDrawThreadID);
+ resume_thread(fDrawThreadID);
+ }
Show();
}
Hide();
Sync();
- wait_for_thread(fDrawThreadID, &result);
if(!fUsingOverlay)
{
+ wait_for_thread(fDrawThreadID, &result);
delete bitmap[0];
delete bitmap[1];
}
{
MoveTo(rect.left, rect.top);
ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
+ SetLook(B_DOCUMENT_WINDOW_LOOK);
be_app->ShowCursor();
}
else
delete screen;
MoveTo(0,0);
ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
+ SetLook(B_NO_BORDER_WINDOW_LOOK);
be_app->HideCursor();
}
is_zoomed = !is_zoomed;