2 * Copyright 2008 Alex Merry <alex.merry@kdemail.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef POLLINGWATCHER_H
18 #define POLLINGWATCHER_H
29 class PollingPlayerFactory
;
31 class PollingWatcher
: public QObject
36 PollingWatcher(QObject
* parent
= 0);
38 QList
<Player::Ptr
> players();
41 * Adds a service to watch for.
43 * @param factory the factory for the player
45 void addFactory(PollingPlayerFactory
* factory
);
49 * A new player is available
51 void newPlayer(Player::Ptr player
);
53 * A previously existing player is no longer available
55 * @param player the now-invalid player
57 void playerDisappeared(Player::Ptr player
);
63 // the factories we are waiting for player to appear on
64 QSet
<PollingPlayerFactory
*> m_polledFactories
;
65 // the factories we have a player for
66 QSet
<PollingPlayerFactory
*> m_usedFactories
;
67 QSet
<Player::Ptr
> m_players
;
71 #endif // POLLINGWATCHER_H