2 * SomePlayer - An alternate music player for Maemo 5
3 * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "../someplayer.h"
26 #include "../trackmetainformation.h"
27 #include "../playlist.h"
28 #include "abstractplayer.h"
29 #include <phonon/MediaObject>
30 #include <phonon/AudioOutput>
31 #include <phonon/Effect>
32 #include <phonon/Path>
38 using SomePlayer::DataObjects::Track;
39 using SomePlayer::DataObjects::TrackMetadata;
40 using SomePlayer::DataObjects::Playlist;
41 using SomePlayer::DataObjects::LastPlayed;
42 using SomePlayer::Storage::Config;
44 namespace SomePlayer {
49 void setPlaylist(QList<int>);
59 class Player : public AbstractPlayer
63 explicit Player(QObject *parent = 0);
66 virtual bool random() {return _random;}
67 virtual RepeatRule repeat() {return _repeat;}
68 virtual bool equalizerEnabled() {return _equalizer_enabled;}
69 virtual bool equalizerAvailable() {return _equalizer != NULL;}
70 virtual Track current();
71 virtual void setAwaitingSeek(int pos) {_awaiting_seek_pos = pos; _awaiting_seek = true;}
74 void setTrackId(int id);
75 void enqueue(int id); // refactor
83 void setPlaylist(Playlist);
87 void enableEqualizer();
88 void disableEqualizer();
89 void setEqualizerValue(int band, double value);
90 void equalizerValue(int band, double *);
94 PlayerState state() {return _state;}
96 QString albumart() {return _albumart;}
97 void setAlbumart(QString albumart) {_albumart = albumart;}
99 void _stateChanged(Phonon::State, Phonon::State);
102 Track _track; // current track
105 bool _equalizer_enabled;
106 QList<Track> _history;
109 Phonon::MediaObject *_player;
110 Phonon::AudioOutput *_output;
112 Phonon::Effect *_equalizer;
116 void _to_history(Track t);
117 void _truncate_history();
118 int _awaiting_seek_pos;