haiku/headers/os/media/MediaFiles.h
Axel Dörfler 7e5d04c543 Beware! The following commit will crash your system when open "Sounds"; I'll
look into this now.
* Renamed the MMediaFilesManager to MediaFilesManager.
* Got rid of its Map usage, we're using std::map now instead.
* The media_server is using an unsafe method to transfer areas from the server
  to the client. I've changed this for the BMediaFiles API to use Haiku's new
  transfer_area() function. However, this seems to cause the above mentioned
  problems.
* Improved naming and data exchange structures used for the BMediaFiles API.
* Fixed BMediaFiles leaking its lists.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-08 14:22:56 +00:00

74 lines
1.8 KiB
C++

/*
* Copyright 2009, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _MEDIA_FILES_H
#define _MEDIA_FILES_H
#include <MediaDefs.h>
#include <List.h>
#include <String.h>
struct entry_ref;
class BMediaFiles {
public:
BMediaFiles();
virtual ~BMediaFiles();
virtual status_t RewindTypes();
virtual status_t GetNextType(BString* _type);
virtual status_t RewindRefs(const char* type);
virtual status_t GetNextRef(BString* _type,
entry_ref* _ref = NULL);
virtual status_t GetRefFor(const char* type, const char* item,
entry_ref* _ref);
virtual status_t SetRefFor(const char* type, const char* item,
const entry_ref& ref);
status_t GetAudioGainFor(const char* type,
const char* item, float* _gain);
status_t SetAudioGainFor(const char* type,
const char* item, float gain);
// TODO: Rename this to "ClearRefFor" when breaking BC.
virtual status_t RemoveRefFor(const char* type,
const char* item, const entry_ref& ref);
virtual status_t RemoveItem(const char* type, const char* item);
static const char B_SOUNDS[];
// TODO: Needs Perform() for FBC reasons!
private:
// FBC padding
status_t _Reserved_MediaFiles_0(void*, ...);
virtual status_t _Reserved_MediaFiles_1(void*, ...);
virtual status_t _Reserved_MediaFiles_2(void*, ...);
virtual status_t _Reserved_MediaFiles_3(void*, ...);
virtual status_t _Reserved_MediaFiles_4(void*, ...);
virtual status_t _Reserved_MediaFiles_5(void*, ...);
virtual status_t _Reserved_MediaFiles_6(void*, ...);
virtual status_t _Reserved_MediaFiles_7(void*, ...);
void _ClearTypes();
void _ClearItems();
private:
BList fTypes;
int fTypeIndex;
BString fCurrentType;
BList fItems;
int fItemIndex;
};
#endif // _MEDIA_FILES_H