BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
bsepcmwriter.hh
Go to the documentation of this file.
00001  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
00002 #ifndef __BSE_PCM_WRITER_H__
00003 #define __BSE_PCM_WRITER_H__
00004 
00005 #include <bse/bseitem.hh>
00006 
00007 G_BEGIN_DECLS
00008 
00009 /* --- object type macros --- */
00010 #define BSE_TYPE_PCM_WRITER              (BSE_TYPE_ID (BsePcmWriter))
00011 #define BSE_PCM_WRITER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_PCM_WRITER, BsePcmWriter))
00012 #define BSE_PCM_WRITER_CLASS(class)      (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_PCM_WRITER, BsePcmWriterClass))
00013 #define BSE_IS_PCM_WRITER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_PCM_WRITER))
00014 #define BSE_IS_PCM_WRITER_CLASS(class)   (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_PCM_WRITER))
00015 #define BSE_PCM_WRITER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_PCM_WRITER, BsePcmWriterClass))
00016 
00017 
00018 /* --- BsePcmWriter  --- */
00019 struct BsePcmWriter : BseItem {
00020   Bse::Mutex    mutex;
00021   guint         open : 1;
00022   guint         broken : 1;
00023   gint          fd;
00024   uint64        n_bytes;
00025   uint64        recorded_maximum;
00026 };
00027 struct BsePcmWriterClass : BseItemClass
00028 {};
00029 
00030 BseErrorType    bse_pcm_writer_open             (BsePcmWriter           *pdev,
00031                                                  const gchar            *file,
00032                                                  guint                   n_channels,
00033                                                  guint                   sample_freq,
00034                                                  uint64                  recorded_maximum);
00035 void            bse_pcm_writer_close            (BsePcmWriter           *pdev);
00036 /* writing is lock protected */
00037 void            bse_pcm_writer_write            (BsePcmWriter           *pdev,
00038                                                  gsize                   n_values,
00039                                                  const gfloat           *values);
00040 
00041 
00042 #ifdef __cplusplus
00043 }
00044 #endif /* __cplusplus */
00045 
00046 #endif /* __BSE_PCM_WRITER_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines