Implemented equalizer
[someplayer] / src / player / player.h
index 625aa63..50ab1f8 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * SomePlayer - An alternate music player for Maemo 5
+ * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
 #ifndef PLAYER_H
 #define PLAYER_H
 
@@ -9,6 +28,8 @@
 #include <phonon/MediaObject>
 #include <phonon/AudioOutput>
 #include <phonon/VolumeSlider>
+#include <phonon/Effect>
+#include <phonon/Path>
 #include <QStack>
 #include <QQueue>
 
@@ -34,6 +55,8 @@ namespace SomePlayer {
                        bool repeat() {return _repeat;}
                        int volume() {return (int)(_output->volume()*100 + 0.5);}
                        Phonon::MediaObject* mediaObject() {return _player;}
+                       bool equalizerEnabled() {return _equalizer_enabled;}
+                       bool equalizerAvailable() {return _equalizer != NULL;}
 
                signals:
                        void stateChanged (PlayerState);
@@ -54,6 +77,10 @@ namespace SomePlayer {
                        void toggleRepeat();
                        void seek(int);
                        void setVolume(int);
+                       void enableEqualizer();
+                       void disableEqualizer();
+                       void setEqualizerValue(int band, double value);
+                       void equalizerValue(int band, double *);
                private slots:
                        void _stateChanged(Phonon::State, Phonon::State);
                        void _tick(qint64);
@@ -62,12 +89,15 @@ namespace SomePlayer {
                        Track _track; // current track (workaround)
                        bool _random;
                        bool _repeat;
+                       bool _equalizer_enabled;
                        QStack<int> _history;
                        QQueue<int> _queue;
                        QStack<int> _prev_history;
                        Playlist _playlist;
                        Phonon::MediaObject *_player;
                        Phonon::AudioOutput *_output;
+                       Phonon::Path _path;
+                       Phonon::Effect *_equalizer;
                        PlayerState _state;
                        Config _config;