Commit 0d944b49 authored by Tony Castley's avatar Tony Castley

Created a wrapper class for VLC functions and interaction. Improved file

and disk opening.  Fixed drag and drop.  Added right click menu and always
on top mode.
parent 8e1d4438
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype * InterfaceWindow.h: BeOS interface window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.12.2.1 2002/06/01 10:12:10 tcastley Exp $ * $Id: InterfaceWindow.h,v 1.12.2.2 2002/07/13 11:33:11 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au> * Tony Castley <tcastley@mail.powerup.com.au>
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
class MediaControlView; class MediaControlView;
class PlayListWindow; class PlayListWindow;
class CDMenu : public BMenu class CDMenu : public BMenu
{ {
public: public:
......
beos_SOURCES = beos.cpp aout_beos.cpp vout_beos.cpp intf_beos.cpp InterfaceWindow.cpp DrawingTidbits.cpp TransportButton.cpp PlayListWindow.cpp MediaControlView.cpp beos_SOURCES = beos.cpp aout_beos.cpp vout_beos.cpp intf_beos.cpp InterfaceWindow.cpp DrawingTidbits.cpp TransportButton.cpp PlayListWindow.cpp MediaControlView.cpp intf_vlc_wrapper.cpp
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* MediaControlView.cpp: beos interface * MediaControlView.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.cpp,v 1.7 2001/12/30 07:09:54 sam Exp $ * $Id: MediaControlView.cpp,v 1.7.2.1 2002/07/13 11:33:11 tcastley Exp $
* *
* Authors: Tony Castley <tony@castley.net> * Authors: Tony Castley <tony@castley.net>
* *
...@@ -141,6 +141,7 @@ MediaControlView::~MediaControlView() ...@@ -141,6 +141,7 @@ MediaControlView::~MediaControlView()
void MediaControlView::MessageReceived(BMessage *message) void MediaControlView::MessageReceived(BMessage *message)
{ {
BView::MessageReceived(message);
} }
void MediaControlView::SetProgress(uint64 seek, uint64 size) void MediaControlView::SetProgress(uint64 seek, uint64 size)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* MsgVals.h * MsgVals.h
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: MsgVals.h,v 1.9.2.1 2002/07/11 07:21:57 tcastley Exp $ * $Id: MsgVals.h,v 1.9.2.2 2002/07/13 11:33:11 tcastley Exp $
* *
* Authors: Tony Castley <tcastley@mail.powerup.com.au> * Authors: Tony Castley <tcastley@mail.powerup.com.au>
* *
...@@ -48,4 +48,5 @@ const uint32 RESIZE_100 = 'RSOR'; ...@@ -48,4 +48,5 @@ const uint32 RESIZE_100 = 'RSOR';
const uint32 RESIZE_200 = 'RSDB'; const uint32 RESIZE_200 = 'RSDB';
const uint32 ASPECT_CORRECT = 'ASCO'; const uint32 ASPECT_CORRECT = 'ASCO';
const uint32 VERT_SYNC = 'VSYN'; const uint32 VERT_SYNC = 'VSYN';
const uint32 WINDOW_FEEL = 'WFEL';
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface * intf_beos.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: intf_beos.cpp,v 1.38 2002/02/15 13:32:52 sam Exp $ * $Id: intf_beos.cpp,v 1.38.2.1 2002/07/13 11:33:11 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -43,16 +43,7 @@ extern "C" ...@@ -43,16 +43,7 @@ extern "C"
} }
#include "InterfaceWindow.h" #include "InterfaceWindow.h"
#include "intf_vlc_wrapper.h"
/*****************************************************************************
* intf_sys_t: description and status of FB interface
*****************************************************************************/
typedef struct intf_sys_s
{
InterfaceWindow * p_window;
char i_key;
} intf_sys_t;
extern "C" extern "C"
{ {
...@@ -108,6 +99,10 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -108,6 +99,10 @@ static int intf_Open( intf_thread_t *p_intf )
intf_ErrMsg( "error: cannot allocate memory for InterfaceWindow" ); intf_ErrMsg( "error: cannot allocate memory for InterfaceWindow" );
return( 1 ); return( 1 );
} }
p_intf->p_sys->b_disabled_menus = 0;
p_intf->p_sys->i_saved_volume = VOLUME_DEFAULT;
p_intf->p_sys->b_loop = 0;
p_intf->p_sys->b_mute = 0;
return( 0 ); return( 0 );
} }
......
This diff is collapsed.
/*****************************************************************************
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.h,v 1.1.2.1 2002/07/13 11:33:11 tcastley Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Tony Casltey <tony@castley.net>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
class InterfaceWindow;
/*****************************************************************************
* intf_sys_t: description and status of FB interface
*****************************************************************************/
typedef struct intf_sys_s
{
InterfaceWindow * p_window;
char i_key;
int b_disabled_menus;
int i_part;
int i_saved_volume;
int b_loop;
int i_channel;
int b_mute;
} intf_sys_t;
/* Intf_VLCWrapper is a singleton class
(only one instance at any time) */
class Intf_VLCWrapper
{
public:
static bool manage();
static void quit();
/* playlist control */
static bool playlistPlay();
static void playlistPause();
static void playlistStop();
static void playlistNext();
static void playlistPrev();
// static void channelNext();
// static void channelPrev();
static void loop();
/* playback control */
static void playSlower();
static void playFaster();
static void volume_mute();
static void volume_restore();
static void toggle_mute();
static void maxvolume();
// static void fullscreen();
static void eject();
/* playback info */
static BString* getTimeAsString();
static float getTimeAsFloat();
static void setTimeAsFloat(float i_offset);
static bool playlistPlaying();
static BList* playlistAsArray();
/* open file/disc/network */
static void openFiles(BList *o_files);
static void openDisc(BString o_type, BString o_device, int i_title, int i_chapter);
static void openNet(BString o_addr, int i_port);
static void openNetChannel(BString o_addr, int i_port);
static void openNetHTTP(BString o_addr);
/* menus management */
static void toggleProgram(int i_program);
static void toggleTitle(int i_title);
static void toggleChapter(int i_chapter);
static void toggleLanguage(int i_language);
static void toggleSubtitle(int i_subtitle);
static void setupMenus();
};
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.58.2.3 2002/07/11 12:24:45 tcastley Exp $ * $Id: vout_beos.cpp,v 1.58.2.4 2002/07/13 11:33:11 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -192,6 +192,15 @@ void VideoWindow::MessageReceived( BMessage *p_message ) ...@@ -192,6 +192,15 @@ void VideoWindow::MessageReceived( BMessage *p_message )
case VERT_SYNC: case VERT_SYNC:
vsync = !vsync; vsync = !vsync;
break; break;
case WINDOW_FEEL:
{
int16 winFeel;
if (p_message->FindInt16("WinFeel", &winFeel) == B_OK)
{
SetFeel((window_feel)winFeel);
}
}
break;
default: default:
BWindow::MessageReceived( p_message ); BWindow::MessageReceived( p_message );
break; break;
...@@ -409,7 +418,6 @@ void VLCView::MouseDown(BPoint point) ...@@ -409,7 +418,6 @@ void VLCView::MouseDown(BPoint point)
{ {
if (mouseButtons & B_SECONDARY_MOUSE_BUTTON) if (mouseButtons & B_SECONDARY_MOUSE_BUTTON)
{ {
//if (!menu) delete menu;
BPopUpMenu *menu = new BPopUpMenu("context menu"); BPopUpMenu *menu = new BPopUpMenu("context menu");
menu->SetRadioMode(false); menu->SetRadioMode(false);
// Toggle FullScreen // Toggle FullScreen
...@@ -427,6 +435,26 @@ void VLCView::MouseDown(BPoint point) ...@@ -427,6 +435,26 @@ void VLCView::MouseDown(BPoint point)
BMenuItem *vsyncItem = new BMenuItem("Vertical Sync", new BMessage(VERT_SYNC)); BMenuItem *vsyncItem = new BMenuItem("Vertical Sync", new BMessage(VERT_SYNC));
vsyncItem->SetMarked(vWindow->vsync); vsyncItem->SetMarked(vWindow->vsync);
menu->AddItem(vsyncItem); menu->AddItem(vsyncItem);
menu->AddSeparatorItem();
// Windwo Feel Items
BMessage *winNormFeel = new BMessage(WINDOW_FEEL);
winNormFeel->AddInt16("WinFeel", (int16)B_NORMAL_WINDOW_FEEL);
BMenuItem *normWindItem = new BMenuItem("Normal Window", winNormFeel);
normWindItem->SetMarked(vWindow->Feel() == B_NORMAL_WINDOW_FEEL);
menu->AddItem(normWindItem);
BMessage *winFloatFeel = new BMessage(WINDOW_FEEL);
winFloatFeel->AddInt16("WinFeel", (int16)B_FLOATING_APP_WINDOW_FEEL);
BMenuItem *onTopWindItem = new BMenuItem("App Top", winFloatFeel);
onTopWindItem->SetMarked(vWindow->Feel() == B_FLOATING_APP_WINDOW_FEEL);
menu->AddItem(onTopWindItem);
BMessage *winAllFeel = new BMessage(WINDOW_FEEL);
winAllFeel->AddInt16("WinFeel", (int16)B_FLOATING_ALL_WINDOW_FEEL);
BMenuItem *allSpacesWindItem = new BMenuItem("On Top All Workspaces", winAllFeel);
allSpacesWindItem->SetMarked(vWindow->Feel() == B_FLOATING_ALL_WINDOW_FEEL);
menu->AddItem(allSpacesWindItem);
menu->SetTargetForItems(this); menu->SetTargetForItems(this);
ConvertToScreen(&where); ConvertToScreen(&where);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment