1 /***************************************************************************
2 * Copyright (C) 2005-2006 Paul Cifarelli <paul@cifarelli.net> *
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. *
9 ***************************************************************************/
11 #ifndef _HELIX_ENGINE_H_
12 #define _HELIX_ENGINE_H_
14 #include "enginebase.h"
17 #include <Q3ValueList>
18 #include <QTimerEvent>
19 #include <sys/types.h>
20 #include <hxplayercontrol.h>
25 class HelixEngine
: public Engine::Base
, public PlayerControl
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();
50 virtual bool load( const KUrl
&url
, bool stream
);
51 virtual bool play( uint
= 0 );
54 virtual void unpause();
55 virtual void seek( uint
);
57 virtual void setEqualizerEnabled( bool );
58 virtual void setEqualizerParameters( int preamp
, const Q3ValueList
<int>& );
62 virtual void setVolumeSW( uint
);
65 Engine::State m_state
;
74 int m_current
; // the current player
77 HelixSimplePlayer::metaData m_md
;
79 int scope(int playerIndex
);
81 int prune(int playerIndex
);
82 bool m_scopeplayerlast
;
84 struct timeval m_scopetm
;
85 unsigned long m_scopedelta
;
91 unsigned long m_lasttime
;
92 unsigned long m_lastpos
;
93 unsigned short m_currentScope
[SCOPESIZE
];
95 unsigned long m_w
; // more accurate position estimate for the player
98 typedef struct MimeEntry
104 std::vector
<MimeEntry
> m_mimes
;
108 unsigned long m_startfadetime
;
114 void timerEvent( QTimerEvent
* );
115 void resetScope(int playerIndex
);
117 int print2stdout(const char *fmt
, ...)
119 __attribute__ ((format (printf
, 2, 3)))
122 int print2stderr(const char *fmt
, ...)
124 __attribute__ ((format (printf
, 2, 3)))
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
;