Make plasma libs build.
[amarok.git] / src / engine / helix / helix-engine.h
blob6e4ae2fa88a5a97d888a82b77a4d37801fa1a932
1 /***************************************************************************
2 * Copyright (C) 2005-2006 Paul Cifarelli <paul@cifarelli.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 ***************************************************************************/
11 #ifndef _HELIX_ENGINE_H_
12 #define _HELIX_ENGINE_H_
14 #include "enginebase.h"
15 #include <QObject>
16 //Added by qt3to4:
17 #include <Q3ValueList>
18 #include <QTimerEvent>
19 #include <sys/types.h>
20 #include <hxplayercontrol.h>
22 class QStringList;
23 struct timeval;
25 class HelixEngine : public Engine::Base, public PlayerControl
27 Q_OBJECT
29 public:
30 HelixEngine();
31 ~HelixEngine();
33 virtual bool init();
34 virtual bool canDecode( const KUrl& ) const;
35 virtual uint position() const;
36 virtual uint length() const;
37 virtual Engine::State state() const;
39 virtual void play_finished(int playerIndex);
40 virtual const Engine::Scope &scope();
42 virtual Amarok::PluginConfig *configure() const;
44 virtual void onContacting(const char *host);
45 virtual void onBuffering(int pcnt);
47 virtual int fallbackToOSS();
49 public slots:
50 virtual bool load( const KUrl &url, bool stream );
51 virtual bool play( uint = 0 );
52 virtual void stop();
53 virtual void pause();
54 virtual void unpause();
55 virtual void seek( uint );
57 virtual void setEqualizerEnabled( bool );
58 virtual void setEqualizerParameters( int preamp, const Q3ValueList<int>& );
61 protected:
62 virtual void setVolumeSW( uint );
64 private:
65 Engine::State m_state;
66 KUrl m_url;
68 QString m_coredir;
69 QString m_pluginsdir;
70 QString m_codecsdir;
71 bool m_inited;
73 int m_numPlayers;
74 int m_current; // the current player
76 bool m_isStream;
77 HelixSimplePlayer::metaData m_md;
79 int scope(int playerIndex);
80 int prune();
81 int prune(int playerIndex);
82 bool m_scopeplayerlast;
83 float m_sfps;
84 struct timeval m_scopetm;
85 unsigned long m_scopedelta;
86 int m_sframes;
87 int m_lframes;
88 struct HelixScope
90 DelayQueue *m_item;
91 unsigned long m_lasttime;
92 unsigned long m_lastpos;
93 unsigned short m_currentScope[SCOPESIZE];
94 int m_scopeindex;
95 unsigned long m_w; // more accurate position estimate for the player
96 } hscope[2];
98 typedef struct MimeEntry
100 QStringList type;
101 QStringList ext;
104 std::vector<MimeEntry> m_mimes;
106 struct FadeTrack
108 unsigned long m_startfadetime;
109 bool m_fadeactive;
110 bool m_stopfade;
111 } m_pfade[2];
113 void cleanup();
114 void timerEvent( QTimerEvent * );
115 void resetScope(int playerIndex);
117 int print2stdout(const char *fmt, ...)
118 #ifdef __GNUC__
119 __attribute__ ((format (printf, 2, 3)))
120 #endif
122 int print2stderr(const char *fmt, ...)
123 #ifdef __GNUC__
124 __attribute__ ((format (printf, 2, 3)))
125 #endif
127 void notifyUser(unsigned long code, const char *moreinfo, const char *moreinfourl);
128 void interruptUser(unsigned long code, const char *moreinfo, const char *moreinfourl);
130 friend class HelixConfigDialogBase;
134 #endif