remove these non BeOS R5 compatible headers

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@690 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-08-10 22:33:26 +00:00
parent bee021cf93
commit e7d9c8df6b
9 changed files with 0 additions and 862 deletions
-138
View File
@@ -1,138 +0,0 @@
/*****************************************************************************/
// DirectWindow.h
//
// A "client window class for direct screen access."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_DIRECT_WINDOW
#define GAME_KIT_DIRECT_WINDOW
#include <Region.h>
#include <Window.h>
class BDirectDriver;
// State of the direct access when called back through DirectConnected.
enum direct_buffer_state
{
B_DIRECT_MODE_MASK = 15,
B_DIRECT_START = 0,
B_DIRECT_STOP = 1,
B_DIRECT_MODIFY = 2,
B_CLIPPING_MODIFIED = 16,
B_BUFFER_RESIZED = 32,
B_BUFFER_MOVED = 64,
B_BUFFER_RESET = 128
};
// State of the direct driver and its hooks functions.
enum direct_driver_state
{
B_DRIVER_CHANGED = 0x0001,
B_MODE_CHANGED = 0x0002
};
// Frame buffer access descriptor.
typedef struct
{
direct_buffer_state buffer_state;
direct_driver_state driver_state;
void *bits;
void *pci_bits;
int32 bytes_per_row;
uint32 bits_per_pixel;
color_space pixel_format;
buffer_layout layout;
buffer_orientation orientation;
uint32 _reserved[9];
uint32 _dd_type_;
uint32 _dd_token_;
uint32 clip_list_count;
clipping_rect window_bounds;
clipping_rect clip_bounds;
clipping_rect clip_list[1];
} direct_buffer_info;
class BDirectWindow : public BWindow
{
public:
// Construction and destruction.
BDirectWindow( BRect frame, const char* pTitle, window_type type,
uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE );
BDirectWindow( BRect frame, const char* pTitle, window_look look,
window_feel feel, uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE );
virtual ~BDirectWindow();
// Save and restore.
static BArchivable* Instantiate( BMessage* pData );
virtual status_t Archive( BMessage *data, bool deep = true ) const;
virtual void DirectConnected( direct_buffer_info* pInfo );
status_t GetClippingRegion( BRegion* pRegion, BPoint* pOrigin = NULL ) const;
status_t SetFullScreen( bool enable );
bool IsFullScreen() const;
static bool SupportsWindowMode( screen_id = B_MAIN_SCREEN_ID );
// Defined for future extension (fragile base class). Otherwise
// identical to BWindow.
virtual void Quit();
virtual void DispatchMessage( BMessage* pMessage, BHandler* pHandler );
virtual void MessageReceived( BMessage* pMessage );
virtual void FrameMoved( BPoint new_position );
virtual void WorkspacesChanged( uint32 old_workspace, uint32 new_workspace );
virtual void WorkspaceActivated( int32 workspace, bool state );
virtual void FrameResized( float new_width, float new_height );
virtual void Minimize( bool minimize );
virtual void Zoom( BPoint rec_position, float rec_width, float rec_height );
virtual void ScreenChanged( BRect screen_size, color_space depth );
virtual void MenusBeginning();
virtual void MenusEnded();
virtual void WindowActivated( bool state );
virtual void Show();
virtual void Hide();
virtual status_t GetSupportedSuites( BMessage* pData );
virtual status_t Perform( perform_code performCode, void* pArg );
virtual BHandler * ResolveSpecifier( BMessage* pMsg, int32 index,
BMessage* pSpecifier, int32 form, const char* pProperty );
private:
// No copying allowed.
BDirectWindow();
BDirectWindow( BDirectWindow& );
BDirectWindow& operator=( BDirectWindow& );
private:
// Fill in all the particulars relating to our implementation,
// once we know what they're going to be, here.
}
#endif // GAME_KIT_DIRECT_WINDOW
-80
View File
@@ -1,80 +0,0 @@
/*****************************************************************************/
// FileGameSound.h
//
// This is "a class that streams data out of a file."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_FILE_GAME_SOUND
#define GAME_KIT_FILE_GAME_SOUND
#include <StreamingGameSound.h>
class BMediaFile;
namespace BPrivate
{
class BTrackReader;
}
class BFileGameSound : public BStreamingGameSound
{
public:
BFileGameSound( const entry_ref* pFile, bool looping = true,
BGameSoundDevice* pDevice = NULL );
BFileGameSound( const char* pFilename, bool looping = true,
BGameSoundDevice* pDevice = NULL );
virtual ~BFileGameSound();
virtual BGameSound* Clone() const;
virtual status_t StartPlaying();
virtual status_t StopPlaying();
// Use this if you have stopped and want to start again quickly.
status_t Preload();
virtual void FillBuffer( void* pInBuffer, size_t inByteCount );
virtual status_t Perform( int32 selector, void* pData );
virtual status_t SetPaused( bool isPaused, bigtime_t rampTime );
enum
{
B_NOT_PAUSED,
B_PAUSE_IN_PROGRESS,
B_PAUSED
};
int32 IsPaused();
private:
// Leave these declarations private unless you plan on actually
// implementing and using them.
BFileGameSound();
BFileGameSound( const BFileGameSound& );
BFileGameSound& operator=( const BFileGameSound& );
};
#endif // GAME_KIT_FILE_GAME_SOUND
-35
View File
@@ -1,35 +0,0 @@
/*****************************************************************************/
// GameKit.h
//
// Includes headers for all classes that comprise the GameKit.
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#include <DirectWindow.h>
#include <FileGameSound.h>
#include <GameSound.h>
#include <GameSoundDefs.h>
#include <PushGameSound.h>
#include <SimpleGameSound.h>
#include <StreamingGameSound.h>
#include <WindowScreen.h>
-98
View File
@@ -1,98 +0,0 @@
/*****************************************************************************/
// GameSound.h
//
// This is an abstract base class for "all sounds being played using the
// gamesound kit. Use one of the concrete subclasses for actually playing
// sound."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_GAME_SOUND
#define GAME_KIT_GAME_SOUND
#include <GameSoundDefs.h>
#include <new>
struct gs_audio_format;
class BGameSoundDevice;
class BGameSound
{
public:
BGameSound( BGameSoundDevice* pDevice = NULL );
virtual ~BGameSound();
virtual BGameSound* Clone() const = 0;
status_t InitCheck() const;
BGameSoundDevice* Device() const;
gs_id ID() const;
// Only valid after Init().
const gs_audio_format& Format() const;
virtual status_t StartPlaying();
virtual bool IsPlaying();
virtual status_t StopPlaying();
// Ramp duration is in seconds.
status_t SetGain( float gain, bigtime_t duration = 0 );
status_t SetPan( float pan, bigtime_t duration = 0 );
float Gain();
float Pan();
virtual status_t SetAttributes( gs_attribute* pInAttributes,
size_t inAttributeCount );
virtual status_t GetAttributes( gs_attribute* pOutAttributes,
size_t outAttributeCount );
virtual status_t Perform( int32 selector, void * data );
void* operator new( size_t size );
void* operator new( size_t size, const nothrow_t& ) throw();
void operator delete( void* ptr );
void operator delete( void* ptr, const nothrow_t& ) throw();
// These were implemented in BPrivGameSound, presumably
// for reasons of privacy. If that's the only reason, then
// we can put them here, because you've got the source, my man.
// Otherwise, we'll put 'em where they have to be.
static status_t SetMemoryPoolSize( size_t in_poolSize );
static status_t LockMemoryPool( bool in_lockInCore );
static int32 SetMaxSoundCount( int32 in_maxCount );
protected:
status_t SetInitError( status_t in_initError );
status_t Init( gs_id handle );
BGameSound( const BGameSound& other );
BGameSound& operator=( const BGameSound & other );
private:
BGameSound();
// Our implementation details go here.
};
#endif // GAME_KIT_GAME_SOUND
-103
View File
@@ -1,103 +0,0 @@
/*****************************************************************************/
// GameSoundDefs.h
//
// "Definitions of common types and constants for the gamesound kit."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_GAME_SOUND_DEFS
#define GAME_KIT_GAME_SOUND_DEFS
#include <SupportDefs.h>
#define B_GS_CUR_API_VERSION B_BEOS_VERSION
#define B_GS_MIN_API_VERSION 0x100
typedef int32 gs_id;
// Invalid sound handle.
#define B_GS_INVALID_SOUND ((gs_id)-1)
// gs_id for the main mix buffer.
#define B_GS_MAIN_SOUND ((gs_id)-2)
// FIXME - renumber to real error messages.
enum
{
B_GS_BAD_HANDLE = -99999,
B_GS_NO_SOUNDS,
B_GS_NO_HARDWARE,
B_GS_ALREADY_COMMITTED,
B_GS_READ_ONLY_VALUE
};
struct gs_audio_format
{
// Same as media_raw_audio_format.
enum format
{
B_GS_U8 = 0x11, // 128 == mid, 1 == bottom, 255 == top.
B_GS_S16 = 0x2, // 0 == mid, -32767 == bottom, +32767 == top.
B_GS_F = 0x24, // 0 == mid, -1.0 == bottom, 1.0 == top.
B_GS_S32 = 0x4 // 0 == mid, 0x80000001 == bottom, 0x7fffffff == top.
};
float frame_rate;
uint32 channel_count; // 1 or 2, mostly.
uint32 format; // For compressed formats, go to media_encoded_audio_format.
uint32 byte_order; // 2 for little endian, 1 for big endian.
size_t buffer_size; // Size of each buffer -- NOT GUARANTEED.
};
enum gs_attributes
{
B_GS_NO_ATTRIBUTE = 0, // When there is no attribute.
B_GS_MAIN_GAIN = 1, // 0 == 0 dB, -6.0 == -6 dB (gs_id ignored).
B_GS_CD_THROUGH_GAIN, // 0 == 0 dB, -12.0 == -12 dB (gs_id ignored).
// But which CD?
B_GS_GAIN = 128, // 0 == 0 dB, -1.0 == -1 dB, +10.0 == +10 dB.
B_GS_PAN, // 0 == middle, -1.0 == left, +1.0 == right.
B_GS_SAMPLING_RATE, // 44100.0 == 44.1 kHz.
B_GS_LOOPING, // 0 == no.
B_GS_FIRST_PRIVATE_ATTRIBUTE = 90000,
B_GS_FIRST_USER_ATTRIBUTE = 100000
};
struct gs_attribute
{
int32 attribute; // Which attribute.
bigtime_t duration; // How long of time to ramp over for the change.
float value; // Where the value stops changing.
uint32 flags; // Whatever flags are for the attribute.
};
struct gs_attribute_info
{
int32 attribute;
float granularity;
float minimum;
float maximum;
};
#endif // GAME_KIT_GAME_SOUND_DEFS
-87
View File
@@ -1,87 +0,0 @@
/*****************************************************************************/
// PushGameSound.h
//
// This is "a class for games that want to push data at the system,
// rather than have a callback get called."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_PUSH_GAME_SOUND
#define GAME_KIT_PUSH_GAME_SOUND
#include <StreamingGameSound.h>
class BPushGameSound : public BStreamingGameSound
{
public:
BPushGameSound( size_t inBufferFrameCount,
const gs_audio_format* pFormat, size_t inBufferCount = 2,
BGameSoundDevice* pDevice = NULL );
virtual ~BPushGameSound();
enum lock_status
{
lock_failed = -1, // not yet time to do more
lock_ok = 0, // do more
lock_ok_frames_dropped // you may have missed some buffers
};
virtual lock_status LockNextPage( void** ppOut_pagePtr,
size_t* pOut_pageSize );
virtual status_t UnlockPage( void* pIn_pagePtr );
virtual lock_status LockForCyclic( void** ppOut_basePtr,
size_t* pOut_size );
virtual status_t UnlockCyclic();
virtual size_t CurrentPosition();
virtual BGameSound* Clone() const;
virtual status_t Perform( int32 selector, void* pData );
protected:
// Will allocate handle and call Init().
virtual status_t SetParameters( size_t inBufferFrameCount,
const gs_audio_format* pFormat, size_t inBufferCount );
virtual status_t SetStreamHook(
void (*hook)( void* pInCookie, void* pInBuffer, size_t inByteCount, BStreamingGameSound* pMe ),
void* pCookie );
// Default is to call stream hook, if any.
virtual void FillBuffer( void* pInBuffer, size_t inByteCount );
private:
// Leave these declarations private unless you plan on actually
// implementing and using them.
BPushGameSound();
BPushGameSound( const BPushGameSound& );
BPushGameSound& operator=( const BPushGameSound& );
};
#endif // GAME_KIT_PUSH_GAME_SOUND
-64
View File
@@ -1,64 +0,0 @@
/*****************************************************************************/
// SimpleGameSound.h
//
// This is "a class for sound effects that are short, and consist of
// non-changing samples in memory."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_SIMPLE_GAME_SOUND
#define GAME_KIT_SIMPLE_GAME_SOUND
#include <GameSound.h>
class BSimpleGameSound : public BGameSound
{
public:
BSimpleGameSound( const entry_ref* pInFile,
BGameSoundDevice* pDevice = NULL );
BSimpleGameSound( const char* pInFile,
BGameSoundDevice* pDevice = NULL );
BSimpleGameSound( const void* pInData,
size_t inFrameCount, const gs_audio_format* pFormat,
BGameSoundDevice* pDevice = NULL );
BSimpleGameSound( const BSimpleGameSound& other );
virtual ~BSimpleGameSound();
virtual BGameSound* Clone() const;
virtual status_t Perform( int32 selector, void* pData );
status_t SetIsLooping( bool looping );
bool IsLooping() const;
private:
// Leave these declarations private unless you plan on actually
// implementing and using them.
BSimpleGameSound();
BSimpleGameSound& operator=( const BSimpleGameSound& );
};
#endif
-83
View File
@@ -1,83 +0,0 @@
/*****************************************************************************/
// StreamingGameSound.h
//
// This is "a class for all kinds of streaming (data not known beforehand)
// game sounds."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_STREAMING_GAME_SOUND
#define GAME_KIT_STREAMING_GAME_SOUND
#include <SupportDefs.h>
#include <GameSound.h>
#include <Locker.h>
class BStreamingGameSound : public BGameSound
{
public:
BStreamingGameSound( size_t inBufferFrameCount,
const gs_audio_format* pFormat, size_t inBufferCount = 2,
BGameSoundDevice* pDevice = NULL );
virtual ~BStreamingGameSound();
virtual BGameSound* Clone() const;
virtual status_t SetStreamHook(
void (*hook)( void* pInCookie, void* pInBuffer, size_t inByteCount, BStreamingGameSound* pMe ),
void* pCookie );
// The default is to call stream hook, if any.
virtual void FillBuffer( void * inBuffer, size_t inByteCount );
virtual status_t SetAttributes( gs_attribute* inAttributes,
size_t inAttributeCount );
virtual status_t Perform( int32 selector, void* pData );
protected:
BStreamingGameSound( BGameSoundDevice* pDevice );
// Will allocate handle and call Init().
virtual status_t SetParameters( size_t inBufferFrameCount,
const gs_audio_format* pFormat, size_t inBufferCount );
bool Lock();
void Unlock();
private:
BLocker _m_lock;
static void stream_callback( void* pCookie, gs_id handle,
void* pBuffer, int32 offset, int32 size, size_t bufSize );
// Leave these declarations private unless you plan on actually
// implementing and using them.
BStreamingGameSound();
BStreamingGameSound( const BStreamingGameSound& );
BStreamingGameSound& operator=( const BStreamingGameSound& );
};
#endif // GAME_KIT_STREAMING_GAME_SOUND
-174
View File
@@ -1,174 +0,0 @@
/*****************************************************************************/
// WindowScreen.h
//
// This is a "client window class for direct screen access."
//
//
// Copyright (c) 2001 OpenBeOS Project
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#ifndef GAME_KIT_WINDOW_SCREEN
#define GAME_KIT_WINDOW_SCREEN
#include <kernel/image.h>
#include <Accelerant.h>
#include <BeBuild.h>
#include <GraphicsCard.h>
#include <OS.h>
#include <SupportDefs.h>
#include <Window.h>
// Private struct.
typedef struct
{
area_id memory_area;
area_id io_area;
char addon_path[64+B_FILE_NAME_LENGTH];
} _direct_screen_info_;
// Private typedef.
typedef int32 (*_add_on_control_)( uint32,void* );
// Global function, allowing to move the position of the mouse when
// the GameKit is in control of the screen.
_IMPEXP_GAME void set_mouse_position( int32 x, int32 y );
//********************* WARNING - WARNING - WARNING ***********************************
// This is the current version of WindowScreen. The main purpose of this object is to
// establish a direct connexion between application and graphic driver, to increase
// efficiency and abilities. The graphic driver architecture will overcome serious
// changes in the next release, consequently this could only be a preview version of
// the real WindowScreen API.
//
// Question - is what follows below still true?
// Answer - to be determined.
//
// "Nevertheless, compatibility will be insured in future releases FOR MOST OF THE API,
// through the use of a compatibility library (the new game library having a name
// different from "libgame.so"), or a compatibility class (the new WindowScreen class
// using a different name). Part of the API for which compatibility will not be insure
// after the Preview Release are specifically pointed out in the following declarations."
//***************************************************************************************
enum
{
B_ENABLE_VIEW_DRAWING = 0x0001,
B_ENABLE_DEBUGGER = 0x0002
};
class BWindowScreen : public BWindow
{
public:
BWindowScreen( const char* pTitle, uint32 space, status_t* pError,
bool debug_enable = false );
BWindowScreen( const char *pTitle, uint32 space, uint32 attributes,
status_t* pError );
virtual ~BWindowScreen();
virtual void Quit();
virtual void ScreenConnected( bool active );
void Disconnect();
virtual void WindowActivated( bool active );
virtual void WorkspaceActivated( int32 workspace, bool state );
virtual void ScreenChanged( BRect screen_size, color_space depth );
virtual void Hide();
virtual void Show();
void SetColorList( rgb_color* pList, int32 first_index = 0, int32 last_index = 255 );
status_t SetSpace( uint32 space );
bool CanControlFrameBuffer();
status_t SetFrameBuffer( int32 width, int32 height );
status_t MoveDisplayArea( int32 x, int32 y );
// IOBase will not be supported in a future compatibility version of
// WindowScreen. Its features should be replaced by other functions
// of the new API.
void *IOBase();
rgb_color* ColorList();
frame_buffer_info* FrameBufferInfo();
graphics_card_hook CardHookAt( int32 index );
graphics_card_info* CardInfo();
//******************************* Debugger API Notice ********************************
// Those three calls, and the debug_enable flag in the constructor, have been added to
// help debugging a WindowScreen application without a cross-developement platform or
// the use of serial debug output.
//
// To use them, you need to :
// - enable the debug mode by setting the debug_enable flag of the constructor to "true".
// - register all threads that could be accessing the screen directly at any time. To do
// that, call RegisterThread after spawning the new thread and before resuming
// it (you should never draw from the Window thread itself, neither register it).
// - launch your application from Terminal. The GameKit will first swicth to another
// workspace before opening the WindowScreen. If you launch from workspace 0 [Alt-F1],
// it will choose the workspace 1 [Alt-F2]. For any other workspace, it will choose
// the previous one (for example, for workspace 3 (Alt-F4), it will choose workspace 2
// [Alt-F3]).
//
// Then :
// - You can use printf(...) anywhere to display informations that will be logged in the
// Terminal window. You can go back to the Terminal Window at any time (using the
// correct Alt-F?? key). Switching workspace will automatically suspend all the thread
// you registered and save the graphic context. Switching back to the WindowScreen
// workspace will restore everything and resume your application.
// - If you need to save and restore more states when your application is suspended and
// resumed, you can overwrite the ForceSwitchForDebug() method. This function is called
// with active == true just after suspending your app, and active == false just before
// resuming it.
// - You can suspend your application by calling the Debugger() method. This will also
// switch to the Terminal workspace. Then you can resume by just switchng back to the
// WindowScreen workspace (using the good Alt-F?? key). It's better not to call Debugger()
// with the WindowScreen locked.
//
// In case of crash :
// - Use the safety short-cut : All the left modifiers (Ctrl, Shift, Option, Command, Alt
// or equivalents) of your keyboard and F12. That should send you back to 640x480, and
// the debugger terminal should be visible (and usable) if any.
// - Then, you can also switch to your Terminal workspace to check the last printf infos.
// - After you got (we hope) more information about your (or our :-) bug, quit the debugger
// window. Then you should be able to change your code and run your application again.
// In any case, check the Error() function immediately after the WindowScreen constructor.
// A bad error code will mean that the GameKit is in a inconsistent state, and then you
// have better to reboot your machine. If you don't want to reboot, you can also try to
// run your application in a different workspace.
//
// It's far from perfect, but we hope it will still help.
//
// The Debug API will not be support after the Preview Release (replaced by the debug
// API in the new WindowScreen class).
//**************************************************************************************
void RegisterThread( thread_id id );
virtual void SuspensionHook( bool active );
void Suspend( char* pLabel );
virtual status_t Perform( perform_code d, void* pArg );
private:
BWindowScreen();
BWindowScreen( BWindowScreen& );
BWindowScreen& operator=( BWindowScreen& );
};
#endif // GAME_KIT_WINDOW_SCREEN