From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- oggvorbis_artsplugin/oggPlayObject_impl.h | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 oggvorbis_artsplugin/oggPlayObject_impl.h (limited to 'oggvorbis_artsplugin/oggPlayObject_impl.h') diff --git a/oggvorbis_artsplugin/oggPlayObject_impl.h b/oggvorbis_artsplugin/oggPlayObject_impl.h new file mode 100644 index 00000000..2f1b0c0c --- /dev/null +++ b/oggvorbis_artsplugin/oggPlayObject_impl.h @@ -0,0 +1,62 @@ +#ifndef OGGPLAYER_IMPL_H +#define OGGPLAYER_IMPL_H "$Id$" + +#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__DragonFly__) +/* union semun is defined by including */ +#else +/* according to X/OPEN we have to define it ourselves */ +union semun { + int val; /* value for SETVAL */ + struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ + unsigned short int *array; /* array for GETALL, SETALL */ + struct seminfo *__buf; /* buffer for IPC_INFO */ +}; +#endif + +int buf_pos; + +namespace Arts { + +class oggPlayObject_impl + : public oggPlayObject_skel, public StdSynthModule +{ + public: + oggPlayObject_impl(); + ~oggPlayObject_impl(); + bool loadMedia(const std::string &filename); + std::string description(); + poTime currentTime(); + poTime overallTime(); + poCapabilities capabilities(); + std::string mediaName(); + poState state(); + void play(); + void halt(); + void seek(const class poTime &t); + void pause(); + void streamInit(); + void streamStart(); + void calculateBlock(unsigned long samples); + void streamEnd(); + + protected: + + static const int BACKBUFSIZ=4096; + OggVorbis_File vf; + std::string currentFile; + + inline float conv_16le_float(short x) + { return static_cast(x) / 32768.0; } + + poState mState; + struct buf_t{ + float left[BACKBUFSIZ]; + float right[BACKBUFSIZ]; + } *shm_buf; + int shm_id, child_pid; + int buflen_sem; +}; + +}; + +#endif -- cgit v1.2.1