Move SoundConsumer to libmedia in the BPrivate namespace

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Hamish Morrison 2012-08-04 03:05:05 +01:00 committed by Jérôme Duval
parent d96e687652
commit 59b4be8cc1
8 changed files with 46 additions and 47 deletions

View File

@ -31,6 +31,8 @@
#include <BufferConsumer.h> #include <BufferConsumer.h>
#include "SoundUtils.h" #include "SoundUtils.h"
namespace BPrivate {
class SoundConsumer : public BBufferConsumer { class SoundConsumer : public BBufferConsumer {
public: public:
@ -143,5 +145,7 @@ private:
}; };
#endif // SOUND_CONSUMER_H }
#endif // SOUND_CONSUMER_H

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src apps soundrecorder ;
SetSubDirSupportedPlatformsBeOSCompatible ; SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders shared ; UsePrivateHeaders shared media ;
Application SoundRecorder : Application SoundRecorder :
DrawButton.cpp DrawButton.cpp
@ -11,9 +11,7 @@ Application SoundRecorder :
RecorderApp.cpp RecorderApp.cpp
RecorderWindow.cpp RecorderWindow.cpp
ScopeView.cpp ScopeView.cpp
SoundConsumer.cpp
SoundListView.cpp SoundListView.cpp
SoundUtils.cpp
TrackSlider.cpp TrackSlider.cpp
TransportButton.cpp TransportButton.cpp
UpDownButton.cpp UpDownButton.cpp

View File

@ -29,17 +29,25 @@
#include "VolumeSlider.h" #include "VolumeSlider.h"
#include "VUView.h" #include "VUView.h"
class BMediaRoster; class BMediaRoster;
class BBox; class BBox;
class BButton; class BButton;
class BCheckBox; class BCheckBox;
class BMenuField; class BMenuField;
class SoundConsumer;
class SoundListView; class SoundListView;
class BScrollView; class BScrollView;
class BSlider; class BSlider;
class BStringView; class BStringView;
namespace BPrivate {
class SoundConsumer;
}
using BPrivate::SoundConsumer;
class RecorderWindow : public BWindow { class RecorderWindow : public BWindow {
public: public:
RecorderWindow(); RecorderWindow();

View File

@ -1,41 +0,0 @@
/*******************************************************************************
/
/ File: SoundPrivate.h
/
/ Description: Implementation headers for SoundConsumer and SoundProducer.
/
/ Copyright 1998-1999, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
#if ! defined( _SoundPrivate_h )
#define _SoundPrivate_h
// The following are implementation details that we don't
// want to expose to the world at large.
#include "SoundUtils.h"
// This structure is the body of a request that we use to
// implement SetHooks().
struct set_hooks_q {
port_id reply;
void * cookie;
SoundProcessFunc process;
SoundNotifyFunc notify;
};
// All incoming buffers and Media Kit requests arrive at a
// media node in the form of messages (which are generally
// dispatched for you by your superclasses' HandleMessage
// implementations). Each message has a 'type' which is
// analagous to a BMessage's 'what' field. We'll define our
// own private message types for our SoundConsumer and
// SoundProducer to use. The BeOS reserves a range,
// 0x60000000 to 0x7fffffff, for us to use.
enum {
MSG_QUIT_NOW = 0x60000000L,
MSG_CHANGE_HOOKS
};
#endif /* _SoundPrivate_h */

View File

@ -16,6 +16,7 @@ if $(CHECK_MALLOC) {
SharedLibrary libmedia.so : SharedLibrary libmedia.so :
# Private Media Kit # Private Media Kit
!missing_symbols.cpp !missing_symbols.cpp
SoundConsumer.cpp
# Public Media Kit # Public Media Kit
Buffer.cpp Buffer.cpp
@ -59,6 +60,7 @@ SharedLibrary libmedia.so :
TimeSourceObject.cpp TimeSourceObject.cpp
TimeSourceObjectManager.cpp TimeSourceObjectManager.cpp
SoundPlayNode.cpp SoundPlayNode.cpp
SoundUtils.cpp
# Old (R3) Media Kit (built only for GCC2) # Old (R3) Media Kit (built only for GCC2)
OldAudioModule.cpp OldAudioModule.cpp

View File

@ -18,12 +18,14 @@
#include <TimeSource.h> #include <TimeSource.h>
#include "AutoDeleter.h" #include "AutoDeleter.h"
#include "SoundPrivate.h"
using std::nothrow; using std::nothrow;
namespace BPrivate {
// If we don't mind the format changing to another format while // If we don't mind the format changing to another format while
// running, we can define this to 1. Look for the symbol down in the source. // running, we can define this to 1. Look for the symbol down in the source.
#define ACCEPT_ANY_FORMAT_CHANGE 0 #define ACCEPT_ANY_FORMAT_CHANGE 0
@ -51,6 +53,30 @@ using std::nothrow;
#endif #endif
// This structure is the body of a request that we use to
// implement SetHooks().
struct set_hooks_q {
port_id reply;
void * cookie;
SoundProcessFunc process;
SoundNotifyFunc notify;
};
// All incoming buffers and Media Kit requests arrive at a
// media node in the form of messages (which are generally
// dispatched for you by your superclasses' HandleMessage
// implementations). Each message has a 'type' which is
// analagous to a BMessage's 'what' field. We'll define our
// own private message types for our SoundConsumer and
// SoundProducer to use. The BeOS reserves a range,
// 0x60000000 to 0x7fffffff, for us to use.
enum {
MSG_QUIT_NOW = 0x60000000L,
MSG_CHANGE_HOOKS
};
SoundConsumer::SoundConsumer( SoundConsumer::SoundConsumer(
const char * name, const char * name,
SoundProcessFunc recordFunc, SoundProcessFunc recordFunc,
@ -672,3 +698,5 @@ SoundConsumer::Notify(int32 /*cause*/, ...)
// If there is no notification hook installed, we instead call this // If there is no notification hook installed, we instead call this
// function for giving notification of various events. // function for giving notification of various events.
} }
}