Commit af691d06 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

BeOS interface: remove

This has been broken for sure since 1.0, most probably nuch earlier.
parent e4347611
......@@ -380,7 +380,6 @@ case "${host_os}" in
CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
VLC_ADD_CXXFLAGS([beos],[])
VLC_ADD_LIBS([vlc libvlccore logger],[-lbe])
VLC_ADD_LIBS([beos],[-lbe -lmedia -ltranslation -ltracker -lgame])
VLC_ADD_LIBS([dvdnav dvdread],[-ldl])
VLC_ADD_LIBS([filesystem],[-lpoll])
LDFLAGS_save="${LDFLAGS_save} -lintl"; LDFLAGS="${LDFLAGS_save}"
......@@ -390,11 +389,6 @@ case "${host_os}" in
else
VLC_ADD_LIBS([filesystem access_ftp access_mms access_output_udp oldtelnet netsync sap libvlccore growl_udp],[-lnet])
fi
dnl Ugly check for Zeta
if test -f /boot/beos/system/lib/libzeta.so; then
VLC_ADD_LIBS([beos],[-lzeta])
fi
;;
*)
SYS="${host_os}"
......@@ -4101,12 +4095,6 @@ dnl
AC_ARG_WITH(,[Interface plugins:])
dnl special case for BeOS
if test "${SYS}" = "beos"
then
VLC_ADD_PLUGIN([beos])
fi
dnl
dnl Skins2 module
dnl
......@@ -5039,7 +5027,6 @@ AC_CONFIG_FILES([
modules/demux/mpeg/Makefile
modules/demux/playlist/Makefile
modules/gui/Makefile
modules/gui/beos/Makefile
modules/gui/macosx/Makefile
modules/gui/hildon/Makefile
modules/gui/minimal_macosx/Makefile
......
......@@ -60,7 +60,6 @@ $Id$
* ball: Augmented reality ball video filter module
* bandlimited_resampler: Bandlimited interpolation audio resampler
* bda: DVB support for Windows BDA drivers
* beos: Audio output, video output and interface module for BeOS
* blend: a picture filter that blends two pictures
* blendbench: a picture filter that test performance of blending routines
* bluescreen: Bluescreen (weather channel like) video filter
......
DIST_SUBDIRS = beos macosx hildon minimal_macosx qt4 skins2 macosx_dialog_provider
DIST_SUBDIRS = macosx hildon minimal_macosx qt4 skins2 macosx_dialog_provider
SUBDIRS =
if HAVE_BEOS
SUBDIRS += beos
endif
if HAVE_DARWIN
SUBDIRS += macosx minimal_macosx macosx_dialog_provider
endif
......
/*****************************************************************************
* AudioOutput.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Eric Petit <titer@videolan.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <malloc.h>
#include <SoundPlayer.h>
#include <media/MediaDefs.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_aout.h>
extern "C"
{
#include <aout_internal.h>
}
/*****************************************************************************
* aout_sys_t: BeOS audio output method descriptor
*****************************************************************************/
typedef struct aout_sys_t
{
BSoundPlayer * p_player;
mtime_t latency;
} aout_sys_t;
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static void Play ( void * p_aout, void * p_buffer, size_t size,
const media_raw_audio_format & format );
static void DoNothing ( aout_instance_t * p_aout );
/*****************************************************************************
* OpenAudio
*****************************************************************************/
int OpenAudio ( vlc_object_t * p_this )
{
aout_instance_t * p_aout = (aout_instance_t*) p_this;
p_aout->output.p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
if( p_aout->output.p_sys == NULL )
return -1;
aout_sys_t * p_sys = p_aout->output.p_sys;
aout_VolumeSoftInit( p_aout );
int i_nb_channels = aout_FormatNbChannels( &p_aout->output.output );
/* BSoundPlayer does not support more than 2 channels AFAIK */
if( i_nb_channels > 2 )
{
i_nb_channels = 2;
p_aout->output.output.i_physical_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
}
media_raw_audio_format * p_format;
p_format = (media_raw_audio_format*)
malloc( sizeof( media_raw_audio_format ) );
p_format->channel_count = i_nb_channels;
p_format->frame_rate = p_aout->output.output.i_rate;
p_format->format = media_raw_audio_format::B_AUDIO_FLOAT;
#ifdef WORDS_BIGENDIAN
p_format->byte_order = B_MEDIA_BIG_ENDIAN;
#else
p_format->byte_order = B_MEDIA_LITTLE_ENDIAN;
#endif
p_format->buffer_size = 8192;
p_aout->output.output.i_format = VLC_CODEC_FL32;
p_aout->output.i_nb_samples = 2048 / i_nb_channels;
p_aout->output.pf_play = DoNothing;
p_sys->p_player = new BSoundPlayer( p_format, "player", Play, NULL, p_aout );
if( p_sys->p_player->InitCheck() != B_OK )
{
msg_Err( p_aout, "BSoundPlayer InitCheck failed" );
delete p_sys->p_player;
free( p_sys );
return -1;
}
/* Start playing */
p_sys->latency = p_sys->p_player->Latency();
p_sys->p_player->Start();
p_sys->p_player->SetHasData( true );
return 0;
}
/*****************************************************************************
* CloseAudio
*****************************************************************************/
void CloseAudio ( vlc_object_t * p_this )
{
aout_instance_t * p_aout = (aout_instance_t *) p_this;
aout_sys_t * p_sys = (aout_sys_t *) p_aout->output.p_sys;
/* Clean up */
p_sys->p_player->Stop();
delete p_sys->p_player;
free( p_sys );
}
/*****************************************************************************
* Play
*****************************************************************************/
static void Play( void * _p_aout, void * _p_buffer, size_t i_size,
const media_raw_audio_format &format )
{
aout_instance_t * p_aout = (aout_instance_t*) _p_aout;
float * p_buffer = (float*) _p_buffer;
aout_sys_t * p_sys = (aout_sys_t*) p_aout->output.p_sys;
aout_buffer_t * p_aout_buffer;
p_aout_buffer = aout_OutputNextBuffer( p_aout,
mdate() + p_sys->latency,
false );
if( p_aout_buffer != NULL )
{
vlc_memcpy( p_buffer, p_aout_buffer->p_buffer,
MIN( i_size, p_aout_buffer->i_buffer ) );
if( p_aout_buffer->i_buffer < i_size )
{
vlc_memset( p_buffer + p_aout_buffer->i_buffer,
0, i_size - p_aout_buffer->i_buffer );
}
aout_BufferFree( p_aout_buffer );
}
else
{
vlc_memset( p_buffer, 0, i_size );
}
}
/*****************************************************************************
* DoNothing
*****************************************************************************/
static void DoNothing( aout_instance_t *p_aout )
{
return;
}
/*****************************************************************************
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
/*****************************************************************************
* External prototypes
*****************************************************************************/
int OpenIntf ( vlc_object_t * );
void CloseIntf ( vlc_object_t * );
int OpenAudio ( vlc_object_t * );
void CloseAudio ( vlc_object_t * );
int OpenVideo ( vlc_object_t * );
void CloseVideo ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin ()
set_category( CAT_INTERFACE )
set_subcategory( SUBCAT_INTERFACE_MAIN )
add_bool( "beos-dvdmenus", false, NULL, _("Use DVD Menus"), "", true )
set_shortname( "BeOS" )
set_description( N_("BeOS standard API interface") )
set_capability( "interface", 100 )
set_callbacks( OpenIntf, CloseIntf )
add_submodule ()
set_capability( "video output", 100 )
set_callbacks( OpenVideo, CloseVideo )
add_submodule ()
set_capability( "audio output", 100 )
set_callbacks( OpenAudio, CloseAudio )
vlc_module_end ()
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*****************************************************************************
* DrawingTidbits.h
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef __DRAWING_TIBITS__
#define __DRAWING_TIBITS__
#include <GraphicsDefs.h>
rgb_color ShiftColor(rgb_color , float );
bool operator==(const rgb_color &, const rgb_color &);
bool operator!=(const rgb_color &, const rgb_color &);
inline rgb_color
Color(int32 r, int32 g, int32 b, int32 alpha = 255)
{
rgb_color result;
result.red = r;
result.green = g;
result.blue = b;
result.alpha = alpha;
return result;
}
const rgb_color kWhite = { 255, 255, 255, 255};
const rgb_color kBlack = { 0, 0, 0, 255};
const float kDarkness = 1.06;
const float kDimLevel = 0.6;
void ReplaceColor(BBitmap *bitmap, rgb_color from, rgb_color to);
void ReplaceTransparentColor(BBitmap *bitmap, rgb_color with);
// function can be used to scale the upper left part of
// a bitmap to fill the entire bitmap, ie fromWidth
// and fromHeight must be smaller or equal to the bitmaps size!
// only supported colorspaces are B_RGB32 and B_RGBA32
status_t scale_bitmap( BBitmap* bitmap,
uint32 fromWidth, uint32 fromHeight );
// bitmaps need to be the same size, or this function will fail
// currently supported conversions:
// B_YCbCr422 -> B_RGB32
// B_RGB32 -> B_RGB32
// B_RGB16 -> B_RGB32
// not yet implemented conversions:
// B_YCbCr420 -> B_RGB32
// B_YUV422 -> B_RGB32
status_t convert_bitmap(BBitmap* inBitmap, BBitmap* outBitmap);
// dims bitmap (in place) by finding the distance of
// the color at each pixel to the provided "center" color
// and shortens that distance by dimLevel
// (dimLevel < 1 -> less contrast)
// (dimLevel > 1 -> more contrast)
// (dimLevel < 0 -> inverted colors)
// currently supported colorspaces:
// B_RGB32
// B_RGBA32
// B_CMAP8
status_t dim_bitmap(BBitmap* bitmap, rgb_color center,
float dimLevel);
rgb_color dimmed_color_cmap8(rgb_color color, rgb_color center,
float dimLevel);
#endif // __DRAWING_TIBITS__
/*****************************************************************************
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Tony Castley <tony@castley.net>
* Richard Shepherd <richard@rshepherd.demon.co.uk>
* Stephan Aßmus <stippi@yellowbites.com>
* Eric Petit <titer@videolan.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <InterfaceKit.h>
#include <Application.h>
#include <Message.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_aout.h>
#include <aout_internal.h>
#include "InterfaceWindow.h"
#include "MsgVals.h"
/*****************************************************************************
* intf_sys_t: internal variables of the BeOS interface
*****************************************************************************/
struct intf_sys_t
{
InterfaceWindow * p_window;
};
/*****************************************************************************
* Local prototype
*****************************************************************************/
static void Run ( intf_thread_t *p_intf );
/*****************************************************************************
* intf_Open: initialize interface
*****************************************************************************/
int OpenIntf ( vlc_object_t *p_this )
{
intf_thread_t * p_intf = (intf_thread_t*) p_this;
/* Allocate instance and initialize some members */
p_intf->p_sys = (intf_sys_t*) malloc( sizeof( intf_sys_t ) );
if( !p_intf->p_sys )
return VLC_EGENERIC;
p_intf->pf_run = Run;
/* Create the interface window */
BScreen screen( B_MAIN_SCREEN_ID );
BRect rect = screen.Frame();
rect.top = rect.bottom - 100;
rect.bottom -= 50;
rect.left += 50;
rect.right = rect.left + 350;
p_intf->p_sys->p_window =
new InterfaceWindow( p_intf, rect, "VLC " VERSION );
if( !p_intf->p_sys->p_window )
{
free( p_intf->p_sys );
msg_Err( p_intf, "cannot allocate InterfaceWindow" );
return VLC_EGENERIC;
}
/* Make the be_app aware the interface has been created */
BMessage message( INTERFACE_CREATED );
message.AddPointer( "window", p_intf->p_sys->p_window );
be_app->PostMessage( &message );
return VLC_SUCCESS;
}
/*****************************************************************************
* intf_Close: destroy dummy interface
*****************************************************************************/
void CloseIntf ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t*) p_this;
/* Destroy the interface window */
if( p_intf->p_sys->p_window->Lock() )
p_intf->p_sys->p_window->Quit();
/* Destroy structure */
free( p_intf->p_sys );
}
/*****************************************************************************
* intf_Run: event loop
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
while( vlc_object_alive( p_intf ) )
{
p_intf->p_sys->p_window->UpdateInterface();
msleep( INTF_IDLE_SLEEP );
}
}
This diff is collapsed.
/*****************************************************************************
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
* Richard Shepherd <richard@rshepherd.demon.co.uk>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef BEOS_INTERFACE_WINDOW_H
#define BEOS_INTERFACE_WINDOW_H
#include <Menu.h>
#include <Window.h>
class BMenuBar;
class MediaControlView;
#if 0
class PlayListWindow;
#endif
class BFilePanel;
class PreferencesWindow;
class MessagesWindow;
class CDMenu : public BMenu
{
public:
CDMenu( const char* name );
virtual ~CDMenu();
virtual void AttachedToWindow();
private:
int GetCD( const char* directory );
};
class LanguageMenu : public BMenu
{
public:
LanguageMenu( intf_thread_t * p_intf,
const char * psz_name,
char * psz_variable );
virtual ~LanguageMenu();
virtual void AttachedToWindow();
private:
intf_thread_t * p_intf;
char * psz_variable;
};
class TitleMenu : public BMenu
{
public:
TitleMenu( const char* name, intf_thread_t *p_interface );
virtual ~TitleMenu();
virtual void AttachedToWindow();
intf_thread_t *p_intf;
};
class ChapterMenu : public BMenu
{
public:
ChapterMenu( const char* name, intf_thread_t *p_interface );
virtual ~ChapterMenu();
virtual void AttachedToWindow();
intf_thread_t *p_intf;
};
class InterfaceWindow : public BWindow
{
public:
InterfaceWindow( intf_thread_t * p_intf,
BRect frame,
const char * name );
virtual ~InterfaceWindow();
// BWindow
virtual void FrameResized( float width, float height );
virtual void MessageReceived( BMessage* message );
virtual bool QuitRequested();
// InterfaceWindow
void UpdateInterface();
void UpdatePlaylist();
bool IsStopped() const;
MediaControlView* p_mediaControl;
MessagesWindow* fMessagesWindow;
private:
void _SetMenusEnabled( bool hasFile,
bool hasChapters = false,
bool hasTitles = false );
void _UpdateSpeedMenu( int rate );
void _ShowFilePanel( uint32 command,
const char* windowTitle );
void _RestoreSettings();
void _StoreSettings();
intf_thread_t * p_intf;
input_thread_t * p_input;
playlist_t * p_playlist;
es_descriptor_t * p_spu_es;
bool b_playlist_update;
BFilePanel* fFilePanel;
#if 0
PlayListWindow* fPlaylistWindow;
#endif
PreferencesWindow* fPreferencesWindow;
BMenuBar* fMenuBar;
BMenuItem* fGotoMenuMI;
BMenuItem* fNextTitleMI;
BMenuItem* fPrevTitleMI;
BMenuItem* fNextChapterMI;
BMenuItem* fPrevChapterMI;
BMenuItem* fOnTopMI;
BMenuItem* fHeighthMI;
BMenuItem* fQuarterMI;
BMenuItem* fHalfMI;
BMenuItem* fNormalMI;
BMenuItem* fTwiceMI;
BMenuItem* fFourMI;
BMenuItem* fHeightMI;
BMenu* fAudioMenu;
BMenu* fNavigationMenu;
BMenu* fTitleMenu;
BMenu* fChapterMenu;
BMenu* fLanguageMenu;
BMenu* fSubtitlesMenu;
BMenu* fSpeedMenu;
BMenu* fShowMenu;
bigtime_t fLastUpdateTime;
BMessage* fSettings; // we keep the message arround
// for forward compatibility
};
// some global support functions
status_t load_settings( BMessage* message,
const char* fileName,
const char* folder = NULL );
status_t save_settings( BMessage* message,
const char* fileName,
const char* folder = NULL );
#endif // BEOS_INTERFACE_WINDOW_H
This diff is collapsed.
/*****************************************************************************
* ListViews.h: BeOS interface list view class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef LIST_VIEWS_H
#define LIST_VIEWS_H
#include <ListItem.h>
#include <ListView.h>
#include <String.h>
enum
{
DISPLAY_PATH = 0,
DISPLAY_NAME,
};
class InterfaceWindow;
// PlaylistItem
class PlaylistItem : public BStringItem
{
public:
PlaylistItem( const char* name );
virtual ~PlaylistItem();
virtual void Draw( BView* owner, BRect frame,
bool tintedLine,
uint32 mode,
bool active = false,
bool playing = false );
private:
BString fName; // additional to BStringItem::Text()
};
// DragSortableListView
class DragSortableListView : public BListView
{
public:
DragSortableListView( BRect frame,
const char* name,
list_view_type type
= B_SINGLE_SELECTION_LIST,
uint32 resizingMode
= B_FOLLOW_LEFT
| B_FOLLOW_TOP,
uint32 flags
= B_WILL_DRAW
| B_NAVIGABLE
| B_FRAME_EVENTS );
virtual ~DragSortableListView();
// BListView
virtual void Draw( BRect updateRect );
virtual bool InitiateDrag( BPoint point, int32 index,
bool wasSelected );
virtual void MessageReceived( BMessage* message );
virtual void MouseMoved( BPoint where, uint32 transit,
const BMessage* dragMessage );
virtual void MouseUp( BPoint where );
virtual void WindowActivated( bool active );
virtual void DrawItem( BListItem *item, BRect itemFrame,
bool complete = false);
// DragSortableListView
virtual void ModifiersChanged(); // called by window
virtual void MoveItems( BList& items, int32 toIndex );
virtual void CopyItems( BList& items, int32 toIndex );
virtual void RemoveItemList( BList& indices );
void RemoveSelected(); // uses RemoveItemList()
int32 CountSelectedItems() const;
virtual BListItem* CloneItem( int32 atIndex ) const = 0;
virtual void DrawListItem( BView* owner, int32 index,
BRect itemFrame ) const = 0;
virtual void MakeDragMessage( BMessage* message ) const = 0;
private:
void _SetDropAnticipationRect( BRect r );
void _SetDropIndex( int32 index );
void _RemoveDropAnticipationRect();
BRect fDropRect;
BMessage fDragMessageCopy;
protected:
int32 fDropIndex;
};
// PlaylistView
class PlaylistView : public DragSortableListView
{
public:
PlaylistView( intf_thread_t * p_intf,
BRect frame,
InterfaceWindow* mainWindow,
BMessage* selectionChangeMessage = NULL );
~PlaylistView();
// BListView
virtual void AttachedToWindow();
virtual void MessageReceived( BMessage* message );
virtual void MouseDown( BPoint where );
virtual void KeyDown( const char* bytes, int32 numBytes );
virtual void Pulse();
virtual void SelectionChanged();
// DragSortableListView
virtual void MoveItems( BList& items, int32 toIndex );
virtual void CopyItems( BList& items, int32 toIndex );
virtual void RemoveItemList( BList& indices );
virtual BListItem* CloneItem( int32 atIndex ) const;
virtual void DrawListItem( BView* owner, int32 index,
BRect itemFrame ) const;
virtual void MakeDragMessage( BMessage* message ) const;
// PlaylistView
void SetCurrent( int32 index );
void SetPlaying( bool playing );
void RebuildList();
void SortReverse();
void SortByPath();
void SortByName();
void SetDisplayMode( uint32 mode );
uint32 DisplayMode() const
{ return fDisplayMode; }
private:
BListItem* _PlayingItem() const;
void _SetPlayingIndex( BListItem* item );
intf_thread_t * p_intf;
int32 fCurrentIndex;
bool fPlaying;
uint32 fDisplayMode;
InterfaceWindow* fMainWindow;
BMessage* fSelectionChangeMessage;
PlaylistItem* fLastClickedItem;
};
#endif // LIST_VIEWS_H
This diff is collapsed.
/*****************************************************************************
* MediaControlView.h: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Tony Castley <tony@castley.net>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef BEOS_MEDIA_CONTROL_VIEW_H
#define BEOS_MEDIA_CONTROL_VIEW_H
#include <Box.h>
#include <Control.h>
class BBitmap;
class PlayPauseButton;
class PositionInfoView;
class SeekSlider;
class TransportButton;
class VolumeSlider;
class MediaControlView : public BBox
{
public:
MediaControlView( intf_thread_t * p_intf, BRect frame );
virtual ~MediaControlView();
// BBox
virtual void AttachedToWindow();
virtual void FrameResized(float width, float height);
virtual void GetPreferredSize(float* width, float* height);
virtual void MessageReceived(BMessage* message);
virtual void Pulse(); // detect stopped stream
// MediaControlView
void SetProgress( float position );
void SetStatus(int status, int rate);
void SetEnabled(bool enable);
void SetAudioEnabled(bool enable);
uint32 GetVolume() const;
void SetSkippable(bool backward,
bool forward);
void SetMuted(bool mute);
private:
void _LayoutControls(BRect frame) const;
BRect _MinFrame() const;
void _LayoutControl(BView* view,
BRect frame,
bool resizeWidth = false,
bool resizeHeight = false) const;
intf_thread_t * p_intf;
VolumeSlider* fVolumeSlider;
SeekSlider* fSeekSlider;
TransportButton* fSkipBack;
TransportButton* fSkipForward;
TransportButton* fRewind;
TransportButton* fForward;
PlayPauseButton* fPlayPause;
TransportButton* fStop;
TransportButton* fMute;
PositionInfoView* fPositionInfo;
int fCurrentRate;
int fCurrentStatus;
float fBottomControlHeight;
BRect fOldBounds;
bool fIsEnabled;
};
class SeekSlider : public BControl
{
public:
SeekSlider(intf_thread_t * p_intf,
BRect frame,
const char* name,
MediaControlView* owner );
virtual ~SeekSlider();
// BControl
virtual void AttachedToWindow();
virtual void Draw(BRect updateRect);
virtual void MouseDown(BPoint where);
virtual void MouseMoved(BPoint where, uint32 transit,
const BMessage* dragMessage);
virtual void MouseUp(BPoint where);
virtual void ResizeToPreferred();
// SeekSlider
void SetPosition(float position);
private:
int32 _ValueFor(float x) const;
void _StrokeFrame(BRect frame,
rgb_color left,
rgb_color top,
rgb_color right,
rgb_color bottom);
intf_thread_t * p_intf;
MediaControlView* fOwner;
bool fTracking;
};
class VolumeSlider : public BControl
{
public:
VolumeSlider(BRect frame,
const char* name,
int32 minValue,
int32 maxValue,
BMessage* message = NULL,
BHandler* target = NULL);
virtual ~VolumeSlider();
// BControl
virtual void AttachedToWindow();
virtual void SetValue(int32 value);
virtual void SetEnabled(bool enable);
virtual void Draw(BRect updateRect);
virtual void MouseDown(BPoint where);
virtual void MouseMoved(BPoint where, uint32 transit,
const BMessage* dragMessage);
virtual void MouseUp(BPoint where);
// VolumeSlider
bool IsValid() const;
void SetMuted(bool mute);
private:
void _MakeBitmaps();
void _DimBitmap(BBitmap* bitmap);
int32 _ValueFor(float xPos) const;
BBitmap* fLeftSideBits;
BBitmap* fRightSideBits;
BBitmap* fKnobBits;
bool fTracking;
bool fMuted;
int32 fMinValue;
int32 fMaxValue;
};
class PositionInfoView : public BView
{
public:
PositionInfoView( BRect frame,
const char* name,
intf_thread_t *p_intf );
virtual ~PositionInfoView();
// BView
virtual void Draw( BRect updateRect );
virtual void ResizeToPreferred();
virtual void GetPreferredSize( float* width,
float* height );
virtual void Pulse();
// PositionInfoView
enum
{
MODE_SMALL,
MODE_BIG,
};
void SetMode( uint32 mode );
void GetBigPreferredSize( float* width,
float* height );
void SetFile( int32 index, int32 size );
void SetTitle( int32 index, int32 size );
void SetChapter( int32 index, int32 size );
void SetTime( int32 seconds );
void SetTime( const char* string );
private:
void _InvalidateContents( uint32 which = 0 );
void _MakeString( BString& into,
int32 index,
int32 maxIndex ) const;
// void _DrawAlignedString( const char* string,
// BRect frame,
// alignment mode = B_ALIGN_LEFT );
uint32 fMode;
int32 fCurrentFileIndex;
int32 fCurrentFileSize;
int32 fCurrentTitleIndex;
int32 fCurrentTitleSize;
int32 fCurrentChapterIndex;
int32 fCurrentChapterSize;
int32 fSeconds;
BString fTimeString;
bigtime_t fLastPulseUpdate;
float fStackedWidthCache;
float fStackedHeightCache;
intf_thread_t * p_intf;
};
#endif // BEOS_MEDIA_CONTROL_VIEW_H
/*****************************************************************************
* MessagesWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Eric Petit <titer@videolan.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/* BeOS headers */
#include <InterfaceKit.h>
#include <SupportKit.h>
/* VLC headers */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_interface.h>
/* BeOS module headers */
#include "InterfaceWindow.h"
#include "MessagesWindow.h"
/*****************************************************************************
* MessagesView::Pulse
*****************************************************************************/
void MessagesView::Pulse()
{
bool isScrolling = false;
if( fScrollBar->LockLooper() )
{
float min, max;
fScrollBar->GetRange( &min, &max );
if( fScrollBar->Value() != max )
isScrolling = true;
fScrollBar->UnlockLooper();
}
int i_start, oldLength;
const char * psz_module_type = NULL;
rgb_color red = { 200, 0, 0 };
rgb_color gray = { 150, 150, 150 };
rgb_color green = { 0, 150, 0 };
rgb_color orange = { 230, 180, 00 };
rgb_color color;
vlc_mutex_lock( p_sub->p_lock );
int i_stop = *p_sub->pi_stop;
vlc_mutex_unlock( p_sub->p_lock );
if( p_sub->i_start != i_stop )
{
for( i_start = p_sub->i_start;
i_start != i_stop;
i_start = (i_start+1) % VLC_MSG_QSIZE )
{
/* Add message */
switch( p_sub->p_msg[i_start].i_type )
{
case VLC_MSG_INFO: color = green; break;
case VLC_MSG_WARN: color = orange; break;
case VLC_MSG_ERR: color = red; break;
case VLC_MSG_DBG: color = gray; break;
}
psz_module_type = p_sub->p_msg[i_start].psz_object_type;
if( LockLooper() )
{
oldLength = TextLength();
BString string;
string << p_sub->p_msg[i_start].psz_module
<< " " << psz_module_type << " : "
<< p_sub->p_msg[i_start].psz_msg << "\n";
Insert( TextLength(), string.String(), strlen( string.String() ) );
SetFontAndColor( oldLength, TextLength(), NULL, 0, &color );
Draw( Bounds() );
UnlockLooper();
}
}
vlc_mutex_lock( p_sub->p_lock );
p_sub->i_start = i_start;
vlc_mutex_unlock( p_sub->p_lock );
}
/* Scroll at the end unless the is user is scrolling or selecting something */
int32 start, end;
GetSelection( &start, &end );
if( !isScrolling && start == end && fScrollBar->LockLooper() )
{
float min, max;
fScrollBar->GetRange( &min, &max );
fScrollBar->SetValue( max );
fScrollBar->UnlockLooper();
}
BTextView::Pulse();
}
/*****************************************************************************
* MessagesWindow::MessagesWindow
*****************************************************************************/
MessagesWindow::MessagesWindow( intf_thread_t * _p_intf,
BRect frame, const char * name )
: BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_ZOOMABLE ),
p_intf(_p_intf)
{
SetSizeLimits( 400, 2000, 200, 2000 );
p_sub = msg_Subscribe( p_intf );
BRect rect, textRect;
rect = Bounds();
rect.right -= B_V_SCROLL_BAR_WIDTH;
textRect = rect;
textRect.InsetBy( 5, 5 );
fMessagesView = new MessagesView( p_sub,
rect, "messages", textRect,
B_FOLLOW_ALL, B_WILL_DRAW );
fMessagesView->MakeEditable( false );
fMessagesView->SetStylable( true );
fScrollView = new BScrollView( "scrollview", fMessagesView, B_WILL_DRAW,
B_FOLLOW_ALL, false, true );
fMessagesView->fScrollBar = fScrollView->ScrollBar( B_VERTICAL );
AddChild( fScrollView );
/* start window thread in hidden state */
Hide();
Show();
}
/*****************************************************************************
* MessagesWindow::~MessagesWindow
*****************************************************************************/
MessagesWindow::~MessagesWindow()
{
msg_Unsubscribe( p_intf, p_sub );
}
/*****************************************************************************
* MessagesWindow::FrameResized
*****************************************************************************/
void MessagesWindow::FrameResized( float width, float height )
{
BWindow::FrameResized( width, height );
BRect rect = fMessagesView->Bounds();
rect.InsetBy( 5, 5 );
fMessagesView->SetTextRect( rect );
}
/*****************************************************************************
* MessagesWindow::QuitRequested
*****************************************************************************/
bool MessagesWindow::QuitRequested()
{
Hide();
return false;
}
/*****************************************************************************
* MessagesWindow::ReallyQuit
*****************************************************************************/
void MessagesWindow::ReallyQuit()
{
Lock();
Hide();
Quit();
}
/*****************************************************************************
* MessagesWindow.h
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Eric Petit <titer@videolan.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef BEOS_MESSAGES_WINDOW_H
#define BEOS_MESSAGES_WINDOW_H
#include <Window.h>
class MessagesView : public BTextView
{
public:
MessagesView( msg_subscription_t * _p_sub,
BRect rect, char * name, BRect textRect,
uint32 resizingMode, uint32 flags )
: BTextView( rect, name, textRect,
resizingMode, flags ),
p_sub(_p_sub)
{
}
virtual void Pulse();
msg_subscription_t * p_sub;
BScrollBar * fScrollBar;
};
class MessagesWindow : public BWindow
{
public:
MessagesWindow( intf_thread_t * p_intf,
BRect frame, const char * name );
virtual ~MessagesWindow();
virtual void FrameResized( float, float );
virtual bool QuitRequested();
void ReallyQuit();
intf_thread_t * p_intf;
msg_subscription_t * p_sub;
BView * fBackgroundView;
MessagesView * fMessagesView;
BScrollView * fScrollView;
};
#endif // BEOS_PREFERENCES_WINDOW_H
SOURCES_beos = \
BeOS.cpp \
AudioOutput.cpp \
VideoOutput.cpp \
Interface.cpp \
InterfaceWindow.cpp \
InterfaceWindow.h \
ListViews.cpp \
ListViews.h \
DrawingTidbits.cpp \
DrawingTidbits.h \
TransportButton.cpp \
TransportButton.h \
PlayListWindow.cpp \
PlayListWindow.h \
PreferencesWindow.cpp \
PreferencesWindow.h \
MessagesWindow.cpp \
MessagesWindow.h \
MediaControlView.cpp \
MediaControlView.h \
Bitmaps.h \
MsgVals.h \
VideoWindow.h \
$(NULL)
/*****************************************************************************
* MsgVals.h
*****************************************************************************
* Copyright (C) 2001 the VideoLAN team
* $Id$
*
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef BEOS_MESSAGE_VALUES_H
#define BEOS_MESSAGE_VALUES_H
#define PLAYING 0
#define PAUSED 1
#define OPEN_FILE 'opfl'
#define OPEN_DVD 'opdv'
#define LOAD_SUBFILE 'losu'
#define SUBFILE_RECEIVED 'sure'
#define OPEN_PLAYLIST 'oppl'
#define STOP_PLAYBACK 'stpl'
#define START_PLAYBACK 'play'
#define PAUSE_PLAYBACK 'papl'
#define HEIGHTH_PLAY 'hhpl'
#define QUARTER_PLAY 'qupl'
#define HALF_PLAY 'hapl'
#define NORMAL_PLAY 'nrpl'
#define TWICE_PLAY 'twpl'
#define FOUR_PLAY 'fopl'
#define HEIGHT_PLAY 'hepl'
#define SEEK_PLAYBACK 'seek'
#define VOLUME_CHG 'voch'
#define VOLUME_MUTE 'mute'
#define SELECT_CHANNEL 'chan'
#define SELECT_SUBTITLE 'subt'
#define PREV_TITLE 'prti'
#define NEXT_TITLE 'nxti'
#define TOGGLE_TITLE 'tgti'
#define PREV_CHAPTER 'prch'
#define NEXT_CHAPTER 'nxch'
#define TOGGLE_CHAPTER 'tgch'
#define PREV_FILE 'prfl'
#define NEXT_FILE 'nxfl'
#define NAVIGATE_PREV 'navp' // could be chapter, title or file
#define NAVIGATE_NEXT 'navn' // could be chapter, title or file
#define OPEN_PREFERENCES 'pref'
#define OPEN_MESSAGES 'mess'
#define TOGGLE_ON_TOP 'ontp'
#define SHOW_INTERFACE 'shin'
#define TOGGLE_FULL_SCREEN 'tgfs'
#define RESIZE_50 'rshl'
#define RESIZE_100 'rsor'
#define RESIZE_200 'rsdb'
#define RESIZE_TRUE 'rstr'
#define ASPECT_CORRECT 'asco'
#define VERT_SYNC 'vsyn'
#define WINDOW_FEEL 'wfel'
#define SCREEN_SHOT 'scrn'
#define MSG_UPDATE 'updt'
#define MSG_SOUNDPLAY 'move' // drag'n'drop from soundplay playlist
#define INTERFACE_CREATED 'ifcr' /* see VlcApplication::MessageReceived()
* in src/misc/beos_specific.cpp */
#define SHORTCUT 'shcu'
#endif // BEOS_MESSAGE_VALUES_H
This diff is collapsed.
/*****************************************************************************
* PlayListWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
* Richard Shepherd <richard@rshepherd.demon.co.uk>
* Stephan Aßmus <stippi@yellowbites.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#if 0
#ifndef BEOS_PLAY_LIST_WINDOW_H
#define BEOS_PLAY_LIST_WINDOW_H
#include <Window.h>
class BMenuItem;
class InterfaceWindow;
class PlaylistView;
class PlayListWindow : public BWindow
{
public:
PlayListWindow(BRect frame,
const char* name,
InterfaceWindow* mainWindow,
intf_thread_t *p_interface );
virtual ~PlayListWindow();
// BWindow
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
virtual void FrameResized(float width, float height);
// PlayListWindow
void ReallyQuit();
void UpdatePlaylist( bool rebuild = false );
void SetDisplayMode( uint32 mode );
uint32 DisplayMode() const;
private:
void _CheckItemsEnableState() const;
void _SetMenuItemEnabled( BMenuItem* item,
bool enabled ) const;
PlaylistView * fListView;
BView * fBackgroundView;
BMenuBar * fMenuBar;
InterfaceWindow * fMainWindow;
BMenuItem* fSelectAllMI;
BMenuItem* fSelectNoneMI;
BMenuItem* fSortReverseMI;
BMenuItem* fSortNameMI;
BMenuItem* fSortPathMI;
BMenuItem* fRandomizeMI;
BMenuItem* fRemoveMI;
BMenuItem* fRemoveAllMI;
BMenu* fViewMenu;
intf_thread_t * p_intf;
};
#endif // BEOS_PLAY_LIST_WINDOW_H
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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