* More header cleanup, continuing korli's work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36206 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
** Copyright 2002-04, Thomas Kurschel. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
* Copyright 2002-2004, Thomas Kurschel. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _SCSI_BUS_RAW_DRIVER_H
|
||||
#define _SCSI_BUS_RAW_DRIVER_H
|
||||
|
||||
/*
|
||||
Part of Open SCSI bus manager
|
||||
|
||||
/*! Part of Open SCSI bus manager
|
||||
|
||||
Devfs entry for raw bus access.
|
||||
|
||||
@@ -13,11 +15,10 @@
|
||||
be retrieved from.
|
||||
*/
|
||||
|
||||
#ifndef _SCSI_BUS_RAW_DRIVER_H
|
||||
#define _SCSI_BUS_RAW_DRIVER_H
|
||||
|
||||
#include <Drivers.h>
|
||||
|
||||
|
||||
// we start with +300 to not collide with any other SCSI opcode defined
|
||||
// in scsiprobe_driver.h or scsi.h;
|
||||
// all ioctl calls return the subsystem status (see SCSI.h)
|
||||
@@ -26,4 +27,4 @@ enum {
|
||||
B_SCSI_BUS_RAW_PATH_INQUIRY
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* _SCSI_BUS_RAW_DRIVER_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* File System and Drivers select support
|
||||
**
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _DRIVERS_SELECT_H
|
||||
#define _DRIVERS_SELECT_H
|
||||
|
||||
@@ -37,4 +37,4 @@ extern status_t notify_select_event(struct selectsync *sync, uint8 event);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _DRIVERS_SELECT_H */
|
||||
#endif /* _DRIVERS_SELECT_H */
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
** Copyright 2002/03, Thomas Kurschel. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
* Copyright 2002-2003, Thomas Kurschel. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _ISA2_H
|
||||
#define _ISA2_H
|
||||
|
||||
/*
|
||||
ISA bus manager
|
||||
|
||||
/*! ISA bus manager
|
||||
|
||||
This is an improper name - this bus manager uses the PnP manager to
|
||||
load device drivers, but calling it ISA PnP manager would be wrong as
|
||||
@@ -24,12 +26,11 @@
|
||||
meanwhile.
|
||||
*/
|
||||
|
||||
#ifndef _ISA2_H
|
||||
#define _ISA2_H
|
||||
|
||||
#include <device_manager.h>
|
||||
#include <ISA.h>
|
||||
|
||||
|
||||
// maximum size of one dma transfer
|
||||
// (in bytes for 8 bit transfer, in words for 16 bit transfer)
|
||||
#define B_MAX_ISA_DMA_COUNT 0x10000
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
** Copyright 2002/03, Thomas Kurschel. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
* Copyright 2002-2003, Thomas Kurschel. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef __LOCKED_POOL_H__
|
||||
#define __LOCKED_POOL_H__
|
||||
|
||||
/*
|
||||
Paging-safe allocation of locked memory.
|
||||
|
||||
/*! Paging-safe allocation of locked memory.
|
||||
|
||||
Library for managing temporary, locked memory with the condition of
|
||||
not calling any function during allocation that can lead to paging.
|
||||
@@ -28,11 +30,10 @@
|
||||
pool is allocated.
|
||||
*/
|
||||
|
||||
#ifndef __LOCKED_POOL_H__
|
||||
#define __LOCKED_POOL_H__
|
||||
|
||||
#include <device_manager.h>
|
||||
|
||||
|
||||
typedef struct locked_pool *locked_pool_cookie;
|
||||
|
||||
typedef status_t (*locked_pool_add_hook)(void *block, void *arg);
|
||||
|
||||
@@ -1,34 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// File Name: FileGameSound.h
|
||||
// Author: Christopher ML Zumwalt May ([email protected])
|
||||
// Description: BFileGameSound is a class that streams data out of a file.
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Author:
|
||||
* Christopher ML Zumwalt May ([email protected])
|
||||
*/
|
||||
#ifndef _FILEGAMESOUND_H
|
||||
#define _FILEGAMESOUND_H
|
||||
|
||||
|
||||
#include <StreamingGameSound.h>
|
||||
|
||||
|
||||
struct entry_ref;
|
||||
struct _gs_media_tracker;
|
||||
struct _gs_ramp;
|
||||
@@ -36,41 +19,78 @@ struct _gs_ramp;
|
||||
|
||||
class BFileGameSound : public BStreamingGameSound {
|
||||
public:
|
||||
BFileGameSound(const entry_ref * file,
|
||||
bool looping = true,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BFileGameSound(const char * file,
|
||||
bool looping = true,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BFileGameSound(const entry_ref* file,
|
||||
bool looping = true,
|
||||
BGameSoundDevice* device = NULL);
|
||||
BFileGameSound(const char* file,
|
||||
bool looping = true,
|
||||
BGameSoundDevice* device = NULL);
|
||||
|
||||
virtual ~BFileGameSound();
|
||||
virtual ~BFileGameSound();
|
||||
|
||||
virtual BGameSound * Clone() const;
|
||||
virtual BGameSound* Clone() const;
|
||||
|
||||
virtual status_t StartPlaying();
|
||||
virtual status_t StopPlaying();
|
||||
status_t Preload(); // if you have stopped and want to start quickly again
|
||||
virtual status_t StartPlaying();
|
||||
virtual status_t StopPlaying();
|
||||
status_t Preload();
|
||||
// if you have stopped and want to start quickly again
|
||||
|
||||
virtual void FillBuffer(void* buffer, size_t byteCount);
|
||||
virtual status_t Perform(int32 selector, void* data);
|
||||
virtual status_t SetPaused(bool isPaused, bigtime_t rampTime);
|
||||
|
||||
virtual void FillBuffer(void * inBuffer,
|
||||
size_t inByteCount);
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
virtual status_t SetPaused(bool isPaused,
|
||||
bigtime_t rampTime);
|
||||
enum {
|
||||
B_NOT_PAUSED,
|
||||
B_PAUSE_IN_PROGRESS,
|
||||
B_PAUSED
|
||||
};
|
||||
int32 IsPaused();
|
||||
int32 IsPaused();
|
||||
|
||||
private:
|
||||
_gs_media_tracker * fAudioStream;
|
||||
|
||||
BFileGameSound();
|
||||
BFileGameSound(const BFileGameSound& other);
|
||||
BFileGameSound& operator=(const BFileGameSound& other);
|
||||
// not implemented
|
||||
|
||||
status_t Init(const entry_ref* file);
|
||||
|
||||
bool Load();
|
||||
bool Read(void* buffer, size_t bytes);
|
||||
|
||||
status_t _Reserved_BFileGameSound_0(int32 arg, ...);
|
||||
// SetPaused(bool paused, bigtime_t ramp);
|
||||
virtual status_t _Reserved_BFileGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_23(int32 arg, ...);
|
||||
|
||||
private:
|
||||
_gs_media_tracker* fAudioStream;
|
||||
|
||||
bool fStopping;
|
||||
bool fLooping;
|
||||
char fReserved;
|
||||
char * fBuffer;
|
||||
|
||||
char* fBuffer;
|
||||
|
||||
size_t fFrameSize;
|
||||
size_t fBufferSize;
|
||||
size_t fPlayPosition;
|
||||
@@ -78,48 +98,13 @@ private:
|
||||
thread_id fReadThread;
|
||||
port_id fPort;
|
||||
|
||||
_gs_ramp * fPausing;
|
||||
_gs_ramp* fPausing;
|
||||
bool fPaused;
|
||||
float fPauseGain;
|
||||
|
||||
status_t Init(const entry_ref* file);
|
||||
|
||||
bool Load();
|
||||
bool Read(void * buffer, size_t bytes);
|
||||
|
||||
|
||||
/* leave these declarations private unless you plan on actually implementing and using them. */
|
||||
BFileGameSound();
|
||||
BFileGameSound(const BFileGameSound&);
|
||||
BFileGameSound& operator=(const BFileGameSound&);
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BFileGameSound_[9];
|
||||
|
||||
status_t _Reserved_BFileGameSound_0(int32 arg, ...); /* SetPaused(bool paused, bigtime_t ramp); */
|
||||
virtual status_t _Reserved_BFileGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BFileGameSound_23(int32 arg, ...);
|
||||
uint32 _reserved[9];
|
||||
};
|
||||
|
||||
|
||||
#endif // _FILEGAMESOUND_H
|
||||
|
||||
+111
-142
@@ -1,168 +1,137 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// File Name: GameSound.h
|
||||
// Author: Christopher ML Zumwalt May ([email protected])
|
||||
// Description: Base class for play sounds using the game kit
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Author:
|
||||
* Christopher ML Zumwalt May ([email protected])
|
||||
*/
|
||||
#ifndef _GAMESOUND_H
|
||||
#define _GAMESOUND_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <GameSoundDefs.h>
|
||||
|
||||
#include <new>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
class BGameSoundDevice;
|
||||
|
||||
// BGameSound class -------------------------------------------------------------
|
||||
class BGameSound
|
||||
{
|
||||
|
||||
class BGameSound {
|
||||
public:
|
||||
BGameSound(BGameSoundDevice * device = NULL);
|
||||
virtual ~BGameSound();
|
||||
BGameSound(BGameSoundDevice* device = NULL);
|
||||
virtual ~BGameSound();
|
||||
|
||||
virtual BGameSound * Clone() const = 0;
|
||||
status_t InitCheck() const;
|
||||
|
||||
// BGameSound attributes
|
||||
BGameSoundDevice * Device() const;
|
||||
gs_id ID() const;
|
||||
const gs_audio_format & Format() const; // only valid after Init()
|
||||
virtual BGameSound* Clone() const = 0;
|
||||
status_t InitCheck() const;
|
||||
|
||||
// Playing sounds
|
||||
virtual status_t StartPlaying();
|
||||
virtual bool IsPlaying();
|
||||
virtual status_t StopPlaying();
|
||||
// BGameSound attributes
|
||||
BGameSoundDevice* Device() const;
|
||||
gs_id ID() const;
|
||||
const gs_audio_format& Format() const;
|
||||
// only valid after Init()
|
||||
|
||||
|
||||
// Modifing the playback
|
||||
status_t SetGain(float gain,
|
||||
bigtime_t duration = 0); // ramp duration in seconds
|
||||
status_t SetPan(float pan,
|
||||
bigtime_t duration = 0); // ramp duration in seconds
|
||||
float Gain();
|
||||
float Pan();
|
||||
// Playing sounds
|
||||
virtual status_t StartPlaying();
|
||||
virtual bool IsPlaying();
|
||||
virtual status_t StopPlaying();
|
||||
|
||||
virtual status_t SetAttributes(gs_attribute * inAttributes,
|
||||
size_t inAttributeCount);
|
||||
virtual status_t GetAttributes(gs_attribute * outAttributes,
|
||||
size_t inAttributeCount);
|
||||
// Modifing the playback
|
||||
status_t SetGain(float gain, bigtime_t duration = 0);
|
||||
// ramp duration in seconds
|
||||
status_t SetPan(float pan, bigtime_t duration = 0);
|
||||
// ramp duration in seconds
|
||||
|
||||
void * operator new(size_t size);
|
||||
void * operator new(size_t size,
|
||||
const std::nothrow_t &) throw();
|
||||
void operator delete(void * ptr);
|
||||
#if !__MWERKS__
|
||||
// there's a bug in MWCC under R4.1 and earlier
|
||||
void operator delete(void * ptr,
|
||||
const std::nothrow_t &) throw();
|
||||
#endif
|
||||
float Gain();
|
||||
float Pan();
|
||||
|
||||
virtual status_t SetAttributes(gs_attribute* attributes,
|
||||
size_t attributeCount);
|
||||
virtual status_t GetAttributes(gs_attribute* attributes,
|
||||
size_t attributeCount);
|
||||
|
||||
void* operator new(size_t size);
|
||||
void* operator new(size_t size,
|
||||
const std::nothrow_t&) throw();
|
||||
void operator delete(void* ptr);
|
||||
void operator delete(void* ptr,
|
||||
const std::nothrow_t&) throw();
|
||||
|
||||
static status_t SetMemoryPoolSize(size_t poolSize);
|
||||
static status_t LockMemoryPool(bool lockInCore);
|
||||
static int32 SetMaxSoundCount(int32 maxCount);
|
||||
|
||||
virtual status_t Perform(int32 selector, void* data);
|
||||
|
||||
static status_t SetMemoryPoolSize(size_t in_poolSize);
|
||||
static status_t LockMemoryPool(bool in_lockInCore);
|
||||
static int32 SetMaxSoundCount(int32 in_maxCount);
|
||||
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
protected:
|
||||
status_t SetInitError(status_t initError);
|
||||
status_t Init(gs_id handle);
|
||||
|
||||
status_t SetInitError(status_t in_initError);
|
||||
status_t Init(gs_id handle);
|
||||
BGameSound(const BGameSound& other);
|
||||
BGameSound& operator=(const BGameSound& other);
|
||||
|
||||
BGameSound(const BGameSound & other);
|
||||
BGameSound & operator=(const BGameSound & other);
|
||||
|
||||
private:
|
||||
BGameSoundDevice* fDevice;
|
||||
status_t fInitError;
|
||||
BGameSound();
|
||||
// not implemented
|
||||
|
||||
virtual status_t _Reserved_BGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_23(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_24(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_25(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_26(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_27(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_28(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_29(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_30(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_31(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_32(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_33(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_34(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_35(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_36(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_37(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_38(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_39(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_40(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_41(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_42(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_43(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_44(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_45(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_46(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_47(int32 arg, ...);
|
||||
|
||||
private:
|
||||
BGameSoundDevice* fDevice;
|
||||
status_t fInitError;
|
||||
|
||||
gs_audio_format fFormat;
|
||||
gs_id fSound;
|
||||
|
||||
/* leave these declarations private unless you plan on actually implementing and using them. */
|
||||
BGameSound();
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BGameSound_[16];
|
||||
|
||||
virtual status_t _Reserved_BGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_23(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_24(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_25(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_26(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_27(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_28(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_29(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_30(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_31(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_32(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_33(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_34(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_35(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_36(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_37(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_38(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_39(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_40(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_41(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_42(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_43(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_44(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_45(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_46(int32 arg, ...);
|
||||
virtual status_t _Reserved_BGameSound_47(int32 arg, ...);
|
||||
gs_audio_format fFormat;
|
||||
gs_id fSound;
|
||||
|
||||
uint32 _reserved[16];
|
||||
};
|
||||
|
||||
|
||||
#endif // _GAME_SOUND_H
|
||||
#endif // _GAME_SOUND_H
|
||||
|
||||
@@ -1,48 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// File Name: GameSound.cpp
|
||||
// Author: Christopher ML Zumwalt May ([email protected])
|
||||
// Description: Declarations for game sounds
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if !defined(_GAME_SOUND_DEFS_H)
|
||||
/*
|
||||
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Author:
|
||||
* Christopher ML Zumwalt May ([email protected])
|
||||
*/
|
||||
#ifndef _GAME_SOUND_DEFS_H
|
||||
#define _GAME_SOUND_DEFS_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
typedef int32 gs_id;
|
||||
|
||||
#define B_GS_CUR_API_VERSION B_BEOS_VERSION
|
||||
#define B_GS_MIN_API_VERSION 0x100
|
||||
|
||||
// invalid sound handle
|
||||
// invalid sound handle
|
||||
#define B_GS_INVALID_SOUND ((gs_id)-1)
|
||||
|
||||
// gs_id for the main mix buffer
|
||||
// gs_id for the main mix buffer
|
||||
#define B_GS_MAIN_SOUND ((gs_id)-2)
|
||||
|
||||
|
||||
enum //fixme renumber to real error messages
|
||||
{
|
||||
enum {
|
||||
B_GS_BAD_HANDLE = -99999,
|
||||
B_GS_NO_SOUNDS,
|
||||
B_GS_NO_HARDWARE,
|
||||
@@ -51,45 +33,47 @@ enum //fixme renumber to real error messages
|
||||
};
|
||||
|
||||
|
||||
struct gs_audio_format
|
||||
{ /* same as media_raw_audio_format */
|
||||
enum format { /* for "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 */
|
||||
struct gs_audio_format {
|
||||
// same as media_raw_audio_format
|
||||
enum format { // for "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 */
|
||||
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
|
||||
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 {
|
||||
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
|
||||
{
|
||||
|
||||
|
||||
struct gs_attribute_info {
|
||||
int32 attribute;
|
||||
float granularity;
|
||||
float minimum;
|
||||
@@ -97,4 +81,4 @@ struct gs_attribute_info
|
||||
};
|
||||
|
||||
|
||||
#endif // _GAME_SOUND_DEFS_H
|
||||
#endif // _GAME_SOUND_DEFS_H
|
||||
|
||||
+77
-100
@@ -1,128 +1,105 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// File Name: FileGameSound.h
|
||||
// Author: Christopher ML Zumwalt May ([email protected])
|
||||
// Description: BFileGameSound is a class that streams data out of a file.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Author:
|
||||
* Christopher ML Zumwalt May ([email protected])
|
||||
*/
|
||||
#ifndef _PUSHGAMESOUND_H
|
||||
#define _PUSHGAMESOUND_H
|
||||
|
||||
|
||||
#include <StreamingGameSound.h>
|
||||
|
||||
|
||||
class BPushGameSound : public BStreamingGameSound
|
||||
{
|
||||
class BPushGameSound : public BStreamingGameSound {
|
||||
public:
|
||||
BPushGameSound(size_t inBufferFrameCount,
|
||||
const gs_audio_format * format,
|
||||
size_t inBufferCount = 2,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BPushGameSound(size_t inBufferFrameCount,
|
||||
const gs_audio_format* format,
|
||||
size_t inBufferCount = 2,
|
||||
BGameSoundDevice* device = NULL);
|
||||
|
||||
virtual ~BPushGameSound();
|
||||
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
|
||||
};
|
||||
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 ** out_pagePtr,
|
||||
size_t * out_pageSize);
|
||||
virtual status_t UnlockPage(void * in_pagePtr);
|
||||
virtual lock_status LockNextPage(void** _pagePtr,
|
||||
size_t* _pageSize);
|
||||
virtual status_t UnlockPage(void* pagePtr);
|
||||
|
||||
virtual lock_status LockForCyclic(void ** out_basePtr,
|
||||
size_t * out_size);
|
||||
virtual status_t UnlockCyclic();
|
||||
virtual size_t CurrentPosition();
|
||||
virtual lock_status LockForCyclic(void** _basePtr, size_t* _size);
|
||||
virtual status_t UnlockCyclic();
|
||||
virtual size_t CurrentPosition();
|
||||
|
||||
virtual BGameSound * Clone() const;
|
||||
virtual BGameSound* Clone() const;
|
||||
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
virtual status_t Perform(int32 selector, void* data);
|
||||
|
||||
protected:
|
||||
|
||||
BPushGameSound(BGameSoundDevice * device);
|
||||
BPushGameSound(BGameSoundDevice* device);
|
||||
|
||||
virtual status_t SetParameters(size_t inBufferFrameCount,
|
||||
const gs_audio_format * format,
|
||||
size_t inBufferCount);
|
||||
virtual status_t SetParameters(size_t bufferFrameCount,
|
||||
const gs_audio_format* format,
|
||||
size_t bufferCount);
|
||||
|
||||
virtual status_t SetStreamHook(void (*hook)(void * inCookie, void * inBuffer, size_t inByteCount, BStreamingGameSound * me),
|
||||
void * cookie);
|
||||
|
||||
virtual void FillBuffer(void * inBuffer,
|
||||
size_t inByteCount);
|
||||
virtual status_t SetStreamHook(void (*hook)(void* inCookie,
|
||||
void* buffer, size_t byteCount,
|
||||
BStreamingGameSound* me),
|
||||
void* cookie);
|
||||
|
||||
virtual void FillBuffer(void* buffer, size_t byteCount);
|
||||
|
||||
private:
|
||||
BPushGameSound();
|
||||
BPushGameSound(const BPushGameSound& other);
|
||||
BPushGameSound& operator=(const BPushGameSound& other);
|
||||
// not implemented
|
||||
|
||||
/* leave these declarations private unless you plan on actually implementing and using them. */
|
||||
BPushGameSound();
|
||||
BPushGameSound(const BPushGameSound&);
|
||||
BPushGameSound& operator=(const BPushGameSound&);
|
||||
bool BytesReady(size_t* bytes);
|
||||
|
||||
bool BytesReady(size_t * bytes);
|
||||
virtual status_t _Reserved_BPushGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_23(int32 arg, ...);
|
||||
|
||||
private:
|
||||
sem_id fLock;
|
||||
BList* fPageLocked;
|
||||
|
||||
sem_id fLock;
|
||||
BList * fPageLocked;
|
||||
size_t fLockPos;
|
||||
size_t fPlayPos;
|
||||
|
||||
size_t fLockPos;
|
||||
size_t fPlayPos;
|
||||
|
||||
char * fBuffer;
|
||||
size_t fPageSize;
|
||||
int32 fPageCount;
|
||||
size_t fBufferSize;
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BPushGameSound_[12];
|
||||
|
||||
virtual status_t _Reserved_BPushGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BPushGameSound_23(int32 arg, ...);
|
||||
char* fBuffer;
|
||||
size_t fPageSize;
|
||||
int32 fPageCount;
|
||||
size_t fBufferSize;
|
||||
|
||||
uint32 _reserved[12];
|
||||
};
|
||||
|
||||
|
||||
#endif // _PUSH_GAME_SOUND_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2008, Haiku Inc. All Rights Reserved.
|
||||
* Copyright 2001-2010, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _SIMPLEGAMESOUND_H
|
||||
@@ -15,64 +15,62 @@ struct entry_ref;
|
||||
|
||||
class BSimpleGameSound : public BGameSound {
|
||||
public:
|
||||
BSimpleGameSound(const entry_ref * inFile,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BSimpleGameSound(const char * inFile,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BSimpleGameSound(const void * inData,
|
||||
size_t inFrameCount,
|
||||
const gs_audio_format * format,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BSimpleGameSound(const BSimpleGameSound & other);
|
||||
BSimpleGameSound(const entry_ref* file,
|
||||
BGameSoundDevice* device = NULL);
|
||||
BSimpleGameSound(const char* file,
|
||||
BGameSoundDevice* device = NULL);
|
||||
BSimpleGameSound(const void* data,
|
||||
size_t frameCount,
|
||||
const gs_audio_format* format,
|
||||
BGameSoundDevice* device = NULL);
|
||||
BSimpleGameSound(const BSimpleGameSound& other);
|
||||
|
||||
virtual ~BSimpleGameSound();
|
||||
virtual ~BSimpleGameSound();
|
||||
|
||||
virtual BGameSound * Clone() const;
|
||||
virtual BGameSound* Clone() const;
|
||||
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
virtual status_t Perform(int32 selector, void* data);
|
||||
|
||||
status_t SetIsLooping(bool looping);
|
||||
bool IsLooping() const;
|
||||
status_t SetIsLooping(bool looping);
|
||||
bool IsLooping() const;
|
||||
|
||||
private:
|
||||
status_t Init(const entry_ref * inFile);
|
||||
status_t Init(const void* inData, int64 inFrameCount,
|
||||
const gs_audio_format* format);
|
||||
|
||||
/* leave these declarations private unless you plan on actually implementing and using them. */
|
||||
BSimpleGameSound();
|
||||
BSimpleGameSound& operator=(const BSimpleGameSound&);
|
||||
private:
|
||||
BSimpleGameSound();
|
||||
BSimpleGameSound& operator=(const BSimpleGameSound& other);
|
||||
// not implemented
|
||||
|
||||
/* fbc data and virtuals */
|
||||
status_t Init(const entry_ref* file);
|
||||
status_t Init(const void* data, int64 frameCount,
|
||||
const gs_audio_format* format);
|
||||
|
||||
uint32 _reserved_BSimpleGameSound_[12];
|
||||
|
||||
virtual status_t _Reserved_BSimpleGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_23(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BSimpleGameSound_23(int32 arg, ...);
|
||||
|
||||
private:
|
||||
uint32 _reserved[12];
|
||||
};
|
||||
|
||||
#endif // _SIMPLE_GAME_SOUND_H
|
||||
|
||||
#endif // _SIMPLE_GAME_SOUND_H
|
||||
|
||||
@@ -1,122 +1,91 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, OpenBeOS
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// File Name: StreamingGameSound.h
|
||||
// Author: Christopher ML Zumwalt May ([email protected])
|
||||
// Description: BStreamingGameSound is a class for all kinds of streaming
|
||||
// (data not known beforehand) game sounds.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/*
|
||||
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Author:
|
||||
* Christopher ML Zumwalt May ([email protected])
|
||||
*/
|
||||
#ifndef _STREAMINGGAMESOUND_H
|
||||
#define _STREAMINGGAMESOUND_H
|
||||
|
||||
// Standard Includes -----------------------------------------------------------
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <SupportDefs.h>
|
||||
#include <GameSound.h>
|
||||
#include <Locker.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
// Local Defines ---------------------------------------------------------------
|
||||
|
||||
// Globals ---------------------------------------------------------------------
|
||||
|
||||
class BStreamingGameSound : public BGameSound
|
||||
{
|
||||
class BStreamingGameSound : public BGameSound {
|
||||
public:
|
||||
BStreamingGameSound(size_t inBufferFrameCount,
|
||||
const gs_audio_format * format,
|
||||
size_t inBufferCount = 2,
|
||||
BGameSoundDevice * device = NULL);
|
||||
BStreamingGameSound(size_t bufferFrameCount,
|
||||
const gs_audio_format* format,
|
||||
size_t bufferCount = 2,
|
||||
BGameSoundDevice* device = NULL);
|
||||
|
||||
virtual ~BStreamingGameSound();
|
||||
virtual ~BStreamingGameSound();
|
||||
|
||||
virtual BGameSound * Clone() const;
|
||||
virtual BGameSound* Clone() const;
|
||||
|
||||
virtual status_t SetStreamHook(void (*hook)(void * inCookie, void * inBuffer, size_t inByteCount, BStreamingGameSound * me),
|
||||
void * cookie);
|
||||
virtual void FillBuffer(void * inBuffer,
|
||||
size_t inByteCount);
|
||||
virtual status_t SetStreamHook(void (*hook)(void* cookie,
|
||||
void* buffer, size_t byteCount,
|
||||
BStreamingGameSound* me),
|
||||
void* cookie);
|
||||
virtual void FillBuffer(void* buffer, size_t byteCount);
|
||||
|
||||
virtual status_t SetAttributes(gs_attribute * inAttributes,
|
||||
size_t inAttributeCount);
|
||||
virtual status_t SetAttributes(gs_attribute* attributes,
|
||||
size_t attributeCount);
|
||||
|
||||
virtual status_t Perform(int32 selector, void * data);
|
||||
virtual status_t Perform(int32 selector, void* data);
|
||||
|
||||
protected:
|
||||
BStreamingGameSound(BGameSoundDevice* device);
|
||||
|
||||
BStreamingGameSound(BGameSoundDevice * device);
|
||||
|
||||
virtual status_t SetParameters(size_t inBufferFrameCount,
|
||||
const gs_audio_format * format,
|
||||
size_t inBufferCount);
|
||||
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
virtual status_t SetParameters(size_t bufferFrameCount,
|
||||
const gs_audio_format* format,
|
||||
size_t bufferCount);
|
||||
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
|
||||
private:
|
||||
BStreamingGameSound();
|
||||
BStreamingGameSound(
|
||||
const BStreamingGameSound& other);
|
||||
BStreamingGameSound& operator=(const BStreamingGameSound& other);
|
||||
// not implemented
|
||||
|
||||
void (*fStreamHook)(void * cookie, void * buffer, size_t bytes, BStreamingGameSound * sound);
|
||||
void * fStreamCookie;
|
||||
BLocker fLock;
|
||||
virtual status_t _Reserved_BStreamingGameSound_0(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_1(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_2(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_3(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_4(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_5(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_6(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_7(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_8(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_9(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_10(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_11(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_12(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_13(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_14(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_15(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_16(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_17(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_18(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_19(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_20(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_21(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_22(int32 arg,...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_23(int32 arg,...);
|
||||
|
||||
/* leave these declarations private unless you plan on actually implementing and using them. */
|
||||
BStreamingGameSound();
|
||||
BStreamingGameSound(const BStreamingGameSound&);
|
||||
BStreamingGameSound& operator=(const BStreamingGameSound&);
|
||||
|
||||
/* fbc data and virtuals */
|
||||
|
||||
uint32 _reserved_BStreamingGameSound_[12];
|
||||
|
||||
virtual status_t _Reserved_BStreamingGameSound_0(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_1(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_2(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_3(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_4(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_5(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_6(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_7(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_8(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_9(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_10(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_11(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_12(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_13(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_14(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_15(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_16(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_17(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_18(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_19(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_20(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_21(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_22(int32 arg, ...);
|
||||
virtual status_t _Reserved_BStreamingGameSound_23(int32 arg, ...);
|
||||
private:
|
||||
void (*fStreamHook)(void* cookie, void* buffer,
|
||||
size_t bytes, BStreamingGameSound* sound);
|
||||
void* fStreamCookie;
|
||||
BLocker fLock;
|
||||
|
||||
uint32 _reserved[12];
|
||||
};
|
||||
|
||||
#endif // _STREAMING_GAME_SOUND_H
|
||||
|
||||
#endif // _STREAMING_GAME_SOUND_H
|
||||
|
||||
@@ -1,61 +1,49 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file EntryList.h
|
||||
BEntryList interface declaration.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2001-2010, Haiku Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _ENTRY_LIST_H
|
||||
#define _ENTRY_LIST_H
|
||||
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
class BEntry;
|
||||
struct entry_ref;
|
||||
|
||||
//! Interface for iterating through a list of filesystem entries
|
||||
/*! Defines a general interface for iterating through a list of entries (i.e.
|
||||
|
||||
/*! Interface for iterating through a list of filesystem entries
|
||||
Defines a general interface for iterating through a list of entries (i.e.
|
||||
files in a folder
|
||||
|
||||
@author <a href='mailto:[email protected]'>Tyler Dauwalder</a>
|
||||
@author Be Inc.
|
||||
@version 0.0.0
|
||||
*/
|
||||
class BEntryList {
|
||||
public:
|
||||
BEntryList();
|
||||
virtual ~BEntryList();
|
||||
|
||||
virtual status_t GetNextEntry(BEntry *entry, bool traverse = false) = 0;
|
||||
virtual status_t GetNextRef(entry_ref *ref) = 0;
|
||||
virtual int32 GetNextDirents(struct dirent *buf, size_t length,
|
||||
int32 count = INT_MAX) = 0;
|
||||
virtual status_t Rewind() = 0;
|
||||
virtual int32 CountEntries() = 0;
|
||||
BEntryList();
|
||||
virtual ~BEntryList();
|
||||
|
||||
virtual status_t GetNextEntry(BEntry* entry,
|
||||
bool traverse = false) = 0;
|
||||
virtual status_t GetNextRef(entry_ref* ref) = 0;
|
||||
virtual int32 GetNextDirents(struct dirent* direntBuffer,
|
||||
size_t bufferSize,
|
||||
int32 maxEntries = INT_MAX) = 0;
|
||||
virtual status_t Rewind() = 0;
|
||||
virtual int32 CountEntries() = 0;
|
||||
|
||||
private:
|
||||
virtual void _ReservedEntryList1();
|
||||
virtual void _ReservedEntryList2();
|
||||
virtual void _ReservedEntryList3();
|
||||
virtual void _ReservedEntryList4();
|
||||
virtual void _ReservedEntryList5();
|
||||
virtual void _ReservedEntryList6();
|
||||
virtual void _ReservedEntryList7();
|
||||
virtual void _ReservedEntryList8();
|
||||
|
||||
virtual void _ReservedEntryList1();
|
||||
virtual void _ReservedEntryList2();
|
||||
virtual void _ReservedEntryList3();
|
||||
virtual void _ReservedEntryList4();
|
||||
virtual void _ReservedEntryList5();
|
||||
virtual void _ReservedEntryList6();
|
||||
virtual void _ReservedEntryList7();
|
||||
virtual void _ReservedEntryList8();
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}; // namespace OpenBeOS
|
||||
#endif
|
||||
|
||||
#endif // _ENTRY_LIST_H
|
||||
|
||||
|
||||
@@ -1,88 +1,76 @@
|
||||
/*
|
||||
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _NODE_INFO_H
|
||||
#define _NODE_INFO_H
|
||||
|
||||
#ifndef _BE_BUILD_H
|
||||
#include <BeBuild.h>
|
||||
#endif
|
||||
#include <SupportDefs.h>
|
||||
#include <Mime.h>
|
||||
#include <Message.h>
|
||||
#include <File.h>
|
||||
#include <Entry.h>
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif // USE_OPENBEOS_NAMESPACE
|
||||
#include <BeBuild.h>
|
||||
#include <Entry.h>
|
||||
#include <File.h>
|
||||
#include <Message.h>
|
||||
#include <Mime.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
class BBitmap;
|
||||
class BResources;
|
||||
|
||||
|
||||
//! BNodeInfo provides file type information
|
||||
/*! BNodeInfo provides a nice wrapper to all sorts of usefull meta data.
|
||||
/*! \brief BNodeInfo provides file type information
|
||||
BNodeInfo provides a nice wrapper to all sorts of usefull meta data.
|
||||
Like it's mime type, the files icon and the application which will load
|
||||
the file.
|
||||
|
||||
\see <a href="http://www.opensource.org/licenses/mit-license.html">MIT</a>
|
||||
\author <a href='mailto:[email protected]'>Ingo Weinhold</a>
|
||||
\author <a href="mailto:[email protected]"> Michael Lloyd Lee </a>
|
||||
\author Be Inc
|
||||
\version 0
|
||||
*/
|
||||
*/
|
||||
class BNodeInfo {
|
||||
public:
|
||||
BNodeInfo();
|
||||
BNodeInfo(BNode* node);
|
||||
virtual ~BNodeInfo();
|
||||
|
||||
BNodeInfo();
|
||||
status_t SetTo(BNode* node);
|
||||
|
||||
BNodeInfo(BNode *node);
|
||||
virtual ~BNodeInfo();
|
||||
status_t InitCheck() const;
|
||||
|
||||
status_t SetTo(BNode *node);
|
||||
virtual status_t GetType(char* type) const;
|
||||
virtual status_t SetType(const char* type);
|
||||
virtual status_t GetIcon(BBitmap* icon,
|
||||
icon_size size = B_LARGE_ICON) const;
|
||||
virtual status_t SetIcon(const BBitmap* icon,
|
||||
icon_size size = B_LARGE_ICON);
|
||||
status_t GetIcon(uint8** data, size_t* size,
|
||||
type_code* type) const;
|
||||
status_t SetIcon(const uint8* data, size_t size);
|
||||
|
||||
status_t InitCheck() const;
|
||||
status_t GetPreferredApp(char* signature,
|
||||
app_verb verb = B_OPEN) const;
|
||||
status_t SetPreferredApp(const char* signature,
|
||||
app_verb verb = B_OPEN);
|
||||
status_t GetAppHint(entry_ref* ref) const;
|
||||
status_t SetAppHint(const entry_ref* ref);
|
||||
|
||||
virtual status_t GetType(char *type) const;
|
||||
virtual status_t SetType(const char *type);
|
||||
virtual status_t GetIcon(BBitmap *icon, icon_size k = B_LARGE_ICON) const;
|
||||
virtual status_t SetIcon(const BBitmap *icon, icon_size k = B_LARGE_ICON);
|
||||
status_t GetIcon(uint8** data, size_t* size, type_code* type) const;
|
||||
status_t SetIcon(const uint8* data, size_t size);
|
||||
|
||||
status_t GetPreferredApp(char *signature,
|
||||
app_verb verb = B_OPEN) const;
|
||||
status_t SetPreferredApp(const char *signature,
|
||||
app_verb verb = B_OPEN);
|
||||
status_t GetAppHint(entry_ref *ref) const;
|
||||
status_t SetAppHint(const entry_ref *ref);
|
||||
|
||||
status_t GetTrackerIcon(BBitmap *icon,
|
||||
icon_size k = B_LARGE_ICON) const;
|
||||
static status_t GetTrackerIcon(const entry_ref *ref,
|
||||
BBitmap *icon,
|
||||
icon_size k = B_LARGE_ICON);
|
||||
status_t GetTrackerIcon(BBitmap* icon,
|
||||
icon_size size = B_LARGE_ICON) const;
|
||||
static status_t GetTrackerIcon(const entry_ref* ref,
|
||||
BBitmap* icon,
|
||||
icon_size size = B_LARGE_ICON);
|
||||
private:
|
||||
friend class BAppFileInfo;
|
||||
friend class BAppFileInfo;
|
||||
|
||||
virtual void _ReservedNodeInfo1(); //< FBC
|
||||
virtual void _ReservedNodeInfo2(); //< FBC
|
||||
virtual void _ReservedNodeInfo3(); //< FBC
|
||||
virtual void _ReservedNodeInfo1();
|
||||
virtual void _ReservedNodeInfo2();
|
||||
virtual void _ReservedNodeInfo3();
|
||||
|
||||
BNodeInfo &operator=(const BNodeInfo &);
|
||||
BNodeInfo(const BNodeInfo &);
|
||||
BNodeInfo &operator=(const BNodeInfo& other);
|
||||
BNodeInfo(const BNodeInfo& other);
|
||||
// not implemented
|
||||
|
||||
BNode *fNode; //< The Node in question
|
||||
uint32 _reserved[2]; //< FBC
|
||||
status_t fCStatus; //< The status to return from InitCheck
|
||||
private:
|
||||
BNode* fNode;
|
||||
uint32 _reserved[2];
|
||||
status_t fCStatus;
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif // USE_OPENBEOS_NAMESPACE
|
||||
|
||||
#endif // _NODE_INFO_H
|
||||
|
||||
|
||||
|
||||
@@ -1,92 +1,86 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file ResourceStrings.h
|
||||
BResourceStrings interface declaration.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2001-2010, Haiku Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _RESOURCE_STRINGS_H
|
||||
#define _RESOURCE_STRINGS_H
|
||||
|
||||
|
||||
#include <Entry.h>
|
||||
#include <Locker.h>
|
||||
|
||||
|
||||
class BResources;
|
||||
class BString;
|
||||
|
||||
/*!
|
||||
\class BResourceStrings
|
||||
\brief Simple class to access the string resources in a file.
|
||||
|
||||
/*! \brief Simple class to access the string resources in a file.
|
||||
|
||||
A BResourceStrings object reads the string type resources from a given
|
||||
resource file and provides fast read only access to them.
|
||||
|
||||
\author <a href='mailto:[email protected]'>Ingo Weinhold</a>
|
||||
|
||||
\version 0.0.0
|
||||
*/
|
||||
class BResourceStrings {
|
||||
public:
|
||||
BResourceStrings();
|
||||
BResourceStrings(const entry_ref &ref);
|
||||
virtual ~BResourceStrings();
|
||||
BResourceStrings();
|
||||
BResourceStrings(const entry_ref& ref);
|
||||
virtual ~BResourceStrings();
|
||||
|
||||
status_t InitCheck();
|
||||
virtual BString *NewString(int32 id);
|
||||
virtual const char *FindString(int32 id);
|
||||
status_t InitCheck();
|
||||
virtual BString* NewString(int32 id);
|
||||
virtual const char* FindString(int32 id);
|
||||
|
||||
virtual status_t SetStringFile(const entry_ref *ref);
|
||||
status_t GetStringFile(entry_ref *outRef);
|
||||
virtual status_t SetStringFile(const entry_ref* ref);
|
||||
status_t GetStringFile(entry_ref* outRef);
|
||||
|
||||
public:
|
||||
enum {
|
||||
RESOURCE_TYPE = 'CSTR'
|
||||
};
|
||||
enum {
|
||||
RESOURCE_TYPE = 'CSTR'
|
||||
};
|
||||
|
||||
protected:
|
||||
struct _string_id_hash {
|
||||
_string_id_hash();
|
||||
~_string_id_hash();
|
||||
void assign_string(const char *str, bool makeCopy);
|
||||
_string_id_hash *next;
|
||||
int32 id;
|
||||
char *data;
|
||||
bool data_alloced;
|
||||
bool _reserved1[3];
|
||||
uint32 _reserved2;
|
||||
};
|
||||
struct _string_id_hash {
|
||||
_string_id_hash();
|
||||
~_string_id_hash();
|
||||
|
||||
void assign_string(const char* str, bool makeCopy);
|
||||
|
||||
_string_id_hash* next;
|
||||
int32 id;
|
||||
char* data;
|
||||
bool data_alloced;
|
||||
bool _reserved1[3];
|
||||
uint32 _reserved2;
|
||||
};
|
||||
|
||||
private:
|
||||
void _Cleanup();
|
||||
void _MakeEmpty();
|
||||
status_t _Rehash(int32 newSize);
|
||||
_string_id_hash* _AddString(char* str, int32 id,
|
||||
bool wasMalloced);
|
||||
|
||||
virtual _string_id_hash* _FindString(int32 id);
|
||||
|
||||
virtual status_t _Reserved_ResourceStrings_0(void*);
|
||||
virtual status_t _Reserved_ResourceStrings_1(void*);
|
||||
virtual status_t _Reserved_ResourceStrings_2(void*);
|
||||
virtual status_t _Reserved_ResourceStrings_3(void*);
|
||||
virtual status_t _Reserved_ResourceStrings_4(void*);
|
||||
virtual status_t _Reserved_ResourceStrings_5(void*);
|
||||
|
||||
protected:
|
||||
BLocker _string_lock;
|
||||
status_t _init_error;
|
||||
BLocker _string_lock;
|
||||
status_t _init_error;
|
||||
|
||||
private:
|
||||
entry_ref fFileRef;
|
||||
BResources *fResources;
|
||||
_string_id_hash **fHashTable;
|
||||
int32 fHashTableSize;
|
||||
int32 fStringCount;
|
||||
uint32 _reserved[16]; // FBC
|
||||
|
||||
private:
|
||||
void _Cleanup();
|
||||
void _MakeEmpty();
|
||||
status_t _Rehash(int32 newSize);
|
||||
_string_id_hash *_AddString(char *str, int32 id, bool wasMalloced);
|
||||
|
||||
virtual _string_id_hash *_FindString(int32 id);
|
||||
|
||||
// FBC
|
||||
virtual status_t _Reserved_ResourceStrings_0(void *);
|
||||
virtual status_t _Reserved_ResourceStrings_1(void *);
|
||||
virtual status_t _Reserved_ResourceStrings_2(void *);
|
||||
virtual status_t _Reserved_ResourceStrings_3(void *);
|
||||
virtual status_t _Reserved_ResourceStrings_4(void *);
|
||||
virtual status_t _Reserved_ResourceStrings_5(void *);
|
||||
entry_ref fFileRef;
|
||||
BResources *fResources;
|
||||
_string_id_hash **fHashTable;
|
||||
int32 fHashTableSize;
|
||||
int32 fStringCount;
|
||||
uint32 _reserved[16]; // FBC
|
||||
};
|
||||
|
||||
|
||||
#endif // _RESOURCE_STRINGS_H
|
||||
|
||||
|
||||
|
||||
@@ -1,54 +1,44 @@
|
||||
// ----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//
|
||||
// File Name: VolumeRoster.h
|
||||
//
|
||||
// Description: BVolumeRoster class
|
||||
// ----------------------------------------------------------------------
|
||||
/*!
|
||||
\file VolumeRoster.h
|
||||
BVolumeRoster interface declarations.
|
||||
*/
|
||||
/*
|
||||
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _VOLUME_ROSTER_H
|
||||
#define _VOLUME_ROSTER_H
|
||||
|
||||
|
||||
#include <Application.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <Volume.h>
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
class BVolume;
|
||||
class BMessenger;
|
||||
|
||||
|
||||
class BVolumeRoster {
|
||||
public:
|
||||
BVolumeRoster();
|
||||
virtual ~BVolumeRoster();
|
||||
BVolumeRoster();
|
||||
virtual ~BVolumeRoster();
|
||||
|
||||
status_t GetNextVolume(BVolume *volume);
|
||||
void Rewind();
|
||||
status_t GetNextVolume(BVolume* volume);
|
||||
void Rewind();
|
||||
|
||||
status_t GetBootVolume(BVolume *volume);
|
||||
status_t GetBootVolume(BVolume* volume);
|
||||
|
||||
status_t StartWatching(BMessenger messenger = be_app_messenger);
|
||||
void StopWatching();
|
||||
BMessenger Messenger() const;
|
||||
status_t StartWatching(
|
||||
BMessenger messenger = be_app_messenger);
|
||||
void StopWatching();
|
||||
BMessenger Messenger() const;
|
||||
|
||||
private:
|
||||
virtual void _SeveredVRoster1();
|
||||
virtual void _SeveredVRoster2();
|
||||
|
||||
int32 fCookie;
|
||||
BMessenger *fTarget;
|
||||
uint32 _reserved[3];
|
||||
virtual void _SeveredVRoster1();
|
||||
virtual void _SeveredVRoster2();
|
||||
|
||||
private:
|
||||
int32 fCookie;
|
||||
BMessenger* fTarget;
|
||||
uint32 _reserved[3];
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _VOLUME_ROSTER_H
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the Haiku License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef __FORK_H__
|
||||
#define __FORK_H__
|
||||
@@ -14,10 +14,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern status_t __init_fork(void);
|
||||
extern status_t __register_atfork(void( *prepare)( void), void( *parent)( void), void( *child)( void));
|
||||
extern status_t __register_atfork(void(*prepare)(void), void(*parent)(void),
|
||||
void(*child)(void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __FORK_H__ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2003, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the OpenBeOS License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _UNICODE_PROPERTIES_H_
|
||||
#define _UNICODE_PROPERTIES_H_
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Distributed under the terms of the OpenBeOS License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _NL_TYPES_H_
|
||||
#define _NL_TYPES_H_
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the OpenBeOS License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef META_FORMAT_H
|
||||
#define META_FORMAT_H
|
||||
@@ -19,7 +19,8 @@ namespace media {
|
||||
|
||||
struct meta_format {
|
||||
meta_format();
|
||||
meta_format(const media_format_description &description, const media_format &format, int32 id);
|
||||
meta_format(const media_format_description &description,
|
||||
const media_format &format, int32 id);
|
||||
meta_format(const media_format_description &description);
|
||||
meta_format(const meta_format &other);
|
||||
|
||||
@@ -32,8 +33,10 @@ struct meta_format {
|
||||
int32 id;
|
||||
};
|
||||
|
||||
typedef status_t (*_MakeFormatHookFunc)(const media_format_description *descriptions,
|
||||
int32 descriptionsCount, media_format *format, uint32 flags);
|
||||
typedef status_t (*_MakeFormatHookFunc)(
|
||||
const media_format_description *descriptions, int32 descriptionsCount,
|
||||
media_format *format, uint32 flags);
|
||||
|
||||
extern _MakeFormatHookFunc _gMakeFormatHook;
|
||||
|
||||
} // namespace media
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the OpenBeOS License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _MIME_TYPES_H
|
||||
#define _MIME_TYPES_H
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the Haiku License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _KERNEL_REAL_TIME_DATA_H
|
||||
#define _KERNEL_REAL_TIME_DATA_H
|
||||
|
||||
|
||||
#include <StorageDefs.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
@@ -15,4 +16,5 @@ struct real_time_data {
|
||||
struct arch_real_time_data arch_data;
|
||||
};
|
||||
|
||||
|
||||
#endif /* _KERNEL_REAL_TIME_DATA_H */
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
/*
|
||||
* Copyright 2004, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the Haiku License.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _SYSTEM_SYSCALL_PROCESS_INFO_H
|
||||
#define _SYSTEM_SYSCALL_PROCESS_INFO_H
|
||||
|
||||
|
||||
enum which_process_info {
|
||||
SESSION_ID = 1,
|
||||
GROUP_ID,
|
||||
PARENT_ID,
|
||||
};
|
||||
|
||||
|
||||
#endif /* _SYSTEM_SYSCALL_PROCESS_INFO_H */
|
||||
|
||||
Reference in New Issue
Block a user