BltCore.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 |
00003 |   BlueTune - Core API
00004 |
00005 |   (c) 2002-2006 Gilles Boccon-Gibod
00006 |   Author: Gilles Boccon-Gibod (bok@bok.net)
00007 |
00008  ****************************************************************/
00013 #ifndef _BLT_CORE_H_
00014 #define _BLT_CORE_H_
00015 
00016 /*----------------------------------------------------------------------
00017 |   includes
00018 +---------------------------------------------------------------------*/
00019 #include "Atomix.h"
00020 #include "BltDefs.h"
00021 #include "BltTypes.h"
00022 #include "BltErrors.h"
00023 #include "BltRegistry.h"
00024 #include "BltMediaPacket.h"
00025 
00026 /*----------------------------------------------------------------------
00027 |   constants
00028 +---------------------------------------------------------------------*/
00029 #define BLT_MODULE_CATEGORY_INPUT     0x01
00030 #define BLT_MODULE_CATEGORY_PARSER    0x02
00031 #define BLT_MODULE_CATEGORY_FORMATTER 0x04
00032 #define BLT_MODULE_CATEGORY_DECODER   0x08
00033 #define BLT_MODULE_CATEGORY_ENCODER   0x10
00034 #define BLT_MODULE_CATEGORY_FILTER    0x20
00035 #define BLT_MODULE_CATEGORY_OUTPUT    0x40
00036 
00037 /*----------------------------------------------------------------------
00038 |   references
00039 +---------------------------------------------------------------------*/
00040 ATX_DECLARE_INTERFACE(BLT_Stream)
00041 ATX_DECLARE_INTERFACE(BLT_Module)
00042 ATX_DECLARE_INTERFACE(BLT_MediaNode)
00043 typedef struct BLT_MediaNodeConstructor BLT_MediaNodeConstructor;
00044 
00045 /*----------------------------------------------------------------------
00046 |   BLT_Core Interface
00047 +---------------------------------------------------------------------*/
00048 ATX_DECLARE_INTERFACE(BLT_Core)
00053 ATX_BEGIN_INTERFACE_DEFINITION(BLT_Core)
00054     BLT_Result (*CreateStream)(BLT_Core* self, BLT_Stream** stream);
00055     BLT_Result (*RegisterModule)(BLT_Core* self, BLT_Module* module);
00056     BLT_Result (*UnRegisterModule)(BLT_Core* self, BLT_Module* module);
00057     BLT_Result (*EnumerateModules)(BLT_Core*      self,
00058                                    BLT_Mask       categories,
00059                                    ATX_Iterator** iterator);
00060     BLT_Result (*GetRegistry)(BLT_Core* self, BLT_Registry** registry);
00061     BLT_Result (*GetProperties)(BLT_Core* self, ATX_Properties** properties);
00062     BLT_Result (*CreateCompatibleMediaNode)(BLT_Core*                 self,
00063                                             BLT_MediaNodeConstructor* constructor,
00064                                             BLT_MediaNode**           node);
00065     BLT_Result (*CreateMediaPacket)(BLT_Core*            self, 
00066                                     BLT_Size             size, 
00067                                     const BLT_MediaType* type,
00068                                     BLT_MediaPacket**    packet);
00069 ATX_END_INTERFACE_DEFINITION
00070 
00071 /*----------------------------------------------------------------------
00072 |   convenience macros
00073 +---------------------------------------------------------------------*/
00074 #define BLT_Core_CreateStream(object, stream) \
00075 ATX_INTERFACE(object)->CreateStream(object, stream)
00076 
00077 #define BLT_Core_RegisterModule(object, module) \
00078 ATX_INTERFACE(object)->RegisterModule(object, module)
00079 
00080 #define BLT_Core_UnRegisterModule(object, module) \
00081 ATX_INTERFACE(object)->UnRegisterModule(object, module)
00082 
00083 #define BLT_Core_EnumerateModules(object, categories, iterator) \
00084 ATX_INTERFACE(object)->EnumerateModules(object, categories, iterator)
00085 
00086 #define BLT_Core_GetRegistry(object, registry) \
00087 ATX_INTERFACE(object)->GetRegistry(object, registry)
00088 
00089 #define BLT_Core_GetProperties(object, settings) \
00090 ATX_INTERFACE(object)->GetProperties(object, settings)
00091 
00092 #define BLT_Core_CreateCompatibleMediaNode(object, constructor, node) \
00093 ATX_INTERFACE(object)->CreateCompatibleMediaNode(object, constructor, node)
00094 
00095 #define BLT_Core_CreateMediaPacket(object, size, type, packet)\
00096 ATX_INTERFACE(object)->CreateMediaPacket(object, size, type, packet)
00097 
00098 #define BLT_Core_Destroy(object) ATX_DESTROY_OBJECT(object)
00099 
00100 #endif /* _BLT_CORE_H_ */