summaryrefslogtreecommitdiffstats
path: root/oggvorbis_artsplugin/oggPlayObject_impl.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /oggvorbis_artsplugin/oggPlayObject_impl.h
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
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
Diffstat (limited to 'oggvorbis_artsplugin/oggPlayObject_impl.h')
-rw-r--r--oggvorbis_artsplugin/oggPlayObject_impl.h62
1 files changed, 62 insertions, 0 deletions
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 <sys/sem.h> */
+#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<float>(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